/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
button, input, textarea, select { font-family: inherit; }

:root {
  --bg:       #0d1117;
  --surface:  #161b22;
  --surface2: #21262d;
  --border:   #30363d;
  --text:     #e6edf3;
  --dim:      #8b949e;
  --pitch:    #2a5225;
  --pitch2:   #1e3c1a;
  --accent:   #FFD700;
  --accent2:  #f0a500;
  --accent-ink: #111;      /* readable text ON an accent-coloured fill */
  --panel:    #1a1f2e;     /* dark navy panels (nav, modals, side panels) */
  --panel2:   #2a2a4e;
  --hover:    #2d333b;   /* button/card hover fill */
  --radius:   12px;
}

/* ── Light mode ─────────────────────────────────────────────────────────────
   Overrides only the structural colours + the few hardcoded-dark chrome bits.
   The pitch stays green and the share card stays a dark graphic by design. */
[data-theme="light"] {
  --bg:       #eef1f6;
  --surface:  #ffffff;
  --surface2: #e7ebf1;
  --border:   #d3d9e0;
  --text:     #1a2130;
  --dim:      #5a6472;
  --panel:    #ffffff;
  --panel2:   #e7ebf1;
  --accent:   #b8860b;     /* default gold is unreadable on white → dark goldenrod */
  --accent2:  #9a6f00;
  --accent-ink: #ffffff;
  --hover:    #dce1e8;
}

html {
  height: 100%;
  overflow: hidden;
}

body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Heebo', Arial, 'Arial Hebrew', sans-serif;
  direction: rtl;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
}

/* ── Screens ──────────────────────────────────────────────────────────────── */
.screen {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  padding: 72px 16px 40px;
}
.screen.active { display: flex; }

/* Split screens fill viewport and are NOT scrollable */
.screen.screen-split {
  flex-direction: row !important;
  padding: 0 !important;
  overflow: hidden !important;
  align-items: stretch !important;
  top: 48px !important;
}

/* ── Welcome ──────────────────────────────────────────────────────────────── */
#screen-welcome {
  justify-content: center;
  background: radial-gradient(ellipse at 50% 30%, #152515 0%, var(--bg) 65%);
}
.welcome-inner { text-align: center; max-width: 420px; }

.btn-coffee {
  display: inline-block;
  margin-top: 14px;
  padding: 9px 22px;
  border-radius: 50px;
  background: #FFDD00;
  color: #000;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: transform .15s, box-shadow .15s;
}
.btn-coffee:hover { transform: translateY(-2px); box-shadow: 0 6px 18px #ffdd0044; }
.btn-coffee-results { align-self: center; margin-top: 4px; }

.site-disclaimer {
  max-width: 620px;
  margin: 40px auto 0;
  padding: 16px 20px 0;
  border-top: 1px solid var(--border);
  text-align: center;
}
.site-disclaimer p { font-size: 11px; line-height: 1.7; color: #5a6472; margin-bottom: 8px; }
.site-disclaimer a { color: var(--dim); text-decoration: underline; }
.site-disclaimer a:hover { color: var(--accent); }

.logo {
  font-size: clamp(72px, 16vw, 130px);
  font-weight: 900;
  letter-spacing: -3px;
  background: linear-gradient(135deg, #FFD700 0%, #ff9500 55%, #FFD700 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  filter: drop-shadow(0 0 40px #ffd70050);
}
.logo-sub       { font-size: 12px; letter-spacing: 5px; text-transform: uppercase; color: var(--dim); margin-top: 4px; }
.welcome-tagline{ font-size: 18px; font-weight: 600; margin: 24px 0 8px; }
.welcome-sub    { font-size: 14px; color: var(--dim); line-height: 1.6; margin-bottom: 36px; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  color: var(--accent-ink, #000);
  border: none;
  border-radius: 50px;
  padding: 15px 44px;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
  box-shadow: 0 4px 20px #ffd70040;
}
.btn-primary:hover  { transform: translateY(-2px); box-shadow: 0 8px 28px #ffd70055; }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 11px 28px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}
.btn-secondary:hover { background: var(--border); }

/* ── Setup Screen ─────────────────────────────────────────────────────────── */
#screen-setup { justify-content: flex-start; padding-bottom: 48px; }

.setup-inner {
  width: 100%;
  max-width: 680px;
  padding: 28px 20px 40px;
}

.setup-header { text-align: center; margin-bottom: 24px; }
.setup-logo {
  font-size: 52px;
  font-weight: 900;
  background: linear-gradient(135deg, #FFD700 0%, #ff9500 55%, #FFD700 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.setup-subtitle { font-size: 11px; letter-spacing: 4px; color: var(--dim); margin-top: 4px; }

.setup-section { margin-bottom: 18px; }
.setup-label {
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 8px;
  padding-right: 2px;
}

/* Option button rows */
.option-row { display: flex; gap: 8px; }
.opt-btn {
  flex: 1;
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 12px 8px;
  cursor: pointer;
  text-align: center;
  color: var(--text);
  transition: border-color .15s, background .15s;
}
.opt-btn:hover:not(.selected) { border-color: var(--accent2); background: var(--hover); }
.opt-btn.selected { border-color: var(--accent); background: #ffd70012; }
.opt-title { font-size: 13px; font-weight: 700; margin-bottom: 3px; }
.opt-sub   { font-size: 10px; color: var(--dim); line-height: 1.3; }
.opt-btn.selected .opt-title { color: var(--accent); }

.btn-full { width: 100%; margin-top: 10px; padding: 16px; font-size: 16px; }

/* ── Formation picker: compact chips + one live preview ───────────────────── */
.formation-picker {
  display: flex;
  gap: 14px;
  align-items: stretch;
  width: 100%;
}
.formation-preview {
  width: 130px;
  flex-shrink: 0;
}
.formation-chips {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  align-content: stretch;
}
.formation-chip {
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 10px 8px;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.formation-chip:hover:not(.selected) { border-color: var(--accent2); background: var(--hover); }
.formation-chip.selected { border-color: var(--accent); background: #ffd70012; color: var(--accent); }

.mini-pitch-inner {
  position: relative;
  width: 100%;
  padding-top: 128%;
  background: linear-gradient(180deg, var(--pitch2), var(--pitch));
  border-radius: 6px;
}
.mini-dot {
  position: absolute;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 3px #0008;
}
.mini-dot.gk { background: var(--accent); }

/* ── Draft Screen Layout ──────────────────────────────────────────────────── */

/* Right panel — fixed width, contains squad card + player list */
.side-panel {
  width: 340px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--border);
  overflow: hidden; /* children scroll separately */
  height: 100%;
}

/* Left panel — fills remaining space, contains pitch */
.pitch-panel {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
  height: 100%;
  min-width: 0;
}

/* ── Progress bar ─────────────────────────────────────────────────────────── */
.progress-bar-wrap {
  padding: 10px 14px 6px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.progress-top-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
.progress-text    { font-size: 12px; color: var(--dim); }
.draft-ovr-display{ font-size: 12px; color: var(--dim); }
.draft-ovr-display span { font-weight: 800; color: var(--accent); font-size: 14px; }
#draft-ovr-lines  { margin-top: 7px; display: flex; flex-direction: column; gap: 4px; }
.dovr-line        { display: flex; align-items: center; gap: 6px; }
.dovr-label       { font-size: 10px; color: var(--dim); width: 58px; flex-shrink: 0; text-align: right; }
.dovr-bar-wrap    { flex: 1; height: 4px; background: var(--surface2); border-radius: 2px; overflow: hidden; }
.dovr-bar         { height: 100%; border-radius: 2px; transition: width .4s ease; }
.dovr-val         { font-size: 11px; font-weight: 800; width: 22px; text-align: center; flex-shrink: 0; }
.progress-bar-bg  { height: 5px; background: var(--surface2); border-radius: 3px; overflow: hidden; }
.progress-bar-fill{
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 3px;
  width: 0;
  transition: width .3s ease;
}

/* ── Pitch container — fills all remaining height in pitch-panel ─────────── */
.pitch-container {
  flex: 1 1 0;
  position: relative;
  overflow: hidden;
  /* explicit min-height so it never collapses */
  min-height: 300px;
}

.pitch {
  position: absolute;
  top: 10px; right: 10px; bottom: 10px; left: 10px;
  background:
    radial-gradient(circle at 50% 50%, transparent 17%, #ffffff12 17.5%, transparent 18%),
    linear-gradient(transparent calc(50% - 1px), #ffffff20 calc(50% - 1px), #ffffff20 calc(50% + 1px), transparent calc(50% + 1px)),
    repeating-linear-gradient(180deg,
      var(--pitch)  0px, var(--pitch)  34px,
      var(--pitch2) 34px, var(--pitch2) 68px);
  border-radius: 10px;
  border: 1px solid #ffffff18;
  overflow: hidden;
}
/* penalty areas */
.pitch::before {
  content: '';
  position: absolute;
  top: 3%; left: 25%; right: 25%; height: 14%;
  border: 1px solid #ffffff20; border-top: none;
}
.pitch::after {
  content: '';
  position: absolute;
  bottom: 3%; left: 25%; right: 25%; height: 14%;
  border: 1px solid #ffffff20; border-bottom: none;
}

/* ── Slot tokens ──────────────────────────────────────────────────────────── */
#pitch-slots, #results-pitch-slots {
  position: absolute;
  inset: 0;
}

.slot-token {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  z-index: 2;
  transition: transform .15s;
}
.slot-token:hover { transform: translate(-50%, -50%) scale(1.08); }

.slot-circle {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #00000055;
  border: 2px dashed #ffffff55;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.slot-pos-label   { font-size: 8px; font-weight: 700; color: #ffffffaa; }
.slot-name-label  {
  font-size: 7px;
  color: #fff;
  background: #00000088;
  padding: 1px 5px;
  border-radius: 3px;
  white-space: nowrap;
  font-weight: 700;
  max-width: 78px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* filled token */
.slot-token.filled .slot-circle {
  background: var(--tc, #003087);
  border: 2px solid var(--ts, #FFD700) !important;
  box-shadow: 0 2px 10px #00000066;
}
.slot-player-short {
  font-size: 8px; font-weight: 700; color: var(--tx, #fff);
  max-width: 36px; overflow: hidden;
  white-space: nowrap; text-overflow: clip; /* never "..." — JS wraps/shrinks to fit */
}

/* highlight states */
.slot-token.highlight-compat .slot-circle {
  border: 2px solid #4CAF50 !important;
  background: #4CAF5030 !important;
  animation: pulseGreen 1.1s ease-in-out infinite;
}
.slot-token.highlight-selected .slot-circle {
  border: 2px solid var(--accent) !important;
  background: #ffd700d9 !important;
  animation: pulseGold 1.1s ease-in-out infinite;
}
.slot-token.highlight-selected .slot-player-short { color: #111; }
.slot-token.highlight-incompat .slot-circle {
  border: 2px solid #F44336 !important;
  background: #F4433625 !important;
}
@keyframes pulseGreen {
  0%,100% { box-shadow: 0 0 6px #4CAF5060; }
  50%      { box-shadow: 0 0 18px #4CAF50bb; }
}
@keyframes pulseGold {
  0%,100% { box-shadow: 0 0 6px #ffd70060; }
  50%      { box-shadow: 0 0 18px #ffd700bb; }
}

/* ── Squad card & roulette ────────────────────────────────────────────────── */
.squad-card {
  margin: 12px 12px 8px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  flex-shrink: 0;
}

.squad-card-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  background: #1a1a2e;
}
.card-badge  { font-size: 28px; flex-shrink: 0; }
.card-text   { flex: 1; min-width: 0; }
.card-team   { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-season { font-size: 12px; color: #ffffffaa; margin-top: 2px; }

.squad-card.spinning .card-team,
.squad-card.spinning .card-season {
  filter: blur(1px);
  animation: txtFlash .09s linear infinite;
}
@keyframes txtFlash { 0%,100% { opacity:1 } 50% { opacity:.35 } }

.squad-card.landed { animation: landPop .4s ease; }
@keyframes landPop {
  0%   { transform: scale(1);    }
  35%  { transform: scale(1.02); }
  100% { transform: scale(1);    }
}

/* ── Reroll buttons ───────────────────────────────────────────────────────── */
.reroll-row {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  background: var(--surface2);
  border-top: 1px solid var(--border);
}
.btn-reroll-small {
  flex: 1;
  padding: 7px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--dim);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: background .15s, color .15s;
  direction: rtl;
}
.btn-reroll-small:hover:not(:disabled) { background: var(--border); color: var(--text); }
.btn-reroll-small:disabled { opacity: 0.3; cursor: not-allowed; }
.reroll-badge {
  background: var(--accent);
  color: #000;
  border-radius: 20px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 900;
  dir: ltr;
}

/* ── Mid-draft restart button ─────────────────────────────────────────────── */
.btn-draft-restart {
  display: block;
  width: calc(100% - 24px);
  margin: 8px 12px 12px;
  padding: 8px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--dim);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.btn-draft-restart:hover {
  color: #F44336;
  border-color: #F44336;
}

/* ── Peak mode banner ─────────────────────────────────────────────────────── */
.peak-mode-banner {
  margin: 0 12px 6px;
  padding: 6px 12px;
  background: linear-gradient(90deg, #7c3aed22, #a855f722);
  border: 1px solid #7c3aed88;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #c4b5fd;
  text-align: center;
  letter-spacing: 0.5px;
}

/* ── Hint ─────────────────────────────────────────────────────────────────── */
.pick-hint {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  padding: 7px 14px 4px;
  flex-shrink: 0;
  min-height: 26px;
}

/* ── Player list ──────────────────────────────────────────────────────────── */
#players-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.player-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, border-color .15s;
}
.player-card:hover { background: var(--hover); border-color: #484f58; }

.pc-pos-badge {
  font-size: 9px; font-weight: 800;
  color: var(--dim);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}
.pc-name { flex: 1; font-size: 13px; font-weight: 600; }
.pc-ovr  {
  font-size: 20px; font-weight: 900;
  color: var(--accent);
  min-width: 28px; text-align: center;
}

/* selection states */
.player-card.card-selected   { background: #ffd70015 !important; border-color: var(--accent) !important; }
.player-card.card-compat     { border-color: #4CAF5055; }
.player-card.card-incompat   { opacity: 0.3; pointer-events: none; }
.player-card.card-unavailable {
  opacity: 0.35;
  pointer-events: none;
  text-decoration: line-through;
  filter: grayscale(0.6);
}

/* ── Results side panel ───────────────────────────────────────────────────── */
.results-side {
  padding: 16px 14px;
  overflow-y: auto;
  justify-content: flex-start;
}

.result-title {
  font-size: 11px; letter-spacing: 4px; text-transform: uppercase;
  color: var(--dim); margin-bottom: 12px; text-align: center;
}

.record-display {
  display: flex; gap: 6px; margin-bottom: 10px;
  direction: ltr;
}
.rec-box {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 6px;
  text-align: center;
}
.rec-num   { font-size: 38px; font-weight: 900; line-height: 1; }
.rec-label { font-size: 10px; color: var(--dim); margin-top: 3px; letter-spacing: 1px; }
.rec-box.wins .rec-num   { color: #4CAF50; }
.rec-box.draws .rec-num  { color: var(--accent); }
.rec-box.losses .rec-num { color: #F44336; }

.record-sm { margin-top: -4px; margin-bottom: 10px; }
.record-sm .rec-box { padding: 7px 6px; }
.rec-num-sm { font-size: 20px; font-weight: 800; color: var(--text); line-height: 1.1; }

.result-ovr { font-size: 12px; color: var(--dim); text-align: center; margin-bottom: 10px; }

/* ── Match list (results) ─────────────────────────────────────────────────── */
.matches-grid {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 12px;
}
@keyframes cellPop { from { transform: translateY(4px); opacity: 0; } to { transform: none; opacity: 1; } }

.match-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 7px 9px;
  border-radius: 6px;
  font-size: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  animation: cellPop .2s ease both;
  flex-shrink: 0;
}
.mr-main { display: flex; align-items: center; gap: 8px; }

/* Skip-reveal button */
.btn-skip-matches {
  align-self: flex-start;
  margin-bottom: 8px;
  padding: 6px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--dim);
  border-radius: 50px;
  font-size: 12px; font-weight: 700; cursor: pointer;
}
.btn-skip-matches:hover { color: var(--accent); border-color: var(--accent2); }

/* Placement popup */
.placement-box { max-width: 340px; text-align: center; animation: cellPop .3s ease both; }
.placement-tier { font-size: 30px; font-weight: 900; line-height: 1.1; margin-bottom: 6px; }
.placement-sub  { font-size: 14px; color: var(--dim); margin-bottom: 12px; }
.placement-rank { font-size: 15px; font-weight: 800; color: var(--text); margin-bottom: 18px; }
.match-row.win  { border-color: #2a5c2a; }
.match-row.draw { border-color: #5c4a00; }
.match-row.loss { border-color: #5c1a1a; }

.playoff-separator {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: #aaa;
  letter-spacing: 0.05em;
  padding: 6px 0 4px;
  border-top: 1px solid #333;
  border-bottom: 1px solid #333;
  margin: 4px 0;
}

.mr-badge {
  font-size: 9px; font-weight: 900;
  padding: 2px 7px; border-radius: 4px;
  flex-shrink: 0; min-width: 22px; text-align: center;
}
.mr-badge.win  { background: #1a4d1a; color: #6bff6b; }
.mr-badge.draw { background: #4d4100; color: #ffd700; }
.mr-badge.loss { background: #4d1515; color: #ff7070; }
.mr-opponent { flex: 1; font-weight: 500; font-size: 12px; }
.mr-venue    { font-size: 10px; color: var(--dim); }
.mr-score    { font-size: 12px; font-weight: 700; color: var(--dim); flex-shrink: 0; }

/* ── Tier box ─────────────────────────────────────────────────────────────── */
.tier-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
  margin-bottom: 14px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .5s, transform .5s;
}
.tier-box.visible { opacity: 1; transform: none; }
.tier-name { font-size: 22px; font-weight: 900; margin-bottom: 4px; }
.tier-sub  { font-size: 12px; color: var(--dim); }

.results-actions { display: flex; flex-direction: column; gap: 8px; }

/* ── Desktop draft pitch: compact + readable (38-0 style) ──────────────── */
@media (min-width: 701px) {
  /* stadium ambience behind the compact pitch so the sides don't feel empty */
  #screen-draft .pitch-panel,
  #screen-preseason .pitch-panel,
  #screen-results .pitch-panel {
    background:
      radial-gradient(ellipse 75% 60% at 50% 40%, #1e4a1bcc 0%, #16341455 45%, transparent 72%),
      radial-gradient(ellipse 100% 45% at 50% 110%, #1a3a12dd 0%, transparent 65%),
      repeating-linear-gradient(90deg, transparent 0 90px, #ffffff05 90px 92px),
      linear-gradient(180deg, #0d1117 0%, #0f1a0e 60%, #0d1117 100%);
  }
  #screen-draft .pitch-container,
  #screen-preseason .pitch-container,
  #screen-results .pitch-container {
    display: flex;
    justify-content: center;
  }
  #screen-draft .pitch,
  #screen-preseason .pitch,
  #screen-results .pitch {
    position: relative;
    inset: auto;
    width: min(640px, 100%);
    height: calc(100% - 20px);
    margin: 10px auto;
    border-radius: 12px;
    border: 1px solid #ffffff14;
    box-shadow: 0 0 80px #1e4a1a66, 0 8px 40px #00000088;
  }
  .slot-circle { width: 52px; height: 52px; }
  .slot-pos-label { font-size: 10px; }
  .slot-player-short { font-size: 11px; max-width: 46px; }
  .slot-name-label {
    font-size: 10px;
    padding: 2px 7px;
    max-width: 110px;
    background: #000000b0;
  }
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
/* Narrow landscape phones/tablets keep the side-by-side layout but the fixed
   340px panel + pitch overflow — shrink the panel so everything fits width. */
@media (min-width: 701px) and (max-width: 950px) {
  .side-panel { width: 280px; }
}

@media (max-width: 700px) {
  /* Allow page scroll on mobile — desktop uses overflow:hidden to prevent
     the viewport from bouncing, but mobile needs the full-page scroll.
     overflow-y MUST be re-declared: the base rule is the `overflow: hidden`
     shorthand, which sets BOTH axes, and a lone `overflow-x` here would leave
     overflow-y:hidden in place — an unscrollable page.
     overflow-x:clip clips sideways WITHOUT becoming a scroll container, so
     overflow-y stays `visible` and the viewport itself does the scrolling.
     (`hidden` would force overflow-y to compute to `auto` — still scrollable,
     but it spawns a nested scroller, which is the iOS jank we're avoiding.
     It stays as the fallback for engines without `clip`, i.e. pre-iOS 16.) */
  html, body {
    overflow-x: hidden;
    overflow-x: clip;
    overflow-y: visible;
    height: auto;
    min-height: 100%;
  }

  /* iOS: a position:fixed box with its own overflow scroll feels "stuck" —
     no momentum hand-off, the URL bar never collapses, and it fights the body
     scroller. So every screen flows in the document and the PAGE is the one and
     only scroll container (the model .screen-split already used).
     Deliberately no overflow-x here: `hidden` on one axis forces the other to
     compute to `auto`, which would recreate a nested scroller — body clips the
     horizontal overflow instead, now that screens are in flow. */
  .screen {
    position: relative;
    inset: auto;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;     /* iOS: excludes the collapsing URL bar → no jump */
    overflow: visible;
    max-width: 100vw;
  }

  /* ── Base touch targets ── */
  button { min-height: 44px; }

  /* ── Split screens: stack vertically, switch from fixed to relative so
     the stacked content can grow beyond the viewport and body can scroll ── */
  .screen.screen-split {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    flex-direction: column !important;
    overflow: visible !important;
    height: auto !important;
    min-height: 100vh;
    min-height: 100dvh;
    align-items: stretch !important;
    padding: 0 !important;
    /* in relative flow the fixed 48px nav no longer offsets us — compensate */
    margin-top: 48px;
  }
  /* (Non-split screens used to stay fixed with their own inner touch-scroll —
     that is exactly what made iOS feel stuck, so they now flow in the document
     like the split ones and the page does the scrolling.) */

  /* Draft screen: pitch (your team) on top, player picking below — like 38-0 */
  #screen-draft .pitch-panel { order: -1; }

  /* ── Side panel: full width, auto height, no height cap ── */
  .side-panel {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    border-left: none !important;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
  }

  /* Results side scrolls as part of page flow */
  .results-side {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
  }

  /* ── Pitch panel: full width, height driven by pitch-container ── */
  .pitch-panel {
    flex: none !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }
  /* pitch-container normally uses flex:1 which collapses when unstacked;
     give it an explicit PORTRAIT height on mobile (taller than wide) so the
     formation isn't vertically squished */
  .pitch-container {
    flex: none !important;
    width: 100% !important;
    height: 132vw !important;
    max-height: 560px !important;
    min-height: 380px !important;
  }

  /* Pitch slot tokens on mobile */
  .slot-circle {
    width: 34px !important;
    height: 34px !important;
  }
  .slot-pos-label { font-size: 7px !important; }
  .slot-name-label { font-size: 8px !important; max-width: 72px !important; }

  /* ── Setup screen ── */
  .option-row { flex-wrap: wrap; gap: 6px; }
  .opt-btn { min-width: 0; flex: 1 1 calc(50% - 3px); }

  /* ── Draft side panel ── */
  .squad-card { padding: 8px 10px; }
  .reroll-row { gap: 6px; }
  .btn-reroll-small { flex: 1; font-size: 12px; min-height: 38px; }

  /* ── Matches grid ── */
  .match-row { font-size: 11px; padding: 3px 6px; }

  /* ── Results awards grid: 2 columns ── */
  .awards-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .award-card { padding: 8px 6px; }
  .award-title { font-size: 10px; }
  .award-winner { font-size: 12px; }

  /* ── Stats table ── */
  .stats-row { font-size: 11px; }
  .st-name { font-size: 11px; max-width: 90px; }

  /* ── Highlights row ── */
  .highlights-row { gap: 6px; }
  .highlight-box { padding: 8px 6px; }
  .hl-val { font-size: 22px; }

  /* ── OVR card ── */
  .ovr-total-val { font-size: 26px; }

  /* ── Tier box ── */
  .tier-name { font-size: 24px; }

  /* ── Results actions ── */
  .results-actions { flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .results-actions .btn-primary,
  .results-actions .btn-secondary { flex: 1; min-width: 120px; }
}

/* ── Scrollbar ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── OVR Card ─────────────────────────────────────────────────────────────── */
.ovr-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 10px;
}
.ovr-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.ovr-total-label { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--dim); }
.ovr-total-val   { font-size: 32px; font-weight: 900; color: var(--text); line-height: 1; }

.ovr-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}
.ovr-line:last-child { margin-bottom: 0; }
.ovr-line-label { font-size: 11px; color: var(--dim); width: 36px; flex-shrink: 0; text-align: right; }
.ovr-bar-wrap   { flex: 1; height: 6px; background: var(--surface); border-radius: 3px; overflow: hidden; }
.ovr-bar        { height: 100%; border-radius: 3px; transition: width .6s cubic-bezier(.4,0,.2,1); }
.ovr-line-val   { font-size: 13px; font-weight: 800; width: 28px; text-align: center; flex-shrink: 0; }

/* ── Stats section (fade in) ──────────────────────────────────────────────── */
.res-stats-section {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .5s, transform .5s;
}
.res-stats-section.visible { opacity: 1; transform: none; }

/* ── Finished vs projected ─────────────────────────────────────────────────── */
.proj-row { display: flex; gap: 8px; margin-bottom: 14px; }
.proj-tile {
  flex: 1; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 6px; text-align: center;
}
.proj-lbl { font-size: 9px; letter-spacing: 1px; color: var(--dim); margin-bottom: 4px; }
.proj-val { font-size: 20px; font-weight: 800; color: var(--text); }
.proj-val.dim { color: var(--dim); }
.proj-verdict { display: flex; align-items: center; justify-content: center; }
.proj-verdict .proj-val { font-size: 13px; font-weight: 800; line-height: 1.2; }
.proj-verdict.over  { border-color: #22c55e66; } .proj-verdict.over  .proj-val { color: #22c55e; }
.proj-verdict.under { border-color: #ef444466; } .proj-verdict.under .proj-val { color: #ef4444; }
.proj-verdict.exact { border-color: #eab30866; } .proj-verdict.exact .proj-val { color: #eab308; }

/* ── Qualitative strength chips ────────────────────────────────────────────── */
.qual-chips { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-bottom: 8px; }
.qual-chip {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 10px; font-size: 12px;
}
.qual-chip .qc-cat { color: var(--dim); font-weight: 600; }
.qual-chip .qc-val { font-weight: 800; }
.qual-summary { font-size: 12px; color: var(--dim); line-height: 1.6; margin-bottom: 16px; text-align: center; }

/* ── Narrative recap ───────────────────────────────────────────────────────── */
.narrative-box {
  background: linear-gradient(180deg, #161b22, #12161d);
  border: 1px solid var(--border); border-radius: 12px;
  padding: 16px; margin-bottom: 18px;
}
.narrative-title { font-size: 17px; font-weight: 900; color: var(--accent); margin-bottom: 8px; }
.narrative-body { font-size: 13px; line-height: 1.7; color: var(--text); }
.narrative-callouts { margin-top: 10px; display: flex; flex-direction: column; gap: 7px; }
.narrative-callout {
  font-size: 12px; line-height: 1.5; color: #cbd5e1;
  border-right: 2px solid var(--accent2); padding-right: 9px;
}
.narrative-callout b { color: #fff; }

/* ── Match scorers ─────────────────────────────────────────────────────────── */
.mr-scorers { font-size: 10px; color: var(--dim); margin-top: 3px; line-height: 1.4; }

/* ── Section label ────────────────────────────────────────────────────────── */
.section-label {
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--dim);
  margin: 14px 0 8px;
}

/* ── Awards grid ──────────────────────────────────────────────────────────── */
.awards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 4px;
}
.award-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 10px 8px;
  text-align: center;
}
.award-icon   { font-size: 18px; margin-bottom: 4px; }
.award-title  { font-size: 9px; letter-spacing: 1px; color: var(--dim); text-transform: uppercase; margin-bottom: 5px; }
.award-winner { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.award-stat   { font-size: 10px; color: var(--accent); }

/* ── Player stats table ───────────────────────────────────────────────────── */
.stats-table { margin-bottom: 6px; }
.stats-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 4px;
  border-bottom: 1px solid #ffffff08;
}
.stats-row:last-child { border-bottom: none; }
.stats-head { padding-bottom: 5px; border-bottom: 1px solid var(--border) !important; margin-bottom: 2px; }

.st-pos-badge {
  font-size: 8px; font-weight: 800;
  padding: 2px 4px; border-radius: 3px;
  flex-shrink: 0; min-width: 32px; text-align: center;
}
.st-pos-badge.atk { background: #f9731620; color: #f97316; border: 1px solid #f9731640; }
.st-pos-badge.mid { background: #22c55e20; color: #22c55e; border: 1px solid #22c55e40; }
.st-pos-badge.def { background: #3b82f620; color: #3b82f6; border: 1px solid #3b82f640; }
.st-pos-badge.gk  { background: #eab30820; color: #eab308; border: 1px solid #eab30840; }

.st-name      { flex: 1; font-size: 12px; font-weight: 600; }
.st-name-head { flex: 1; font-size: 9px; color: var(--dim); letter-spacing: 1px; }
.st-num       { font-size: 12px; font-weight: 700; width: 42px; text-align: center; color: var(--dim); flex-shrink: 0; }
.st-num-head  { font-size: 9px; color: var(--dim); width: 42px; text-align: center; flex-shrink: 0; }
.st-num.green  { color: #4CAF50; }
.st-num.yellow { color: #FFD700; }
.st-num.cyan   { color: #22d3ee; }

/* ── Highlights row ───────────────────────────────────────────────────────── */
.highlights-row {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}
.highlight-box {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 6px;
  text-align: center;
}
.hl-wide { flex: 1.6; }
.hl-val  { font-size: 18px; font-weight: 900; color: var(--accent); line-height: 1.1; margin-bottom: 3px; }
.hl-small { font-size: 11px; font-weight: 700; }
.hl-label { font-size: 9px; color: var(--dim); letter-spacing: 0.5px; }

/* ── League table ─────────────────────────────────────────────────────────── */
.league-details {
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.league-summary {
  cursor: pointer;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface2);
  list-style: none;
  user-select: none;
}
.league-summary::-webkit-details-marker { display: none; }
.league-summary::after { content: ' ▾'; color: var(--dim); }
.league-details[open] .league-summary::after { content: ' ▴'; }

.lt-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 9px;
  color: var(--dim);
  letter-spacing: 1px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.lt-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 12px;
  border-top: 1px solid #ffffff08;
  background: var(--bg);
  transition: background .15s;
}
.lt-row.lt-us {
  background: #ffd70010;
  border-color: #ffd70025 !important;
  font-weight: 700;
}
.lt-pos  { font-size: 11px; color: var(--dim); width: 16px; flex-shrink: 0; }
.lt-name { flex: 1; }
.lt-stat { font-size: 10px; color: var(--dim); flex-shrink: 0; }
.lt-pts  { font-size: 13px; font-weight: 800; color: var(--accent); width: 28px; text-align: center; flex-shrink: 0; }

.lt-bracket-sep {
  border-top: 2px solid #444;
  margin: 3px 0;
}

.lt-us-badge {
  font-size: 9px; font-weight: 700;
  background: var(--accent); color: #000;
  border-radius: 4px; padding: 1px 5px;
  margin-right: 4px; vertical-align: middle;
}

/* ── Era Selection ─────────────────────────────────────────────────────────── */
.era-presets {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.era-btn {
  flex: 1;
  padding: 6px 4px;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  color: var(--dim);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
  transition: border-color .15s, color .15s, background .15s;
}
.era-btn:hover:not(.selected) { border-color: var(--accent2); color: var(--text); }
.era-btn.selected { background: #ffd70015; border-color: var(--accent); color: var(--accent); }

.era-slider-wrap {
  position: relative;
  height: 24px;
  margin: 4px 6px 2px;
}
.era-track {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  left: 0; right: 0;
  height: 4px;
  background: var(--surface2);
  border-radius: 2px;
  pointer-events: none;
}
.era-fill {
  position: absolute;
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
}
.era-thumb {
  position: absolute;
  width: 100%;
  top: 0; left: 0;
  height: 24px;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  pointer-events: none;
  outline: none;
  margin: 0; padding: 0;
  z-index: 2;
}
.era-thumb::-webkit-slider-runnable-track { background: transparent; height: 24px; }
.era-thumb::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  pointer-events: auto;
  cursor: pointer;
  box-shadow: 0 0 0 3px #ffd70030;
  margin-top: 4px;
}
.era-thumb::-moz-range-track { background: transparent; }
.era-thumb::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  pointer-events: auto;
  cursor: pointer;
}

.era-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 6px 2px 0;
}
.era-lbl-edge { font-size: 11px; font-weight: 700; color: var(--accent); }
.era-lbl-mid  { font-size: 10px; color: var(--dim); }
.era-note     { font-size: 10px; color: var(--dim); margin-top: 5px; }

/* Opponents-league selector (era opponents) */
.opp-season-sel {
  width: 100%;
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.opp-season-sel:focus { outline: none; border-color: var(--accent); }

/* ── Move player button ────────────────────────────────────────────────────── */
.btn-move-player {
  margin: 0 12px 4px;
  padding: 6px 12px;
  width: calc(100% - 24px);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--dim);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all .15s;
  flex-shrink: 0;
}
.btn-move-player:hover { background: var(--border); color: var(--text); }
.btn-move-player.move-active {
  background: #ffd70015;
  border-color: var(--accent);
  color: var(--accent);
  animation: pulseGold 1.4s ease-in-out infinite;
}

/* ── Share modal ───────────────────────────────────────────────────────────── */
.share-overlay {
  position: fixed;
  inset: 0;
  background: #000000cc;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}
.share-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  max-width: 400px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 96vh;
  overflow-y: auto;
}

/* The card that gets screenshotted */
.share-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 14px;
  font-family: 'Heebo', Arial, 'Arial Hebrew', sans-serif;
}
.sc-header { text-align: center; margin-bottom: 8px; }
.sc-logo {
  font-size: 32px; font-weight: 900; line-height: 1;
  background: linear-gradient(135deg, #FFD700 0%, #ff9500 55%, #FFD700 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.sc-sub { font-size: 9px; letter-spacing: 3px; color: var(--dim); margin-top: 2px; }

.sc-pills {
  display: flex; gap: 6px; justify-content: center; margin-bottom: 10px;
}
.sc-pill { font-size: 10px; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.formation-pill { background: #3b82f620; color: #3b82f6; border: 1px solid #3b82f640; }
.ovr-pill       { background: #ffd70015; color: var(--accent); border: 1px solid #ffd70040; }

.sc-wdl {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; margin-bottom: 6px;
}
.sc-wdl-block { text-align: center; }
.sc-big-num   { display: block; font-size: 36px; font-weight: 900; line-height: 1; }
.sc-lbl       { font-size: 10px; color: var(--dim); display: block; }
.sc-wdl-block.wins   .sc-big-num { color: #4CAF50; }
.sc-wdl-block.draws  .sc-big-num { color: var(--accent); }
.sc-wdl-block.losses .sc-big-num { color: #F44336; }
.sc-dash { font-size: 24px; font-weight: 300; color: var(--dim); align-self: flex-start; padding-top: 4px; }

.sc-pts-line { text-align: center; font-size: 12px; color: var(--dim); margin-bottom: 8px; }
.sc-tier-name { font-weight: 800; }
.sc-dot { margin: 0 5px; }
.sc-divider { height: 1px; background: var(--border); margin: 8px 0; }

.sc-lineup {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
}
.sc-player-row {
  display: flex; align-items: center; gap: 4px;
  padding: 4px 5px;
  background: var(--surface2);
  border-radius: 5px;
  font-size: 11px;
}
.sc-p-pos {
  font-size: 7px; font-weight: 800;
  padding: 1px 3px; border-radius: 3px; border: 1px solid;
  flex-shrink: 0; min-width: 22px; text-align: center;
}
.sc-p-name {
  flex: 1; font-size: 11px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sc-p-ovr { font-size: 12px; font-weight: 900; flex-shrink: 0; }

.sc-awards { font-size: 11px; color: var(--dim); text-align: right; }
.sc-award-line { margin-bottom: 3px; }
.sc-award-line b { color: var(--text); }

.sc-emoji {
  font-size: 9px; letter-spacing: 1px;
  margin: 6px 0 4px; word-break: break-all; line-height: 1.5; text-align: center;
}
.sc-footer {
  text-align: center; font-size: 9px; color: var(--dim);
  letter-spacing: 3px; margin-top: 4px; text-transform: uppercase;
}

/* Share action buttons */
.share-btns-row { display: flex; gap: 8px; }
.sh-btn {
  flex: 1; padding: 11px 6px;
  border-radius: 8px; border: none;
  font-size: 13px; font-weight: 700;
  cursor: pointer; transition: opacity .15s;
}
.sh-btn:hover { opacity: .85; }
.sh-wa   { background: #25D366; color: #000; }
.sh-x    { background: #111; color: #fff; border: 1px solid #333 !important; }
.sh-copy { background: var(--surface2); color: var(--text); border: 1px solid var(--border) !important; }

.sh-save {
  width: 100%; padding: 11px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background .15s;
}
.sh-save:hover { background: var(--border); }
.sh-close {
  width: 100%; padding: 9px;
  background: transparent; border: none;
  color: var(--dim); font-size: 12px; cursor: pointer;
  transition: color .15s;
}
.sh-close:hover { color: var(--text); }

@media (max-width: 700px) {
  .era-presets { flex-wrap: wrap; }
  .era-btn { flex: 1 1 calc(50% - 3px); }
  .sc-lineup { grid-template-columns: 1fr; }
  .share-btns-row { flex-wrap: wrap; }
  .sh-btn { flex: 1 1 calc(50% - 4px); }
}

/* ── Nav Bar ─────────────────────────────────────────────────────────────── */
.app-nav {
  position: fixed; top: 0; left: 0; right: 0; height: 48px;
  background: var(--panel); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; z-index: 100; direction: rtl;
}
.nav-logo { font-weight: 900; font-size: 1.1rem; color: var(--text); letter-spacing: 1px; cursor: pointer; }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.nav-btn {
  background: transparent; border: 1px solid var(--border); color: var(--text);
  padding: 4px 12px; border-radius: 6px; cursor: pointer;
  font-size: 0.85rem; font-family: inherit; transition: background 0.15s;
  white-space: nowrap;
}
.nav-btn:hover { background: var(--panel2); color: var(--text); }
.nav-btn-primary { background: #4CAF50; border-color: #4CAF50; color: #fff; }
.nav-btn-primary:hover { background: #45a049; }
.nav-btn-sm { padding: 2px 8px; font-size: 0.75rem; }
.nav-btn-icon { padding: 4px 8px; font-size: 1rem; line-height: 1; }
.nav-user { display: flex; align-items: center; gap: 8px; }
.nav-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.nav-username { color: var(--text); font-size: 0.9rem; }

/* ── Theme settings popover (⚙️) ─────────────────────────────────────────── */
.theme-panel {
  position: absolute; top: 52px; inset-inline-end: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; width: 240px; z-index: 300;
  box-shadow: 0 10px 34px #00000066;
}
.tp-row { margin-bottom: 12px; }
.tp-label { display: block; font-size: 12px; color: var(--dim); margin-bottom: 6px; font-weight: 700; }
.tp-seg { display: flex; gap: 6px; }
.tp-seg button {
  flex: 1; background: var(--surface2); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 7px; cursor: pointer; font-family: inherit; font-size: 13px;
}
.tp-seg button.on { border-color: var(--accent); color: var(--accent); background: transparent; font-weight: 800; }
.tp-select {
  width: 100%; background: var(--surface2); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 8px; font-family: inherit; font-size: 13px;
}
.tp-swatch {
  height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; border: 1px solid #ffffff22;
}

/* Narrow screens: keep the nav on one line and stop the buttons from
   overlapping the logo. When there are more buttons than fit (logged-in user),
   the strip scrolls horizontally INSIDE the nav — the nav is position:fixed,
   so if its content overflowed the viewport, the whole page would become
   pannable left/right on phones. */
@media (max-width: 620px) {
  .app-nav { padding: 0 8px; gap: 6px; max-width: 100vw; }
  .nav-logo { font-size: 0.95rem; letter-spacing: 0; flex-shrink: 0; }
  .nav-actions {
    gap: 4px; flex-wrap: nowrap; min-width: 0;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; padding: 6px 0;
    /* fade the trailing edge so it's obvious the strip scrolls */
    -webkit-mask-image: linear-gradient(to left, #000 90%, transparent);
    mask-image: linear-gradient(to left, #000 90%, transparent);
  }
  .nav-actions::-webkit-scrollbar { display: none; }
  .nav-actions > *, .nav-user { flex-shrink: 0; }
  .nav-btn { padding: 4px 7px; font-size: 0.72rem; }
  .nav-btn-sm { padding: 3px 6px; font-size: 0.68rem; }
  .nav-username { font-size: 0.75rem; max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-avatar { width: 22px; height: 22px; }
}

/* ── Modals ──────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.75);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; direction: rtl;
}
.modal-box {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 28px 24px; width: 340px; max-width: 90vw; position: relative;
}
.modal-close {
  position: absolute; top: 12px; left: 12px;
  background: none; border: none; color: #aaa; font-size: 1.1rem; cursor: pointer;
}
.modal-title { font-size: 1.2rem; font-weight: 700; color: #fff; margin-bottom: 8px; text-align: center; }
.modal-sub   { font-size: 0.85rem; color: #aaa; text-align: center; margin-bottom: 16px; }

.auth-google-btn {
  width: 100%; padding: 10px; background: #fff; color: #333;
  border: none; border-radius: 8px; font-size: 0.95rem; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  gap: 8px; margin-bottom: 12px;
}
.auth-google-btn span { font-weight: 900; color: #4285F4; }
.auth-divider { text-align: center; color: #666; margin: 8px 0; font-size: 0.85rem; }
.auth-tabs { display: flex; gap: 4px; margin-bottom: 12px; }
.auth-tab {
  flex: 1; padding: 6px; background: transparent; border: 1px solid #444;
  color: #aaa; border-radius: 6px; cursor: pointer; font-family: inherit;
}
.auth-tab.selected { background: #4CAF50; border-color: #4CAF50; color: #fff; }
.auth-input {
  width: 100%; padding: 10px 12px; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: 0.9rem; margin-bottom: 10px;
  box-sizing: border-box; font-family: inherit;
}
.auth-error { color: #e74c3c; font-size: 0.8rem; margin-top: 8px; text-align: center; }

/* ── Achievement Toast ───────────────────────────────────────────────────── */
.achievement-toast {
  position: fixed; bottom: 24px; right: 24px;
  background: #1e1e3a; border: 1px solid #4CAF50; border-radius: 12px;
  padding: 14px 18px; display: flex; align-items: center; gap: 12px;
  direction: rtl; z-index: 300; box-shadow: 0 4px 20px rgba(76,175,80,0.3);
  animation: toast-in 0.3s ease;
}
@keyframes toast-in {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.toast-icon  { font-size: 2rem; }
.toast-label { font-size: 0.7rem; color: #4CAF50; font-weight: 700; margin-bottom: 2px; }
.toast-name  { font-size: 1rem; color: #fff; font-weight: 600; }

/* ── Save Result ─────────────────────────────────────────────────────────── */
.save-result-section { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.save-check-label { display: flex; align-items: center; gap: 8px; color: #ccc; font-size: 0.9rem; cursor: pointer; }
.save-check-label input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }
.save-login-prompt {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: #1a1a2e; border-radius: 8px;
  color: #ccc; font-size: 0.85rem; margin-bottom: 12px;
}

/* ── Mode info (results + share card) ───────────────────────────────────── */
.res-mode-info { font-size: 0.75rem; color: #888; margin-top: 6px; }
.mode-pill { background: #2a2a4e !important; color: #aaa !important; font-size: 0.7rem !important; }

/* ── Pre-season Odds Screen ──────────────────────────────────────────────── */
.pre-side { gap: 12px; }
.pre-header { text-align: center; padding: 8px 0 4px; }
.pre-trophy { font-size: 2.2rem; }
.pre-title  { font-size: 1.3rem; font-weight: 800; color: #fff; margin: 4px 0; }
.pre-sub    { font-size: 0.8rem; color: #888; line-height: 1.4; }

.pre-odds-card {
  background: #141425; border: 1px solid #2a2a4e; border-radius: 12px;
  padding: 16px 14px; display: flex; flex-direction: column; gap: 12px;
}
.pre-odds-header { display: flex; justify-content: space-between; align-items: center; }
.pre-odds-label  { font-size: 0.7rem; font-weight: 700; color: #888; letter-spacing: 1px; text-transform: uppercase; }
.pre-odds-note   { font-size: 0.65rem; color: #555; }
.pre-odds-main   { display: flex; gap: 8px; }
.pre-odds-col    { flex: 1; background: #0d0d1a; border-radius: 8px; padding: 10px 12px; }
.pre-odds-key    { font-size: 0.7rem; color: #666; margin-bottom: 4px; }
.pre-odds-val    { font-size: 1.6rem; font-weight: 900; color: #fff; }
.pre-odds-pts    { color: #4CAF50; }

.pre-bar-row   { display: flex; align-items: center; gap: 8px; direction: rtl; }
.pre-bar-label { font-size: 0.8rem; color: #ccc; width: 90px; flex-shrink: 0; }
.pre-bar-wrap  { flex: 1; height: 6px; background: #2a2a4e; border-radius: 3px; overflow: hidden; }
.pre-bar-fill  { height: 100%; border-radius: 3px; transition: width 0.6s ease; }
.pre-bar-pct   { font-size: 0.8rem; font-weight: 700; width: 44px; text-align: left; flex-shrink: 0; }

.pre-signin-prompt {
  display: flex; align-items: center; gap: 10px; direction: rtl;
  background: #1a1f2e; border: 1px solid #2a3a5e; border-radius: 10px; padding: 12px 14px;
}
.pre-signin-icon    { font-size: 1.5rem; flex-shrink: 0; }
.pre-signin-content { flex: 1; }
.pre-signin-title   { font-size: 0.85rem; font-weight: 700; color: #fff; }
.pre-signin-sub     { font-size: 0.72rem; color: #888; margin-top: 2px; }

.btn-simulate {
  width: 100%; padding: 14px; font-size: 1rem; font-weight: 700;
  border-radius: 10px; letter-spacing: 0.5px;
}

/* ── Page Screens (achievements, leaderboard) ────────────────────────────── */
.screen-page { flex-direction: column; min-height: 100vh; background: var(--bg); }
.page-inner  { max-width: 600px; margin: 0 auto; padding: 24px 16px; width: 100%; box-sizing: border-box; }
.page-header { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; direction: rtl; }
.page-title  { font-size: 1.4rem; font-weight: 700; color: var(--text); margin: 0; flex: 1; text-align: center; }
.back-btn    { background: none; border: 1px solid var(--border); color: var(--dim); padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 0.85rem; font-family: inherit; }
.page-loading { color: var(--dim); text-align: center; padding: 40px; }
.page-note   { color: #aaa; text-align: center; font-size: 0.9rem; margin-bottom: 20px; }

/* ── Achievements Grid ───────────────────────────────────────────────────── */
.achievements-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; direction: rtl; }
.ach-card {
  border-radius: 10px; padding: 16px 12px;
  display: flex; align-items: flex-start; gap: 12px; border: 1px solid #333;
}
.ach-unlocked { background: #1a2a1a; border-color: #4CAF50; }
.ach-locked   { background: #141425; opacity: 0.6; }
.ach-icon  { font-size: 1.8rem; flex-shrink: 0; }
.ach-info  { display: flex; flex-direction: column; gap: 2px; }
.ach-name  { font-size: 0.9rem; font-weight: 700; color: #fff; }
.ach-desc  { font-size: 0.75rem; color: #aaa; line-height: 1.3; }
.ach-date  { font-size: 0.7rem; color: #4CAF50; margin-top: 4px; }

/* games-played progress bar on the count achievements */
.ach-progress { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.ach-progress-bar { flex: 1; height: 6px; background: var(--surface2); border-radius: 3px; overflow: hidden; }
.ach-progress-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width .4s ease; }
.ach-progress-lbl { font-size: 0.7rem; font-weight: 700; color: var(--dim); flex-shrink: 0; }
.ach-count {
  font-size: 0.72rem; font-weight: 800; color: var(--accent);
  background: #ffd70015; border: 1px solid #ffd70040;
  border-radius: 8px; padding: 0 6px; margin-right: 6px;
}
.ach-rarity-row { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.ach-rarity-tag {
  font-size: 0.65rem; font-weight: 700; padding: 1px 6px;
  border-radius: 4px; border: 1px solid; white-space: nowrap; flex-shrink: 0;
}
.ach-bar-wrap {
  flex: 1; height: 4px; background: #2a2a4e; border-radius: 2px; overflow: hidden; min-width: 30px;
}
.ach-bar-fill { height: 100%; border-radius: 2px; transition: width 0.4s ease; }
.ach-pct { font-size: 0.65rem; color: #666; white-space: nowrap; flex-shrink: 0; }

/* ── Leaderboard ─────────────────────────────────────────────────────────── */
.lb-inner { max-width: 700px; }
.lb-tabs { display: flex; gap: 6px; margin-bottom: 12px; direction: rtl; }
.lb-tab {
  flex: 1; padding: 8px; background: transparent; border: 1px solid var(--border);
  color: var(--dim); border-radius: 8px; cursor: pointer; font-family: inherit; font-size: 0.9rem;
}
.lb-tab.selected { background: #4CAF50; border-color: #4CAF50; color: #fff; font-weight: 700; }
.lb-filters { display: flex; gap: 6px; margin-bottom: 16px; direction: rtl; }
.lb-filter, .lb-mode {
  padding: 4px 14px; background: transparent; border: 1px solid var(--border);
  color: var(--dim); border-radius: 20px; cursor: pointer; font-family: inherit; font-size: 0.8rem;
}
.lb-filter.selected, .lb-mode.selected { border-color: #4CAF50; color: #4CAF50; }
.lb-table { display: flex; flex-direction: column; gap: 6px; direction: rtl; }
.lb-row {
  display: grid;
  grid-template-columns: 32px 1fr auto auto 64px;
  align-items: center; gap: 8px;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
}
.lb-rank      { font-weight: 900; color: var(--dim); font-size: 0.95rem; text-align: center; }
.lb-rank-top  { color: #f1c40f; }
.lb-name      { font-size: 0.9rem; color: var(--text); font-weight: 600; }
.lb-stat      { font-size: 0.9rem; color: #4CAF50; font-weight: 700; }
.lb-sub       { font-size: 0.75rem; color: #666; }
.lb-view-btn  {
  padding: 4px 8px; background: transparent; border: 1px solid #444;
  color: #aaa; border-radius: 6px; cursor: pointer; font-size: 0.75rem; font-family: inherit;
}
.lb-view-btn:hover { border-color: #4CAF50; color: #4CAF50; }

/* ── Squad Modal ─────────────────────────────────────────────────────────── */
.squad-modal-box   { max-width: 400px; }
.squad-player-list { display: flex; flex-direction: column; gap: 6px; direction: rtl; margin-top: 12px; }
.squad-player-item {
  display: grid; grid-template-columns: 48px 1fr 40px; gap: 8px;
  align-items: center; background: #13132a; border-radius: 6px; padding: 6px 10px;
}
.sq-pos  { font-size: 0.7rem; font-weight: 700; color: #4CAF50; }
.sq-name { font-size: 0.85rem; color: #fff; }
.sq-ovr  { font-size: 0.8rem; color: #f1c40f; font-weight: 700; text-align: left; }

.site-disclaimer .disclaimer-links { margin-top: 6px; }
.site-disclaimer .disclaimer-links a { color: var(--dim); }
.site-disclaimer .disclaimer-links a:hover { color: var(--accent); }

/* ── Leagues ──────────────────────────────────────────────────────────────── */
.lg-actions { display: flex; flex-direction: column; gap: 12px; }
.lg-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.lg-card-title { font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.lg-row { display: flex; gap: 8px; }
.lg-input {
  flex: 1; background: var(--surface2); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 10px 12px; font-family: inherit; font-size: 14px;
}
.lg-code-input { letter-spacing: 3px; font-weight: 700; text-align: center; }
.lg-btn { padding: 10px 20px; font-size: 14px; }
.lg-msg { font-size: 13px; margin-top: 10px; min-height: 18px; text-align: center; }
.lg-msg.ok { color: #4CAF50; } .lg-msg.err { color: #f85149; }
.lg-my { display: flex; flex-direction: column; gap: 8px; }
.lg-item {
  display: flex; justify-content: space-between; align-items: center;
  background: #141425; border: 1px solid #222; border-radius: 10px; padding: 12px 14px;
  cursor: pointer; font-family: inherit; color: var(--text); text-align: right;
}
.lg-item:hover { border-color: var(--accent2); }
.lg-item-name { font-size: 15px; font-weight: 700; }
.lg-item-meta { font-size: 12px; color: var(--dim); }
.lg-item-code { color: var(--accent); font-weight: 700; letter-spacing: 1px; }
.lg-login-btn { display: block; margin: 16px auto 0; }
.lg-inner-back { margin-bottom: 12px; }
.lg-share {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 14px;
}
.lg-share-lbl { font-size: 12px; color: var(--dim); }
.lg-share-code { font-size: 20px; font-weight: 900; color: var(--accent); letter-spacing: 3px; }
.lg-copy {
  margin-inline-start: auto; background: var(--surface2); border: 1px solid var(--border);
  color: var(--dim); border-radius: 8px; padding: 6px 12px; cursor: pointer; font-family: inherit; font-size: 12px;
}
.lg-copy:hover { color: var(--accent); border-color: var(--accent2); }

.lg-league-name { font-size: 20px; font-weight: 900; color: var(--accent); margin-bottom: 10px; }
.lg-play { display: block; width: 100%; margin-bottom: 4px; }

/* League mode: hide the shared-settings sections (creator fixed them) */
#screen-setup.league-locked .lg-lockable { display: none; }
.lg-setup-note {
  background: #ffd70012; border: 1px solid #ffd70040; color: var(--accent);
  border-radius: 10px; padding: 10px 14px; font-size: 13px; font-weight: 700;
  text-align: center; margin: 6px 0 10px;
}
/* League create/config */
.lg-config { display: flex; flex-direction: column; gap: 10px; margin: 8px 0; }
.lg-config-row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.lg-config-row > span { font-size: 13px; color: var(--dim); }
.lg-mini { display: flex; gap: 4px; }
.lg-mini button {
  background: var(--surface2); border: 1px solid var(--border); color: var(--text);
  border-radius: 7px; padding: 5px 10px; font-size: 12px; font-weight: 700; cursor: pointer; font-family: inherit;
}
.lg-mini button.on { border-color: var(--accent); color: var(--accent); background: #ffd70012; }
.lg-max-input { width: 60px; text-align: center; }
.lg-status { font-size: 13px; color: var(--dim); margin: 4px 0 10px; }
.lg-status.complete { color: #22c55e; font-weight: 800; font-size: 15px; }
.lg-leave { background: none; border: 1px solid #f8514940; color: #f85149; border-radius: 8px; padding: 6px 12px; font-size: 12px; cursor: pointer; font-family: inherit; margin-top: 12px; }
.lg-leave:hover { background: #f851491a; }
.lb-row.lg-clickable { cursor: pointer; }
.lb-row.lg-clickable:hover { border-color: var(--accent2); }
.lg-played-badge { font-size: 12px; color: #22c55e; font-weight: 700; text-align: center; margin-bottom: 8px; }
.lg-status-hint { font-size: 11px; opacity: .8; }
.lg-chip { font-size: 12px; font-weight: 800; white-space: nowrap; }
.lg-chip.done { color: #22c55e; }
.lg-chip.wait { color: #f59e0b; }
.lg-masked .lb-row { opacity: .9; }
.lg-sim-btn { display: block; width: 100%; margin-bottom: 12px; }
.lb-row.lg-reveal { opacity: 0; transform: translateY(10px); transition: opacity .38s ease, transform .38s ease; }
.lb-row.lg-reveal.shown { opacity: 1; transform: none; }

/* ── Real-time duel (1v1) ─────────────────────────────────────────────────── */
.nav-beta { font-size: 9px; font-weight: 800; color: #fff; background: var(--accent2); border-radius: 6px; padding: 1px 4px; margin-inline-start: 3px; vertical-align: middle; }
.duel-slots { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 18px 0; }
.duel-slot { flex: 1; min-width: 0; background: var(--panel2, #1b2330); border: 1.5px solid var(--border); border-radius: 12px; padding: 16px 10px; text-align: center; transition: border-color .2s, box-shadow .2s; }
.duel-slot.filled { border-color: var(--accent2); }
.duel-slot.ready { border-color: #22c55e; box-shadow: 0 0 0 2px #22c55e33; }
.duel-slot.empty { opacity: .65; border-style: dashed; }
.duel-slot-name { font-weight: 800; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duel-slot-status { font-size: 12px; margin-top: 4px; color: var(--dim); }
.duel-slot.ready .duel-slot-status { color: #22c55e; font-weight: 700; }
.duel-vs { font-weight: 900; font-size: 14px; color: var(--dim); }
.duel-ready-btn { display: block; width: 100%; margin-bottom: 10px; }
.duel-ready-btn.on { background: #22c55e; }
.duel-ready-btn:disabled { opacity: .55; cursor: default; }
.duel-ready-note { text-align: center; font-weight: 800; color: #22c55e; margin: 8px 0; }
.duel-soon { text-align: center; font-size: 13px; color: var(--dim); background: var(--panel2, #1b2330); border: 1px dashed var(--border); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.duel-soon span { font-size: 11px; opacity: .7; }
.duel-hint { text-align: center; font-size: 12px; color: var(--dim); margin-top: 8px; }
/* draft board */
.duel-draft-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-weight: 800; font-size: 13px; }
.duel-turn.me { color: #22c55e; }
.duel-turn.opp { color: var(--dim); }
.duel-prog { color: var(--dim); font-size: 12px; }
.duel-timer { color: var(--accent2); min-width: 42px; text-align: end; }
.duel-team-panel { background: var(--panel2, #1b2330); border: 1px solid var(--border); border-radius: 12px; padding: 10px; margin-bottom: 10px; }
.duel-team-name { font-weight: 800; font-size: 14px; text-align: center; margin-bottom: 8px; }
.duel-pl-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; max-height: 210px; overflow-y: auto; }
.duel-pl { display: flex; align-items: center; gap: 6px; background: var(--panel, #232c3b); border: 1px solid var(--border); border-radius: 8px; padding: 7px 8px; font-family: inherit; color: var(--text); cursor: pointer; text-align: start; }
.duel-pl:not([disabled]):hover { border-color: var(--accent2); background: #2b3546; }
.duel-pl[disabled] { opacity: .55; cursor: default; }
.duel-pl-pos { font-size: 9px; font-weight: 800; color: var(--dim); min-width: 26px; }
.duel-pl-name { flex: 1; font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duel-pl-ovr { font-size: 12px; font-weight: 900; color: var(--accent2); }
.duel-wait-note { text-align: center; font-size: 12px; color: var(--dim); margin-top: 8px; }
.duel-squads { display: flex; gap: 8px; margin-bottom: 12px; }
.duel-sq { flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.duel-sq.mine { border-color: var(--accent2); }
.duel-sq-h { display: flex; justify-content: space-between; padding: 5px 7px; background: var(--panel2, #1b2330); font-size: 11px; font-weight: 800; }
.duel-sq-h span { color: var(--dim); }
.duel-sq-row { display: flex; align-items: center; gap: 4px; padding: 2px 6px; font-size: 10px; border-top: 1px solid var(--border); }
.duel-sq-row.f { background: #22c55e0f; }
.duel-sq-pos { color: var(--dim); font-weight: 700; min-width: 22px; }
.duel-sq-nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duel-sq-ovr { font-weight: 800; color: var(--accent2); }
/* result */
.duel-result-head { text-align: center; font-size: 26px; font-weight: 900; margin: 6px 0; }
.duel-scoreline { text-align: center; font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.duel-scoreline b { font-size: 20px; }
.duel-res-row { cursor: pointer; }
.duel-quick-card { border-color: var(--accent2); background: linear-gradient(180deg, #1b2330, var(--panel2, #1b2330)); }
.duel-wait-spin { font-size: 40px; text-align: center; margin: 16px 0; animation: duelspin 1.1s linear infinite; }
@keyframes duelspin { to { transform: rotate(360deg); } }
#duel-review-chrome { position: fixed; bottom: 0; inset-inline: 0; z-index: 60; display: flex; gap: 8px; padding: 8px 10px; background: #0e1420ee; border-top: 1px solid var(--border); backdrop-filter: blur(6px); }
.duel-chrome-summary { flex: 1; background: var(--panel2, #1b2330); border: 1px solid var(--border); border-radius: 10px; padding: 10px; font-family: inherit; font-weight: 900; font-size: 15px; cursor: pointer; }
.duel-chrome-exit { background: none; border: 1px solid #f8514966; color: #f85149; border-radius: 10px; padding: 10px 14px; font-family: inherit; font-weight: 700; cursor: pointer; }
.duel-sum-score { text-align: center; font-size: 18px; margin: 10px 0 4px; }
.duel-sum-score b { font-size: 15px; }
.duel-sum-ovr { text-align: center; font-size: 12px; color: var(--dim); margin-bottom: 12px; }
.btn-draft-exit { display: block; width: 100%; margin-bottom: 8px; background: #f8514918; color: #f85149; border: 1px solid #f8514955; border-radius: 8px; padding: 8px; font-family: inherit; font-weight: 800; font-size: 13px; cursor: pointer; }
.btn-draft-exit:hover { background: #f8514930; }
.duel-fmt-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 8px; }
.duel-fmt-btn { background: var(--panel2, #1b2330); border: 1.5px solid var(--border); border-radius: 10px; padding: 16px 6px; font-family: inherit; font-weight: 900; font-size: 15px; color: var(--text); cursor: pointer; }
.duel-fmt-btn:hover { border-color: var(--accent2); background: #2b3546; }
.duel-reroll-row { display: flex; gap: 6px; margin: 4px 0 8px; }
.duel-reroll-btn { flex: 1; background: #eab30822; color: #eab308; border: 1px solid #eab30866; border-radius: 8px; padding: 8px; font-family: inherit; font-weight: 800; font-size: 13px; cursor: pointer; }
.duel-reroll-btn:hover { background: #eab30833; }
.rr-badge { display: inline-block; min-width: 16px; padding: 0 4px; margin-inline-start: 3px; background: #eab308; color: #1b2330; border-radius: 8px; font-size: 11px; font-weight: 900; }
/* interactive duel pitches (full width, readable) */
.duel-pitch-wrap { position: relative; width: 100%; aspect-ratio: 3 / 4; margin-bottom: 4px; background: var(--panel2, #1b2330); border: 1px solid var(--border); border-radius: 12px; }
.duel-pitch-wrap.opp { max-width: 72%; margin-inline: auto; }
.duel-pitch { top: 6px; right: 6px; bottom: 6px; left: 6px; }
.duel-pitch.mine .slot-circle { width: 34px; height: 34px; }
.duel-pitch.mine .slot-player-short { font-size: 8px; max-width: 30px; }
.duel-pitch.mine .slot-name-label { font-size: 9px; max-width: 76px; }
.duel-pitch.mine .slot-pos-label { font-size: 9px; }
.duel-pitch.opp .slot-token { cursor: default; }
.duel-pitch.opp .slot-token:hover { transform: translate(-50%, -50%); }
.duel-pitch.opp .slot-circle { width: 26px; height: 26px; }
.duel-pitch.opp .slot-player-short { font-size: 7px; max-width: 24px; }
.duel-pitch.opp .slot-name-label { font-size: 7px; max-width: 60px; }
.duel-pitch.opp .slot-pos-label { font-size: 7px; }
.duel-pitch .slot-token.hl .slot-circle { border-color: #22c55e !important; box-shadow: 0 0 0 2px #22c55e66, 0 0 10px #22c55e99; }
.duel-pitch .slot-token.selmove .slot-circle { border-color: #eab308 !important; box-shadow: 0 0 0 2px #eab308aa; }
.duel-board-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 800; margin: 8px 0 3px; }
.duel-board-head.opp { color: var(--dim); margin-top: 10px; }
.duel-move-btn { background: #3b82f622; color: #3b82f6; border: 1px solid #3b82f666; border-radius: 8px; padding: 4px 12px; font-family: inherit; font-weight: 800; font-size: 12px; cursor: pointer; }
.duel-move-btn.on { background: #3b82f6; color: #fff; }
.duel-hint2 { text-align: center; font-size: 12px; color: var(--accent2); margin-top: 8px; font-weight: 700; }
.duel-pl.sel { border-color: var(--accent2); background: #2b3546; box-shadow: 0 0 0 2px var(--accent2); }
.duel-agreed { text-align: center; font-size: 13px; color: var(--dim); margin: 8px 0; padding: 7px; background: var(--panel2, #1b2330); border: 1px solid var(--border); border-radius: 8px; }
.duel-agreed.ok { color: #22c55e; font-weight: 800; border-color: #22c55e55; }
.duel-record { text-align: center; font-size: 13px; color: var(--dim); margin-bottom: 10px; }
.duel-record b { color: var(--text); }
.duel-rps-row { display: flex; gap: 10px; margin-top: 14px; }
.duel-rps-btn { flex: 1; background: var(--panel2, #1b2330); border: 1.5px solid var(--border); border-radius: 12px; padding: 18px 6px; font-family: inherit; font-weight: 800; font-size: 30px; line-height: 1.25; color: var(--text); cursor: pointer; }
.duel-rps-btn:hover { border-color: var(--accent2); background: #2b3546; }
/* two mini-pitches side by side during the draft */
.duel-boards { display: flex; gap: 8px; margin-bottom: 12px; }
.duel-mini { flex: 1; min-width: 0; }
.duel-mini.mine .duel-mini-wrap { border-color: var(--accent2); }
.duel-mini-head { display: flex; justify-content: space-between; padding: 4px 6px; font-size: 11px; font-weight: 800; overflow: hidden; }
.duel-mini-head span { color: var(--dim); }
.duel-mini-wrap { position: relative; width: 100%; aspect-ratio: 3 / 4; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.duel-mini-pitch { top: 3px; right: 3px; bottom: 3px; left: 3px; }
.duel-mini-pitch .slot-token { gap: 1px; cursor: default; }
.duel-mini-pitch .slot-token:hover { transform: translate(-50%, -50%); }
.duel-mini-pitch .slot-circle { width: 20px; height: 20px; border-width: 1.5px; }
.duel-mini-pitch .slot-player-short { font-size: 6px; max-width: 20px; }
.duel-mini-pitch .slot-pos-label { font-size: 6px; }
.duel-mini-pitch .slot-name-label { font-size: 6px; max-width: 46px; padding: 0 3px; border-radius: 2px; }
/* shared league simulation */
.lgsim-hero { text-align: center; padding: 18px 12px; }
.lgsim-hero-title { font-size: 20px; font-weight: 900; color: #22c55e; }
.lgsim-hero-sub { font-size: 13px; color: var(--dim); margin: 8px 0 14px; }
.lgsim-start { width: 100%; font-size: 16px; }
.lgsim-reveal-head { text-align: center; font-weight: 900; font-size: 16px; margin-bottom: 10px; }
.lgsim-tally { margin-bottom: 8px; }
.lgsim-pos { text-align: center; font-size: 15px; margin-top: 10px; }
.lgsim-pos b { color: var(--accent2); font-size: 18px; }
.lb-row.lgsim-member { border-color: var(--accent2); }
.lb-row.lgsim-me { background: #22c55e14; border-color: #22c55e; }
.league-review-back { position: fixed; top: 8px; inset-inline-start: 8px; z-index: 50; background: var(--accent2); color: #fff; border: none; border-radius: 8px; padding: 7px 12px; font-family: inherit; font-weight: 800; font-size: 13px; cursor: pointer; box-shadow: 0 2px 8px #0006; }
.nav-username { cursor: pointer; }
.nav-username:hover { text-decoration: underline; }
/* league-complete popup */
.lgc-name { font-weight: 800; color: #22c55e; margin: 4px 0; }

/* ══ Daily challenge ══════════════════════════════════════════════════════════ */
/* welcome-screen card */
.daily-welcome-card {
  display: block; width: 100%; max-width: 340px; margin: 14px auto 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; cursor: pointer; font-family: inherit; text-align: right;
  color: var(--text, #e6edf3); transition: border-color .15s, background .15s;
}
.daily-welcome-card:hover { border-color: var(--accent); background: #ffd70008; }
.dw-top { display: flex; align-items: center; gap: 8px; }
.dw-icon { font-size: 18px; }
.dw-title { font-weight: 800; font-size: 15px; }
.dw-title span { color: var(--accent); }
.dw-arrow { margin-inline-start: auto; color: var(--accent); font-weight: 900; }
.dw-sub { display: block; font-size: 11px; color: var(--dim); margin-top: 6px; line-height: 1.5; }

/* daily screen */
.daily-hero { text-align: center; padding: 18px 14px; }
.daily-hero-title { font-size: 20px; font-weight: 900; }
.daily-hero-title span { color: var(--accent); }
.daily-hero-sub { font-size: 13px; color: var(--dim); margin: 8px 0 12px; line-height: 1.5; }
.daily-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 12px; }
.daily-chip {
  font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  background: #ffd70010; border: 1px solid #ffd70040; color: var(--accent);
}
.daily-mine { font-size: 13px; color: var(--dim); margin-bottom: 10px; min-height: 18px; }
.daily-mine b { color: #22c55e; }
.daily-mine-rank { font-weight: 900; color: var(--accent); margin-inline-end: 4px; }
.daily-mine-tries { font-size: 11px; opacity: .8; }
.daily-play { width: 100%; font-size: 16px; }
.daily-countdown { font-size: 11px; color: var(--dim); margin-top: 10px; }

/* results-screen extras for a daily run */
.daily-result-extras { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 4px; }
.daily-result-note { font-size: 13px; font-weight: 700; text-align: center; min-height: 0; }
.daily-result-note.ok { color: #22c55e; }
.daily-result-note.meh { color: var(--dim); }
.dw-more { display: block; font-size: 10.5px; color: var(--dim); margin-top: 3px; opacity: .85; }
.chal-tabs { margin-bottom: 12px; }

/* ── Challenge missions ─────────────────────────────────────────────────────── */
.chal-missions { border-top: 1px dashed var(--border); margin-top: 4px; padding-top: 10px; margin-bottom: 12px; }
.chalreq-title { font-size: 13px; font-weight: 800; color: var(--accent); margin-bottom: 6px; }
.chal-mission { font-size: 13px; font-weight: 600; padding: 3px 0; }
.chal-missions-hint { font-size: 11px; color: var(--dim); margin-top: 6px; }

.chal-reqs-panel, .chal-reqs-pre {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; margin: 8px 0; text-align: right;
}
.chalreq-line { display: flex; align-items: center; gap: 7px; font-size: 12.5px; padding: 3px 0; }
.chalreq-line.met .chalreq-text { color: #22c55e; }
.chalreq-line.fail .chalreq-text { color: #f87171; }
.chalreq-icon { font-size: 12px; flex-shrink: 0; }
.chalreq-text { flex: 1; line-height: 1.35; }
.chalreq-progress { font-size: 11px; font-weight: 800; color: var(--dim); flex-shrink: 0; }
.chalreq-verdict { font-size: 12px; font-weight: 700; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); }
.chalreq-verdict.ok { color: #22c55e; }
.chalreq-verdict.bad { color: #fbbf24; }
.chal-reqs-result { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; text-align: right; }

/* player nationality — shown ONLY in nationality-mission challenges */
.pc-nats { display: block; font-size: 10px; color: var(--dim); font-weight: 500; margin-top: 1px; }
.pc-nats-hit { color: #22c55e; font-weight: 700; }

/* real flag images (Windows can't render flag emoji) */
.nat-flag { width: 17px; height: auto; border-radius: 2px; vertical-align: -2px; box-shadow: 0 0 0 1px #00000033; }
.pc-nats .nat-flag { width: 14px; vertical-align: -2px; }

/* footer policy links (about / privacy / contact) — AdSense + credibility */
.footer-links { margin-top: 8px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.footer-links a { color: var(--dim); text-decoration: none; font-size: 11px; }
.footer-links a:hover { color: var(--accent); text-decoration: underline; }

/* ── Light-mode targeted fixes for hardcoded-dark chrome ──────────────────── */
[data-theme="light"] #screen-welcome {
  background: radial-gradient(ellipse at 50% 30%, #e2f0e2 0%, var(--bg) 62%);
}
[data-theme="light"] .site-disclaimer p { color: #8a93a0; }

/* footer social links (brand-colour on hover) */
.social-links { display: flex; gap: 14px; justify-content: center; margin-top: 12px; }
.social-links a { color: var(--dim); display: inline-flex; align-items: center; transition: color .15s, transform .15s; }
.social-links a:hover { transform: translateY(-2px); }
.social-links a.social-fb:hover { color: #1877F2; }
.social-links a.social-ig:hover { color: #E4405F; }
.social-links a.social-tt:hover { color: var(--text); }
.social-links a.social-x:hover  { color: var(--text); }
.social-links a.social-yt:hover { color: #FF0000; }
