/* ─────────────────────────────────────────────────────────────
   likesort — "studio scoreboard"
   Deep charcoal board · vivid jewel-toned tier tabs · tactile tiles
   Anton (poster) + Schibsted Grotesk (text)
   ───────────────────────────────────────────────────────────── */

:root {
  --bg: #15161c;
  --bg-2: #1a1c24;
  --panel: #20222c;
  --panel-2: #2a2d39;
  --edge: rgba(255, 255, 255, 0.09);
  --edge-strong: rgba(255, 255, 255, 0.16);
  --text: #f1ede4;
  --text-dim: rgba(241, 237, 228, 0.55);
  --text-faint: rgba(241, 237, 228, 0.32);

  --brand: #ff5c6c;

  /* tier accents — jewel-toned, cohesive across the spectrum */
  --t-s: #ff5c6c;
  --t-a: #ff9f45;
  --t-b: #ffd23f;
  --t-c: #56d9a3;
  --t-d: #4aa8ff;
  --t-f: #9b8cff;

  --poster: "Anton", "Arial Narrow", sans-serif;
  --sans: "Schibsted Grotesk", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(130% 90% at 50% -20%, #20222d 0%, var(--bg) 60%);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  overflow-x: hidden;
}
body.grabbing, body.grabbing * { cursor: grabbing !important; }

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  opacity: 0.4;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.stage {
  flex: 1;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(2.2rem, 6vw, 4.5rem) clamp(1.1rem, 4vw, 2.4rem) 2rem;
  z-index: 1;
}

.view { display: none; }
.view.is-active { display: block; animation: rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ════════════════════════════ SETUP ════════════════════════ */
.hero { margin-bottom: 1.5rem; }
.wordmark {
  font-family: var(--poster);
  font-size: clamp(3.6rem, 15vw, 7.5rem);
  line-height: 0.84;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.wordmark__cut { color: var(--brand); }

.tagline {
  font-size: clamp(1.05rem, 3vw, 1.35rem);
  color: var(--text-dim);
  margin-top: 0.7rem;
  font-weight: 500;
}

.lede {
  max-width: 46ch;
  font-size: 1.05rem;
  color: var(--text-dim);
  margin: 1.6rem 0 2.2rem;
  padding-left: 1rem;
  border-left: 3px solid var(--brand);
}
.lede b { color: var(--text); font-weight: 700; }

.composer__label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: 0.6rem;
}
.composer__label span { color: var(--text-faint); font-weight: 500; }

.composer__input {
  width: 100%;
  background: var(--panel);
  border: 1.5px solid var(--edge);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  font-family: var(--sans);
  font-size: 1.02rem;
  color: var(--text);
  resize: vertical;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.composer__input::placeholder { color: var(--text-faint); }
.composer__input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(255, 92, 108, 0.16);
}

.presets {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem 0.7rem;
  margin: 1.1rem 0 0.3rem;
}
.presets__label { color: var(--text-faint); font-size: 0.9rem; font-weight: 500; }
.presets__chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }

.chip {
  font-family: var(--sans);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.34rem 0.8rem;
  background: var(--panel);
  border: 1.4px solid var(--edge);
  border-radius: 100px;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s ease;
}
.chip:hover { border-color: var(--edge-strong); color: var(--text); transform: translateY(-1px); }

.composer__foot {
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.count { color: var(--text-dim); font-size: 0.98rem; }

/* ── buttons ───────────────────────────────────────────────── */
.btn {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.92rem;
  padding: 0.68rem 1.25rem;
  border-radius: 9px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}
.btn--go {
  background: var(--brand);
  color: #1a0e10;
  box-shadow: 0 6px 0 #c23a48;
}
.btn--go:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 0 #c23a48; }
.btn--go:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 #c23a48; }
.btn--go:disabled { opacity: 0.34; cursor: not-allowed; box-shadow: none; }
.btn__arrow { display: inline-block; transition: transform 0.18s ease; }
.btn--go:hover:not(:disabled) .btn__arrow { transform: translateX(4px); }

.btn--ghost { background: var(--panel); color: var(--text-dim); border-color: var(--edge); }
.btn--ghost:hover { border-color: var(--edge-strong); color: var(--text); }
.btn.copied { background: var(--t-c); color: #06231a; border-color: var(--t-c); box-shadow: 0 6px 0 #2c9b6f; }

/* ════════════════════════════ BOARD ════════════════════════ */
.topbar {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.6rem 1.1rem;
  margin-bottom: 1.5rem;
}
.topbar__brand {
  font-family: var(--poster);
  font-size: 1.7rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.topbar__brand span { color: var(--brand); }
.topbar__hint { color: var(--text-faint); font-size: 0.9rem; }

.board { display: flex; flex-direction: column; gap: 0.55rem; }

.tier {
  display: grid;
  grid-template-columns: clamp(56px, 12vw, 72px) 1fr;
  border: 1.5px solid var(--edge);
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel);
  animation: rowin 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes rowin { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.tier__tab {
  background: var(--tier-color);
  color: #16161c;
  font-family: var(--poster);
  font-size: clamp(1.9rem, 6vw, 2.8rem);
  display: grid;
  place-items: center;
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
}

.tier__drop {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 0.5rem;
  padding: 0.6rem;
  min-height: clamp(58px, 9vw, 68px);
  background: color-mix(in srgb, var(--tier-color) 9%, var(--panel));
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.tier__drop.over {
  background: color-mix(in srgb, var(--tier-color) 22%, var(--panel));
  box-shadow: inset 0 0 0 2px var(--tier-color);
}

/* ── the bench (unranked pool) ─────────────────────────────── */
.bench {
  margin-top: 1rem;
  border: 1.5px dashed var(--edge);
  border-radius: 12px;
  background: var(--bg-2);
  padding: 0.7rem 0.8rem 0.9rem;
}
.bench__head {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  margin-bottom: 0.55rem;
}
.bench__title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-dim);
}
.bench__sub { font-size: 0.85rem; color: var(--text-faint); }

.pool {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 0.5rem;
  min-height: 52px;
}
.pool.over { box-shadow: inset 0 0 0 2px var(--brand); border-radius: 8px; }
.pool:empty::after {
  content: "✦ bench empty — everything’s ranked";
  color: var(--text-faint);
  font-style: italic;
  font-weight: 500;
  padding: 0.4rem 0.2rem;
}

/* ── draggable chips ───────────────────────────────────────── */
.chip-item {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.96rem;
  padding: 0.5rem 0.8rem;
  background: var(--panel-2);
  border: 1.4px solid var(--edge-strong);
  border-radius: 9px;
  color: var(--text);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
  animation: chipin 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.chip-item:hover { transform: translateY(-2px); border-color: var(--text-faint); }
.chip-item.dragging { opacity: 0.28; }
@keyframes chipin { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: none; } }

/* the floating tile that follows the pointer */
.chip-ghost {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  margin: 0;
  animation: none;
  transform: rotate(-3deg) scale(1.06);
  border-color: var(--brand);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.5);
}

.board__controls {
  margin-top: 1.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

/* ════════════════════════════ FOOTER ═══════════════════════ */
.footer {
  text-align: center;
  padding: 1.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  z-index: 1;
}
.footer__dot { margin: 0 0.5rem; color: var(--brand); }

/* ── responsive ────────────────────────────────────────────── */
@media (max-width: 520px) {
  .composer__foot { flex-direction: column; align-items: stretch; }
  .composer__foot .btn--go { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .chip-ghost { transform: scale(1.04); }
}
