/* ============================================================
   /game — draft setup page. Builds on home.css (tokens, footer, drawer).
   Figma: node 4018-644 + sticky states 4032-805, 4050-868.
   ============================================================ */
:root { --game-header-h: 56px; --chip-line: #002e00; }

body.game { background: #010b00; }

.game-page { display: flex; flex-direction: column; gap: 48px; }

/* ---- sticky top bar: ←  Draft  ☰ ---- */
.game-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--game-header-h);
  transition: background-color 0.3s var(--ease), backdrop-filter 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.game-header.scrolled {
  background: rgba(1, 11, 0, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(76, 154, 21, 0.14);
}
.game-header .wrap { height: 100%; display: flex; align-items: center; gap: 12px; }
.game-back {
  flex: none; width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text); background: transparent; border: none; border-radius: 10px;
  cursor: pointer; text-decoration: none; -webkit-tap-highlight-color: transparent;
}
.game-back:hover { background: rgba(230,230,230,0.08); }
.game-back svg { width: 24px; height: 24px; display: block; }
.game-title {
  flex: 1 1 auto; min-width: 0; text-align: center;
  font-family: var(--f-head); font-weight: 700; font-size: 20px; color: var(--text);
  white-space: nowrap; opacity: 0; transform: translateY(6px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
.game-header.show-title .game-title { opacity: 1; transform: none; }
/* balances the 40px back arrow so the sticky title stays centred */
.game-spacer { flex: none; width: 40px; }

/* ---- body ---- */
.game-main { display: flex; flex-direction: column; gap: 40px; padding-bottom: 8px; }
.game-heading { display: flex; flex-direction: column; }
.game-heading h1 {
  font-family: var(--f-display); font-weight: 400; font-size: clamp(40px, 13vw, 48px);
  color: var(--text); margin: 0; line-height: 1.05;
}
.game-heading p { font-family: var(--f-body); font-weight: 500; font-size: 18px; color: var(--text-2); margin: 6px 0 0; }

.setup-section { display: flex; flex-direction: column; gap: 8px; }
.section-head {
  position: sticky;
  top: var(--game-header-h);
  z-index: 30;
  background: #010b00;
  font-family: var(--f-head); font-weight: 700; font-size: 14px; line-height: 24px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 12px 0 8px;
  margin: 0;
}

/* ---- formation chips ---- */
.formation-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: var(--card);
  border: 1px solid var(--chip-line);
  border-radius: 8px;
  padding: 12px 24px;
  font-family: var(--f-body); font-weight: 500; font-size: 16px; color: var(--text);
  cursor: pointer; white-space: nowrap;
  transition: background-color 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.12s var(--ease);
}
.chip:hover { border-color: var(--mag); }
.chip:active { transform: scale(0.97); }
.chip.is-selected {
  background: rgba(207, 76, 187, 0.08); border: 2px solid var(--mag);
  color: var(--mag); font-weight: 800;
  padding: 11px 23px; /* keep size despite the thicker border */
}
.formation-desc { font-family: var(--f-body); font-weight: 500; font-size: 14px; color: var(--muted); margin: 0; min-height: 20px; }

/* ---- 16:9 pitch ---- */
.pitch-wrap { width: 100%; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; margin-top: 8px; }
.pitch-wrap svg { display: block; width: 100%; height: 100%; }

/* ---- option cards (difficulty + ratings) ---- */
.opt-cards { display: flex; gap: 8px; align-items: stretch; }
.opt-card {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  background: var(--card); border: 1px solid var(--chip-line); border-radius: 8px;
  padding: 12px 16px; cursor: pointer;
  transition: background-color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.opt-card:hover { border-color: var(--mag); }
.opt-card .ot { font-family: var(--f-body); font-weight: 500; font-size: 16px; color: var(--text); }
.opt-card .od { font-family: var(--f-body); font-weight: 400; font-size: 12px; letter-spacing: -0.24px; color: var(--text-2); margin: 0; }
.opt-card.is-selected { background: rgba(207, 76, 187, 0.08); border: 2px solid var(--mag); padding: 11px 15px; }
.opt-card.is-selected .ot { font-weight: 800; color: var(--mag); }
.opt-card.is-selected .od { color: var(--mag); }

/* ---- "Start playing" CTA ----
   Sits in the page flow as the last step, so the whole setup (formation,
   difficulty, ratings) scrolls above it instead of being covered by a
   pinned bar. */
.start-bar {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}
.start-bar .btn-start {
  width: 100%;
  background: var(--mag); border: none; color: var(--text);
  font-size: 20px; font-weight: 600;
  box-shadow: 0 8px 24px rgba(207, 76, 187, 0.34);
}
.start-bar .btn-start:hover { filter: brightness(1.06); box-shadow: 0 12px 30px rgba(207, 76, 187, 0.42); }

/* ---- desktop ---- */
@media (min-width: 600px) {
  .game-header .wrap { max-width: var(--frame); padding: 0 40px; }
}
@media (min-width: 1024px) {
  .game-heading h1 { font-size: 64px; }
  .game-heading p { font-size: 22px; }
  .section-head { font-size: 14px; }
  .chip, .opt-card .ot { font-size: 18px; }
  .opt-card .od { font-size: 13px; }
  .formation-desc { font-size: 16px; }
}
