/* =========================================================================
   Süper Lig Draft — mobile-first dark/teal sports app.
   ========================================================================= */

:root {
  --ink: #081311;
  --ink-2: #0e1c1b;
  --ink-3: #142927;
  --ink-4: #1d3a37;
  --bone: #eaf4f3;
  --dim: #93aeac;
  --faint: #5f7674;

  --accent: #2fd9e3;
  --accent-2: #19b8c2;
  --accent-deep: #0c8088;
  --gold: #ffcf5a;
  --crimson: #ff6b63;
  --green: #45c98f;

  --line: rgba(234, 244, 243, 0.08);
  --line-2: rgba(234, 244, 243, 0.16);

  --display: "Sora", system-ui, sans-serif;
  --body: "Manrope", system-ui, sans-serif;
  /* "mono" historically; now just our body font reused for uppercase accent labels,
     pills and numbers (no monospace/console look). Numbers get tabular-nums below. */
  --mono: "Manrope", system-ui, sans-serif;

  --r: 22px;
  --r-sm: 14px;
  --shadow: 0 22px 50px -26px rgba(0, 0, 0, 0.85);
  --maxw: 600px;
  --topbar-bg: rgba(8, 19, 17, 0.82);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
/* overflow-x: clip on BOTH html and body kills stray horizontal scroll (iOS treats
   <html> as the document scroll container, so clipping body alone isn't enough).
   `clip` — not `hidden` — so no scroll container is created and the sticky .topbar
   keeps working. */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  font-family: var(--body); background: var(--ink); color: var(--bone);
  min-height: 100dvh; display: flex; flex-direction: column; overflow-x: clip;
  line-height: 1.45; -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }

/* ---- atmosphere -------------------------------------------------------- */
.floods {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(70% 45% at 15% -10%, rgba(47, 217, 227, 0.18), transparent 70%),
    radial-gradient(70% 45% at 90% -6%, rgba(25, 184, 194, 0.12), transparent 72%),
    radial-gradient(120% 90% at 50% 118%, rgba(12, 128, 136, 0.12), transparent 60%);
}
.pitch-lines {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.5;
  background-image: linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 58px 58px;
  -webkit-mask-image: radial-gradient(85% 65% at 50% 25%, #000 30%, transparent 85%);
          mask-image: radial-gradient(85% 65% at 50% 25%, #000 30%, transparent 85%);
}
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0.035; mix-blend-mode: overlay;
  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.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---- topbar ------------------------------------------------------------ */
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  gap: 0.8rem; padding: 0.9rem clamp(1rem, 5vw, 1.4rem); padding-top: max(0.9rem, env(safe-area-inset-top));
  border-bottom: 1px solid var(--line); background: var(--topbar-bg); backdrop-filter: blur(12px);
}
.wordmark { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(1rem, 4.2vw, 1.25rem); letter-spacing: 0.01em; white-space: nowrap; display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.wordmark:hover { color: var(--accent); }
/* Neon-glowing logo mark replaces the old accent bar. Layered drop-shadows in
   the accent colour read as neon; a gentle pulse keeps it alive. */
.wordmark-logo {
  height: 1.7em; width: auto; display: block; flex: none;
  filter: drop-shadow(0 0 4px var(--accent)) drop-shadow(0 0 11px var(--accent));
  animation: neonPulse 2.8s ease-in-out infinite;
  transition: filter 0.2s ease, transform 0.2s ease;
}
.wordmark:hover .wordmark-logo {
  filter: drop-shadow(0 0 6px var(--accent)) drop-shadow(0 0 18px var(--accent));
  transform: scale(1.06) rotate(-2deg);
}
@keyframes neonPulse {
  0%, 100% { filter: drop-shadow(0 0 3px var(--accent)) drop-shadow(0 0 8px var(--accent)); }
  50%      { filter: drop-shadow(0 0 6px var(--accent)) drop-shadow(0 0 16px var(--accent)); }
}
@media (prefers-reduced-motion: reduce) {
  .wordmark-logo { animation: none; }
}
.wordmark .tag { font-family: var(--mono); font-size: 0.56rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); border: 1px solid var(--line-2); padding: 0.2rem 0.45rem; border-radius: 100px; }

/* staging-only "TEST" badge — hidden on prod, shown when html[data-env="test"] */
.env-badge { display: none; }
html[data-env="test"] .env-badge {
  display: inline-block; font-family: var(--mono); font-weight: 800;
  font-size: 0.72rem; letter-spacing: 0.18em; line-height: 1;
  color: #fff; background: var(--crimson); padding: 0.28rem 0.5rem;
  border-radius: 6px; box-shadow: 0 0 0 1px rgba(0,0,0,0.2), 0 2px 8px rgba(0,0,0,0.25);
}
.phase-rail { display: flex; gap: 0.25rem; }
.phase-rail span { font-family: var(--mono); font-size: 0.56rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); padding: 0.32rem 0.6rem; border-radius: 100px; border: 1px solid transparent; }
.phase-rail span.on { color: var(--ink); background: var(--accent); font-weight: 600; }
.phase-rail span.done { color: var(--dim); border-color: var(--line); }
.topbar-right { display: flex; align-items: center; gap: 0.55rem; }

/* Install-app button — a round 36px icon button, but ONLY on mobile
   (the install guide covers phone Chrome/Safari). */
.install-btn { width: 36px; height: 36px; flex: none; border-radius: 50%; border: 1px solid var(--accent); background: var(--ink-2); color: var(--accent); display: grid; place-items: center; transition: all 0.15s ease; }
.install-btn:hover { background: var(--accent); color: #05201f; transform: translateY(-1px); }
@media (min-width: 768px) { .install-btn { display: none; } }

/* Install guide modal (two tabs × three screenshots) */
.install-overlay { position: fixed; inset: 0; z-index: 9995; display: flex; align-items: flex-end; justify-content: center; padding: 0; background: rgba(4, 12, 11, 0.72); backdrop-filter: blur(4px); animation: pvpIn 0.2s ease both; }
.install-modal { width: 100%; max-width: 460px; max-height: 90vh; display: flex; flex-direction: column; border: 1px solid var(--accent); border-bottom: none; border-radius: var(--r) var(--r) 0 0; background: var(--ink); box-shadow: 0 -20px 60px -16px rgba(0, 0, 0, 0.7); animation: sheetUp 0.25s cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.install-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.1rem 0.6rem; }
.install-title { font-family: var(--display); font-weight: 800; font-size: 1.05rem; color: var(--bone); }
.install-x { width: 32px; height: 32px; flex: none; border-radius: 50%; border: 1px solid var(--line-2); background: transparent; color: var(--dim); font-size: 1.3rem; line-height: 1; display: grid; place-items: center; }
.install-x:hover { color: var(--bone); border-color: var(--accent); }
.install-tabbar { display: flex; gap: 0.4rem; padding: 0 1.1rem 0.8rem; }
.install-tab { flex: 1; padding: 0.6rem; border-radius: 100px; border: 1px solid var(--line-2); background: var(--ink-2); color: var(--dim); font-family: var(--body); font-weight: 700; font-size: 0.85rem; transition: all 0.15s ease; }
.install-tab.on { background: linear-gradient(180deg, var(--accent), var(--accent-2)); color: #05201f; border-color: transparent; }
.install-body { overflow-y: auto; padding: 0 1.1rem calc(1.1rem + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
.install-steps { display: flex; flex-direction: column; gap: 1.1rem; }
/* each step is its own card so the screenshots don't blend into one image */
.install-step { border: 1px solid var(--line-2); border-radius: 14px; padding: 0.85rem; background: var(--ink-2); }
.install-step-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.55rem; }
.install-step-num { width: 1.4rem; height: 1.4rem; flex: none; border-radius: 50%; background: var(--accent); color: #05201f; font-family: var(--mono); font-weight: 700; font-size: 0.8rem; display: grid; place-items: center; }
.install-step-cap { font-size: 0.9rem; font-weight: 600; color: var(--bone); }
.install-step-img { width: 100%; height: auto; display: block; border-radius: 10px; border: 1px solid var(--line-2); box-shadow: 0 6px 18px -8px rgba(0, 0, 0, 0.6); }
.install-note { margin: 0; padding: 0.7rem 0.85rem; border: 1px solid var(--line-2); border-left: 3px solid var(--accent); border-radius: 10px; background: var(--ink-2); color: var(--dim); font-size: 0.8rem; line-height: 1.55; }

/* ---- layout ------------------------------------------------------------ */
/* overflow-x: clip on the CONTENT WRAPPER (not just html/body). Overflow set on
   the root propagates to the viewport, and iOS Safari / PWA honour that `clip`
   propagation unreliably — so a long team name (e.g. "Kardemir Karabükspor",
   "İstanbul Başakşehir") could still leak a stray horizontal scroll there.
   Clipping on a normal element is honoured reliably; and because `clip` pairs
   with `overflow-y: visible` WITHOUT creating a scroll container, it doesn't
   break the sticky topbar, the fixed match bar, or the desktop sticky columns. */
#app { position: relative; z-index: 2; flex: 1; width: 100%; max-width: var(--maxw); margin: 0 auto; padding: clamp(1rem, 5vw, 1.6rem) clamp(1rem, 5vw, 1.4rem) 2.4rem; overflow-x: clip; }
/* z-index 1 (below #app's z-2 stacking context) so the fixed emoji FAB — a child of
   #app — paints ABOVE the footer where they overlap at the bottom, instead of the
   footer (a later sibling) covering it and stealing the taps. */
.footer { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 0.2rem; align-items: center; text-align: center; padding: 1rem 1.2rem calc(1rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); font-family: var(--mono); font-size: 0.62rem; color: var(--faint); }
.footer-note { font-style: italic; }
/* The fixed match bar owns the bottom edge — a footer there just sits behind the
   bar and steals clicks. Hide it whenever the bar is on screen (single-player
   season AND multiplayer sim). */
body[data-view="season"] .footer { display: none; }
body:has(.match-bar) .footer { display: none; }

/* Crawlable description below the app. Stays in the raw HTML (good for SEO /
   no-JS crawlers) but is only shown on the main page; hidden on every other
   view (setup/draft/season/result/rooms) so it never competes with the game. */
.seo-about { max-width: 50ch; margin: 0.5rem auto 2.4rem; padding: 0 1.2rem; text-align: center; color: var(--dim); }
.seo-about h2 { font-family: var(--display); font-size: 1.1rem; color: var(--bone); margin: 0 0 0.6rem; }
.seo-about p { font-size: 0.84rem; line-height: 1.6; margin: 0 0 0.6rem; }
.seo-about strong { color: var(--bone); }

/* ---- help / tutorial modal ----------------------------------------------- */
.help-btn { width: 36px; height: 36px; flex: none; border-radius: 50%; border: 1px solid var(--line-2); background: var(--ink-2); color: var(--bone); display: grid; place-items: center; transition: all 0.15s ease; }
.help-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
/* static in the DOM but hidden until opened (so the tutorial stays crawlable) */
.help-overlay { position: fixed; inset: 0; z-index: 9996; display: none; align-items: flex-end; justify-content: center; padding: 0; background: rgba(4, 12, 11, 0.72); backdrop-filter: blur(4px); }
.help-overlay.open { display: flex; animation: pvpIn 0.2s ease both; }
.help-modal { width: 100%; max-width: 480px; max-height: 88vh; display: flex; flex-direction: column; border: 1px solid var(--accent); border-bottom: none; border-radius: var(--r) var(--r) 0 0; background: var(--ink); box-shadow: 0 -20px 60px -16px rgba(0, 0, 0, 0.7); animation: sheetUp 0.25s cubic-bezier(0.22, 1, 0.36, 1) both; }
@media (min-width: 560px) { .help-overlay { align-items: center; } .help-modal { border-bottom: 1px solid var(--accent); border-radius: var(--r); } }
.help-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.1rem 0.6rem; }
.help-title { font-family: var(--display); font-weight: 800; font-size: 1.05rem; color: var(--bone); }
.help-x { width: 32px; height: 32px; flex: none; border-radius: 50%; border: 1px solid var(--line-2); background: transparent; color: var(--dim); font-size: 1.3rem; line-height: 1; display: grid; place-items: center; }
.help-x:hover { color: var(--bone); border-color: var(--accent); }
/* wrap to as many rows as needed so every tab is always reachable — a single
   horizontal scroller hid the last tab (SSS) off-screen with no visible scrollbar */
.help-tabbar { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0 1.1rem 0.8rem; }
.help-tab { flex: 0 0 auto; white-space: nowrap; padding: 0.55rem 0.85rem; border-radius: 100px; border: 1px solid var(--line-2); background: var(--ink-2); color: var(--dim); font-family: var(--body); font-weight: 700; font-size: 0.82rem; transition: all 0.15s ease; }
.help-tab.on { background: linear-gradient(180deg, var(--accent), var(--accent-2)); color: #05201f; border-color: transparent; }
.help-body { overflow-y: auto; padding: 0 1.2rem calc(1.2rem + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
.help-panel { font-size: 0.86rem; line-height: 1.6; color: var(--dim); }
.help-panel[hidden] { display: none; }
.help-panel h4 { font-family: var(--display); color: var(--bone); font-size: 0.92rem; margin: 0.9rem 0 0.35rem; }
.help-panel h4:first-child { margin-top: 0.2rem; }
.help-panel p { margin: 0 0 0.6rem; }
.help-panel ol, .help-panel ul { margin: 0 0 0.6rem; padding-left: 1.3rem; }
.help-panel li { margin: 0 0 0.5rem; }
.help-panel strong { color: var(--bone); }
.help-tip { margin-top: 0.8rem; padding: 0.6rem 0.75rem; border-radius: var(--r-sm); border: 1px solid var(--line-2); border-left: 3px solid var(--accent); background: var(--ink-2); font-size: 0.8rem; }
body[data-view]:not([data-view="intro"]) .seo-about { display: none; }
.footer-links { display: flex; gap: 1rem; }
.footer-links a, .footer-links a:visited { color: var(--dim); text-decoration: none; }
.footer-links a:hover { color: var(--accent); }

/* ---- inline SVG icons (Lucide) — used instead of emoji everywhere ---- */
.ic { display: inline-flex; align-items: center; justify-content: center; line-height: 0; vertical-align: -0.16em; color: inherit; flex: none; }
.ic svg { display: block; }
/* Lay a leading icon + its text out as a centred flex row so the icon is reliably
   aligned with the text (vertical-align can't centre a 20px icon against tiny caps).
   gap replaces per-icon margins. */
.field-label, .install-title { display: flex; align-items: center; gap: 0.45em; }
.eyebrow, .btn, .help-tab { display: inline-flex; align-items: center; justify-content: center; gap: 0.45em; }
.btn { width: 100%; } /* keep full-width buttons (display went from block to inline-flex) */
.mode-btn strong { display: inline-flex; align-items: center; gap: 0.35em; }
/* the leading icon scales with its (small, uppercase) label so it doesn't tower over it */
.field-label .ic svg, .eyebrow .ic svg { width: 1rem; height: 1rem; }
.field-label .ic { color: var(--accent); }
.mode-btn .ic { color: var(--accent); }
.mode-btn.sel .ic { color: inherit; }
.eyebrow { font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent); }

/* ---- buttons ----------------------------------------------------------- */
.btn { font-family: var(--body); font-weight: 800; font-size: 0.98rem; letter-spacing: 0.01em; border-radius: 100px; padding: 1rem 1.6rem; color: #05201f; background: linear-gradient(180deg, var(--accent), var(--accent-2)); box-shadow: 0 14px 30px -12px rgba(47, 217, 227, 0.5); transition: transform 0.14s ease, box-shadow 0.2s ease, opacity 0.2s; width: 100%; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 20px 40px -14px rgba(47, 217, 227, 0.6); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.4; box-shadow: none; transform: none; }
.btn--ghost { background: transparent; color: var(--bone); border: 1px solid var(--line-2); box-shadow: none; }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); box-shadow: none; }
.btn--x { background: #0f1419; color: #fff; box-shadow: none; border: 1px solid rgba(255, 255, 255, 0.18); }
.btn--x:hover { background: #20262c; box-shadow: none; }
.btn--roll { font-size: 1.15rem; letter-spacing: 0.05em; padding: 1.15rem; }
.btn--roll .dice { display: inline-block; animation: dicebob 1.6s ease-in-out infinite; }
.btn--roll:hover .dice { animation: diceroll 0.6s linear infinite; }
.btn-row { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.btn-row .btn { width: auto; flex: 1; min-width: 130px; }
.mode-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
/* selectable chip (mode on intro, season-scope on setup) — toggle .sel, don't navigate */
.mode-btn { display: flex; flex-direction: column; gap: 0.18rem; align-items: center; padding: 0.95rem 0.6rem; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--ink-3); color: var(--bone); transition: all 0.15s ease; }
.mode-btn:hover { border-color: var(--dim); }
.mode-btn strong { font-size: 1.05rem; font-weight: 800; }
.mode-btn small { font-family: var(--mono); font-size: 0.54rem; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.8; }
.mode-btn.sel { background: linear-gradient(180deg, var(--accent), var(--accent-2)); color: #05201f; border-color: var(--accent); }
.mode-btn.sel small { color: rgba(5, 32, 31, 0.72); opacity: 1; }
/* season-scope chips selected in a distinct colour so they don't read like the mode chips */
.mode-btn.scope-btn.sel { background: linear-gradient(180deg, var(--gold), #d9a72f); border-color: var(--gold); }
.mode-btn.scope-btn.sel small { color: rgba(32, 24, 5, 0.72); }

/* auto-reconnect toast (multiplayer) */
.reconnect-toast {
  position: fixed; left: 50%; bottom: 1.1rem; transform: translateX(-50%);
  z-index: 1200; background: rgba(12, 27, 28, 0.96); color: var(--bone);
  border: 1px solid var(--accent); border-radius: 999px; padding: 0.55rem 1.1rem;
  font-size: 0.85rem; font-weight: 600; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

/* ---- panels ------------------------------------------------------------ */
.panel { background: linear-gradient(180deg, var(--ink-2), var(--ink)); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.panel-pad { padding: clamp(1.1rem, 4vw, 1.5rem); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.9rem; }

/* ---- intro ------------------------------------------------------------- */
.hero { display: grid; gap: 1.4rem; padding: clamp(1rem, 5vh, 2.4rem) 0; }
.hero-art { border-radius: var(--r); padding: 1.6rem; min-height: 200px; display: flex; align-items: flex-end; position: relative; overflow: hidden; border: 1px solid var(--line-2);
  background: radial-gradient(120% 120% at 80% 10%, rgba(47, 217, 227, 0.22), transparent 55%), repeating-linear-gradient(110deg, rgba(255,255,255,0.03) 0 2px, transparent 2px 22px), linear-gradient(150deg, #0c2b2c, #071413); }
.hero-art .ball { position: absolute; top: 1.1rem; right: 1.3rem; font-size: 2.4rem; filter: drop-shadow(0 8px 14px rgba(0,0,0,.5)); animation: float 4s ease-in-out infinite; }
.hero-title { font-family: var(--display); font-weight: 800; font-size: clamp(2.5rem, 11vw, 3.6rem); line-height: 1.0; letter-spacing: -0.02em; white-space: pre-line; }
.hero-title em { font-style: normal; color: var(--accent); }
.hero-lede { color: var(--dim); font-size: 1.02rem; max-width: 42ch; }
.hero-lede b { color: var(--bone); font-weight: 700; }
.hero-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
.hero-meta div { background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0.7rem 0.4rem; text-align: center; font-family: var(--mono); font-size: 0.56rem; letter-spacing: 0.04em; color: var(--faint); text-transform: uppercase; }
.hero-meta b { display: block; font-family: var(--display); font-size: 1.4rem; color: var(--accent); margin-bottom: 0.1rem; }
.hint { font-family: var(--mono); font-size: 0.72rem; color: var(--dim); }

/* ---- setup ------------------------------------------------------------- */
/* minmax(0, 1fr) — NOT a bare 1fr/auto — forces the single column's minimum to 0
   so long content (e.g. team names) ellipsizes instead of sizing the track (and
   the whole page) wider than the viewport. Applied to every top-level grid. */
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.1rem; }
.field-label { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); margin-bottom: 0.6rem; display: flex; align-items: center; gap: 0.5rem; }
.text-input { width: 100%; background: var(--ink-3); border: 1px solid var(--line-2); color: var(--bone); border-radius: var(--r-sm); padding: 0.95rem 1rem; font-size: 1.2rem; font-weight: 700; }
.text-input:focus { outline: none; border-color: var(--accent); }
.season-select { width: 100%; background: var(--ink-3); border: 1px solid var(--line-2); color: var(--bone); border-radius: var(--r-sm); padding: 0.85rem 1rem; font-family: var(--mono); font-size: 1.05rem; font-weight: 700; cursor: pointer; -webkit-appearance: none; appearance: none; }
.season-select:focus { outline: none; border-color: var(--accent); }
.formation-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
.formation-chip { border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 0.9rem; background: var(--ink-3); display: flex; flex-direction: column; gap: 0.25rem; align-items: center; transition: all 0.15s ease; font-family: var(--mono); font-size: 1rem; font-weight: 600; }
.formation-chip small { font-size: 0.58rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
.formation-chip.sel { background: linear-gradient(180deg, var(--accent), var(--accent-2)); color: #05201f; border-color: var(--accent); }
.formation-chip.sel small { color: rgba(5, 32, 31, 0.72); }

/* club picker (kickoff) */
.club-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.55rem; }
.club-chip { display: flex; align-items: center; gap: 0.55rem; padding: 0.6rem 0.7rem; text-align: left; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--ink-2); color: var(--bone); transition: all 0.15s ease; }
.club-chip:hover { border-color: var(--dim); transform: translateY(-1px); }
.club-chip.sel { border-color: var(--accent); background: rgba(47, 217, 227, 0.1); box-shadow: inset 0 0 0 1px var(--accent); }
.club-chip .ci { min-width: 0; flex: 1; }
.club-chip .ci .cn { font-weight: 700; font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.club-chip .ci .cs { font-family: var(--mono); font-size: 0.58rem; color: var(--faint); }
.club-chip.weak .cs { color: var(--crimson); }
.club-chip .ov { font-family: var(--mono); font-size: 0.82rem; color: var(--accent); }
/* multiplayer pre-sim: a club already claimed by another player is blocked */
.club-chip.taken { opacity: 0.42; cursor: not-allowed; }
.club-chip.taken:hover { transform: none; border-color: var(--line-2); }
/* MP draft: space the spin/drawn card from the player list (and the cue) */
#mpBoardTop { display: flex; flex-direction: column; gap: 0.7rem; }
/* MP pre-sim: gap between the drafted-XI cards (mobile too — base grid) */
.reveal-squads { display: grid; gap: 1.1rem; }
/* your own squad card on the pre-sim page — accent ring + ★ on its label */
.reveal-squads .panel.mine { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent), var(--shadow); }

/* ---- multiplayer rooms ------------------------------------------------- */
.or-divider { text-align: center; font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.room-code { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; }
.room-code-big { font-family: var(--display); font-weight: 800; font-size: 2rem; letter-spacing: 0.18em; color: var(--accent); }
.room-players { display: grid; gap: 0.5rem; }
.room-player { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.7rem 0.9rem; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--ink-2); }
.room-player.me { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.room-player .rp-name { font-weight: 700; }
.room-player .rp-host { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); }
.room-player .rp-right { display: flex; align-items: center; gap: 0.5rem; }
.room-player .rp-kick { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; font-size: 1.05rem; line-height: 1; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--ink-3); color: var(--dim); cursor: pointer; transition: color 0.15s, border-color 0.15s; }
.room-player .rp-kick:hover { color: var(--crimson); border-color: var(--crimson); }
.draft-draw { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin: 0.6rem 0 0.9rem; }
.draft-draw-team { font-family: var(--display); font-weight: 800; font-size: 1.1rem; }
.room-player .rp-host.done { color: var(--green); }
.emoji-bar { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.4rem; }
.emoji-btn { font-size: 1.5rem; line-height: 1; padding: 0.4rem 0.5rem; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--ink-3); transition: transform 0.1s ease, opacity 0.2s; }
.emoji-btn:hover { transform: translateY(-2px); border-color: var(--accent); }
.emoji-btn:disabled { opacity: 0.35; }
.emoji-pop { position: fixed; bottom: 12vh; z-index: 9999; pointer-events: none; display: flex; flex-direction: column; align-items: center; gap: 0.2rem; animation: emojiPop 3s ease-out forwards; }
.emoji-pop-em { font-size: clamp(3rem, 12vw, 5rem); filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.5)); }
.emoji-pop-name { font-family: var(--mono); font-size: 0.72rem; color: var(--bone); background: rgba(0, 0, 0, 0.55); padding: 0.15rem 0.5rem; border-radius: 100px; }
@keyframes emojiPop {
  0% { opacity: 0; transform: translateY(20px) scale(0.5); }
  15% { opacity: 1; transform: translateY(0) scale(1.15); }
  30% { transform: scale(1); }
  80% { opacity: 1; transform: translateY(-40px) scale(1); }
  100% { opacity: 0; transform: translateY(-110px) scale(0.95); }
}

/* emoji tooltip on the sticky bar */

/* other player teams in the standings */
.row.rival .nm { color: var(--accent); }
.fixture.pvp { border: 1px solid rgba(47, 217, 227, 0.35); border-radius: var(--r-sm); }

/* player-vs-player match popup (slow reveal) */
.pvp-overlay { position: fixed; inset: 0; z-index: 9990; display: flex; align-items: center; justify-content: center; padding: 1.5rem; background: rgba(4, 12, 11, 0.72); backdrop-filter: blur(4px); animation: pvpIn 0.25s ease both; }
@keyframes pvpIn { from { opacity: 0; } to { opacity: 1; } }
.pvp-card { width: 100%; max-width: 460px; padding: 2rem 1.6rem; border-radius: var(--r); border: 1px solid var(--accent); background: linear-gradient(160deg, var(--ink-2), var(--ink)); text-align: center; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7); }
.pvp-tag { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent); margin-bottom: 1.2rem; }
/* Vertical stack: home / score / away. Robust to long or single-word team
   names on narrow phones (the old 3-col grid overflowed and split the score). */
.pvp-teams { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.pvp-team { font-family: var(--display); font-weight: 800; font-size: 1.3rem; line-height: 1.15; text-align: center; max-width: 100%; overflow-wrap: anywhere; transition: color 0.3s, transform 0.3s; }
.pvp-team.win { color: var(--accent); transform: scale(1.05); }
.pvp-team.lose { color: var(--faint); }
.pvp-score { font-family: var(--display); font-weight: 800; font-size: 3rem; line-height: 1; letter-spacing: 0.03em; color: var(--bone); white-space: nowrap; margin: 0.1rem 0; }
.pvp-overlay.revealed .pvp-score { animation: pvpScore 0.4s ease; }
@keyframes pvpScore { 0% { transform: scale(0.6); opacity: 0.3; } 60% { transform: scale(1.2); } 100% { transform: scale(1); opacity: 1; } }
/* weekly "Kapışmalar" card: each head-to-head is its own panel so clashes are
   clearly separated. Narrow screens STACK the clash (name / score / name) so a
   full 16-char nickname fits on one line; wider cards put the names side by side. */
.pvp-card--week { max-width: 600px; padding: 1.5rem 1.2rem; }
.pvp-card--week .pvp-tag { margin-bottom: 0.9rem; }
.pvp-weeklist { display: flex; flex-direction: column; gap: 0.5rem; }
.pvp-row { display: grid; grid-template-columns: 1fr; align-items: center; gap: 0.35rem; padding: 0.75rem 0.85rem; background: var(--ink-3); border: 1px solid var(--line-2); border-radius: var(--r-sm); text-align: center; }
.pvp-row.mine { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--ink-3)); }
/* names centered, always one line — overflow gets an ellipsis (e.g. "Fenerbah…") */
.pvp-row .pvp-team { font-size: clamp(0.92rem, 3.6vw, 1.05rem); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.pvp-row .pvp-team.win { transform: none; }
.pvp-row .pvp-score { font-size: 1.5rem; margin: 0.15rem 0; }
@media (min-width: 500px) {
  .pvp-row { grid-template-columns: 1fr auto 1fr; gap: 0.3rem 0.9rem; }
}

/* ---- badges ------------------------------------------------------------ */
.badge { display: inline-grid; place-items: center; flex: none; border-radius: 30% 30% 34% 34% / 30% 30% 42% 42%; background: linear-gradient(135deg, var(--c1) 0 50%, var(--c2) 50% 100%); color: #fff; font-family: var(--display); font-weight: 700; border: 1px solid rgba(255, 255, 255, 0.16); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); letter-spacing: -0.02em; }

/* thin two-tone kit-colour strip placed before a club name (license-safe id cue).
   inline-block + vertical-align so it never forces a flex layout on its host. */
.team-bar { display: inline-block; flex: none; width: 0.95em; height: 0.95em; border-radius: 3px; margin-right: 0.5rem; vertical-align: -0.13em; background: linear-gradient(90deg, var(--c1) 0 50%, var(--c2) 50% 100%); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25); }
/* in the match bar the right-hand team is mirrored, so flip the swatch to its right */
.match-bar-team.right .team-bar { margin-right: 0; margin-left: 0.5rem; }
/* a bigger swatch for prominent spots (the drawn club on the draft page) */
.team-bar.big { width: 1.5em; height: 1.5em; border-radius: 4px; margin-right: 0.6rem; vertical-align: -0.3em; }

/* ---- team colour chooser ---------------------------------------------- */
.color-picker { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; }
.color-pick { display: flex; align-items: center; gap: 0.4rem; font-size: 0.78rem; color: var(--dim); }
.color-pick input[type="color"] { width: 2.1rem; height: 2.1rem; padding: 0; border: 1px solid var(--line-2); border-radius: 8px; background: none; cursor: pointer; }

/* ---- draft ------------------------------------------------------------- */
.draft-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.1rem; }
.draft-right { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.1rem; }
.kadro-head { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }
/* top-left back button lives in the Kadro header — web only (see ≥900px) */
.draft-back-top { display: none; align-items: center; gap: 0.3rem; font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.04em; color: var(--dim); background: transparent; border: 1px solid var(--line-2); border-radius: 100px; padding: 0.32rem 0.7rem; transition: all 0.15s ease; }
.draft-back-top:hover { border-color: var(--accent); color: var(--accent); }
/* reserve 2 lines so holding a player (longer cue text wraps) doesn't push the
   pitch down and back — was the dominant draft-page layout shift (CLS) */
.pos-cue { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; min-height: 2.6rem; font-size: 0.82rem; color: var(--dim); margin-bottom: 0.7rem; }
.pos-cue b { color: var(--accent); }
.pos-cue button { font-family: var(--mono); font-size: 0.66rem; color: var(--faint); text-decoration: underline; }

/* dual-slot machine */
.dual-slot {
  display: grid; grid-template-columns: 1fr 0.52fr; border-radius: var(--r); overflow: hidden;
  border: 1px solid var(--line-2); background: linear-gradient(180deg, var(--ink-3), var(--ink-2));
  box-shadow: inset 0 2px 16px rgba(0,0,0,0.5); margin-bottom: 0.7rem;
}
.dual-slot.single { grid-template-columns: 1fr; }
.dual-slot.spinning .reel-cell { animation: reelblur 0.09s linear infinite; }
.reel {
  position: relative; min-height: 84px; display: grid; place-items: center; padding: 0.8rem; overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
          mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
}
.reel-team { border-right: 1px solid var(--line-2); }
.reel-year { background: rgba(47,217,227,0.05); }
.reel .windowline { position: absolute; left: 0; right: 0; height: 1px; background: var(--accent); opacity: 0.2; }
.reel .windowline.top { top: 26%; } .reel .windowline.bot { bottom: 26%; }
.reel-cell { display: flex; align-items: center; justify-content: center; width: 100%; }
.reel-cell .name { font-family: var(--display); font-weight: 800; font-size: clamp(0.95rem, 4.5vw, 1.3rem); letter-spacing: -0.01em; line-height: 1.1; text-align: center; }
.reel-cell .name.idle { color: var(--faint); font-size: 0.66rem; letter-spacing: 0.22em; text-transform: uppercase; }
.reel-cell .name.yr { color: var(--accent); font-size: clamp(1rem, 5vw, 1.5rem); }
@keyframes reelblur { 0% { transform: translateY(-14px); filter: blur(3px); opacity: 0.4; } 100% { transform: translateY(14px); filter: blur(3px); opacity: 0.4; } }

.drawn {
  display: flex; flex-direction: column; gap: 0.55rem;
  padding: 0.85rem 1rem; border-radius: var(--r); border: 1px solid var(--line-2);
  background: var(--ink-2); margin-bottom: 0.6rem;
}
.drawn-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.drawn-tag { font-family: var(--mono); font-size: 0.56rem; letter-spacing: 0.18em; color: var(--accent); text-transform: uppercase; }
/* team name and season sit on the same row, split by a vertical line (mirrors
   the spin reels' divider) */
.drawn-body { display: flex; align-items: center; gap: 0.9rem; }
.drawn-club { display: flex; align-items: center; gap: 0.5rem; flex: 1; min-width: 0; font-family: var(--display); font-weight: 800; font-size: 1.1rem; }
.drawn-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawn-year { flex: none; font-family: var(--mono); font-weight: 700; font-size: 1.2rem; color: var(--accent); white-space: nowrap; padding-left: 0.9rem; border-left: 1px solid var(--line-2); }
.reroll { width: 100%; }

.year-tag { font-family: var(--mono); font-size: 0.64rem; color: var(--accent); background: rgba(47,217,227,0.12); border-radius: 6px; padding: 0.1rem 0.4rem; margin-left: 0.25rem; vertical-align: middle; }
.list-head-club { display: flex; align-items: center; gap: 0.45rem; flex: 1; min-width: 0; }
/* long club names (uppercase + tracked) must ellipsize, never widen the page */
.list-head-club .eyebrow { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-head-club .year-tag { flex: none; }

/* scrollable player list */
.list-panel { overflow: hidden; }
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.9rem 1rem 0.6rem; }
.list-head .hint { flex: none; white-space: nowrap; }
.player-list { max-height: min(46vh, 360px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.player-row { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto 2.4rem; align-items: center; gap: 0.6rem; padding: 0.75rem 1rem; border-top: 1px solid var(--line); text-align: left; transition: background 0.12s; }
.player-row:hover { background: var(--ink-3); }
.player-row.sel { background: rgba(47, 217, 227, 0.12); box-shadow: inset 3px 0 0 var(--accent); }
.player-row.disabled { opacity: 0.4; cursor: not-allowed; }
.player-row.disabled:hover { background: none; }
.pr-name { font-weight: 700; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-pos { font-family: var(--mono); font-size: 0.62rem; color: var(--faint); text-transform: uppercase; letter-spacing: 0.04em; }
.pr-ovr { font-family: var(--mono); font-weight: 600; font-size: 1.1rem; color: var(--accent); text-align: right; }

/* responsive pitch (absolute-positioned by formation coords) */
.pitch {
  position: relative; width: 100%; aspect-ratio: 2 / 3; border-radius: var(--r); overflow: hidden;
  border: 1px solid rgba(69, 201, 143, 0.28);
  background: repeating-linear-gradient(180deg, rgba(255,255,255,0.04) 0 7%, transparent 7% 14%), linear-gradient(180deg, #0f3330, #0a201d);
}
.pitch-mark { position: absolute; border: 1px solid rgba(255, 255, 255, 0.16); pointer-events: none; }
.pitch-mark.center { left: 50%; top: 50%; width: 30%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; }
.pitch-mark.box { left: 24%; width: 52%; bottom: 0; height: 13%; border-bottom: none; border-radius: 8px 8px 0 0; }
.node { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 0.28rem; width: clamp(42px, 15%, 62px); z-index: 1; }
.node .circle { width: 100%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; border: 2px dashed rgba(255, 255, 255, 0.5); color: rgba(255, 255, 255, 0.85); background: rgba(0, 0, 0, 0.18); }
.node .role { font-family: var(--mono); font-size: clamp(0.5rem, 2.6vw, 0.64rem); letter-spacing: 0.02em; }
.node .circle b { font-family: var(--mono); font-weight: 700; font-size: clamp(0.72rem, 3.4vw, 0.98rem); }
.node.filled .circle { border-style: solid; border-color: rgba(255, 255, 255, 0.45); background: var(--bone); color: var(--ink); }
.node.gk.filled .circle { background: var(--crimson); color: #fff; border-color: rgba(255, 255, 255, 0.6); }
.node.avail .circle { border-style: solid; border-color: var(--accent); color: var(--accent); background: rgba(47, 217, 227, 0.18); cursor: pointer; animation: availpulse 1.1s ease-in-out infinite; }
.node.avail:hover .circle { background: rgba(47, 217, 227, 0.32); }
.node.dim { opacity: 0.32; }
.node .nlabel { font-size: clamp(0.5rem, 2.4vw, 0.6rem); font-weight: 700; background: rgba(8, 19, 17, 0.82); color: #eaf4f3; padding: 1px 6px; border-radius: 5px; max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes availpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(47, 217, 227, 0); } 50% { box-shadow: 0 0 0 6px rgba(47, 217, 227, 0.22); } }

/* ---- captain power-up -------------------------------------------------- */
/* before a captain is chosen, every placed player invites a tap to be crowned */
.node.cap-set .circle { cursor: pointer; box-shadow: 0 0 0 2px rgba(245, 181, 68, 0.5); }
.node.cap-set:hover .circle { box-shadow: 0 0 0 3px var(--gold, #f5b544); }
/* the captain: gold ring + a "C" armband badge + a "+5" chip */
.node.captain .circle { border-color: var(--gold, #f5b544); box-shadow: 0 0 0 2px var(--gold, #f5b544), 0 0 14px rgba(245, 181, 68, 0.45); }
/* a freshly-crowned captain (still the latest pick) can be cancelled — tappable */
.node.cap-x .circle { cursor: pointer; }
.node.cap-x:hover .circle { box-shadow: 0 0 0 2px var(--gold, #f5b544), 0 0 18px rgba(245, 181, 68, 0.6); }
.cap-badge { position: absolute; top: -6px; left: -6px; width: 1.15rem; height: 1.15rem; border-radius: 50%; display: grid; place-items: center; background: var(--gold, #f5b544); color: #1a1205; font-family: var(--display); font-weight: 800; font-size: 0.72rem; line-height: 1; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5); z-index: 2; }
.cap-plus { position: absolute; top: -7px; right: -10px; font-family: var(--mono); font-weight: 700; font-size: 0.56rem; color: #1a1205; background: var(--gold, #f5b544); border-radius: 4px; padding: 0 3px; z-index: 2; }

/* the always-on captain hint line above the draft pitch */
.cap-hint { display: flex; align-items: center; gap: 0.5rem; font-size: 0.78rem; color: var(--dim); margin-bottom: 0.6rem; line-height: 1.3; }
.cap-hint.set { color: var(--gold, #f5b544); }
.cap-hint .c-emoji { font-size: 1rem; flex: none; }
.c-emoji.ic { color: var(--gold, #f5b544); } /* captain crown icon */
.rp-name .rp-bot { color: var(--dim); margin-right: 0.15em; vertical-align: -0.18em; }
.cap-hint b { color: var(--gold, #f5b544); }

/* one-time intro callout (first draft only) */
.cap-coach { display: flex; gap: 0.7rem; align-items: flex-start; padding: 0.8rem 0.9rem; margin-bottom: 0.7rem; border-radius: var(--r-sm); border: 1px solid var(--gold, #f5b544); background: rgba(245, 181, 68, 0.1); }
.cap-coach .c-emoji { font-size: 1.4rem; flex: none; line-height: 1; }
.cap-coach .c-body { flex: 1; min-width: 0; }
.cap-coach .c-title { font-weight: 800; font-size: 0.9rem; color: var(--gold, #f5b544); margin-bottom: 0.15rem; }
.cap-coach .c-text { font-size: 0.8rem; color: var(--bone); line-height: 1.35; }
.cap-coach .c-dismiss { margin-top: 0.5rem; font-family: var(--mono); font-size: 0.68rem; color: #1a1205; background: var(--gold, #f5b544); border-radius: 6px; padding: 0.3rem 0.7rem; font-weight: 700; }

.strength-bars { display: grid; gap: 0.4rem; margin-top: 1rem; }
.sbar { display: grid; grid-template-columns: 2.6rem 1fr 1.8rem; gap: 0.6rem; align-items: center; font-family: var(--mono); font-size: 0.64rem; color: var(--dim); }
.sbar .track { height: 7px; background: var(--ink-4); border-radius: 100px; overflow: hidden; }
.sbar .fill { height: 100%; background: var(--accent); border-radius: 100px; transition: width 0.6s cubic-bezier(.4,0,.2,1); }
.sbar b { text-align: right; color: var(--accent); }
.pill { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--dim); border: 1px solid var(--line); border-radius: 100px; padding: 0.4rem 0.8rem; }
.pill b { color: var(--accent); }
.pill.win { color: var(--green); border-color: var(--green); }
.pill.lose { color: var(--crimson); border-color: var(--crimson); }

/* ---- season ------------------------------------------------------------ */
.season-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.1rem; padding-bottom: 160px; /* space for sticky bar */ }
.table-head, .row { display: grid; grid-template-columns: 1.7rem minmax(0, 1fr) 2.1rem 2.4rem 2.6rem; gap: 0.4rem; align-items: center; padding: 0.55rem 0.7rem; font-family: var(--mono); font-size: 0.8rem; }
.table-head { font-size: 0.58rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); border-bottom: 1px solid var(--line-2); }
.row { border-bottom: 1px solid var(--line); will-change: transform; }
.row .nm { font-family: var(--body); font-weight: 700; font-size: 0.86rem; display: flex; align-items: center; gap: 0.5rem; overflow: hidden; }
.row .nm span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .num { text-align: center; color: var(--dim); font-variant-numeric: tabular-nums; }
.row .pts { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.row .rank { color: var(--faint); text-align: center; }
.row.you { background: linear-gradient(90deg, rgba(47,217,227,0.16), transparent); box-shadow: inset 3px 0 0 var(--accent); border-radius: 8px; }
.row.you .nm { color: var(--accent); }
.row.ucl { box-shadow: inset 3px 0 0 var(--green); }
.row.releg { background: linear-gradient(90deg, rgba(255,107,99,0.12), transparent); }
.row.releg .rank { color: var(--crimson); }
.row.champ .rank { color: var(--gold); }
.legend { display: flex; gap: 0.9rem; flex-wrap: wrap; margin-top: 0.8rem; font-family: var(--mono); font-size: 0.6rem; color: var(--faint); }
.legend i { width: 0.75rem; height: 0.75rem; border-radius: 3px; display: inline-block; vertical-align: -1px; margin-right: 0.3rem; }
.md-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.md-no { font-family: var(--display); font-weight: 800; font-size: 2rem; }
.md-no small { font-family: var(--mono); font-size: 0.66rem; color: var(--faint); }
.progress-track { height: 7px; background: var(--ink-3); border-radius: 100px; overflow: hidden; margin: 0.8rem 0 1rem; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent-deep), var(--accent)); transition: width 0.4s ease; }
.controls { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.controls .btn { padding: 0.85rem 0.6rem; font-size: 0.82rem; }
.fixtures { display: grid; gap: 0.4rem; margin-top: 1rem; max-height: 50vh; overflow-y: auto; }
.fixture { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 0.5rem; padding: 0.5rem 0.55rem; border-radius: 12px; background: var(--ink-2); border: 1px solid var(--line); animation: rise 0.3s both; }
.fixture .side { display: flex; align-items: center; gap: 0.4rem; font-size: 0.76rem; min-width: 0; }
.fixture .side.h { justify-content: flex-end; text-align: right; }
.fixture .side .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fixture .score { font-family: var(--mono); font-weight: 600; font-size: 0.92rem; background: var(--ink-4); padding: 0.2rem 0.5rem; border-radius: 7px; }
.fixture .t.me { font-weight: 800; color: var(--bone); }
.star { color: var(--gold); font-size: 0.85em; line-height: 1; flex: none; }
.fixture.win { border-color: var(--green); }
.fixture.win .score { background: var(--green); color: #05201f; }
.fixture.lose { border-color: var(--crimson); }
.fixture.lose .score { background: var(--crimson); color: #fff; }
.fixture.draw .score { background: var(--ink-4); color: var(--bone); }

/* sticky match bar */
.match-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10;
  background: var(--ink-2); border-top: 1px solid var(--line-2);
  backdrop-filter: blur(12px);
  padding: 0.7rem clamp(1rem, 5vw, 1.4rem) calc(0.7rem + env(safe-area-inset-bottom));
}
.match-bar-inner { max-width: var(--maxw); margin: 0 auto; display: grid; gap: 0.55rem; }
.match-bar-score {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 0.5rem;
}
/* min-width: 0 lets the 1fr grid tracks shrink so a long name ellipsizes instead
   of widening the (fixed, viewport-width) bar — the bar escapes #app's clip */
.match-bar-team { min-width: 0; font-weight: 800; font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.match-bar-team.right { text-align: right; }
.match-bar-team.dim { color: var(--dim); font-weight: 600; }
/* floating emoji button on the sticky sim bar + its popup */
/* fixed emoji button on the non-sim multiplayer pages (lobby / draft / pre-sim /
   result): bottom-RIGHT. On the sim page it moves into the match bar's top-right
   corner (see .match-bar override below), opposite the centred boost cards. */
.fab-emoji { position: fixed; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom)); width: 3rem; height: 3rem; border-radius: 50%; display: grid; place-items: center; font-size: 1.4rem; background: var(--ink-3); border: 1px solid var(--line-2); box-shadow: 0 8px 22px -6px rgba(0,0,0,0.6); z-index: 40; }
.fab-emoji:hover { border-color: var(--accent); }
/* during cooldown the FAB stays usable, but the emojis inside look disabled */
.emoji-btn:disabled { opacity: 0.3; filter: grayscale(1); cursor: default; }
.fab-emoji-pop { position: fixed; right: 1rem; bottom: calc(4.6rem + env(safe-area-inset-bottom)); max-width: min(90vw, 340px); justify-content: flex-end; background: var(--ink-2); border: 1px solid var(--line-2); border-radius: var(--r); padding: 0.5rem 0.6rem; box-shadow: 0 14px 34px -10px rgba(0,0,0,0.7); z-index: 41; }
/* on the sim page the emoji button is a child of the (fixed) match bar and rides
   just above its top-right corner — so it never overlaps the team names no matter
   how tall the bar is */
.match-bar .fab-emoji { position: absolute; top: auto; left: auto; right: clamp(1rem, 5vw, 1.4rem); bottom: calc(100% + 0.55rem); width: 2.6rem; height: 2.6rem; font-size: 1.25rem; }
.match-bar .fab-emoji-pop { position: absolute; top: auto; left: auto; right: clamp(1rem, 5vw, 1.4rem); bottom: calc(100% + 3.7rem); }
/* host-only start/stop button — mirrors the emoji button on the bar's LEFT corner */
.match-bar .fab-sim { position: absolute; top: auto; right: auto; left: clamp(1rem, 5vw, 1.4rem); bottom: calc(100% + 0.55rem); width: 2.6rem; height: 2.6rem; border-radius: 50%; display: grid; place-items: center; font-size: 1.2rem; background: var(--ink-3); border: 1px solid var(--line-2); box-shadow: 0 8px 22px -6px rgba(0,0,0,0.6); z-index: 40; }
.match-bar .fab-sim:hover { border-color: var(--accent); }
.match-bar .fab-sim .fab-ic { display: block; line-height: 1; }
.match-bar .fab-sim.is-play .fab-ic { transform: translateX(2px); } /* centre the right-pointing ▶ */

/* ---- boosts: always-visible card bar (sticky), active strip, target popup, splash ---- */
/* the 3 dealt cards live inline in the bottom sticky bar (and as a pre-sim preview),
   so everyone can tap them directly — no toggle, no panel. The bar always reserves
   its height so the layout never jumps when cards are spent. */
/* shared boost badge art (the 7 hexagonal icons). Source PNGs are square, so width
   + height:auto keeps them square in any container that just sets a width. */
.boost-img { display: block; width: 100%; height: auto; object-fit: contain; }
.boost-img.is-emoji { width: auto; height: auto; display: inline-grid; place-items: center; line-height: 1; } /* emoji fallback */

.boost-bar { display: flex; gap: 0.6rem; justify-content: center; align-items: flex-start; min-height: 4.4rem; margin-top: 0.4rem; }
.boost-bar.compact { gap: 0.5rem; }
/* the badge image IS the button — no card chrome — with the name underneath */
.boost-chip { flex: 1 1 0; min-width: 0; max-width: 8rem; display: flex; flex-direction: column; align-items: center; gap: 0.2rem; padding: 0; background: none; border: none; color: var(--bone); font-weight: 600; font-size: 0.76rem; }
.boost-chip-img { position: relative; width: clamp(3.3rem, 18vw, 4.3rem); aspect-ratio: 1; }
.boost-chip-img .boost-img { filter: drop-shadow(0 4px 8px rgba(0,0,0,0.45)); transition: transform 0.12s ease; }
.boost-chip:not(.used):not(:disabled):hover .boost-img { transform: translateY(-2px) scale(1.06); }
.boost-chip:not(.used):not(:disabled):active .boost-img { transform: translateY(0) scale(1.02); }
.boost-chip:disabled { cursor: default; }
/* a spent card dims its art + name but keeps a crisp ✓ on a dark disc */
.boost-chip.used .boost-img { opacity: 0.4; }
.boost-chip.used .boost-chip-nm { opacity: 0.55; }
.boost-chip-nm { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.boost-chip-x { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.35rem; font-weight: 800; color: var(--green); }
.boost-chip-x::before { content: ""; position: absolute; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: rgba(5,15,14,0.78); box-shadow: 0 2px 6px rgba(0,0,0,0.5); }
.boost-chip-empty { flex: 1 1 0; min-height: 4.4rem; display: grid; place-items: center; color: var(--faint); }
.boost-preview { display: grid; gap: 0.2rem; }
/* active buffs/debuffs in force, shown above the score in the sticky bar */
.boost-active-host { min-height: 0; }
.boost-active { display: flex; flex-wrap: wrap; gap: 0.3rem; justify-content: center; margin-bottom: 0.35rem; }
.boost-active-chip { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.12rem 0.5rem 0.12rem 0.3rem; border-radius: 100px; font-size: 0.72rem; background: var(--ink-4); border: 1px solid var(--line-2); }
.boost-active-chip .boost-img.ic-xs { width: 1.15rem; flex: none; }
.boost-active-chip.good { border-color: rgba(69,201,143,0.5); }
.boost-active-chip.bad { border-color: rgba(255,107,99,0.5); }
.boost-active-chip b { font-weight: 700; }
.boost-active-chip small { color: var(--dim); }
.boost-active-chip { cursor: help; }
.boost-tip { position: fixed; transform: translate(-50%, -100%); z-index: 9999; max-width: 15rem; padding: 0.4rem 0.6rem; border-radius: var(--r-sm); background: rgba(12, 27, 28, 0.98); border: 1px solid var(--line-2); color: var(--bone); font-size: 0.74rem; line-height: 1.35; text-align: center; box-shadow: 0 10px 24px -8px rgba(0,0,0,0.75); pointer-events: none; }
/* boost list in the help modal + the one-time intro modal — the .boost-help-ic slot
   takes an emoji today and a logo <img> later (swap the child, keep the row). */
.boost-help-list { list-style: none; padding: 0; margin: 0.6rem 0; display: grid; gap: 0.55rem; }
.boost-help-list li { display: flex; align-items: flex-start; gap: 0.7rem; }
/* the badge art is self-framed, so the slot is just a sizing box (no bg/border) */
.boost-help-ic { flex: none; width: 2.7rem; height: 2.7rem; display: grid; place-items: center; }
.boost-help-ic.is-emoji { font-size: 1.4rem; border-radius: var(--r-sm); background: var(--ink-3); border: 1px solid var(--line-2); }
.boost-help-list em { color: var(--dim); font-style: normal; font-size: 0.78rem; }
/* one-time boost intro modal (pre-sim page) */
.boost-intro-overlay { position: fixed; inset: 0; z-index: 9995; display: flex; align-items: center; justify-content: center; padding: 1rem; background: rgba(4, 12, 12, 0.72); backdrop-filter: blur(4px); animation: pvpIn 0.2s ease both; }
.boost-intro { width: 100%; max-width: 440px; max-height: 88vh; overflow-y: auto; display: flex; flex-direction: column; gap: 0.7rem; background: var(--ink-2); border: 1px solid var(--line-2); border-top: 3px solid var(--gold); border-radius: var(--r); padding: 1.1rem 1.1rem calc(1.1rem + env(safe-area-inset-bottom)); box-shadow: var(--shadow); }
.boost-intro-h { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.boost-intro-h strong { font-family: var(--display); font-size: 1.15rem; }
.boost-intro-h strong { display: inline-flex; align-items: center; gap: 0.4em; }
.boost-x { flex: none; width: 2rem; height: 2rem; border-radius: 50%; background: var(--ink-3); border: 1px solid var(--line-2); color: var(--bone); font-size: 0.9rem; }
.boost-x:hover { border-color: var(--accent); }
/* grouped boost list (self-buffs / debuffs / defence) in the intro modal */
.boost-help-list.grouped .boost-help-group { display: block; margin: 0.55rem 0 0.05rem; font-family: var(--mono); font-size: 0.6rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); }
.boost-help-list.grouped .boost-help-group:first-child { margin-top: 0; }
/* footer: opt-out checkbox + the dismiss button */
.boost-intro-foot { display: flex; flex-direction: column; gap: 0.7rem; margin-top: 0.3rem; }
.boost-dontshow { display: flex; align-items: center; gap: 0.55rem; font-size: 0.84rem; color: var(--dim); cursor: pointer; user-select: none; }
.boost-dontshow input { width: 1.05rem; height: 1.05rem; accent-color: var(--accent); flex: none; cursor: pointer; }
/* target popup: pick which opponent a debuff hits (rides above the bar) */
.boost-target-pop { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(100% + 0.6rem); z-index: 42; width: min(90vw, 320px); display: grid; gap: 0.4rem; background: var(--ink-2); border: 1px solid var(--line-2); border-radius: var(--r); padding: 0.7rem 0.75rem; box-shadow: 0 14px 34px -10px rgba(0,0,0,0.7); }
.boost-target-h { display: flex; align-items: center; gap: 0.4rem; font-size: 0.82rem; color: var(--dim); }
.boost-target-h .boost-img.ic-sm { width: 1.5rem; flex: none; }
.boost-target { display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.7rem; border-radius: var(--r-sm); background: var(--ink-3); border: 1px solid var(--line-2); color: var(--bone); text-align: left; font-weight: 600; }
.boost-target:hover { border-color: var(--crimson); }
/* full-screen splash when a boost is played / a Shield / Mirror triggers. Sits over
   everything (but click-through) and auto-dismisses. The .boost-splash-icon slot
   takes an emoji today and a logo <img>/animation later — swap the child, keep the box. */
.boost-splash { position: fixed; inset: 0; z-index: 9998; pointer-events: none; display: grid; place-items: center; opacity: 0; transition: opacity 0.18s ease; }
.boost-splash.show { opacity: 1; }
/* no card box — just the badge art floating over the pitch, with the text under it.
   The badges are self-framed, so a backdrop would only get in the way. */
.boost-splash-card { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; text-align: center; max-width: min(86vw, 360px); padding: 0; background: none; border: none; box-shadow: none; transform: scale(0.9); transition: transform 0.22s cubic-bezier(.2,.9,.3,1.2); }
.boost-splash.show .boost-splash-card { transform: scale(1); }
.boost-splash-icon { width: clamp(8.5rem, 42vw, 12rem); display: grid; place-items: center; filter: drop-shadow(0 8px 24px rgba(0,0,0,0.65)); }
.boost-splash-icon .boost-img.is-emoji { font-size: 5.5rem; }
/* the badge floats transparent; the text gets its own card so it stays readable */
.boost-splash-text { display: flex; flex-direction: column; gap: 0.25rem; padding: 0.7rem 1.1rem; border-radius: var(--r-sm); background: rgba(8, 19, 17, 0.92); border: 1px solid var(--line-2); box-shadow: 0 16px 36px -16px rgba(0,0,0,0.8); backdrop-filter: blur(4px); }
.boost-splash-title { font-family: var(--display); font-size: 1.2rem; color: var(--bone); }
.boost-splash-title b { color: var(--gold); }
.boost-splash-card.is-shield .boost-splash-title b { color: var(--accent); }
.boost-splash-card.is-mirror .boost-splash-title b { color: #b98cff; }
.boost-splash-desc { font-size: 0.92rem; color: var(--dim); }
/* clash: incoming boost card flies in, then the defender's Kalkan/Ayna SLAMS in and
   shatters it (shield) or it ricochets back (mirror). One sequenced animation. */
.boost-clash { position: relative; width: clamp(8.5rem, 40vw, 12rem); height: clamp(6.5rem, 30vw, 9rem); display: grid; place-items: center; }
.boost-clash .clash-atk { position: absolute; width: clamp(5rem, 24vw, 7rem); filter: drop-shadow(0 3px 10px rgba(0,0,0,0.55)); }
.boost-clash .clash-atk.shatter { animation: clashIn 0.35s ease both, clashShatter 1.1s 0.55s ease-in both; }
.boost-clash .clash-atk.reflect { animation: clashIn 0.35s ease both, clashReflect 1s 0.5s cubic-bezier(.5,0,.6,1) both; }
.boost-clash .clash-def { position: absolute; width: clamp(5.5rem, 27vw, 7.6rem); opacity: 0; filter: drop-shadow(0 4px 12px rgba(0,0,0,0.6)); animation: clashSlam 1.1s 0.45s cubic-bezier(.3,1.4,.5,1) both; }
.boost-clash .clash-burst { position: absolute; font-size: clamp(2.2rem, 9vw, 3rem); opacity: 0; animation: clashBurst 0.7s 0.7s ease-out both; }
@keyframes clashIn { from { transform: translateX(-130%) rotate(-12deg); opacity: 0; } to { transform: translateX(0) rotate(0); opacity: 1; } }
@keyframes clashShatter { 0%,30% { transform: translateX(0); opacity: 1; } 42% { transform: translateX(2px) rotate(3deg); } 54% { transform: translateX(-2px) rotate(-3deg); } 100% { transform: scale(0.35) rotate(18deg) translateY(22px); opacity: 0; } }
@keyframes clashReflect { 0%,30% { transform: translateX(0) rotateY(0); opacity: 1; } 100% { transform: translateX(150%) rotateY(180deg); opacity: 0; } }
@keyframes clashSlam { 0% { transform: scale(0); opacity: 0; } 55% { transform: scale(1.35); opacity: 1; } 72% { transform: scale(0.92); } 100% { transform: scale(1); opacity: 1; } }
@keyframes clashBurst { 0% { transform: scale(0.3); opacity: 0; } 35% { transform: scale(1.3); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }
/* ---- per-boost "use" entrance animations (the splash badge) ----
   Each card animates in a way that matches what it does. Keyed by bz-<id> on the
   splash icon; fires when the splash gets .show (the node is freshly mounted). */
.boost-splash.show .boost-splash-icon .boost-img { animation: bz-pop 0.5s cubic-bezier(.2,.9,.3,1.2) both; }
@keyframes bz-pop { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: scale(1); } }

/* Momentum — arrows whoosh in from the left and overshoot forward */
.boost-splash.show .bz-momentum .boost-img { animation: bz-momentum 0.55s cubic-bezier(.2,.8,.2,1) both; }
@keyframes bz-momentum { 0% { opacity: 0; transform: translateX(-60%) skewX(-10deg); } 55% { opacity: 1; } 76% { transform: translateX(7%) skewX(2deg); } 100% { transform: translateX(0) skewX(0); } }

/* Duvar — the wall builds smoothly from the bottom up */
.boost-splash.show .bz-duvar .boost-img { animation: bz-duvar 0.45s cubic-bezier(.25,.7,.3,1) both; }
@keyframes bz-duvar { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }

/* Galaktiko — the comet-ball streaks in from far away */
.boost-splash.show .bz-galaktiko .boost-img { animation: bz-galaktiko 0.6s cubic-bezier(.2,.7,.2,1) both; }
@keyframes bz-galaktiko { 0% { opacity: 0; transform: translate(-38%, -38%) scale(0.12) rotate(-25deg); } 70% { opacity: 1; } 100% { transform: translate(0,0) scale(1) rotate(0); } }

/* Muz Kabuğu — slips and wobbles like stepping on a banana peel */
.boost-splash.show .bz-muz-kabugu .boost-img { animation: bz-muz 0.72s ease both; transform-origin: 50% 82%; }
@keyframes bz-muz { 0% { opacity: 0; transform: rotate(-15deg) translateY(-18%); } 42% { opacity: 1; transform: rotate(11deg); } 62% { transform: rotate(-7deg); } 80% { transform: rotate(4deg); } 100% { transform: rotate(0); } }

/* Yorgun Ayaklar — drops in heavy and sluggish, then settles */
.boost-splash.show .bz-yorgun-ayaklar .boost-img { animation: bz-yorgun 0.78s cubic-bezier(.3,.6,.4,1) both; transform-origin: 50% 100%; }
@keyframes bz-yorgun { 0% { opacity: 0; transform: translateY(-28%) scale(1.07); } 60% { opacity: 1; transform: translateY(6%) scale(0.96); } 82% { transform: translateY(-1%) scale(1.01); } 100% { transform: translateY(0) scale(1); } }

/* Kalkan / Ayna rarely splash (silent when armed) but cover them anyway */
.boost-splash.show .bz-kalkan .boost-img { animation: bz-kalkan 0.6s cubic-bezier(.3,1.4,.5,1) both; }
@keyframes bz-kalkan { 0% { opacity: 0; transform: scale(1.7); } 55% { opacity: 1; transform: scale(0.9); } 74% { transform: scale(1.05); } 100% { transform: scale(1); } }
.boost-splash.show .bz-ayna .boost-img { animation: bz-ayna 0.7s cubic-bezier(.3,.8,.3,1) both; }
@keyframes bz-ayna { 0% { opacity: 0; transform: rotateY(85deg) scale(0.9); } 55% { opacity: 1; transform: rotateY(-14deg); } 80% { transform: rotateY(6deg); } 100% { transform: rotateY(0) scale(1); } }

@media (prefers-reduced-motion: reduce) { .boost-splash.show .boost-splash-icon .boost-img { animation-duration: 0.01ms !important; } }

.match-score-pill {
  font-family: var(--mono); font-weight: 700; font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
  background: var(--ink-4); color: var(--bone);
  border-radius: 100px; padding: 0.3rem 0.9rem; text-align: center;
  min-width: 4rem;
}
.match-score-pill.win { background: var(--green); color: #05201f; }
.match-score-pill.lose { background: var(--crimson); color: #fff; }
.match-score-pill.draw { background: var(--ink-4); color: var(--bone); }

/* ---- result ------------------------------------------------------------ */
.result-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.2rem; }
.verdict { position: relative; overflow: hidden; border-radius: var(--r); padding: clamp(1.6rem, 7vw, 2.6rem); border: 1px solid var(--line-2); background: linear-gradient(160deg, var(--ink-2), var(--ink)); text-align: center; }
.verdict.win { border-color: var(--gold); }
.verdict.win::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(80% 60% at 50% 0%, rgba(255,207,90,0.22), transparent 70%); }
.verdict .crown { font-family: var(--mono); letter-spacing: 0.26em; text-transform: uppercase; font-size: 0.66rem; color: var(--gold); }
.verdict.lose .crown { color: var(--accent); }
.verdict .big { font-family: var(--display); font-weight: 800; font-size: clamp(2.6rem, 14vw, 4.4rem); line-height: 0.9; margin: 0.5rem 0; letter-spacing: -0.02em; }
.verdict .big em { font-style: normal; color: var(--gold); }
.verdict .sub { color: var(--dim); font-size: 1rem; }
.verdict .shine { position: absolute; top: 0; bottom: 0; width: 40%; left: -50%; background: linear-gradient(105deg, transparent, rgba(255,255,255,0.12), transparent); animation: sweep 3.5s ease-in-out infinite; pointer-events: none; }
/* 2×2 on phones so a wide value like "12-10-12" fits on one line; 4-across on
   wider screens. nowrap stops any value from breaking mid-number. */
.statline { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.6rem; margin-top: 1.5rem; }
.statline .s { background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0.7rem 0.3rem; }
.statline .s b { display: block; font-family: var(--display); font-weight: 800; font-size: 1.5rem; color: var(--accent); white-space: nowrap; }
.statline .s span { font-family: var(--mono); font-size: 0.54rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
@media (min-width: 560px) { .statline { grid-template-columns: repeat(4, 1fr); } }

/* ---- animations -------------------------------------------------------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(0.82); } to { opacity: 1; transform: none; } }
@keyframes sweep { 0% { left: -50%; } 55%, 100% { left: 130%; } }
@keyframes float { 0%,100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-10px) rotate(6deg); } }
@keyframes dicebob { 0%,100% { transform: translateY(0) rotate(-10deg); } 50% { transform: translateY(-3px) rotate(10deg); } }
@keyframes diceroll { from { transform: rotate(0); } to { transform: rotate(360deg); } }

.reveal > * { animation: rise 0.5s both; }
.reveal > *:nth-child(1) { animation-delay: 0.04s; }
.reveal > *:nth-child(2) { animation-delay: 0.1s; }
.reveal > *:nth-child(3) { animation-delay: 0.16s; }
.reveal > *:nth-child(4) { animation-delay: 0.22s; }
.reveal > *:nth-child(5) { animation-delay: 0.28s; }

@media (min-width: 720px) {
  :root { --maxw: 680px; }
  /* web: single-column flows (intro/setup/kickoff/lobby) read better narrow */
  .stack { max-width: 600px; margin-inline: auto; }
  /* web: the pitch was a full-column giant — keep the match field a sensible size */
  .pitch { max-width: 340px; margin-inline: auto; }
  /* multiplayer pre-sim is wider and lays the drafted XIs + club buttons out as a grid */
  .mp-reveal { max-width: 880px; }
  .reveal-squads { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.1rem; align-items: start; }
  .mp-reveal .club-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
}

/* ---- Drafted XI on result page ----------------------------------------- */
.drafted-xi { display: grid; gap: 0; }
.drafted-row {
  display: grid; grid-template-columns: 2.8rem minmax(0, 1fr) auto;
  align-items: center; gap: 0.5rem;
  padding: 0.55rem 0.2rem; border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
}
.drafted-row:last-child { border-bottom: none; }
.dr-pos { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--faint); }
.dr-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dr-right { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }
.dr-club { font-family: var(--mono); font-size: 0.62rem; color: var(--dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 110px; }
.dr-ovr { font-family: var(--mono); font-weight: 700; font-size: 0.95rem; color: var(--accent); }

/* ---- Desktop two-column layouts (≥ 900px) ------------------------------ */
@media (min-width: 900px) {
  :root { --maxw: 1120px; }

  /* Draft: pitch on left (sticky), machine + player list on right, back below */
  .draft-wrap {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    align-items: start;
  }
  .draft-wrap > .pitch-panel {
    grid-column: 1;
    grid-row: 1;
    position: sticky;
    top: calc(3.6rem + 1rem);
  }
  .draft-wrap > .draft-right { grid-column: 2; grid-row: 1; }
  /* web: back button lives top-left of the Kadro card; hide the bottom one */
  .draft-back-top { display: inline-flex; }
  .draft-wrap > .draft-back { display: none; }
  /* squad selection: the player list takes the viewport so the PAGE doesn't scroll
     (you scroll the list, not the whole page) */
  /* fixed (not max-) height so the list doesn't change size per club and never
     overflows the page — you scroll the list, not the page */
  .draft-right .player-list { height: min(26rem, calc(100vh - 17rem)); max-height: min(26rem, calc(100vh - 17rem)); }
  /* the sticky pitch column also stays within the viewport */
  .draft-wrap > .pitch-panel { max-height: calc(100vh - 5rem); }

  /* Season: standings left, fixtures right; sticky bar stays full-width (position:fixed) */
  .season-wrap {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }
  /* fixtures panel (2nd panel child) goes to right column */
  .season-wrap > .panel:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: calc(3.6rem + 1rem);
    max-height: calc(100vh - 8rem);
    overflow-y: auto;
  }
  /* standings panel stays left */
  .season-wrap > .panel:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
  }
  /* fixtures list inside the panel: relax the max-height since the panel itself scrolls */
  .season-wrap > .panel:nth-child(2) .fixtures {
    max-height: none;
  }

  /* multiplayer draft: pitch left (sticky), board on top-right, then "Seçenler" +
     emoji side by side under it. DOM order (board, pitch, extras, leave) is
     unchanged so mobile is untouched; web just re-places them via the grid. */
  .mp-draft { max-width: var(--maxw); grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); align-items: start; }
  .mp-draft > *:nth-child(2) { grid-column: 1; grid-row: 1; }          /* pitch (match field) — left top */
  .mp-draft > *:nth-child(3) { grid-column: 1; grid-row: 2; }          /* Seçenler — left, UNDER the pitch (fixed) */
  .mp-draft > *:nth-child(1) { grid-column: 2; grid-row: 1 / span 2; } /* board (machine + roster) — right */
  .mp-draft > *:nth-child(4) { grid-column: 1 / -1; grid-row: 3; }     /* leave button — full width */
  /* fixed player-list size so it doesn't jump as clubs of different squad sizes
     are drawn (roughly the pitch height) */
  .mp-draft .player-list { height: min(26rem, calc(100vh - 17rem)); max-height: min(26rem, calc(100vh - 17rem)); }
  /* multiplayer pre-sim can use the full width too */
  .mp-reveal { max-width: 960px; }
}

@media (prefers-reduced-motion: reduce) { * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }
