:root {
  --bg: #0a0a12;
  --bg-2: #11111e;
  --panel: #161628;
  --panel-2: #1d1d33;
  --line: #25253f;
  --text: #ececf6;
  --text-dim: #9a9ab6;
  --accent: #5cf0c2;
  --accent-2: #ffd55c;
  --wc-red: #e63946;       /* WC26 host accent — Mexico/USA/Canada warm */
  --wc-cyan: #2dd4bf;
  --pitch-green: #1d6b3a;
  --pitch-green-2: #1a5e34;
  --danger: #ff6b6b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  color: var(--text); font-family: "Inter", system-ui, sans-serif; min-height: 100vh;
}
body {
  background-color: var(--bg);
  position: relative;
  overflow-x: hidden;
}
/* Subtle grain layer */
body::before {
  content: "";
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.05 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  pointer-events: none; z-index: 0; opacity: 0.6;
}
body > * { position: relative; z-index: 1; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: inherit; }
.hidden { display: none !important; }

/* ── topbar ──────────────────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px; border-bottom: 1px solid var(--line);
  background: rgba(10, 10, 18, 0.85); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10;
}
.brand {
  display: flex; align-items: baseline; gap: 10px;
  text-decoration: none; color: inherit;
}
.brand-mark { font-weight: 900; letter-spacing: 1px; font-size: 18px; color: var(--accent); }
.brand-sub { color: var(--text-dim); font-size: 13px; }
.round-pill {
  background: var(--panel-2); border: 1px solid var(--line);
  padding: 6px 12px; border-radius: 999px; font-size: 12px;
  font-weight: 600; letter-spacing: 0.5px;
}
.icon-btn {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--panel); border: 1px solid var(--line);
  font-size: 18px;
}
.icon-btn:hover { background: var(--panel-2); }

.hdr-right { display: flex; align-items: center; gap: 10px; }
.hdr-btn {
  background: var(--panel); border: 1px solid var(--line);
  padding: 8px 14px; border-radius: 8px; font-size: 13px; font-weight: 700; color: var(--text);
  text-decoration: none;
}
.hdr-btn:hover { background: var(--panel-2); }
.hdr-btn.primary { background: var(--accent); color: #0a0a12; border-color: var(--accent); }
.hdr-link { color: var(--text-dim); font-size: 13px; text-decoration: none; }
.hdr-link:hover { color: var(--text); }
.hdr-email { color: var(--text-dim); font-size: 12px; }
.auth-slot-inline { display: inline-flex; align-items: center; gap: 8px; }

.league-banner {
  background: var(--panel-2); border-bottom: 1px solid var(--line);
  padding: 8px 18px; font-size: 13px; text-align: center;
  color: var(--accent);
}
.league-banner b { color: var(--text); }

/* ── setup screen ────────────────────────── */
.setup { padding: 48px 20px 80px; }
.setup-inner { max-width: 720px; margin: 0 auto; text-align: center; }
.setup-title { font-size: 34px; font-weight: 800; margin-bottom: 8px; }
.setup-sub { color: var(--text-dim); margin-bottom: 36px; }
.setup-step { margin-bottom: 28px; text-align: left; }
.setup-step-label {
  font-size: 12px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 12px;
}
.formation-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.formation-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 16px; text-align: center;
  transition: border-color 0.15s, transform 0.15s;
}
.formation-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.formation-card.selected { border-color: var(--accent); background: var(--panel-2); }
.formation-card-name { font-weight: 800; font-size: 18px; }
.formation-card-desc { color: var(--text-dim); font-size: 12px; margin-top: 4px; }

.setup-start {
  margin-top: 16px;
  padding: 14px 28px; background: var(--accent); color: #0a0a12;
  border-radius: 12px; font-weight: 800; font-size: 16px;
  transition: opacity 0.15s, transform 0.15s;
}
.setup-start:disabled { opacity: 0.4; cursor: not-allowed; }
.setup-start:not(:disabled):hover { transform: translateY(-2px); }

/* ── game screen ─────────────────────────── */
.game {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px;
  padding: 18px; max-width: 1240px; margin: 0 auto;
  min-height: calc(100vh - 60px);
}
@media (max-width: 900px) {
  .game { grid-template-columns: 1fr; }
}
.left-col, .pitch-col { display: flex; flex-direction: column; }

/* ── spin pane ───────────────────────────── */
.spin-pane {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 32px 24px; text-align: center;
}
.pot-banner {
  display: inline-block;
  background: var(--panel-2); border: 1px solid var(--line);
  padding: 8px 16px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: 1px;
  color: var(--accent); margin-bottom: 6px;
}
.pot-banner .pot-sub {
  color: var(--text-dim); margin-left: 6px; font-weight: 500; letter-spacing: 0.5px;
}
.reels {
  display: grid; grid-template-columns: 1fr 1.5fr; gap: 14px;
  margin: 14px 0 8px;
}
.reel {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 18px 12px; display: flex; flex-direction: column; align-items: center;
  gap: 6px; min-height: 110px; justify-content: center;
}
.reel-label {
  font-size: 10px; letter-spacing: 1.5px; color: var(--text-dim); font-weight: 700;
}
.reel-value {
  font-size: 38px; font-weight: 900; letter-spacing: 0.5px;
}
.reel-flag .reel-value { font-size: 56px; line-height: 1; }
.reel.spinning .reel-value { animation: spin 0.06s linear infinite; }
@keyframes spin { from { transform: translateY(-3px); } to { transform: translateY(3px); } }

.reel-captions {
  display: grid; grid-template-columns: 1fr 1.5fr; gap: 14px;
  color: var(--text-dim); font-size: 11px; letter-spacing: 1px;
  margin-bottom: 22px;
}

.spin-btn {
  display: block; width: 100%; padding: 16px;
  background: var(--accent); color: #0a0a12; border-radius: 12px;
  font-weight: 900; font-size: 18px; letter-spacing: 1.5px;
  transition: transform 0.15s, opacity 0.15s;
}
.spin-btn:hover { transform: translateY(-2px); }
.spin-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.spin-hint { margin-top: 14px; color: var(--text-dim); font-size: 13px; }
.needed-hint {
  margin-top: 8px; color: var(--accent-2); font-size: 13px; font-weight: 600;
}

/* ── draft pane ──────────────────────────── */
.draft-pane {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px; display: flex; flex-direction: column;
  flex: 1; min-height: 0;
}
.draft-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.draft-title { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; }
.draft-title #draftFlag { font-size: 26px; }
.draft-group {
  font-size: 11px; padding: 3px 8px; border-radius: 999px;
  background: var(--panel-2); color: var(--text-dim); font-weight: 700;
}
.draft-search {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 12px; color: var(--text); width: 180px; font-size: 13px;
}
.draft-subhead {
  display: flex; justify-content: space-between; align-items: center;
  margin: 14px 0 8px;
}
.draft-instruct { color: var(--text-dim); font-size: 12px; }
.draft-cols { display: flex; gap: 14px; font-style: normal; }
.draft-cols i {
  font-size: 10px; color: var(--text-dim); letter-spacing: 1px; font-weight: 700;
  width: 38px; text-align: center; font-style: normal;
}
.player-list {
  flex: 1; overflow-y: auto; min-height: 280px; max-height: 60vh;
  display: flex; flex-direction: column; gap: 4px;
  padding-right: 4px;
}
.player-row {
  display: grid;
  grid-template-columns: 28px 1fr 38px 38px 38px;
  gap: 8px; align-items: center;
  padding: 8px 10px; border-radius: 8px;
  background: var(--bg-2); border: 1px solid transparent;
  transition: border-color 0.1s, background 0.1s;
}
.player-row:hover { border-color: var(--accent); }
.player-row.disabled { opacity: 0.35; cursor: not-allowed; }
.player-row.disabled:hover { border-color: transparent; }
.pr-no { color: var(--text-dim); font-size: 12px; font-weight: 700; text-align: center; }
.pr-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pr-name {
  font-weight: 700; font-size: 14px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.pr-name .captain { font-size: 10px; color: var(--accent-2); margin-left: 4px; }
.pr-club { color: var(--text-dim); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-pos, .pr-caps, .pr-goals { text-align: center; font-size: 13px; font-weight: 600; }
.pr-pos { color: var(--accent); }

/* ── pitch ───────────────────────────────── */
.pitch-col { gap: 8px; }
.pitch {
  position: relative; flex: 1; min-height: 440px;
  background:
    linear-gradient(180deg, var(--pitch-green) 0%, var(--pitch-green-2) 100%);
  background-image:
    repeating-linear-gradient(0deg,
      rgba(255,255,255,0.04) 0 36px,
      rgba(0,0,0,0.04) 36px 72px),
    linear-gradient(180deg, var(--pitch-green) 0%, var(--pitch-green-2) 100%);
  border-radius: 16px; border: 1px solid var(--line);
  overflow: hidden; padding: 12px;
}
.pitch-lines { position: absolute; inset: 12px; pointer-events: none; }
.pl-box {
  position: absolute; left: 25%; right: 25%; height: 60px;
  border: 2px solid rgba(255,255,255,0.22);
}
.pl-box-top { top: 0; border-top: none; }
.pl-box-bottom { bottom: 0; border-bottom: none; }
.pl-circle {
  position: absolute; left: 50%; top: 50%;
  width: 90px; height: 90px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.22);
  transform: translate(-50%, -50%);
}
.pl-halfway {
  position: absolute; left: 0; right: 0; top: 50%; height: 0;
  border-top: 2px solid rgba(255,255,255,0.22);
}
.pl-spot {
  position: absolute; left: 50%; width: 4px; height: 4px;
  background: rgba(255,255,255,0.4); border-radius: 50%;
  transform: translateX(-50%);
}
.pl-spot-top { top: 36px; }
.pl-spot-bottom { bottom: 36px; }

.slot {
  position: absolute; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 90px; text-align: center;
  z-index: 2;
}
.slot-pill {
  background: rgba(10, 10, 18, 0.78); border: 1.5px solid rgba(255,255,255,0.25);
  border-radius: 10px; padding: 5px 8px;
  min-width: 70px;
  font-size: 11px; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100px;
}
.slot.empty .slot-pill {
  background: rgba(10, 10, 18, 0.45); color: rgba(255,255,255,0.55);
  border-style: dashed;
}
.slot.next .slot-pill {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 2px rgba(255, 213, 92, 0.25);
}
.slot-flag { font-size: 16px; line-height: 1; }
.slot-pos {
  font-size: 9px; letter-spacing: 1px; color: rgba(255,255,255,0.6); font-weight: 800;
}

.formation-tag {
  text-align: center; padding: 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  font-weight: 800; font-size: 13px; color: var(--text-dim); letter-spacing: 2px;
}

/* ── results ─────────────────────────────── */
.results { padding: 36px 20px; }
.results-inner { max-width: 760px; margin: 0 auto; text-align: center; }
.results-title { font-size: 30px; font-weight: 800; }
.results-sub { color: var(--text-dim); margin: 6px 0 22px; }
.results-pitch { min-height: 540px; max-width: 460px; margin: 0 auto 22px; }
.results-buttons { display: flex; justify-content: center; gap: 12px; }
.primary-btn {
  background: var(--accent); color: #0a0a12; padding: 12px 22px;
  border-radius: 10px; font-weight: 800;
}
.ghost-btn {
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  padding: 12px 22px; border-radius: 10px; font-weight: 700;
}
.primary-btn:hover, .ghost-btn:hover { transform: translateY(-2px); }

/* ── HALO AMRIKA landing — Aurora hero ───── */
.hero {
  padding: 80px 20px 56px;
  border-bottom: 1px solid var(--line);
  text-align: center;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.hero::before, .hero::after {
  content: "";
  position: absolute;
  top: -30%; left: -20%;
  width: 140%; height: 160%;
  background:
    radial-gradient(ellipse 40% 30% at 20% 30%, rgba(92, 240, 194, 0.30), transparent 60%),
    radial-gradient(ellipse 35% 28% at 80% 40%, rgba(255, 213, 92, 0.26), transparent 60%),
    radial-gradient(ellipse 50% 35% at 50% 80%, rgba(230, 57, 70, 0.22), transparent 65%);
  filter: blur(60px);
  z-index: -1;
  animation: aurora 28s ease-in-out infinite alternate;
  opacity: 0.9;
}
.hero::after {
  animation-duration: 38s;
  animation-direction: alternate-reverse;
  background:
    radial-gradient(ellipse 35% 25% at 70% 20%, rgba(230, 57, 70, 0.22), transparent 60%),
    radial-gradient(ellipse 45% 35% at 30% 70%, rgba(45, 212, 191, 0.22), transparent 60%);
  opacity: 0.6;
}
@keyframes aurora {
  0%   { transform: translate(0%, 0%)    rotate(0deg)   scale(1); }
  25%  { transform: translate(4%, -3%)   rotate(8deg)   scale(1.05); }
  50%  { transform: translate(-3%, 5%)   rotate(-6deg)  scale(0.98); }
  75%  { transform: translate(6%, 2%)    rotate(10deg)  scale(1.08); }
  100% { transform: translate(-4%, -4%)  rotate(-4deg)  scale(1.02); }
}
@media (prefers-reduced-motion: reduce) {
  .hero::before, .hero::after { animation: none; }
}
.hero-inner { max-width: 760px; margin: 0 auto; }
.hero-split {
  display: flex; gap: 36px; align-items: center; justify-content: center;
  max-width: 1100px;
  text-align: left;
}
.hero-text { min-width: 0; flex: 1 1 auto; max-width: 640px; }
.hero-art {
  flex: 0 0 auto;
  width: 220px; max-width: 24vw;
  animation: float 6s ease-in-out infinite alternate;
}
.hero-art img { width: 100%; height: auto; display: block; }
.hero-art.saba-art {
  filter: drop-shadow(0 12px 36px rgba(92, 240, 194, 0.20))
          drop-shadow(0 4px 12px rgba(0, 0, 0, 0.6));
}
.hero-art.wc-art {
  filter: drop-shadow(0 12px 36px rgba(230, 57, 70, 0.22))
          drop-shadow(0 4px 12px rgba(0, 0, 0, 0.6));
  animation-direction: alternate-reverse;
  animation-duration: 7s;
}
@keyframes float {
  0%   { transform: translateY(0) rotate(-1deg); }
  100% { transform: translateY(-12px) rotate(2deg); }
}
@media (max-width: 820px) {
  .hero-split { flex-direction: column; text-align: center; }
  .hero-art   { width: 130px; max-width: 36vw; margin: 4px auto; }
  .hero-art.wc-art   { order: 0; }
  .hero-text         { order: 1; }
  .hero-art.saba-art { order: 2; }
}
[dir="rtl"] .hero-split { text-align: right; flex-direction: row-reverse; }
@media (max-width: 820px) {
  [dir="rtl"] .hero-split { flex-direction: column-reverse; text-align: center; }
}
.hero-eyebrow {
  font-size: 11px; letter-spacing: 2.5px; color: var(--text-dim);
  text-transform: uppercase; margin-bottom: 16px; font-weight: 700;
}
.hero-title {
  font-size: clamp(40px, 8vw, 84px); font-weight: 900; letter-spacing: -1.5px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 50%, var(--wc-red) 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 14px; line-height: 1;
  animation: title-shimmer 8s ease-in-out infinite alternate;
  text-shadow: 0 0 60px rgba(92, 240, 194, 0.15);
}
@keyframes title-shimmer {
  0%   { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}
.hero-tag { color: var(--text); font-size: 16px; line-height: 1.6; margin-bottom: 24px; }
.hero-tag b { color: var(--accent-2); }
.hero-status {
  display: inline-block;
  background: var(--panel-2); border: 1px solid var(--line);
  padding: 8px 16px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: 1px; color: var(--accent);
}
.hero-cta {
  display: inline-block; margin-top: 18px;
  padding: 14px 28px; background: var(--accent); color: #0a0a12;
  border-radius: 12px; font-weight: 900; font-size: 15px; letter-spacing: 1px;
  text-decoration: none;
  transition: transform 0.18s, box-shadow 0.18s;
  box-shadow: 0 4px 30px rgba(92, 240, 194, 0.25);
  position: relative;
  overflow: hidden;
}
.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 40px rgba(92, 240, 194, 0.45);
}
.hero-cta::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,0.35) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.6s;
}
.hero-cta:hover::after { transform: translateX(100%); }
.hero-cta.ghost {
  background: var(--panel); border: 1px solid var(--line);
  color: var(--text); margin-left: 10px;
}

/* ── strips (sections) ───────────────────── */
.strip { padding: 36px 20px; }
.strip-alt { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.strip-inner { max-width: 1100px; margin: 0 auto; }
.strip-title {
  font-size: 18px; font-weight: 800; margin-bottom: 18px;
  letter-spacing: 0.5px;
}
.strip-note { color: var(--text-dim); font-size: 13px; margin-top: 10px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
@media (max-width: 720px) { .two-col { grid-template-columns: 1fr; gap: 30px; } }

/* ── squad cells (rules summary on landing) ── */
.squad-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.sq-cell {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; display: flex; justify-content: space-between; align-items: center;
}
.sq-pos { font-weight: 800; color: var(--accent); font-size: 13px; letter-spacing: 1px; }
.sq-n   { font-size: 13px; color: var(--text-dim); }
.sq-cell.wild { border-color: var(--accent-2); }
.sq-cell.wild .sq-pos { color: var(--accent-2); }
.sq-cell.arab { border-color: #d97706; }
.sq-cell.arab .sq-pos { color: #f59e0b; }

/* ── rules table ─────────────────────────── */
.rules { width: 100%; border-collapse: collapse; font-size: 14px; }
.rules td { padding: 8px 10px; border-bottom: 1px solid var(--line); }
.rules td:last-child { text-align: right; font-weight: 800; color: var(--accent); width: 80px; }

/* ── leaderboard ─────────────────────────── */
.lb-table { display: flex; flex-direction: column; gap: 6px; }
.lb-head, .lb-row {
  display: grid;
  grid-template-columns: 44px 1fr 1fr 72px;
  gap: 10px; align-items: center;
  padding: 10px 14px;
}
.lb-head {
  font-size: 11px; color: var(--text-dim); letter-spacing: 1px; padding-bottom: 4px;
}
.lb-row {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
}
.lb-row.me { border-color: var(--accent); background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%); }
.lb-rank { font-weight: 800; color: var(--accent); font-size: 16px; }
.lb-team { font-weight: 700; }
.lb-team .lb-form { color: var(--text-dim); font-weight: 400; font-size: 11px; margin-left: 6px; }
.lb-owner { color: var(--text-dim); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-pts { text-align: right; font-weight: 800; font-size: 16px; }
.lb-empty {
  color: var(--text-dim); font-size: 13px; padding: 18px; text-align: center;
  background: var(--panel); border: 1px dashed var(--line); border-radius: 12px;
}

/* ── player pool ─────────────────────────── */
.pool-head { display: flex; justify-content: space-between; align-items: end; margin-bottom: 16px; flex-wrap: wrap; gap: 8px; }
.pool-stats { color: var(--text-dim); font-size: 12px; }
.pool-filters {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  margin-bottom: 14px;
}
.pool-select {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; color: var(--text); font-size: 13px; font-family: inherit;
}
.pool-toggle { display: flex; align-items: center; gap: 6px; color: var(--text-dim); font-size: 13px; cursor: pointer; }
.pool-toggle input { accent-color: var(--accent); }

.pool-list { display: flex; flex-direction: column; gap: 4px; }
.pool-row {
  display: grid;
  grid-template-columns: 32px 1fr auto 38px;
  gap: 10px; align-items: center;
  padding: 8px 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  transition: border-color 0.1s;
}
.pool-row:hover { border-color: var(--accent); }
.pr-flag { font-size: 18px; line-height: 1; }
.pr-meta { min-width: 0; }
.pr-name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-club { font-size: 11px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-roles { display: flex; gap: 3px; flex-wrap: wrap; }
.pr-cat { font-size: 11px; font-weight: 800; text-align: center; padding: 3px 0; border-radius: 4px; min-width: 32px; }
.pr-cat.cat-1 { background: rgba(92, 240, 194, 0.18); color: var(--accent); }
.pr-cat.cat-2 { background: rgba(120, 220, 200, 0.16); color: #6ed8b8; }
.pr-cat.cat-3 { background: rgba(255, 213, 92, 0.18); color: var(--accent-2); }
.pr-cat.cat-4 { background: rgba(255, 180, 100, 0.16); color: #ffb464; }
.pr-cat.cat-5 { background: rgba(255, 120, 120, 0.16); color: #ff8888; }
.pr-cat.cat-6 { background: rgba(154, 154, 182, 0.16); color: var(--text-dim); }

.role-chip {
  font-size: 9px; font-weight: 800; letter-spacing: 0.5px;
  padding: 2px 6px; border-radius: 4px;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text-dim);
}
.role-chip.role-GK  { color: #ffd55c; border-color: #5e4a14; }
.role-chip.role-CB  { color: #7aa6ff; border-color: #3b4e7d; }
.role-chip.role-FB  { color: #8dc7f0; border-color: #3b5b75; }
.role-chip.role-CM  { color: #5cf0c2; border-color: #1e6b54; }
.role-chip.role-WIN { color: #ff8e8e; border-color: #6b2a2a; }
.role-chip.role-ST  { color: #ffb454; border-color: #6b4a14; }

.pool-more { margin-top: 14px; text-align: center; }
.pool-more .ghost-btn { padding: 10px 18px; font-size: 13px; }

/* ── footer ──────────────────────────────── */
.footer {
  padding: 30px 20px; border-top: 1px solid var(--line);
  text-align: center; color: var(--text-dim); font-size: 12px;
  background: var(--bg-2);
}
.footer-sub { margin-top: 4px; opacity: 0.7; }

/* ── RTL polish ──────────────────────────────────────────────── */
[dir="rtl"] .brand { flex-direction: row-reverse; }
[dir="rtl"] .hdr-right { flex-direction: row-reverse; }
[dir="rtl"] .club-crest,
[dir="rtl"] .club-badge { margin-right: 0; margin-left: 4px; }
[dir="rtl"] .cand-pick { letter-spacing: 0; }
[dir="rtl"] .lb-head,
[dir="rtl"] .lb-row { direction: rtl; }
[dir="rtl"] .lb-pts { text-align: left; }
[dir="rtl"] .role-chip { letter-spacing: 0; }
[dir="rtl"] .hero-cta.ghost { margin-left: 0; margin-right: 10px; }

/* ── build (squad builder) ───────────────── */
.build {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px;
  padding: 18px; max-width: 1240px; margin: 0 auto;
}
@media (max-width: 900px) { .build { grid-template-columns: 1fr; } }
.build-left, .build-right { display: flex; flex-direction: column; gap: 14px; }
.build-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px;
}
.build-card h3 {
  font-size: 13px; letter-spacing: 1.5px; color: var(--text-dim);
  text-transform: uppercase; margin-bottom: 12px; font-weight: 700;
}

.spinner-display {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-bottom: 14px;
}
.spinner-single { margin-bottom: 14px; }
.spinner-box.big { min-height: 140px; }
.spinner-box.big .val { font-size: 32px; }
.spinner-box.flag.big .val { font-size: 64px; }
.spinner-box {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 18px 12px; display: flex; flex-direction: column; align-items: center;
  gap: 6px; min-height: 110px; justify-content: center; text-align: center;
}
.spinner-box .lbl { font-size: 10px; letter-spacing: 1.5px; color: var(--text-dim); font-weight: 700; }
.spinner-box .val { font-size: 28px; font-weight: 900; line-height: 1; }
.spinner-box.role .val { color: var(--accent); }
.spinner-box.flag .val { font-size: 56px; }
.spinner-box.spinning .val { animation: spin 0.06s linear infinite; }
.spinner-box.big {
  background:
    radial-gradient(ellipse 70% 50% at 50% 50%, rgba(92, 240, 194, 0.06), transparent 70%),
    var(--bg-2);
  box-shadow: inset 0 0 30px rgba(92, 240, 194, 0.08);
  border: 1.5px solid var(--line);
  transition: border-color 0.3s, box-shadow 0.3s;
}
.spinner-box.big.spinning {
  border-color: var(--accent);
  box-shadow:
    inset 0 0 40px rgba(92, 240, 194, 0.2),
    0 0 30px rgba(92, 240, 194, 0.25);
}

.spin-action {
  display: block; width: 100%; padding: 18px;
  background: linear-gradient(135deg, var(--accent) 0%, #6ed8b8 50%, var(--accent) 100%);
  background-size: 200% 100%;
  color: #0a0a12; border-radius: 12px;
  font-weight: 900; font-size: 18px; letter-spacing: 2px;
  margin-bottom: 10px;
  transition: transform 0.15s, box-shadow 0.15s, background-position 0.4s;
  box-shadow: 0 4px 30px rgba(92, 240, 194, 0.3);
  position: relative;
  overflow: hidden;
}
.spin-action:disabled {
  opacity: 0.35; cursor: not-allowed; background: var(--panel); color: var(--text-dim);
  box-shadow: none;
}
.spin-action:not(:disabled):hover {
  transform: translateY(-2px);
  background-position: 100% 0;
  box-shadow: 0 6px 40px rgba(92, 240, 194, 0.5);
}
.spin-action:not(:disabled)::before {
  content: "⚽"; margin-right: 10px; display: inline-block;
  animation: ball-spin 4s linear infinite;
}
@keyframes ball-spin {
  to { transform: rotate(360deg); }
}
.spin-hint { color: var(--text-dim); font-size: 13px; text-align: center; min-height: 1.2em; }

.candidates { display: flex; flex-direction: column; gap: 4px; max-height: 50vh; overflow-y: auto; }
.cand-row {
  display: grid; grid-template-columns: 28px 28px 1fr auto; gap: 10px; align-items: center;
  padding: 8px 12px; background: var(--bg-2); border: 1px solid transparent;
  border-radius: 8px; cursor: pointer; transition: border-color 0.1s;
}
.cand-flag { font-size: 20px; line-height: 1; text-align: center; }
.cand-head-flag { font-size: 22px; vertical-align: middle; margin-right: 2px; }
.cand-row:hover { border-color: var(--accent); }
.cand-no { color: var(--text-dim); font-size: 11px; font-weight: 700; text-align: center; }
.cand-name { font-weight: 700; font-size: 13px; }
.cand-club { font-size: 11px; color: var(--text-dim); }
.cand-pick {
  background: var(--accent); color: #0a0a12; font-weight: 800;
  padding: 4px 10px; border-radius: 6px; font-size: 11px; letter-spacing: 0.5px;
}

/* squad slots panel (right column) */
.slots-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.slot-card {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px; min-height: 78px;
  display: flex; flex-direction: column; gap: 4px;
}
.slot-card.next   { border-color: var(--accent-2); box-shadow: 0 0 0 2px rgba(255,213,92,0.18); }
.slot-card.filled { border-color: var(--accent); }
.slot-card.wild   { border-style: dashed; }
.slot-card .slot-tag { font-size: 10px; letter-spacing: 1px; color: var(--text-dim); font-weight: 800; }
.slot-card .slot-name { font-size: 13px; font-weight: 700; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; }
.slot-card .slot-nation { font-size: 11px; color: var(--text-dim); }
.slot-card .slot-empty { color: var(--text-dim); font-size: 12px; font-style: italic; }

.constraint-line {
  display: flex; justify-content: space-between; padding: 6px 0;
  font-size: 13px; border-bottom: 1px solid var(--line);
}
.constraint-line:last-child { border-bottom: none; }
.constraint-line .ok { color: var(--accent); font-weight: 700; }
.constraint-line .bad { color: var(--accent-2); font-weight: 700; }

.submit-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.team-name-input {
  flex: 1; min-width: 200px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 12px; color: var(--text); font-size: 15px; font-weight: 600;
}
.submit-btn {
  background: var(--accent); color: #0a0a12; padding: 12px 22px;
  border-radius: 10px; font-weight: 800; font-size: 14px; letter-spacing: 0.5px;
}
.submit-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.submit-btn:not(:disabled):hover { transform: translateY(-2px); }
.submit-msg { font-size: 13px; min-height: 1.2em; margin-top: 8px; color: var(--accent-2); }

/* ── bucket picker (after spin) ──────────────────────────────── */
.bucket-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px;
}
@media (max-width: 600px) { .bucket-grid { grid-template-columns: repeat(3, 1fr); } }
.bucket-btn {
  background: var(--bg-2); border: 1.5px solid var(--line); border-radius: 10px;
  padding: 12px 6px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
}
.bucket-btn:not(.disabled):hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(92, 240, 194, 0.18);
}
.bucket-btn.disabled { opacity: 0.35; cursor: not-allowed; }
.bucket-btn .bk-tag {
  font-weight: 900; font-size: 14px; letter-spacing: 1px;
}
.bucket-btn .bk-meta { font-size: 10px; color: var(--text-dim); }
.bucket-btn.bucket-GK  .bk-tag { color: #ffd55c; }
.bucket-btn.bucket-DEF .bk-tag { color: #7aa6ff; }
.bucket-btn.bucket-MID .bk-tag { color: var(--accent); }
.bucket-btn.bucket-WIN .bk-tag { color: #ff8e8e; }
.bucket-btn.bucket-FWD .bk-tag { color: #ffb454; }

/* role chips inline with name */
.cand-roles { margin-left: 6px; display: inline-flex; gap: 3px; }

/* ── per-category status (max 2) ─────────────────────────────── */
.cat-status-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px;
}
.cat-pill {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 4px; text-align: center;
  display: flex; flex-direction: column; gap: 2px;
}
.cat-pill span { font-size: 10px; color: var(--text-dim); letter-spacing: 1px; font-weight: 700; }
.cat-pill b    { font-size: 14px; font-weight: 800; }
.cat-pill.full { border-color: var(--accent); background: var(--panel-2); }
.cat-pill.full b { color: var(--accent); }

/* ── sub-in rows ─────────────────────────────────────────────── */
.subin-row {
  display: grid; grid-template-columns: 1fr 30px 1fr; align-items: center;
  width: 100%; gap: 8px; padding: 10px 12px; margin-bottom: 6px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  text-align: left; cursor: pointer; transition: border-color 0.1s;
}
.subin-row:hover { border-color: var(--accent-2); }
.subin-row .swap-arrow {
  text-align: center; font-size: 18px; color: var(--accent-2); font-weight: 800;
}

/* ── modal overlay (submit confirmation + squad viewer) ──────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadein 0.2s;
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; padding: 28px;
  max-width: 420px; width: 100%; max-height: 90vh; overflow-y: auto;
  position: relative; text-align: center;
  animation: popin 0.2s;
}
@keyframes popin { from { transform: scale(0.95); } to { transform: scale(1); } }
.modal-x {
  position: absolute; top: 12px; right: 12px;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-2); border: 1px solid var(--line);
  font-size: 20px; color: var(--text); line-height: 1;
}
.modal-x:hover { background: var(--panel-2); }
.modal-badge { font-size: 50px; margin-bottom: 10px; }
.modal-title { font-size: 24px; font-weight: 900; margin-bottom: 8px; }
.modal-sub { color: var(--text-dim); font-size: 13px; line-height: 1.5; margin-bottom: 18px; }
.modal-actions { display: flex; flex-direction: column; gap: 8px; }
.modal-btn {
  padding: 12px 18px; border-radius: 10px; font-weight: 800; font-size: 14px;
  text-decoration: none; display: block; text-align: center;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
}
.modal-btn:hover { transform: translateY(-1px); }
.modal-btn.primary { background: var(--accent); color: #0a0a12; border-color: var(--accent); }
.modal-btn.whatsapp { background: #25D366; color: #0a0a12; border-color: #25D366; }
.modal-btn.copy { background: var(--bg-2); }
.modal-btn.ghost { background: transparent; color: var(--text-dim); }

/* ── clickable leaderboard rows ─────────────────────────────── */
.lb-row.clickable { cursor: pointer; transition: border-color 0.1s, transform 0.1s; }
.lb-row.clickable:hover { border-color: var(--accent); transform: translateX(2px); }

/* ── wildcard help icon ─────────────────────────────────────── */
.wildcard-help {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--bg-2); border: 1px solid var(--line);
  color: var(--accent-2); font-weight: 800; font-size: 12px;
  cursor: help;
}
.wildcard-help:hover { background: var(--panel-2); border-color: var(--accent-2); }

/* ── homepage "My Squad" card ────────────────────────────────── */
.my-squad-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px;
}
.my-squad-card .pitch442 { aspect-ratio: 1 / 1.25; width: 100%; max-width: 460px; margin: 0 auto; }
.my-squad-card .bench { margin-top: 10px; max-width: 460px; margin-left: auto; margin-right: auto; }

/* ── pitch (4-4-2) inside the build squad card ────────────────── */
.pitch-wrap { display: flex; flex-direction: column; gap: 10px; }
.pitch442 {
  position: relative;
  aspect-ratio: 1 / 1.35;
  background:
    repeating-linear-gradient(0deg,
      rgba(255,255,255,0.04) 0 36px,
      rgba(0,0,0,0.04) 36px 72px),
    linear-gradient(180deg, var(--pitch-green) 0%, var(--pitch-green-2) 100%);
  border-radius: 12px; border: 1px solid var(--line);
  overflow: hidden;
}
.pitch442 .pl-box, .pitch442 .pl-circle, .pitch442 .pl-halfway { pointer-events: none; }
.pitch442 .pl-box {
  position: absolute; left: 25%; right: 25%; height: 60px;
  border: 2px solid rgba(255,255,255,0.22);
}
.pitch442 .pl-box-top { top: 0; border-top: none; }
.pitch442 .pl-box-bottom { bottom: 0; border-bottom: none; }
.pitch442 .pl-circle {
  position: absolute; left: 50%; top: 50%;
  width: 90px; height: 90px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.22);
  transform: translate(-50%, -50%);
}
.pitch442 .pl-halfway {
  position: absolute; left: 0; right: 0; top: 50%; height: 0;
  border-top: 2px solid rgba(255,255,255,0.22);
}
.pitch-slot {
  position: absolute; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 72px; max-width: 90px; text-align: center;
  z-index: 2;
}
.pitch-slot .ps-flag {
  font-size: 22px; line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
  margin-bottom: 2px;
}
.pitch-slot .ps-name, .pitch-slot .ps-tag, .pitch-slot .ps-empty {
  background: rgba(10, 10, 18, 0.82);
  border: 1.5px solid rgba(255,255,255,0.28);
  border-radius: 8px;
  padding: 3px 7px;
  color: var(--text);
}
.pitch-slot .ps-name {
  font-size: 11px; font-weight: 800;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 90px;
}
.pitch-slot .ps-tag {
  font-size: 9px; letter-spacing: 1px; font-weight: 800;
  color: var(--text-dim);
  background: rgba(10, 10, 18, 0.6);
  padding: 1px 6px;
}
.pitch-slot.empty .ps-empty {
  font-size: 10px; letter-spacing: 1px; font-weight: 800; color: rgba(255,255,255,0.6);
  border-style: dashed; background: rgba(10, 10, 18, 0.5);
}
.pitch-slot.filled .ps-name { border-color: var(--accent); }

.bench {
  display: flex; flex-direction: column; gap: 6px;
}
.bench-label {
  font-size: 10px; letter-spacing: 1.5px; color: var(--text-dim); font-weight: 800;
}
.bench-slot {
  background: var(--bg-2); border: 1px dashed var(--line); border-radius: 10px;
  padding: 10px 12px; font-size: 13px; color: var(--text-dim);
}
.bench-slot.filled { border-style: solid; border-color: var(--accent-2); color: var(--text); }

/* ── flag images (flagcdn) ───────────────────────────────────── */
.flag-img {
  width: 24px; height: 18px; object-fit: cover;
  border-radius: 2px; box-shadow: 0 1px 2px rgba(0,0,0,0.4);
  vertical-align: middle;
}
.flag-img-mid {
  width: 36px; height: 27px; object-fit: cover;
  border-radius: 3px; box-shadow: 0 2px 5px rgba(0,0,0,0.5);
  vertical-align: middle;
}
.flag-img-big {
  width: 96px; height: 72px; object-fit: cover;
  border-radius: 4px; box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  vertical-align: middle;
}
.reel-code { font-size: 22px; font-weight: 900; margin-left: 8px; vertical-align: middle; color: var(--text); }

/* ── club crest / initial badge ───────────────────────────────── */
.club-crest {
  width: 18px; height: 18px; object-fit: contain;
  margin-right: 4px; vertical-align: middle;
  border-radius: 3px;
  background: rgba(255,255,255,0.04);
}
.club-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 4px;
  font-size: 9px; font-weight: 800; letter-spacing: 0.5px;
  margin-right: 4px; vertical-align: middle;
}
.cand-club { display: flex; align-items: center; }
.cand-meta { min-width: 0; overflow: hidden; }
.cand-name { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cand-club { font-size: 11px; color: var(--text-dim); }
.cand-club span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
