:root {
  --night: #0a1226;
  --night-2: #121d3b;
  --ink: #eef2ff;
  --muted: #9aa6c7;
  --pitch-a: #2f8d40;
  --pitch-b: #2a8039;
  --chalk: rgba(255, 255, 255, 0.72);
  --gold: #f5c542;
  --you: #39c0ff;
  --opp: #ff5d6c;
  --player-frame: #d9b44a;
  --skill-frame: #1fa58b;
  --stadium-frame: #6b4bd8;
  --nation-frame: #c7254e;
  --good: #46e08a;
  --bad: #ff5d6c;
  --sidebar: 260px;
  /* Field rows are full size; Stadium/Nationality rows are 72% (see .spell-row), which leaves more room for players. */
  --cw-base: clamp(40px, min(calc((100dvh - 340px) / 6.5), calc((100vw - var(--sidebar) - 72px) / 7.5)), 122px);
  --cw: var(--cw-base);
  --ch: calc(var(--cw) * 1.4);
  --slot-w: calc(var(--cw) * 1.16);
  --gap: calc(var(--cw) * 0.1);
  --radius: calc(var(--cw) * 0.08);
  --dur: 1;
  color-scheme: dark;
}

@media (prefers-reduced-motion: reduce) {
  :root { --dur: 0.25; }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
html { overflow-x: clip; } /* phones: the page never slides sideways (only the card rows scroll) */
body {
  background: radial-gradient(1200px 600px at 50% -10%, #1b2c5c 0%, var(--night) 60%) fixed, var(--night);
  color: var(--ink);
  font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
  overflow-x: clip;
}
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 16px; height: 44px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.logo { margin: 0; font-size: 18px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 900; }
.logo span { color: var(--gold); margin-left: 4px; }
.top-actions { display: flex; gap: 8px; }
.btn {
  background: var(--night-2); border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 8px;
  padding: 6px 12px; cursor: pointer; font-weight: 600;
}
.btn:hover:not(:disabled) { border-color: var(--gold); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: var(--gold); color: #1a1400; border-color: var(--gold); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); }
kbd {
  font: 11px/1 ui-monospace, monospace; padding: 2px 5px; border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.06);
}

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: 1fr var(--sidebar); gap: 16px; padding: 8px 16px 16px; }
.board { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.sidebar { display: flex; flex-direction: column; gap: 12px; min-height: 0; max-height: calc(100dvh - 68px); position: sticky; top: 8px; }

@media (max-width: 900px) {
  :root {
    --sidebar: 0px;
    --cw-base: clamp(38px, calc((100vw - 32px) / 7.4), 104px);
  }
  .layout { grid-template-columns: 1fr; padding: 8px 16px 16px; }
  .sidebar { position: static; max-height: none; }
  .preview { display: none; }
  .log { max-height: 180px; }
  .topbar .hide-sm { display: none; }
}

/* ---------- duelist bars ---------- */
.duelist {
  width: 100%; max-width: calc(var(--slot-w) * 6 + var(--gap) * 5 + 32px);
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08); position: relative; min-height: 44px;
}
.duelist.active { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-weight: 900; font-size: 13px; color: #fff;
}
.duelist.you .avatar { background: linear-gradient(135deg, #1e7fd1, var(--you)); }
.duelist.opp .avatar { background: linear-gradient(135deg, #a3182a, var(--opp)); }
.d-name { font-weight: 700; white-space: nowrap; }
.d-sub { color: var(--muted); font-size: 12px; }
.lp { margin-left: auto; text-align: right; min-width: 110px; }
.lp-label { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.lp-value { font-size: 22px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1; }
.lp-bar { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.12); margin-top: 3px; overflow: hidden; }
.lp-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--bad), var(--gold) 45%, var(--good)); transition: width calc(0.7s * var(--dur)); }
.duelist.shake { animation: shake calc(0.45s * var(--dur)); }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.opp-hand { display: flex; gap: 0; margin-left: 8px; }
.opp-hand .mini-back {
  width: 22px; height: 31px; border-radius: 3px; margin-left: -8px; border: 1px solid rgba(255, 255, 255, 0.5);
  background: repeating-linear-gradient(135deg, #18306b 0 4px, #1e3b82 4px 8px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}
.opp-hand .mini-back:first-child { margin-left: 0; }

.speech {
  position: absolute; left: 50px; top: calc(100% + 6px); z-index: 30; max-width: min(320px, 80vw);
  background: #fff; color: #111; border-radius: 12px; padding: 8px 12px; font-weight: 600; font-size: 13px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4); pointer-events: none;
  animation: pop calc(0.25s * var(--dur)) ease-out;
}
.speech::before { content: ""; position: absolute; top: -6px; left: 14px; border: 6px solid transparent; border-top: 0; border-bottom-color: #fff; }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } }

/* ---------- pitch ---------- */
.pitch {
  position: relative; padding: calc(var(--gap) * 2) 16px; border-radius: 14px;
  background:
    repeating-linear-gradient(0deg, var(--pitch-a) 0 calc(var(--ch) * 0.5), var(--pitch-b) calc(var(--ch) * 0.5) calc(var(--ch) * 1));
  box-shadow: 0 0 0 4px #1f5f2b, 0 20px 60px rgba(0, 0, 0, 0.5) ;
  overflow: hidden;
}
.pitch::before { /* outer touchline + center circle */
  content: ""; position: absolute; inset: 8px; border: 2px solid var(--chalk); border-radius: 6px; pointer-events: none;
}
.pitch::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: calc(var(--ch) * 1.1); height: calc(var(--ch) * 1.1);
  transform: translate(-50%, -50%); border: 2px solid var(--chalk); border-radius: 50%; pointer-events: none;
}
.half { position: relative; display: flex; flex-direction: column; gap: var(--gap); }
.half::before { /* penalty box */
  content: ""; position: absolute; left: 22%; right: 22%; height: 46%; border: 2px solid var(--chalk); pointer-events: none;
}
.opp-half::before { top: -10px; border-top: 0; }
.you-half::before { bottom: -10px; border-bottom: 0; }
.midline {
  position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; margin: calc(var(--gap) * 0.5) 0;
}
.midline::before { content: ""; position: absolute; left: -16px; right: -16px; top: 50%; border-top: 2px solid var(--chalk); z-index: -1; }

.zone-row { display: grid; grid-template-columns: repeat(6, var(--slot-w)); gap: var(--gap); position: relative; z-index: 1; }
.slot {
  width: var(--slot-w); height: var(--ch); border-radius: var(--radius); position: relative;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.06); border: 1.5px dashed rgba(255, 255, 255, 0.28);
}
.slot.spell-slot { background: rgba(10, 18, 38, 0.18); }
.slot.pile { border-style: solid; background: rgba(10, 18, 38, 0.35); cursor: default; }
.slot.pile .pile-count {
  position: absolute; bottom: 4px; left: 0; right: 0; text-align: center; font-weight: 900;
  font-size: calc(var(--cw) * 0.16); text-shadow: 0 1px 3px #000; pointer-events: none;
}
.slot.pile .pile-label {
  position: absolute; top: 4px; left: 0; right: 0; text-align: center; font-size: calc(var(--cw) * 0.11);
  letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255, 255, 255, 0.8); pointer-events: none;
}
button.slot.pile { cursor: pointer; }
.slot.selectable { border-color: var(--gold); border-style: solid; box-shadow: 0 0 0 2px var(--gold), 0 0 18px rgba(245, 197, 66, 0.6); }

/* ---------- phase bar ---------- */
.next-btn { white-space: nowrap; }
.hint {
  min-height: 20px; text-align: center; font-size: 13px; color: var(--ink); max-width: 100%;
}
.hint .btn { padding: 2px 10px; margin-left: 6px; }
@media (max-width: 560px) {
  :root { --cw-base: clamp(34px, calc((100vw - 56px) / 7.5), 68px); }
  .layout { padding: 6px 8px 12px; }
  .pitch { padding: calc(var(--gap) * 2) 8px; }
  .midline::before { left: -8px; right: -8px; }
  .next-btn { padding: 4px 10px; font-size: 13px; }
  .duelist { gap: 8px; padding: 6px 8px; }
  .d-title { display: none; }
  .lp { min-width: 0; }
  .lp-value { font-size: 19px; }
  .hint { font-size: 12px; }
}

/* ---------- hand ---------- */
.you-hand {
  display: flex; justify-content: center; min-height: calc(var(--ch) + 8px); padding-top: 6px; width: 100%;
  max-width: calc(var(--slot-w) * 7);
}
.you-hand .card { margin-left: calc(var(--cw) * var(--overlap, 0) * -1); transition: transform 0.15s; }
.you-hand .card:first-child { margin-left: 0; }
.you-hand .card:hover, .you-hand .card:focus-visible { transform: translateY(-10px); z-index: 5; }
.you-hand .card.playable .rot { box-shadow: 0 0 0 2px var(--gold), 0 0 14px rgba(245, 197, 66, 0.55); }

/* ---------- cards ---------- */
.card {
  --radius: calc(var(--cw) * 0.08);
  width: var(--cw); height: calc(var(--cw) * 1.4); padding: 0; border: 0; background: none; cursor: pointer;
  position: relative; flex: none; perspective: 600px; border-radius: var(--radius);
}
.card .rot { width: 100%; height: 100%; border-radius: var(--radius); transition: transform 0.25s; }
.card.pos-def .rot { transform: rotate(-90deg) scale(0.74); }
.card .flipper { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; border-radius: var(--radius); }
.card.down .flipper { transform: rotateY(180deg); }
.face {
  position: absolute; inset: 0; backface-visibility: hidden; border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; text-align: left;
}
.face.back {
  transform: rotateY(180deg); border: calc(var(--cw) * 0.05) solid #e8ecf7;
  background:
    url(assets/logo/football-duel-crest-round.webp) center / 74% auto no-repeat, /* the game's crest on every card back (2026-11-20) */
    radial-gradient(circle at 50% 50%, rgba(245, 197, 66, 0.28) 0 38%, transparent 40%),
    repeating-linear-gradient(135deg, #18306b 0 6px, #1e3b82 6px 12px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45);
}
/* Your own face-down card: its name (and ATK/DEF) on a dark band across the back (ui.js cardHtml). */
.face.back .back-peek { position: absolute; left: 6%; right: 6%; top: 50%; transform: translateY(-50%); display: grid; gap: 1px; justify-items: center;
  padding: calc(var(--cw) * 0.04) calc(var(--cw) * 0.03); border-radius: calc(var(--cw) * 0.06); background: rgba(8, 12, 30, 0.82);
  border: 1px solid rgba(245, 197, 66, 0.55); color: #fff; text-align: center; line-height: 1.1; }
.face.back .back-peek b { font: 800 max(8px, calc(var(--cw) * 0.11)) system-ui, sans-serif; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card.pos-def .face.back .back-peek { left: -18%; right: -18%; transform: translateY(-50%) rotate(90deg); } /* a Defense card lies sideways: keep its label level */
.face.back .back-peek i { font: 700 max(8px, calc(var(--cw) * 0.095)) system-ui, sans-serif; font-style: normal; color: var(--gold, #f5c542); }
.face.front {
  background: var(--frame); padding: calc(var(--cw) * 0.045); gap: calc(var(--cw) * 0.03);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45);
  color: #111;
}
.card.player { --frame: linear-gradient(160deg, #f6dd8a, var(--player-frame) 45%, #9c7a1c); }
.card.skill { --frame: linear-gradient(160deg, #8ff0d7, var(--skill-frame) 50%, #0c5b4c); }
.card.stadium { --frame: linear-gradient(160deg, #b9a5ff, var(--stadium-frame) 50%, #2f1d7a); }
.card.nationality { --frame: linear-gradient(160deg, #ff9fb8, var(--nation-frame) 50%, #6a0f2a); }
.card.referee { --frame: linear-gradient(160deg, #3a3a3a, #111 50%, #3a3a3a); }
.card.coach { --frame: linear-gradient(160deg, #5c8f5f, #1f4d2a 55%, #0f2a17); }
.card.coach .face.front { color: #e8ffe9; }
.c-ab { color: #b06a00; font-size: 0.95em; }
.ability-line { background: rgba(245, 197, 66, 0.12); border-left: 3px solid var(--gold); padding: 4px 8px; border-radius: 4px; }
.card.referee .face.front { color: #ffd400; }
.card.stadium .face.front, .card.nationality .face.front { color: #fff; }
.c-head { display: flex; justify-content: space-between; align-items: center; gap: 2px; font-weight: 800; font-size: calc(var(--cw) * 0.12); line-height: 1.1; }
.c-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-pos { flex: none; background: rgba(0, 0, 0, 0.75); color: #fff; border-radius: 3px; padding: 0 3px; font-size: calc(var(--cw) * 0.095); }
.c-stars { font-size: calc(var(--cw) * 0.1); color: #7a1d00; font-weight: 900; line-height: 1; letter-spacing: -0.02em; }
.c-art { flex: 1; min-height: 0; border-radius: calc(var(--radius) * 0.6); overflow: hidden; border: 1px solid rgba(0, 0, 0, 0.35); background: #222; }
.c-art svg.art { width: 100%; height: 100%; display: block; }
.c-type { font-size: calc(var(--cw) * 0.09); font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; text-align: center; opacity: 0.9; }
.c-stats {
  display: flex; justify-content: space-between; font-weight: 900; font-variant-numeric: tabular-nums;
  font-size: calc(var(--cw) * 0.12); line-height: 1.1; background: rgba(255, 255, 255, 0.55); border-radius: 3px; padding: 0 3px;
}
/* pitch and hand: never under 8 px (small desktops in Strategy had 7 px numbers, 2026-11-24; phone rules further down win) */
.zone-row .card .c-stats, #you-hand .card .c-stats { font-size: max(8px, calc(var(--cw) * 0.12)); letter-spacing: -0.02em; }
.c-stats .up { color: #0a7d3c; }
.c-stats .down { color: #b3001b; }
.card.selectable .rot { box-shadow: 0 0 0 3px var(--gold), 0 0 20px rgba(245, 197, 66, 0.8); }
.card.selected .rot { box-shadow: 0 0 0 3px var(--you), 0 0 20px rgba(57, 192, 255, 0.8); }
.card.spent { filter: saturate(0.55) brightness(0.85); }
.card .badge {
  position: absolute; top: -6px; right: -6px; z-index: 3; background: var(--gold); color: #000; font-size: 10px;
  font-weight: 900; border-radius: 999px; padding: 1px 5px; pointer-events: none;
}

/* large card (preview / spotlight / details) */
.big { --cw: 200px; }
.preview { background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 12px; padding: 12px; }
.preview-empty { color: var(--muted); font-size: 13px; text-align: center; padding: 30px 8px; }
.preview .big, .details .big { margin: 0 auto 10px; display: block; cursor: default; }
.card-info h3 { margin: 0 0 2px; font-size: 16px; }
.real-name { margin: 0 0 4px; font-size: 13px; color: var(--muted); }
.real-name b { color: var(--ink); }
.card-info .meta { color: var(--muted); font-size: 12px; margin-bottom: 6px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.card-info .meta .flag { width: 21px; height: 14px; vertical-align: -2px; border-radius: 2px; }
.card-info p { margin: 6px 0 0; font-size: 13px; }
.card-info .stats-line { font-weight: 800; font-variant-numeric: tabular-nums; }

/* log */
.log {
  flex: 1; min-height: 120px; overflow: auto; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px; padding: 8px 10px; font-size: 12px;
}
.log h2 { margin: 0 0 6px; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.log ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column-reverse; gap: 3px; }
.log li { color: #c9d2ee; }
.log li.p0 b { color: var(--you); }
.log li.p1 b { color: var(--opp); }
.log li.turn { color: var(--gold); font-weight: 700; margin-top: 4px; }

/* ---------- menu ---------- */
.menu {
  position: fixed; z-index: 50; min-width: 190px; background: #fff; color: #111; border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5); padding: 6px; display: flex; flex-direction: column; gap: 2px;
  animation: pop calc(0.15s * var(--dur)) ease-out;
}
.menu[hidden] { display: none; }
.menu .m-title { font-weight: 800; font-size: 12px; padding: 4px 8px; color: #555; }
.menu button {
  text-align: left; background: none; border: 0; border-radius: 6px; padding: 7px 10px; cursor: pointer; font-weight: 600; color: #111;
}
.menu button:hover:not(:disabled), .menu button:focus-visible { background: #f1e3b3; outline: none; }
.menu button:disabled { color: #999; cursor: not-allowed; }
.menu button .why { display: block; font-size: 11px; font-weight: 500; color: #a33; }

/* ---------- modal ---------- */
.modal-back {
  position: fixed; inset: 0; z-index: 60; background: rgba(4, 8, 20, 0.72); display: grid; place-items: center; padding: 16px;
  animation: fade calc(0.2s * var(--dur));
}
@keyframes fade { from { opacity: 0; } }
.modal {
  background: var(--night-2); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 16px; padding: 20px;
  width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow: auto; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  animation: pop calc(0.2s * var(--dur)) ease-out;
}
.modal h2 { margin: 0 0 8px; }
.modal .actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.modal .pick-grid { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; --cw: 92px; margin-top: 12px; }
.modal.rules { width: min(760px, 100%); }
.modal.rules h3 { margin: 16px 0 4px; color: var(--gold); font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em; }
.modal.rules ul { margin: 4px 0; padding-left: 18px; }
.modal.rules li { margin: 2px 0; }
.result-big { font-size: 40px; font-weight: 900; text-align: center; margin: 4px 0; }
.result-big.win { color: var(--gold); }
.result-big.lose { color: var(--opp); }
.details { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start; }
@media (max-width: 560px) { .details { grid-template-columns: 1fr; } .details .big { --cw: 170px; } }

/* ---------- fx layer ---------- */
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 40; }
.banner {
  position: absolute; left: 0; right: 0; top: 42%; text-align: center; font-size: clamp(26px, 5vw, 54px); font-weight: 900;
  letter-spacing: 0.08em; text-transform: uppercase; color: #fff; text-shadow: 0 4px 0 rgba(0, 0, 0, 0.35), 0 0 30px rgba(245, 197, 66, 0.6);
  background: linear-gradient(90deg, transparent, rgba(10, 18, 38, 0.85) 20%, rgba(10, 18, 38, 0.85) 80%, transparent);
  padding: 10px 0;
}
.banner small { display: block; font-size: 0.35em; letter-spacing: 0.2em; color: var(--gold); }
.float {
  position: absolute; font-weight: 900; font-size: 22px; text-shadow: 0 2px 6px #000; transform: translate(-50%, -50%);
  white-space: nowrap;
}
.float.minus { color: var(--bad); }
.float.plus { color: var(--good); }
.float.info { color: var(--gold); font-size: 16px; }
.spotlight { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.spotlight .big { --cw: min(220px, 50vw); pointer-events: none; }
.spotlight .caption { background: rgba(10, 18, 38, 0.9); padding: 6px 14px; border-radius: 999px; font-weight: 800; }
.spotlight.slow { pointer-events: auto; cursor: pointer; }
.spotlight .sl-skip { font-size: 12px; opacity: .7; }
.impact {
  position: absolute; width: 90px; height: 90px; border-radius: 50%; transform: translate(-50%, -50%);
  background: radial-gradient(circle, #fff 0 15%, rgba(255, 220, 120, 0.9) 30%, rgba(255, 120, 60, 0) 70%);
}

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- home ---------- */
.icon-btn { min-width: 34px; }
.sound-toggle[aria-pressed="false"] { opacity: 0.45; text-decoration: line-through; }
.home {
  position: fixed; inset: 0; z-index: 55; overflow: auto; overflow-x: hidden; overscroll-behavior-x: none;
  background:
    radial-gradient(900px 500px at 50% 0%, rgba(245, 197, 66, 0.18), transparent 70%),
    repeating-linear-gradient(90deg, rgba(47, 141, 64, 0.22) 0 80px, rgba(42, 128, 57, 0.22) 80px 160px),
    var(--night);
}
.home[hidden] { display: none; }
.home-hero { text-align: center; }
.home-title { margin: 8px 0 4px; font-size: clamp(42px, 7vw, 84px); font-weight: 900; letter-spacing: 0.04em; text-transform: uppercase; line-height: 1; text-shadow: 0 6px 0 rgba(0, 0, 0, 0.35); }
.home-title span { color: var(--gold); display: block; }
.home-tag { color: var(--muted); margin: 10px 0 0; }
.home-cards { position: relative; height: 230px; --cw: 120px; }
.home-cards .card { position: absolute; left: 50%; top: 10px; cursor: default; transform-origin: 50% 120%; animation: deal 0.8s ease-out both; }
@keyframes deal { from { transform: translate(-50%, 60px) rotate(0) scale(0.6); opacity: 0; } }
.home-panel {
  background: rgba(18, 29, 59, 0.92); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 18px; padding: 22px;
  display: flex; flex-direction: column; gap: 12px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.field input, .join-row input {
  font: 600 16px/1.2 system-ui, sans-serif; color: var(--ink); background: var(--night); letter-spacing: normal; text-transform: none;
  border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 10px; padding: 10px 12px;
}
.field input:focus, .join-row input:focus { outline: 2px solid var(--gold); border-color: transparent; }
.deck-opt {
  text-align: left; background: var(--night); border: 2px solid rgba(255, 255, 255, 0.14); border-radius: 12px; padding: 10px; cursor: pointer;
  text-transform: none; letter-spacing: normal; display: flex; flex-direction: column; gap: 2px;
}
.deck-opt b { font-size: 14px; color: var(--ink); }
.deck-opt span { font-size: 12px; font-weight: 500; color: var(--muted); }
.deck-opt[aria-checked="true"] { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.big-btn { padding: 12px 16px; font-size: 16px; font-weight: 800; }
.online { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 12px; background: rgba(0, 0, 0, 0.2); }
.online[hidden] { display: none; }
.join-row { display: flex; gap: 8px; }
.join-row input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: 0.3em; font-weight: 900; }
.online-status { font-size: 13px; min-height: 18px; }
.online-status .code { display: inline-block; font: 900 26px/1 ui-monospace, monospace; letter-spacing: 0.25em; color: var(--gold); padding: 6px 10px; background: var(--night); border-radius: 8px; margin: 4px 0; }
.online-status .err { color: var(--bad); }
.home-links { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
@media (max-width: 800px) {
  .home-inner { grid-template-columns: 1fr; gap: 16px; padding: 20px 16px; }
  .home-cards { height: 170px; --cw: 86px; }
}
.waiting-dots::after { content: ""; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

/* ---------- legends & gold ---------- */
.card.legend { --frame: linear-gradient(160deg, #ffffff, #b9c3d6 30%, #6d7a92 60%, #e8edf6); }
.card.legend .face.front { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6) inset, 0 3px 10px rgba(0, 0, 0, 0.5); }
.card.gold, .card.piece { --frame: linear-gradient(115deg, #fff3b0 0%, #e6b33a 25%, #fff6c9 45%, #b8820f 65%, #f9dd7a 85%, #9c6a08 100%); }
.card.gold .face.front, .card.piece .face.front { background-size: 220% 220%; animation: goldsheen 4s ease-in-out infinite; }
@keyframes goldsheen { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.card.gold .rot { box-shadow: 0 0 calc(var(--cw) * 0.18) rgba(255, 210, 90, 0.75); }
.c-tag { font-size: 0.8em; letter-spacing: 0.06em; background: rgba(0, 0, 0, 0.75); color: #fff; border-radius: 3px; padding: 0 3px; vertical-align: 1px; }
.card.gold .c-tag { background: #6b4600; color: #ffe9a3; }
.vault-badge { font-size: 11px; font-weight: 800; color: #1a1400; background: linear-gradient(90deg, #f6d365, #e0a800); border-radius: 999px; padding: 1px 7px; margin-left: 4px; vertical-align: 1px; }
.rival-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.rival-row select { flex: 1; font: 600 14px system-ui, sans-serif; color: var(--ink); background: var(--night); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 8px; padding: 6px 8px; }
.online-deck { font-size: 13px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .card.gold .face.front, .card.piece .face.front { animation: none; } }

/* ---------- al3ab-hub tab bar (only shown on *.al3ab-hub.com) ---------- */
.hub-tabs { display: flex; align-items: center; gap: 4px; padding: 10px 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); background: rgba(7, 9, 26, 0.78); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); overflow-x: auto; scrollbar-width: none; }
.hub-tabs::-webkit-scrollbar { display: none; }
.hub-tabs[hidden] { display: none; }
.hub-brand { font-weight: 900; letter-spacing: 0.04em; margin-right: 10px; text-decoration: none; color: var(--ink); white-space: nowrap; }
.hub-brand span { color: var(--gold); }
/* same nav as the al3ab-hub.com home page (deploy/hub/index.html) */
.hub-tab { text-decoration: none; color: #a3acd2; font: 700 14px system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; padding: 8px 13px; border-radius: 999px; white-space: nowrap; border: 1px solid transparent; }
.hub-tab:hover { color: #f1f3ff; border-color: rgba(255, 255, 255, 0.1); }
.hub-tab[aria-current="page"] { background: rgba(255, 255, 255, 0.08); color: #f1f3ff; }
.home:has(.hub-tabs:not([hidden])) .home-inner { min-height: calc(100% - 56px); }

/* ---------- clearer plays: ribbons, plays bar, turn tracker, response prompt ---------- */
.ribbon {
  position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); z-index: 4; white-space: nowrap; pointer-events: none;
  font-size: max(9px, calc(var(--cw) * 0.1)); font-weight: 900; letter-spacing: 0.04em; padding: 2px 7px; border-radius: 999px;
  background: #fff; color: #111; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}
.ribbon.legend { background: linear-gradient(90deg, #e8edf6, #9aa6bd); color: #10172a; }
.ribbon.gold { background: linear-gradient(90deg, #ffe58a, #e0a800); color: #2a1a00; }
.ribbon.coach { background: #2c7a3c; color: #fff; }
.ribbon.armed { background: #ffd400; color: #111; }
.ribbon.muted { background: rgba(10, 18, 38, 0.92); color: var(--muted); }
.card.special-ready .rot { animation: special-pulse 1.4s ease-in-out infinite; }
@keyframes special-pulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--gold), 0 0 10px rgba(245, 197, 66, 0.5); }
  50% { box-shadow: 0 0 0 3px #fff3b0, 0 0 26px rgba(245, 197, 66, 0.95); }
}

.plays { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; width: 100%; max-width: calc(var(--slot-w) * 7); }
.plays[hidden] { display: none; }
.plays-title { width: 100%; text-align: center; font-size: 11px; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.play-btn {
  display: grid; text-align: left; gap: 1px; padding: 8px 14px; border-radius: 12px; cursor: pointer;
  background: var(--night-2); border: 1px solid rgba(255, 255, 255, 0.18); color: var(--ink); min-width: 150px;
}
.play-btn:hover:not(:disabled) { border-color: var(--gold); transform: translateY(-1px); }
.play-btn:disabled { cursor: default; opacity: 0.7; }
.pb-label { font-weight: 900; font-size: 14px; }
.pb-sub { font-size: 12px; color: var(--muted); }
.play-btn.gold { background: linear-gradient(135deg, #5a3f00, #2b1e00); border-color: #e0a800; animation: special-pulse 1.4s ease-in-out infinite; }
.play-btn.gold.info { animation: none; opacity: 0.85; }
.play-btn.gold .pb-label { color: #ffe58a; }
.play-btn.legend { background: linear-gradient(135deg, #3b4560, #1a2034); border-color: #c9d2e6; }
.play-btn.legend:not(:disabled) { animation: special-pulse 1.4s ease-in-out infinite; }
.play-btn.coach { background: linear-gradient(135deg, #1f4d2a, #0f2a17); border-color: #5fae6f; }
.play-btn.attack { background: linear-gradient(135deg, #6b1c1c, #3a0d0d); border-color: var(--bad); }


.turn-status {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; font-size: 13px;
  padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1);
}
.turn-status:empty { display: none; }
.turn-status.mine { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(245, 197, 66, 0.3) inset; }
.turn-status.theirs { border-color: rgba(255, 93, 108, 0.6); }
.ts-who { font-weight: 900; text-transform: uppercase; letter-spacing: 0.06em; }
.turn-status.mine .ts-who { color: var(--gold); }
.turn-status.theirs .ts-who { color: var(--opp); }
.ts-sep { color: var(--muted); }
.ts-phase { font-weight: 800; }
.ts-help { color: var(--muted); }
.tchip { font-size: 11px; font-weight: 800; border-radius: 999px; padding: 2px 8px; background: rgba(255, 255, 255, 0.08); }
.tchip.ok { background: rgba(70, 224, 138, 0.18); color: var(--good); }
.tchip.used { color: var(--muted); text-decoration: line-through; }
.tchip.next { background: rgba(245, 197, 66, 0.14); color: var(--gold); }
@media (max-width: 560px) { .ts-help { display: none; } }

/* response prompt */
.modal.respond { border-color: #ffd400; box-shadow: 0 0 0 2px rgba(255, 212, 0, 0.3), 0 30px 80px rgba(0, 0, 0, 0.6); }
.resp-what { font-size: 15px; background: rgba(255, 255, 255, 0.05); border-radius: 10px; padding: 8px 12px; }
.resp-list { display: grid; gap: 10px; margin-top: 10px; }
.resp-row { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 14px; padding: 10px; --cw: 84px; }
.resp-info { display: grid; gap: 4px; }
.resp-info p { margin: 0; font-size: 13px; color: #cfd6f3; }
.resp-type { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.resp-go { justify-self: start; margin-top: 4px; font-size: 15px; padding: 8px 14px; }
.resp-skip { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 13px; color: var(--muted); cursor: pointer; }
@media (max-width: 480px) { .resp-row { grid-template-columns: 1fr; justify-items: center; text-align: center; } .resp-go { justify-self: center; } }

/* compact plays row */
.plays-title { display: none; }
.play-btn { padding: 5px 12px; min-width: 0; border-radius: 10px; }
.pb-label { font-size: 13px; }
.pb-sub { font-size: 11px; }
.hint:empty { display: none; }
.board { gap: 4px; }
.ribbon { max-width: calc(var(--cw) * 1.05); overflow: hidden; text-overflow: ellipsis; }

/* ---------- bigger field: compact set-card rows ---------- */
#opp-spells, #you-spells {
  /* smaller cards, same columns as the player rows so everything lines up */
  --cw: calc(var(--cw-base) * 0.72); --ch: calc(var(--cw) * 1.4); --slot-w: calc(var(--cw-base) * 1.16); --gap: calc(var(--cw-base) * 0.1);
}
.hint-rc { font-size: 11px; color: var(--muted); }
.toast-hint { color: var(--gold); font-weight: 800; }
.btn.danger { border-color: rgba(255, 93, 108, 0.6); color: #ffb3bb; }
.btn.danger:hover:not(:disabled) { border-color: var(--bad); }

/* substitution: OFF / ON ribbons + confirmation */
.ribbon.out { background: var(--bad); color: #fff; }
.ribbon.in { background: var(--good); color: #062a14; }
.card.selected .ribbon.out { animation: pop calc(0.2s * var(--dur)) ease-out; }
#you-field .card.selected:has(.ribbon.out) .rot { box-shadow: 0 0 0 3px var(--bad), 0 0 20px rgba(255, 93, 108, 0.8); opacity: 0.8; }
.modal.subs-confirm { width: min(680px, 100%); border-color: var(--gold); }
.sub-swap { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-top: 10px; }
.sub-side { display: grid; gap: 6px; justify-items: center; background: rgba(255, 255, 255, 0.04); border-radius: 14px; padding: 10px; }
.sub-label { font-size: 12px; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; }
.sub-label.out { color: var(--bad); }
.sub-label.in { color: var(--good); }
.sub-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; --cw: 92px; }
.sub-card { position: relative; display: grid; justify-items: center; gap: 6px; }
.sub-card .card { cursor: default; }
.sub-tag { font-size: 12px; font-weight: 900; border-radius: 999px; padding: 2px 10px; }
.sub-tag.out { background: var(--bad); color: #fff; }
.sub-tag.in { background: var(--good); color: #062a14; }
.sub-row:has(.sub-tag.out) .card { filter: grayscale(0.5) brightness(0.85); }
.sub-arrow { font-size: 34px; color: var(--gold); animation: swap-pulse 1.2s ease-in-out infinite; }
@keyframes swap-pulse { 50% { transform: scale(1.2); } }
@media (max-width: 560px) { .sub-swap { grid-template-columns: 1fr; } .sub-arrow { transform: rotate(90deg); justify-self: center; } }

/* ---------- Legend cards: platinum holo frame ---------- */
.card.legend {
  --frame: linear-gradient(125deg, #ffffff 0%, #c7d0e2 18%, #8a96b0 32%, #f4f7ff 46%, #a9b4cc 60%, #e9d8ff 72%, #bfe8ff 84%, #ffffff 100%);
}
.card.legend .face.front { background-size: 260% 260%; animation: legendsheen 5s linear infinite; position: absolute; }
.card.legend .face.front::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: var(--radius);
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.55) 45%, rgba(190, 220, 255, 0.35) 50%, transparent 62%);
  background-size: 250% 100%; animation: holo 3.2s ease-in-out infinite; mix-blend-mode: overlay;
}
.card.legend .rot { box-shadow: 0 0 calc(var(--cw) * 0.14) rgba(200, 220, 255, 0.7); }
.card.legend .c-head { color: #10172a; }
.card.legend .c-tag { background: linear-gradient(90deg, #1b2440, #3e4c78); color: #e9eefc; }
.card.legend .c-stars { color: #2a3556; }
.card.legend .c-art { position: relative; }
.c-era {
  position: absolute; left: 0; right: 0; bottom: 14%; text-align: center; font-size: calc(var(--cw) * 0.07); font-weight: 900;
  letter-spacing: 0.06em; text-transform: uppercase; color: #10172a; background: linear-gradient(90deg, transparent, rgba(240, 244, 255, 0.92) 15%, rgba(240, 244, 255, 0.92) 85%, transparent);
  padding: 2px 0;
}
@keyframes legendsheen { from { background-position: 0% 50%; } to { background-position: 260% 50%; } }
@keyframes holo { 0%, 100% { background-position: 120% 0; } 50% { background-position: -20% 0; } }
.you-hand .card.legend:hover .rot { box-shadow: 0 0 calc(var(--cw) * 0.3) rgba(210, 225, 255, 0.95); }

/* ---------- Skin players: regular players with an illustration get a prismatic holo frame (plain-shirt players keep the gold one) ---------- */
.card.skin {
  --frame: linear-gradient(125deg, #7ff3e1 0%, #2bb3c9 16%, #6d5df6 32%, #e879f9 46%, #7ff3e1 56%, #3b82f6 70%, #a78bfa 84%, #7ff3e1 100%);
}
.card.skin .face.front { background-size: 260% 260%; animation: legendsheen 7s linear infinite; position: absolute; }
.card.skin .face.front::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: var(--radius);
  background: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, 0.45) 46%, rgba(200, 255, 245, 0.3) 51%, transparent 62%);
  background-size: 250% 100%; animation: holo 4s ease-in-out infinite; mix-blend-mode: overlay;
}
.card.skin .rot { box-shadow: 0 0 calc(var(--cw) * 0.12) rgba(140, 120, 255, 0.6); }
.card.skin .c-head, .card.skin .c-stars { color: #0b1030; }
.c-tag.skin { background: linear-gradient(90deg, #2bb3c9, #8b5cf6, #e879f9); color: #fff; }
.card.skin .c-art { position: relative; }
.b-grid .card.skin .face.front { animation: none; }
.b-grid .card.skin .face.front::after { display: none; }
@media (prefers-reduced-motion: reduce) { .card.skin .face.front, .card.skin .face.front::after { animation: none; } }

/* ---------- Blue Lock in play: the whole pitch turns blue with the padlock emblem in the centre (lockFx in ui.js) ---------- */
.pitch.blue-lock { box-shadow: 0 0 0 4px #1550d6, 0 0 32px rgba(60, 140, 255, 0.6), 0 20px 60px rgba(0, 0, 0, 0.5); }
.slock { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; border-radius: inherit; }
.slock > * { position: absolute; display: block; }
.sl-grass { inset: 0; background:
  radial-gradient(ellipse at 50% 50%, transparent 45%, rgba(2, 10, 40, 0.55) 100%),
  repeating-linear-gradient(0deg, #1446c8 0 calc(var(--ch, 60px) * 0.5), #0f3aaf calc(var(--ch, 60px) * 0.5) calc(var(--ch, 60px) * 1)); }
.sl-glow { left: 50%; top: 50%; width: 46%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle, rgba(110, 180, 255, 0.55), rgba(40, 110, 255, 0.15) 50%, transparent 70%); }
.sl-emblem { left: 50%; top: 50%; height: min(40%, 170px); width: auto; transform: translate(-50%, -40%); opacity: 0.92;
  filter: drop-shadow(0 0 14px rgba(120, 190, 255, 0.85)) drop-shadow(0 8px 14px rgba(0, 0, 0, 0.5)); }
.sl-name { left: 0; right: 0; top: calc(50% + min(25%, 108px)); text-align: center; font: 900 clamp(9px, 1.3vw, 13px) system-ui; letter-spacing: 0.32em;
  color: rgba(220, 236, 255, 0.85); text-shadow: 0 0 10px rgba(80, 160, 255, 0.9); }
.pitch.blue-lock .pitch-marks i:not(.pm-tint):not(.pm-spot) { border-color: rgba(200, 225, 255, 0.6); }
.pitch.blue-lock .pm-tint { opacity: 0; }
.pitch.blue-lock .st-skin, .pitch.blue-lock .pitch-lights { opacity: 0; } /* the blue pitch replaces any Stadium grass */
.slock.sl-intro .sl-grass { animation: sl-sweep 0.9s cubic-bezier(.2, .8, .2, 1) both; }
.slock.sl-intro .sl-emblem { animation: sl-drop 1.1s 0.35s cubic-bezier(.2, 1.5, .4, 1) both; }
.slock.sl-intro .sl-glow { animation: sl-flash 1.4s 0.5s ease-out both; }
@keyframes sl-sweep { from { clip-path: circle(0% at 50% 50%); } to { clip-path: circle(75% at 50% 50%); } }
@keyframes sl-drop { 0% { transform: translate(-50%, -160%) scale(1.6); opacity: 0; } 60% { transform: translate(-50%, -36%) scale(0.94); opacity: 1; }
  75% { transform: translate(-50%, -44%) scale(1.04) rotate(-4deg); } 100% { transform: translate(-50%, -40%); } }
@keyframes sl-flash { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4); } 40% { opacity: 1; transform: translate(-50%, -50%) scale(1.5); } 100% { transform: translate(-50%, -50%) scale(1); } }
@media (prefers-reduced-motion: reduce) { .slock .sl-grass, .slock .sl-emblem, .slock .sl-glow { animation: none !important; } }

/* ---------- Fantasy Field in play: the pitch becomes a Spartan arena (arenaFx in ui.js) ---------- */
.pitch.fantasy { box-shadow: 0 0 0 4px #8a5a1c, 0 0 30px rgba(255, 120, 30, 0.55), 0 20px 60px rgba(0, 0, 0, 0.5); }
.arena { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; border-radius: inherit; }
.arena > i { position: absolute; display: block; }
.ar-bg { inset: 0; background: repeating-linear-gradient(0deg, #c9a063 0 calc(var(--ch) * 0.5), #bb9157 calc(var(--ch) * 0.5) calc(var(--ch) * 1)); } /* sand, mowed in stripes like the grass */
.ar-shade { inset: 0; background: radial-gradient(ellipse at 50% 50%, transparent 55%, rgba(90, 40, 5, 0.45) 100%); }
.pitch.fantasy .pitch-marks i:not(.pm-tint):not(.pm-spot) { border-color: rgba(255, 236, 200, 0.55); }
.pitch.fantasy .pm-tint { opacity: 0; }
.pitch.fantasy .st-skin, .pitch.fantasy .pitch-lights { opacity: 0; } /* the arena replaces any Stadium grass */
.ar-embers {
  inset: -10% 0 0; opacity: 0.85; mix-blend-mode: screen;
  background-image:
    radial-gradient(2px 2px at 10% 90%, #ffcf6b 50%, transparent), radial-gradient(2px 2px at 30% 70%, #ff8a2b 50%, transparent),
    radial-gradient(1.5px 1.5px at 55% 85%, #ffe29a 50%, transparent), radial-gradient(2px 2px at 75% 60%, #ff9d3b 50%, transparent),
    radial-gradient(1.5px 1.5px at 90% 80%, #ffd27a 50%, transparent), radial-gradient(2px 2px at 45% 40%, #ff7a1a 50%, transparent);
  background-size: 180px 220px; animation: ar-rise 6s linear infinite;
}
@keyframes ar-rise { from { background-position: 0 0; } to { background-position: 30px -220px; } }
/* torches: a bronze bowl and three flickering flames */
.ar-torch { width: clamp(20px, calc(var(--cw) * 0.42), 54px); aspect-ratio: 1 / 1.6; }
.ar-torch::after { /* the bowl */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 26%; border-radius: 0 0 50% 50% / 0 0 100% 100%;
  background: linear-gradient(180deg, #c58a3a, #5a3410); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}
.ar-torch b {
  position: absolute; left: 12%; right: 12%; bottom: 20%; height: 80%; border-radius: 50% 50% 35% 35% / 65% 65% 35% 35%;
  background: radial-gradient(ellipse at 50% 85%, #fffbe0 0 12%, #ffd34d 25%, #ff8c1a 50%, rgba(255, 60, 0, 0.6) 68%, transparent 72%);
  transform-origin: 50% 100%; animation: ar-flicker 0.9s ease-in-out infinite alternate; filter: blur(0.4px);
}
.ar-torch b:nth-child(2) { left: 0; right: 30%; height: 60%; animation-duration: 0.7s; animation-delay: -0.3s; opacity: 0.85; }
.ar-torch b:nth-child(3) { left: 30%; right: 0; height: 66%; animation-duration: 1.1s; animation-delay: -0.6s; opacity: 0.85; }
.ar-torch { filter: drop-shadow(0 0 10px rgba(255, 140, 30, 0.9)); }
@keyframes ar-flicker { 0% { transform: scale(1, 1) skewX(0deg); } 50% { transform: scale(0.92, 1.08) skewX(3deg); } 100% { transform: scale(1.05, 0.9) skewX(-3deg); } }
.ar-torch.tl { left: 4px; top: 4px; } .ar-torch.tr { right: 4px; top: 4px; }
.ar-torch.ml { left: 4px; top: 50%; translate: 0 -60%; } .ar-torch.mr { right: 4px; top: 50%; translate: 0 -60%; }
.ar-torch.bl { left: 4px; bottom: 4px; } .ar-torch.br { right: 4px; bottom: 4px; }
/* the moment it's played: a wall of fire sweeps up the pitch and the arena appears behind it */
.arena.ar-intro .ar-bg, .arena.ar-intro .ar-shade { animation: ar-reveal 1.4s ease-out both; }
.arena.ar-intro::after {
  content: ""; position: absolute; left: -10%; right: -10%; height: 45%; bottom: -45%;
  background: linear-gradient(0deg, transparent, rgba(255, 70, 0, 0.85) 30%, #ffb02e 55%, rgba(255, 240, 180, 0.9) 70%, transparent);
  filter: blur(6px); animation: ar-wall 1.4s ease-in forwards;
}
@keyframes ar-reveal { from { clip-path: inset(100% 0 0 0); filter: brightness(2.2) saturate(1.5); } to { clip-path: inset(0 0 0 0); } }
@keyframes ar-wall { from { bottom: -45%; opacity: 1; } 85% { opacity: 1; } to { bottom: 110%; opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ar-embers, .ar-torch b { animation: none; } }

/* ---------- cinematics (Legend summon, Gold fusion) ---------- */
.cinematic {
  position: fixed; inset: 0; z-index: 45; pointer-events: auto; cursor: pointer; overflow: hidden;
  display: grid; place-items: center; background: radial-gradient(ellipse at 50% 45%, rgba(30, 40, 80, 0.85), rgba(2, 4, 12, 0.96) 70%);
}
.cine-card { position: relative; z-index: 3; perspective: 900px; }
.cine-card .big { --cw: min(240px, 46vw, 30vh); pointer-events: none; }
.cine-glow { position: absolute; left: 50%; top: 45%; width: 70vmin; height: 70vmin; transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle, rgba(220, 230, 255, 0.55), rgba(140, 160, 255, 0.15) 40%, transparent 70%); opacity: 0; transition: opacity 0.6s; }
.cinematic.landed .cine-glow { opacity: 1; animation: glowpulse 1.6s ease-in-out infinite; }
@keyframes glowpulse { 50% { transform: translate(-50%, -50%) scale(1.12); } }
.cine-beams { position: absolute; inset: 0; z-index: 1; }
.cine-beams i {
  position: absolute; top: -10%; width: 26vmin; height: 130%; transform-origin: 50% 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.05) 70%, transparent);
  filter: blur(6px); clip-path: polygon(40% 0, 60% 0, 100% 100%, 0 100%);
}
.cine-beams i:nth-child(1) { left: 12%; animation: beam 2.4s ease-in-out infinite alternate; --a: -22deg; --b: -8deg; }
.cine-beams i:nth-child(2) { left: calc(50% - 13vmin); animation: beam 2s ease-in-out infinite alternate; --a: -4deg; --b: 4deg; }
.cine-beams i:nth-child(3) { right: 12%; animation: beam 2.6s ease-in-out infinite alternate; --a: 22deg; --b: 8deg; }
@keyframes beam { from { transform: rotate(var(--a)); } to { transform: rotate(var(--b)); } }
.cine-title {
  position: absolute; z-index: 4; left: 0; right: 0; bottom: 8vh; text-align: center; display: grid; gap: 2px;
  opacity: 0; transform: translateY(20px); transition: opacity 0.4s, transform 0.4s;
}
.cinematic.landed .cine-title { opacity: 1; transform: none; }
.cine-title small { font-size: 13px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--muted); }
.cine-title b {
  font-size: clamp(40px, 9vw, 92px); font-weight: 900; letter-spacing: 0.18em; line-height: 1;
  background: linear-gradient(90deg, #ffffff, #b9c6e6, #ffffff, #d9c7ff, #ffffff); background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: legendsheen 3s linear infinite;
  filter: drop-shadow(0 0 18px rgba(200, 215, 255, 0.7));
}
.cine-title span { font-size: clamp(16px, 2.4vw, 22px); font-weight: 800; color: #fff; }
.cine-sparks { position: absolute; left: 50%; top: 45%; z-index: 2; }
.spark {
  position: absolute; width: 6px; height: 6px; border-radius: 50%; left: -3px; top: -3px;
  animation: spark 1.3s cubic-bezier(.1, .7, .3, 1) forwards;
}
.spark.silver { background: #fff; box-shadow: 0 0 10px #bcd0ff, 0 0 18px #fff; }
.spark.gold { background: #fff3b0; box-shadow: 0 0 10px #f5c542, 0 0 18px #ffde7a; }
@keyframes spark { from { transform: translate(0, 0) scale(1.4); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) scale(0.2); opacity: 0; } }
.gold-cine { background: radial-gradient(ellipse at 50% 45%, rgba(90, 60, 0, 0.88), rgba(10, 6, 0, 0.97) 70%); }
.gold-cine .cine-glow { background: radial-gradient(circle, rgba(255, 225, 130, 0.7), rgba(245, 197, 66, 0.2) 40%, transparent 70%); }
.gold-cine .cine-title b { background-image: linear-gradient(90deg, #fff3b0, #e0a800, #fff6c9, #b8820f, #fff3b0); filter: drop-shadow(0 0 18px rgba(255, 200, 80, 0.8)); }
.gold-cine .cine-card { opacity: 0; }
.cine-pieces { position: absolute; left: 50%; top: 45%; z-index: 2; }
.cine-piece { position: absolute; transform: translate(-50%, -50%); }
.cine-piece .card.piece { --cw: min(150px, 28vw, 20vh); margin: calc(min(150px, 28vw, 20vh) * -0.7) 0 0 calc(min(150px, 28vw, 20vh) * -0.5); cursor: default; }
.gold-cine.flash::after { content: ""; position: absolute; inset: 0; background: #fff; animation: flash 0.5s ease-out forwards; pointer-events: none; z-index: 5; }
@keyframes flash { from { opacity: 0.9; } to { opacity: 0; } }
.cinematic .cine-title::after { content: "click to skip"; font-size: 11px; color: rgba(255, 255, 255, 0.35); margin-top: 6px; }
.impact-ring { position: absolute; width: 160px; height: 160px; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 0 30px #cfe0ff, inset 0 0 30px #cfe0ff; }
.impact-ring.gold { border-color: #ffe58a; box-shadow: 0 0 30px #f5c542, inset 0 0 30px #f5c542; }
@media (prefers-reduced-motion: reduce) {
  .card.legend .face.front, .card.legend .face.front::after, .cine-beams i, .cine-title b, .cinematic.landed .cine-glow { animation: none; }
}

/* ---------- deck picker: custom decks ---------- */
.deck-opt.custom { position: relative; border-color: rgba(245, 197, 66, 0.5); }
.deck-opt .deck-edit { position: absolute; top: 6px; right: 8px; font-size: 11px; font-weight: 800; color: var(--gold); padding: 2px 6px; border-radius: 6px; background: rgba(0, 0, 0, 0.3); }
.deck-opt .deck-edit:hover { background: rgba(245, 197, 66, 0.2); }
.deck-opt.build { border-style: dashed; border-color: rgba(245, 197, 66, 0.6); background: rgba(245, 197, 66, 0.06); }
.deck-opt.build b { color: var(--gold); }

/* ---------- deck builder ---------- */
body.builder-open { overflow: hidden; }
.builder {
  position: fixed; inset: 0; z-index: 55; background: var(--night); display: grid; grid-template-rows: auto 1fr;
  animation: fade calc(0.2s * var(--dur));
}
.b-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); background: var(--night-2); }
.b-top h2 { margin: 0 8px 0 0; font-size: 18px; }
.b-name, .b-filters input, .b-filters select, .b-template {
  font: 600 14px system-ui, sans-serif; color: var(--ink); background: var(--night); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 8px; padding: 7px 10px;
}
.b-name { flex: 1 1 160px; max-width: 260px; }
.b-top [data-b="save"] { margin-left: auto; }
.b-body { display: grid; grid-template-columns: 1fr 330px; min-height: 0; }
.b-catalog { display: grid; grid-template-rows: auto auto 1fr; min-height: 0; padding: 12px 16px 0; gap: 8px; }
.b-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.b-filters [hidden] { display: none !important; } /* rating + club hide when a non-player type is picked */
.b-filters input { flex: 1 1 180px; }
.b-help { margin: 0; font-size: 12px; color: var(--muted); }
.b-help.warn { color: var(--bad); font-weight: 800; }
.b-grid { overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 14px 10px; padding: 4px 4px 24px; align-content: start; --cw: 96px; }
.b-cell { position: relative; display: grid; justify-items: center; gap: 4px; }
.b-card { transition: transform 0.12s; }
.b-card:hover { transform: translateY(-4px); }
.b-card.in-deck .rot { box-shadow: 0 0 0 3px var(--good), 0 0 12px rgba(70, 224, 138, 0.5); }
.b-card.maxed { opacity: 0.45; }
.b-card.maxed.in-deck { opacity: 0.8; }
.b-copies { font-size: 11px; font-weight: 800; color: var(--muted); }
.b-cell:has(.in-deck) .b-copies { color: var(--good); }
.b-empty { color: var(--muted); padding: 20px; }
.b-deck { border-left: 1px solid rgba(255, 255, 255, 0.1); background: var(--night-2); display: grid; grid-template-rows: auto auto 1fr; min-height: 0; padding: 12px; gap: 10px; }
.b-count { font-size: 14px; color: var(--muted); }
.b-count b { font-size: 26px; color: var(--ink); }
.b-count b.ok { color: var(--good); }
.b-bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); margin: 6px 0; overflow: hidden; }
.b-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--good)); transition: width 0.2s; }
.b-mix { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; }
.b-rules { list-style: none; margin: 0; padding: 8px 10px; display: grid; gap: 3px; font-size: 12px; background: rgba(0, 0, 0, 0.2); border-radius: 10px; max-height: 32vh; overflow: auto; }
.b-rules .ok { color: var(--good); }
.b-rules .bad { color: #ff9aa4; font-weight: 700; }
.b-rules .gold { color: var(--gold); }
.b-list { overflow: auto; min-height: 0; }
.b-list h4 { margin: 10px 0 4px; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; }
.b-row {
  width: 100%; display: grid; grid-template-columns: 36px 1fr auto 18px; gap: 6px; align-items: center; text-align: left; cursor: pointer;
  background: rgba(255, 255, 255, 0.04); border: 1px solid transparent; border-radius: 7px; padding: 4px 8px; margin-bottom: 3px; color: var(--ink); font: 600 13px system-ui, sans-serif;
}
.b-row:hover { border-color: var(--bad); }
.b-row-tag { font-size: 11px; font-weight: 900; color: var(--gold); }
.b-row.legend .b-row-tag { color: #cfd8ef; }
.b-row-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-row-n { color: var(--muted); font-size: 12px; }
.b-row-x { color: var(--bad); font-weight: 900; text-align: center; }
@media (max-width: 800px) {
  .b-body { grid-template-columns: 1fr; grid-template-rows: 1fr 42vh; }
  .b-deck { border-left: 0; border-top: 1px solid rgba(255, 255, 255, 0.1); }
  .b-grid { --cw: 78px; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
}
@media (max-width: 560px) {
  .topbar { padding: 6px 8px; gap: 6px; }
  .logo { font-size: 14px; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .top-actions { display: flex; gap: 4px; flex: none; }
  .top-actions .btn { padding: 5px 8px; font-size: 13px; }
}

/* online: public matchmaking + private rooms */
.online-mode { display: grid; gap: 6px; padding: 10px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.03); }
.online-mode.public { border-color: rgba(245, 197, 66, 0.45); }
.online-mode p { margin: 0; font-size: 12px; color: var(--muted); }
.om-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.lobby-stats { font-size: 11px; color: var(--good); }
.online-status .btn { padding: 3px 10px; margin-top: 4px; }

/* watch live */
.online-mode.watch { border-color: rgba(70, 224, 138, 0.35); }
.om-head .btn { padding: 2px 10px; }
.live-list { display: grid; gap: 6px; max-height: 210px; overflow: auto; }
.live-row { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 4px 8px; font-size: 13px; background: rgba(255, 255, 255, 0.04); border-radius: 8px; padding: 6px 8px; }
.live-names { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-row .btn { padding: 3px 10px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 8px var(--bad); animation: special-pulse 1.4s infinite; }
.live-meta { font-size: 11px; color: var(--muted); }
.live-empty { margin: 0; font-size: 12px; color: var(--muted); }
.watch-badge { font-size: 12px; font-weight: 800; color: var(--good); padding: 3px 8px; border-radius: 999px; background: rgba(70, 224, 138, 0.12); white-space: nowrap; }
.watch-badge[hidden] { display: none; }

/* ---------- phase timer ---------- */
.phase-timer { font: 800 13px/1 ui-monospace, monospace; padding: 6px 10px; border-radius: 999px; background: rgba(10, 18, 38, 0.85); color: var(--muted); white-space: nowrap; border: 1px solid rgba(255, 255, 255, 0.15); }
.phase-timer[hidden] { display: none; }
.phase-timer.mine { color: var(--ink); border-color: rgba(245, 197, 66, 0.5); }
.phase-timer.low { color: #fff; background: var(--bad); border-color: var(--bad); animation: special-pulse 1s ease-in-out infinite; }
.resp-wait { font-weight: 900; color: #ffd400; }

/* ---------- response countdown (10 s) ---------- */
.resp-timer { position: relative; height: 22px; border-radius: 11px; background: rgba(255, 255, 255, 0.08); overflow: hidden; margin: 2px 0 8px; }
.resp-timer i { position: absolute; inset: 0 auto 0 0; width: 100%; background: linear-gradient(90deg, #ffd400, #46e08a); transition: width 0.1s linear; }
.resp-timer span { position: relative; display: block; text-align: center; font: 900 13px/22px system-ui; color: #111; }
.resp-timer.low i { background: var(--bad); }
.resp-timer.low span { color: #fff; }

/* ---------- attack readiness: frozen vs ready ---------- */
.card.frozen { cursor: not-allowed; }
.card.frozen .face.front { filter: grayscale(0.75) brightness(0.8) saturate(0.6); }
.card .frost-layer {
  position: absolute; inset: 0; border-radius: var(--radius); pointer-events: none; z-index: 2;
  background:
    linear-gradient(135deg, rgba(190, 230, 255, 0.55), rgba(120, 180, 255, 0.15) 45%, rgba(220, 245, 255, 0.5)),
    repeating-linear-gradient(60deg, transparent 0 calc(var(--cw) * 0.12), rgba(255, 255, 255, 0.35) calc(var(--cw) * 0.12) calc(var(--cw) * 0.13)),
    repeating-linear-gradient(-60deg, transparent 0 calc(var(--cw) * 0.16), rgba(255, 255, 255, 0.25) calc(var(--cw) * 0.16) calc(var(--cw) * 0.17));
  box-shadow: inset 0 0 calc(var(--cw) * 0.12) rgba(200, 235, 255, 0.95);
  mix-blend-mode: screen;
}
.card.frozen .frost-layer::after { content: "❄"; position: absolute; top: 34%; left: 50%; transform: translate(-50%, -50%); font-size: calc(var(--cw) * 0.38); color: #eaf6ff; text-shadow: 0 0 10px #8fd0ff; }
.card.pos-def.frozen .frost-layer::after { transform: translate(-50%, -50%) rotate(90deg); }
.ribbon.frost { background: linear-gradient(90deg, #d9f1ff, #8fc8ff); color: #0b2a4a; }
.ribbon.ready { background: linear-gradient(90deg, #ffe066, #ff9f1c); color: #2a1500; }
.card.ready .rot { box-shadow: 0 0 0 3px #ffb02e, 0 0 22px rgba(255, 160, 40, 0.85); animation: ready-pulse 1.2s ease-in-out infinite; }
.card.ready { cursor: pointer; }
@media (hover: hover) { .card.ready:hover { transform: translateY(-4px) scale(1.04); } } /* mouse only: on phones a tap would only "hover" */
@keyframes ready-pulse { 50% { box-shadow: 0 0 0 4px #ffd166, 0 0 32px rgba(255, 190, 60, 1); } }

/* ---------- active effects on players (frame colour = card type that caused it) ---------- */
.card.fx { --fx-c: #46e08a; }
.card.fx-skill { --fx-c: #2fe0b5; }
.card.fx-stadium { --fx-c: #9b7bff; }
.card.fx-nationality { --fx-c: #ff5d8a; }
.card.fx-referee { --fx-c: #ffd400; }
.card.fx-coach { --fx-c: #5fd97a; }
.card.fx-player { --fx-c: #f5c542; }
.card.fx .rot::after {
  content: ""; position: absolute; inset: calc(var(--cw) * -0.04); border-radius: calc(var(--radius) * 1.4); pointer-events: none; z-index: 3;
  padding: calc(var(--cw) * 0.03);
  background: conic-gradient(from var(--fx-a, 0deg), var(--fx-c), transparent 30%, var(--fx-c) 50%, transparent 80%, var(--fx-c));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: fx-spin 2.4s linear infinite; filter: drop-shadow(0 0 6px var(--fx-c));
}
.card .rot { position: relative; }
@property --fx-a { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes fx-spin { to { --fx-a: 360deg; } }
.fx-chip {
  position: absolute; top: calc(var(--cw) * -0.12); left: 50%; transform: translateX(-50%); z-index: 5; white-space: nowrap; pointer-events: auto;
  font-size: max(9px, calc(var(--cw) * 0.105)); font-weight: 900; padding: 1px 7px; border-radius: 999px;
  background: var(--fx-c, #46e08a); color: #06140d; box-shadow: 0 0 10px var(--fx-c, #46e08a), 0 2px 5px rgba(0, 0, 0, 0.5);
}
.card.fx .fx-chip { background: var(--fx-c); }
.fx-chip.neg { background: var(--bad) !important; color: #fff; box-shadow: 0 0 10px var(--bad); }
.fx-list { display: grid; gap: 4px; margin: 6px 0; }
.fx-list b { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.fx-item { font-size: 13px; padding: 4px 8px; border-radius: 6px; border-left: 3px solid var(--fx-c, var(--good)); background: rgba(255, 255, 255, 0.05); }
.fx-item.fx-skill { --fx-c: #2fe0b5; } .fx-item.fx-stadium { --fx-c: #9b7bff; } .fx-item.fx-nationality { --fx-c: #ff5d8a; }
.fx-item.fx-referee { --fx-c: #ffd400; } .fx-item.fx-coach { --fx-c: #5fd97a; } .fx-item.fx-player { --fx-c: #f5c542; }
.blocked-line { color: #8fc8ff; font-weight: 700; }

/* face-up Stadium / Nationality / Coach cards in play: glowing "in use" frame */
.card.in-use .rot { box-shadow: 0 0 0 2px var(--use-c, #9b7bff), 0 0 18px var(--use-c, #9b7bff); animation: in-use 2s ease-in-out infinite; }
.card.in-use.stadium { --use-c: #9b7bff; } .card.in-use.nationality { --use-c: #ff5d8a; } .card.in-use.coach { --use-c: #5fd97a; } .card.in-use.referee { --use-c: #ffd400; }
@keyframes in-use { 50% { box-shadow: 0 0 0 3px var(--use-c, #9b7bff), 0 0 30px var(--use-c, #9b7bff); } }
@media (prefers-reduced-motion: reduce) { .card.fx .rot::after, .card.ready .rot, .card.in-use .rot { animation: none; } }
.ribbon.active { background: linear-gradient(90deg, #c9b8ff, #7b5cff); color: #fff; }

/* ---------- online: step-by-step choices ---------- */
.online { gap: 10px; }
.online-deck { font-size: 13px; color: var(--ink); background: rgba(255, 255, 255, 0.05); border-radius: 8px; padding: 6px 10px; }
.online-deck span { color: var(--muted); }
.ol-step { display: grid; gap: 8px; }
.ol-step[hidden] { display: none; }
.ol-q { margin: 2px 0; font-weight: 800; font-size: 14px; }
.ol-tile {
  display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 10px; text-align: left; cursor: pointer;
  padding: 12px 14px; border-radius: 14px; background: var(--night-2); border: 1px solid rgba(255, 255, 255, 0.14); color: var(--ink);
  transition: transform 0.12s, border-color 0.12s;
}
.ol-tile:hover, .ol-tile:focus-visible { border-color: var(--gold); transform: translateY(-1px); }
.ol-tile#room-quick { background: linear-gradient(135deg, rgba(245, 197, 66, 0.22), rgba(245, 197, 66, 0.06)); border-color: rgba(245, 197, 66, 0.6); }
.ol-ico { font-size: 28px; text-align: center; }
.ol-txt { display: grid; gap: 1px; }
.ol-txt b { font-size: 15px; }
.ol-txt span { font-size: 12px; color: var(--muted); }
.ol-tile em { font-style: normal; font-size: 12px; font-weight: 800; color: var(--good); }
.ol-tile em:not(.lobby-stats) { font-size: 22px; color: var(--muted); }
.ol-back { justify-self: start; background: none; border: 0; color: var(--muted); font: 700 13px system-ui; cursor: pointer; padding: 2px 0; }
.ol-back:hover { color: var(--ink); }
.ol-row { display: flex; justify-content: space-between; align-items: center; }
.ol-card { display: grid; gap: 6px; padding: 12px; border-radius: 12px; background: var(--night-2); border: 1px solid rgba(255, 255, 255, 0.12); }
.ol-card p { margin: 0; font-size: 12px; color: var(--muted); }
.ol-or { text-align: center; font-size: 11px; font-weight: 800; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.searching { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(245, 197, 66, 0.1); border: 1px solid rgba(245, 197, 66, 0.4); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.2); border-top-color: var(--gold); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.room-ready { display: grid; gap: 6px; justify-items: center; text-align: center; padding: 12px; border-radius: 12px; background: rgba(245, 197, 66, 0.08); border: 1px solid rgba(245, 197, 66, 0.4); }
.room-ready .code { font-size: 34px; }

/* ---------- deck art: booster packs + avatars ---------- */
.pack {
  position: relative; overflow: hidden; display: grid; justify-items: center; align-content: space-between;
  background: linear-gradient(150deg, var(--c1), color-mix(in srgb, var(--c1) 45%, var(--c2)) 55%, var(--c2));
  border-radius: 6px; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.25);
  -webkit-mask: linear-gradient(#000 0 0) center / 100% calc(100% - 12px) no-repeat,
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) top / 8px 6px repeat-x,
    conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) bottom / 8px 6px repeat-x;
  mask: linear-gradient(#000 0 0) center / 100% calc(100% - 12px) no-repeat,
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) top / 8px 6px repeat-x,
    conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) bottom / 8px 6px repeat-x;
}
.pack-foil {
  position: absolute; inset: 0; pointer-events: none; mix-blend-mode: overlay;
  background: linear-gradient(115deg, transparent 25%, rgba(255, 255, 255, 0.55) 42%, rgba(255, 240, 180, 0.35) 48%, transparent 62%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.07) 0 6px, transparent 6px 12px);
  background-size: 250% 100%, auto; animation: holo 4s ease-in-out infinite;
}
.pack-brand { position: relative; font-weight: 900; color: #fff; letter-spacing: 0.08em; text-shadow: 0 2px 3px rgba(0, 0, 0, 0.5); line-height: 1; text-align: center; }
.pack-brand b { display: block; color: #ffd54a; }
.pack-emblem { position: relative; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5)); }
.pack-emblem svg { width: 100%; height: 100%; display: block; }
.pack-name { position: relative; font-weight: 900; color: #fff; text-align: center; text-shadow: 0 2px 3px rgba(0, 0, 0, 0.6); line-height: 1.05; }
.pack-count { position: relative; font-weight: 900; letter-spacing: 0.14em; color: rgba(255, 255, 255, 0.85); background: rgba(0, 0, 0, 0.35); border-radius: 999px; }
.pack-sm { width: 54px; height: 76px; padding: 9px 3px 8px; }
.pack-sm .pack-brand { font-size: 6px; } .pack-sm .pack-emblem { width: 36px; height: 36px; } .pack-sm .pack-count { font-size: 5px; padding: 1px 4px; }
.pack-lg { width: 240px; height: 340px; padding: 26px 14px 22px; border-radius: 12px; }
.pack-lg .pack-brand { font-size: 22px; } .pack-lg .pack-emblem { width: 150px; height: 150px; } .pack-lg .pack-name { font-size: 22px; } .pack-lg .pack-count { font-size: 13px; padding: 4px 12px; }
.deck-opt[aria-checked="true"] .pack { box-shadow: 0 0 0 2px #ffd54a, 0 6px 16px rgba(0, 0, 0, 0.45); }
.deck-opt:hover .pack { transform: translateY(-2px) rotate(-2deg); transition: transform 0.15s; }
.avatar.deck { background: none !important; padding: 0; overflow: visible; }
.avatar.deck svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5)); }
.d-you { font-size: 10px; font-weight: 900; color: #06140d; background: var(--good); border-radius: 4px; padding: 0 4px; vertical-align: 2px; }
.d-deck { color: var(--muted); }

/* Playmaker (midfielders): Assist / Cover */
.c-pm { font-size: 0.9em; }
.ability-line.pm { border-left-color: #2fe0b5; background: rgba(47, 224, 181, 0.1); }
.pm-ball { position: absolute; left: 0; top: 0; font-size: 34px; filter: drop-shadow(0 0 10px #fff) drop-shadow(0 4px 6px rgba(0,0,0,.5)); pointer-events: none; }

/* =========================================================
   Home page v2: hero on the left, 1-2-3 steps on the right
   ========================================================= */
.home {
  background:
    radial-gradient(1100px 600px at 25% -10%, rgba(245, 197, 66, 0.22), transparent 65%),
    radial-gradient(900px 700px at 100% 100%, rgba(57, 192, 255, 0.12), transparent 60%),
    repeating-linear-gradient(90deg, rgba(47, 141, 64, 0.16) 0 90px, rgba(42, 128, 57, 0.16) 90px 180px),
    var(--night);
}
.home-inner {
  min-height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 560px); gap: 48px; align-items: start;
  max-width: 1200px; margin: 0 auto; padding: 36px 28px 48px;
}
.home-hero { position: sticky; top: 24px; display: grid; gap: 18px; text-align: left; }
.home-cards { height: 230px; --cw: 124px; }
.home-title { font-size: clamp(48px, 7vw, 92px); margin: 0; text-align: left; }
.home-title span { display: inline; margin-left: 0.25em; }
.home-tag { font-size: 19px; line-height: 1.45; color: #d7def5; margin: 0; max-width: 34ch; }
.home-features { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.home-features li { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 14px; padding: 10px 14px; font-size: 14px; color: var(--muted); line-height: 1.35; }
.home-features li > span { font-size: 26px; text-align: center; }
.home-features b { display: block; font-size: 16px; color: var(--ink); }
.home-how { background: rgba(10, 18, 38, 0.6); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 14px; padding: 14px 16px; display: grid; gap: 8px; }
.home-how h2 { margin: 0; font-size: 14px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
.home-how ol { margin: 0; padding-left: 22px; display: grid; gap: 6px; font-size: 15px; line-height: 1.4; color: #d7def5; }
.home-how b { color: var(--ink); }
.home-how .btn { justify-self: start; font-size: 14px; padding: 8px 14px; }

.home-panel { gap: 18px; padding: 24px; border-radius: 22px; background: rgba(18, 29, 59, 0.94); }
.hp-step { display: grid; gap: 12px; }
.hp-step + .hp-step { border-top: 1px solid rgba(255, 255, 255, 0.08); padding-top: 18px; }
.hp-title { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 900; letter-spacing: 0.01em; }
.hp-num { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: #1a1400; font-size: 16px; flex: none; }
.hp-input { font: 700 18px/1.2 system-ui, sans-serif; color: var(--ink); background: var(--night); border: 2px solid rgba(255, 255, 255, 0.16); border-radius: 12px; padding: 12px 14px; width: 100%; box-sizing: border-box; }
.hp-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(245, 197, 66, 0.2); }

/* selected deck, shown big */
.deck-feature { display: grid; grid-template-columns: 132px 1fr; gap: 16px; align-items: center; padding: 14px; border-radius: 16px; background: linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)); border: 1px solid rgba(245, 197, 66, 0.35); }
.pack-md { width: 124px; height: 176px; padding: 16px 8px 13px; border-radius: 10px; }
.pack-md .pack-brand { font-size: 12px; } .pack-md .pack-emblem { width: 82px; height: 82px; } .pack-md .pack-count { font-size: 9px; padding: 2px 8px; }
.deck-feature .pack { transform: rotate(-4deg); }
.df-info { display: grid; gap: 8px; min-width: 0; }
.df-name { font-size: 22px; font-weight: 900; line-height: 1.1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.df-edit { font: 800 13px system-ui; color: var(--gold); background: rgba(245, 197, 66, 0.12); border: 1px solid rgba(245, 197, 66, 0.4); border-radius: 8px; padding: 3px 9px; cursor: pointer; }
.df-desc { margin: 0; font-size: 14px; line-height: 1.45; color: #cfd6f3; }
.df-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.df-label { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); width: 62px; }
.df-chip { font-size: 13px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); white-space: nowrap; }
.df-chip b { color: var(--gold); }
.df-chip.legend { background: linear-gradient(90deg, #e8edf6, #9aa6bd); color: #10172a; }
.df-chip.legend b { color: #10172a; }
.df-chip.gold { background: linear-gradient(90deg, #ffe58a, #e0a800); color: #2a1a00; }
.df-chip.gold b { color: #2a1a00; }
.df-stats { font-size: 13px; color: var(--muted); }

/* deck tiles: scrollable row of packs */
.deck-pick { display: grid; grid-auto-flow: column; grid-auto-columns: 96px; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x proximity; }
.deck-opt { display: grid; justify-items: center; align-content: start; gap: 8px; padding: 10px 6px; border-radius: 14px; background: var(--night); border: 2px solid rgba(255, 255, 255, 0.1); cursor: pointer; scroll-snap-align: start; text-align: center; }
.deck-opt b { font-size: 13px; line-height: 1.2; color: var(--ink); }
.deck-opt:hover { border-color: rgba(245, 197, 66, 0.6); }
.deck-opt[aria-checked="true"] { border-color: var(--gold); background: rgba(245, 197, 66, 0.1); box-shadow: 0 0 0 3px rgba(245, 197, 66, 0.2); }
.deck-opt .pack-sm { width: 60px; height: 84px; }
.deck-warn { font-style: normal; font-size: 11px; font-weight: 800; color: var(--bad); }
.deck-opt.build { border-style: dashed; border-color: rgba(245, 197, 66, 0.55); background: rgba(245, 197, 66, 0.05); }
.build-plus { width: 60px; height: 84px; display: grid; place-items: center; font-size: 34px; color: var(--gold); border-radius: 8px; border: 2px dashed rgba(245, 197, 66, 0.5); }

/* play buttons */
.play-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.play-card { display: grid; gap: 8px; align-content: start; }
.play-card .big-btn { padding: 16px 12px; font-size: 18px; border-radius: 14px; }
.online-btn { background: linear-gradient(135deg, rgba(57, 192, 255, 0.25), rgba(57, 192, 255, 0.08)); border-color: rgba(57, 192, 255, 0.6); }
.online-btn[aria-expanded="true"] { border-color: var(--you); box-shadow: 0 0 0 3px rgba(57, 192, 255, 0.25); }
.play-sub { font-size: 13px; color: var(--muted); text-align: center; }
.rival-row { display: grid; gap: 4px; font-size: 13px; font-weight: 700; color: var(--muted); }
.rival-row select { font: 600 14px system-ui, sans-serif; padding: 8px 10px; border-radius: 10px; }
.online { padding: 14px; border-radius: 16px; background: rgba(0, 0, 0, 0.22); }
.online-deck { font-size: 14px; }
.ol-q { font-size: 16px; }
.ol-txt b { font-size: 16px; } .ol-txt span { font-size: 13px; }
.ol-card p, .live-empty, .online-status { font-size: 14px; }
.home-links .btn { font-size: 14px; }

@media (max-width: 960px) {
  .home-inner { grid-template-columns: 1fr; gap: 20px; padding: 18px 16px 32px; }
  .home-hero { position: static; text-align: center; justify-items: center; }
  .home-title { text-align: center; }
  .home-tag { text-align: center; font-size: 17px; }
  .home-cards { height: 170px; --cw: 88px; width: 100%; }
  .home-features, .home-how { width: 100%; text-align: left; }
  .home-how { order: 5; }
}
@media (max-width: 480px) {
  .home-panel { padding: 16px; }
  .deck-feature { grid-template-columns: 96px 1fr; gap: 12px; padding: 12px; }
  .pack-md { width: 92px; height: 130px; padding: 12px 6px 10px; } .pack-md .pack-emblem { width: 60px; height: 60px; } .pack-md .pack-brand { font-size: 9px; }
  .df-name { font-size: 18px; } .df-label { width: auto; }
  .play-grid { grid-template-columns: 1fr; }
  .home-title { font-size: 48px; }
}

.home-inner { grid-template-areas: "hero panel" "info panel"; row-gap: 20px; }
.home-hero { grid-area: hero; position: static; }
.home-panel { grid-area: panel; }
.home-info { grid-area: info; display: grid; gap: 14px; align-content: start; }
@media (max-width: 960px) {
  .home-inner { grid-template-areas: "hero" "panel" "info"; }
}
.home-title { font-size: clamp(48px, 6.2vw, 88px); }
.home-title span { display: block; margin-left: 0; }
.home-inner { grid-template-rows: auto 1fr; }
.home-hero { align-self: end; }
.deck-pick { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); overflow: visible; padding: 2px; }
.deck-opt .build-plus { font-size: 34px; font-weight: 300; color: var(--gold); }
@media (max-width: 480px) {
  .deck-feature { align-items: start; }
  .home-cards { --cw: 74px; height: 150px; }
  .df-chip { font-size: 12px; }
}

/* ---------- match report drawer: the pitch gets the full width ---------- */
:root { --sidebar: 0px; }
.layout { grid-template-columns: 1fr; }
.sidebar {
  position: fixed; top: 52px; right: 0; bottom: 0; width: min(340px, 92vw); z-index: 30; max-height: none;
  padding: 12px; background: rgba(10, 18, 38, 0.97); border-left: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: -20px 0 50px rgba(0, 0, 0, 0.5); transform: translateX(105%); transition: transform 0.22s ease; overflow: auto;
}
.sidebar .preview { display: block; }
body.report-open .sidebar { transform: none; }
.sidebar-close { position: absolute; top: 8px; right: 8px; z-index: 2; width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.2); background: var(--night-2); color: var(--ink); cursor: pointer; }
.report-btn { position: relative; }
.report-btn[aria-pressed="true"], #btn-fullscreen[aria-pressed="true"] { border-color: var(--gold); color: var(--gold); }
.unread-dot { display: none; position: absolute; top: 3px; right: 3px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 6px var(--bad); }
.report-btn.unread .unread-dot { display: block; }
.board { max-width: 2400px; margin: 0 auto; width: 100%; } /* wide screens: the pitch grows until the height runs out (fitBoard in ui.js) */

/* deck builder: card details */
.b-cell { position: relative; }
.b-cell .card { cursor: pointer; }
.b-quick {
  position: absolute; top: -8px; right: 2px; z-index: 6; width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  font: 900 18px/1 system-ui; color: #062a14; background: var(--good); border: 2px solid #0a1226; box-shadow: 0 2px 8px rgba(0,0,0,.5);
}
.b-quick:hover:not(:disabled) { transform: scale(1.12); }
.b-quick:disabled { background: #46506b; color: #9aa6c7; cursor: not-allowed; }
.modal.b-info-modal { width: min(720px, 100%); }
.b-info { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: start; }
.b-info-card .big { --cw: 210px; }
.b-info-text h3 { margin: 0 0 6px; font-size: 24px; }
.b-info-text p { margin: 8px 0; font-size: 15px; line-height: 1.45; color: #d7def5; }
.b-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.b-meta span { font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.08); }
.b-stat { display: flex; gap: 14px; font-size: 16px !important; }
.b-stat b { font-size: 22px; color: var(--ink); }
.b-tag.legend { display: inline-block; font-weight: 900; font-size: 12px !important; letter-spacing: .08em; padding: 3px 10px; border-radius: 999px; background: linear-gradient(90deg, #e8edf6, #9aa6bd); color: #10172a !important; }
.b-ab { border-left: 3px solid var(--gold); background: rgba(245,197,66,.1); padding: 8px 10px !important; border-radius: 6px; }
.b-ab.pm { border-left-color: #2fe0b5; background: rgba(47,224,181,.1); }
.b-hint { color: var(--muted) !important; font-size: 13px !important; }
.b-info-copies { color: var(--muted) !important; font-size: 14px !important; }
@media (max-width: 560px) { .b-info { grid-template-columns: 1fr; justify-items: center; } .b-info-card .big { --cw: 170px; } }

/* ---------- wide screens: player panels beside the pitch, so the cards can grow ---------- */
@media (min-width: 1000px) and (min-aspect-ratio: 5/4) {
  :root { --cw-base: clamp(40px, min(calc((100dvh - 250px) / 6.45), calc((100vw - 600px) / 7.5)), 136px); }
  .board {
    display: grid; justify-content: center; align-items: start; column-gap: 18px; row-gap: 6px;
    grid-template-columns: minmax(220px, 260px) auto minmax(220px, 260px);
    grid-template-areas:
      "opp    pitch  ."
      "status status status"
      "hint   hint   hint"
      "you    hand   plays";
  }
  #opp-panel { grid-area: opp; }
  .pitch { grid-area: pitch; }
  #turn-status { grid-area: status; justify-self: center; }
  #hint { grid-area: hint; }
  #you-hand { grid-area: hand; --cw: min(calc(var(--cw-base) * 1.25), calc(var(--cw-base) + 12px)); --ch: calc(var(--cw) * 1.4); } /* your hand reads bigger than the pitch */
  #you-panel { grid-area: you; align-self: center; }
  #plays { grid-area: plays; align-self: center; flex-direction: column; align-items: stretch; max-width: none; }
  #plays .play-btn { min-width: 0; }
  .duelist { max-width: none; flex-wrap: wrap; align-content: flex-start; padding: 12px; gap: 8px 10px; }
  .duelist .lp { width: 100%; }
  .duelist .opp-hand { order: 5; }
  .duelist .avatar { width: 52px; height: 52px; }
  #opp-panel { align-self: start; margin-top: 8px; }
}

/* ---------- phones: tall field, hand at the bottom, foldable tips ---------- */
.tips-toggle { display: none; }
@media (max-width: 760px) {
  :root {
    --cw-base: clamp(34px, min(calc((100vw - 34px) / 6.7), calc((100dvh - 430px) / 5.4)), 84px);
    --slot-w: calc(var(--cw) * 1.04); --gap: calc(var(--cw) * 0.05);
  }
  #opp-spells, #you-spells { --slot-w: calc(var(--cw-base) * 1.04); --gap: calc(var(--cw-base) * 0.05); }
  .topbar { height: 44px; }
  .topbar .sound-toggle { display: none; }
  .topbar .logo { font-size: 13px; }
  .layout { padding: 4px 6px 0; }
  .board {
    height: calc(100dvh - 50px); display: flex; flex-direction: column; align-items: stretch; gap: 4px; max-width: none;
  }
  .board > * { flex: none; }
  #opp-panel { order: 1; min-height: 0; padding: 4px 8px; }
  .pitch { order: 2; flex: 1 1 0; min-height: auto; display: flex; flex-direction: column; justify-content: space-between; padding: 8px 4px; }
  .pitch .half { flex: 1 1 0; justify-content: space-evenly; }
  .zone-row { justify-content: center; }
  .tips-toggle {
    order: 3; display: block; align-self: center; font: 800 12px system-ui; color: var(--muted); cursor: pointer;
    background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 999px; padding: 4px 12px;
  }
  #turn-status { order: 4; padding: 4px 10px; font-size: 12px; }
  #hint { order: 5; }
  #plays { order: 6; gap: 6px; }
  #you-panel { order: 7; min-height: 0; padding: 4px 8px; }
  #you-hand { order: 8; padding: 2px 0 6px; min-height: calc(var(--ch) + 8px); max-width: none; --cw: min(calc((100vw - 28px) / 5), 84px, 9.4dvh); --ch: calc(var(--cw) * 1.4); }
  body.tips-hidden #turn-status, body.tips-hidden #plays { display: none !important; }
  .duelist .avatar { width: 34px; height: 34px; }
  .duelist .d-sub { display: none; }
  .duelist .lp-label { display: none; }
  .duelist .lp-value { font-size: 18px; }
  .duelist .opp-hand .mini-back { width: 12px; height: 17px; }
}

/* deck builder: tabs + toast (tabs only used on phones) */
.b-tabs { display: none; }
.b-toast {
  position: fixed; left: 50%; bottom: 18px; transform: translate(-50%, 20px); z-index: 58; opacity: 0; pointer-events: none;
  font: 800 14px system-ui; padding: 10px 16px; border-radius: 999px; background: var(--good); color: #062a14; box-shadow: 0 8px 24px rgba(0,0,0,.5);
  transition: opacity .2s, transform .2s;
}
.b-toast.bad { background: var(--bad); color: #fff; }
.b-toast.show { opacity: 1; transform: translate(-50%, 0); }
.b-rules .ready { font-weight: 900; font-size: 14px; }
.b-rules .pass-summary { display: none; }
.b-tab-count { font-size: 12px; font-weight: 900; padding: 1px 8px; border-radius: 999px; background: rgba(255,255,255,.12); margin-left: 4px; }
.b-tab-count.ok { background: var(--good); color: #062a14; }
.b-tab-count.bad { background: rgba(255, 93, 108, .25); color: #ffb3bb; }

@media (max-width: 760px) {
  .builder { grid-template-rows: auto auto 1fr; }
  .b-top { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; padding: 8px 10px; }
  .b-top h2 { display: none; }
  .b-top [data-b="close"] { grid-column: 1; grid-row: 1; padding: 8px 10px; }
  .b-name { grid-column: 2; grid-row: 1; max-width: none; min-width: 0; font-size: 16px; padding: 8px 10px; }
  .b-top [data-b="save"] { grid-column: 3; grid-row: 1; margin: 0; padding: 8px 12px; }
  .b-template { grid-column: 1 / span 2; grid-row: 2; font-size: 14px; padding: 6px 8px; }
  .b-top [data-b="clear"], .b-top [data-b="delete"] { grid-row: 2; padding: 6px 10px; font-size: 13px; }
  .b-top [data-b="delete"] { grid-column: 3; grid-row: 3; justify-self: end; }
  .b-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 6px 10px; background: var(--night-2); border-bottom: 1px solid rgba(255,255,255,.1); }
  .b-tabs button { font: 800 15px system-ui; color: var(--muted); background: transparent; border: 0; border-bottom: 3px solid transparent; padding: 8px 4px; cursor: pointer; }
  .b-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--gold); }
  .b-body { grid-template-columns: 1fr; grid-template-rows: 1fr; }
  .builder[data-view="cards"] .b-deck { display: none; }
  .builder[data-view="deck"] .b-catalog { display: none; }
  .b-deck { border: 0; padding: 12px; }
  .b-catalog { padding: 8px 10px 0; gap: 6px; }
  .b-filters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .b-filters input { grid-column: 1 / -1; font-size: 15px; padding: 9px 12px; }
  .b-filters select { min-width: 0; font-size: 13px; padding: 7px 6px; }
  .b-filters:has(.b-band[hidden]) .b-type { grid-column: 1 / -1; }
  .b-help { display: none; }
  .b-grid { --cw: 86px; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 16px 6px; padding: 10px 2px 80px; }
  .b-rules { max-height: none; font-size: 14px; }
  .b-rules .pass { display: none; }
  .b-rules .pass-summary { display: list-item; }
  .b-count { font-size: 15px; }
  .b-row { font-size: 15px; padding: 8px 10px; }
}

/* ---------- accounts ---------- */
.acc-bar { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); }
.acc-av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 18px; background: linear-gradient(135deg, var(--gold), #e08a00); color: #1a1400; overflow: hidden; }
.acc-av.guest { background: rgba(255,255,255,.1); color: var(--ink); }
.acc-av img, .prof-av img { width: 100%; height: 100%; object-fit: cover; }
.acc-who { display: grid; font-size: 15px; line-height: 1.25; }
.acc-who small { font-size: 12px; color: var(--muted); }
.acc-saved { text-align: center; color: var(--good); font-weight: 700; }
.modal.acc-modal { width: min(440px, 100%); }
.acc { display: grid; gap: 12px; }
.acc h2 { margin: 0; }
.acc-why { margin: 0; color: #cfd6f3; font-size: 14px; }
.acc-google { display: grid; justify-items: center; min-height: 44px; }
.acc-or { text-align: center; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; }
.acc-tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--night); border-radius: 12px; padding: 4px; }
.acc-tab { font: 800 14px system-ui; color: var(--muted); background: none; border: 0; border-radius: 9px; padding: 9px; cursor: pointer; }
.acc-tab[aria-selected="true"] { background: var(--gold); color: #1a1400; }
.acc-form { display: grid; gap: 10px; }
.acc-form label { display: grid; gap: 4px; font-size: 13px; font-weight: 700; color: var(--muted); }
.acc-form label[hidden] { display: none; }
.acc-form input:not([type="checkbox"]) { font: 600 16px system-ui; color: var(--ink); background: var(--night); border: 2px solid rgba(255,255,255,.15); border-radius: 10px; padding: 10px 12px; }
.acc-form input:focus { outline: none; border-color: var(--gold); }
.acc-check { display: flex !important; align-items: center; gap: 8px; font-weight: 600 !important; }
.acc-err { margin: 0; min-height: 18px; color: var(--bad); font-size: 13px; font-weight: 700; }
.acc-submit { padding: 12px; font-size: 16px; }
.acc-legal { margin: 0; font-size: 11px; color: var(--muted); }
.modal.prof-modal { width: min(680px, 100%); }
.prof-head { display: flex; align-items: center; gap: 14px; }
.prof-head h2 { margin: 0; }
.prof-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.prof-av { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 24px; font-weight: 900; background: linear-gradient(135deg, var(--gold), #e08a00); color: #1a1400; overflow: hidden; flex: none; }
.prof-tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 16px 0; }
.prof-tiles div { background: rgba(255,255,255,.05); border-radius: 12px; padding: 10px 6px; text-align: center; display: grid; }
.prof-tiles b { font-size: 24px; color: var(--gold); }
.prof-tiles span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.prof-tables { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.prof-tables table { width: 100%; border-collapse: collapse; font-size: 13px; }
.prof-tables th, .prof-tables td { padding: 5px 6px; border-bottom: 1px solid rgba(255,255,255,.08); text-align: left; }
.prof-tables .n { text-align: right; }
.prof-tables th { color: var(--muted); font-size: 11px; }
.prof-modal h3 { margin: 16px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.prof-recent { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.prof-recent li { display: grid; grid-template-columns: 30px 1fr; gap: 2px 10px; align-items: center; background: rgba(255,255,255,.04); border-radius: 10px; padding: 6px 10px; font-size: 13px; }
.wl { grid-row: span 2; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-weight: 900; }
.wl.w { background: var(--good); color: #062a14; } .wl.l { background: var(--bad); color: #fff; }
.prof-vs em { font-style: normal; color: var(--muted); font-size: 12px; }
.prof-meta { color: var(--muted); font-size: 12px; }
.prof-empty { color: var(--muted); text-align: center; padding: 20px; }
@media (max-width: 560px) { .prof-tiles { grid-template-columns: repeat(3, 1fr); } .prof-tables { grid-template-columns: 1fr; } }
.acc-google[hidden], .acc-form label[hidden], .acc-form .acc-check[hidden] { display: none !important; }

/* sign-in window v2: two clear choices */
.modal.acc-modal { width: min(460px, 100%); padding: 22px; }
.acc { gap: 14px; }
.acc-hero { text-align: center; display: grid; gap: 4px; }
.acc-logo { font-size: 34px; }
.acc-hero h2 { margin: 0; font-size: 24px; }
.acc-why { font-size: 15px; line-height: 1.4; }
.acc-choice { display: grid; gap: 10px; padding: 16px; border-radius: 16px; text-align: left; width: 100%; box-sizing: border-box; }
.acc-choice.main { background: linear-gradient(135deg, rgba(245,197,66,.14), rgba(245,197,66,.04)); border: 2px solid rgba(245,197,66,.55); }
.acc-choice.guest { background: rgba(255,255,255,.05); border: 2px solid rgba(255,255,255,.14); color: var(--ink); cursor: pointer; font: inherit; }
.acc-choice.guest:hover { border-color: rgba(255,255,255,.4); background: rgba(255,255,255,.08); }
.acc-choice-head { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 10px; }
.acc-choice-head > span { font-size: 26px; text-align: center; }
.acc-choice-head b { display: block; font-size: 17px; }
.acc-choice-head small { display: block; font-size: 13px; color: var(--muted); line-height: 1.3; }
.acc-choice-head em { font-style: normal; font-size: 26px; color: var(--muted); }
.acc-perks { list-style: none; margin: 0; padding: 0 0 0 46px; display: grid; gap: 2px; font-size: 14px; color: #d7def5; }
.acc-google { display: grid; justify-items: center; min-height: 44px; }
.acc-email-toggle { justify-self: center; background: none; border: 0; color: var(--ink); font: 700 14px system-ui; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 4px; }
.acc-email { display: grid; gap: 10px; }
.acc-email[hidden] { display: none; }
.acc-or { font-weight: 800; }
.acc-err:empty { display: none; }
.acc-actions { display: flex; gap: 6px; }
.acc-logout { color: var(--muted); }
.home-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 80; background: var(--night-2); color: var(--ink); border: 1px solid rgba(255,255,255,.2); border-radius: 999px; padding: 10px 18px; font: 700 14px system-ui; box-shadow: 0 10px 30px rgba(0,0,0,.5); animation: pop .2s ease-out; }
@media (max-width: 480px) { .acc-bar { grid-template-columns: 40px 1fr; } .acc-actions { grid-column: 1 / -1; justify-content: flex-end; } }

/* account entry on phones: top-right chip + full-width bar */
.acc-chip { display: none; }
.acc-long { display: none; }
@media (max-width: 760px) {
  .home-inner { position: relative; }
  .acc-chip {
    display: flex; align-items: center; gap: 6px; position: absolute; top: 10px; right: 12px; z-index: 3;
    font: 800 14px system-ui; color: #1a1400; background: var(--gold); border: 0; border-radius: 999px; padding: 8px 14px 8px 10px;
    box-shadow: 0 6px 18px rgba(0,0,0,.45); cursor: pointer; max-width: 46vw;
  }
  .acc-chip span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .acc-chip .acc-av.sm { width: 24px; height: 24px; font-size: 12px; flex: none; }
  .acc-bar { grid-template-columns: 44px 1fr; gap: 10px 12px; padding: 12px; }
  .acc-bar > .btn, .acc-actions { grid-column: 1 / -1; }
  .acc-signin { width: 100%; padding: 14px; font-size: 17px; border-radius: 12px; }
  .acc-long { display: inline; }
  .acc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .acc-actions .btn { padding: 12px; font-size: 15px; }
  .acc-av { width: 44px; height: 44px; }
  .acc-who { font-size: 16px; }
  .acc-who small { font-size: 13px; }
}
@media (max-width: 760px) { .home-hero { padding-top: 34px; } }

/* ---------- leaderboard ---------- */
.lb-btn { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px; font-size: 16px; font-weight: 800; border-radius: 14px; background: linear-gradient(135deg, rgba(245,197,66,.18), rgba(245,197,66,.05)); border-color: rgba(245,197,66,.5); }
.lb-btn span { font-size: 13px; font-weight: 600; color: var(--muted); }
.modal.lb-modal { width: min(620px, 100%); }
.lb { display: grid; gap: 10px; }
.lb h2 { margin: 0; }
.lb-tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--night); border-radius: 12px; padding: 4px; }
.lb-tabs button { font: 800 14px system-ui; color: var(--muted); background: none; border: 0; border-radius: 9px; padding: 9px 6px; cursor: pointer; }
.lb-tabs button[aria-selected="true"] { background: var(--gold); color: #1a1400; }
.lb-period { display: flex; gap: 6px; justify-content: center; }
.lb-period button { font: 700 13px system-ui; color: var(--muted); background: transparent; border: 1px solid rgba(255,255,255,.2); border-radius: 999px; padding: 5px 14px; cursor: pointer; }
.lb-period button[aria-pressed="true"] { color: var(--ink); border-color: var(--gold); background: rgba(245,197,66,.12); }
.lb-note { margin: 0; font-size: 13px; color: var(--muted); text-align: center; }
.lb-body table { width: 100%; border-collapse: collapse; font-size: 14px; }
.lb-body th, .lb-body td { padding: 8px 6px; border-bottom: 1px solid rgba(255,255,255,.07); text-align: left; }
.lb-body th { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.lb-body .n { text-align: right; }
.lb-rank { width: 34px; font-weight: 900; font-size: 16px; text-align: center !important; }
.lb-name { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.lb-name img, .lb-av { width: 26px; height: 26px; border-radius: 50%; flex: none; object-fit: cover; }
.lb-av { display: grid; place-items: center; font-size: 12px; font-weight: 900; background: rgba(255,255,255,.12); }
.lb-name em { font-style: normal; font-size: 11px; font-weight: 900; color: #06140d; background: var(--good); border-radius: 4px; padding: 0 5px; }
.lb-score { font-weight: 900; color: var(--gold); font-size: 16px; }
.lb-body tr.me td { background: rgba(70,224,138,.1); }
.lb-gap td { text-align: center !important; color: var(--muted); }
.lb-empty { text-align: center; color: var(--muted); padding: 24px 10px; font-size: 14px; }
.lb-total { text-align: center; color: var(--muted); font-size: 12px; margin: 8px 0 0; }
.lb-cta { justify-self: center; }
.prof-rating { display: grid; grid-template-columns: repeat(3, 1fr) auto; gap: 8px; align-items: center; margin-top: 14px; padding: 10px; border-radius: 12px; background: linear-gradient(135deg, rgba(245,197,66,.15), rgba(245,197,66,.03)); border: 1px solid rgba(245,197,66,.4); }
.prof-rating div { display: grid; text-align: center; }
.prof-rating b { font-size: 22px; color: var(--gold); }
.prof-rating span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.rating-line { text-align: center; font-weight: 800; color: var(--gold); }
.rating-line.up b { color: var(--good); } .rating-line.down b { color: var(--bad); }
.rating-line.muted { color: var(--muted); font-weight: 600; }
@media (max-width: 560px) { .prof-rating { grid-template-columns: repeat(3, 1fr); } .prof-rating .btn { grid-column: 1 / -1; } .lb-body td:nth-child(5), .lb-body th:nth-child(5) { display: none; } }

/* ---------- tutorial ---------- */
.tut-btn {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; text-align: left; width: 100%;
  padding: 12px 16px; border-radius: 14px; cursor: pointer; color: var(--ink); font: 700 15px system-ui;
  background: linear-gradient(135deg, rgba(70,224,138,.22), rgba(57,192,255,.12)); border: 2px solid rgba(70,224,138,.6);
  animation: tut-glow 2.4s ease-in-out infinite;
}
.tut-btn b { font-size: 17px; }
.tut-btn span { grid-column: 1 / -1; font-size: 13px; font-weight: 600; color: var(--muted); }
.tut-btn.done { display: block; animation: none; font-size: 14px; padding: 9px 14px; border-width: 1px; border-color: rgba(255,255,255,.2); background: transparent; text-align: center; }
@keyframes tut-glow { 50% { box-shadow: 0 0 0 4px rgba(70,224,138,.2), 0 0 24px rgba(70,224,138,.35); } }
.how-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tut {
  position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 70; width: min(560px, calc(100vw - 20px)); box-sizing: border-box;
  background: #fff; color: #10172a; border-radius: 18px; padding: 14px 16px; box-shadow: 0 20px 60px rgba(0,0,0,.6), 0 0 0 3px var(--gold);
  font-size: 15px; line-height: 1.45; animation: pop .25s ease-out;
}
.tut.at-top { bottom: auto; top: 58px; }
.tut-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.tut-badge { font-size: 12px; font-weight: 900; letter-spacing: .04em; color: #0f7a3d; }
.tut-skip { background: none; border: 0; color: #6b7280; font: 700 12px system-ui; text-decoration: underline; cursor: pointer; }
.tut-text ul { margin: 6px 0; padding-left: 20px; }
.tut-text b { color: #000; }
.tut-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.tut-actions .btn:not(.primary) { color: #10172a; border-color: #cbd2e1; background: #f1f4fa; }
.tut-ring {
  position: fixed; z-index: 69; display: none; pointer-events: none; border-radius: 14px; border: 3px solid var(--gold);
  box-shadow: 0 0 0 9999px rgba(2, 6, 18, .45), 0 0 24px rgba(245,197,66,.9); transition: left .2s, top .2s, width .2s, height .2s;
  animation: tut-pulse 1.2s ease-in-out infinite;
}
.tut-arrow { position: absolute; left: 50%; top: -40px; transform: translateX(-50%); font-size: 30px; animation: tut-bounce .8s ease-in-out infinite; filter: drop-shadow(0 2px 4px rgba(0,0,0,.6)); }
@keyframes tut-pulse { 50% { border-color: #fff3b0; } }
.tut-ring.soft { box-shadow: 0 0 24px rgba(245,197,66,.9); }
.tut.first { padding: 10px 14px; width: min(460px, calc(100vw - 20px)); }
.tut.first .tut-top { margin-bottom: 2px; }
.tut.first .tut-text { font-size: 16px; font-weight: 600; }
@keyframes tut-bounce { 50% { transform: translate(-50%, -8px); } }
@media (max-width: 760px) { .tut { font-size: 14px; padding: 12px 14px; } .tut.at-top { top: 50px; } }
/* Coach's drills: a question with answer cards, then the verdict */
.drill-title { display: block; font-size: 17px; margin-bottom: 4px; }
.drill-basics { display: block; margin-bottom: 8px; padding: 7px 10px; border-radius: 10px; background: #e9f8ef; border-left: 3px solid #1f9d55; font-size: 14px; }
.welcome-pop { text-align: center; }
.welcome-pop img { width: 96px; height: 96px; margin: 0 auto 6px; border-radius: 50%; filter: drop-shadow(0 8px 20px rgba(245, 197, 66, 0.45)); }
.welcome-pop h2 { margin: 2px 0 8px; }
.welcome-pop p { margin: 0 0 6px; }
.drill-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-top: 10px; }
.drill-opt {
  display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; text-align: left; cursor: pointer;
  background: #f1f4fa; border: 2px solid #cbd2e1; color: #10172a; font: inherit; transition: border-color .15s, transform .15s, background .15s;
}
.drill-opt:hover { border-color: var(--gold); background: #fffaf0; transform: translateY(-1px); }
.drill-opt img, .drill-opt i { width: 48px; height: 48px; flex: none; border-radius: 8px; object-fit: cover; object-position: 50% 15%; }
.drill-opt i { display: grid; place-items: center; font-size: 26px; font-style: normal; background: #e2e7f1; }
.drill-opt span { display: flex; flex-direction: column; min-width: 0; }
.drill-opt b { font-size: 15px; line-height: 1.2; }
.drill-opt small { font-size: 12px; color: #4b5568; font-weight: 600; }
.drill-opt.tried { opacity: .55; border-style: dashed; }
.drill-verdict { display: block; font-size: 17px; margin-bottom: 4px; }
.drill-verdict.good { color: #0f7a3d !important; }
.drill-verdict.bad { color: #c0262d !important; }
.drill-lesson { display: block; margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: #fff6d6; border-left: 3px solid var(--gold); font-weight: 600; }
@media (max-width: 420px) { .drill-opts { grid-template-columns: 1fr; } .drill-opt img, .drill-opt i { width: 40px; height: 40px; } }

.df-modify {
  justify-self: start; font: 800 14px system-ui; color: #1a1400; background: var(--gold); border: 0; border-radius: 10px;
  padding: 9px 14px; cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,.35);
}
.df-modify:hover { filter: brightness(1.08); }
@media (max-width: 480px) { .df-modify { justify-self: stretch; font-size: 13px; } }

/* "why your set card stayed quiet" notice */
.notice {
  position: fixed; left: 50%; top: 58px; transform: translateX(-50%); z-index: 65; max-width: min(560px, calc(100vw - 24px));
  background: #fff7d1; color: #2a1a00; border: 2px solid #ffd400; border-radius: 14px; padding: 10px 16px;
  font: 700 14px/1.4 system-ui; box-shadow: 0 10px 30px rgba(0,0,0,.5); animation: pop .2s ease-out; transition: opacity .4s;
}
.notice.out { opacity: 0; }
.log li.note { color: #ffd400; }

.cb-badge { font-size: 11px; font-weight: 900; color: #2a1a00; background: linear-gradient(90deg, #ffe066, #ff9f1c); border-radius: 999px; padding: 1px 8px; margin-left: 4px; vertical-align: 1px; animation: special-pulse 1.4s ease-in-out infinite; white-space: nowrap; }

/* ⚡ POWER cards */
.card.power { --frame: linear-gradient(150deg, #ffe066, #ff6bd6 40%, #7b5cff 75%, #2fe0ff); }
.card.power .rot { box-shadow: 0 0 calc(var(--cw) * 0.14) rgba(255, 107, 214, 0.7); }
.card.power .c-type { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.muted-note { color: var(--muted); font-size: 13px; margin: 0 0 4px; }
.card.skill:has(.c-type) .c-type { white-space: nowrap; }

/* ---------- player cards: READY / FROZEN / other ribbons sit on the picture, never on the ATK/DEF line ---------- */
.card.player:not(.big) > .ribbon { bottom: auto; top: 64%; transform: translate(-50%, -50%); }
.card.player.pos-def:not(.big) > .ribbon { top: 50%; }
.card.player.frozen .frost-layer::after { top: 30%; }

/* ---------- avatars (badge, Google photo or initial) ---------- */
.av-badge { width: 100%; height: 100%; display: grid; place-items: center; font-size: 0.62em; line-height: 1; }
.acc-av .av-badge, .prof-av .av-badge, .lb-av .av-badge { font-size: 1.15em; }
.acc-av:has(.av-badge), .prof-av:has(.av-badge), .lb-av:has(.av-badge) { background: none; }
.lb-av { overflow: hidden; }
.lb-av img { width: 100%; height: 100%; object-fit: cover; }
button.acc-av { border: 0; padding: 0; cursor: pointer; font: inherit; font-weight: 900; font-size: 18px; color: #1a1400; }
button.acc-av:hover { box-shadow: 0 0 0 3px rgba(245, 197, 66, 0.5); }
.prof-head > div:nth-child(2) { flex: 1; min-width: 0; }
.prof-edit { flex: none; }

/* ---------- name field: locked to the nickname when signed in ---------- */
.name-row { display: flex; gap: 8px; align-items: stretch; }
.name-row .hp-input { flex: 1; min-width: 0; }
.hp-input.locked { color: var(--gold); cursor: default; }
.name-edit { flex: none; }
.name-edit[hidden] { display: none; }

/* ---------- settings ---------- */
.set-modal { max-width: 520px; }
.set { display: grid; gap: 14px; }
.set h2 { margin: 0; }
.set-preview { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.05); }
.set-preview b { font-size: 20px; display: block; word-break: break-word; }
.set-preview small { color: var(--muted); font-size: 13px; }
.set form { display: grid; gap: 10px; }
.set-label { display: grid; gap: 6px; font-weight: 800; font-size: 14px; }
.set-label small { font-weight: 500; color: var(--muted); font-size: 12px; }
.set-label input, .fb-label input, .fb-label select, .fb-label textarea {
  font: 600 16px/1.3 system-ui, sans-serif; color: var(--ink); background: var(--night); border: 2px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px; padding: 10px 12px; width: 100%; box-sizing: border-box;
}
.set-label input:focus, .fb-label input:focus, .fb-label select:focus, .fb-label textarea:focus { outline: none; border-color: var(--gold); }
.set-avs { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 8px; }
.set-av { aspect-ratio: 1; border-radius: 50%; padding: 0; border: 3px solid transparent; background: rgba(255, 255, 255, 0.08); cursor: pointer; overflow: hidden; font-size: 26px; display: grid; place-items: center; transition: transform 0.12s; }
.set-av:hover { transform: scale(1.08); }
.set-av.on { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(245, 197, 66, 0.35); }
.set-av .av-badge { font-size: 26px; }
.set-av img { width: 100%; height: 100%; object-fit: cover; }
.set-initial { font-weight: 900; font-size: 22px; color: var(--gold); }
.set .actions, .fb .actions { margin-top: 4px; }

/* ---------- feedback: bug report + suggest a card ---------- */
.fb-modal { max-width: 560px; }
.fb { display: grid; gap: 12px; }
.fb-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; border-radius: 14px; background: rgba(255, 255, 255, 0.06); }
.fb-tabs[hidden] { display: none; }
.fb-tabs button { font: 800 15px system-ui, sans-serif; color: var(--muted); background: transparent; border: 0; border-radius: 10px; padding: 10px 8px; cursor: pointer; }
.fb-tabs button[aria-selected="true"] { color: #1a1400; background: var(--gold); }
.fb-form { display: grid; gap: 10px; }
.fb-form[hidden], .fb-done[hidden], .fb-player[hidden] { display: none; }
.fb-intro { margin: 0; color: var(--muted); font-size: 14px; }
.fb-label { display: grid; gap: 5px; font-weight: 800; font-size: 14px; }
.fb-label em, .fb-ctx em { font-style: normal; font-weight: 500; color: var(--muted); font-size: 12px; }
.fb-label textarea { resize: vertical; min-height: 64px; }
.fb-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fb-nums { grid-template-columns: repeat(3, 1fr); }
.fb-player { border: 0; margin: 0; padding: 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); display: grid; gap: 10px; }
.fb-ctx { font-size: 14px; }
.fb-done { text-align: center; display: grid; gap: 6px; justify-items: center; padding: 8px 0; }
.fb-done-ico { font-size: 54px; }
.fb-done h2, .fb-done p { margin: 0; }
.fb-done p { color: var(--muted); max-width: 40ch; }
@media (max-width: 480px) { .fb-row { grid-template-columns: 1fr; } .fb-nums { grid-template-columns: repeat(3, 1fr); } .fb-tabs button { font-size: 13px; } }

/* =====================================================================
   Game feel: VFX canvas, shake, impacts, GOAL!, damage numbers, card tilt, stadium lights
   ===================================================================== */
.vfx-canvas { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
#fx > :not(.vfx-canvas) { z-index: 1; }
.vfx-flash { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen; }

/* screen shake on the board (strength set by --shake) */
.board.vfx-shake { animation: vfx-shake 0.38s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes vfx-shake {
  10% { transform: translate(calc(var(--shake) * -1), calc(var(--shake) * 0.4)) rotate(-0.4deg); }
  25% { transform: translate(var(--shake), calc(var(--shake) * -0.5)) rotate(0.4deg); }
  40% { transform: translate(calc(var(--shake) * -0.6), calc(var(--shake) * 0.3)); }
  60% { transform: translate(calc(var(--shake) * 0.4), calc(var(--shake) * -0.2)); }
  80% { transform: translate(calc(var(--shake) * -0.15), 0); }
  100% { transform: none; }
}

/* attacker + target */
.card.attacking .rot { box-shadow: 0 0 0 3px #fff, 0 0 26px rgba(255, 255, 255, 0.9), 0 18px 30px rgba(0, 0, 0, 0.6); }
.card.hit-flash .face.front { animation: hit-flash 0.3s ease-out; }
@keyframes hit-flash { 0% { filter: brightness(3) saturate(0); } 100% { filter: none; } }

/* big numbers */
.vfx-num {
  position: absolute; pointer-events: none; white-space: nowrap; font: 900 clamp(26px, 4vw, 44px)/1 system-ui, sans-serif; letter-spacing: 0.02em;
  -webkit-text-stroke: 2px rgba(0, 0, 0, 0.75); paint-order: stroke fill; text-shadow: 0 4px 0 rgba(0, 0, 0, 0.45), 0 0 24px currentColor;
}
.vfx-num.dmg { color: #ff4d5e; }
.vfx-num.dmg.huge { font-size: clamp(40px, 6.5vw, 72px); color: #ff2f45; }
.vfx-num.heal { color: #46e08a; }
.vfx-num.vs { color: #ffd166; font-size: clamp(18px, 2.6vw, 28px); }
.vfx-num.card-red { font-size: clamp(30px, 4vw, 46px); -webkit-text-stroke: 0; text-shadow: 0 0 18px rgba(255, 40, 60, 0.9); }

/* flying card (draws) */
.vfx-fly { position: absolute; left: 0; top: 0; pointer-events: none; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.55)); }
.vfx-fly .card { cursor: default; }

/* GOAL! */
.goal-banner {
  position: absolute; left: 50%; top: 46%; display: grid; justify-items: center; gap: 4px; pointer-events: none; padding: 18px 60px;
}
.goal-banner b {
  font: 900 clamp(64px, 14vw, 170px)/0.9 system-ui, sans-serif; letter-spacing: 0.04em; font-style: italic;
  background: linear-gradient(180deg, #fff 0%, #fff3c4 45%, #f5c542 55%, #ff9f1c 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: 3px rgba(20, 10, 0, 0.6); filter: drop-shadow(0 8px 0 rgba(0, 0, 0, 0.4)) drop-shadow(0 0 40px rgba(245, 197, 66, 0.8));
}
.goal-banner.theirs b { background-image: linear-gradient(180deg, #fff 0%, #ffd0d5 45%, #ff5d6c 55%, #b3001b 100%); filter: drop-shadow(0 8px 0 rgba(0, 0, 0, 0.4)) drop-shadow(0 0 40px rgba(255, 93, 108, 0.8)); }
.goal-banner small { font: 800 clamp(14px, 2vw, 20px) system-ui, sans-serif; letter-spacing: 0.25em; text-transform: uppercase; color: #fff; text-shadow: 0 2px 6px #000; }
.goal-net {
  position: absolute; inset: -40px -80px; z-index: -1; border-radius: 30px; opacity: 0.55;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.35) 0 2px, transparent 2px 22px),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.35) 0 2px, transparent 2px 22px),
    radial-gradient(closest-side, rgba(10, 18, 38, 0.85), rgba(10, 18, 38, 0));
  animation: net-ripple 0.7s ease-out;
}
@keyframes net-ripple { 0% { transform: scale(1.25) perspective(400px) rotateX(18deg); } 40% { transform: scale(0.95); } 100% { transform: none; } }

/* defeat: the stadium goes grey for a moment */
body.defeat-tint .layout { filter: grayscale(0.85) brightness(0.7); transition: filter 0.8s; }
.layout { transition: filter 0.8s; }

/* hand cards: 3D tilt toward the pointer with a moving glare (mouse only) */
@media (hover: hover) and (pointer: fine) {
  .you-hand .card:not(.down) .flipper { transition: transform 0.18s ease-out; }
  .you-hand .card:not(.down):hover { transform: translateY(-16px) scale(1.12); z-index: 6; }
  .you-hand .card:not(.down):hover .flipper { transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
  .you-hand .card:not(.down) .flipper::after {
    content: ""; position: absolute; inset: 0; border-radius: var(--radius); pointer-events: none; opacity: 0; transition: opacity 0.2s; transform: translateZ(1px);
    background: radial-gradient(circle at var(--gx, 50%) var(--gy, 30%), rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 55%);
    mix-blend-mode: overlay;
  }
  .you-hand .card:not(.down):hover .flipper::after { opacity: 1; }
  .you-hand .card:not(.down):hover .rot { box-shadow: 0 18px 30px rgba(0, 0, 0, 0.55), 0 0 0 2px rgba(255, 255, 255, 0.35); }
  #you-field .card.ready:hover .rot, #you-field .card.selectable:hover .rot { filter: brightness(1.12); }
}

/* holo foil sweep on 8★+ players and POWER cards in hand */
.you-hand .card.power:not(.legend) .face.front::after, .you-hand .card[data-holo]:not(.legend) .face.front::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: color-dodge; opacity: 0.35;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 0, 180, 0.5) 40%, rgba(0, 255, 230, 0.5) 50%, rgba(255, 240, 0, 0.5) 60%, transparent 70%);
  background-size: 250% 100%; animation: holo 3.2s linear infinite;
}
@keyframes holo { from { background-position: 120% 0; } to { background-position: -120% 0; } }

/* stadium floodlights slowly sweeping over the grass */
.pitch-lights { position: absolute; inset: 0; pointer-events: none; overflow: hidden; border-radius: inherit; }
.pitch-lights i {
  position: absolute; width: 70%; height: 160%; top: -30%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 240, 0.13), rgba(255, 255, 240, 0)); mix-blend-mode: soft-light;
  animation: flood 14s ease-in-out infinite alternate;
}
.pitch-lights i:first-child { left: -20%; }
.pitch-lights i:last-child { right: -20%; animation-delay: -7s; animation-duration: 17s; }
@keyframes flood { from { transform: translateX(-12%) rotate(-6deg); } to { transform: translateX(12%) rotate(6deg); } }
.pitch { box-shadow: 0 0 0 4px #1f5f2b, 0 20px 60px rgba(0, 0, 0, 0.5), inset 0 0 80px rgba(0, 0, 0, 0.35); }

/* you are close to losing: red pulse around your Fan Support */
.duelist.you.danger { animation: danger-pulse 0.95s ease-in-out infinite; }
@keyframes danger-pulse { 0%, 100% { box-shadow: 0 0 0 1px rgba(255, 93, 108, 0.4), 0 0 0 rgba(255, 40, 60, 0); } 15% { box-shadow: 0 0 0 2px rgba(255, 93, 108, 0.9), 0 0 28px rgba(255, 40, 60, 0.7); } }

@media (prefers-reduced-motion: reduce) {
  .board.vfx-shake, .pitch-lights i, .duelist.you.danger, .you-hand .card .face.front::after { animation: none !important; }
}

/* a drawn card stays invisible (but keeps its place) until it has flown in from the deck */
.you-hand .card.pending-draw { visibility: hidden; }
.pick-required { margin: 0 0 8px; padding: 6px 10px; border-radius: 8px; background: rgba(245, 197, 66, 0.12); color: var(--gold); font-weight: 700; font-size: 14px; }
.c-lb { font-size: 0.85em; }
.ability-line.lb, .b-ab.lb { border-left-color: #46e08a; }
.b-budget { font-size: 13px; color: var(--muted); margin-top: 4px; }
.b-budget b { color: var(--ink); }
.b-budget .b-bar i { background: linear-gradient(90deg, #39c0ff, #46e08a); }
.b-budget.near .b-bar i { background: linear-gradient(90deg, #46e08a, var(--gold)); }
.b-budget.over { color: var(--bad); }
.b-budget.over b { color: var(--bad); }
.b-budget.over .b-bar i { background: var(--bad); }
.df-warn { margin: 6px 0 10px; padding: 8px 10px; border-radius: 10px; background: rgba(255, 93, 108, 0.12); border: 1px solid rgba(255, 93, 108, 0.45); color: #ffd0d5; font-size: 14px; }

/* home-screen ad slot (hidden until an AdSense slot id is configured) */
.home-ad { margin-top: 14px; padding: 8px; border-radius: 14px; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.08); min-height: 100px; }
.home-ad[hidden] { display: none; }
.home-ad-label { display: block; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.home-legal { margin: 10px 0 0; text-align: center; font-size: 12px; color: var(--muted); }
.home-legal a { color: var(--muted); }
.home-badge { margin: 4px 0 0; text-align: center; line-height: 0; }
.home-badge img { max-width: 100%; height: auto; }
.home-vote { margin: 4px 0 0; text-align: center; font-size: 13px; color: var(--muted); }
.home-vote a { color: #ffc93c; font-weight: 700; }
.acc-legal a { color: var(--gold); }

/* al3ab-hub: beta marker in the hub navigation and the "under development" banner */
.beta-chip { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 999px; font-size: 9px; font-weight: 900; letter-spacing: 0.08em; line-height: 16px; vertical-align: 1px; background: #7b6cff; color: #fff; }
.beta-banner { padding: 8px 14px; text-align: center; font-size: 13px; line-height: 1.4; color: #e9e6ff; background: linear-gradient(90deg, rgba(123, 108, 255, 0.28), rgba(123, 108, 255, 0.12)); border-bottom: 1px solid rgba(123, 108, 255, 0.45); }

/* =====================================================================
   Home page v3 · "matchday" dashboard (broadcast top bar, hero with shiny cards, panels)
   Palette: deep violet + electric green / cyan, gold for cards.
   ===================================================================== */
.home {
  --fd-v1: #12031f; --fd-v2: #24073f; --fd-v3: #38106a; --fd-green: #00ff87; --fd-cyan: #05f0ff; --fd-pink: #ff2e7e;
  --fd-panel: rgba(28, 10, 52, 0.82); --fd-line: rgba(255, 255, 255, 0.1);
  background:
    radial-gradient(1200px 620px at 78% -8%, rgba(5, 240, 255, 0.16), transparent 62%),
    radial-gradient(1000px 700px at 0% 0%, rgba(0, 255, 135, 0.13), transparent 60%),
    radial-gradient(900px 900px at 50% 120%, rgba(255, 46, 126, 0.14), transparent 60%),
    linear-gradient(160deg, var(--fd-v2), var(--fd-v1) 60%);
  scroll-behavior: smooth;
}
.home::before { /* faint pitch markings */
  content: ""; position: fixed; inset: 0; pointer-events: none; opacity: 0.07;
  background:
    radial-gradient(circle at 50% 46%, transparent 0 118px, #fff 118px 120px, transparent 120px),
    repeating-linear-gradient(115deg, transparent 0 140px, rgba(255, 255, 255, 0.35) 140px 141px);
}

/* ---- broadcast top bar ---- */
.fd-top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 18px; padding: 10px 24px;
  background: linear-gradient(90deg, rgba(18, 3, 31, 0.96), rgba(56, 16, 106, 0.94)); backdrop-filter: blur(8px);
  border-bottom: 2px solid transparent; border-image: linear-gradient(90deg, var(--fd-green), var(--fd-cyan), var(--fd-pink)) 1;
}
.fd-brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: #fff; font: 900 italic 22px/1 system-ui, sans-serif; text-transform: uppercase; letter-spacing: 0.02em; flex: none; }
.fd-brand i { color: var(--fd-green); font-style: italic; }
.fd-brand em { font: 800 11px system-ui; font-style: normal; color: #1a0530; background: var(--fd-green); border-radius: 4px; padding: 2px 5px; letter-spacing: 0.04em; }
.fd-crest { width: 30px; height: 30px; border-radius: 9px; transform: rotate(45deg); background: linear-gradient(135deg, var(--fd-green), var(--fd-cyan)); box-shadow: 0 0 18px rgba(0, 255, 135, 0.5); position: relative; }
.fd-crest::after { content: "⚽"; position: absolute; inset: 0; display: grid; place-items: center; transform: rotate(-45deg); font-size: 16px; font-style: normal; }
.fd-nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.fd-nav::-webkit-scrollbar { display: none; }
.fd-nav a { color: #d9cdf3; text-decoration: none; font: 800 14px system-ui; padding: 8px 12px; border-radius: 999px; white-space: nowrap; transition: background 0.15s, color 0.15s; }
.fd-nav a:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.fd-top-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.fd-top-actions .icon-btn { border-radius: 999px; background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.14); }
.home .acc-chip {
  display: flex; position: static; align-items: center; gap: 8px; max-width: 220px; cursor: pointer;
  font: 800 14px system-ui; color: #1a0530; background: var(--fd-green); border: 0; border-radius: 999px; padding: 7px 14px 7px 8px;
  box-shadow: 0 0 0 3px rgba(0, 255, 135, 0.18), 0 8px 20px rgba(0, 0, 0, 0.4);
}
.home .acc-chip:hover { filter: brightness(1.06); }
.home .acc-chip span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home .acc-chip .acc-av.sm { width: 26px; height: 26px; font-size: 13px; flex: none; }

/* ---- page frame ---- */
.fd-wrap { position: relative; max-width: 1240px; margin: 0 auto; padding: 22px 24px 40px; display: grid; gap: 22px; }

/* ---- hero ---- */
.fd-hero {
  position: relative; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 24px; align-items: center;
  padding: 34px 36px; border-radius: 26px; overflow: hidden; isolation: isolate;
  background:
    linear-gradient(115deg, rgba(0, 255, 135, 0.18), transparent 38%),
    linear-gradient(295deg, rgba(5, 240, 255, 0.2), transparent 42%),
    linear-gradient(135deg, #3b0f6e, #1d0638 70%);
  border: 1px solid rgba(255, 255, 255, 0.12); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}
.fd-hero::before { /* stadium light streaks */
  content: ""; position: absolute; inset: -40% -10%; z-index: -1; opacity: 0.5;
  background: repeating-linear-gradient(115deg, transparent 0 60px, rgba(255, 255, 255, 0.05) 60px 62px, transparent 62px 140px);
}
.fd-hero-text { display: grid; gap: 16px; align-content: center; min-width: 0; }
.fd-eyebrow { display: inline-flex; align-items: center; gap: 8px; justify-self: start; font: 800 12px system-ui; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fd-green); background: rgba(0, 255, 135, 0.1); border: 1px solid rgba(0, 255, 135, 0.35); padding: 6px 12px; border-radius: 999px; }
.fd-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fd-pink); box-shadow: 0 0 10px var(--fd-pink); display: inline-block; animation: fd-blink 1.4s ease-in-out infinite; }
@keyframes fd-blink { 50% { opacity: 0.3; } }
.home .home-title { margin: 0; text-align: left; font: 900 italic clamp(40px, 5.4vw, 74px)/0.95 system-ui, sans-serif; text-transform: uppercase; letter-spacing: -0.01em; text-shadow: 0 6px 0 rgba(0, 0, 0, 0.3); }
.home .home-title span { display: block; margin: 4px 0 0; background: linear-gradient(90deg, var(--fd-green), var(--fd-cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.3)); }
.home .home-tag { margin: 0; max-width: 46ch; font-size: 17px; line-height: 1.5; color: #e1d8f5; text-align: left; }
.fd-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.fd-cta .big-btn { padding: 16px 24px; font: 900 18px system-ui; border-radius: 14px; letter-spacing: 0.01em; }
.fd-play { background: var(--fd-green); color: #12031f; border-color: var(--fd-green); box-shadow: 0 10px 30px rgba(0, 255, 135, 0.35); }
.fd-play:hover { filter: brightness(1.08); transform: translateY(-1px); }
.fd-online { background: rgba(5, 240, 255, 0.12); color: #fff; border: 2px solid rgba(5, 240, 255, 0.7); }
.fd-online[aria-expanded="true"] { background: rgba(5, 240, 255, 0.22); box-shadow: 0 0 0 3px rgba(5, 240, 255, 0.25); }
.fd-cta-sub { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.fd-cta-sub .rival-row { color: #cdbfee; }
.fd-cta-sub .rival-row select { background: rgba(0, 0, 0, 0.3); color: #fff; border: 1px solid rgba(255, 255, 255, 0.2); }
.fd-cta-sub .tut-btn { width: auto; flex: 1 1 240px; }
.fd-live-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.fd-pill { display: inline-flex; align-items: center; gap: 6px; font: 700 13px system-ui; color: #e1d8f5; padding: 6px 12px; border-radius: 999px; background: rgba(0, 0, 0, 0.28); border: 1px solid rgba(255, 255, 255, 0.12); }
.fd-pill b { color: #fff; font-size: 14px; }
.fd-pill.live { border-color: rgba(255, 46, 126, 0.55); }
.fd-hero .online { background: rgba(0, 0, 0, 0.32); border: 1px solid rgba(255, 255, 255, 0.12); }

/* hero card fan: the game's own big cards, holographic shine, gentle float */
.fd-hero-cards { position: relative; height: 420px; display: grid; place-items: center; }
.fd-fan { position: relative; width: 100%; height: 100%; --fan-cw: clamp(150px, 15vw, 210px); }
.fd-fan .card.big { --cw: var(--fan-cw); }
.fd-fan .card { position: absolute; left: 50%; top: 50%; cursor: default; pointer-events: none; filter: drop-shadow(0 26px 30px rgba(0, 0, 0, 0.55)); }
.fd-fan-0 { transform: translate(-50%, -50%) translateX(-62%) rotate(-12deg) scale(0.86); animation: fd-float-a 6s ease-in-out infinite; }
.fd-fan-1 { transform: translate(-50%, -50%) translateY(-4%) scale(1.04); z-index: 2; animation: fd-float-b 6s ease-in-out infinite; }
.fd-fan-2 { transform: translate(-50%, -50%) translateX(62%) rotate(12deg) scale(0.86); animation: fd-float-c 6s ease-in-out infinite; }
@keyframes fd-float-a { 50% { transform: translate(-50%, -50%) translateX(-62%) translateY(-10px) rotate(-10deg) scale(0.86); } }
@keyframes fd-float-b { 50% { transform: translate(-50%, -50%) translateY(-8%) scale(1.05); } }
@keyframes fd-float-c { 50% { transform: translate(-50%, -50%) translateX(62%) translateY(-12px) rotate(10deg) scale(0.86); } }
.fd-fan .card .face.front::before { /* holographic sweep */
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; mix-blend-mode: color-dodge; opacity: 0.4;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 0, 170, 0.55) 40%, rgba(0, 255, 230, 0.55) 50%, rgba(255, 238, 0, 0.55) 60%, transparent 70%);
  background-size: 260% 100%; animation: holo 4s linear infinite;
}
.fd-fan-glow { position: absolute; inset: 15% 10%; border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 255, 135, 0.35), rgba(5, 240, 255, 0.15), transparent); filter: blur(30px); z-index: -1; }

/* ---- dashboard panels ---- */
.fd-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 22px; align-items: start; }
.fd-side { display: grid; gap: 22px; }
.fd-panel { background: var(--fd-panel); border: 1px solid var(--fd-line); border-radius: 20px; overflow: hidden; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35); backdrop-filter: blur(6px); }
.fd-ph {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 18px;
  background: linear-gradient(90deg, rgba(0, 255, 135, 0.16), rgba(5, 240, 255, 0.08) 60%, transparent);
  border-bottom: 1px solid var(--fd-line);
}
.fd-ph h2 { margin: 0; display: flex; align-items: center; gap: 8px; font: 900 italic 18px system-ui, sans-serif; text-transform: uppercase; letter-spacing: 0.02em; color: #fff; }
.fd-ph-sub { font-size: 13px; color: #bfb1e3; }
.fd-ph-link { margin-left: auto; font: 800 13px system-ui; color: var(--fd-green); background: none; border: 0; padding: 4px 0; cursor: pointer; }
.fd-ph-link:hover { text-decoration: underline; }
.home .fd-ph-link.lb-btn { display: inline; border-radius: 0; background: none; }
.fd-pbody { padding: 16px 18px; display: grid; gap: 14px; }
.fd-empty { margin: 0; color: #bfb1e3; font-size: 14px; }

/* squad */
.fd-squad .name-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.fd-label { font: 800 12px system-ui; letter-spacing: 0.1em; text-transform: uppercase; color: #bfb1e3; }
.home .hp-input { background: rgba(0, 0, 0, 0.3); border-color: rgba(255, 255, 255, 0.16); padding: 10px 12px; font-size: 16px; }
.home .hp-input:focus { border-color: var(--fd-green); box-shadow: 0 0 0 4px rgba(0, 255, 135, 0.18); }
.home .hp-input.locked { color: var(--fd-green); }
.home .deck-feature { background: linear-gradient(135deg, rgba(0, 255, 135, 0.1), rgba(5, 240, 255, 0.04)); border-color: rgba(0, 255, 135, 0.35); }
.home .df-modify { background: var(--fd-green); color: #12031f; border-color: var(--fd-green); }
.home .deck-opt { background: rgba(0, 0, 0, 0.25); }
.home .deck-opt[aria-checked="true"] { border-color: var(--fd-green); background: rgba(0, 255, 135, 0.1); box-shadow: 0 0 0 3px rgba(0, 255, 135, 0.18); }
.home .deck-opt.build { border-color: rgba(0, 255, 135, 0.5); background: rgba(0, 255, 135, 0.05); }
.home .build-plus { color: var(--fd-green); border-color: rgba(0, 255, 135, 0.5); }

/* manager */
.home .fd-manager .acc-bar { background: rgba(0, 0, 0, 0.22); }
.fd-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.fd-tiles div { display: grid; justify-items: center; gap: 2px; padding: 10px 4px; border-radius: 12px; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--fd-line); }
.fd-tiles b { font: 900 20px system-ui; color: #fff; font-variant-numeric: tabular-nums; }
.fd-tiles span { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #bfb1e3; }
.fd-form { position: relative; height: 26px; border-radius: 8px; background: rgba(0, 0, 0, 0.3); overflow: hidden; display: grid; align-items: center; }
.fd-form i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--fd-green), var(--fd-cyan)); opacity: 0.85; }
.fd-form span { position: relative; padding: 0 10px; font: 800 12px system-ui; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }
.fd-guest { margin: 0; font-size: 14px; line-height: 1.5; color: #e1d8f5; }
.fd-guest b { color: var(--fd-green); }

/* mini leaderboard */
.fd-board-what { margin: 0; font-size: 12px; font-weight: 700; color: #bfb1e3; text-transform: uppercase; letter-spacing: 0.08em; }
.fd-board-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.fd-board-list li { display: grid; grid-template-columns: 30px 28px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(0, 0, 0, 0.22); }
.fd-board-list li:first-child { background: linear-gradient(90deg, rgba(245, 197, 66, 0.22), rgba(0, 0, 0, 0.2)); }
.fd-board-list li.me { outline: 2px solid var(--fd-green); }
.fd-rank { font: 900 16px system-ui; text-align: center; }
.fd-board-list .lb-av { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.12); font-size: 13px; font-weight: 900; overflow: hidden; }
.fd-bname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.fd-bname em { font-style: normal; font-size: 11px; color: #12031f; background: var(--fd-green); border-radius: 4px; padding: 0 4px; }
.fd-board-list b { font: 900 16px system-ui; color: var(--fd-green); font-variant-numeric: tabular-nums; }

/* live matches */
.fd-live-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fd-live-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(0, 0, 0, 0.22); border-left: 3px solid var(--fd-pink); }
.fd-vs { display: flex; gap: 6px; align-items: baseline; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fd-vs em { font-style: normal; font-size: 11px; color: #bfb1e3; text-transform: uppercase; }
.fd-min { font: 800 12px ui-monospace, monospace; color: var(--fd-pink); }
.fd-watch { padding: 5px 10px; font-size: 13px; }

/* home news banner (big real-football moments) */
.fd-news { display: flex; align-items: center; gap: 12px; justify-self: start; max-width: 520px; padding: 8px 16px 8px 8px; border-radius: 16px; text-decoration: none; color: #fff4d6; background: linear-gradient(100deg, rgba(245, 192, 74, 0.28), rgba(245, 192, 74, 0.08)); border: 1px solid rgba(245, 192, 74, 0.55); box-shadow: 0 8px 26px rgba(245, 192, 74, 0.18); }
.fd-news img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; object-position: 50% 18%; flex: none; }
.fd-news span { display: grid; gap: 2px; font-size: 13px; line-height: 1.3; }
.fd-news b { font-size: 15px; color: #ffd66b; }
.fd-news small { font-size: 13px; }
.fd-news em { font-style: normal; font-weight: 700; color: #fff; }
.fd-news:hover { border-color: #ffd66b; }
.fd-news[hidden] { display: none; }

/* Team of the Week */
.fd-totw .fd-ph { background: linear-gradient(90deg, rgba(245, 197, 66, 0.25), rgba(0, 255, 135, 0.08) 60%, transparent); }
.fd-totw-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; --totw-cw: clamp(110px, 12vw, 170px); }
.fd-totw-row .card.big { --cw: var(--totw-cw); }
.fd-totw-item { margin: 0; display: grid; justify-items: center; gap: 8px; }
.fd-totw-item .card { cursor: default; transition: transform 0.2s; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.5)); }
.fd-totw-item:hover .card { transform: translateY(-6px) rotate(-1.5deg); }
.fd-totw-item figcaption { display: grid; justify-items: center; text-align: center; gap: 2px; }
.fd-totw-item figcaption b { font-size: 15px; }
.fd-totw-item figcaption span { font-size: 12px; color: #bfb1e3; }

/* how to play */
.fd-how { display: grid; gap: 16px; padding: 22px; border-radius: 20px; background: linear-gradient(135deg, rgba(5, 240, 255, 0.08), rgba(0, 0, 0, 0.15)); border: 1px solid var(--fd-line); }
.fd-how h2 { margin: 0; font: 900 italic 22px system-ui; text-transform: uppercase; }
.fd-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.fd-steps li { position: relative; padding: 16px 16px 14px 62px; border-radius: 16px; background: var(--fd-panel); border: 1px solid var(--fd-line); }
.fd-steps b { font-size: 17px; }
.fd-steps p { margin: 4px 0 0; font-size: 14px; line-height: 1.45; color: #d6cbef; }
.fd-step-n { position: absolute; left: 14px; top: 14px; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font: 900 italic 20px system-ui; color: #12031f; background: linear-gradient(135deg, var(--fd-green), var(--fd-cyan)); }
.fd-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.fd-facts div { display: grid; gap: 2px; padding: 12px; border-radius: 14px; background: rgba(0, 0, 0, 0.22); text-align: center; }
.fd-facts b { font: 900 italic 26px system-ui; background: linear-gradient(90deg, var(--fd-green), var(--fd-cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.fd-facts span { font-size: 13px; color: #d6cbef; }
.fd-how .how-actions { display: flex; flex-wrap: wrap; gap: 10px; }
/* How to play in 3 pictures (2026-11-26): the card's numbers, a fight, the Fan Support (index.html .how-vis) */
.how-vis li { display: grid; align-content: start; gap: 4px; padding: 14px 16px 16px; }
.how-vis .fd-step-n { z-index: 2; }
.hv-pic { position: relative; height: 150px; margin: 0 0 8px; border-radius: 12px; display: flex; align-items: center; justify-content: center; gap: 10px; overflow: hidden;
  background: radial-gradient(120% 100% at 50% 100%, rgba(40, 150, 80, 0.45), rgba(10, 40, 25, 0.6)); border: 1px solid rgba(255, 255, 255, 0.1); }
.hv-card { position: relative; width: 84px; display: grid; justify-items: center; gap: 2px; padding: 4px 4px 5px; border-radius: 9px; background: linear-gradient(160deg, #f0d48a, #b8862b); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45); color: #1b1200; }
.hv-card img { width: 76px; height: 64px; object-fit: cover; border-radius: 6px; display: block; }
.hv-card b { font: 800 11px/1.1 system-ui, sans-serif; }
.hv-stats { display: flex; gap: 2px; width: 100%; }
.hv-stats i { flex: 1; font: 900 12px/1.5 system-ui, sans-serif; font-style: normal; text-align: center; border-radius: 4px; background: #fff7e0; }
.hv-1 .hv-atk { background: #ffd0c8; outline: 2px solid #ff5a46; }
.hv-1 .hv-def { background: #cfe6ff; outline: 2px solid #4fa8ff; }
.hv-tag { position: absolute; bottom: 10px; font: 800 11px/1 system-ui, sans-serif; padding: 4px 7px; border-radius: 999px; color: #fff; white-space: nowrap; }
.hv-tag.atk { left: 8px; background: #d8392b; } .hv-tag.def { right: 8px; background: #2f74c7; }
.hv-1 .hv-card { margin-bottom: 18px; }
.hv-vs { font-size: 22px; animation: hv-clash 3.2s ease-in-out infinite; }
.hv-2 .hv-card.win .hv-atk { background: #c9f5d6; outline: 2px solid #2fbf6b; }
.hv-2 .hv-card.lose .hv-atk { background: #ffd0c8; }
.hv-2 .hv-card.lose { animation: hv-off 3.2s ease-in-out infinite; }
.hv-off { position: absolute; right: 12px; top: 50%; transform: translateY(-50%) rotate(-14deg); font: 900 13px/1 system-ui, sans-serif; letter-spacing: 0.06em; color: #fff; background: #d8392b; padding: 5px 8px; border-radius: 6px; opacity: 0; animation: hv-stamp 3.2s ease-in-out infinite; }
.hv-3 { flex-direction: column; gap: 8px; padding: 0 18px; align-items: stretch; }
.hv-who { font: 800 12px/1 system-ui, sans-serif; color: #e8f6ec; text-transform: uppercase; letter-spacing: 0.06em; }
.hv-bar { height: 14px; border-radius: 999px; background: rgba(0, 0, 0, 0.4); overflow: hidden; }
.hv-bar i { display: block; height: 100%; width: 100%; border-radius: inherit; background: linear-gradient(90deg, #2fbf6b, #f5c04a); animation: hv-drain 3.2s ease-in-out infinite; }
.hv-lp { font: 900 22px/1 system-ui, sans-serif; color: #fff; } .hv-lp s { color: rgba(255, 255, 255, 0.45); font-size: 16px; } .hv-lp b { color: #f5c04a; }
.hv-math { font: 800 13px/1 system-ui, sans-serif; color: #e8f6ec; } .hv-math b { color: #ff7a66; }
@keyframes hv-clash { 0%, 20% { transform: scale(1); } 35% { transform: scale(1.5) rotate(-10deg); } 50%, 100% { transform: scale(1); } }
@keyframes hv-off { 0%, 40% { opacity: 1; filter: none; transform: none; } 60%, 88% { opacity: 0.35; filter: grayscale(1); transform: translateY(6px) rotate(6deg); } 100% { opacity: 1; filter: none; transform: none; } }
@keyframes hv-stamp { 0%, 42% { opacity: 0; transform: translateY(-50%) rotate(-14deg) scale(1.6); } 52%, 88% { opacity: 1; transform: translateY(-50%) rotate(-14deg) scale(1); } 100% { opacity: 0; } }
@keyframes hv-drain { 0%, 30% { width: 100%; } 55%, 88% { width: 85.6%; } 100% { width: 100%; } }
/* phones: the 3 pictures in one swipeable row (they stacked to ~1300 px) */
@media (max-width: 760px) {
  .fd-how { min-width: 0; }
  .fd-steps.how-vis { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px; margin: 0 -16px; padding: 0 16px 6px; scroll-padding-inline: 16px; scrollbar-width: none; overscroll-behavior-x: contain; }
  .fd-steps.how-vis::-webkit-scrollbar { display: none; }
  .how-vis li { flex: 0 0 min(300px, 84%); scroll-snap-align: start; }
  .how-vis p { font-size: 13.5px; }
}
@media (prefers-reduced-motion: reduce) { .hv-vs, .hv-2 .hv-card.lose, .hv-off, .hv-bar i { animation: none; } .hv-off { opacity: 1; } .hv-bar i { width: 85.6%; } .hv-2 .hv-card.lose { opacity: 0.4; } }
/* Questions about the game (also the FAQ that search engines and AI assistants read) */
.fd-faq { display: grid; gap: 14px; padding: 22px; border-radius: 20px; background: rgba(0, 0, 0, 0.18); border: 1px solid var(--fd-line); }
.fd-faq h2 { margin: 0; font: 900 italic 22px system-ui; text-transform: uppercase; }
.fd-faq-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.fd-qa { padding: 14px 16px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.08); }
.fd-qa h3 { margin: 0 0 6px; font: 800 16px system-ui; color: #fff; }
.fd-qa p { margin: 0; color: #cfc6e8; font-size: 14.5px; line-height: 1.5; }

.fd-foot { display: grid; gap: 10px; justify-items: center; padding-top: 6px; }
.home .home-ad { background: var(--fd-panel); border-color: var(--fd-line); }

/* ---- responsive ---- */
@media (max-width: 1020px) {
  .fd-hero { grid-template-columns: 1fr; padding: 26px 22px; }
  .fd-hero-cards { order: -1; height: 300px; }
  .fd-fan { --fan-cw: clamp(120px, 26vw, 170px); }
  .fd-grid { grid-template-columns: 1fr; }
  .fd-totw-row { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: calc(var(--totw-cw) + 16px); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; justify-content: start; }
  .fd-totw-item { scroll-snap-align: start; }
}
@media (max-width: 760px) {
  .fd-top { gap: 10px; padding: 8px 12px; flex-wrap: wrap; }
  .fd-brand { font-size: 18px; }
  .fd-nav { order: 3; flex-basis: 100%; }
  .fd-nav a { font-size: 13px; padding: 6px 10px; }
  .fd-top-actions { margin-left: auto; }
  .fd-top-actions .icon-btn { display: none; }
  .home .acc-chip { max-width: 46vw; }
  .fd-wrap { padding: 14px 12px 28px; gap: 16px; }
  .fd-hero { border-radius: 20px; padding: 20px 16px; gap: 14px; }
  .fd-hero-cards { height: 230px; }
  .fd-fan { --fan-cw: 112px; }
  .home .home-title { font-size: 40px; }
  .home .home-tag { font-size: 15px; }
  .fd-cta .big-btn { flex: 1 1 100%; }
  .fd-steps, .fd-facts { grid-template-columns: 1fr 1fr; }
  .fd-steps { grid-template-columns: 1fr; }
  .fd-squad .name-row { grid-template-columns: 1fr auto; }
  .fd-squad .fd-label { grid-column: 1 / -1; }
  .fd-totw-row { --totw-cw: 118px; }
  .fd-tiles b { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .fd-fan .card, .fd-dot, .fd-fan .card .face.front::before { animation: none !important; }
}

/* ---- Rivalries showcase (fan-art banners) ---- */
.fd-show { position: relative; border-radius: 24px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.14); box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5); background: #07020f; }
.fd-show-track { position: relative; aspect-ratio: 1200 / 478; }
.fd-slide { position: absolute; inset: 0; margin: 0; opacity: 0; transition: opacity 0.9s ease; }
.fd-slide.on { opacity: 1; }
.fd-slide img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; transform: scale(1.04); transition: transform 6s ease-out; }
.fd-slide.on img { transform: scale(1); }
.fd-slide::after { /* fade the bottom so captions read well */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 45%, rgba(10, 2, 22, 0.75) 78%, #0a0216 100%), linear-gradient(90deg, rgba(10, 2, 22, 0.35), transparent 30%, transparent 70%, rgba(10, 2, 22, 0.35));
}
.fd-slide figcaption { position: absolute; left: 50%; bottom: 58px; transform: translateX(-50%); z-index: 1; display: grid; justify-items: center; gap: 4px; text-align: center; width: max-content; max-width: 92%; }
.fd-show-tag { font: 800 11px system-ui; letter-spacing: 0.16em; text-transform: uppercase; color: #12031f; background: var(--fd-green); padding: 3px 10px; border-radius: 999px; }
.fd-slide figcaption b { font: 900 italic clamp(26px, 4vw, 52px)/1 system-ui, sans-serif; text-transform: uppercase; color: #fff; text-shadow: 0 4px 0 rgba(0, 0, 0, 0.45), 0 0 30px rgba(0, 0, 0, 0.6); }
.fd-slide figcaption b i { font-size: 0.55em; color: var(--fd-green); vertical-align: 0.2em; margin: 0 0.15em; }
.fd-slide figcaption em { font-style: normal; font-size: 15px; color: #e8def8; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8); }
.fd-show-fanart { position: absolute; top: 12px; right: 14px; z-index: 2; font: 800 10px system-ui; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255, 255, 255, 0.75); background: rgba(0, 0, 0, 0.45); padding: 3px 8px; border-radius: 6px; }
.fd-show-ui { position: absolute; left: 0; right: 0; bottom: 14px; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 16px; }
.fd-show-cta { background: var(--fd-green); color: #12031f; border-color: var(--fd-green); font: 900 15px system-ui; padding: 9px 18px; border-radius: 12px; box-shadow: 0 8px 22px rgba(0, 255, 135, 0.35); }
.fd-show-dots { display: flex; gap: 8px; }
.fd-show-dots button { width: 10px; height: 10px; padding: 0; border-radius: 999px; border: 0; background: rgba(255, 255, 255, 0.4); cursor: pointer; transition: width 0.25s, background 0.25s; }
.fd-show-dots button[aria-selected="true"] { width: 28px; background: var(--fd-green); }
@media (max-width: 760px) {
  .fd-show { border-radius: 18px; }
  .fd-show-track { aspect-ratio: 1200 / 800; } /* whole image on top, caption below it */
  .fd-slide img { height: auto; aspect-ratio: 1200 / 478; transform: none !important; }
  .fd-slide::after { background: linear-gradient(180deg, transparent 40%, #0a0216 60%); }
  .fd-slide figcaption { bottom: 54px; }
  .fd-slide figcaption b { font-size: 26px; }
  .fd-slide figcaption em { font-size: 13px; }
  .fd-show-cta { font-size: 14px; padding: 8px 14px; }
}
@media (prefers-reduced-motion: reduce) { .fd-slide, .fd-slide img { transition: none; } }

/* =====================================================================
   Full-time screen: broadcast-style match summary
   ===================================================================== */
.ic { display: inline-block; vertical-align: -3px; flex: none; }
.acc-stats { display: inline-flex; align-items: center; gap: 6px; }
.modal.ft-modal {
  width: min(640px, 100%); padding: 0; overflow: auto; border: 0; border-radius: 22px;
  background: linear-gradient(180deg, #2a0a4c, #160428 55%, #0f031d); box-shadow: 0 40px 100px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.12);
  --ft-a: #00ff87; --ft-b: #05f0ff;
}
.ft { display: grid; gap: 14px; padding: 0 0 18px; }
.ft.lost { --ft-a: #ff5d6c; --ft-b: #ff9f1c; }
.ft-head { position: relative; text-align: center; padding: 22px 20px 16px; overflow: hidden; isolation: isolate;
  background: linear-gradient(115deg, color-mix(in srgb, var(--ft-a) 26%, transparent), transparent 45%), linear-gradient(295deg, color-mix(in srgb, var(--ft-b) 22%, transparent), transparent 50%); }
.ft-head::before { content: ""; position: absolute; inset: -50%; z-index: -1; opacity: 0.35; background: repeating-linear-gradient(115deg, transparent 0 40px, rgba(255, 255, 255, 0.06) 40px 42px); }
.ft-eyebrow { font: 800 11px system-ui; letter-spacing: 0.18em; text-transform: uppercase; color: rgba(255, 255, 255, 0.75); }
.ft-title { margin: 6px 0 4px !important; font: 900 italic clamp(46px, 11vw, 76px)/0.95 system-ui, sans-serif; text-transform: uppercase; letter-spacing: -0.01em;
  background: linear-gradient(90deg, var(--ft-a), var(--ft-b)); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 5px 0 rgba(0, 0, 0, 0.35)); animation: ft-in calc(0.5s * var(--dur)) cubic-bezier(.2, .9, .3, 1.3) both; }
.ft-title.sm { font-size: clamp(30px, 7vw, 44px); }
.ft.spec .ft-title { font-size: clamp(34px, 8vw, 54px); }
@keyframes ft-in { from { transform: scale(1.6); opacity: 0; } }
.ft-reason { margin: 0; color: #e6dcf7; font-size: 15px; display: flex; gap: 6px; align-items: center; justify-content: center; }

/* scoreboard */
.ft-board { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin: 0 18px; padding: 14px; border-radius: 18px; background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(255, 255, 255, 0.1); }
.ft-side { display: grid; justify-items: center; gap: 4px; text-align: center; min-width: 0; }
.ft-crest { position: relative; width: 64px; height: 64px; }
.ft-crest svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5)); }
.ft-side.lose .ft-crest { filter: grayscale(0.6) brightness(0.8); }
.ft-crown { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); font-size: 20px; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6)); }
.ft-name { font-size: 15px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ft-you { font: 900 10px system-ui; letter-spacing: 0.1em; text-transform: uppercase; color: #12031f; background: var(--ft-a); border-radius: 4px; padding: 1px 6px; }
.ft-deck { font-size: 12px; color: #b9acd9; }
.ft-score { display: grid; grid-template-columns: auto auto auto; grid-template-rows: auto auto; column-gap: 8px; align-items: baseline; justify-items: center; }
.ft-score b { font: 900 clamp(26px, 7vw, 44px)/1 system-ui; font-variant-numeric: tabular-nums; color: rgba(255, 255, 255, 0.55); grid-row: 1; }
.ft-score i { grid-row: 1; font: 900 clamp(20px, 5vw, 32px)/1 system-ui; font-style: normal; color: rgba(255, 255, 255, 0.4); }
.ft-score b.w { color: #fff; text-shadow: 0 0 22px color-mix(in srgb, var(--ft-a) 70%, transparent); }
.ft-score span { grid-row: 2; grid-column: 1 / -1; font: 800 10px system-ui; letter-spacing: 0.14em; text-transform: uppercase; color: #b9acd9; margin-top: 4px; }

/* stat comparison */
.ft-stats { display: grid; gap: 8px; margin: 0 18px; }
.ft-row { display: grid; grid-template-columns: 54px 1fr 54px; align-items: center; gap: 10px; }
.ft-v { font: 900 17px system-ui; font-variant-numeric: tabular-nums; text-align: center; color: rgba(255, 255, 255, 0.7); }
.ft-v.best { color: #fff; }
.ft-mid { display: grid; gap: 4px; text-align: center; }
.ft-mid span { font: 700 12px system-ui; color: #cdbfee; }
.ft-bars { display: flex; justify-content: space-between; gap: 4px; height: 6px; }
.ft-bars i { display: block; height: 100%; border-radius: 999px; min-width: 3px; }
.ft-bars .l { background: linear-gradient(90deg, var(--ft-b), var(--ft-a)); }
.ft-bars .r { background: rgba(255, 255, 255, 0.28); }
.ft.lost .ft-bars .r { background: linear-gradient(90deg, #ff9aa4, #ff5d6c); }
.ft.lost .ft-bars .l { background: rgba(255, 255, 255, 0.35); }

/* player of the match */
.ft-potm { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; margin: 0 18px; padding: 12px 14px; border-radius: 16px;
  background: linear-gradient(90deg, rgba(245, 197, 66, 0.2), rgba(245, 197, 66, 0.03)); border: 1px solid rgba(245, 197, 66, 0.45); }
.ft-potm-card .card.big { --cw: 92px; cursor: default; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.5)); }
.ft-potm-info { display: grid; gap: 4px; min-width: 0; }
.ft-potm-info .ft-eyebrow { color: var(--gold); }
.ft-potm-info b { font: 900 22px/1.1 system-ui; }
.ft-potm-info > span:last-child { font-size: 14px; color: #e6dcf7; }

/* rating, saved, actions */
.ft-rating { display: flex; align-items: center; gap: 8px; justify-content: center; margin: 0 18px; padding: 10px; border-radius: 12px; background: rgba(0, 0, 0, 0.3); font-size: 15px; }
.ft-rating b { font-size: 20px; }
.ft-rating em { font-style: normal; font-weight: 900; padding: 2px 8px; border-radius: 999px; background: rgba(0, 255, 135, 0.18); color: #00ff87; }
.ft-rating.down em { background: rgba(255, 93, 108, 0.18); color: #ff8a96; }
.ft-rating.muted { color: #b9acd9; font-size: 13px; }
.ft-saved { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 0 18px; font-size: 14px; color: #cfeedd; }
.ft-saved .ic { color: #00ff87; }
.ft-saved.guest { padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); color: #e6dcf7; }
.ft-saved.guest .ic { color: #e6dcf7; }
.ft-link { display: inline-flex; align-items: center; gap: 5px; font: 800 14px system-ui; color: #05f0ff; background: none; border: 0; cursor: pointer; padding: 2px 4px; }
.ft-link:hover { text-decoration: underline; }
.ft-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 4px 18px 0; }
.ft-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border-radius: 14px; font: 800 15px system-ui; }
.ft-main { grid-column: 1 / -1; padding: 16px !important; font-size: 18px !important; background: linear-gradient(90deg, var(--ft-a), var(--ft-b)); color: #12031f; border: 0; box-shadow: 0 12px 30px color-mix(in srgb, var(--ft-a) 35%, transparent); }
.ft-main:hover { filter: brightness(1.06); }
.ft-sec { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.18); }
.ft-ghost { background: transparent; border-color: rgba(255, 255, 255, 0.12); color: #cdbfee; }
.ft.spec .ft-actions { grid-template-columns: 1fr 1fr; }
.ft-small .ft-actions { grid-template-columns: 1fr 1fr; }
@media (max-width: 480px) {
  .ft-board { margin: 0 12px; padding: 12px 8px; gap: 6px; }
  .ft-crest { width: 48px; height: 48px; }
  .ft-stats, .ft-potm, .ft-rating, .ft-saved, .ft-actions { margin-left: 12px; margin-right: 12px; }
  .ft-row { grid-template-columns: 44px 1fr 44px; }
  .ft-actions { grid-template-columns: 1fr 1fr; }
  .ft-actions .ft-ghost { grid-column: 1 / -1; }
  /* keep the next step in reach on phones: actions stay pinned to the bottom of the window */
  .ft-actions { position: sticky; bottom: 0; margin: 4px 0 0; padding: 12px; background: linear-gradient(180deg, rgba(15, 3, 29, 0), #0f031d 30%); }
  .ft-score span { font-size: 9px; }
}

/* al3ab-hub mark in the hub navigation */
.hub-brand { display: inline-flex; align-items: center; gap: 8px; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.hub-mark { width: 30px; height: 30px; flex: none; filter: drop-shadow(0 3px 8px rgba(58, 214, 255, 0.4)); }

/* Football Duel crest: match top bar and home top bar */
.logo { display: flex; align-items: center; gap: 8px; }
.logo-mark { width: 30px; height: 30px; flex: none; filter: drop-shadow(0 2px 6px rgba(0, 255, 135, 0.35)); }
.fd-mark { width: 38px; height: 38px; flex: none; filter: drop-shadow(0 3px 10px rgba(0, 255, 135, 0.45)); transition: transform 0.2s; }
.fd-brand:hover .fd-mark { transform: rotate(-8deg) scale(1.06); }
@media (max-width: 760px) { .fd-mark { width: 32px; height: 32px; } .logo-mark { width: 24px; height: 24px; } }

/* Al3ab Hub wordmark: "Al3ab" + gold "Hub", one text run */
.wm, .brand .wm, .hub-brand .wm { color: var(--ink, #eef1ff); white-space: nowrap; } .wm em { font-style: normal; color: var(--gold, #f5c542); }

/* ---- in-match chat (online) ---- */
.chat-btn.unread .unread-dot { display: block; }
.chat-panel { position: fixed; right: 16px; bottom: 16px; z-index: 45; width: min(340px, calc(100vw - 32px)); max-height: min(520px, 70vh); display: flex; flex-direction: column; border-radius: 16px; background: rgba(14, 22, 44, 0.97); border: 1px solid rgba(255, 255, 255, 0.16); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6); overflow: hidden; }
.chat-panel[hidden] { display: none; }
.chat-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.chat-note { font-size: 11px; color: var(--muted); flex: 1; }
.chat-mute, .chat-close { font: 800 12px system-ui; color: var(--ink); background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 8px; padding: 4px 8px; cursor: pointer; }
.chat-mute[aria-pressed="true"] { background: rgba(255, 93, 108, 0.2); border-color: var(--bad); }
.chat-log { list-style: none; margin: 0; padding: 8px 12px; overflow-y: auto; flex: 1; min-height: 60px; display: grid; gap: 4px; align-content: start; font-size: 14px; }
.chat-log li b { color: #ff8a96; margin-right: 4px; }
.chat-log li.mine b { color: #7fd8ff; }
.chat-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.chat-quick button { font: 700 13px system-ui; color: var(--ink); background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 999px; padding: 5px 10px; cursor: pointer; }
.chat-quick button:hover { border-color: var(--gold); background: rgba(245, 197, 66, 0.12); }
.chat-form { display: flex; gap: 6px; padding: 0 12px 12px; }
.chat-form input { flex: 1; min-width: 0; font: 600 14px system-ui; color: var(--ink); background: var(--night); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 10px; padding: 8px 10px; }
.chat-spec { margin: 0; padding: 8px 12px 12px; font-size: 12px; color: var(--muted); }
.speech.chat { background: #e8f6ff; color: #0b1a33; font-weight: 800; }
@media (max-width: 560px) { .chat-panel { right: 8px; left: 8px; bottom: 8px; width: auto; max-height: 60vh; } }

/* Voice chat (friend rooms) */
.mic-btn[data-state="off"] { filter: grayscale(0.6); opacity: 0.85; }
.mic-btn[data-state="live"] { background: var(--bad); border-color: var(--bad); color: #fff; filter: none; opacity: 1; box-shadow: 0 0 0 0 color-mix(in srgb, var(--bad) 60%, transparent); animation: mic-live 1.6s ease-out infinite; }
.mic-btn.invite { filter: none; opacity: 1; animation: mic-invite 1.2s ease-in-out infinite; }
@keyframes mic-live { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--bad) 55%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }
@keyframes mic-invite { 50% { transform: scale(1.12); } }
#you-panel.talking, #opp-panel.talking { box-shadow: 0 0 0 2px var(--good), 0 0 18px color-mix(in srgb, var(--good) 55%, transparent); transition: box-shadow 0.15s; }
@media (prefers-reduced-motion: reduce) { .mic-btn[data-state="live"], .mic-btn.invite { animation: none; } }

/* Chat + voice controls inside each player's panel: a row under the profile on wide screens, icons inline on phones */
.d-comms { display: flex; align-items: center; gap: 6px; order: 4; }
.d-comms:not(:has(> :not([hidden]))) { display: none; }
.d-comms [hidden] { display: none !important; }
.comms-btn, .opp-mic {
  position: relative; display: inline-flex; align-items: center; gap: 2px; height: 30px; padding: 0 10px; border-radius: 999px;
  font: 800 12px system-ui; color: var(--ink); background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.16); white-space: nowrap;
}
.comms-btn { cursor: pointer; }
.comms-btn:hover { border-color: var(--gold); background: rgba(245, 197, 66, 0.12); }
.comms-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.chat-btn.unread .unread-dot { display: block; }
.chat-btn[aria-expanded="true"] { border-color: var(--gold); }
.opp-mic { background: transparent; border-style: dashed; color: var(--muted); }
.opp-mic[data-on="true"] { border-style: solid; border-color: var(--good); color: var(--good); }
#opp-panel.talking .opp-mic[data-on="true"] { background: color-mix(in srgb, var(--good) 18%, transparent); }
.opp-mute[aria-pressed="true"] { border-color: var(--bad); background: rgba(255, 93, 108, 0.18); }
@media (min-width: 1000px) and (min-aspect-ratio: 5/4) {
  .duelist > .avatar + div { flex: 1 1 0; min-width: 0; }
  .duelist .d-name { white-space: normal; line-height: 1.35; }
  .duelist .vault-badge { white-space: nowrap; }
  /* the bottom panel may rise into the empty left side of the status rows, so the extra controls don't push the page */
  #you-panel { grid-column: 1; grid-row: 2 / 5; align-self: end; }
  .d-comms { width: 100%; order: 6; padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
  .d-comms > * { flex: 1; justify-content: center; }
}
@media (max-width: 760px) {
  .duelist > .avatar + div { flex: 1 1 0; min-width: 0; }
  .duelist .d-name { overflow: hidden; text-overflow: ellipsis; }
  .duelist .lp { min-width: 64px; flex: none; }
  .d-comms { gap: 4px; flex: none; }
  .comms-btn, .opp-mic { width: 34px; height: 34px; padding: 0; justify-content: center; font-size: 15px; }
  .c-label { display: none; }
}
/* small phones: keep the match top bar inside the screen (bug reports stay on the home page) */
@media (max-width: 430px) {
  .topbar #btn-bug { display: none; }
  .top-actions { gap: 3px; }
  .top-actions .btn { padding: 5px 7px; }
}

/* Deck choice before every match */
.modal.deck-choose { width: min(720px, 100%); display: flex; flex-direction: column; gap: 10px; }
.dc-title { margin: 0; font-size: 20px; }
.dc-sub { margin: -6px 0 2px; color: var(--muted); font-size: 13px; }
.dc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; max-height: min(52dvh, 440px); overflow-y: auto; padding: 2px; }
.dc-opt { align-items: center; text-align: center; padding: 10px 6px 8px; position: relative; }
.dc-opt b { font-size: 13px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.dc-opt[disabled] { opacity: 0.45; cursor: not-allowed; }
.dc-opt[aria-checked="true"]::after { content: "✓"; position: absolute; top: 6px; right: 8px; width: 20px; height: 20px; border-radius: 50%; background: var(--gold); color: #1a1300; font: 900 12px/20px system-ui; }
.dc-tag { font-style: normal; font-size: 10px; font-weight: 800; color: var(--gold); text-transform: uppercase; letter-spacing: 0.06em; }
.dc-rival { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 700; }
.dc-rival select { font: 700 14px system-ui; color: var(--ink); background: var(--night); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 8px; padding: 6px 8px; }
.dc-build { align-self: flex-start; font: 800 13px system-ui; color: var(--gold); background: none; border: 0; padding: 4px 0; cursor: pointer; }
.dc-build:hover { text-decoration: underline; }
.modal.deck-choose .actions .btn.primary { min-width: 140px; }
@media (max-width: 560px) {
  .dc-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; max-height: 50dvh; }
  .dc-opt { padding: 8px 4px 6px; }
  .dc-opt b { font-size: 11px; }
  .dc-opt .pack { transform: scale(0.85); }
  .modal.deck-choose { padding: 14px; }
}

/* ✦ skill used up / blocked, Icon tag */
.c-ab.off { color: #8a8f9c; opacity: 0.55; filter: grayscale(1); }
.ab-state { font: 800 10px system-ui; text-transform: uppercase; letter-spacing: 0.06em; padding: 1px 6px; border-radius: 999px; margin-left: 4px; vertical-align: 1px; }
.ab-state.on { background: rgba(70, 224, 138, 0.18); color: var(--good); }
.ab-state.off { background: rgba(255, 255, 255, 0.08); color: var(--muted); }
.ab-when { display: block; color: var(--muted); font-size: 0.9em; margin-top: 2px; }
.c-tag.icon { background: linear-gradient(135deg, #6c7a93, #b9c4d8); color: #111827; }
.card .new-chip { position: absolute; top: 31%; left: 5%; z-index: 3; font: 900 clamp(7px, calc(var(--cw) * 0.075), 10px)/1 system-ui; letter-spacing: 0.06em; color: #062a14; background: var(--good); padding: 0.3em 0.55em; border-radius: 999px; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4); }

/* ---------- deck builder: pick cards (tap = select, − / ＋ on every card) ---------- */
.b-grid { gap: 18px 12px; padding: 10px 6px 28px; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }
.b-cell { position: relative; display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 8px 4px 9px; border-radius: 16px; transition: background 0.2s, box-shadow 0.2s; }
.b-cell.in { background: radial-gradient(120% 90% at 50% 30%, rgba(70, 224, 138, 0.16), transparent 70%); box-shadow: inset 0 0 0 1px rgba(70, 224, 138, 0.35); }
.b-pick { position: relative; display: block; padding: 0; margin: 0; border: 0; background: none; cursor: pointer; border-radius: calc(var(--cw) * 0.08); outline: none; -webkit-tap-highlight-color: transparent; }
.b-pick .card { pointer-events: none; transition: transform 0.22s cubic-bezier(.2, .8, .2, 1.2), filter 0.2s; }
.b-pick .card .rot { transition: box-shadow 0.22s; }
.b-cell:hover .b-pick .card, .b-pick:focus-visible .card { transform: translateY(-6px) scale(1.05); filter: brightness(1.08) saturate(1.08); }
.b-cell:hover .b-pick .card .rot, .b-pick:focus-visible .card .rot { box-shadow: 0 16px 30px rgba(0, 0, 0, 0.55), 0 0 0 2px rgba(245, 197, 66, 0.8), 0 0 22px rgba(245, 197, 66, 0.35); }
.b-cell.in .b-pick .card .rot { box-shadow: 0 0 0 3px var(--good), 0 0 26px rgba(70, 224, 138, 0.6), 0 10px 22px rgba(0, 0, 0, 0.45); }
.b-cell.blocked .b-pick .card { filter: grayscale(0.75) brightness(0.62); }
.b-cell.blocked:hover .b-pick .card { transform: none; }
/* light sweep across the card on hover and when picked */
.b-shine { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; }
.b-shine::before { content: ""; position: absolute; top: -20%; bottom: -20%; width: 45%; left: -70%; transform: skewX(-18deg); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent); opacity: 0; }
.b-cell:hover .b-shine::before, .b-cell.b-picked .b-shine::before { animation: b-sweep 0.75s ease-out; }
@keyframes b-sweep { 0% { left: -70%; opacity: 0; } 20% { opacity: 1; } 100% { left: 130%; opacity: 0; } }
.b-check { position: absolute; top: 2px; right: 2px; z-index: 4; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 999px; display: grid; place-items: center; font: 900 13px/1 system-ui; color: #062a14; background: var(--good); box-shadow: 0 0 0 2px #0a1226, 0 4px 12px rgba(70, 224, 138, 0.55); animation: b-check-in 0.3s cubic-bezier(.2, .8, .2, 1.5); }
@keyframes b-check-in { from { transform: scale(0.2) rotate(-30deg); opacity: 0; } }
.b-info-btn { position: absolute; top: 2px; left: 2px; z-index: 4; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; font: italic 800 13px/1 Georgia, serif; color: var(--ink); background: rgba(10, 18, 38, 0.82); border: 1px solid rgba(255, 255, 255, 0.35); opacity: 0.85; transition: transform 0.15s, background 0.15s; }
.b-info-btn:hover, .b-info-btn:focus-visible { transform: scale(1.12); background: var(--gold); color: #1a1300; opacity: 1; }
.b-warn { position: absolute; left: 50%; top: calc(var(--cw) * 1.4 - 10px); transform: translateX(-50%); z-index: 4; white-space: nowrap; font: 800 10px/1 system-ui; color: #2b1d00; background: #ffc857; padding: 4px 7px; border-radius: 999px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45); pointer-events: none; }
.b-ctrl { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.12); }
.b-ctrl .b-n { min-width: 34px; text-align: center; font: 700 12px system-ui; color: var(--muted); }
.b-ctrl .b-n b { color: var(--ink); font-size: 14px; }
.b-cell.in .b-ctrl { border-color: rgba(70, 224, 138, 0.55); background: rgba(70, 224, 138, 0.1); }
.b-cell.in .b-ctrl .b-n b { color: var(--good); }
.b-minus, .b-plus { width: 30px; height: 30px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; font: 900 18px/1 system-ui; transition: transform 0.12s, background 0.15s, opacity 0.15s; }
.b-plus { color: #1a1300; background: linear-gradient(180deg, #ffe07a, var(--gold)); box-shadow: 0 2px 8px rgba(245, 197, 66, 0.35); }
.b-minus { color: #fff; background: rgba(255, 93, 108, 0.85); }
.b-minus:hover:not(:disabled), .b-plus:hover:not(:disabled) { transform: scale(1.12); }
.b-minus:active:not(:disabled), .b-plus:active:not(:disabled) { transform: scale(0.92); }
.b-minus:disabled, .b-plus:disabled { background: rgba(255, 255, 255, 0.08); color: rgba(255, 255, 255, 0.28); box-shadow: none; cursor: default; }
.b-minus:focus-visible, .b-plus:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
/* feedback */
.b-cell.b-picked .b-pick .card { animation: b-pop 0.5s cubic-bezier(.2, .8, .2, 1.4); }
.b-cell.b-picked::after { content: ""; position: absolute; left: 50%; top: calc(var(--cw) * 0.7 + 8px); width: calc(var(--cw) * 1.1); aspect-ratio: 1; border-radius: 50%; transform: translate(-50%, -50%) scale(0.3); border: 3px solid var(--good); opacity: 0.9; pointer-events: none; animation: b-ring 0.6s ease-out forwards; }
@keyframes b-pop { 0% { transform: scale(1); } 35% { transform: scale(1.14) rotate(-2deg); } 100% { transform: scale(1); } }
@keyframes b-ring { to { transform: translate(-50%, -50%) scale(1.5); opacity: 0; } }
.b-cell.b-dropped .b-pick .card { animation: b-drop 0.35s ease-out; }
@keyframes b-drop { 40% { transform: scale(0.88) translateY(6px); filter: brightness(0.7); } }
.b-cell.b-nope { animation: b-shake 0.4s; }
.b-cell.b-nope .b-pick .card .rot { box-shadow: 0 0 0 3px var(--bad), 0 0 18px rgba(255, 93, 108, 0.6); }
@keyframes b-shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.b-ghost { position: fixed !important; z-index: 300; margin: 0; pointer-events: none; filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.6)); }
.b-bump { animation: b-bump 0.4s cubic-bezier(.2, .8, .2, 1.6); display: inline-block; }
@keyframes b-bump { 40% { transform: scale(1.35); color: var(--good); } }
/* deck list rows: name opens details, − / ＋ change the count */
.b-row { grid-template-columns: 36px 1fr auto; cursor: default; padding: 3px 4px 3px 8px; }
.b-row:hover { border-color: rgba(255, 255, 255, 0.18); }
.b-row-name { font: 600 13px system-ui, sans-serif; color: var(--ink); background: none; border: 0; padding: 4px 0; text-align: left; cursor: pointer; min-width: 0; }
.b-row-name:hover { color: var(--gold); text-decoration: underline; }
.b-row-ctrl { display: inline-flex; align-items: center; gap: 6px; }
.b-row-ctrl b { min-width: 14px; text-align: center; font-size: 13px; }
.b-row-ctrl .b-minus, .b-row-ctrl .b-plus { width: 26px; height: 26px; font-size: 16px; }
.b-row.b-flash { animation: b-row-flash 0.7s ease-out; }
@keyframes b-row-flash { 0% { background: rgba(70, 224, 138, 0.45); } 100% { background: rgba(255, 255, 255, 0.04); } }
@media (max-width: 760px) {
  .b-grid { --cw: 92px; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 14px 4px; }
  .b-minus, .b-plus { width: 34px; height: 34px; }
  .b-info-btn { width: 28px; height: 28px; }
  .b-row-ctrl .b-minus, .b-row-ctrl .b-plus { width: 34px; height: 34px; font-size: 18px; }
  .b-row-name { font-size: 15px; }
}
@media (max-width: 380px) { .b-grid { --cw: 84px; grid-template-columns: repeat(3, 1fr); } }
@media (prefers-reduced-motion: reduce) { .b-cell.b-picked .b-pick .card, .b-cell.b-dropped .b-pick .card, .b-cell.b-nope, .b-check, .b-shine::before, .b-cell.b-picked::after { animation: none !important; } }
/* ✓ sits on the card's corner, ⓘ lives in the control bar (nothing covers the name or position) */
.b-check { top: -10px; right: -10px; }
.b-ctrl .b-info-btn { position: static; width: 26px; height: 26px; margin-right: 2px; opacity: 1; background: rgba(255, 255, 255, 0.1); border: 0; }
@media (max-width: 760px) { .b-ctrl .b-info-btn { width: 30px; height: 30px; } .b-ctrl .b-n { min-width: 28px; } }
/* compact control bar: ⓘ − n ＋ fits under every card */
.b-grid { grid-template-columns: repeat(auto-fill, minmax(126px, 1fr)); }
.b-ctrl { gap: 1px; }
.b-ctrl .b-info-btn { width: 24px; height: 24px; font-size: 12px; margin-right: 1px; }
.b-ctrl .b-minus, .b-ctrl .b-plus { width: 28px; height: 28px; font-size: 17px; }
.b-ctrl .b-n { min-width: 30px; }
.b-check { top: -11px; right: -11px; min-width: 24px; height: 24px; font-size: 12px; }
@media (max-width: 760px) {
  .b-grid { --cw: 92px; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 2px; padding: 12px 0 80px; }
  .b-ctrl .b-info-btn { width: 26px; height: 26px; }
  .b-ctrl .b-minus, .b-ctrl .b-plus { width: 31px; height: 31px; font-size: 18px; }
  .b-ctrl .b-n { min-width: 27px; font-size: 11px; }
}
@media (max-width: 360px) { .b-grid { --cw: 82px; } .b-ctrl .b-info-btn { display: none; } }

/* head-to-head record under each duelist (two signed-in players) */
.d-h2h { display: inline-flex; align-items: center; gap: 3px; margin-top: 2px; padding: 2px 8px; border-radius: 999px; font: 800 11px/1.3 system-ui; color: var(--muted); background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.12); white-space: nowrap; }
.d-h2h b.w { color: var(--good); }
.d-h2h b.l { color: #ff8a96; }
.d-h2h i { font-style: normal; opacity: 0.6; }
.d-h2h span { font-weight: 600; color: var(--muted); }
.ft-h2h { display: grid; justify-items: center; gap: 2px; margin: 4px auto 10px; padding: 10px 16px; border-radius: 14px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); max-width: 420px; text-align: center; }
.ft-h2h b { font-size: 17px; }
.ft-h2h em { font-style: normal; font-size: 22px; color: var(--gold); padding: 0 4px; }
.ft-h2h > span:last-child { font-size: 12px; color: var(--muted); }
@media (max-width: 760px) { .d-h2h { font-size: 10px; padding: 1px 6px; margin-top: 1px; } .d-h2h span { display: none; } }

/* deck builder performance: cells are built once and only shown / hidden; hover uses transforms only (no filters) */
.b-cell[hidden], .b-check[hidden], .b-warn[hidden], .b-empty[hidden] { display: none !important; }
.b-cell { contain: layout style; }
.b-cell:hover .b-pick .card, .b-pick:focus-visible .card { filter: none; }
.b-cell.blocked .b-pick .card { filter: none; opacity: 0.42; }
.b-cell.blocked .b-ctrl { opacity: 0.8; }
/* deck builder: catalogue cards never flip, so no 3D layers; the Legend / Gold sheen plays only on the hovered card
   (an always-running sheen on ~30 cards repainted the grid on every frame) */
.b-grid .card { perspective: none; }
.b-grid .card .flipper { transform-style: flat; }
.b-grid .face { backface-visibility: visible; }
.b-grid .face.back { display: none; }
.b-grid .card.legend .face.front, .b-grid .card.legend .face.front::after, .b-grid .card.gold .face.front, .b-grid .card.piece .face.front { animation: none; }
.b-grid .b-cell:hover .card.legend .face.front { animation: legendsheen 5s linear infinite; }
.b-grid .b-cell:hover .card.gold .face.front, .b-grid .b-cell:hover .card.piece .face.front { animation: goldsheen 4s ease-in-out infinite; }
.b-grid .card.legend .face.front::after { display: none; } /* blend-mode overlay: costly on a full grid */
.b-grid .b-cell:hover .card.legend .face.front::after { display: block; }
.b-ghost { filter: none; }
.b-ghost .rot { box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55); }
/* while the deck builder covers the home page, stop painting what's behind it */
body.builder-open #home { visibility: hidden; }
body.builder-open #home, body.builder-open #home * { animation-play-state: paused !important; }

/* Phones: one 🔊 button → Music / Sound effects switches (the two inline toggles are hidden on small screens) */
.sound-menu { position: relative; display: none; }
.sound-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 70; min-width: 230px; display: grid; gap: 4px; padding: 8px; border-radius: 14px;
  background: rgba(14, 22, 44, 0.98); border: 1px solid rgba(255, 255, 255, 0.16); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55); }
.sound-pop[hidden] { display: none; }
.sp-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; padding: 12px 12px; border-radius: 10px; border: 0; cursor: pointer;
  background: transparent; color: var(--ink); font: 700 15px system-ui; text-decoration: none !important; opacity: 1 !important; }
.sp-row:hover, .sp-row:focus-visible { background: rgba(255, 255, 255, 0.07); outline: none; }
.sp-switch { position: relative; width: 44px; height: 26px; border-radius: 999px; background: rgba(255, 255, 255, 0.18); transition: background 0.15s; flex: none; }
.sp-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.sp-row[aria-pressed="true"] .sp-switch { background: var(--good); }
.sp-row[aria-pressed="true"] .sp-switch::after { transform: translateX(18px); }
@media (max-width: 760px) {
  .sound-menu { display: inline-flex; }
}

/* ---------- home arena: Online now (challenge) + Watch live ---------- */
.fd-arena { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 22px; align-items: start; }
/* Since 2026-11-18 the arena sits inside the Play online box (hero column): one column, lighter panels, short lists. */
.online .fd-arena { grid-template-columns: 1fr; gap: 10px; margin-top: 4px; }
.online .fd-arena .fd-panel { border-radius: 14px; box-shadow: none; backdrop-filter: none; background: rgba(255, 255, 255, 0.03); }
.online .fd-arena .fd-ph { padding: 12px 14px 4px; flex-wrap: wrap; gap: 8px; }
.online .fd-arena .fd-ph h2 { font-size: 15px; }
.online .fd-arena .fd-pbody { padding: 10px 12px 12px; gap: 10px; }
.online .fd-arena .on-list { max-height: 300px; }
.online .fd-arena .watch-grid { grid-template-columns: 1fr; }
/* Quick match is already the first tile of the box: no second button, and a smaller empty state. */
.online .fd-arena .wl-empty [data-quick], .online .fd-arena .wl-empty-ico { display: none; }
.online .fd-arena .wl-empty { padding: 10px; }
.fd-dot.green { background: var(--fd-green); box-shadow: 0 0 10px var(--fd-green); }
.fd-count { margin-left: 6px; font-size: 13px; font-weight: 900; padding: 2px 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); vertical-align: 2px; }
.fd-count:empty { display: none; }
.fd-switch { display: inline-flex; align-items: center; gap: 8px; font: 700 12px system-ui; color: rgba(255, 255, 255, 0.75); cursor: pointer; user-select: none; }
.fd-switch input { position: absolute; opacity: 0; pointer-events: none; }
.fd-switch i { position: relative; width: 38px; height: 22px; border-radius: 999px; background: rgba(255, 255, 255, 0.18); transition: background 0.15s; flex: none; }
.fd-switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.fd-switch input:checked + i { background: var(--fd-green); }
.fd-switch input:checked + i::after { transform: translateX(16px); }
.fd-switch input:focus-visible + i { outline: 2px solid var(--fd-green); outline-offset: 2px; }

.on-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 420px; overflow-y: auto; }
.on-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.07); transition: border-color 0.15s, background 0.15s; }
.on-row:hover { border-color: rgba(0, 255, 135, 0.35); background: rgba(0, 255, 135, 0.05); }
.on-row.me { border-color: rgba(0, 255, 135, 0.4); background: linear-gradient(90deg, rgba(0, 255, 135, 0.1), rgba(0, 255, 135, 0.02)); }
.on-av { position: relative; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; overflow: visible; font-size: 20px; background: rgba(255, 255, 255, 0.08); }
.on-av > :not(.on-st) { width: 44px; height: 44px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; }
.on-av img { width: 100%; height: 100%; object-fit: cover; }
.on-st { position: absolute; right: -1px; bottom: -1px; width: 13px; height: 13px; border-radius: 50%; background: var(--fd-green); border: 3px solid #1b0933; box-shadow: 0 0 8px var(--fd-green); }
.on-row.playing .on-st { background: #ffb020; box-shadow: 0 0 8px #ffb020; }
.on-who { display: grid; min-width: 0; }
.on-who b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.on-who b em { font-style: normal; font-size: 10px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; color: #0b2a17; background: var(--fd-green); padding: 1px 6px; border-radius: 999px; margin-left: 4px; vertical-align: 2px; }
.on-who small { font-size: 12px; color: rgba(255, 255, 255, 0.6); }
.on-challenge { font-weight: 900; border-radius: 999px; padding: 8px 14px; background: linear-gradient(180deg, #ffe07a, #f5c542); color: #1a1300; border: 0; box-shadow: 0 4px 14px rgba(245, 197, 66, 0.3); }
.on-challenge:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(245, 197, 66, 0.45); }
.on-challenge:disabled { background: rgba(255, 255, 255, 0.08); color: rgba(255, 255, 255, 0.45); box-shadow: none; cursor: default; }
.on-empty { list-style: none; padding: 16px; border-radius: 14px; text-align: center; color: rgba(255, 255, 255, 0.65); font-size: 14px; background: rgba(255, 255, 255, 0.03); border: 1px dashed rgba(255, 255, 255, 0.14); }

.watch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.wl-card { position: relative; display: grid; gap: 12px; padding: 14px; border-radius: 18px; overflow: hidden;
  background: radial-gradient(120% 80% at 50% 0%, rgba(255, 46, 126, 0.16), rgba(255, 46, 126, 0) 60%), rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1); transition: transform 0.15s, border-color 0.15s; }
.wl-card:hover { transform: translateY(-2px); border-color: rgba(255, 46, 126, 0.55); }
.wl-card header { display: flex; align-items: center; gap: 10px; font: 800 12px system-ui; color: rgba(255, 255, 255, 0.7); }
.wl-live { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; background: var(--fd-pink); color: #fff; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 900; }
.wl-live i { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: fd-blink 1.2s ease-in-out infinite; }
.wl-vs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.wl-side { display: grid; justify-items: center; gap: 4px; text-align: center; min-width: 0; }
.wl-side .pack { --pw: 54px; }
.wl-side b { font-size: 15px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-side span { font-size: 11px; color: rgba(255, 255, 255, 0.6); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-x { font: italic 900 26px system-ui; color: var(--fd-pink); text-shadow: 0 0 18px rgba(255, 46, 126, 0.6); }
.wl-watch { width: 100%; border-radius: 12px; }
.wl-empty { grid-column: 1 / -1; display: grid; justify-items: center; gap: 6px; padding: 26px 16px; text-align: center; border-radius: 18px; background: rgba(255, 255, 255, 0.03); border: 1px dashed rgba(255, 255, 255, 0.14); }
.wl-empty-ico { font-size: 40px; filter: drop-shadow(0 0 16px rgba(255, 46, 126, 0.5)); }
.wl-empty p { margin: 0 0 8px; color: rgba(255, 255, 255, 0.65); font-size: 14px; }

/* challenge pop-up */
.modal.ch-modal { width: min(440px, 100%); text-align: center; }
.ch-box { display: grid; justify-items: center; gap: 8px; }
.ch-ico { font-size: 54px; filter: drop-shadow(0 0 20px rgba(245, 197, 66, 0.55)); }
.ch-av { width: 84px; height: 84px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; font-size: 40px; background: rgba(255, 255, 255, 0.08); box-shadow: 0 0 0 4px var(--gold), 0 0 30px rgba(245, 197, 66, 0.5); }
.ch-av > * { width: 100%; height: 100%; display: grid; place-items: center; }
.ch-box h2 { margin: 6px 0 0; }
.ch-box p { margin: 0; color: var(--muted); }
.ch-bar { width: 100%; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); overflow: hidden; margin-top: 8px; }
.ch-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--bad)); transform-origin: left; animation: ch-count linear forwards; }
@keyframes ch-count { from { transform: scaleX(1); } to { transform: scaleX(0); } }

@media (max-width: 900px) {
  .fd-arena { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .fd-arena .fd-ph { flex-wrap: wrap; gap: 8px; }
  .watch-grid { grid-template-columns: 1fr; }
  .on-row { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; }
  .on-challenge { padding: 8px 11px; font-size: 13px; }
}

/* ---------- pro pitch: stadium grass, full markings, team-tinted halves, glass slots ---------- */
:root { --pitch-a: #2c8f3f; --pitch-b: #247c35; --chalk: rgba(255, 255, 255, 0.82); }
.pitch {
  background:
    radial-gradient(60% 45% at 50% 50%, rgba(255, 255, 230, 0.12), rgba(255, 255, 230, 0) 70%),
    radial-gradient(120% 90% at 50% 50%, rgba(0, 0, 0, 0) 55%, rgba(0, 12, 4, 0.42) 100%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 calc(var(--slot-w) * 0.75), rgba(0, 0, 0, 0.035) calc(var(--slot-w) * 0.75) calc(var(--slot-w) * 1.5)),
    repeating-linear-gradient(0deg, var(--pitch-a) 0 calc(var(--ch) * 0.5), var(--pitch-b) calc(var(--ch) * 0.5) calc(var(--ch) * 1));
  box-shadow: 0 0 0 3px #134a22, 0 0 0 9px #0c2515, 0 0 0 10px rgba(120, 255, 170, 0.12), 0 26px 70px rgba(0, 0, 0, 0.55), inset 0 0 90px rgba(0, 0, 0, 0.32);
}
/* fine grass texture (a static SVG noise tile) instead of the old touchline pseudo */
.pitch::before {
  inset: 0; border: 0; border-radius: inherit; opacity: 0.22; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.9 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
.pitch::after, .half::before { content: none; }
.midline::before { border-top: 2px solid var(--chalk); box-shadow: 0 0 6px rgba(255, 255, 255, 0.35); }

.pitch-marks { position: absolute; inset: 9px; pointer-events: none; z-index: 0; }
.pitch-marks i { position: absolute; display: block; }
.pitch-marks i:not(.pm-tint):not(.pm-spot) { border: 2px solid var(--chalk); box-shadow: 0 0 5px rgba(255, 255, 255, 0.28), inset 0 0 5px rgba(255, 255, 255, 0.12); }
.pm-tint { left: 0; right: 0; height: 50%; }
.pm-tint.t { top: 0; background: linear-gradient(180deg, rgba(255, 93, 108, 0.13), rgba(255, 93, 108, 0) 85%); }
.pm-tint.b { bottom: 0; background: linear-gradient(0deg, rgba(57, 192, 255, 0.13), rgba(57, 192, 255, 0) 85%); }
.pm-touch { inset: 0; border-radius: 4px; }
.pm-circle { left: 50%; top: 50%; width: calc(var(--ch) * 1.3); aspect-ratio: 1; border-radius: 50%; transform: translate(-50%, -50%); }
/* the game's crest painted in the centre circle (both modes, 2026-11-20) */
.pm-circle::before { content: ""; position: absolute; inset: 7%; border-radius: 50%; opacity: 0.9;
  background: url(assets/logo/football-duel-crest-round.webp) center / contain no-repeat; filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.35)); }
.pm-spot { width: 8px; height: 8px; border-radius: 50%; background: var(--chalk); box-shadow: 0 0 6px rgba(255, 255, 255, 0.6); transform: translate(-50%, -50%); left: 50%; }
.pm-spot.c { top: 50%; }
.pm-spot.t { top: 12%; }
.pm-spot.b { top: 88%; }
.pm-box { left: 21%; width: 58%; height: 18%; }
.pm-box.t { top: -2px; border-top: 0 !important; }
.pm-box.b { bottom: -2px; border-bottom: 0 !important; }
.pm-six { left: 36%; width: 28%; height: 7%; }
.pm-six.t { top: -2px; border-top: 0 !important; }
.pm-six.b { bottom: -2px; border-bottom: 0 !important; }
.pm-d { left: 33%; width: 34%; height: 34%; }
.pm-box.t .pm-d { top: 100%; border-top: 0 !important; border-radius: 0 0 50% 50% / 0 0 100% 100%; }
.pm-box.b .pm-d { bottom: 100%; border-bottom: 0 !important; border-radius: 50% 50% 0 0 / 100% 100% 0 0; }
.pm-corner { width: 16px; height: 16px; }
.pm-corner.tl { left: -2px; top: -2px; border-left: 0 !important; border-top: 0 !important; border-radius: 0 0 100% 0; }
.pm-corner.tr { right: -2px; top: -2px; border-right: 0 !important; border-top: 0 !important; border-radius: 0 0 0 100%; }
.pm-corner.bl { left: -2px; bottom: -2px; border-left: 0 !important; border-bottom: 0 !important; border-radius: 0 100% 0 0; }
.pm-corner.br { right: -2px; bottom: -2px; border-right: 0 !important; border-bottom: 0 !important; border-radius: 100% 0 0 0; }
.pitch .half, .pitch .midline { z-index: 1; }

/* glass card slots, tinted to each side */
.slot {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.025));
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 -12px 22px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.12);
}
#opp-field .slot { border-color: rgba(255, 120, 130, 0.42); background: linear-gradient(180deg, rgba(255, 93, 108, 0.12), rgba(255, 255, 255, 0.02)); }
#you-field .slot { border-color: rgba(110, 205, 255, 0.45); background: linear-gradient(180deg, rgba(57, 192, 255, 0.12), rgba(255, 255, 255, 0.02)); }
.slot.spell-slot { background: linear-gradient(180deg, rgba(8, 16, 34, 0.32), rgba(8, 16, 34, 0.18)); border-color: rgba(255, 255, 255, 0.14); }
.slot.pile { background: linear-gradient(180deg, rgba(8, 16, 34, 0.55), rgba(8, 16, 34, 0.35)); border-color: rgba(255, 255, 255, 0.22); }
/* small phones: room for the 🔊 menu in both top bars */
@media (max-width: 430px) {
  .topbar #btn-fullscreen { display: none; }
  .fd-brand em { display: none; }
  .fd-top { gap: 8px; padding: 8px 10px; }
  .home .acc-chip { max-width: 40vw; }
}
@media (max-width: 370px) {
  .topbar .logo { font-size: 0; gap: 0; }
  .topbar .logo .logo-mark { width: 28px; height: 28px; }
  .top-actions .btn { padding: 5px 6px; }
  .fd-brand b, .fd-brand i { font-size: 15px; }
  .fd-brand .fd-mark { width: 30px; height: 30px; }
  .home .acc-chip { max-width: 36vw; }
}

/* Sound settings panel (phone and desktop): on/off + volume per channel */
.sound-menu { display: inline-flex; }
.topbar > .top-actions > .sound-toggle, .fd-top-actions > .sound-toggle { display: none !important; }
.sound-pop { min-width: 270px; padding: 12px; gap: 2px; }
.sp-title { font: 900 12px system-ui; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); padding: 2px 12px 6px; }
.sp-vol { display: grid; grid-template-columns: 1fr 44px; align-items: center; gap: 10px; padding: 0 12px 10px; }
.sp-vol + .sp-row { border-top: 1px solid rgba(255, 255, 255, 0.08); margin-top: 4px; padding-top: 14px; }
.sp-vol output { font: 800 13px system-ui; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.sp-vol.off { opacity: 0.45; }
.sp-vol .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.sp-vol input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; cursor: pointer; --fill: 80%; }
.sp-vol input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--good) var(--fill), rgba(255, 255, 255, 0.16) var(--fill)); }
.sp-vol input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.16); }
.sp-vol input[type="range"]::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--good); }
.sp-vol input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45), 0 0 0 4px rgba(70, 224, 138, 0.25); }
.sp-vol input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45); }
.sp-vol input[type="range"]:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
@media (max-width: 760px) { .sound-pop { min-width: 250px; } }
@media (max-width: 760px) {
  .sound-pop { position: fixed; left: 12px; right: 12px; top: 60px; min-width: 0; z-index: 80; }
}
.topbar .sound-pop .sound-toggle { display: flex !important; }

/* Legends with illustrated artwork: the era sits in a thin band at the bottom, off the picture's hero */
.c-art:has(.art-img) .c-era { bottom: 0; font-size: calc(var(--cw) * 0.06); padding: 3px 0 2px; background: linear-gradient(90deg, rgba(240, 244, 255, 0.55), rgba(240, 244, 255, 0.95) 20%, rgba(240, 244, 255, 0.95) 80%, rgba(240, 244, 255, 0.55)); }

/* ---------- The Legends gallery (home) ---------- */
.fd-legends { position: relative; margin: 28px 0; padding: 22px 0 18px; border-radius: 24px; overflow: hidden;
  background: radial-gradient(900px 340px at 15% 0%, rgba(124, 92, 255, 0.28), transparent 70%), radial-gradient(700px 300px at 90% 100%, rgba(245, 197, 66, 0.18), transparent 70%), linear-gradient(180deg, #0c0f26, #090b1c);
  border: 1px solid rgba(255, 255, 255, 0.12); box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45); }
.fd-leg-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding: 0 22px; }
.fd-leg-head h2 { margin: 6px 0 4px; font-size: clamp(28px, 4.4vw, 44px); line-height: 1; letter-spacing: -0.01em;
  background: linear-gradient(90deg, #fff, #dfe6ff 40%, #f5c542 75%, #fff2c4); -webkit-background-clip: text; background-clip: text; color: transparent; }
.fd-leg-sub { margin: 0; color: var(--muted); max-width: 560px; font-size: 14px; }
.fd-leg-nav { display: flex; gap: 8px; flex: none; }
.fd-leg-row { display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 22px 22px 10px; scrollbar-width: none; --leg-cw: clamp(132px, 15vw, 180px); overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.fd-nc-strip, .fd-totw-row, .deck-pick { overscroll-behavior-x: contain; }
.fd-leg-row::-webkit-scrollbar { display: none; }
.fd-leg-row:focus-visible { outline: 2px solid var(--gold); outline-offset: -4px; }
.fd-leg-item { margin: 0; flex: none; scroll-snap-align: start; display: grid; justify-items: center; gap: 8px; width: calc(var(--leg-cw) * 1.05); }
.fd-leg-row .card.big { --cw: var(--leg-cw); }
.fd-leg-item .card { cursor: default; transition: transform 0.25s, filter 0.25s; filter: drop-shadow(0 16px 22px rgba(0, 0, 0, 0.55)); }
.fd-leg-item:hover .card { transform: translateY(-8px) rotate(-1.5deg) scale(1.03); filter: drop-shadow(0 22px 30px rgba(124, 92, 255, 0.45)); }
.fd-leg-item figcaption { display: grid; text-align: center; line-height: 1.25; }
.fd-leg-item figcaption b { font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: calc(var(--leg-cw) * 1.05); }
.fd-leg-item figcaption span { font-size: 11px; color: var(--muted); }
.fd-leg-cta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; padding: 8px 22px 0; }
@media (max-width: 640px) {
  .fd-legends { border-radius: 18px; margin: 20px 0; padding-top: 18px; }
  .fd-leg-head { padding: 0 16px; }
  .fd-leg-nav { display: none; }
  .fd-leg-row { padding: 18px 16px 8px; gap: 12px; --leg-cw: 128px; scroll-snap-type: x proximity; }
}
/* Touch screens: no hover lift on the Legends (a tap or swipe would leave a card stuck mid-animation). */
@media (hover: none) {
  .fd-leg-item .card { transition: none; }
  .fd-leg-item:hover .card { transform: none; filter: drop-shadow(0 16px 22px rgba(0, 0, 0, 0.55)); }
}
@media (prefers-reduced-motion: reduce) { .fd-leg-item .card { transition: none; } }

/* Home: a labelled ⚙️ Settings button (music + sound) that stays visible on every screen size */
.fd-top-actions .settings-btn { display: inline-flex !important; align-items: center; gap: 7px; border-radius: 999px; padding: 8px 14px; font: 800 14px system-ui;
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.14); color: var(--ink); }
.fd-top-actions .settings-btn i { font-style: normal; font-size: 16px; line-height: 1; }
.fd-top-actions .settings-btn[aria-expanded="true"] { border-color: var(--gold); }
@media (max-width: 760px) { .fd-top-actions .sound-pop { position: fixed; right: 12px; left: 12px; top: 64px; min-width: 0; } }
@media (max-width: 420px) { .fd-top-actions .settings-btn span { display: none; } .fd-top-actions .settings-btn { padding: 8px 10px; } }

/* ---------- rock · paper · scissors (who kicks off) ---------- */
.rps-modal { text-align: center; max-width: 480px; }
.rps-box h2 { margin: 4px 0 6px; }
.rps-eyebrow { display: inline-block; font: 900 12px system-ui; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
.rps-art { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 12px; user-select: none; -webkit-user-drag: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 6px 16px rgba(0, 0, 0, 0.45); }
.rps-picks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0 12px; }
.rps-btn { display: grid; justify-items: center; gap: 7px; padding: 7px 7px 9px; border-radius: 16px; cursor: pointer; color: var(--ink);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)); border: 1px solid rgba(255, 255, 255, 0.16);
  font: 900 13px system-ui; letter-spacing: 0.04em; text-transform: uppercase; transition: transform 0.14s, border-color 0.14s, box-shadow 0.14s; }
.rps-btn:hover, .rps-btn:focus-visible { transform: translateY(-4px) rotate(-1deg); border-color: var(--gold); outline: none;
  box-shadow: 0 0 0 2px rgba(255, 194, 58, 0.35), 0 12px 26px rgba(0, 0, 0, 0.45); }
.rps-btn:active { transform: translateY(-1px) scale(0.97); }
.rps-wait { width: 120px; margin: 4px auto 10px; }
.rps-wait .rps-art { animation: rps-shake 0.9s ease-in-out infinite; }

/* The Special Referee: a round medallion floating in 3D, with a floor shadow; he turns to point at the winner */
.rps-ref { --s: 92px; position: relative; width: var(--s); height: calc(var(--s) + 16px); margin: 0 auto; perspective: 520px; flex: none; }
.rps-ref-body { position: relative; width: var(--s); height: var(--s); border-radius: 50%; transform-style: preserve-3d;
  animation: rps-ref-idle 3.2s ease-in-out infinite; }
.rps-ref-body img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block;
  border: 3px solid var(--gold); box-shadow: 0 0 0 4px rgba(10, 18, 40, 0.9), 0 0 22px rgba(255, 194, 58, 0.45), 0 14px 22px rgba(0, 0, 0, 0.55); }
.rps-ref-shine { position: absolute; inset: 3px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.45), transparent 42%), radial-gradient(circle at 70% 85%, rgba(0, 0, 0, 0.35), transparent 55%); }
.rps-ref-floor { position: absolute; left: 18%; right: 18%; bottom: 0; height: 9px; border-radius: 50%; background: rgba(0, 0, 0, 0.55); filter: blur(3px);
  animation: rps-ref-floor 3.2s ease-in-out infinite; }
.rps-ref.left .rps-ref-body { animation: rps-ref-call 1s cubic-bezier(.2, 1.4, .4, 1) both; --turn: 32deg; --slide: -10px; }
.rps-ref.right .rps-ref-body { animation: rps-ref-call 1s cubic-bezier(.2, 1.4, .4, 1) both; --turn: -32deg; --slide: 10px; }
.rps-ref.draw .rps-ref-body { animation: rps-ref-shrug 0.9s ease-in-out both; }
.rps-say { margin: 8px auto 0; max-width: 340px; font: 700 14px/1.35 system-ui; color: var(--ink); padding: 8px 12px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.12); }
.rps-ref + .rps-say { position: relative; margin-top: 10px; }
.rps-ref + .rps-say::before { content: ''; position: absolute; top: -7px; left: 50%; margin-left: -7px; border: 7px solid transparent; border-top: 0;
  border-bottom-color: rgba(255, 255, 255, 0.14); }
@keyframes rps-ref-idle { 0%, 100% { transform: translateY(0) rotateY(-14deg) rotateX(4deg); } 50% { transform: translateY(-7px) rotateY(14deg) rotateX(-3deg); } }
@keyframes rps-ref-floor { 0%, 100% { transform: scaleX(1); opacity: 0.6; } 50% { transform: scaleX(0.78); opacity: 0.38; } }
@keyframes rps-ref-call { 0% { transform: scale(0.6) rotateY(0); } 45% { transform: scale(1.12) translateY(-10px) rotateY(0); }
  100% { transform: scale(1.05) translateX(var(--slide)) rotateY(var(--turn)) rotateZ(calc(var(--turn) / -6)); } }
@keyframes rps-ref-shrug { 0%, 100% { transform: rotateY(0); } 25% { transform: rotateY(-25deg) rotateZ(4deg); } 75% { transform: rotateY(25deg) rotateZ(-4deg); } }

.rps-vs { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 10px 0 6px; }
.rps-side { display: grid; justify-items: center; gap: 6px; font: 800 14px system-ui; width: 116px; max-width: 34%; transition: opacity 0.4s, filter 0.4s; }
.rps-side span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.rps-side .rps-art { animation: rps-shake 0.5s ease-out; }
.rps-side.win .rps-art { border-radius: 12px; box-shadow: 0 0 0 3px var(--gold), 0 0 26px rgba(255, 194, 58, 0.55); animation: rps-shake 0.5s ease-out, rps-win 0.6s 0.9s ease-out both; }
.rps-side.lose { opacity: 0.55; filter: grayscale(0.7); transition-delay: 0.9s; }
.rps-vs .rps-ref { --s: 112px; }
@keyframes rps-shake { 0%, 60%, 100% { transform: translateY(0) rotate(0); } 20% { transform: translateY(-14px) rotate(-8deg); } 40% { transform: translateY(0) rotate(6deg); } }
@keyframes rps-win { 0% { transform: scale(1); } 50% { transform: scale(1.1); } 100% { transform: scale(1.04); } }
@media (max-width: 420px) {
  .rps-vs { gap: 6px; }
  .rps-vs .rps-ref { --s: 78px; }
  .rps-ref { --s: 76px; }
}
@media (prefers-reduced-motion: reduce) {
  .rps-side .rps-art, .rps-wait .rps-art, .rps-ref-body, .rps-ref-floor { animation: none !important; }
  .rps-ref.left .rps-ref-body { transform: rotateY(20deg); }
  .rps-ref.right .rps-ref-body { transform: rotateY(-20deg); }
}

/* your own deck pile is a button: tap it to surrender */
.slot.pile.own-deck { cursor: pointer; font: inherit; color: inherit; }
.slot.pile.own-deck:hover .pile-label::after, .slot.pile.own-deck:focus-visible .pile-label::after { content: " · 🏳️"; }
.room-watch { margin: 2px 0 10px; }
.room-watch input { accent-color: var(--fd-green, #2ee59d); width: 16px; height: 16px; }
.wl-friends { font: 800 11px system-ui; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); }

/* ---------- phones: lighter home page ---------- */
@media (max-width: 760px), (pointer: coarse) {
  /* no looping shine / float effects on the home cards and decorations (they ran 60+ at once) */
  #home .card, #home .card *, #home [class*="fd-float"], #home .fd-fan-glow { animation: none !important; }
  /* drop shadows and frosted glass cost a lot on phones: flat versions instead */
  #home .fd-leg-item .card, #home .fd-totw-item .card, #home .fd-fan .card { filter: none !important; }
  #home *, .topbar, .topbar * { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
}
/* nav links (#fd-board…) land below the sticky top bar + section tabs, not under them */
html, #home { scroll-padding-top: 100px; }

/* ---------- Stadium skins: a face-up Stadium dresses its owner's half (see renderStadiums in ui.js) ---------- */
.st-skin { position: absolute; left: 0; right: 0; height: 50%; z-index: 0; pointer-events: none; overflow: hidden; opacity: 0; transition: opacity 0.5s; }
.st-skin.t { top: 0; border-radius: 14px 14px 0 0; }
.st-skin.b { bottom: 0; border-radius: 0 0 14px 14px; }
.st-skin.on { opacity: 1; }
.st-skin > * { position: absolute; inset: 0; }
/* mowing patterns */
.st-mow { --l: rgba(255, 255, 255, 0.075); --d: rgba(0, 0, 0, 0.085); }
.st-mow[data-mow="stripes"] { background: repeating-linear-gradient(0deg, var(--l) 0 22px, var(--d) 22px 44px); }
.st-mow[data-mow="wide"] { background: repeating-linear-gradient(0deg, var(--l) 0 40px, var(--d) 40px 80px); }
.st-mow[data-mow="columns"] { background: repeating-linear-gradient(90deg, var(--l) 0 26px, var(--d) 26px 52px); }
.st-mow[data-mow="diagonal"] { background: repeating-linear-gradient(45deg, var(--l) 0 20px, var(--d) 20px 40px); }
.st-mow[data-mow="snow"] { /* Snow Stadium: a snow-covered half, flakes drifting down */
  background: radial-gradient(ellipse at 50% 50%, rgba(255, 255, 255, 0.5), rgba(220, 238, 255, 0.72) 75%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.14) 0 40px, rgba(170, 205, 240, 0.14) 40px 80px); }
.st-mow[data-mow="snow"]::after { content: ''; position: absolute; inset: 0; opacity: 0.9;
  background-image: radial-gradient(2px 2px at 12% 20%, #fff 50%, transparent), radial-gradient(2.5px 2.5px at 38% 60%, #fff 50%, transparent),
    radial-gradient(1.5px 1.5px at 66% 30%, #fff 50%, transparent), radial-gradient(2px 2px at 84% 75%, #fff 50%, transparent),
    radial-gradient(1.5px 1.5px at 52% 88%, #fff 50%, transparent);
  background-size: 140px 120px; animation: st-snow 7s linear infinite; }
@keyframes st-snow { from { background-position: 0 0; } to { background-position: 30px 120px; } }
@media (prefers-reduced-motion: reduce) { .st-mow[data-mow="snow"]::after { animation: none; } }
.st-mow[data-mow="checker"] { background: conic-gradient(var(--l) 25%, var(--d) 0 50%, var(--l) 0 75%, var(--d) 0) 0 0 / 46px 46px; }
.st-skin.t .st-mow[data-mow="rings"] { background: repeating-radial-gradient(circle at 50% 100%, var(--l) 0 22px, var(--d) 22px 44px); }
.st-skin.b .st-mow[data-mow="rings"] { background: repeating-radial-gradient(circle at 50% 0%, var(--l) 0 22px, var(--d) 22px 44px); }
/* club colour wash, strongest at the home end */
.st-skin.t .st-tint { background: linear-gradient(180deg, color-mix(in srgb, var(--st1) 46%, transparent), color-mix(in srgb, var(--st1) 10%, transparent) 92%); }
.st-skin.b .st-tint { background: linear-gradient(0deg, color-mix(in srgb, var(--st1) 46%, transparent), color-mix(in srgb, var(--st1) 10%, transparent) 92%); }
.pitch:has(#st-skin-opp.on) .pm-tint.t, .pitch:has(#st-skin-you.on) .pm-tint.b { opacity: 0; }
/* the home fans: a ring of club-coloured scarves along the home touchline */
.st-crowd {
  inset: auto 0; height: 9px;
  background:
    radial-gradient(circle, var(--st1) 1.3px, transparent 1.8px) 0 0 / 6px 4.5px,
    radial-gradient(circle, var(--st2) 1.3px, transparent 1.8px) 3px 2.25px / 6px 4.5px,
    #0a1a0f;
}
.st-skin.t .st-crowd { top: 0; }
.st-skin.b .st-crowd { bottom: 0; }
/* crest + name painted on the grass (tilted flat, like the real thing) */
.st-paint { display: grid; place-items: center; align-content: center; gap: 0; perspective: 600px; }
.st-crest { width: min(26%, calc(var(--ch) * 1.25)); height: auto; transform: rotateX(48deg); opacity: 0.5; }
.st-name { margin-top: -4%; font: 900 italic clamp(10px, 2.6vw, 20px)/1 system-ui, sans-serif; letter-spacing: 0.24em; color: #fff; opacity: 0.36; transform: rotateX(48deg); white-space: nowrap; }
/* the intro banner */
.st-banner {
  position: absolute; left: -4%; right: -4%; z-index: 7; pointer-events: none; display: grid; justify-items: center; gap: 2px; padding: 8px 0 10px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--st1) 88%, #000) 18%, color-mix(in srgb, var(--st1) 88%, #000) 82%, transparent);
  border-block: 2px solid var(--st2); transform: skewX(-12deg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); animation: st-banner-in 0.5s cubic-bezier(.2,.8,.2,1) 0.45s backwards;
}
.st-banner.t { top: 22%; }
.st-banner.b { bottom: 22%; }
.st-banner b { font: 900 italic clamp(20px, 5vw, 34px)/1 system-ui, sans-serif; text-transform: uppercase; color: #fff; text-shadow: 0 3px 0 rgba(0, 0, 0, 0.45); letter-spacing: 0.02em; }
.st-banner small { font: 800 11px system-ui; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255, 255, 255, 0.85); }
@keyframes st-banner-in { from { transform: translateX(-60%) skewX(-12deg); opacity: 0; } }

/* ---------- The Lady Card: her chain to the player she controls (placeChains in ui.js) ---------- */
.lady-chains { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; overflow: visible; }
.lc { filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.55)); animation: lc-glow 2.4s ease-in-out infinite; }
.lc-link ellipse, .lc-link rect { fill: none; stroke: url(#lc-metal); stroke-width: 2.4; }
.lc-link rect { fill: url(#lc-metal); stroke: #5b616c; stroke-width: 0.8; }
.lc-shackle { fill: none; stroke: url(#lc-metal); stroke-width: 2.6; }
.lc-body { fill: url(#lc-gold); stroke: #6b4508; stroke-width: 0.8; }
.lc-hole { fill: #3a2405; }
@keyframes lc-glow { 0%, 100% { filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 0 rgba(255, 80, 150, 0)); } 50% { filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 5px rgba(255, 80, 150, 0.85)); } }
.lc-in .lc-link, .lc-in .lc-lock { opacity: 0; animation: lc-link-in 0.22s ease-out forwards; }
.lc-in .lc-lock { animation-name: lc-lock-in; animation-duration: 0.35s; }
@keyframes lc-link-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes lc-lock-in { 0% { opacity: 0; scale: 2.2; } 70% { opacity: 1; scale: 0.9; } 100% { opacity: 1; scale: 1; } }
.lc-lock { transform-box: fill-box; transform-origin: center; }
@media (prefers-reduced-motion: reduce) { .lc { animation: none; } }

/* ---------- Nationality cards: little flags on poles between the cards of that half (placeFlags in ui.js) ---------- */
.nt-flags { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.nt-flag { position: absolute; width: clamp(12px, calc(var(--cw) * 0.3), 22px); aspect-ratio: 3 / 2; transform: translateY(-190%); transform-origin: 0 190%; }
.nt-flag::before { /* the pole, planted on the line */
  content: ""; position: absolute; left: 0; top: 0; width: 1.5px; height: 190%; background: linear-gradient(#fff, #c9c9c9); border-radius: 1px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.nt-svg { position: absolute; left: 1.5px; top: 0; width: 100%; height: 100%; display: block; border-radius: 1px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.45); transform-origin: left center; animation: nt-wave 2.6s ease-in-out infinite; animation-delay: calc(var(--i) * -0.33s); }
@keyframes nt-wave { 0%, 100% { transform: skewY(0deg) scaleX(1); } 50% { transform: skewY(-6deg) scaleX(0.9); } }
.nt-banner-flag { width: 16px; height: 11px; vertical-align: -1px; border-radius: 1px; }
@media (prefers-reduced-motion: reduce) { .nt-svg { animation: none; } }
/* official crests painted on the grass: a soft white halo keeps dark crests (Juventus, Tottenham) readable */
.st-logos { display: flex; justify-content: center; gap: 6%; aspect-ratio: 1; opacity: 0.75; }
.st-logos.two { width: min(44%, calc(var(--ch) * 2.2)); aspect-ratio: 2.1; }
.st-logos img { height: 100%; width: auto; max-width: 100%; object-fit: contain; filter: drop-shadow(0 0 1.5px rgba(255, 255, 255, 0.9)) drop-shadow(0 0 6px rgba(255, 255, 255, 0.45)); }

/* the game's crest on the home hero (dark edges melt into the hero) */
.fd-logo-crest {
  width: clamp(150px, 17vw, 220px); height: auto; justify-self: start; margin: -10px 0 -14px -10px;
  -webkit-mask-image: radial-gradient(ellipse 54% 54% at 50% 50%, #000 80%, transparent 100%); mask-image: radial-gradient(ellipse 54% 54% at 50% 50%, #000 80%, transparent 100%);
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.45));
}
@media (max-width: 760px) { .fd-logo-crest { width: 170px; justify-self: center; margin: -10px auto -14px; } }
/* the crest sits beside the season pill and the news, so the Play buttons are on the first screen (1280×720 too) */
.fd-hero-head { display: grid; gap: 16px; min-width: 0; }
@media (min-width: 761px) {
  .fd-hero-head { grid-template-columns: auto minmax(0, 1fr); gap: 10px 18px; align-items: center; }
  .fd-hero-head .fd-logo-crest { grid-row: span 2; width: clamp(96px, 9vw, 124px); margin: -8px 0 -8px -8px; }
  .fd-hero-head .fd-eyebrow { align-self: end; }
  .fd-hero-head .fd-news { align-self: start; }
}
@media (min-width: 1021px) and (max-height: 820px) {
  .fd-hero { padding-block: 24px; }
  .home .home-title { font-size: clamp(40px, 4.6vw, 64px); }
}
.logo-mark, .fd-mark { border-radius: 50%; }

/* ---------- Man of the Match cards: night-blue + red + gold holo frame (special editions after a big match) ---------- */
.card.motm {
  --frame: linear-gradient(125deg, #ffd66b 0%, #0b1f4d 16%, #1d3d8f 32%, #c8102e 46%, #ffd66b 54%, #1d3d8f 68%, #0b1f4d 84%, #ffd66b 100%);
}
.card.motm .face.front { background-size: 260% 260%; animation: legendsheen 6s linear infinite; position: absolute; color: #fff; }
.card.motm .face.front::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: var(--radius);
  background: linear-gradient(115deg, transparent 30%, rgba(255, 230, 160, 0.5) 45%, rgba(255, 255, 255, 0.3) 50%, transparent 62%);
  background-size: 250% 100%; animation: holo 3.6s ease-in-out infinite; mix-blend-mode: overlay;
}
.card.motm .rot { box-shadow: 0 0 calc(var(--cw) * 0.14) rgba(255, 200, 90, 0.75); }
.card.motm .c-head, .card.motm .c-stars { color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }
.c-tag.motm { background: linear-gradient(90deg, #c8102e, #ffb703); color: #fff; }
.card.motm .c-art { position: relative; }
.b-grid .card.motm .face.front { animation: none; }
.b-grid .card.motm .face.front::after { display: none; }
@media (prefers-reduced-motion: reduce) { .card.motm .face.front, .card.motm .face.front::after { animation: none; } }
.card.motm .c-stats { color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7); background: linear-gradient(90deg, rgba(11, 31, 77, 0.9), rgba(200, 16, 46, 0.85)); border-radius: calc(var(--cw) * 0.04); }
.card.motm .c-stats .up { color: #7dffb0; } .card.motm .c-stats .down { color: #ffb3bb; }
.card.motm .c-art .c-era, .card.motm .c-art:has(.art-img) .c-era { color: #fff; white-space: nowrap; bottom: 0; background: linear-gradient(90deg, #0b1f4d, #1d3d8f 50%, #c8102e); }

/* ---------- reward cards: locked in the deck builder ---------- */
.b-cell.locked .b-pick .card { filter: grayscale(0.85) brightness(0.55); }
.b-cell.locked .b-pick::after {
  content: "🔒 WIN IT"; position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 4; pointer-events: none;
  font: 900 12px/1 system-ui; letter-spacing: 0.06em; color: #1a1300; background: var(--gold); padding: 6px 9px; border-radius: 999px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5); white-space: nowrap;
}
.b-cell.locked .b-pick { position: relative; cursor: help; }
.b-cell.locked .b-n { opacity: 0.5; }
.b-tag.locked { background: rgba(255, 210, 90, 0.16); color: var(--gold); }

/* ---------- prize pick after a 3-win streak ---------- */
.prize-back { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: radial-gradient(900px 700px at 50% 40%, rgba(70, 40, 140, 0.92), rgba(6, 8, 20, 0.96)); opacity: 0; transition: opacity 0.3s; }
.prize-back.in { opacity: 1; }
.prize { width: min(680px, 100%); text-align: center; display: grid; gap: 10px; justify-items: center; }
.pz-eyebrow { margin: 0; font: 900 13px system-ui; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); }
.prize h2 { margin: 0; font: 900 italic clamp(30px, 7vw, 46px)/1 system-ui; text-transform: uppercase; color: #fff; text-shadow: 0 4px 0 rgba(0, 0, 0, 0.4); }
.pz-sub { margin: 0; max-width: 520px; color: #d9d3f5; font-size: 15px; }
.pz-row { --cw: min(28vw, 170px); position: relative; width: calc(var(--cw) * 3 + 40px); height: calc(var(--cw) * 1.45); margin: 14px 0 4px; }
.pz-slot { position: absolute; left: 0; top: 0; padding: 0; border: 0; background: none; cursor: default; transform: translateX(calc(var(--x) * (var(--cw) + 20px))); transition: transform 0.42s cubic-bezier(.5, 0, .3, 1); }
.prize-back.fast .pz-slot { transition-duration: 0.26s; }
.pz-slot .card { --cw: min(28vw, 170px); cursor: inherit; }
/* a Boss prize: 4 cards on the table */
.prize-back.n4 .pz-row { --cw: min(calc((100vw - 100px) / 4), 150px); width: calc(var(--cw) * 4 + 60px); }
.prize-back.n4 .pz-slot .card { --cw: min(calc((100vw - 100px) / 4), 150px); }
.pz-slot .card .flipper { transition: transform 0.5s cubic-bezier(.3, .7, .2, 1); }
.pz-slot:not(:disabled) { cursor: pointer; }
.pz-slot:not(:disabled):hover .card, .pz-slot:not(:disabled):focus-visible .card { transform: translateY(-10px); transition: transform 0.15s; }
.pz-slot:not(:disabled) .card .rot { box-shadow: 0 0 0 3px rgba(255, 210, 90, 0.7), 0 0 26px rgba(255, 200, 80, 0.5); }
.pz-slot.is-new .card .rot { box-shadow: 0 0 0 4px var(--gold), 0 0 40px rgba(255, 200, 80, 0.85); }
.pz-slot.picked .card { transform: translateY(-14px) scale(1.06); }
.prize-back.won .pz-slot.picked .card .rot { box-shadow: 0 0 0 5px var(--gold), 0 0 60px rgba(255, 200, 80, 0.95); }
.prize-back.lost .pz-slot.has-new .card .rot { box-shadow: 0 0 0 4px var(--gold), 0 0 30px rgba(255, 200, 80, 0.7); }
.prize-back.lost .pz-slot:not(.has-new) .card { filter: brightness(0.6); }
.pz-slot .new-chip { display: none; }
.pz-status { min-height: 24px; margin: 4px 0 0; font: 800 16px system-ui; color: #fff; }
.pz-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.pz-actions[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .pz-slot, .pz-slot .card .flipper { transition-duration: 0.01s; } }

/* ---------- home: the newest reward card ---------- */
.fd-newcard { display: grid; grid-template-columns: auto 1fr; gap: 26px; align-items: center; padding: 22px 26px; border-radius: 26px; background: linear-gradient(120deg, rgba(255, 194, 58, 0.16), rgba(28, 10, 52, 0.85) 45%), var(--fd-panel, #1c0a34); border: 1px solid rgba(255, 210, 90, 0.35); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35); }
.fd-newcard[hidden] { display: none; }
.fd-nc-card { position: relative; --cw: 150px; }
.fd-nc-card .new-chip { display: none; }
.fd-nc-lock { position: absolute; right: -10px; top: -10px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; background: var(--gold, #ffc23a); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45); }
.fd-nc-text { display: grid; gap: 8px; justify-items: start; }
.fd-nc-text h2 { margin: 0; font: 900 italic clamp(30px, 4vw, 44px)/1 system-ui, sans-serif; text-transform: uppercase; color: #fff; }
.fd-nc-fx { margin: 0; color: #ffe3a1; font-weight: 700; max-width: 560px; }
.fd-nc-how { margin: 0; color: #cdbfee; max-width: 560px; font-size: 14px; }
.fd-nc-sign { margin: 0; color: #cdbfee; font-size: 13px; }
.fd-nc-streak { display: flex; align-items: center; gap: 10px; font: 800 13px system-ui; color: #fff; background: rgba(0, 0, 0, 0.3); border-radius: 999px; padding: 6px 12px; }
.fd-nc-streak .dots { display: flex; gap: 6px; }
.fd-nc-streak .dots i { width: 14px; height: 14px; border-radius: 50%; background: rgba(255, 255, 255, 0.18); }
.fd-nc-streak .dots i.on { background: var(--gold, #ffc23a); box-shadow: 0 0 10px rgba(255, 200, 80, 0.8); }
.fd-nc-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
@media (max-width: 760px) {
  .fd-newcard { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 18px 16px; gap: 14px; border-radius: 20px; }
  .fd-nc-card { --cw: 130px; }
  .fd-nc-text { justify-items: center; }
}

/* ---------- reward cards: deep violet + gold holo frame ---------- */
.card.reward { --frame: linear-gradient(125deg, #ffe28a 0%, #7b2ff7 18%, #2a0b5e 36%, #ffcf4d 50%, #2a0b5e 64%, #9a4dff 82%, #ffe28a 100%); }
.card.reward .face.front { background-size: 260% 260%; animation: legendsheen 6s linear infinite; position: absolute; color: #fff; }
.card.reward .rot { box-shadow: 0 0 calc(var(--cw) * 0.16) rgba(255, 200, 90, 0.75); }
.card.reward .c-head { color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }
.card.reward .c-type { color: #1a1300; background: linear-gradient(90deg, #ffcf4d, #ffe9a6); font-weight: 900; }
.card.reward .c-art { background: radial-gradient(circle at 50% 45%, #fff7d6, #ffd36b 70%); }
.b-grid .card.reward .face.front { animation: none; }
@media (prefers-reduced-motion: reduce) { .card.reward .face.front { animation: none; } }
.fd-nc-card .card.big { --cw: 150px; }
@media (max-width: 760px) { .fd-nc-card .card.big { --cw: 118px; } }

/* ---------- "new card" pop-up (once per card) ---------- */
.modal.nc-pop-modal { width: min(620px, 100%); }
.wc-pop { display: grid; gap: 10px; }
.wc-pop h2 { margin: 0; }
.wc-cards { display: flex; justify-content: center; gap: 10px; --cw: 104px; padding: 4px 0; }
.wc-cards .new-chip { display: none; }
.wc-steps { margin: 0; padding-left: 22px; display: grid; gap: 6px; line-height: 1.4; }
@media (max-width: 480px) { .wc-cards { --cw: 84px; gap: 6px; } }
.nc-pop { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; }
.nc-pop-card .card.big { --cw: 170px; }
.nc-pop-card .new-chip { display: none; }
.nc-pop-card.two { display: grid; grid-template-columns: auto auto; gap: 10px; } /* a weekly challenge with two rare cards */
.nc-pop-card.two .card.big { --cw: 140px; }
.nc-pop-text { display: grid; gap: 8px; }
.nc-pop-text p { margin: 0; }
.nc-pop-eyebrow { font: 900 12px system-ui; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); }
.nc-pop-text h2 { margin: 0; font: 900 italic 38px/1 system-ui, sans-serif; text-transform: uppercase; }
.nc-pop-fx { color: #ffe3a1; font-weight: 700; }
@media (max-width: 560px) {
  .nc-pop { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 12px; }
  .nc-pop-card .card.big { --cw: 130px; }
  .nc-pop-card.two .card.big { --cw: 110px; }
}
/* veteran gift (more than 200 matches): pick one of the new cards */
.modal.vet-modal { width: min(760px, 100%); }
.vet-pop { display: grid; gap: 10px; }
.vet-pop h2 { margin: 0; font: 900 italic 30px/1.05 system-ui, sans-serif; text-transform: uppercase; }
.vet-pop > p { margin: 0; }
.vet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; --cw: 104px; max-height: 58vh; overflow-y: auto; padding: 4px; }
.vet-card { display: grid; justify-items: center; gap: 6px; padding: 6px 4px; background: none; border: 2px solid transparent; border-radius: 12px; color: inherit; font: 700 12px system-ui; cursor: pointer; }
.vet-card:hover, .vet-card:focus-visible { border-color: var(--gold); background: rgba(255, 215, 0, 0.08); outline: none; }
.vet-card .new-chip { display: none; }
@media (max-width: 480px) { .vet-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); --cw: 76px; gap: 4px; padding: 2px; } .vet-card { padding: 4px 0; font-size: 11px; } .vet-pop h2 { font-size: 22px; } }
.card.reward .c-art { position: relative; } /* keeps the era band ("The King") inside the picture, above the stats */
.card.reward .c-stats { color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7); background: linear-gradient(90deg, #2a0b5e, #7b2ff7); }

/* home "Reward cards" section v2: every reward card, newest first */
.fd-newcard { grid-template-columns: 1fr; gap: 16px; }
.fd-nc-head { display: grid; gap: 8px; justify-items: start; }
.fd-nc-head h2 { margin: 0; font: 900 italic clamp(26px, 3.6vw, 40px)/1 system-ui, sans-serif; text-transform: uppercase; color: #fff; }
.fd-nc-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.fd-nc-item { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; padding: 14px; border-radius: 18px; background: rgba(0, 0, 0, 0.25); border: 1px solid rgba(255, 210, 90, 0.22); }
.fd-nc-item.owned { border-color: rgba(70, 224, 138, 0.45); }
.fd-nc-item .fd-nc-card .card.big { --cw: 120px; }
.fd-nc-badge { position: absolute; right: -8px; top: -8px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 17px; background: var(--gold, #ffc23a); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45); }
.fd-nc-item.owned .fd-nc-badge { background: #46e08a; color: #062a14; font-weight: 900; }
.fd-nc-lock { display: none; }
.fd-nc-text h3 { margin: 0; font: 900 italic 26px/1 system-ui, sans-serif; text-transform: uppercase; color: #fff; }
.fd-nc-new { justify-self: start; font: 900 11px system-ui; letter-spacing: 0.12em; text-transform: uppercase; color: #1a1300; background: var(--gold, #ffc23a); padding: 3px 8px; border-radius: 999px; }
.fd-nc-text .fd-nc-fx { font-size: 13px; }
.fd-nc-state { margin: 0; font: 800 13px system-ui; color: #cdbfee; }
.fd-nc-item.owned .fd-nc-state { color: #7dffb0; }
@media (max-width: 760px) {
  .fd-nc-head { justify-items: center; text-align: center; }
  .fd-nc-list { grid-template-columns: 1fr; }
  .fd-nc-item { grid-template-columns: auto 1fr; text-align: left; }
  .fd-nc-item .fd-nc-card .card.big { --cw: 96px; }
  .fd-nc-text { justify-items: start; }
  .fd-nc-text h3 { font-size: 22px; }
}

/* ---------- Pelé's storm entrance ---------- */
.storm-cine { background: radial-gradient(ellipse at 50% 40%, rgba(16, 18, 34, 0.94), rgba(0, 0, 4, 0.99) 70%); transition: background 0.12s; }
.storm-cine.lit { background: radial-gradient(ellipse at 50% 35%, rgba(120, 140, 200, 0.7), rgba(8, 10, 26, 0.95) 75%); }
.st-clouds { position: absolute; inset: -20% -20% auto; height: 60%; z-index: 1; opacity: 0.9;
  background: radial-gradient(40% 60% at 20% 40%, rgba(70, 76, 100, 0.85), transparent 70%), radial-gradient(45% 55% at 60% 30%, rgba(55, 60, 85, 0.9), transparent 70%), radial-gradient(35% 50% at 90% 45%, rgba(66, 70, 96, 0.85), transparent 70%);
  filter: blur(14px); animation: st-clouds 5s ease-in-out forwards; }
@keyframes st-clouds { from { transform: translateX(-6%) translateY(-12%); opacity: 0; } 30% { opacity: 0.9; } to { transform: translateX(4%) translateY(0); opacity: 0.9; } }
.storm-cine.lit .st-clouds { filter: blur(14px) brightness(2.2); }
.st-rain { position: absolute; inset: -10%; z-index: 2; opacity: 0.4; pointer-events: none;
  background: repeating-linear-gradient(105deg, transparent 0 14px, rgba(190, 210, 255, 0.35) 14px 15px, transparent 15px 34px);
  animation: st-rain 0.45s linear infinite; }
@keyframes st-rain { from { background-position: 0 0; } to { background-position: -40px 120px; } }
.st-bolts { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
.st-bolts path { fill: none; stroke: #f4f7ff; stroke-width: 0.7; stroke-linejoin: bevel; opacity: 0; filter: drop-shadow(0 0 1.5px #9fc0ff) drop-shadow(0 0 4px #7aa2ff); vector-effect: non-scaling-stroke; }
.st-bolts path.on { opacity: 1; stroke-width: 3; }
.st-bolts path.b3.on { stroke: #fff3c4; stroke-width: 5; filter: drop-shadow(0 0 3px #ffd166) drop-shadow(0 0 10px #ffb703); }
.storm-cine .cine-glow { background: radial-gradient(circle, rgba(255, 214, 110, 0.6), rgba(255, 170, 40, 0.18) 40%, transparent 70%); }
.storm-cine .cine-title b { color: #ffd166; text-shadow: 0 0 24px rgba(255, 190, 60, 0.8), 0 4px 0 rgba(0, 0, 0, 0.5); }
@media (prefers-reduced-motion: reduce) { .st-rain, .st-clouds { animation: none; } }
.storm-cine .cine-card { opacity: 0; } /* the King only appears with the last strike */

/* ---------- rarity serial (illustrated cards) ---------- */
.c-art:has(.c-serial) { position: relative; }
.c-serial {
  position: absolute; bottom: 2.5%; right: 2.5%; z-index: 2; pointer-events: none; opacity: 0.85; /* a small tag in the corner, so it never covers the face */
  font: 800 calc(var(--cw) * 0.036)/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0.03em;
  padding: 0.2em 0.4em 0.15em; border-radius: 0.45em; white-space: nowrap;
  color: #fff; background: rgba(10, 14, 28, 0.78); border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.c-serial.lgd { color: #e9eefc; border-color: #b9c6ee; background: linear-gradient(135deg, rgba(27, 36, 64, 0.9), rgba(62, 76, 120, 0.9)); }
.c-serial.gld { color: #3a2600; border-color: #fff1b0; background: linear-gradient(135deg, #f6d365, #c99a1e); }
.c-serial.spc { color: #fff; border-color: #ffb3c0; background: linear-gradient(135deg, rgba(11, 31, 77, 0.92), rgba(200, 16, 46, 0.92)); }
.c-serial.rwd { color: #fff7d6; border-color: #ffd36b; background: linear-gradient(135deg, #5a1f00, #a3460a); text-shadow: 0 0 4px rgba(255, 211, 107, 0.8); }
.card .new-chip { top: -0.45em; right: -0.35em; left: auto; } /* a corner sticker on the card's top-right */

/* ---------- rewarded ads (src/ads.js) ---------- */
.pz-slot.missed .card { opacity: 0.55; filter: grayscale(0.6); transform: scale(0.94); }
.ad-test { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; background: rgba(0, 0, 0, 0.92); }
.ad-test-box { display: grid; gap: 14px; justify-items: center; padding: 28px 36px; border: 2px dashed #888; border-radius: 16px; color: #ddd; text-align: center; }
.ad-test-box p { margin: 0; letter-spacing: 0.2em; font-weight: 800; }
.ad-test-box b { font-size: 56px; line-height: 1; color: #fff; }
.ft-save { margin: 10px 0 0; padding: 12px 14px; border-radius: 12px; background: rgba(255, 209, 102, 0.12); border: 1px solid rgba(255, 209, 102, 0.45); text-align: center; }
.ft-save p { margin: 0 0 10px; }
.ft-save .btn + .btn { margin-left: 8px; }

/* ---------- CrazyGames edition (body.cg, src/platform.js): no outside links, own sign-in, share or fullscreen ---------- */
body.cg { -webkit-user-select: none; -moz-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.cg input, body.cg textarea { -webkit-user-select: text; user-select: text; }
.cg #hub-tabs, .cg #acc-chip, .cg #acc-bar, .cg #btn-fullscreen, .cg [data-share], .cg [data-nc="signin"], .cg .lb-cta,
.cg .ft-saved.guest, .cg .home-legal, .cg .home-badge, .cg #home-vote, .cg #home-ad, .cg #fd-newcard { display: none !important; }

/* Wide but short screens (laptops, the CrazyGames frame ~1080×607): the pitch is narrow, so the phase bar keeps only
   the current phase, like on phones, and the Next button stays inside the pitch. */
@media (min-width: 1000px) and (min-aspect-ratio: 5/4) and (max-height: 760px) {
  .phase-bar { --ph-compact: 1; }
  .phase:not(.on) .ph-long, .phase.auto:not(.on), .phase.auto:not(.on) + .phase-link { display: none; }
  .phase-link { width: 6px; }
}
.c-serial.skl { color: #e6fff6; border-color: #7fe3c4; background: linear-gradient(135deg, rgba(10, 60, 52, 0.92), rgba(24, 110, 92, 0.92)); }
.st-logos img[src*="crests/"] { filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.25)); }

/* ---------- illustrated players: flag, club and epic title in a band under the picture ---------- */
.c-band {
  display: flex; align-items: center; gap: calc(var(--cw) * 0.035); min-width: 0; flex: none;
  margin-top: calc(var(--cw) * 0.025); padding: calc(var(--cw) * 0.018) calc(var(--cw) * 0.035);
  border-radius: calc(var(--cw) * 0.04); background: rgba(10, 14, 28, 0.78); color: #fff;
  font-size: calc(var(--cw) * 0.07); line-height: 1.1; white-space: nowrap;
}
.c-band .flag { width: calc(var(--cw) * 0.12); height: calc(var(--cw) * 0.08); flex: none; border-radius: 1px; }
.c-band b { font-weight: 900; letter-spacing: 0.04em; flex: none; }
.c-band { justify-content: center; }
.c-band span { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 800; font-style: italic; color: #ffe39a; font-size: calc(var(--cw) * 0.064); letter-spacing: -0.01em; }
.card.legend .c-band { background: linear-gradient(90deg, #1b2440, #3e4c78); }
.card.gold .c-band { background: linear-gradient(90deg, #5a3a00, #a8741a); }
.card.motm .c-band { background: linear-gradient(90deg, #0b1f4d, #c8102e); }
.card.reward .c-band { background: linear-gradient(90deg, #3b1166, #7a2fd0); }
.c-band span.long { font-size: calc(var(--cw) * 0.056); letter-spacing: -0.02em; }
.c-serial.pce { color: #3a2600; border-color: #fff1b0; background: linear-gradient(135deg, #ffe38a, #d9a632); }
/* small cards (hand, pitch, builder): keep the serial readable */
.c-art:has(.c-era) .c-serial { bottom: auto; top: 2.5%; } /* Legends keep their era strip at the bottom */
.card:not(.big) .c-serial { font-size: max(6px, calc(var(--cw) * 0.05)); padding: 0.15em 0.3em 0.1em; }

/* ---------- daily missions + login streak (home) ---------- */
.fd-missions { padding: 22px 26px; border-radius: 26px; background: linear-gradient(120deg, rgba(70, 224, 138, 0.14), rgba(10, 30, 40, 0.9) 50%), var(--fd-panel, #0e2230); border: 1px solid rgba(70, 224, 138, 0.35); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35); display: grid; gap: 14px; }
.fd-missions header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.fd-missions h2 { margin: 0; font-size: 22px; }
.fm-reset { margin-left: auto; color: var(--muted); font-size: 12px; }
.fm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fm-guess { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; text-decoration: none; color: inherit;
  background: linear-gradient(110deg, rgba(245, 197, 66, 0.2), rgba(124, 92, 255, 0.16)); border: 1px solid rgba(245, 197, 66, 0.55); }
.fm-guess:hover { border-color: var(--gold); }
.fm-guess-ico { font-size: 24px; text-align: center; }
.fm-guess-txt { display: grid; gap: 2px; min-width: 0; }
.fm-guess-txt > b { font-size: 16px; color: var(--gold); }
.fm-guess-txt > span { font-size: 13px; color: var(--muted); }
.fm-guess-txt > span b { color: var(--ink); }
.fm-guess-go { font-weight: 800; color: #1a1030; background: var(--gold); padding: 6px 12px; border-radius: 999px; white-space: nowrap; }
.fm-guess.done { background: rgba(255, 255, 255, 0.05); border-color: rgba(70, 224, 138, 0.4); }
.fm-guess.done .fm-guess-txt > b { color: var(--good); }
.fm-guess.done .fm-guess-go { display: none; }
.fm-list li { display: grid; grid-template-columns: 28px 1fr minmax(80px, 160px) 44px 34px; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.05); }
.fm-list li.done { background: rgba(70, 224, 138, 0.12); }
.fm-list li.done .fm-txt { text-decoration: line-through; opacity: 0.75; }
.fm-ico { font-size: 18px; text-align: center; }
.fm-txt { font-weight: 700; }
.fm-n { text-align: right; font-variant-numeric: tabular-nums; }
.fm-list em { font-style: normal; color: var(--gold); font-weight: 800; font-size: 13px; }
.fm-bar { display: block; height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.fm-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #46e08a, #ffd166); }
.fm-bar.big { height: 12px; flex: 1; }
.fm-stars { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-weight: 800; }
.fm-stars .fm-goal { color: var(--muted); font-weight: 700; font-size: 13px; }
.fm-login { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fm-login-t { font-weight: 800; }
.fm-login ol { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.fm-login li { display: grid; justify-items: center; min-width: 52px; padding: 6px 8px; border-radius: 12px; font-size: 12px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); color: var(--muted); }
.fm-login li.on { background: rgba(255, 209, 102, 0.16); border-color: rgba(255, 209, 102, 0.5); color: #fff; }
.fm-login li.now { box-shadow: 0 0 0 2px var(--gold); }
.fm-login li:last-child span { color: var(--gold); font-weight: 900; }
.fm-guest { margin: 0; }
.fm-cta { display: flex; gap: 8px; }
.ft-missions { display: grid; gap: 4px; margin: 8px 0; padding: 8px 12px; border-radius: 12px; background: rgba(70, 224, 138, 0.12); border: 1px solid rgba(70, 224, 138, 0.4); font-size: 14px; }
.ft-missions em { font-style: normal; color: var(--gold); font-weight: 800; }
.cg #fd-missions { display: none !important; }
@media (max-width: 760px) {
  .fd-missions { padding: 16px; border-radius: 20px; }
  .fm-list li { grid-template-columns: 24px 1fr 40px 30px; }
  .fm-list li .fm-bar { grid-column: 2 / -1; grid-row: 2; }
  .fm-reset { margin-left: 0; width: 100%; }
}
.c-name.epic { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 0.74em; line-height: 1.05; letter-spacing: -0.01em; }
.c-head:has(.c-name.epic) { align-items: flex-start; }
.c-band span:not(.long) { font-style: normal; color: rgba(255, 255, 255, 0.75); font-weight: 800; letter-spacing: 0.04em; }
.c-art img.art-img { width: 100%; height: 100%; display: block; object-fit: cover; -webkit-user-drag: none; user-select: none; }
/* illustrated players: stars + badge on one line, so the picture gets more height (faces stay in view) */
.card.big .c-stars.illus { white-space: nowrap; overflow: hidden; font-size: calc(var(--cw) * 0.085); line-height: 1.2; }
.card.big .c-stars.illus .c-tag { letter-spacing: 0.02em; font-size: 0.9em; }
.card.big:has(.c-stars.illus) .c-name.epic { font-size: 0.68em; }

/* ---------- Football Script: a 3D die thrown across the pitch (src/ui.js rollDice) ---------- */
.die-stage { position: fixed; z-index: 900; pointer-events: none; perspective: 900px; }
.die-stage::before { content: ''; position: absolute; inset: -4px; border-radius: 18px; background: rgba(4, 8, 20, 0.35); opacity: 0; transition: opacity 0.3s; }
.die-stage.landed::before { opacity: 1; }
.die-stage.out { opacity: 0; transition: opacity 0.3s; }
.die-move { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-style: preserve-3d; }
.die3d { position: absolute; left: -36px; top: -36px; width: 72px; height: 72px; transform-style: preserve-3d; }
.die-side { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 14px; background: linear-gradient(145deg, #ffffff, #dde3f0); box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.18); backface-visibility: hidden; }
.die-side .dice-face { grid-template-columns: repeat(3, 14px); grid-template-rows: repeat(3, 14px); gap: 4px; }
.die-side.front { transform: translateZ(36px); }
.die-side.back { transform: rotateY(180deg) translateZ(36px); }
.die-side.right { transform: rotateY(90deg) translateZ(36px); }
.die-side.left { transform: rotateY(-90deg) translateZ(36px); }
.die-side.top { transform: rotateX(90deg) translateZ(36px); }
.die-side.bottom { transform: rotateX(-90deg) translateZ(36px); }
.die-stage.landed .die-side { box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.18), 0 0 26px rgba(255, 209, 102, 0.9); }
.die-shadow { position: absolute; left: -34px; top: -10px; width: 68px; height: 20px; border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 0, 0, 0.55), transparent); }
.die-ui { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 10px; pointer-events: auto; padding: 14px 20px; border-radius: 18px; background: rgba(13, 20, 48, 0.88); border: 1px solid rgba(255, 209, 102, 0.45); text-align: center; transition: opacity 0.2s; }
.die-ui p { margin: 0; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); font-size: 13px; }
.die-ui.gone { opacity: 0; pointer-events: none; }
.die-result { position: absolute; left: 50%; top: calc(50% + 56px); transform: translateX(-50%); display: grid; justify-items: center; gap: 6px; width: max-content; max-width: 92%; padding: 10px 16px; border-radius: 16px; background: rgba(13, 20, 48, 0.92); border: 1px solid rgba(255, 209, 102, 0.45); text-align: center; animation: die-pop 0.35s ease-out; }
.die-result p { margin: 0; font-size: 14px; }
@keyframes die-pop { from { opacity: 0; transform: translateX(-50%) translateY(10px); } to { opacity: 1; transform: translateX(-50%); } }
.dice-face { display: grid; }
.dice-face i { border-radius: 50%; }
.dice-face i.on { background: radial-gradient(circle at 35% 35%, #3a4566, #0d1430); }
.dice-n { font-size: 30px; line-height: 1; color: var(--gold); }
.dice-cards { display: flex; gap: 12px; justify-content: center; }
.dice-card { --cw: 78px; }
.dice-roll { font-size: 18px; padding: 12px 22px; }
@media (prefers-reduced-motion: reduce) { .dice.rolling, .dice.landed { animation: none; } }
.dice-card { display: grid; justify-items: center; gap: 4px; } .dice-who { font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

/* ---------- home: compact reward cards strip ---------- */
.fd-newcard { display: grid; grid-template-columns: 1fr; gap: 14px; padding: 18px 22px; }
.fd-newcard .fd-nc-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; }
.fd-newcard .fd-nc-head h2 { margin: 4px 0; font-size: 26px; }
.fd-newcard .fd-nc-how { margin: 0; font-size: 14px; color: var(--muted); }
.fd-nc-strip { display: flex; gap: 12px; overflow-x: auto; padding: 6px 2px 10px; scroll-snap-type: x mandatory; width: 100%; min-width: 0; }
.fd-newcard > * { min-width: 0; max-width: 100%; } /* grid items: the strip scrolls instead of stretching the box */
@media (max-width: 640px) { .fd-nc-strip { scroll-snap-type: x proximity; padding: 10px 6px 12px; } }
@media (hover: none) { .fd-nc-mini:hover { transform: none; } }
.fd-nc-mini { position: relative; flex: none; --cw: 118px; padding: 0; border: 0; background: none; cursor: pointer; scroll-snap-align: start; transition: transform 0.15s; }
.fd-nc-mini:hover, .fd-nc-mini:focus-visible { transform: translateY(-4px); }
.fd-nc-mini:not(.owned) .card { filter: saturate(0.75) brightness(0.85); }
.fd-nc-mini .fd-nc-badge { position: absolute; right: -6px; top: -6px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: #1a1030; border: 2px solid var(--gold); font-size: 14px; }
.fd-nc-mini.owned .fd-nc-badge { background: var(--good); color: #062a14; }
.fd-nc-mini .fd-nc-new { position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); font: 900 11px/1 system-ui; letter-spacing: 0.08em; padding: 4px 8px; border-radius: 999px; background: var(--good); color: #062a14; }
.fd-nc-detail { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; }
.fd-nc-detail-card { --cw: 180px; }
.fd-nc-detail h2 { margin: 0 0 8px; }
@media (max-width: 560px) { .fd-nc-detail { grid-template-columns: 1fr; justify-items: center; text-align: center; } .fd-nc-mini { --cw: 100px; } }
.fm-invite { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 14px; border-radius: 14px; background: rgba(122, 47, 208, 0.18); border: 1px solid rgba(160, 110, 255, 0.45); }
.fm-inv-t { font-weight: 900; }
.fm-inv-txt { flex: 1; min-width: 220px; font-size: 14px; }
.fm-inv-txt em { color: var(--gold); font-style: normal; font-weight: 800; }
.fm-inv-friends { flex-basis: 100%; list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.fm-inv-friends li { display: grid; grid-template-columns: minmax(70px, auto) 1fr auto; align-items: center; gap: 10px; font-size: 13px; }
.fm-inv-friends em { font-style: normal; font-weight: 800; color: var(--gold); }
.fm-inv-me { flex-basis: 100%; font-size: 13px; padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.07); }
.inv-pop-friends { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: inherit; gap: 4px 14px; font-size: 13px; }
.nc-pop-text .wc-steps { text-align: left; }
.share-pic { display: grid; gap: 10px; justify-items: center; }
.share-pic img { width: min(320px, 70vw); height: auto; border-radius: 14px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5); }
.share-pic p { margin: 0; text-align: center; }
/* phones: the Play buttons come sooner (no fanned cards above the crest), and an empty "Watch live" panel shrinks */
@media (max-width: 760px) {
  .fd-hero-cards { display: none; }
  .fd-logo-crest { width: 130px; margin: -6px auto -10px; }
  .fd-watch-live:has(.wl-empty) .wl-empty p, .fd-watch-live:has(.wl-empty) .wl-empty-ico { display: none; }
  .fd-watch-live:has(.wl-empty) .wl-empty { padding: 10px; }
}

/* Welcome gift (The Special One, free with an account): guest prompts and the gift popup */
.fd-newcard .fd-nc-gift { margin: 6px 0 0; font-size: 14px; color: var(--gold); }
.gift-perks { list-style: none; margin: 10px 0 6px; padding: 0; display: grid; gap: 8px; font-size: 15px; line-height: 1.35; }
.gift-small { margin: 4px 0 0; font-size: 12px; opacity: 0.7; }
.acc-perks .acc-gift { color: var(--gold); }

/* Storm skill: a storm over the pitch (ui.js pitchStorm). The cards underneath fly away as the twister passes. */
.pitch-storm { position: fixed; z-index: 900; pointer-events: none; border-radius: 18px; overflow: hidden; opacity: 0; }
.pitch-storm .ps-dark { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 30%, rgba(14, 18, 36, 0.6), rgba(2, 4, 12, 0.82) 75%); transition: background 0.12s; }
.pitch-storm.lit .ps-dark { background: radial-gradient(ellipse at 50% 30%, rgba(150, 170, 230, 0.45), rgba(10, 14, 34, 0.5) 75%); }
.pitch-storm .ps-clouds { position: absolute; inset: -12% -20% auto; height: 45%; opacity: 0.95; filter: blur(12px);
  background: radial-gradient(40% 60% at 15% 45%, rgba(60, 66, 92, 0.95), transparent 70%), radial-gradient(45% 55% at 55% 35%, rgba(45, 50, 76, 0.95), transparent 70%), radial-gradient(35% 50% at 90% 45%, rgba(58, 62, 88, 0.95), transparent 70%);
  animation: st-clouds 4s ease-in-out forwards; }
.pitch-storm.lit .ps-clouds { filter: blur(12px) brightness(2.4); }
.pitch-storm .ps-rain { position: absolute; inset: -10%; opacity: 0.55;
  background: repeating-linear-gradient(105deg, transparent 0 12px, rgba(190, 210, 255, 0.4) 12px 13px, transparent 13px 30px);
  animation: st-rain 0.4s linear infinite; }
.pitch-storm .st-bolts { z-index: 3; }
.ps-twister { position: absolute; left: 0; top: 2%; bottom: 6%; width: clamp(110px, 30%, 240px); opacity: 0; z-index: 2; filter: drop-shadow(0 0 14px rgba(170, 200, 255, 0.45)); }
/* the funnel: wide at the top, a thin tip on the grass; diagonal streaks slide across it so it seems to spin */
.ps-twister .ps-funnel { position: absolute; inset: 0; clip-path: polygon(0 0, 100% 0, 66% 38%, 58% 70%, 53% 100%, 47% 100%, 42% 70%, 34% 38%);
  background: repeating-linear-gradient(160deg, rgba(170, 182, 208, 0.75) 0 10px, rgba(120, 132, 160, 0.55) 10px 22px, rgba(215, 224, 245, 0.6) 22px 30px);
  background-size: 120px 100%; filter: blur(2.5px); -webkit-mask-image: linear-gradient(transparent, #000 18%); mask-image: linear-gradient(transparent, #000 18%); animation: ps-swirl 0.32s linear infinite, ps-sway 0.9s ease-in-out infinite alternate; transform-origin: 50% 0; }
.ps-twister .ps-base { position: absolute; left: 50%; bottom: -4%; width: 70%; height: 12%; transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(ellipse, rgba(200, 180, 140, 0.7), rgba(120, 100, 70, 0.3) 50%, transparent 72%); filter: blur(3px); animation: ps-dust 0.5s ease-in-out infinite alternate; }
.ps-twister .ps-debris { position: absolute; width: 7px; height: 7px; border-radius: 2px; background: #e8efff; box-shadow: 0 0 6px #9fc0ff; animation: ps-orbit 0.7s linear infinite; }
.ps-twister .ps-debris:nth-of-type(1) { top: 30%; animation-duration: 0.6s; }
.ps-twister .ps-debris:nth-of-type(2) { top: 55%; animation-duration: 0.5s; animation-delay: -0.2s; background: #7fd36b; }
.ps-twister .ps-debris:nth-of-type(3) { top: 15%; animation-duration: 0.8s; animation-delay: -0.4s; }
@keyframes ps-swirl { to { background-position: 120px 0; } }
@keyframes ps-sway { from { transform: skewX(-6deg); } to { transform: skewX(6deg); } }
@keyframes ps-dust { from { transform: translateX(-50%) scale(0.9); } to { transform: translateX(-50%) scale(1.15); } }
@keyframes ps-orbit { 0% { left: 10%; transform: scale(0.6); z-index: 0; } 50% { left: 85%; transform: scale(1.2); } 100% { left: 10%; transform: scale(0.6); } }
@media (prefers-reduced-motion: reduce) { .ps-twister *, .pitch-storm .ps-rain { animation: none; } }

/* ---------- phones held sideways: panels left, pitch + hand in the middle, turn info and plays on the right ----------
   (the card size itself is measured to fit the screen: fitBoard in ui.js) */
@media (orientation: landscape) and (max-height: 560px) {
  .layout { padding: 4px 8px 0; }
  .board {
    height: auto; display: grid; justify-content: center; align-items: start; column-gap: 10px; row-gap: 4px;
    grid-template-columns: minmax(150px, 1fr) auto minmax(120px, 0.8fr);
    grid-template-rows: auto auto 1fr auto;
    grid-template-areas:
      "opp  pitch tips"
      "opp  pitch status"
      "you  pitch hint"
      "hand pitch plays";
  }
  #opp-panel { grid-area: opp; order: 0; }
  #you-panel { grid-area: you; order: 0; align-self: end; }
  .pitch { grid-area: pitch; order: 0; padding: calc(var(--gap) * 2) 8px; }
  #you-hand { grid-area: hand; order: 0; --cw: calc(var(--cw-base) * 1.1); --ch: calc(var(--cw) * 1.4); padding: 4px 0 0; min-height: calc(var(--ch) + 4px); max-width: none; align-self: end; }
  .tips-toggle {
    grid-area: tips; order: 0; display: block; justify-self: stretch; font: 800 12px system-ui; color: var(--muted); cursor: pointer;
    background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 999px; padding: 4px 12px;
  }
  body.tips-hidden #turn-status, body.tips-hidden #plays { display: none !important; }
  #turn-status { grid-area: status; order: 0; font-size: 12px; padding: 4px 8px; }
  #hint { grid-area: hint; order: 0; font-size: 12px; }
  #plays { grid-area: plays; order: 0; flex-direction: column; align-items: stretch; max-width: none; }
  .duelist { max-width: none; flex-wrap: wrap; padding: 6px 8px; gap: 4px 8px; min-height: 0; }
  .duelist .lp { width: 100%; min-width: 0; }
  .duelist .avatar { width: 30px; height: 30px; }
  .duelist .d-sub, .duelist .lp-label { display: none; }
  .duelist .lp-value { font-size: 17px; }
  .phase:not(.on) .ph-long, .phase.auto:not(.on), .phase.auto:not(.on) + .phase-link { display: none; }
  .phase-link { width: 5px; }
  .topbar { height: 40px; }
  .ts-help { display: none; }
  #turn-status, #hint { align-self: start; }
}

/* A big hand (10+ cards on a phone): it scrolls sideways from the first card instead of running off both edges */
.you-hand.scrolls { justify-content: flex-start; overflow-x: auto; overflow-y: hidden; padding-top: 12px; scrollbar-width: thin; overscroll-behavior-x: contain; }
.resp-cause { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; padding: 10px; border-radius: 14px; --cw: 84px;
  background: rgba(255, 93, 108, 0.08); border: 1px solid rgba(255, 93, 108, 0.35); margin-bottom: 10px; }
.resp-cause .resp-type { color: #ffb3bb; }
@media (max-width: 480px) { .resp-cause { --cw: 64px; gap: 10px; } }

/* =====================================================================
   Home page v4 · the Al3ab Hub template (deploy/hub/index.html):
   deep navy, gold accent, purple + cyan glows, pitch lines, crest on the left.
   ===================================================================== */
.home {
  --fd-v1: #07091a; --fd-v2: #10142e; --fd-v3: #1a1f45; --fd-green: #f5c542; --fd-cyan: #3ad6ff; --fd-pink: #7b6cff;
  --fd-panel: rgba(16, 20, 46, 0.86); --fd-line: rgba(255, 255, 255, 0.1); --hub-green: #35c46a; --hub-muted: #a3acd2;
  background: #07091a; color: #f1f3ff; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.home::before { display: none; }

/* top bar: the same glass bar as the hub nav */
.home .fd-top { background: rgba(7, 9, 26, 0.78); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--fd-line); border-image: none; padding: 10px 20px; }
.home .hub-tabs { border-bottom: 0; }
.home .fd-brand { font: 900 19px/1 system-ui, sans-serif; letter-spacing: 0.03em; }
.home .fd-brand i { font-style: normal; color: var(--fd-green); }
.home .fd-brand em { color: #1a1200; }
.home .fd-mark { filter: drop-shadow(0 3px 8px rgba(245, 197, 66, 0.4)); }
.home .fd-nav a { color: var(--hub-muted); font: 700 14px system-ui, sans-serif; padding: 8px 13px; border: 1px solid transparent; }
.home .fd-nav a:hover { background: none; color: #f1f3ff; border-color: var(--fd-line); }
.home .acc-chip { color: #1a1200; box-shadow: 0 6px 18px rgba(245, 197, 66, 0.25); }
.home .fd-top-actions .settings-btn { color: #f1f3ff; }

/* hero: a full-width stage like the hub's featured game */
.home .fd-wrap { max-width: 1160px; padding: 0 20px 56px; gap: 28px; }
.home .fd-hero {
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 32px; padding: 40px 20px 30px;
  margin: 0 calc(50% - 50vw); padding-left: max(20px, calc(50vw - 560px)); padding-right: max(20px, calc(50vw - 560px));
  border: 0; border-bottom: 1px solid var(--fd-line); border-radius: 0; box-shadow: none; overflow: hidden; overflow: clip;
  background:
    radial-gradient(700px 520px at 24% 42%, rgba(245, 197, 66, 0.20), transparent 70%),
    radial-gradient(800px 600px at 80% 30%, rgba(123, 108, 255, 0.32), transparent 70%),
    radial-gradient(600px 400px at 60% 110%, rgba(58, 214, 255, 0.16), transparent 70%),
    linear-gradient(180deg, #0a0d24, #07091a);
}
.home .fd-hero::before { /* pitch lines fading into the dark */
  content: ""; position: absolute; inset: auto; left: 50%; bottom: -260px; z-index: -1; width: 1400px; height: 560px; opacity: 1;
  transform: translateX(-50%) perspective(600px) rotateX(58deg); border: 2px solid rgba(255, 255, 255, 0.08); border-radius: 8px;
  background:
    radial-gradient(circle at 50% 50%, transparent 88px, rgba(255, 255, 255, 0.08) 89px 91px, transparent 92px),
    linear-gradient(90deg, transparent calc(50% - 1px), rgba(255, 255, 255, 0.08) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)),
    repeating-linear-gradient(90deg, rgba(53, 196, 106, 0.10) 0 70px, rgba(53, 196, 106, 0.05) 70px 140px);
  -webkit-mask-image: linear-gradient(0deg, #000 30%, transparent 95%); mask-image: linear-gradient(0deg, #000 30%, transparent 95%);
}
.fd-crest-wrap { position: relative; display: grid; place-items: center; align-self: center; }
.fd-crest-wrap::before { content: ""; position: absolute; width: 74%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(245, 197, 66, 0.35), rgba(123, 108, 255, 0.18) 45%, transparent 70%); filter: blur(10px); animation: fd-crest-pulse 4s ease-in-out infinite; }
.home .fd-logo-crest {
  position: relative; width: min(100%, 400px); margin: 0; justify-self: center; filter: none;
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 72%, transparent 100%); mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 72%, transparent 100%);
  animation: fd-crest-float 6s ease-in-out infinite;
}
@keyframes fd-crest-float { 50% { transform: translateY(-10px); } }
@keyframes fd-crest-pulse { 50% { transform: scale(1.08); opacity: 0.75; } }
.home .fd-hero-text { gap: 14px; }
.home .fd-hero-head { grid-template-columns: minmax(0, 1fr); gap: 12px; }
.home .fd-hero-head .fd-eyebrow, .home .fd-hero-head .fd-news { align-self: auto; }
.home .fd-eyebrow { background: none; border: 0; padding: 0; color: var(--fd-green); font: 800 12.5px system-ui, sans-serif; letter-spacing: 0.14em; }
.home .fd-eyebrow .fd-dot { background: var(--hub-green); box-shadow: 0 0 0 0 rgba(53, 196, 106, 0.6); animation: fd-ping 2s infinite; }
@keyframes fd-ping { 70% { box-shadow: 0 0 0 8px rgba(53, 196, 106, 0); } 100% { box-shadow: 0 0 0 0 rgba(53, 196, 106, 0); } }
.home .home-title { font: 800 clamp(38px, 5.4vw, 62px)/1.02 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; text-transform: none; letter-spacing: -0.015em; text-shadow: none; }
.home .home-title span {
  display: block; margin: 2px 0 0; filter: none; background: linear-gradient(100deg, #ffdf7e, #f5c542 40%, #fff6cf 50%, #f5c542 60%, #c99419);
  -webkit-background-clip: text; background-clip: text; color: transparent; background-size: 220% 100%; animation: fd-shine 5s linear infinite;
}
@keyframes fd-shine { to { background-position: -220% 0; } }
/* the game's name inside the h1 (search engines read the h1 as the page's topic), shown as a small label */
.home .home-title .home-brand { display: block; margin: 0 0 10px; font: 800 14px/1.2 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); }
.home .home-tag { font-size: 18px; color: #cfd5f3; max-width: 34em; }
.home .fd-cta .big-btn { border-radius: 14px; font: 800 18px system-ui, sans-serif; transition: transform 0.15s, box-shadow 0.15s, background 0.15s; }
.home .fd-play {
  font-size: 19px; padding: 17px 30px; color: #1a1200; border: 0;
  background: linear-gradient(180deg, #ffe08a, #f5c542 55%, #d9a52a);
  box-shadow: 0 10px 30px rgba(245, 197, 66, 0.35), inset 0 -3px 0 rgba(0, 0, 0, 0.18), inset 0 2px 0 rgba(255, 255, 255, 0.5);
  animation: fd-glow 2.6s ease-in-out infinite;
}
.home .fd-play:hover { filter: none; transform: translateY(-2px); background: linear-gradient(180deg, #fff0bd, #ffdf7e 55%, #e8b53a); }
@keyframes fd-glow { 50% { box-shadow: 0 10px 44px rgba(245, 197, 66, 0.6), inset 0 -3px 0 rgba(0, 0, 0, 0.18), inset 0 2px 0 rgba(255, 255, 255, 0.5); } }
.home .fd-online { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--fd-line); color: #f1f3ff; }
.home .fd-online:hover { transform: translateY(-2px); background: rgba(255, 255, 255, 0.09); }
.home .fd-online[aria-expanded="true"] { background: rgba(58, 214, 255, 0.14); border-color: rgba(58, 214, 255, 0.6); box-shadow: none; }
.home .fd-cta-sub .rival-row { color: var(--hub-muted); }
.home .fd-pill { background: rgba(255, 255, 255, 0.04); border-color: var(--fd-line); color: #cfd5f3; }
.home .fd-pill.live { border-color: rgba(53, 196, 106, 0.55); }
.home .fd-hero .online { background: rgba(16, 20, 46, 0.86); border-color: var(--fd-line); }
.home .fd-news { background: rgba(245, 197, 66, 0.08); border-color: rgba(245, 197, 66, 0.4); box-shadow: none; }
/* the card fan sits under the buttons, like the hub's */
.home .fd-hero-cards { height: 250px; margin-top: 4px; }
.home .fd-fan { --fan-cw: clamp(118px, 11vw, 150px); }
.home .fd-fan-glow { background: radial-gradient(closest-side, rgba(245, 197, 66, 0.3), rgba(123, 108, 255, 0.15), transparent); }

/* panels and sections: the hub's cards and headings */
.home .fd-panel { background: #10142e; border-color: var(--fd-line); border-radius: 18px; box-shadow: none; backdrop-filter: none; }
.home .fd-ph { background: none; padding: 16px 18px 6px; border-bottom: 0; }
.home .fd-ph h2 { font: 800 20px system-ui, sans-serif; text-transform: none; letter-spacing: -0.005em; }
.home .fd-ph-sub, .home .fd-empty { color: var(--hub-muted); }
.home .fd-ph-link { color: var(--fd-green); }
.home .fd-totw .fd-ph { background: none; }
.home .fd-how, .home .fd-faq { background: none; border: 0; padding: 0; border-radius: 0; }
.home .fd-how h2, .home .fd-faq h2, .home .fd-leg-head h2 { font: 800 clamp(26px, 3.4vw, 34px)/1.1 system-ui, sans-serif; text-transform: none; letter-spacing: -0.01em; margin: 0; }
.home .fd-steps li { background: #10142e; border-color: var(--fd-line); border-radius: 18px; }
.home .fd-steps p, .home .fd-facts span { color: #c3cbea; }
.home .fd-step-n { font-style: normal; color: #1a1200; background: linear-gradient(180deg, #ffe08a, #f5c542 55%, #d9a52a); }
.home .fd-facts div { background: rgba(16, 20, 46, 0.86); border: 1px solid var(--fd-line); border-radius: 16px; padding: 16px 18px; }
.home .fd-facts b { font: 800 30px/1.1 system-ui, sans-serif; background: none; color: #f5c542; -webkit-text-fill-color: currentColor; font-variant-numeric: tabular-nums; }
.home .fd-legends { background: #10142e; border-color: var(--fd-line); box-shadow: none; border-radius: 18px; margin: 0; }
.home .fd-show { border-radius: 18px; }
.home .fd-show-tag { color: #1a1200; }
.home .fd-show-cta { color: #1a1200; box-shadow: 0 8px 22px rgba(245, 197, 66, 0.3); }
.home .btn.primary { background: linear-gradient(180deg, #ffe08a, #f5c542 55%, #d9a52a); color: #1a1200; border-color: transparent; }
.home .deck-opt[aria-checked="true"] { background: rgba(245, 197, 66, 0.1); box-shadow: 0 0 0 3px rgba(245, 197, 66, 0.18); }
.home .hp-input:focus { box-shadow: 0 0 0 4px rgba(245, 197, 66, 0.18); }
.home .fd-foot { border-top: 1px solid var(--fd-line); padding-top: 22px; }
.home .home-legal, .home .home-legal a, .home .home-vote { color: var(--hub-muted); }
/* online-now dots stay green: they mean "online" */
.home .fd-dot.green, .home .on-st, .home .fd-switch input:checked + i { background: var(--hub-green); box-shadow: 0 0 10px rgba(53, 196, 106, 0.6); }
.home .on-st { border-color: #10142e; }

@media (max-width: 900px) {
  .home .fd-hero { grid-template-columns: 1fr; text-align: center; gap: 4px; padding-top: 16px; padding-bottom: 28px; }
  .home .fd-logo-crest { width: min(56vw, 240px); }
  .home .fd-hero-text, .home .fd-hero-head { justify-items: center; }
  .home .fd-eyebrow, .home .fd-news { justify-self: center; }
  .home .home-title, .home .home-tag { text-align: center; }
  .home .fd-cta, .home .fd-cta-sub, .home .fd-live-strip { justify-content: center; }
  .home .fd-hero-cards { order: 0; height: 200px; }
  .home .fd-fan { --fan-cw: 104px; }
}
@media (max-width: 760px) {
  .home .fd-wrap { padding: 0 16px 40px; gap: 22px; }
  .home .fd-hero { padding-left: 16px; padding-right: 16px; }
  .home .fd-hero { padding-top: 8px; }
  .home .fd-logo-crest { width: min(40vw, 150px); margin: 0 auto -8px; }
  .home .fd-hero-text { gap: 12px; }
  .home .home-title { font-size: 36px; }
  .home .home-tag { font-size: 15.5px; line-height: 1.45; }
  .home .fd-play { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .home .fd-logo-crest, .fd-crest-wrap::before, .home .home-title span, .home .fd-play { animation: none; }
}

/* hero v4.1: two clear buttons, then one quiet row (opponent deck · learn link), no icon clutter */
.home .fd-tri { width: 0; height: 0; border-left: 13px solid #1a1200; border-top: 8px solid transparent; border-bottom: 8px solid transparent; flex: none; }
.home .fd-live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--hub-green); flex: none; animation: fd-ping 2s infinite; }
.home .fd-cta .big-btn { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-width: 0; }
.home .fd-online { padding: 17px 26px; font-size: 18px; }
.home .fd-news { gap: 10px; padding: 5px 14px 5px 5px; border-radius: 999px; }
.home .fd-news img { width: 30px; height: 30px; border-radius: 50%; }
.home .fd-news span { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.home .fd-news b { font-size: 14px; }
.home .fd-news small { font-size: 13.5px; color: #cfd5f3; }
.home .fd-cta-sub { align-items: center; gap: 10px 18px; margin-top: -2px; }
.home .fd-cta-sub .rival-row { display: inline-flex; align-items: center; gap: 8px; font: 600 14px system-ui, sans-serif; color: var(--hub-muted); }
.home .fd-cta-sub .rival-row select {
  -webkit-appearance: none; appearance: none; width: auto; flex: none; cursor: pointer; font: 700 14px system-ui, sans-serif; color: #f1f3ff;
  padding: 7px 32px 7px 14px; border-radius: 999px; border: 1px solid var(--fd-line); outline: none;
  background: rgba(255, 255, 255, 0.05) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23f5c542' stroke-width='1.8'/%3E%3C/svg%3E") no-repeat right 13px center;
}
.home .fd-cta-sub .rival-row select:hover, .home .fd-cta-sub .rival-row select:focus-visible { border-color: rgba(245, 197, 66, 0.6); }
.home .fd-cta-sub .rival-row select option { background: #10142e; }
.home .fd-cta-sub .tut-btn, .home .fd-cta-sub .tut-btn.done {
  display: inline; flex: none; width: auto; padding: 0; margin: 0; border: 0; background: none; box-shadow: none; animation: none;
  font: 600 14px system-ui, sans-serif; color: var(--hub-muted); cursor: pointer; text-align: left;
}
.home .fd-cta-sub .tut-btn b { font-size: 14px; color: var(--fd-green); font-weight: 800; }
.home .fd-cta-sub .tut-btn b::after { content: " ›"; }
.home .fd-cta-sub .tut-btn:hover b { text-decoration: underline; text-underline-offset: 3px; }
.home .fd-cta-sub .rival-row + .tut-btn::before { content: "·"; margin-right: 18px; color: rgba(255, 255, 255, 0.25); }
.home .fd-live-strip:empty { display: none; }
@media (max-width: 900px) {
  .home .fd-cta-sub { justify-content: center; }
  .home .fd-cta-sub .rival-row + .tut-btn::before { display: none; }
  .home .fd-cta-sub .tut-btn { flex-basis: 100%; text-align: center; }
}
@media (max-width: 760px) {
  .home .fd-cta .big-btn { flex: 1 1 100%; }
  .home .fd-news small { display: none; }
}

/* Invite a friend: the small notification on opening and after each match (main.js inviteNotif) */
.inv-notif { position: fixed; top: max(12px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 70; width: min(560px, calc(100vw - 20px));
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; color: var(--ink);
  background: linear-gradient(135deg, rgba(60, 24, 110, 0.97), rgba(20, 26, 52, 0.97)); border: 1px solid rgba(160, 110, 255, 0.6);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55); animation: inv-in 0.35s ease-out; }
@keyframes inv-in { from { opacity: 0; transform: translate(-50%, -16px); } }
.inv-notif img { flex: none; width: 48px; height: 48px; border-radius: 10px; object-fit: cover; border: 2px solid var(--gold); }
.inv-notif-txt { flex: 1; min-width: 0; display: grid; gap: 2px; line-height: 1.3; }
.inv-notif-txt b { font-size: 14px; }
.inv-notif-txt small { font-size: 12px; opacity: 0.85; }
.inv-notif .btn { flex: none; padding: 8px 12px; font-size: 14px; }
.inv-notif-x { flex: none; align-self: flex-start; background: none; border: 0; color: inherit; opacity: 0.6; font-size: 20px; line-height: 1; padding: 2px 4px; cursor: pointer; }
.inv-notif-x:hover { opacity: 1; }

/* ---------- phase bar (2026-11-09): one colour per phase, the current one glows and animates ---------- */
.phase-bar {
  --c: #8fa3c7; display: flex; align-items: center; gap: 0; padding: 5px 7px; border-radius: 999px;
  background: linear-gradient(180deg, rgba(14, 22, 44, 0.95), rgba(6, 11, 26, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.14); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.phase-bar.theirs { border-color: rgba(255, 93, 108, 0.55); }
.phase {
  --c: #8fa3c7; --c2: #5b6b8c; position: relative; display: inline-flex; align-items: center; gap: 5px; flex: none;
  padding: 3px; border-radius: 999px; font: 900 12px/1 system-ui, sans-serif; letter-spacing: 0.06em; text-transform: uppercase;
  color: rgba(220, 230, 250, 0.62); white-space: nowrap; transition: color 0.2s;
}
.ph-main { --c: #4fa8ff; --c2: #1f5fd1; }
.ph-match { --c: #ff7a45; --c2: #d6262f; }
.ph-end { --c: #b693ff; --c2: #6a3fd1; }
.ph-draw, .ph-standby { --c: #7fe3c4; --c2: #1e8c72; }
.phase .ph-icon {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: 13px;
  background: rgba(255, 255, 255, 0.06); border: 1.5px solid color-mix(in srgb, var(--c) 55%, transparent);
}
.phase .ph-long { padding-right: 6px; }
.phase.auto .ph-icon { width: 18px; height: 18px; font-size: 10px; }
.phase.auto:not(.on) .ph-long { display: none; }
.phase.done { color: color-mix(in srgb, var(--c) 75%, #fff); }
.phase.done .ph-icon { background: color-mix(in srgb, var(--c) 30%, transparent); border-color: var(--c); color: #fff; font-size: 12px; font-weight: 900; }
.phase.skipped { opacity: 0.35; }
/* a phase ahead of you on your turn: a button (tap to go there) */
button.phase { appearance: none; background: none; border: 0; margin: 0; cursor: pointer; font: 900 12px/1 system-ui, sans-serif; letter-spacing: 0.06em; text-transform: uppercase; }
button.phase.can-go:hover, button.phase.can-go:focus-visible { color: #fff; outline: none; background: color-mix(in srgb, var(--c) 22%, transparent); }
button.phase.can-go:hover .ph-icon, button.phase.can-go:focus-visible .ph-icon { border-color: var(--c); background: color-mix(in srgb, var(--c) 35%, transparent); transform: scale(1.08); }
button.phase.can-go:active { transform: scale(0.95); }
button.phase.can-go .ph-icon { transition: transform 0.12s, background 0.12s; }
button.phase.can-go::before { content: ''; position: absolute; inset: -9px -4px; } /* a thumb-sized tap area, same look */
.phase.skipped .ph-long { text-decoration: line-through; }
/* the current phase */
.phase.on {
  color: #fff; padding: 3px 4px 3px 3px; overflow: hidden;
  background: linear-gradient(135deg, var(--c), var(--c2));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 45%, transparent), 0 0 18px color-mix(in srgb, var(--c) 70%, transparent);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}
.phase.on .ph-icon { background: rgba(255, 255, 255, 0.22); border-color: rgba(255, 255, 255, 0.7); }
.phase.on .ph-long { display: inline !important; padding-right: 8px; }
.phase.on::after { /* light sweep */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.45) 50%, transparent 65%); background-size: 250% 100%;
  animation: ph-sweep 2.6s ease-in-out infinite;
}
.phase.on.opp { filter: saturate(0.75) brightness(0.92); }
/* the moment a phase starts: pop + ring burst */
.phase.enter { animation: ph-pop 0.55s cubic-bezier(0.2, 1.6, 0.4, 1) both; overflow: visible; }
.phase.enter::before {
  content: ""; position: absolute; inset: -2px; border-radius: inherit; border: 2px solid var(--c); pointer-events: none;
  animation: ph-ring 0.7s ease-out both;
}
/* each phase's icon has its own little loop */
.ph-main.on .ph-icon { animation: ph-think 1.8s ease-in-out infinite; }
.ph-match.on .ph-icon { animation: ph-clash 1.1s ease-in-out infinite; }
.ph-end.on .ph-icon { animation: ph-wave 1.2s ease-in-out infinite; transform-origin: 30% 80%; }
.ph-draw.on .ph-icon { animation: ph-flip 1s ease-in-out infinite; }
.ph-standby.on .ph-icon { animation: ph-tick 1s steps(4) infinite; }
/* connectors fill up to the current phase */
.phase-link { position: relative; width: 12px; height: 3px; margin: 0 2px; border-radius: 2px; background: rgba(255, 255, 255, 0.14); flex: none; overflow: hidden; }
.phase-link i { position: absolute; inset: 0; transform: scaleX(0); transform-origin: left; background: linear-gradient(90deg, #7fe3c4, var(--gold)); }
.phase-link.lit i { transform: scaleX(1); }
.phase-link.fill i { animation: ph-fill 0.4s ease-out both; }
/* Next button: wears the colour and icon of the phase it leads to */
.next-btn[data-to="match"] { background: linear-gradient(135deg, #ff7a45, #d6262f); border-color: #ff9a6b; color: #fff; }
.next-btn[data-to="main2"] { background: linear-gradient(135deg, #4fa8ff, #1f5fd1); border-color: #8cc6ff; color: #fff; }
.next-btn[data-to="end"] { background: linear-gradient(135deg, #b693ff, #6a3fd1); border-color: #d3bcff; color: #fff; }
.next-btn[data-to] { text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4); }
.next-btn .nb-icon { display: inline-block; }
.next-btn.nb-pop { animation: ph-pop 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) 0.15s both; }
.next-btn:not(:disabled):hover .nb-icon { animation: ph-clash 0.6s ease-in-out infinite; }
@keyframes ph-sweep { 0%, 35% { background-position: 130% 0; } 100% { background-position: -130% 0; } }
@keyframes ph-pop { 0% { transform: scale(0.6); opacity: 0.3; } 60% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
@keyframes ph-ring { 0% { transform: scale(1); opacity: 0.9; } 100% { transform: scale(1.45, 1.9); opacity: 0; } }
@keyframes ph-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes ph-think { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.14); } }
@keyframes ph-clash { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-14deg) scale(1.1); } 50% { transform: rotate(10deg) scale(1.15); } 75% { transform: rotate(-4deg); } }
@keyframes ph-wave { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-16deg); } }
@keyframes ph-flip { 0%, 100% { transform: rotateY(0); } 50% { transform: rotateY(180deg); } }
@keyframes ph-tick { to { transform: rotate(360deg); } }
@media (max-width: 560px) {
  .phase { font-size: 11px; }
  .phase .ph-icon { width: 22px; height: 22px; font-size: 12px; }
  .phase:not(.on) .ph-long, .phase.auto:not(.on), .phase.auto:not(.on) + .phase-link { display: none; }
  .phase { padding: 2px; }
  .phase-link { width: 7px; margin: 0 1px; }
  .phase-bar { padding: 4px 5px; }
}
/* The bar fits the space the pitch gives it (not the screen): compact when the midline is narrow. */
.midline { container-type: inline-size; container-name: midline; }
@container midline (max-width: 640px) {
  .phase:not(.on) .ph-long, .phase.auto:not(.on), .phase.auto:not(.on) + .phase-link { display: none; }
  .phase { padding: 2px; }
  .phase-link { width: 7px; margin: 0 1px; }
  .phase-bar { padding: 4px 5px; }
}
@container midline (max-width: 330px) {
  .next-btn .nb-label { display: none; }
  .phase .ph-icon { width: 21px; height: 21px; font-size: 11px; }
  .phase { font-size: 10.5px; letter-spacing: 0.03em; }
}
@media (prefers-reduced-motion: reduce) {
  .phase.on::after, .phase.on .ph-icon, .phase.enter, .phase.enter::before, .phase-link.fill i, .next-btn.nb-pop, .next-btn .nb-icon { animation: none !important; }
}

/* ---------- target bar (2026-11-09): picking a target (attack, Skill, substitution, Assist/Cover) ----------
   Wide screens: in the middle of the pitch (between your player and the targets), in place of the phase bar.
   Phones: a bottom sheet over the hand, in thumb reach, with big buttons. */
.target-bar[hidden] { display: none !important; }
.target-bar {
  display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 14px; border-radius: 999px; max-width: 100%;
  background: linear-gradient(180deg, rgba(20, 28, 54, 0.97), rgba(8, 12, 28, 0.97)); border: 1.5px solid var(--gold);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 22px rgba(245, 197, 66, 0.35); animation: tb-in 0.28s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
body.targeting-attack .target-bar { border-color: #ff7a45; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 22px rgba(255, 122, 69, 0.45); }
.tb-text { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; line-height: 1.25; color: var(--ink); }
.tb-icon { font-size: 18px; flex: none; }
.tb-msg b { color: var(--gold-2, #ffe7a3); }
.tb-actions { display: flex; gap: 6px; flex: none; }
.target-bar .btn { min-height: 38px; padding: 6px 14px; border-radius: 999px; font-weight: 900; font-size: 14px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.tb-direct { background: linear-gradient(135deg, #ff7a45, #d6262f); border-color: #ff9a6b; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); animation: tb-glow 1.4s ease-in-out infinite; }
.tb-cancel { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.35); color: #fff; }
.tb-cancel:hover { background: rgba(255, 255, 255, 0.18); }
.tb-key { font: 700 10px ui-monospace, monospace; padding: 1px 5px; border-radius: 4px; background: rgba(255, 255, 255, 0.15); color: rgba(255, 255, 255, 0.75); }
/* while a target is picked the phase bar and Next step aside on the pitch (the online timer stays) */
.midline:has(.target-bar:not([hidden])) .phase-bar, .midline:has(.target-bar:not([hidden])) #btn-next { display: none; }
/* the cards you can pick pulse */
body.targeting .card.selectable .rot, body.targeting .slot.selectable { animation: tb-target 1.1s ease-in-out infinite; }
body.targeting-attack #opp-field .card.selectable .rot { --tc: 255, 122, 69; }
.target-sheet { display: none; }
@container midline (max-width: 600px) {
  .target-bar { padding-left: 10px; gap: 6px; }
  .tb-text { font-size: 12.5px; }
  .tb-key { display: none; }
  .target-bar .btn { padding: 6px 11px; font-size: 13px; }
}
@container midline (max-width: 430px) { .tb-text .tb-msg { display: none; } }
/* phones (and touch tablets in portrait): the bottom sheet */
@media (max-width: 760px) {
  .midline .target-bar { display: none !important; }
  .midline:has(.target-bar:not([hidden])) .phase-bar, .midline:has(.target-bar:not([hidden])) #btn-next { display: flex; }
  .target-sheet:not([hidden]) {
    display: flex; flex-direction: column; align-items: stretch; gap: 10px; position: fixed; z-index: 45; left: 8px; right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px)); padding: 12px 12px 12px; border-radius: 20px; animation: tb-up 0.3s cubic-bezier(0.2, 1.3, 0.4, 1) both;
  }
  .target-sheet .tb-text { font-size: 15px; justify-content: center; text-align: center; }
  .target-sheet .tb-actions { display: flex; gap: 8px; }
  .target-sheet .btn { flex: 1; justify-content: center; min-height: 50px; font-size: 16px; }
  .target-sheet .tb-cancel { flex: 0 0 34%; }
  .target-sheet .tb-key { display: none; }
}
@media (hover: none) { .tb-key { display: none; } }
@keyframes tb-in { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes tb-up { from { transform: translateY(110%); } to { transform: translateY(0); } }
@keyframes tb-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 122, 69, 0.6); } 50% { box-shadow: 0 0 0 6px rgba(255, 122, 69, 0); } }
@keyframes tb-target { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.25) drop-shadow(0 0 10px rgba(var(--tc, 245, 197, 66), 0.9)); } }
@media (prefers-reduced-motion: reduce) { .target-bar, .tb-direct, body.targeting .card.selectable .rot, body.targeting .slot.selectable { animation: none !important; } }
@media (max-width: 760px) { .target-sheet .tb-cancel:only-child { flex: 1; } }

/* ---------- Support the game (2026-11-09): Stripe donation links, 💛 Supporter badge ---------- */
.support-btn { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 6px 12px; font-weight: 800; color: #3a2700;
  background: linear-gradient(135deg, #ffe08a, #f5b72e); border-color: #ffd36b; box-shadow: 0 0 14px rgba(245, 183, 46, 0.35); }
.support-btn i { font-style: normal; animation: sup-beat 2.4s ease-in-out infinite; }
.support-btn[hidden], #home-support-foot[hidden] { display: none; }
@media (max-width: 560px) { .support-btn span { display: none; } .support-btn { padding: 6px 9px; } }
.sup-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 0.82em; font-weight: 800; color: #ffd36b; white-space: nowrap; }
.acc-who .sup-badge { padding: 1px 8px; border-radius: 999px; background: rgba(245, 183, 46, 0.15); border: 1px solid rgba(245, 183, 46, 0.45); }
.modal.sup-modal { width: min(560px, 100%); }
.sup { display: grid; gap: 14px; text-align: center; }
.sup-hero h2, .sup-thanks h2 { margin: 6px 0 6px; font: 900 italic 30px/1.05 system-ui, sans-serif; text-transform: uppercase; }
.sup-hero p { margin: 0; color: var(--ink); line-height: 1.45; }
.sup-heart { display: inline-block; font-size: 42px; animation: sup-beat 1.6s ease-in-out infinite; }
.sup-heart.big { font-size: 64px; }
.sup-tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sup-tier { position: relative; display: grid; justify-items: center; gap: 4px; padding: 16px 8px 12px; border-radius: 16px; text-decoration: none; color: var(--ink);
  background: rgba(255, 255, 255, 0.06); border: 1.5px solid rgba(255, 255, 255, 0.16); transition: transform 0.15s, border-color 0.15s, background 0.15s; }
.sup-tier:hover, .sup-tier:focus-visible { transform: translateY(-3px); border-color: #ffd36b; background: rgba(245, 183, 46, 0.12); outline: none; }
.sup-tier.best { border-color: #ffd36b; background: linear-gradient(180deg, rgba(245, 183, 46, 0.2), rgba(245, 183, 46, 0.06)); box-shadow: 0 0 22px rgba(245, 183, 46, 0.25); }
.sup-pop { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); padding: 2px 10px; border-radius: 999px; font: 900 10px system-ui; letter-spacing: 0.08em; text-transform: uppercase; color: #3a2700; background: #ffd36b; white-space: nowrap; }
.sup-icon { font-size: 30px; }
.sup-tier b { font-size: 14px; }
.sup-price { font: 900 26px system-ui; color: #ffd36b; }
.sup-tier small { font-size: 11.5px; color: var(--muted); line-height: 1.25; }
.sup-custom { justify-self: center; padding: 10px 18px; border-radius: 999px; text-decoration: none; font-weight: 800; color: var(--ink); border: 1.5px dashed rgba(255, 255, 255, 0.35); }
.sup-custom:hover { border-color: #ffd36b; color: #ffd36b; }
.sup-paypal { justify-self: center; display: inline-flex; align-items: center; gap: 4px; padding: 10px 22px; border-radius: 999px; text-decoration: none; background: #ffc439; color: #111; font-weight: 700; }
.sup-paypal b { font-weight: 900; font-style: italic; color: #003087; font-size: 1.08em; }
.sup-paypal b.pp2 { color: #0070e0; margin-left: -4px; }
.sup-paypal:hover { filter: brightness(1.05); box-shadow: 0 0 0 2px #fff inset; }
.sup-note { margin: 0; font-size: 13.5px; color: var(--ink); }
.sup-note.ok { color: #ffd36b; font-weight: 700; }
.sup-signin { background: none; border: 0; padding: 0; color: #ffd36b; font: inherit; font-weight: 800; text-decoration: underline; cursor: pointer; }
.sup-safe { margin: 0; font-size: 11.5px; color: var(--muted); }
.ft-support { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; padding: 10px 12px; border-radius: 14px; font-size: 13.5px;
  background: rgba(245, 183, 46, 0.1); border: 1px solid rgba(245, 183, 46, 0.4); }
.ft-support .btn { border-radius: 999px; font-weight: 800; color: #3a2700; background: linear-gradient(135deg, #ffe08a, #f5b72e); border-color: #ffd36b; }
@media (max-width: 480px) { .sup-tiers { gap: 6px; } .sup-tier { padding: 14px 4px 10px; } .sup-price { font-size: 22px; } .sup-hero h2 { font-size: 24px; } }
@keyframes sup-beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.18); } 30% { transform: scale(1); } 45% { transform: scale(1.1); } }
@media (prefers-reduced-motion: reduce) { .sup-heart, .support-btn i { animation: none; } }
.cg .support-btn, .cg #home-support-foot, .cg .ft-support { display: none !important; }
.lb-place { margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; font-size: 13.5px; background: rgba(79, 168, 255, 0.12); border: 1px solid rgba(79, 168, 255, 0.4); }

/* ---------- The Captain's level (2026-11-09): Rookie / Pro / Legend ---------- */
.lvl-row { display: flex; align-items: center; gap: 8px; }
.lvl-pick { display: inline-flex; gap: 0; padding: 3px; border-radius: 999px; background: rgba(10, 18, 38, 0.8); border: 1px solid rgba(255, 255, 255, 0.14); }
.lvl-pick button { border: 0; background: none; color: var(--muted); font: 800 13px system-ui, sans-serif; padding: 6px 12px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.lvl-pick button:hover { color: var(--ink); }
.lvl-pick button[aria-checked="true"] { color: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35); }
.lvl-pick .lvl-rookie[aria-checked="true"] { background: linear-gradient(135deg, #3fbf7f, #1e8c5a); }
.lvl-pick .lvl-pro[aria-checked="true"] { background: linear-gradient(135deg, #f5c04a, #c8901a); color: #2a1c00; }
.lvl-pick .lvl-legend[aria-checked="true"] { background: linear-gradient(135deg, #ff6a4d, #c41f2f); box-shadow: 0 0 14px rgba(255, 90, 70, 0.45); }
.dc-rival-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.dc-level { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.lvl-chip { font-weight: 800; color: var(--ink); white-space: nowrap; }
@media (max-width: 480px) { .lvl-pick button { padding: 6px 9px; font-size: 12px; } }
/* Classic | Strategy next to the level (2026-11-26, main.js renderModeHome): Play goes straight to the pitch */
.home .fd-playbox .pb-opts { row-gap: 10px; }
.mode-pick { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(10, 18, 38, 0.8); border: 1px solid rgba(255, 255, 255, 0.14); }
.mode-pick button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--muted); font: 800 13px system-ui, sans-serif; padding: 5px 12px 5px 8px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.mode-pick button:hover { color: var(--ink); }
.mode-pick .mode-ico { width: 15px; height: 19px; flex: none; }
.mode-pick button[aria-checked="true"] { color: #fff; background: linear-gradient(135deg, #2f8f55, #1d6b3d); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35); }
.mode-pick .mode-classic[aria-checked="true"] { background: linear-gradient(135deg, #3d5bd1, #26389a); }
@media (max-width: 480px) { .mode-pick button { padding: 5px 9px 5px 6px; font-size: 12px; } }
/* phones: the Captain block (mode, level, Play) first in the play box, so Play is on the first screen (2026-11-26) */
@media (max-width: 760px) {
  .home .fd-playbox .pb-captain { order: -1; }
  .home .fd-playbox .pb-opts { justify-content: center; }
  .home .fd-logo-crest { width: 96px; margin: -10px auto -16px; }
  .home .fd-hero-text { gap: 12px; }
  .home .fd-hero-text .home-tag { order: 5; } /* the tagline under the play box: Play comes first */
  .home .fd-hero-text .fd-playbox { order: 4; }
}

/* ---------- portrait phones (2026-11-11): bigger, readable cards ----------
   The pitch rows drop their 6th column (deck and bench move to two chips on each player's bar), so the 5 places share
   the whole width. On cards this small, the faces keep what matters at a readable size: the name and ATK / DEF.
   The rest (position, club band, serial) is in the card's details. */
.pile-chips { display: none; }
@media (max-width: 760px) and (orientation: portrait) {
  :root { --cw-base: clamp(34px, min(calc((100vw - 30px) / 5.4), calc((100dvh - 400px) / 4.9)), 96px); }
  .zone-row { grid-template-columns: repeat(5, var(--slot-w)); }
  .zone-row > .slot.pile { display: none; }
  .duelist { max-width: none; }
  .pile-chips { display: flex; gap: 4px; flex: none; margin-left: auto; }
  .pile-chips + .lp { margin-left: 6px; min-width: 0; }
  .pchip {
    display: inline-flex; align-items: center; gap: 3px; min-height: 30px; padding: 0 7px; border-radius: 999px; cursor: pointer;
    font: 800 11px/1 system-ui, sans-serif; color: var(--ink); background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.2);
  }
  span.pchip { cursor: default; }
  .pchip b { font-weight: 900; font-size: 13px; }
  .duelist .d-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .duelist .opp-hand { display: none; }
  .pchip .pc-ico { font-size: 14px; opacity: 0.85; }
  .topbar .logo { white-space: nowrap; flex: none; }
  #you-hand { --cw: min(calc((100vw - 24px) / 5.1), 92px, 11.2dvh); --ch: calc(var(--cw) * 1.4); } /* 5 cards side by side, no overlap; a tap shows the card big */
}

/* Phones in either orientation: card faces keep the name and ATK / DEF readable (min 10 px), the rest is in Details. */
@media (max-width: 760px) and (orientation: portrait), (orientation: landscape) and (max-height: 560px) {
  .zone-row .card .c-serial, .zone-row .card .c-band, .zone-row .card .c-pos, #you-hand .card .c-serial { display: none; }
  .zone-row .card:not(.down) .c-head, #you-hand .card .c-head { font-size: max(9.5px, calc(var(--cw) * 0.15)); letter-spacing: -0.02em; }
  /* The original look, bigger (was 7.5px): as large as two 4-digit numbers fit on the card (they take about 5.6em with
     this spacing), so a 57px hand card reads at ~8.8px, a 64px pitch card at ~10px and a 69px one at ~11px. */
  .zone-row .card .c-stats, #you-hand .card .c-stats { font-size: clamp(8px, min(calc(var(--cw) * 0.17), calc((var(--cw) - 8px) / 5.6)), 14px); gap: 0.15em; letter-spacing: -0.04em; padding-inline: 1px; }
  .zone-row .card .c-stats > *, #you-hand .card .c-stats > * { min-width: 0; }
  #you-hand .card .c-band { font-size: max(7.5px, calc(var(--cw) * 0.09)); }
  #you-hand .card .c-stars, .zone-row .card .c-stars { font-size: max(8px, calc(var(--cw) * 0.12)); }
  .zone-row .card .c-type, #you-hand .card .c-type { font-size: max(7.5px, calc(var(--cw) * 0.11)); letter-spacing: 0.04em; }
}

/* ---------- landscape phones (2026-11-11): the height is what limits the cards ----------
   A slimmer top bar, compact player bars (no hand backs, chips for deck/bench/hand), thinner Skill/Referee rows and a
   bigger hand. fitBoard() then measures the biggest card size that still fits. */
@media (orientation: landscape) and (max-height: 560px) {
  .topbar { height: 34px; }
  .topbar .btn { padding: 3px 9px; min-height: 0; }
  .topbar .logo .logo-mark { width: 24px; height: 24px; }
  .zone-row { grid-template-columns: repeat(5, var(--slot-w)); }
  .zone-row > .slot.pile { display: none; }
  .pile-chips { display: flex; flex-wrap: wrap; gap: 4px; width: 100%; }
  .pchip {
    display: inline-flex; align-items: center; gap: 3px; min-height: 28px; padding: 0 8px; border-radius: 999px; cursor: pointer;
    font: 800 11px/1 system-ui, sans-serif; color: var(--ink); background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.2);
  }
  span.pchip { cursor: default; }
  .pchip b { font-weight: 900; font-size: 13px; }
  .duelist .opp-hand { display: none; }
  .duelist .d-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #opp-spells, #you-spells { --cw: calc(var(--cw-base) * 0.62); --ch: calc(var(--cw) * 1.4); }
  #you-hand { --cw: calc(var(--cw-base) * 1.3); --ch: calc(var(--cw) * 1.4); }
  /* compact player bars: name on the first line, then deck / bench / hand chips and the Fan Support on one line */
  .duelist { padding: 5px 8px; gap: 3px 6px; }
  .duelist .avatar { width: 26px; height: 26px; font-size: 10px; }
  .duelist .d-h2h { display: none; }
  .duelist > .avatar + div { flex: 1 1 calc(100% - 40px); min-width: 0; } /* the name gets its own line, chips + Fan Support below */
  .pile-chips { width: auto; flex: 1 1 auto; flex-wrap: nowrap; }
  .duelist .lp { width: auto; flex: 0 0 auto; margin-left: auto; min-width: 0; }
  .duelist .lp-value { font-size: 16px; line-height: 1.1; }
  .duelist .lp-bar { width: 64px; margin-left: auto; }
  .pchip { min-height: 26px; padding: 0 7px; }
  /* the rival's bar sits above the turn info on the right, so the left column only holds your bar and your hand */
  .board {
    grid-template-rows: auto auto auto 1fr auto;
    grid-template-areas:
      "you  pitch opp"
      "hand pitch tips"
      "hand pitch status"
      "hand pitch hint"
      "hand pitch plays";
  }
  #you-panel { align-self: start; }
  #you-hand { align-self: start; }
}

/* ---------- Lite mode (src/perf.js, 2026-11-11): html.lite on weak or slow devices, or from Settings ----------
   Decorative loops play once instead of forever, and the purely decorative layers are not drawn. */
html.lite *, html.lite *::before, html.lite *::after { animation-iteration-count: 1 !important; }
html.lite .pitch-lights, html.lite .ar-embers, html.lite .ar-torch, html.lite .ps-rain, html.lite .st-rain { display: none !important; }

/* ---------- phones: a tapped card opens big, actions under it (ui.js openMenu, 2026-11-11) ---------- */
.menu.sheet {
  inset: 0; left: 0; top: 0; min-width: 0; border-radius: 0; padding: 16px 16px max(16px, env(safe-area-inset-bottom));
  background: rgba(4, 8, 20, 0.78); color: var(--ink); box-shadow: none; gap: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; animation: sheet-in calc(0.15s * var(--dur)) ease-out;
}
.menu.sheet[hidden] { display: none; }
.menu.sheet .sheet-card { --cw: min(62vw, 34dvh, 250px); pointer-events: auto; animation: pop calc(0.2s * var(--dur)) ease-out; }
.menu.sheet .sheet-card .card { cursor: default; pointer-events: none; }
.menu.sheet .sheet-acts { width: min(360px, 100%); display: grid; gap: 8px; }
.menu.sheet .m-title { color: var(--muted); text-align: center; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.menu.sheet button {
  text-align: center; color: var(--ink); background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px; padding: 13px 14px; font: 800 16px system-ui, sans-serif; min-height: 50px;
}
.menu.sheet button[data-i]:first-of-type:not(:disabled) { background: linear-gradient(135deg, #ffe08a, #f5b72e); color: #2a1c00; border-color: #ffd36b; }
.menu.sheet button:hover:not(:disabled), .menu.sheet button:focus-visible { background: rgba(255, 255, 255, 0.18); outline: none; }
.menu.sheet button[data-i]:first-of-type:not(:disabled):focus-visible { background: linear-gradient(135deg, #fff0b8, #f5c04a); }
.menu.sheet button:disabled { opacity: 0.55; }
.menu.sheet button .why { color: #ffb3bb; font-weight: 600; font-size: 12px; }
.menu.sheet .sheet-close { background: none; border-color: transparent; color: var(--muted); min-height: 40px; font-size: 14px; }
@media (orientation: landscape) and (max-height: 560px) {
  .menu.sheet { flex-direction: row; gap: 20px; }
  .menu.sheet .sheet-card { --cw: min(30vw, 54dvh, 220px); }
  .menu.sheet .sheet-acts { width: min(320px, 46vw); }
}
@keyframes sheet-in { from { opacity: 0; } }

/* ---------- 2026-11-11 (2): sheet contrast, portrait full screen button, landscape rebuilt ---------- */
.menu.sheet { background: rgba(4, 8, 20, 0.94); }
.menu.sheet button { background: #1b2440; border-color: rgba(255, 255, 255, 0.22); }
.menu.sheet button:disabled { opacity: 0.6; }

/* portrait phones: the top bar keeps the badge only, so the full screen button fits next to Rules and Home */
@media (max-width: 760px) and (orientation: portrait) {
  .topbar .logo { font-size: 0; gap: 0; }
  .topbar .logo .logo-mark { width: 30px; height: 30px; }
  .topbar #btn-fullscreen { display: inline-flex; }
  .top-actions { gap: 4px; }
  .top-actions .btn { padding: 5px 8px; }
}

/* landscape phones: one left column (top bar icons, the Captain's bar, your bar, the turn info and your whole hand),
   the pitch takes everything else, full height. */
@media (orientation: landscape) and (max-height: 560px) {
  :root { --lcol: clamp(230px, 34vw, 320px); }
  .topbar {
    position: fixed; left: 0; top: 0; z-index: 30; width: var(--lcol); height: 36px; padding: 2px 6px;
    border-bottom: 0; background: transparent;
  }
  .topbar .logo { font-size: 0; gap: 0; }
  .topbar .logo .logo-mark { width: 26px; height: 26px; }
  .top-actions { gap: 3px; }
  .top-actions .btn { padding: 3px 7px; font-size: 13px; }
  .top-actions .btn .hide-sm { display: none; }
  .layout { padding: 0 6px 0 0; }
  .board {
    height: calc(100dvh - 8px); column-gap: 8px; row-gap: 4px; align-items: stretch; justify-content: stretch;
    grid-template-columns: var(--lcol) minmax(0, 1fr);
    grid-template-rows: 36px auto auto auto auto minmax(0, 1fr) auto;
    grid-template-areas:
      ".      pitch"
      "opp    pitch"
      "you    pitch"
      "tips   pitch"
      "status pitch"
      "hand   pitch"
      "plays  pitch";
  }
  #opp-panel, #you-panel { align-self: start; margin: 0; padding-left: 6px; }
  #opp-panel { margin-left: 6px; } #you-panel { margin-left: 6px; }
  .pitch { align-self: stretch; height: auto; margin: 4px 0; }
  .pitch .half { align-items: center; }
  .pitch .zone-row { justify-content: center; margin-inline: auto; }
  #hint { display: none; }
  .tips-toggle { grid-area: tips; margin-left: 6px; padding: 2px 10px; font-size: 11px; }
  #turn-status { margin-left: 6px; }
  #plays { display: none !important; } /* the hint boxes squeezed the hand; the turn line and the cards' own glow say the same */
  #turn-status { padding: 3px 8px; font-size: 11.5px; }
  #turn-status .ts-help { display: none; }
  /* the whole hand stays visible: cards wrap onto rows inside the left column instead of overlapping */
  #you-hand {
    align-self: stretch; margin-left: 6px; width: auto; max-width: none; min-height: 0; padding: 2px 0 6px;
    display: flex; flex-wrap: wrap; align-content: flex-start; justify-content: flex-start; gap: 4px;
    overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
    --cw: min(calc((var(--lcol) - 26px) / 3), 96px); --ch: calc(var(--cw) * 1.4);
  }
  #you-hand.scrolls { overflow-x: hidden; padding-top: 2px; }
  #you-hand .card { margin-left: 0 !important; }
  /* the rival's and your bars on one line each */
  .duelist { flex-wrap: nowrap; }
  .duelist > .avatar + div { flex: 1 1 auto; }
  .duelist .lp-bar { display: none; }
  .duelist .vault-badge { display: none; }
}

/* ---------- landscape phones, v3 (2026-11-11): no top bar, the screen is the game ----------
   left: ⚙ menu, the Captain's bar, the turn line, your bar · middle: the pitch, full height · right: your hand, big,
   two cards per row. The top bar's buttons live in the ⚙ menu (main.js GAME_MENU). */
.game-menu-btn { display: none; }
.gm-list { display: grid; gap: 6px; }
.gm-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 46px; padding: 10px 14px;
  border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.16); background: rgba(255, 255, 255, 0.06); color: var(--ink);
  font: 800 15px system-ui, sans-serif; text-align: left; cursor: pointer;
}
.gm-item:hover, .gm-item:focus-visible { background: rgba(255, 255, 255, 0.12); outline: none; }
.gm-modal .gm-list { grid-template-columns: 1fr 1fr; }
@media (max-width: 420px) { .gm-modal .gm-list { grid-template-columns: 1fr; } }
@media (orientation: landscape) and (max-height: 560px) {
  :root { --lcol: clamp(170px, 24vw, 230px); --rcol: clamp(170px, 26vw, 250px); }
  .topbar { display: none !important; }
  .game-menu-btn {
    display: grid; place-items: center; position: fixed; left: 8px; top: 6px; z-index: 31; width: 38px; height: 38px; border-radius: 50%;
    font-size: 19px; color: var(--ink); background: rgba(10, 18, 38, 0.9); border: 1px solid rgba(255, 255, 255, 0.25); cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  }
  body:has(#home:not([hidden])) .game-menu-btn { display: none; }
  .layout { padding: 0 6px; }
  .board {
    height: calc(100dvh - 14px); margin-top: 3px; column-gap: 8px; row-gap: 6px;
    grid-template-columns: var(--lcol) minmax(0, 1fr) var(--rcol);
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
    grid-template-areas:
      "opp    pitch hand"
      "tips   pitch hand"
      "status pitch hand"
      ".      pitch hand"
      "you    pitch hand";
  }
  #opp-panel { grid-area: opp; margin: 44px 0 0; align-self: start; }
  #you-panel { grid-area: you; margin: 0; align-self: end; }
  .tips-toggle { margin-left: 0; }
  #turn-status { margin-left: 0; }
  .pitch { margin: 0; }
  /* bars: name on top, chips + Fan Support below (the column is narrow) */
  .duelist { flex-wrap: wrap; }
  .duelist > .avatar + div { flex: 1 1 calc(100% - 36px); }
  .pile-chips { flex: 1 1 auto; }
  .pchip { padding: 0 6px; min-height: 24px; }
  .duelist .lp-value { font-size: 15px; }
  /* your hand: right column, two big cards per row, scrolls if it ever gets long */
  #you-hand {
    grid-area: hand; margin: 0; align-self: stretch; display: grid; grid-template-columns: repeat(2, max-content);
    justify-content: center; align-content: start; gap: 6px; overflow-y: auto; padding: 2px 0 8px;
    --cw: min(calc((var(--rcol) - 14px) / 2), 112px); --ch: calc(var(--cw) * 1.4);
  }
}

/* landscape phones with a big hand (7+ cards): 3 per row, so up to 10 cards fit without scrolling */
@media (orientation: landscape) and (max-height: 560px) {
  #you-hand[data-many] { grid-template-columns: repeat(3, max-content); gap: 4px; --cw: min(calc((var(--rcol) - 12px) / 3), calc((100dvh - 34px) / 5.6), 112px); }
}
/* portrait phones: a hand that scrolls sideways shows it (soft edge on the right) */
@media (max-width: 760px) and (orientation: portrait) {
  #you-hand.scrolls { -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); padding-right: 24px; }
}

/* ---------- landscape phones, v4 (2026-11-11): the layout of the pro card games, in Football Duel's style ----------
   left: ⚙, the turn line, your score at the bottom; the selected card opens big in this column (ui.js openMenu)
   middle: the pitch, full height, deck + bench piles beside its rows, your hand peeking up from the bottom edge
   right: the rival's score */
@media (orientation: landscape) and (max-height: 560px) {
  :root { --lcol: clamp(190px, 27vw, 260px); --rcol: clamp(130px, 17vw, 180px); --hand-cw: clamp(56px, calc(var(--cw-base) * 1.25), 86px); }
  .board {
    grid-template-columns: var(--lcol) minmax(0, 1fr) var(--rcol);
    grid-template-rows: 44px auto minmax(0, 1fr) auto;
    grid-template-areas:
      ".      pitch opp"
      "status pitch ."
      ".      pitch ."
      "you    pitch .";
  }
  .tips-toggle, #hint, #plays { display: none !important; }
  #turn-status { grid-area: status; display: block !important; }
  /* score badges: avatar + name on a line, the big Fan Support number and its bar below */
  #opp-panel { grid-area: opp; margin: 0; align-self: start; }
  #you-panel { grid-area: you; margin: 0; align-self: end; }
  .duelist { flex-wrap: wrap; padding: 8px 10px; gap: 4px 8px; }
  .duelist > .avatar + div { flex: 1 1 calc(100% - 40px); }
  .duelist .lp { width: 100%; text-align: left; margin: 0; }
  .duelist .lp-value { font-size: 26px; }
  .duelist .lp-bar { display: block; width: 100%; }
  .pile-chips { display: flex; width: auto; flex: 0 0 auto; }
  .pile-chips .deck-chip, .pile-chips .bench-chip { display: none; } /* the piles are on the pitch now */
  /* deck and bench piles: beside the pitch rows, out of the grid so the 5 places stay centred */
  .zone-row > .slot.pile {
    display: grid !important; position: absolute; top: 0; left: calc(100% + var(--gap) * 2);
    width: calc(var(--slot-w) * 0.82); height: var(--ch);
  }
  #opp-spells > .slot.pile, #you-spells > .slot.pile { height: var(--ch); }
  /* your hand: bottom centre of the pitch, the top half showing; a tap opens the card in the left column */
  .pitch { padding-bottom: calc(var(--hand-cw) * 0.78); }
  #you-hand {
    grid-area: pitch; align-self: end; justify-self: stretch; z-index: 6; margin: 0 8px; width: auto; max-width: none;
    display: flex; flex-wrap: nowrap; align-content: normal; justify-content: center; align-items: flex-start; gap: 0; overflow: hidden; padding: 4px 0 0;
    --cw: var(--hand-cw); --ch: calc(var(--cw) * 1.4); min-height: 0; height: calc(var(--hand-cw) * 0.8);
  }
  #you-hand[data-many] { display: flex; gap: 0; --cw: var(--hand-cw); }
  #you-hand .card { margin-left: calc(var(--cw) * var(--overlap, 0) * -1) !important; transform: translateY(0); transition: transform 0.15s; }
  #you-hand .card:first-child { margin-left: 0 !important; }
  #you-hand.scrolls { overflow: hidden; }
  /* the selected card: big in the left column, its actions under it; the pitch stays visible */
  .menu.sheet {
    inset: auto; left: 6px; top: 50px; bottom: 6px; width: var(--lcol); flex-direction: column; justify-content: flex-start; gap: 8px;
    padding: 10px; border-radius: 16px; background: rgba(8, 14, 32, 0.97); border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  }
  .menu.sheet .sheet-card { --cw: min(calc(var(--lcol) - 90px), 31dvh, 150px); }
  .menu.sheet .sheet-acts { width: 100%; gap: 6px; }
  .menu.sheet .m-title { display: none; }
  .menu.sheet button { min-height: 38px; padding: 7px 10px; font-size: 14px; border-radius: 11px; }
  .menu.sheet .sheet-close { min-height: 30px; font-size: 13px; }
}
@media (orientation: landscape) and (max-height: 560px) {
  /* turn info as a tidy card: who, then turn · phase, then the chips one per line */
  #turn-status {
    display: flex !important; flex-wrap: wrap; align-items: center; gap: 4px 6px; text-align: left; padding: 8px 10px; font-size: 12px; line-height: 1.25;
    border-radius: 14px;
  }
  #turn-status .ts-who { flex: 1 1 100%; font-size: 13px; }
  #turn-status .ts-phase, #turn-status > span { white-space: nowrap; }
  #turn-status > span:not(.ts-who):not(.ts-sep):not(.ts-phase):not(.ts-help) { flex: 0 0 auto; }
  /* a bench pile shows its top card at the pile's size */
  .zone-row > .slot.pile .card { --cw: calc(var(--slot-w) * 0.74); --ch: calc(var(--cw) * 1.4); }
  .zone-row > .slot.pile { overflow: hidden; }
  /* the hand shows its top 60%: name, stars and most of the art */
  .pitch { padding-bottom: calc(var(--hand-cw) * 0.62); }
  #you-hand { height: calc(var(--hand-cw) * 0.84); }
}
@media (orientation: landscape) and (max-height: 560px) {
  /* the phase bar and Next / target buttons move to the right column (under the rival's score): the pitch rows get that height */
  .midline {
    position: fixed; right: 6px; top: 50%; transform: translateY(-50%); z-index: 20; width: var(--rcol); height: auto; margin: 0;
    flex-direction: column; align-items: stretch; gap: 8px;
  }
  .midline::before { display: none; }
  .midline .phase-bar { align-self: center; }
  .midline #btn-next { width: 100%; justify-content: center; }
  .midline .target-bar { position: static; width: 100%; }
  .zone-row > .slot.pile { left: calc(100% + var(--gap)); }
}
@media (orientation: landscape) and (max-height: 560px) {
  /* right column phase controls: only the current phase shows, and the Next button keeps its label */
  .midline .phase:not(.on), .midline .phase-link { display: none !important; }
  .midline .phase.on .ph-long { display: inline !important; }
  .midline .next-btn .nb-label { display: inline !important; }
  .midline #btn-next { font-size: 14px; padding: 9px 10px; white-space: nowrap; }
  /* rows + the piles beside them, centred together; the two halves share the pitch height */
  .pitch .zone-row { transform: translateX(calc((var(--slot-w) * 0.82 + var(--gap)) / -2)); }
  .pitch { justify-content: space-evenly; }
  .pitch .half { flex: 1 1 0; justify-content: space-evenly; }
}
@media (orientation: landscape) and (max-height: 560px) {
  .zone-row > .slot.pile .pile-count { top: 2px; bottom: auto; left: auto; right: 2px; padding: 0 5px; border-radius: 999px; background: rgba(6, 10, 24, 0.85); font-size: 11px; line-height: 16px; }
}
@media (orientation: landscape) and (max-height: 560px) {
  .menu.sheet .sheet-card .card.big { --cw: min(calc(var(--lcol) - 100px), calc((100dvh - 230px) / 1.4), 150px); }
  .zone-row > .slot.pile .pile-label { display: none; }
}
/* portrait phones: the tapped card is sized by the sheet, not by the generic .big size */
@media (max-width: 760px) and (orientation: portrait) {
  .menu.sheet .sheet-card .card.big { --cw: min(62vw, 34dvh, 250px); }
}
@media (orientation: landscape) and (max-height: 560px) {
  .menu.sheet { overflow-y: auto; overscroll-behavior: contain; }
  .menu.sheet button { min-height: 34px; padding: 6px 10px; }
}
@media (orientation: landscape) and (max-height: 560px) {
  #you-hand.scrolls { justify-content: flex-start; }
}

/* ---------- landscape phones, v6 (2026-11-12): like the console card games ----------
   left: the selected card big + its actions (ui.js openMenu), the turn info, your score at the bottom
   middle: the whole pitch (deck and bench back in their own column, nothing cut), your full hand under it
   right: the rival's score, the phase + Next button */
@media (orientation: landscape) and (max-height: 560px) {
  :root { --lcol: clamp(200px, 29vw, 280px); --rcol: clamp(130px, 17vw, 180px); --hand-cw: clamp(48px, calc((100dvh - 30px) / 6.2), 76px); }
  .board {
    grid-template-columns: var(--lcol) minmax(0, 1fr) var(--rcol);
    grid-template-rows: 44px auto minmax(0, 1fr) auto;
    grid-template-areas:
      ".      pitch opp"
      "status pitch ."
      ".      pitch ."
      "you    hand  .";
  }
  /* the pitch rows: 6 columns again (5 places + deck / bench), so the piles are whole */
  .zone-row { grid-template-columns: repeat(6, var(--slot-w)); transform: none !important; }
  .zone-row > .slot.pile { display: grid !important; position: relative; left: auto; top: auto; width: var(--slot-w); height: var(--ch); overflow: visible; }
  .zone-row > .slot.pile .card { --cw: calc(var(--slot-w) * 0.92); --ch: calc(var(--cw) * 1.4); }
  .zone-row > .slot.pile .pile-label { display: none; }
  .pitch { padding-bottom: 6px; }
  /* your hand: under the pitch, every card whole; a tap opens it big on the left */
  #you-hand {
    grid-area: hand; align-self: end; justify-self: stretch; height: auto; min-height: calc(var(--hand-cw) * 1.4 + 6px);
    overflow: hidden; padding: 4px 0 2px; margin: 0;
  }
  #you-hand.scrolls { overflow-x: auto; overflow-y: hidden; }
  /* the selected card: in the left column, above your score, card on the left and its actions beside it */
  .menu.sheet {
    left: 6px; top: 50px; bottom: auto; width: var(--lcol); max-height: calc(100dvh - 170px);
    flex-direction: row; align-items: flex-start; justify-content: flex-start; gap: 8px; padding: 8px;
  }
  .menu.sheet .sheet-card .card.big { --cw: min(calc(var(--lcol) * 0.44), calc((100dvh - 200px) / 1.4), 120px); }
  .menu.sheet .sheet-acts { flex: 1; min-width: 0; }
  .menu.sheet button { min-height: 32px; padding: 5px 8px; font-size: 13px; }
  .menu.sheet button .why { font-size: 11px; }
}
@media (orientation: landscape) and (max-height: 560px) {
  .zone-row > .slot.pile { overflow: hidden; }
  .zone-row > .slot.pile .card { --cw: min(calc(var(--slot-w) * 0.92), calc(var(--ch) / 1.4 * 0.94)); --ch: calc(var(--cw) * 1.4); }
}
@media (orientation: landscape) and (max-height: 560px) {
  .zone-row > .slot.pile { --pile-h: var(--ch); --pile-w: var(--slot-w); }
  .zone-row > .slot.pile .card { --cw: min(calc(var(--pile-w) * 0.9), calc(var(--pile-h) / 1.4 * 0.92)); --ch: calc(var(--cw) * 1.4); }
}
@media (orientation: landscape) and (max-height: 560px) {
  :root { --lcol: clamp(156px, 27vw, 280px); --rcol: clamp(116px, 17vw, 180px); }
  .zone-row .card .c-stats { font-size: clamp(8px, min(calc(var(--cw) * 0.17), calc((var(--cw) - 8px) / 5.6)), 13px); }
}
@media (orientation: landscape) and (max-height: 560px) and (max-width: 700px) {
  .duelist .lp-value { font-size: 22px; }
  #turn-status { font-size: 11px; padding: 6px 8px; }
  .midline #btn-next { font-size: 12px; }
}
@media (orientation: landscape) and (max-height: 560px) {
  .zone-row .card .c-stats { gap: 0.35em; padding: 0 1px; letter-spacing: -0.05em; }
}

/* phones: the rows are close together, so the Nationality flags stand BEHIND the cards (they never hide ATK / DEF) */
@media (max-width: 760px) and (orientation: portrait), (orientation: landscape) and (max-height: 560px) {
  .pitch .nt-flags { z-index: 0; }
  .pitch .half { z-index: 1; }
  .nt-flag { width: clamp(10px, calc(var(--cw) * 0.24), 16px); }
}
@media (orientation: landscape) and (max-height: 560px) {
  .pitch { padding-top: 10px; padding-bottom: 16px; } /* room for the ribbons under the bottom row's cards */
}

/* the Landscape button: only on touch screens (phones, tablets) */
.rotate-btn { display: none; }
@media (pointer: coarse) { .topbar .rotate-btn { display: inline-flex; align-items: center; gap: 1px; } }
.rotate-btn span { font-size: 0.8em; }
.tchip.warn { background: rgba(255, 170, 60, 0.18); color: #ffc46b; border: 1px solid rgba(255, 170, 60, 0.5); }

/* ---------- whose turn (2026-11-13): the big call at the start of a turn, and the rival-turn state ---------- */
.turn-call { position: fixed; inset: 0; z-index: 70; pointer-events: none; display: grid; place-items: center; }
.turn-call .tc-flash { position: absolute; inset: 0; }
.turn-call.mine .tc-flash { background: radial-gradient(ellipse at center, rgba(245, 197, 66, 0.28), rgba(4, 8, 20, 0.55) 70%); }
.turn-call.rival .tc-flash { background: radial-gradient(ellipse at center, rgba(255, 70, 85, 0.3), rgba(4, 8, 20, 0.6) 70%); }
.turn-call.watch .tc-flash { background: rgba(4, 8, 20, 0.45); }
.turn-call .tc-band {
  position: relative; width: 100%; padding: clamp(10px, 2.4vh, 22px) 12px; text-align: center; transform-origin: center;
  display: grid; justify-items: center; gap: 2px;
}
.turn-call.mine .tc-band { background: linear-gradient(90deg, transparent, rgba(12, 60, 32, 0.92) 18%, rgba(14, 82, 42, 0.95) 50%, rgba(12, 60, 32, 0.92) 82%, transparent); border-block: 2px solid rgba(255, 214, 102, 0.85); }
.turn-call.rival .tc-band { background: linear-gradient(90deg, transparent, rgba(90, 10, 22, 0.92) 18%, rgba(122, 14, 30, 0.95) 50%, rgba(90, 10, 22, 0.92) 82%, transparent); border-block: 2px solid rgba(255, 110, 120, 0.85); }
.turn-call.watch .tc-band { background: linear-gradient(90deg, transparent, rgba(10, 18, 38, 0.92) 20%, rgba(10, 18, 38, 0.92) 80%, transparent); }
.turn-call b {
  display: block; font: 900 clamp(34px, 9vw, 86px)/1 system-ui, sans-serif; letter-spacing: 0.04em; text-transform: uppercase;
  color: #fff; text-shadow: 0 4px 0 rgba(0, 0, 0, 0.45);
}
.turn-call.mine b { color: #ffe08a; text-shadow: 0 4px 0 rgba(0, 0, 0, 0.45), 0 0 34px rgba(245, 197, 66, 0.85); }
.turn-call.rival b { color: #ffd1d5; text-shadow: 0 4px 0 rgba(0, 0, 0, 0.45), 0 0 34px rgba(255, 70, 85, 0.8); }
.turn-call small { font: 900 clamp(11px, 2.6vw, 16px)/1 system-ui, sans-serif; letter-spacing: 0.3em; text-transform: uppercase; color: rgba(255, 255, 255, 0.75); }
.turn-call em { font: 800 clamp(12px, 2.8vw, 18px)/1.2 system-ui, sans-serif; font-style: normal; color: rgba(255, 255, 255, 0.85); }
@media (orientation: landscape) and (max-height: 560px) { .turn-call b { font-size: clamp(30px, 7vw, 64px); } }

/* the rival's turn: your hand rests, and the pitch says who is playing */
body.rival-turn #you-hand .card { filter: saturate(0.55) brightness(0.75); transition: filter 0.3s; }
body.rival-turn #you-panel { opacity: 0.8; }
body.rival-turn #opp-panel { box-shadow: 0 0 0 2px rgba(255, 90, 100, 0.85), 0 0 22px rgba(255, 70, 85, 0.45); }
.rival-playing {
  position: absolute; left: 50%; top: 8px; transform: translateX(-50%); z-index: 15; pointer-events: none;
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; white-space: nowrap;
  font: 900 clamp(12px, 1.6vw, 15px)/1 system-ui, sans-serif; letter-spacing: 0.02em; color: #ffe2e5;
  background: rgba(120, 12, 28, 0.88); border: 1.5px solid rgba(255, 120, 130, 0.9); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}
.rival-playing i { width: 9px; height: 9px; border-radius: 50%; background: #ff5d6c; box-shadow: 0 0 0 0 rgba(255, 93, 108, 0.7); animation: rp-pulse 1.2s ease-out infinite; }
@keyframes rp-pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 93, 108, 0.7); } 100% { box-shadow: 0 0 0 10px rgba(255, 93, 108, 0); } }
@media (prefers-reduced-motion: reduce) { .rival-playing i { animation: none; } }
html.lite .rival-playing i { animation-iteration-count: infinite !important; } /* tiny and important: keeps pulsing in Lite mode */

/* phones: the way back to full screen after leaving the browser (src/phone.js) */
.fs-back {
  position: fixed; left: 50%; bottom: max(10px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60;
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 999px; cursor: pointer;
  font: 800 14px/1 system-ui, sans-serif; color: #1a1400; background: linear-gradient(135deg, #ffe08a, #f5b72e);
  border: 1px solid #ffd36b; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); animation: sheet-in 0.2s ease-out;
}
@media (orientation: landscape) and (max-height: 560px) { .fs-back { left: auto; right: 10px; bottom: 10px; transform: none; } }
/* Strategy (portrait phones): the hand fills the bottom, so the button sits at the top, over the rival's panel */
body.st-match .fs-back { bottom: auto; top: max(6px, env(safe-area-inset-top)); padding: 7px 14px; font-size: 13px; }
.next-btn.nb-bench { background: linear-gradient(135deg, #ffb35c, #e0791a) !important; color: #2a1400 !important; border-color: #ffc47a !important; }

/* milestone match popup (main.js milestoneGift) */
.ms-pop { text-align: center; display: grid; gap: 8px; justify-items: center; }
.ms-pop h2 { margin: 0; font-size: clamp(30px, 8vw, 46px); color: #ffd666; text-shadow: 0 0 24px rgba(255, 200, 80, 0.6); }
.ms-badge { font-size: 54px; line-height: 1; animation: ms-pop 0.6s cubic-bezier(.2,1.6,.4,1); }
.ms-pop p { margin: 0; }
.ms-card { --cw: min(150px, 38vw); margin: 4px 0; }
.ms-name { font-size: 16px; }
.ms-gift { padding: 10px 12px; border-radius: 12px; background: rgba(255, 214, 102, 0.12); border: 1px solid rgba(255, 214, 102, 0.45); }
.ms-ig { font-size: 13px; color: var(--muted); }
@keyframes ms-pop { from { transform: scale(0.2) rotate(-20deg); opacity: 0; } }

/* phone-only image copies (<picture><source media>): the wrapper takes no part in the layout, every page looks as before */
picture { display: contents; }

/* ---------- icons (src/iconify.js, 2026-11-14): every emoji in the game's texts is shown as a Tabler icon ---------- */
.ico { display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -0.2em; color: var(--ic, currentColor); line-height: 0; flex: none; }
.ico svg { width: 100%; height: 100%; display: block; overflow: visible; }
.ico-t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); font-size: 0; white-space: nowrap; }
/* on bright buttons and chips the icon takes the text colour (a gold icon on a gold button would vanish) */
.btn.primary .ico, .support-btn .ico, .next-btn .ico, .fs-back .ico, .tchip .ico, .pill .ico, .sup-pop .ico, .d-you .ico, .vault-badge .ico, .lvl-pick button[aria-checked="true"] .ico, .rival-playing .ico, .phase .ico { --ic: currentColor !important; }

/* home: road to the milestone match (main.js refreshRoad) */
.fd-road { margin: 4px 0 2px; padding: 12px 14px; border-radius: 16px; max-width: 520px; text-align: left;
  background: linear-gradient(135deg, rgba(245, 197, 66, 0.16), rgba(123, 108, 255, 0.12)); border: 1px solid rgba(245, 197, 66, 0.5); }
.rd-top { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.rd-eyebrow { flex: 1 1 100%; font: 900 12px/1 system-ui, sans-serif; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
.rd-count { font: 900 clamp(30px, 7vw, 40px)/1 system-ui, sans-serif; font-variant-numeric: tabular-nums; color: #fff; text-shadow: 0 0 18px rgba(245, 197, 66, 0.55); }
.rd-count.tick { animation: rd-tick 0.6s ease-out; }
.rd-of { font-size: 13px; color: var(--muted); }
.rd-bar { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); overflow: hidden; margin: 8px 0; }
.rd-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #f5b72e, #ffe08a); transition: width 0.8s ease; }
.rd-text { margin: 0; font-size: 13.5px; color: var(--ink); }
@keyframes rd-tick { 0% { transform: scale(1.35); color: var(--gold); } 100% { transform: none; } }
@media (max-width: 760px) { .fd-road { text-align: center; margin-inline: auto; } .rd-top { justify-content: center; } }
/* phones: the road banner sits above Play, compact; the long tagline makes room for it */
@media (max-width: 760px) {
  .fd-road { padding: 10px 12px; margin: 0 auto 10px; }
  .rd-count { font-size: 30px; }
  .rd-text { font-size: 13px; }
  .home:has(.fd-road:not([hidden])) .home-tag { display: none; }
}
.lb-new { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 999px; font: 800 10px/16px system-ui, sans-serif; letter-spacing: 0.04em; text-transform: uppercase; color: #9fe3ff; background: rgba(92, 200, 255, 0.15); border: 1px solid rgba(92, 200, 255, 0.4); vertical-align: 1px; }


/* Country flag next to a player's name (src/flag.js) */
img.flag { display: inline-block; width: 1.15em; height: auto; aspect-ratio: 4 / 3; vertical-align: -0.12em; margin-right: 0.35em; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25); object-fit: cover; }

/* Home: congratulations for the last milestone match (main.js refreshRoad) */
.rd-cg { display: flex; align-items: center; gap: 14px; }
.rd-cg-art { flex: 0 0 auto; width: 64px; height: 64px; border-radius: 12px; object-fit: cover; border: 2px solid rgba(245, 197, 66, 0.7); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); }
.rd-congrats .rd-eyebrow { display: block; margin-bottom: 6px; }
.rd-congrats .rd-text { font-size: 15px; line-height: 1.4; }
.rd-next { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
@media (max-width: 760px) { .rd-cg { text-align: left; } .rd-cg-art { width: 54px; height: 54px; } }

/* Home: rare cards and the weekly challenge (home.js renderRare) */
.fd-rare { border-color: rgba(255, 210, 90, 0.45); }
.fd-rare .fd-ph { background: linear-gradient(90deg, rgba(245, 197, 66, 0.3), rgba(123, 108, 255, 0.1) 60%, transparent); }
.rr-body { grid-template-columns: 190px minmax(0, 1fr); align-items: start; gap: 22px; }
.rr-card > * { width: 100%; margin: 0; }
.fd-pbody.rr-body:has(.rr-two) { grid-template-columns: 330px minmax(0, 1fr); }
.rr-card.rr-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } /* two rare cards won together */
.rr-info { display: grid; gap: 10px; }
.rr-lead { margin: 0; font-size: 17px; line-height: 1.4; color: #fff; }
.rr-sub, .rr-me { margin: 0; font-size: 13.5px; color: #bfb1e3; }
.rr-list li.in { background: linear-gradient(90deg, rgba(245, 197, 66, 0.24), rgba(0, 0, 0, 0.2)); }
.rr-list li:first-child:not(.in) { background: rgba(0, 0, 0, 0.22); }
.rr-list b small { font-size: 11px; font-weight: 700; color: #bfb1e3; }
.rr-play { justify-self: start; }
.rr-past { margin: 2px 0 0; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.1); font-size: 13.5px; color: #bfb1e3; }
.rr-past b { color: #fff; }
.rr-past small { color: #bfb1e3; }
@media (max-width: 760px) {
  .rr-body, .fd-pbody.rr-body:has(.rr-two) { grid-template-columns: 1fr; justify-items: center; } /* two cards too (the :has rule kept 2 columns and pushed the text off the phone, 2026-11-25) */
  .rr-card .c-stats { gap: 0.3em; font-size: 20px; letter-spacing: -0.02em; } .rr-card .c-stats > span + span { border-left: 1px solid rgba(255, 255, 255, 0.35); padding-left: 0.25em; }
  .rr-card { width: 160px; }
  .rr-card.rr-two { width: min(320px, 100%); }
  .rr-info { width: 100%; }
  .rr-play { justify-self: stretch; }
}

/* Home: deck sharing (src/deckshare.js) */
.ds-body.solo { grid-template-columns: 1fr; }
.ds-body { grid-template-columns: minmax(0, 300px) minmax(0, 1fr); align-items: start; gap: 22px; }
.ds-top { display: grid; gap: 8px; padding: 14px; border-radius: 14px; background: linear-gradient(160deg, rgba(245, 197, 66, 0.18), rgba(0, 0, 0, 0.25)); border: 1px solid rgba(245, 197, 66, 0.4); }
.ds-eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--gold); }
.ds-row, .ds-list li { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ds-row .lb-av, .ds-list .lb-av { flex: 0 0 auto; width: 32px; height: 32px; }
.ds-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-rating { margin-left: auto; font-weight: 800; color: var(--gold); }
.ds-deck, .ds-what { font-size: 13px; color: var(--muted); }
.ds-strip { display: flex; gap: 4px; overflow: hidden; --cw: 42px; }
.ds-strip .card { margin: 0; pointer-events: none; }
.ds-btns { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.ds-top .ds-btns { margin-left: 0; }
.ds-mine { display: grid; gap: 8px; min-width: 0; }
.ds-h { margin: 6px 0 0; font-size: 14px; }
.ds-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ds-list li { flex-wrap: wrap; padding: 8px 10px; border-radius: 10px; background: rgba(0, 0, 0, 0.22); }
.ds-list li .btn { padding: 6px 10px; font-size: 13px; }
.ds-list li > .btn, .ds-list li > .ds-st { margin-left: auto; }
.ds-req { border: 1px solid rgba(245, 197, 66, 0.45); }
.ds-st { font-size: 12.5px; font-weight: 700; }
.ds-st.wait { color: var(--muted); } .ds-st.ok { color: #46e08a; } .ds-st.no { color: #ff8a95; }
.ds-hint { margin: 0; font-size: 13.5px; color: var(--muted); }
.ds-opt { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.ds-modal { max-width: min(760px, 94vw); }
.ds-view h3 { margin: 0 0 6px; } .ds-view h3 small { display: block; font-size: 13px; font-weight: 600; color: var(--muted); }
.ds-warn { color: #ffcf6e; margin: 4px 0 10px; } .ds-ok { color: #46e08a; margin: 4px 0 10px; } .ds-sub { color: var(--muted); margin: 6px 0; }
.ds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px 8px; max-height: 58vh; overflow-y: auto; padding: 2px; --cw: 90px; justify-items: center; }
.ds-cell { position: relative; }
.ds-cell .card { margin: 0; }
.ds-cell.locked .card { filter: grayscale(.85) brightness(.6); }
.ds-k { position: absolute; right: 4px; top: 4px; background: rgba(0, 0, 0, 0.8); color: #fff; font-weight: 800; font-size: 12px; padding: 1px 6px; border-radius: 8px; }
.ds-lock { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 26px; }
.ds-need { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 50vh; overflow-y: auto; }
.ds-need li { display: flex; gap: 12px; align-items: center; }
.ds-need-card { flex: 0 0 64px; } .ds-need-card .card { --cw: 64px; margin: 0; }
.ds-need span { display: block; font-size: 13px; color: var(--muted); }
@media (max-width: 760px) {
  .ds-body { grid-template-columns: 1fr; }
  .ds-list li > .btn, .ds-list li > .ds-st, .ds-btns { margin-left: 0; }
  .ds-grid { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); --cw: 72px; }
}

/* Home footer: our Instagram page */
.home-ig { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: #fff; border-color: transparent;
  background: linear-gradient(45deg, #f9ce34, #ee2a7b 45%, #6228d7); }
.home-ig:hover:not(:disabled) { border-color: #fff; filter: brightness(1.08); }
.home-ig b { font-weight: 800; }

/* First visit: "Pick your star" (main.js openStarPick) and the first match's full time */
.modal.star-modal { max-width: min(680px, 96vw); text-align: center; padding: 22px 14px 16px; background: radial-gradient(120% 90% at 50% 0%, #2c2470, #12102a 70%); border: 1px solid rgba(245, 197, 66, 0.5); }
.star-pick .sp-eyebrow { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.star-pick h2 { margin: 6px 0 4px; font-size: clamp(30px, 8vw, 44px); line-height: 1; }
.star-pick .sp-sub { margin: 0 0 16px; color: #d6d0f0; font-size: 15px; }
.sp-cards { display: flex; justify-content: center; gap: clamp(6px, 2vw, 16px); }
.sp-card { display: grid; gap: 8px; justify-items: center; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; font: inherit; transition: transform .15s; animation: sp-in .45s ease-out backwards; }
.sp-card:nth-child(2) { animation-delay: .08s; } .sp-card:nth-child(3) { animation-delay: .16s; }
.sp-card .card { --cw: min(180px, 28vw); pointer-events: none; margin: 0; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
.sp-card:hover { transform: translateY(-6px) scale(1.03); }
.sp-go { display: inline-block; padding: 8px 0; width: 100%; border-radius: 999px; background: var(--gold); color: #1a1400; font-weight: 900; font-size: 15px; animation: sp-pulse 1.4s ease-in-out infinite; }
.sp-switch { display: block; margin: 14px auto 0; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 999px; padding: 7px 14px; color: #d6d0f0; font: 600 13px system-ui; cursor: pointer; }
.sp-switch b { color: var(--gold); }
.sp-switch + .sp-skip { margin-top: 8px; }
.sp-skip { margin-top: 16px; background: none; border: 0; color: #a8a2cc; font: 600 13px system-ui; text-decoration: underline; cursor: pointer; }
@keyframes sp-in { from { opacity: 0; transform: translateY(30px) scale(.9); } }
@keyframes sp-pulse { 50% { box-shadow: 0 0 0 5px rgba(245, 197, 66, 0.3); } }
@media (prefers-reduced-motion: reduce) { .sp-card, .sp-go { animation: none; } }

/* First visit, test 3: "Build your dream team" (main.js openTeamPick): a little 1-2-1 team sheet filling up on top */
.team-pick h2 { font-size: clamp(26px, 7vw, 40px); }
.tp-pitch { position: relative; display: grid; gap: 6px; margin: 10px auto 10px; padding: 10px 8px; width: min(340px, 100%); box-sizing: border-box; border-radius: 12px;
  background: repeating-linear-gradient(0deg, #1f7a3a 0 22px, #22853f 22px 44px); border: 2px solid rgba(255, 255, 255, 0.55); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25); }
.tp-pitch::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 2px solid rgba(255, 255, 255, 0.4); }
.tp-row { position: relative; display: flex; justify-content: center; gap: 10px; }
.tp-spot { width: 46px; height: 64px; display: grid; place-items: center; border-radius: 6px; border: 2px dashed rgba(255, 255, 255, 0.5); color: rgba(255, 255, 255, 0.8); font: 800 11px system-ui; background: rgba(0, 0, 0, 0.18); }
.tp-spot.next { border-color: var(--gold); color: var(--gold); animation: sp-pulse 1.4s ease-in-out infinite; }
.tp-spot.on { border: 0; background: none; }
.tp-spot.on .card { --cw: 46px; margin: 0; pointer-events: none; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5); }
.tp-spot.pop .card { animation: tp-pop .4s cubic-bezier(.2, .9, .3, 1.3); }
@keyframes tp-pop { from { transform: scale(1.8); opacity: 0; } }
.tp-step { margin: 2px 0 10px; font-size: 18px; font-weight: 800; }
.tp-step b { color: var(--gold); margin-right: 4px; }
.tp-step em { font-style: normal; color: #d6d0f0; font-weight: 600; }
.tp-step.go { color: var(--gold); font-size: 24px; animation: sp-in .3s ease-out; }
.tp-cands .card { --cw: min(150px, 27vw); }
.tp-cands.four .card { --cw: min(130px, 21vw); }
.team-pick .sp-skip { margin-top: 12px; }
@media (max-height: 700px) { .tp-spot { width: 38px; height: 53px; } .tp-spot.on .card { --cw: 38px; } .tp-cands .card { --cw: min(120px, 25vw); } .tp-cands.four .card { --cw: min(100px, 21vw); } .team-pick h2 { margin: 2px 0; } }
@media (max-height: 760px) and (min-width: 600px) { .team-modal { padding-top: 12px; padding-bottom: 10px; } .tp-pitch { gap: 4px; padding: 6px 8px; margin: 6px auto; } .tp-spot { width: 40px; height: 56px; } .tp-spot.on .card { --cw: 40px; } .tp-cands .card { --cw: 132px; } .tp-cands.four .card { --cw: 120px; } }
/* Full time of the dream-team match: the exhibition explained */
.modal.dt-modal { max-width: min(560px, 96vw); text-align: center; }
.dt-over h2 { margin: 4px 0 10px; }
.dt-team { display: flex; justify-content: center; gap: 6px; margin: 0 0 12px; }
.dt-team .card { --cw: min(76px, 17vw); margin: 0; pointer-events: none; }
.dt-rule { text-align: left; margin: 6px 0; padding: 8px 10px; border-radius: 10px; background: rgba(245, 197, 66, 0.1); border: 1px solid rgba(245, 197, 66, 0.35); }
@media (prefers-reduced-motion: reduce) { .tp-spot.next, .tp-spot.pop .card, .tp-step.go { animation: none; } }

/* Come back: "add to home screen" / notifications / open-in-browser card (src/comeback.js) */
.cb-card { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 60; width: min(520px, calc(100vw - 20px)); box-sizing: border-box;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px;
  background: #1b1d3a; border: 1px solid rgba(245, 197, 66, 0.55); box-shadow: 0 16px 50px rgba(0, 0, 0, 0.55); animation: pop .25s ease-out; }
.cb-icon { font-size: 28px; }
.cb-text { display: grid; gap: 2px; font-size: 13.5px; color: #cfc8ee; }
.cb-text b { font-size: 15px; color: #fff; }
.cb-text small { color: #e6dcff; font-size: 12.5px; }
.cb-card .cb-go { white-space: nowrap; padding: 9px 14px; }
.cb-x { background: none; border: 0; color: #a8a2cc; font-size: 22px; line-height: 1; cursor: pointer; padding: 4px 6px; }
@media (max-width: 480px) { .cb-card { grid-template-columns: auto minmax(0, 1fr) auto; } .cb-card .cb-go { grid-column: 1 / -1; grid-row: 2; } .cb-x { grid-column: 3; grid-row: 1; } }

/* Home: the Boss (main.js renderBoss, src/boss.js). The picture is the user's illustration (assets/boss.jpg); a crown stands in until it exists. */
.fd-boss { display: grid; grid-template-columns: 240px minmax(0, 1fr); border-color: rgba(168, 85, 247, 0.55); background: linear-gradient(110deg, #120a1f, #10142e 70%) !important; }
.boss-pic { position: relative; min-height: 250px; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, rgba(147, 51, 234, 0.4), rgba(10, 6, 14, 0.9) 72%); }
.boss-pic span { font-size: 84px; filter: drop-shadow(0 8px 22px rgba(168, 85, 247, 0.7)); }
.boss-pic span svg { width: 84px; height: 84px; }
.boss-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; }
.boss-av { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.boss-body { padding: 20px 22px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.boss-eyebrow { margin: 0; font: 800 11px/1 system-ui, sans-serif; letter-spacing: 0.12em; text-transform: uppercase; color: #c79bff; }
.boss-body h2 { margin: 0; font-size: 28px; }
.boss-text { margin: 0; color: var(--muted); line-height: 1.45; max-width: 60ch; }
.boss-text b { color: #fff; }
.boss-prize { margin: 0; font-weight: 700; color: #ffd66b; }
.boss-go { margin-top: 6px; }
.fd-boss.locked .boss-pic { filter: grayscale(0.8) brightness(0.7); }
.fd-boss.locked .boss-go { opacity: 0.75; cursor: default; }
@media (max-width: 760px) {
  .fd-boss { grid-template-columns: 112px minmax(0, 1fr); }
  .boss-pic { min-height: 0; }
  .boss-pic span { font-size: 48px; }
  .boss-pic span svg { width: 48px; height: 48px; }
  .boss-body { padding: 14px; }
  .boss-body h2 { font-size: 22px; }
  .boss-go { width: 100%; white-space: normal; }
}
/* The Boss's speech bubble: dark, so it never looks like The Captain's */
.speech.boss { background: #120a1f; color: #fff; border: 1px solid rgba(168, 85, 247, 0.8); font-weight: 700; }
.speech.boss::before { border-bottom-color: #a855f7; }

/* Card picker with both sides (Collina, Player Reborn): each side under its own heading (ui.js pickCard groups) */
.pick-group { margin: 10px 0 4px; padding: 8px 10px 10px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.12); }
.pick-group h3 { margin: 0 0 8px; font: 800 12px/1.2 system-ui, sans-serif; letter-spacing: 0.08em; text-transform: uppercase; text-align: left; }
.pick-group h3 span { opacity: 0.6; font-weight: 700; }
.pick-group.theirs { border-color: rgba(255, 110, 110, 0.5); background: rgba(255, 80, 80, 0.07); }
.pick-group.theirs h3 { color: #ff9a9a; }
.pick-group.mine { border-color: rgba(90, 200, 255, 0.5); background: rgba(70, 170, 255, 0.07); }
.pick-group.mine h3 { color: #8fd3ff; }

/* ---------- Coin (reward Skill): a real coin (BALL / BOOT faces) is tossed slowly over the chosen forward ---------- */
.coin-flip { position: fixed; z-index: 60; width: 150px; height: 150px; margin: -75px 0 0 -75px; pointer-events: none; perspective: 700px; transform-style: preserve-3d; }
.coin-flip i { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: 0 0 0 3px #6b4608, 0 0 34px rgba(255, 200, 70, 0.75), 0 18px 30px rgba(0, 0, 0, 0.55); }
.coin-flip i img { display: block; width: 100%; height: 100%; object-fit: cover; }
.coin-flip .cf-b { transform: rotateY(180deg); }
.coin-flip .cf-glow { position: absolute; inset: -40%; border-radius: 50%; background: radial-gradient(circle, rgba(255, 215, 110, 0.55), transparent 62%);
  transform: translateZ(-2px); opacity: 0; animation: cf-glow 3.3s ease-out both; }
.coin-flip.ball { animation: coin-ball 3.3s cubic-bezier(.15, .55, .2, 1) both; }
.coin-flip.boot { animation: coin-boot 3.3s cubic-bezier(.15, .55, .2, 1) both; }
.coin-flip.boot { --end: 180deg; } /* the fade-out keeps the BOOT face up */
.coin-flip.cf-out { animation: coin-out 0.45s ease-in both; }
/* up in a fast spin, then it slows down and lands on its face (ball = a whole number of turns, boot = half a turn more) */
@keyframes coin-ball { 0% { transform: translateY(40px) rotateY(0) rotateX(12deg) scale(.45); } 30% { transform: translateY(-170px) rotateY(1440deg) rotateX(-8deg) scale(1.15); }
  80% { transform: translateY(-70px) rotateY(2120deg) rotateX(4deg) scale(1.05); } 100% { transform: translateY(-70px) rotateY(2160deg) rotateX(0) scale(1.1); } }
@keyframes coin-boot { 0% { transform: translateY(40px) rotateY(0) rotateX(12deg) scale(.45); } 30% { transform: translateY(-170px) rotateY(1440deg) rotateX(-8deg) scale(1.15); }
  80% { transform: translateY(-70px) rotateY(2300deg) rotateX(4deg) scale(1.05); } 100% { transform: translateY(-70px) rotateY(2340deg) rotateX(0) scale(1.1); } }
@keyframes cf-glow { 0%, 70% { opacity: 0; } 100% { opacity: 1; } }
@keyframes coin-out { from { opacity: 1; transform: translateY(-70px) rotateY(var(--end, 0)) scale(1.1); } to { opacity: 0; transform: translateY(-90px) scale(.7); } }
@media (max-width: 760px) { .coin-flip { width: 110px; height: 110px; margin: -55px 0 0 -55px; } }

/* The Narrator's line (src/narrator.js, Boss matches): a quiet caption while the voice speaks */
.narr-cap { position: fixed; left: 50%; top: 12%; transform: translateX(-50%); z-index: 60; max-width: min(86vw, 560px); padding: 8px 18px; border-radius: 999px; background: rgba(8, 4, 14, 0.82); border: 1px solid rgba(168, 85, 247, 0.6); color: #efe6ff; font: italic 700 15px/1.3 Georgia, 'Times New Roman', serif; letter-spacing: 0.02em; text-align: center; pointer-events: none; box-shadow: 0 8px 30px rgba(88, 28, 135, 0.45); animation: pop 0.25s ease-out; }
.narr-cap.big { font-size: 18px; border-color: rgba(216, 180, 254, 0.9); }
@media (max-width: 760px) { .narr-cap { font-size: 13px; top: 9%; } .narr-cap.big { font-size: 15px; } }

/* The Boss's popup when the site opens (main.js bossPopup): his picture big, dark and purple */
.modal.boss-pop { width: min(760px, 94vw); max-width: none; padding: 0; overflow: hidden; background: linear-gradient(120deg, #0d0716, #160b25 55%, #10142e); border: 1px solid rgba(168, 85, 247, 0.6); box-shadow: 0 30px 90px rgba(88, 28, 135, 0.55); }
.boss-pop .bp { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); }
.boss-pop .bp-art { position: relative; min-height: 380px; background: radial-gradient(circle at 50% 40%, rgba(147, 51, 234, 0.45), #07040c 75%); display: grid; place-items: center; }
.boss-pop .bp-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.boss-pop .bp-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 60%, #110920); pointer-events: none; }
.boss-pop .bp-art span { font-size: 96px; }
.boss-pop .bp-body { padding: 26px 26px 8px; text-align: left; }
.boss-pop .bp-eyebrow { margin: 0 0 6px; font: 800 12px/1 system-ui, sans-serif; letter-spacing: 0.14em; text-transform: uppercase; color: #c79bff; }
.boss-pop h2 { margin: 0; font-size: clamp(30px, 5vw, 44px); line-height: 1; letter-spacing: 0.01em; text-shadow: 0 0 28px rgba(168, 85, 247, 0.7); }
.boss-pop .bp-tag { margin: 6px 0 14px; color: #d8c4f5; font-style: italic; }
.boss-pop .bp-facts { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 7px; color: var(--muted, #b7bdd6); }
.boss-pop .bp-facts b { color: #fff; }
.boss-pop .bp-prize { margin: 0; padding: 10px 12px; border-radius: 12px; background: rgba(245, 197, 66, 0.1); border: 1px solid rgba(245, 197, 66, 0.35); color: #ffd66b; font-weight: 700; line-height: 1.4; }
.boss-pop .actions { padding: 14px 26px 22px; justify-content: flex-end; }
@media (max-width: 640px) {
  .boss-pop .bp { grid-template-columns: 1fr; }
  .boss-pop .bp-art { min-height: 0; height: 42vh; max-height: 300px; }
  .boss-pop .bp-art::after { background: linear-gradient(180deg, transparent 55%, #110920); }
  .boss-pop .bp-body { padding: 4px 18px 4px; }
  .boss-pop .bp-facts { gap: 4px; font-size: 14px; }
  .boss-pop .bp-prize { font-size: 13px; }
  .boss-pop .actions { padding: 12px 18px 16px; flex-direction: column-reverse; }
  .boss-pop .actions .btn { width: 100%; }
}

/* Rüdiger's Chaos Wall: the top 5 cards of a deck, shown to both players for a moment */
.reveal-strip { position: fixed; left: 50%; top: 50%; z-index: 70; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 8px; padding: 12px 16px 14px;
  border-radius: 18px; background: rgba(10, 16, 36, 0.94); border: 1px solid rgba(255, 209, 102, 0.5); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6); animation: pop 0.25s ease-out; pointer-events: none; }
.reveal-strip.theirs { border-color: rgba(255, 93, 108, 0.6); }
.reveal-strip p { margin: 0; font: 900 12px system-ui; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); }
.reveal-strip > div { display: flex; gap: 8px; --cw: 74px; }
.reveal-strip.out { opacity: 0; transition: opacity 0.3s; }
@media (max-width: 520px) { .reveal-strip > div { --cw: 56px; gap: 5px; } .reveal-strip { padding: 10px; } }

/* Home: the play controls grouped in one box (2026-11-18): your deck, then the Captain (level, his deck, Play), then the
   other ways to play. Only regrouping: every control and id is the one that was already there. */
.home .fd-playbox { display: grid; gap: 12px; max-width: 560px; margin: 4px 0 6px; padding: 14px; border-radius: 18px; background: rgba(10, 12, 32, 0.55); border: 1px solid rgba(255, 255, 255, 0.12); }
.home .fd-playbox .fd-cta, .home .fd-playbox .fd-cta-sub { margin: 0; }
.home .fd-playbox .pb-deck .rival-row { display: flex; width: 100%; }
.home .fd-playbox .pb-deck .rival-row select, .home .fd-playbox .pb-opts .rival-row select { flex: 1; }
.home .fd-playbox .pb-captain { display: grid; gap: 10px; padding: 12px; border-radius: 14px; background: rgba(245, 197, 66, 0.06); border: 1px solid rgba(245, 197, 66, 0.28); }
.home .fd-playbox .pb-opts { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.home .fd-playbox .pb-opts .rival-row { flex: 1 1 200px; }
.home .fd-playbox .fd-cta .big-btn { flex: 1 1 100%; width: 100%; }
.home .fd-playbox .pb-more { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; justify-content: space-between; }
.home .fd-playbox .pb-more .tut-btn { flex: 0 1 auto; }
.home .fd-playbox .pb-more .rival-row + .tut-btn::before { display: none; }
.home .pb-link { background: none; border: 0; padding: 0; cursor: pointer; font: 600 14px system-ui, sans-serif; color: #c79bff; }
.home .pb-link b { font-weight: 800; }
.home .pb-link:hover b { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 760px) {
  .home .fd-playbox { max-width: none; margin-inline: auto; padding: 12px; text-align: left; }
  .home .fd-playbox .pb-more { justify-content: center; }
  .home .fd-playbox .pb-more .tut-btn { flex-basis: auto; }
}

/* The online choices open inside the play box, right under "Play online" (2026-11-18) */
.home .fd-playbox .online { margin-top: -4px; }
.home .fd-playbox .online-status:empty { display: none; }

/* Card details: description language switch EN · FR · ع (ui.js infoHtml) */
.card-info .ci-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.card-info .ci-head h3 { margin: 0; }
.ci-lang { flex: 0 0 auto; display: inline-flex; border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 999px; overflow: hidden; }
.ci-lang button { border: 0; background: transparent; color: var(--muted, #b7bdd6); font: 800 11px/1 system-ui, sans-serif; padding: 5px 8px; cursor: pointer; min-width: 30px; }
.ci-lang button[lang="ar"] { font-size: 13px; padding: 3px 8px; }
.ci-lang button[aria-pressed="true"] { background: rgba(245, 197, 66, 0.9); color: #1a1405; }
.ci-lang button:focus-visible { outline: 2px solid #ffd66b; outline-offset: -2px; }
.card-info .ci-body[dir="rtl"] { text-align: right; font-family: "Noto Kufi Arabic", "Geeza Pro", "Segoe UI", Tahoma, system-ui, sans-serif; line-height: 1.75; }

/* ---------- card panel right of the pitch (wide screens with room for it; ui.js dockRoom) ---------- */
.card-dock { display: none; }
body.dock-room .card-dock {
  display: block; position: fixed; top: 64px; right: 16px; width: var(--dock-w, 280px); max-height: calc(var(--dock-bottom, 100dvh) - 64px); overflow: auto; z-index: 5;
  padding: 12px; border-radius: 14px; background: rgba(10, 18, 38, 0.86); border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}
body.dock-room .card-dock .card.big { --cw: calc(var(--dock-w, 280px) * 0.6); margin: 0 auto 10px; display: block; cursor: default; }
.card-dock .card-info { font-size: 13px; }
.card-dock .preview-empty { color: var(--muted); font-size: 13px; text-align: center; padding: 18px 6px; }
body.report-open .card-dock { display: none; } /* the match report drawer has its own card view */

/* ---------- Strategy mode (src/strategy.js): Classic / Strategy, then formation + starting five ---------- */
/* the mode pictures (strategy.js modeIcon) */
.mode-ico { display: block; width: 64px; height: 80px; flex: none; }
.mode-ico .mi-grass { fill: #1f7a3a; stroke: #2e9a50; stroke-width: 1.5; }
.mode-ico .mi-chalk { fill: none; stroke: rgba(255, 255, 255, 0.55); stroke-width: 1.4; }
.mode-ico .mi-pl { fill: #ffd34d; stroke: #3a2a00; stroke-width: 1.2; }
.mode-ico .mi-gk { fill: #5fd0ff; stroke: #06283a; stroke-width: 1.2; }
.mode-ico .mi-run { stroke: rgba(255, 211, 77, 0.65); stroke-width: 1.6; stroke-dasharray: 2.5 3; fill: none; }
.mode-ico .mi-card { stroke: rgba(0, 0, 0, 0.35); stroke-width: 1; }
.mode-ico .c1 { fill: #7b5cff; } .mode-ico .c2 { fill: #f5c542; } .mode-ico .c3 { fill: #39c0ff; }
.mode-ico .mi-art { fill: rgba(255, 255, 255, 0.35); }
.mode-ico .mi-line { fill: rgba(0, 0, 0, 0.3); }
.mode-ico .mi-hand { fill: rgba(255, 255, 255, 0.1); stroke: rgba(255, 255, 255, 0.25); }

.modal.st-choose { width: min(620px, 96vw); }
.st-title { text-align: center; }
.st-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.st-mode { position: relative; display: grid; justify-items: center; align-content: start; gap: 4px; text-align: center; padding: 16px 14px 14px;
  border-radius: 16px; cursor: pointer; color: var(--ink); font: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02)); border: 1.5px solid rgba(255, 255, 255, 0.16);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s; }
.st-mode .mode-ico { width: 76px; height: 95px; margin-bottom: 6px; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.45)); }
.st-mode b { font: 900 20px/1.1 system-ui, sans-serif; letter-spacing: 0.02em; }
.st-mode .st-mode-sub { font-size: 12px; font-weight: 800; color: var(--gold); text-transform: uppercase; letter-spacing: 0.08em; }
.st-mode ul { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 5px; font-size: 13px; color: var(--muted); line-height: 1.35; text-align: left; }
.st-mode li { padding-left: 16px; position: relative; }
.st-mode li::before { content: ""; position: absolute; left: 3px; top: 0.5em; width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, 0.35); }
.st-mode.strategy { border-color: rgba(245, 197, 66, 0.55); background: linear-gradient(180deg, rgba(245, 197, 66, 0.16), rgba(31, 122, 58, 0.12)); box-shadow: 0 0 24px rgba(245, 197, 66, 0.12); }
.st-mode.strategy li::before { background: var(--gold); }
.st-mode:hover, .st-mode:focus-visible { border-color: var(--gold); transform: translateY(-3px); box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4); outline: none; }
.st-new { position: absolute; top: 10px; right: 10px; font: 900 11px system-ui, sans-serif; font-style: normal; letter-spacing: 0.08em;
  padding: 3px 8px; border-radius: 999px; color: #1a1300; background: var(--gold); box-shadow: 0 0 12px rgba(245, 197, 66, 0.6); }
@media (max-width: 520px) {
  .st-modes { grid-template-columns: 1fr; }
  .st-mode { grid-template-columns: auto 1fr; justify-items: start; text-align: left; column-gap: 12px; padding: 12px; }
  .st-mode .mode-ico { grid-row: 1 / 4; width: 54px; height: 68px; margin: 0; }
  .st-mode ul { grid-column: 1 / -1; }
}
.modal.st-wide { width: min(1080px, 96vw); max-width: 96vw; }
.st-body { max-height: min(76dvh, 760px); overflow-y: auto; padding-right: 4px; }
/* The lineup screen (2026-11-20): the list on the left, the lineup on a little pitch on the right (stays in view). */
.st-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); gap: 18px; align-items: start; }
.st-left h2 { margin-top: 0; }
.st-right { position: sticky; top: 0; z-index: 2; }
.st-pitch { position: relative; border-radius: 16px; overflow: hidden; aspect-ratio: 0.78; padding: 14px 10px;
  background: radial-gradient(120% 80% at 50% 0%, rgba(255, 255, 255, 0.10), transparent 60%),
    repeating-linear-gradient(0deg, #2b8c3d 0 34px, #267f37 34px 68px);
  border: 2px solid rgba(255, 255, 255, 0.75); box-shadow: 0 0 0 4px #134a22, 0 16px 40px rgba(0, 0, 0, 0.5), inset 0 0 50px rgba(0, 0, 0, 0.3); }
body.st-match .st-pitch, .st-pitch { --chalk: rgba(255, 255, 255, 0.7); }
.st-pl { position: absolute; border: 2px solid var(--chalk); pointer-events: none; }
.st-pl.half { left: -2px; right: -2px; top: -2px; height: 0; border-width: 2px 0 0; }
.st-pl.circle { left: 50%; top: 0; width: 34%; aspect-ratio: 1; border-radius: 50%; transform: translate(-50%, -50%); }
.st-pl.box { left: 22%; right: 22%; bottom: -2px; height: 17%; border-bottom: 0; }
.st-pl.six { left: 37%; right: 37%; bottom: -2px; height: 7%; border-bottom: 0; }
.st-prows { position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; justify-content: space-evenly; gap: 6px; --cw: 62px; }
.st-prow { display: flex; justify-content: center; gap: 10px; }
.st-spot { width: var(--cw); height: calc(var(--cw) * 1.4); border-radius: 9px; padding: 0; border: 0; background: none; position: relative; }
.st-spot.empty { display: grid; place-items: center; border: 2px dashed rgba(255, 255, 255, 0.5); background: rgba(0, 0, 0, 0.18); }
.st-spot.empty span { font: 900 12px system-ui, sans-serif; letter-spacing: 0.08em; color: rgba(255, 255, 255, 0.8); }
.st-spot.on { cursor: pointer; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5)); transition: transform 0.15s; }
.st-spot.on:hover, .st-spot.on:focus-visible { transform: translateY(-3px) scale(1.04); outline: none; }
.st-spot .card { pointer-events: none; }
.st-spot.pop { animation: st-pop 0.45s cubic-bezier(.2, 1.5, .4, 1); }
.st-spot.pop::after { content: ""; position: absolute; inset: -6px; border-radius: 12px; pointer-events: none;
  box-shadow: 0 0 0 3px #ffd34d, 0 0 26px 6px rgba(255, 211, 77, 0.7); animation: st-glow 0.8s ease-out forwards; }
@keyframes st-pop { from { transform: translateY(14px) scale(0.4); opacity: 0; } }
@keyframes st-glow { to { opacity: 0; transform: scale(1.15); } }
.st-pcap { margin: 8px 0 0; text-align: center; font-size: 13px; color: var(--muted); }
.st-pcap b { color: var(--gold); }
@media (max-width: 760px) {
  /* phones: the pitch on top (it stays in view while you scroll the list), smaller */
  .st-layout { grid-template-columns: 1fr; gap: 10px; }
  .st-right { order: -1; background: var(--night-2); padding-bottom: 6px; }
  .st-pitch { aspect-ratio: auto; padding: 8px 6px; }
  .st-prows { --cw: 40px; gap: 5px; height: auto; }
  .st-prow { gap: 6px; }
  .st-pcap { margin-top: 4px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { .st-spot.pop, .st-spot.pop::after { animation: none; } }
.st-sub, .st-hint { margin: 4px 0 10px; font-size: 13px; color: var(--muted); line-height: 1.45; }
.st-forms { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.st-form { display: grid; gap: 2px; padding: 10px 6px; border-radius: 12px; cursor: pointer; text-align: center; color: var(--ink); font: inherit;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.14); }
.st-form b { font: 900 20px/1 system-ui, sans-serif; letter-spacing: 0.04em; }
.st-form span { font-size: 11px; color: var(--muted); }
.st-form.on { border-color: var(--gold); background: rgba(245, 197, 66, 0.14); box-shadow: 0 0 0 2px rgba(245, 197, 66, 0.25); }
.st-form.on span { color: var(--ink); }
.st-lines { display: grid; gap: 10px; }
.st-line { padding: 8px 10px 10px; border-radius: 12px; background: rgba(0, 0, 0, 0.2); border: 1px solid rgba(255, 255, 255, 0.07); }
.st-line h3 { margin: 0 0 8px; font: 800 13px system-ui, sans-serif; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.st-line h3 em { font-style: normal; color: var(--gold); margin-left: 4px; }
.st-cands { display: flex; flex-wrap: wrap; gap: 8px; --cw: 76px; }
.st-cand { padding: 0; border: 0; background: none; cursor: pointer; border-radius: 10px; opacity: 0.5; filter: grayscale(0.5); transition: opacity 0.15s, transform 0.15s, filter 0.15s; }
.st-cand .card { pointer-events: none; }
.st-cand.on { opacity: 1; filter: none; transform: translateY(-2px); box-shadow: 0 0 0 3px var(--gold), 0 8px 18px rgba(0, 0, 0, 0.4); }
.st-cand:hover, .st-cand:focus-visible { opacity: 0.9; filter: none; }
.st-none { margin: 0; font-size: 13px; color: var(--muted); }
@media (max-width: 640px) {
  .st-forms { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .st-cands { --cw: 64px; }
}

/* Game mode in the match (2026-11-19): a tag at the start of the turn line, the formation in each player panel. */
.ts-mode { font-weight: 800; color: var(--muted); white-space: nowrap; }
.ts-mode.strategy { color: var(--gold); }
/* Strategy lineup screen: who kicks off (known before the lineup since 2026-11-20) and the online timer */
.st-order { margin: 4px 0 8px; padding: 8px 12px; border-radius: 12px; font-size: 15px; text-align: left; }
.st-order.first { background: rgba(245, 197, 66, 0.14); border: 1px solid rgba(245, 197, 66, 0.55); }
.st-order.second { background: rgba(95, 208, 255, 0.12); border: 1px solid rgba(95, 208, 255, 0.5); }
.st-timer { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.ts-mode .ts-ico { display: inline-block; width: auto; height: 1.5em; vertical-align: -0.42em; margin-right: 3px; }

/* ---------- Strategy matches: the tactical navy + gold look (2026-11-20; Classic keeps the green pitch) ---------- */
body.st-match { --pitch-a: #1d4b63; --pitch-b: #193f55; --chalk: rgba(255, 214, 128, 0.82); }
body.st-match .pitch { box-shadow: 0 0 0 3px #b48a2a, 0 0 0 9px #0c1d2b, 0 0 0 10px rgba(255, 210, 110, 0.25), 0 26px 70px rgba(0, 0, 0, 0.55), inset 0 0 90px rgba(0, 0, 0, 0.35); }
body.st-match .pitch-marks i:not(.pm-tint):not(.pm-spot) { box-shadow: 0 0 6px rgba(255, 200, 90, 0.3), inset 0 0 5px rgba(255, 200, 90, 0.12); }
body.st-match .pm-spot { box-shadow: 0 0 6px rgba(255, 200, 90, 0.6); }
body.st-match .slot { border-color: rgba(255, 214, 128, 0.3); background: rgba(255, 214, 128, 0.05); }
body.st-match #turn-status { border-color: rgba(245, 197, 66, 0.55); }
.form-chip { font-weight: 800; color: var(--gold); white-space: nowrap; }

/* Boss section: your record and who beats him; Manager: record per game mode (2026-11-19) */
.boss-record { margin: 6px 0 0; font-size: 14px; color: var(--ink); }
.boss-record .w { color: var(--good, #46e08a); }
.boss-record .l { color: var(--bad, #ff5d6c); }
.boss-top { margin: 8px 0 4px; }
.boss-top-h { margin: 0 0 4px; font: 800 12px system-ui, sans-serif; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.boss-top ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.boss-top li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; font-size: 14px; }
.boss-top li.me { color: var(--gold); }
.boss-top .bt-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.boss-top small { color: var(--muted); }
.fd-bygame { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.fd-bygame b { color: var(--ink); margin-left: 3px; }

/* Challenge windows: which game mode (2026-11-19) */
.ch-mode { margin: 4px 0 8px; font-size: 14px; color: var(--muted); }
.ch-mode b { color: var(--gold); }

/* ---------- Strategy mode: the pitch as a team sheet (ui.js formationPlaces; wide screens only) ----------
   Each half is a grid: a side column, a spacer, 10 half-columns for the lines (a card spans 2, so a line of 1 to 5
   players stays centred), a spacer and a side column. The zone rows dissolve into it (display: contents). */
.pitch.formation .half {
  display: grid; grid-template-columns: var(--side-w, var(--slot-w)) var(--gap) repeat(10, calc(var(--slot-w) / 2)) var(--gap) var(--side-w, var(--slot-w));
  grid-template-rows: repeat(4, auto); column-gap: calc(var(--gap) * 0.6); row-gap: calc(var(--gap) * 0.5);
  align-items: center; justify-items: center;
}
.pitch.formation .half > .zone-row { display: contents; }
.pitch.formation .half .slot:not(.spell-slot):not(.pile) { width: calc(var(--slot-w) + var(--gap) * 0.6); }
.pitch.formation .slot.st-empty { display: none; }
.pitch.formation .nt-flags { display: none; }
/* a player in Defense lies sideways (0.74 scale): his line needs much less height */
.pitch.formation .half .slot:has(> .card.pos-def) { height: calc(var(--cw) * 0.86); }
/* ...and the card (still a full-height box, turned sideways) is pulled to that height, so it sits centred in its
   line instead of hanging over the next one */
.pitch.formation .half .slot > .card.pos-def { margin: calc((var(--ch) - var(--cw) * 0.86) / -2) 0; }
/* Strategy on wide screens: the pitch takes the full height (8 lines of cards need it). The profiles, the turn line,
   the next moves and your hand stack in a column on its left; the card view keeps the free space on the right. */
@media (min-width: 1000px) and (min-aspect-ratio: 5/4) {
  .board:has(> .pitch.formation) {
    justify-content: stretch; align-items: start; column-gap: 22px; row-gap: 10px;
    grid-template-columns: minmax(320px, 1fr) auto clamp(260px, 21vw, 380px);
    grid-template-rows: auto auto auto auto auto 1fr;
    grid-template-areas:
      "opp    pitch ."
      "status pitch ."
      "hint   pitch ."
      "plays  pitch ."
      "you    pitch ."
      "hand   pitch .";
  }
  .board:has(> .pitch.formation) > .pitch { grid-row: 1 / -1; align-self: start; }
  .board:has(> .pitch.formation) > #turn-status { justify-self: stretch; flex-wrap: wrap; justify-content: flex-start; }
  .board:has(> .pitch.formation) > #hint { text-align: left; }
  .board:has(> .pitch.formation) > #plays { align-self: start; }
  .board:has(> .pitch.formation) > #you-hand {
    align-self: end; justify-content: flex-start; max-width: 100%;
    --cw: clamp(64px, 6.2vw, 104px); --ch: calc(var(--cw) * 1.4);
  }
  /* a big hand scrolls without a scrollbar (it would add height and push the page past the screen); fade = more on the right */
  .board:has(> .pitch.formation) > #you-hand { padding-top: 12px; }
  .board:has(> .pitch.formation) > #you-hand.scrolls { scrollbar-width: none; padding-right: 28px; -webkit-mask-image: linear-gradient(90deg, #000 86%, transparent); mask-image: linear-gradient(90deg, #000 86%, transparent); }
  .board:has(> .pitch.formation) > #you-hand.scrolls::-webkit-scrollbar { display: none; }
  .board:has(> .pitch.formation) > #you-panel { grid-area: you; align-self: start; }
  /* 2026-11-24: your panel sits under the turn line and the hand gets the rest of the column, down to the pitch's
     bottom (contain: size = its cards never stretch the grid). fitHand (ui.js) lays it out in as many even lines as
     fit, no overlap ("tiles"); a hand too big even for that falls back to the overlapping, scrolling row. */
  .board:has(> .pitch.formation) > #you-hand { grid-area: hand; align-self: stretch; min-height: 0; contain: size; }
  .board:has(> .pitch.formation) > #you-hand.tiles { overflow: clip; overflow-clip-margin: 14px; } /* cards sized for a moment-ago column never make the page scroll (and shrink the pitch) */
  .board:has(> .pitch.formation) > #you-hand.tiles { flex-wrap: wrap; align-content: flex-start; justify-content: flex-start; gap: 16px 8px; } /* row gap: room for a Gold piece's 2/3 badge */
  .board:has(> .pitch.formation) > #you-hand.tiles .card { margin-left: 0; }
  .board:has(> .pitch.formation) > #opp-panel { margin-top: 0; }
}
.pitch.formation .slot.st-corner:empty::before {
  content: "Stadium"; font-size: calc(var(--cw) * 0.15); font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

/* Strategy, upright screens (phones, tablets): no measured fit there, so the card size comes from the width (7 card
   widths across a half) and the height (about 9.4 card widths for the 8 lines and the halfway line). */
@media (orientation: portrait) {
  :root:has(.pitch.formation) { --cw-base: clamp(28px, min(calc((100vw - 40px) / 7.8), calc((100dvh - 400px) / 9.4)), 110px); }
}
/* Phones, Strategy team sheet: the cards are small, so each one shows only the number that counts in a duel (ATK in
   Attack, DEF in Defense, sideways), bigger. Tapping the card still shows both. */
@media (max-width: 760px) and (orientation: portrait) {
  /* the pitch keeps one size all turn (it is measured once): no suggestion boxes or hint line coming and going under
     it (as on sideways phones: the turn line and the cards' glow say the same), and a turn line of fixed height */
  .board:has(> .pitch.formation) > #plays, .board:has(> .pitch.formation) > #hint { display: none !important; }
  /* ...and the room goes to the pitch: a one-line turn line (no chips, no tips button: it is always shown) and
     smaller hand cards */
  .board:has(> .pitch.formation) > #turn-status { display: flex !important; height: 26px; overflow: hidden; flex-wrap: nowrap; white-space: nowrap; padding-block: 2px; }
  .board:has(> .pitch.formation) > #turn-status .tchip { display: none; }
  /* the side columns as wide as their (72% size) cards, not a full player's place: more width for the lines */
  .pitch.formation { --side-w: calc(var(--cw-base) * 0.8); }
  .pitch.formation .half .slot.spell-slot, .pitch.formation .half .slot.pile { width: var(--side-w); }
  .board:has(> .pitch.formation) > .tips-toggle { display: none; }
  .board:has(> .pitch.formation) > #you-hand { --cw: min(calc((100vw - 28px) / 7.2), 52px); --ch: calc(var(--cw) * 1.4); padding-bottom: 3px; }
  /* slimmer Fan Support bars */
  .board:has(> .pitch.formation) > .duelist { padding: 2px 8px; }
  .board:has(> .pitch.formation) > .duelist .avatar { width: 26px; height: 26px; }
  .board:has(> .pitch.formation) > .duelist .d-name { font-size: 12.5px; }
  .board:has(> .pitch.formation) > .duelist .pchip { height: 24px; padding-block: 0; }
  .board:has(> .pitch.formation) > .duelist .lp-value { font-size: 15px; }
  .pitch.formation .half .card.player .c-stats { justify-content: center; font-size: clamp(8px, calc(var(--cw) * 0.27), 15px); letter-spacing: -0.02em; }
  .pitch.formation .half .card.player:not(.pos-def) .c-stats > :last-child,
  .pitch.formation .half .card.player.pos-def .c-stats > :first-child { display: none; }
}

/* Strategy team sheet: a player in Defense keeps a full-height box under his sideways card; only the card itself
   takes taps, so a tap near a neighbouring card's edge reaches that card */
.pitch.formation .half .card.pos-def { pointer-events: none; }
.pitch.formation .half .card.pos-def > .rot { pointer-events: auto; }

/* taps on the board act at once (no wait for a possible double-tap zoom) */
.board .card, .board .slot, .board .phase-bar, .board .btn { touch-action: manipulation; }

/* Strategy needs the tall pitch: a phone held sideways is asked to turn upright (the match waits underneath) */
@media (orientation: landscape) and (max-height: 560px) {
  body.st-match:not(:has(#home:not([hidden])))::after {
    content: "\21BB\A Turn your phone upright\A to play Strategy";
    white-space: pre; position: fixed; inset: 0; z-index: 30; /* under the game menu button (31) and pop-ups (60) */ display: grid; place-content: center; text-align: center;
    font: 800 20px/1.5 system-ui, sans-serif; color: #fff; background: rgba(6, 12, 28, 0.96);
  }
}

/* ---------- home: the new Strategy mode (index.html #fd-strategy, the news banner) ---------- */
.fd-news .fd-news-ico { width: 36px; height: 44px; flex: none; display: grid; place-items: center; }
.fd-news .fd-news-ico .mode-ico { width: 34px; height: 42px; }
.fd-strat { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; padding: 18px 22px;
  background: radial-gradient(120% 140% at 0% 0%, rgba(46, 154, 80, 0.35), transparent 60%), linear-gradient(120deg, rgba(245, 197, 66, 0.14), rgba(10, 18, 38, 0.6));
  border: 1px solid rgba(245, 197, 66, 0.45); }
.fd-strat .fs-ico .mode-ico { width: 104px; height: 130px; filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.5)); }
.fd-strat .fs-eyebrow { margin: 0; }
.fd-strat .fs-eyebrow i { font: 900 11px system-ui, sans-serif; font-style: normal; letter-spacing: 0.1em; padding: 3px 9px; border-radius: 999px; color: #1a1300; background: var(--gold); }
.fd-strat h2 { margin: 6px 0 4px; font-size: 24px; }
.fd-strat .fs-lead { margin: 0 0 10px; color: var(--muted); font-size: 14px; line-height: 1.45; max-width: 620px; }
.fd-strat .fs-forms { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.fd-strat .fs-forms span { font: 900 13px system-ui, sans-serif; letter-spacing: 0.05em; padding: 4px 10px; border-radius: 8px; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.16); }
.fd-strat .fs-cta { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 560px) {
  .fd-strat { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 16px; gap: 10px; }
  .fd-strat .fs-ico .mode-ico { width: 80px; height: 100px; }
  .fd-strat .fs-forms, .fd-strat .fs-cta { justify-content: center; }
}

/* the one-time "new mode" announcement (main.js announceStrategy) */
.modal.sn-pop { width: min(460px, 94vw); text-align: center; }
.sn-pop .mode-ico { width: 96px; height: 120px; margin: 4px auto 8px; filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.5)); }
.sn-pop .sn-eyebrow { margin: 0; font: 900 12px system-ui, sans-serif; letter-spacing: 0.1em; color: var(--gold); }
.sn-pop h2 { margin: 4px 0 8px; }
.sn-pop p { color: var(--muted); font-size: 14px; line-height: 1.5; }
.sn-pop ul { text-align: left; margin: 10px auto 0; padding: 0; list-style: none; display: grid; gap: 6px; max-width: 360px; font-size: 14px; }
.sn-pop li { padding-left: 18px; position: relative; }
.sn-pop li::before { content: ""; position: absolute; left: 4px; top: 0.5em; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }

/* Decks panel: 3 tiles side by side, one clear action each (deckshare.js draw) */
.ds-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.ds-tile { display: grid; gap: 8px; align-content: start; padding: 14px; border-radius: 14px; min-width: 0;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.25)); border: 1px solid rgba(255, 255, 255, 0.12); }
.ds-tile.gold { background: linear-gradient(160deg, rgba(245, 197, 66, 0.18), rgba(0, 0, 0, 0.25)); border-color: rgba(245, 197, 66, 0.4); }
.ds-tile.shared { border-color: rgba(70, 224, 138, 0.4); }
.ds-tile.how { border-style: dashed; }
.ds-tile .ds-btns { margin: auto 0 0; padding-top: 2px; }
.ds-tile .ds-btns .btn { flex: 1 1 auto; justify-content: center; }
.ds-tile .ds-st { padding: 6px 0; }
.ds-unlock { font-weight: 700; } .ds-unlock.ok { color: #46e08a; } .ds-unlock.lock { color: #ffcf6e; }
.ds-backs { position: relative; align-items: center; height: calc(42px * 1.4); }
.ds-backs i { width: 42px; height: 100%; flex: none; border-radius: 4px; background: repeating-linear-gradient(135deg, #1b3a8a 0 6px, #22479f 6px 12px); border: 1px solid rgba(255, 255, 255, 0.25); }
.ds-backs b { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 20px; }
.ds-steps { margin: 2px 0 0; padding-left: 20px; display: grid; gap: 6px; font-size: 13.5px; color: var(--muted); }
.ds-inc { margin-bottom: 12px; }
@media (max-width: 860px) { .ds-tiles { grid-template-columns: 1fr; } .ds-tile.how { grid-column: auto !important; } }

/* ---- Home order + feature rail (2026-11-20). The rail is for wide screens only: phones and tablets keep the top menu. ---- */
.fd-rail { display: none; }
@media (min-width: 1180px) {
  .home .fd-layout { display: grid; grid-template-columns: 224px minmax(0, 1fr); align-items: start; }
  .fd-rail {
    display: flex; flex-direction: column; gap: 2px; position: sticky; top: var(--fd-top-h, 62px); z-index: 6;
    height: calc(100vh - var(--fd-top-h, 62px)); overflow-y: auto; scrollbar-width: thin; padding: 18px 12px 28px;
    background: rgba(7, 9, 26, 0.78); border-right: 1px solid var(--fd-line);
  }
  .fd-rail a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #b9bddb; text-decoration: none; font: 800 15px/1.15 system-ui, sans-serif; transition: background 0.15s, color 0.15s; }
  .fd-rail a[hidden] { display: none; }
  .fd-rail a i { flex: none; width: 24px; height: 24px; display: grid; place-items: center; font-style: normal; font-size: 20px; }
  .fd-rail a i svg { width: 22px; height: 22px; }
  .fd-rail a:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
  .fd-rail a.on { background: rgba(255, 255, 255, 0.1); color: #fff; box-shadow: inset 3px 0 0 #f5c542; }
  .fd-rail a[data-rail="play"] { color: #f5c542; }
  .fd-rail .fr-boss { color: #d9b8ff; }
  .fd-rail .fr-boss.on { box-shadow: inset 3px 0 0 #a855f7; }
  .home .fd-nav a { display: none; } /* the rail replaces the top menu */
  /* the hero stays full-bleed, but only across the content column (not under the rail) */
  .home .fd-hero { margin: 0 calc(50% - 50vw + 112px); padding-left: max(20px, calc(50vw - 112px - 560px)); padding-right: max(20px, calc(50vw - 112px - 560px)); }
}

/* the Boss, right under Play: bigger and darker than the other sections (desktop and tablets; phones keep their layout) */
@media (min-width: 761px) {
  .home .fd-boss {
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); border: 1px solid rgba(168, 85, 247, 0.75);
    background: radial-gradient(600px 320px at 85% 0%, rgba(147, 51, 234, 0.28), transparent 70%), linear-gradient(110deg, #0d0716, #120a24 55%, #10142e) !important;
    box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.2), 0 26px 80px rgba(88, 28, 135, 0.45);
  }
  .home .fd-boss .boss-pic { min-height: 330px; }
  .home .fd-boss .boss-pic::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 55%, #0f0820); pointer-events: none; }
  .home .fd-boss .boss-body { padding: 28px 32px; justify-content: center; gap: 10px; }
  .home .fd-boss .boss-eyebrow { font-size: 12px; letter-spacing: 0.18em; }
  .home .fd-boss .boss-body h2 { font-size: 38px; line-height: 1.05; text-transform: uppercase; letter-spacing: 0.01em; text-shadow: 0 4px 30px rgba(168, 85, 247, 0.55); }
  .home .fd-boss .boss-text { font-size: 15.5px; }
  .home .fd-boss .boss-go { margin-top: 10px; padding: 14px 28px; font-size: 17px; background: linear-gradient(135deg, #b46cff, #7c3aed 60%, #5b21b6); color: #fff; border-color: transparent; box-shadow: 0 12px 34px rgba(147, 51, 234, 0.5); }
  .home .fd-boss .boss-go:hover:not(:disabled) { filter: brightness(1.1); }
}

/* ---- Hero, tighter (2026-11-20): your deck big, then the Captain and online; the Boss and Strategy beside them ---- */
.home .fd-playbox .pb-deck { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: center; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--fd-line); }
.pb-deck-pack { width: 96px; display: grid; place-items: center; }
.pb-deck-pack .pack { width: 96px; height: 134px; padding: 14px 5px 12px; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45); }
.pb-deck-pack .pack-brand { font-size: 10px; } .pb-deck-pack .pack-emblem { width: 64px; height: 64px; } .pb-deck-pack .pack-count { font-size: 8px; padding: 2px 6px; }
@media (max-width: 760px) { .pb-deck-pack { width: 72px; } .pb-deck-pack .pack { width: 72px; height: 100px; padding: 10px 4px 9px; } .pb-deck-pack .pack-emblem { width: 46px; height: 46px; } .pb-deck-pack .pack-brand { font-size: 7px; } }
.pb-dice { font-size: 52px; line-height: 1; }
.pb-dice svg { width: 56px; height: 56px; }
.pb-deck-main { display: grid; gap: 8px; min-width: 0; }
.pb-deck-main { text-align: left; }
.pb-deck-main .rival-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; width: 100%; font-weight: 800; }
.pb-deck-main .rival-row select { flex: 1 1 150px; max-width: 100%; }
@media (max-width: 760px) { .pb-deck-main .rival-row > span { flex-basis: 100%; font-size: 13px; } .pb-deck-main .rival-row select { font-size: 14px; } }
.pb-deck-main .rival-row select { flex: 1; min-width: 0; font-size: 15px; font-weight: 800; padding: 8px 10px; }
.pb-deck-info { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--hub-muted, #b9bddb); min-height: 22px; align-items: center; }
.pb-deck-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.pb-deck-btn { flex: 1 1 auto; padding: 8px 12px; font: 800 13.5px system-ui, sans-serif; border-radius: 10px; background: rgba(245, 197, 66, 0.1); border: 1px solid rgba(245, 197, 66, 0.4); color: #ffe08a; }
.pb-deck-btn:hover { background: rgba(245, 197, 66, 0.18); }
.pb-deck-btn[hidden] { display: none; }

.fd-modes { display: none; }
@media (min-width: 761px) {
  .fd-modes { display: grid; gap: 14px; align-content: start; }
  .home .fd-playbox .pb-boss { display: none; } /* the Boss tile is right there */
  .fm-tile { position: relative; overflow: hidden; display: grid; border-radius: 18px; min-height: 0; border: 1px solid var(--fd-line); background: #10142e; }
  .fm-body { position: relative; display: grid; gap: 6px; justify-items: start; padding: 18px 20px; text-align: left; }
  .fm-eyebrow { margin: 0; font: 800 11px/1 system-ui, sans-serif; letter-spacing: 0.14em; text-transform: uppercase; }
  .fm-h { margin: 0; font: 800 24px/1.1 system-ui, sans-serif; color: #fff; }
  .fm-txt { margin: 0; font-size: 14px; line-height: 1.4; color: #cfd5f3; max-width: 30ch; }
  .fm-go { margin-top: 6px; padding: 10px 18px; border-radius: 12px; font: 800 15px system-ui, sans-serif; border: 0; }
  .fm-boss { border-color: rgba(168, 85, 247, 0.7); background: linear-gradient(110deg, #0d0716, #160b25); box-shadow: 0 16px 50px rgba(88, 28, 135, 0.4); }
  .fm-boss .fm-bg { position: absolute; inset: 0 0 0 auto; width: 58%; height: 100%; object-fit: cover; object-position: 50% 15%; -webkit-mask-image: linear-gradient(90deg, transparent, #000 45%); mask-image: linear-gradient(90deg, transparent, #000 45%); }
  .fm-boss .fm-body { padding-right: 40%; min-height: 200px; align-content: center; }
  .fm-boss .fm-eyebrow { color: #c79bff; }
  .fm-boss .fm-h { text-transform: uppercase; text-shadow: 0 4px 24px rgba(168, 85, 247, 0.6); }
  .fm-boss .fm-go { background: linear-gradient(135deg, #b46cff, #7c3aed 60%, #5b21b6); color: #fff; box-shadow: 0 10px 28px rgba(147, 51, 234, 0.5); }
  .fm-strat { grid-template-columns: auto minmax(0, 1fr); align-items: center; padding-left: 14px; }
  .fm-strat .fm-ico .mode-ico { width: 64px; height: 80px; display: block; filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.5)); }
  .fm-strat .fm-body { padding: 16px 18px 16px 14px; }
  .fm-strat .fm-eyebrow { color: var(--gold, #f5c542); }
  .fm-strat .fm-go { background: rgba(53, 196, 106, 0.16); border: 1px solid rgba(53, 196, 106, 0.6); color: #b8f5cf; }
  .fm-go:hover { filter: brightness(1.12); }
}
/* desktop: a short title row (small crest), then the play box and the two tiles side by side; the card fan goes */
@media (min-width: 901px) {
  .home .fd-hero {
    grid-template-columns: 112px minmax(0, 1.25fr) minmax(280px, 1fr); column-gap: 24px; row-gap: 10px; align-items: start; padding-top: 26px; padding-bottom: 26px;
    grid-template-areas: "crest head head" "crest title title" "crest tag tag" "box box modes" "road road road" "live live live";
  }
  .home .fd-hero-text { display: contents; }
  .home .fd-crest-wrap { grid-area: crest; align-self: center; }
  .home .fd-logo-crest { width: 112px; animation: none; }
  .home .fd-crest-wrap::before { animation: none; }
  .home .fd-hero-head { grid-area: head; grid-template-columns: auto auto; justify-content: start; align-items: center; gap: 14px; }
  .home .home-title { grid-area: title; font-size: clamp(32px, 3.4vw, 46px); }
  .home .home-title .home-brand { margin-bottom: 6px; }
  .home .home-title span { display: inline; margin-left: 0.25em; }
  .home .home-tag { grid-area: tag; font-size: 16px; max-width: 70ch; }
  .home .fd-playbox { grid-area: box; max-width: none; margin: 8px 0 0; }
  .home .fd-modes { grid-area: modes; margin-top: 8px; }
  .home .fd-road { grid-area: road; }
  .home .fd-live-strip { grid-area: live; }
  .home .fd-hero-cards { display: none; }
}

/* ---- "Help the game" (2026-11-20): the support button said louder; never in the portal editions ---- */
.home .support-btn { padding: 7px 14px; box-shadow: 0 0 0 0 rgba(245, 183, 46, 0.55); animation: sup-ring 3s ease-out infinite; }
@keyframes sup-ring { 0% { box-shadow: 0 0 0 0 rgba(245, 183, 46, 0.55); } 70%, 100% { box-shadow: 0 0 0 10px rgba(245, 183, 46, 0); } }
.fr-support[hidden], .pb-support[hidden] { display: none !important; }
.fr-support { display: none; }
@media (min-width: 1180px) {
  .fd-rail .fr-support {
    display: grid; gap: 4px; margin-top: 14px; padding: 12px 14px; border-radius: 14px; cursor: pointer; text-align: left; font: inherit; color: #3a2700;
    background: linear-gradient(135deg, #ffe08a, #f5b72e); border: 1px solid #ffd36b; box-shadow: 0 8px 24px rgba(245, 183, 46, 0.25); transition: transform 0.15s, box-shadow 0.15s;
  }
  .fd-rail .fr-support b { display: flex; align-items: center; gap: 8px; font: 900 15px/1.1 system-ui, sans-serif; }
  .fd-rail .fr-support b i { font-style: normal; animation: sup-beat 2.4s ease-in-out infinite; }
  .fd-rail .fr-support small { font: 600 12px/1.35 system-ui, sans-serif; color: #5a4100; }
  .fd-rail .fr-support:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(245, 183, 46, 0.4); }
  .home .fd-playbox .pb-support { display: none !important; } /* the rail has it */
}
.home .pb-support { color: #ffd36b; }
.cg .fr-support, .cg .pb-support { display: none !important; }
@media (prefers-reduced-motion: reduce) { .home .support-btn, .fd-rail .fr-support b i { animation: none; } }

/* Online now / Watch live with nobody there: one short line each, not two big empty boxes (2026-11-20) */
.online .fd-arena .on-empty { padding: 8px 10px; font-size: 13px; }
.online .fd-arena .fd-watch-live:has(.wl-empty) .wl-empty p { display: none; }
.online .fd-arena .wl-empty { padding: 8px 10px; gap: 0; font-size: 13px; }
.online .fd-arena .fd-panel:has(.on-empty, .wl-empty) .fd-ph { padding-top: 10px; padding-bottom: 4px; }
.online .fd-arena .fd-panel:has(.on-empty, .wl-empty) .fd-pbody { padding-top: 4px; padding-bottom: 10px; }

/* Strategy kick-off: each starting player is summoned (ui.js summonOne, 2026-11-20). A gold circle opens on his place,
   a beam of light rises from it, the card comes up through it. */
.summon-fx { position: fixed; z-index: 40; width: var(--s); height: var(--s); margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2); pointer-events: none; }
.summon-fx i { position: absolute; display: block; }
.sm-ring { inset: 0; border-radius: 50%; transform: scaleY(0.5) scale(0); }
.sm-ring.a { border: 3px solid #ffd34d; box-shadow: 0 0 18px 4px rgba(255, 211, 77, 0.75), inset 0 0 18px rgba(255, 211, 77, 0.6);
  animation: sm-ring calc(0.9s * var(--d)) cubic-bezier(.2, .9, .3, 1) forwards; }
.sm-ring.b { inset: 14%; border: 2px dashed rgba(255, 243, 196, 0.9); animation: sm-ring2 calc(0.9s * var(--d)) ease-out forwards; }
.sm-glyphs { inset: 6%; border-radius: 50%; transform: scaleY(0.5) scale(0);
  background: repeating-conic-gradient(rgba(255, 220, 120, 0.85) 0 4deg, transparent 4deg 22deg);
  -webkit-mask: radial-gradient(circle, transparent 58%, #000 60% 70%, transparent 72%); mask: radial-gradient(circle, transparent 58%, #000 60% 70%, transparent 72%);
  animation: sm-glyph calc(0.9s * var(--d)) ease-out forwards; }
.sm-pillar { left: 22%; right: 22%; bottom: 50%; height: 260%; transform-origin: 50% 100%; transform: scaleY(0); border-radius: 50% 50% 0 0;
  background: linear-gradient(0deg, rgba(255, 236, 170, 0.95), rgba(255, 211, 77, 0.55) 35%, rgba(255, 211, 77, 0) 100%); filter: blur(4px);
  animation: sm-pillar calc(0.8s * var(--d)) ease-out forwards; }
@keyframes sm-ring { 0% { transform: scaleY(0.5) scale(0); opacity: 1; } 45% { transform: scaleY(0.5) scale(1); opacity: 1; } 100% { transform: scaleY(0.5) scale(1.15); opacity: 0; } }
@keyframes sm-ring2 { 0% { transform: scaleY(0.5) scale(0) rotate(0deg); opacity: 1; } 50% { transform: scaleY(0.5) scale(1) rotate(90deg); opacity: 1; } 100% { transform: scaleY(0.5) scale(1) rotate(160deg); opacity: 0; } }
@keyframes sm-glyph { 0% { transform: scaleY(0.5) scale(0) rotate(0deg); opacity: 0; } 40% { transform: scaleY(0.5) scale(1) rotate(-40deg); opacity: 1; } 100% { transform: scaleY(0.5) scale(1) rotate(-120deg); opacity: 0; } }
@keyframes sm-pillar { 0% { transform: scaleY(0); opacity: 0; } 30% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1.1); opacity: 0; } }
html.lite .sm-glyphs, html.lite .sm-pillar { display: none; }
@media (prefers-reduced-motion: reduce) { .summon-fx { display: none; } }

/* ---------- Card categories (2026-11-20, ui.js cardLook): every card of a category has the same frame ----------
   Skill (green), Referee (black), Stadium (purple), Coach (dark green); subcategories change only the label band:
   ⚡ POWER keeps its own frame, ✨ SPECIAL and 💪 BOOST a coloured band. A reward card keeps its category's frame
   with a gold "Reward" ribbon on the picture and a gold glow. */
.card.sub-special .c-type { color: #fff; background: linear-gradient(90deg, #6d28d9, #a855f7); border-radius: 3px; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5); }
.card.sub-boost .c-type { color: #fff; background: linear-gradient(90deg, #ea580c, #f59e0b); border-radius: 3px; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5); }
.c-art { position: relative; }
.rw-tag { position: absolute; left: 3%; top: 3%; z-index: 2; padding: 0.15em 0.45em; border-radius: 999px; pointer-events: none;
  font: 900 max(6.5px, calc(var(--cw) * 0.075))/1.2 system-ui, sans-serif; letter-spacing: 0.04em; text-transform: uppercase;
  color: #2a1a00; background: linear-gradient(135deg, #fff1b8, #ffcf4d 55%, #e0a21a); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45); }
.card.rw .rot { box-shadow: 0 0 0 1px rgba(255, 207, 77, 0.7), 0 0 calc(var(--cw) * 0.12) rgba(255, 200, 90, 0.55); }
.card.reward .rw-tag { display: none; } /* reward players keep their own gold frame and label */
.zone-row .card .rw-tag { display: none; } /* small on the pitch: the glow says it */

/* ---------- wide screens, Classic (2026-11-24): your panel rises beside the pitch, the hand gets the whole width ----------
   A hand too big for one row wraps into two even lines (fitHand in ui.js; fitBoard then re-measures the pitch). */
@media (min-width: 1000px) and (min-aspect-ratio: 5/4) {
  .board:not(:has(> .pitch.formation)) {
    grid-template-columns: minmax(168px, 1fr) auto minmax(150px, 1fr); /* the pitch is sized first, the panels share what's left (1024×768: the pitch was squeezed by two 260px columns) */
    grid-template-rows: auto 1fr auto auto auto;
    grid-template-areas:
      "opp    pitch  ."
      "you    pitch  plays"
      "status status status"
      "hint   hint   hint"
      "hand   hand   hand";
  }
  .board:not(:has(> .pitch.formation)) > .pitch { grid-area: 1 / 2 / 3 / 3; }
  .board:not(:has(> .pitch.formation)) > #you-panel { grid-area: you; align-self: end; }
  .board:not(:has(> .pitch.formation)) > #you-panel, .board:not(:has(> .pitch.formation)) > #opp-panel { width: 100%; max-width: 260px; justify-self: end; }
  .board:not(:has(> .pitch.formation)) > #plays { width: 100%; max-width: 260px; justify-self: start; }
  .board:not(:has(> .pitch.formation)) > #plays { grid-area: plays; align-self: end; }
  /* A fixed-height hand (2026-11-24): room for one big line or two smaller ones, so the pitch keeps its size however
     many cards you hold (contain: size = its cards never resize the grid; overflow clipped = never a page scroll). */
  .board:not(:has(> .pitch.formation)) > #you-hand {
    max-width: none; justify-self: stretch; width: 0; min-width: 100%; min-height: 0; contain: size; overflow: clip; overflow-clip-margin: 14px; /* width 0 + min-width 100%: never widens the grid */
    height: calc(min(calc(var(--cw-base) * 1.25), calc(var(--cw-base) + 12px)) * 1.4 * 1.45 + 14px);
    flex-wrap: wrap; align-content: center;
  }
  /* the turn line and the hint span the board too: they never widen the pitch's column (12 cards add a long "Hand 12/10" note) */
  .board:not(:has(> .pitch.formation)) > #turn-status { width: 0; min-width: 100%; justify-self: stretch; justify-content: center; flex-wrap: nowrap; overflow: hidden; white-space: nowrap; }
  /* always one line (a second line would shrink the pitch): the phase's explanation gives way first, cut with … */
  .board:not(:has(> .pitch.formation)) > #turn-status > * { flex-shrink: 0; }
  .board:not(:has(> .pitch.formation)) > #turn-status > .ts-help { flex-shrink: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .board:not(:has(> .pitch.formation)) > #hint { width: 0; min-width: 100%; }
  .board:not(:has(> .pitch.formation)) > #you-hand.two-lines { justify-content: center; gap: 14px 6px; align-content: flex-start; }
  .board:not(:has(> .pitch.formation)) > #you-hand.two-lines .card { margin-left: 0; }
}

/* ---------- during a match (2026-11-24): the page never scrolls or bounces; the board is sized to fit the screen ----------
   (the home page is hidden only while a match is on; panels and dialogs scroll inside themselves) */
html:has(#home[hidden]), html:has(#home[hidden]) body { overflow: hidden; overscroll-behavior: none; }

/* Small phone cards: a thin line between ATK and DEF, so "1500 1300" never reads as one number */
@media (max-width: 760px) and (orientation: portrait), (orientation: landscape) and (max-height: 560px) {
  .zone-row .card .c-stats > span + span, #you-hand .card .c-stats > span + span { border-left: 1px solid rgba(0, 0, 0, 0.45); padding-left: 0.18em; }
}

/* ---------- "The Captain or the Boss?" (2026-11-26, main.js renderBoss): the two computer opponents side by side ---------- */
.fd-boss.fd-panel { display: grid; grid-template-columns: 1fr; gap: 14px; padding: 20px; }
.vs-head h2 { margin: 0; font: 900 italic 24px system-ui, sans-serif; text-transform: uppercase; }
.vs-head p { margin: 4px 0 0; color: var(--muted); }
.vs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.vs-card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 16px; overflow: hidden; min-width: 0; }
.vs-card > * { position: relative; }
.vs-cap { background: linear-gradient(160deg, rgba(47, 116, 199, 0.28), rgba(14, 26, 56, 0.85)); border: 1px solid rgba(79, 168, 255, 0.45); }
.vs-boss { background: linear-gradient(160deg, rgba(120, 40, 200, 0.35), rgba(14, 8, 26, 0.92)); border: 1px solid rgba(168, 85, 247, 0.7); box-shadow: 0 0 28px rgba(147, 51, 234, 0.25); }
.vs-boss .vs-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; opacity: 0.22; filter: saturate(1.2); pointer-events: none; }
.vs-top { display: flex; align-items: center; gap: 12px; }
.vs-av { width: 56px; height: 56px; flex: none; border-radius: 50%; overflow: hidden; display: grid; place-items: center; border: 2px solid rgba(79, 168, 255, 0.8); background: #0e1a38; font-size: 28px; }
.vs-av svg, .vs-av img { width: 100%; height: 100%; display: block; object-fit: cover; }
.vs-av.boss { border-color: #b06cff; box-shadow: 0 0 14px rgba(176, 108, 255, 0.6); }
.vs-eyebrow { margin: 0; font: 800 11px/1 system-ui, sans-serif; letter-spacing: 0.12em; text-transform: uppercase; color: #8fc2ff; }
.vs-boss .vs-eyebrow { color: #c79bff; }
.vs-card h3 { margin: 3px 0 5px; font-size: 22px; line-height: 1.1; }
.vs-meter { display: inline-flex; align-items: center; gap: 3px; }
.vs-meter i { width: 14px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.16); }
.vs-meter em { font: 800 11px/1 system-ui, sans-serif; font-style: normal; margin-left: 6px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.vs-meter[data-captain-meter="rookie"] i:nth-child(-n+1), .vs-meter[data-captain-meter="pro"] i:nth-child(-n+2), .vs-meter[data-captain-meter="legend"] i:nth-child(-n+3) { background: #4fa8ff; }
.vs-meter.max i { background: linear-gradient(90deg, #b06cff, #ff4d8d); box-shadow: 0 0 6px rgba(255, 77, 141, 0.5); }
.vs-meter.max em { color: #ff8fbf; }
.vs-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.vs-facts li { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; line-height: 1.35; color: #e3ddf5; }
.vs-facts li b { color: #fff; }
.vs-best { margin: 0; font-size: 13px; color: var(--muted); }
.vs-card .vs-go { margin-top: auto; align-self: stretch; }
.fd-boss .vs-boss .btn.vs-go, .fd-boss .vs-boss .btn.vs-go:hover:not(:disabled) { background: linear-gradient(135deg, #9b4dff, #6d28d9); color: #fff; border-color: rgba(255, 255, 255, 0.25); }
.vs-card .boss-record, .vs-card .boss-prize { margin: 0; font-size: 13px; }
.vs-card .boss-top { margin: 0; }
@media (max-width: 760px) {
  .fd-boss.fd-panel { padding: 14px; }
  .vs-head h2 { font-size: 20px; }
  .vs-grid { grid-template-columns: 1fr; gap: 10px; }
  .vs-card { padding: 14px; gap: 8px; }
  .vs-facts li { font-size: 13.5px; }
}
.fd-boss.locked .vs-boss .boss-go:not(:disabled) { opacity: 1; cursor: pointer; } /* on the site it opens sign-in: not greyed out */

/* ---------- the level ladder (2026-11-27, main.js openLevels / showLadder): Rookie → Pro → Legend → the Boss ---------- */
.lvl-pick button.locked { color: rgba(255, 255, 255, 0.38); cursor: help; }
.lvl-pick button.locked:hover { color: rgba(255, 255, 255, 0.6); }
.modal.ladder-modal { max-width: min(520px, 94vw); text-align: center; background: radial-gradient(120% 90% at 50% 0%, #22306e, #10122c 70%); border: 1px solid rgba(245, 197, 66, 0.55); }
.ladder-pop h2 { margin: 6px 0 8px; font-size: clamp(24px, 6vw, 32px); }
.ladder-pop p { margin: 0 0 6px; color: #d6d0f0; line-height: 1.45; }
.lp-eyebrow { font: 800 12px/1 system-ui, sans-serif !important; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold) !important; }
.lp-steps { display: flex; justify-content: center; align-items: center; gap: 6px; margin: 12px 0 4px; flex-wrap: wrap; }
.lp-steps i { color: rgba(255, 255, 255, 0.35); font-style: normal; }
.lp-step { padding: 6px 12px; border-radius: 999px; font: 800 13px system-ui, sans-serif; background: rgba(255, 255, 255, 0.07); color: rgba(255, 255, 255, 0.45); border: 1px solid rgba(255, 255, 255, 0.12); }
.lp-step.done { color: #9be7b4; border-color: rgba(82, 217, 138, 0.45); }
.lp-step.new { color: #2a1c00; background: linear-gradient(135deg, #f5c04a, #c8901a); border-color: transparent; box-shadow: 0 0 18px rgba(245, 192, 74, 0.55); animation: lp-pop 0.6s cubic-bezier(.2, .9, .3, 1.4); }
.lp-step.new.lvl-legend { color: #fff; background: linear-gradient(135deg, #ff6a4d, #c41f2f); box-shadow: 0 0 18px rgba(255, 90, 70, 0.55); }
@keyframes lp-pop { from { transform: scale(0.4); opacity: 0; } }
.lp-next { display: grid; gap: 8px; margin: 12px 0 4px; text-align: left; }
.lp-next > div { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.12); }
.lp-next b { font-size: 15px; } .lp-next span { font-size: 13px; color: #d6d0f0; }
@media (prefers-reduced-motion: reduce) { .lp-step.new { animation: none; } }

/* ---------- rank move on arrival (2026-11-27, main.js showRankMove): "#7 ↘ #10, you dropped in the ranking" ---------- */
.rank-move { position: fixed; z-index: 70; top: 14px; left: 50%; transform: translateX(-50%); width: min(460px, calc(100vw - 20px)); box-sizing: border-box;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px;
  background: #1b1d3a; box-shadow: 0 16px 50px rgba(0, 0, 0, 0.55); animation: rm-in .5s cubic-bezier(.2, .9, .3, 1.2); }
.rank-move.down { border: 1px solid rgba(255, 90, 70, 0.7); background: linear-gradient(135deg, #3a1420, #1b1d3a 60%); }
.rank-move.up { border: 1px solid rgba(82, 217, 138, 0.7); background: linear-gradient(135deg, #123a26, #1b1d3a 60%); }
.rank-move.out { animation: rm-out .4s ease-in forwards; }
.rm-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; }
.rank-move.down .rm-ico { color: #ff7a66; background: rgba(255, 90, 70, 0.14); }
.rank-move.up .rm-ico { color: #52d98a; background: rgba(82, 217, 138, 0.14); }
.rank-move.down .rm-ico { animation: rm-shake .6s ease-in-out .5s 2; }
.rm-text { display: grid; gap: 2px; min-width: 0; }
.rm-text > b { font-size: 15px; color: #fff; }
.rm-text small { font-size: 12px; color: #c9c3e0; }
.rm-nums { display: flex; align-items: baseline; gap: 8px; font: 900 24px/1.1 system-ui, sans-serif; }
.rm-nums s { color: rgba(255, 255, 255, 0.45); font-size: 18px; }
.rm-nums i { font-style: normal; font-size: 18px; }
.rank-move.down .rm-now, .rank-move.down .rm-nums i { color: #ff7a66; }
.rank-move.up .rm-now, .rank-move.up .rm-nums i { color: #52d98a; }
.rank-move.done .rm-now { animation: rm-pop .35s ease-out; }
.rm-go { white-space: nowrap; padding: 8px 12px; font-size: 13px; }
.rank-move.down .rm-go { background: linear-gradient(135deg, #ff6a4d, #c41f2f); color: #fff; border-color: transparent; }
.rank-move.up .rm-go { background: linear-gradient(135deg, #3fbf7f, #1e8c5a); color: #fff; border-color: transparent; }
.rm-x { background: none; border: 0; color: #a8a2cc; font-size: 16px; cursor: pointer; padding: 4px; }
@keyframes rm-in { from { transform: translate(-50%, -140%); opacity: 0; } }
@keyframes rm-out { to { transform: translate(-50%, -140%); opacity: 0; } }
@keyframes rm-shake { 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }
@keyframes rm-pop { 50% { transform: scale(1.25); } }
@media (max-width: 480px) { .rank-move { grid-template-columns: auto minmax(0, 1fr) auto; } .rm-go { grid-column: 1 / -1; } .rm-x { grid-row: 1; grid-column: 3; } }
@media (prefers-reduced-motion: reduce) { .rank-move, .rank-move.out, .rm-ico, .rm-now { animation: none !important; } }

/* ======================================================================================================================
   Mobile home (2026-11-27): a native-app style first screen. Phones only (max-width 760px): desktop is unchanged.
   - the home scrolls with the page itself (no inner scroll box: iPhone Safari and in-app browsers scroll it natively,
     and the address bar can hide); the match layer underneath stays laid out but hidden
   - one compact header row + a fixed bottom bar (Play, Boss, Squad, League, Profile) instead of the sliding menu
   - order: title + recent wins → mode tiles, level, his deck, Play → Play online → Boss / Strategy → your deck
   ====================================================================================================================== */
.mode-pick .mode-txt b { font: inherit; }
.mode-pick .mode-txt small { display: none; }
.fd-bottom { display: none; }
@media (max-width: 760px) {
  /* --- the page scrolls, not an inner box --- */
  html:has(#home:not([hidden])) .topbar, html:has(#home:not([hidden])) .layout, html:has(#home:not([hidden])) #btn-game-menu {
    position: fixed; top: 0; left: 0; width: 100vw; visibility: hidden; pointer-events: none; }
  .home { position: relative; inset: auto; min-height: 100dvh; overflow: visible; overflow-x: clip; z-index: auto;
    padding-bottom: calc(66px + env(safe-area-inset-bottom, 0px)); }
  html:has(#home:not([hidden])) { scroll-padding-top: 64px; scroll-padding-bottom: 76px; }

  /* --- header: one compact row --- */
  .home .fd-top { position: sticky; top: 0; z-index: 30; flex-wrap: nowrap; gap: 8px; padding: 8px 12px; min-height: 52px; box-sizing: border-box;
    background: #080a1d; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
  .home .fd-nav { display: none; }
  .home .fd-brand { min-width: 0; }
  .home .fd-brand .fd-mark { width: 30px; height: 30px; }
  .home .fd-brand b, .home .fd-brand i { font-size: 16px; letter-spacing: 0.02em; }
  .home .fd-top-actions > * { flex: none; }
  .home .acc-chip { padding: 0 12px; font-size: 13px; }
  .home .fd-brand em { display: none; }
  .home .fd-top-actions { gap: 6px; margin-left: auto; }
  .home .fd-top-actions .support-btn span, .home .fd-top-actions .settings-btn span { display: none; }
  .home .fd-brand { min-height: 44px; }
  .home .fd-top-actions .support-btn, .home .fd-top-actions .settings-btn { min-width: 40px; min-height: 40px; padding: 0 10px; }
  .home .acc-chip { max-width: 34vw; min-height: 40px; }
  .home .hub-tabs { display: none !important; }

  /* --- bottom bar --- */
  .fd-bottom { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 60; left: 0; right: 0; bottom: 0;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px)); background: rgba(9, 11, 30, 0.96); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(245, 197, 66, 0.25); box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.45); }
  .home[hidden] .fd-bottom, body.builder-open .fd-bottom, html:has(#modal-root .modal) .fd-bottom { display: none; }
  .fd-bottom a, .fd-bottom button { display: grid; justify-items: center; align-content: center; gap: 2px; min-height: 48px; border: 0; background: none; border-radius: 12px;
    color: #a3acd2; text-decoration: none; font: 700 11px/1.1 system-ui, sans-serif; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .fd-bottom i { font-style: normal; font-size: 20px; line-height: 1; }
  .fd-bottom i svg { width: 22px; height: 22px; }
  .fd-bottom .on { color: #f5c542; background: rgba(245, 197, 66, 0.1); }
  .fd-bottom a:active, .fd-bottom button:active { transform: scale(0.94); }

  /* --- hero: short, Play first --- */
  .home .fd-hero { padding: 12px 12px 14px; gap: 10px; border-radius: 0; }
  .home .fd-crest-wrap, .home .fd-hero-head, .home .home-brand, .home .fd-hero-cards, .home .pb-more .pb-boss { display: none !important; }
  .home .fd-hero-text { display: flex; flex-direction: column; gap: 10px; }
  .home .home-title { order: 1; margin: 0; font-size: clamp(22px, 6.4vw, 27px); line-height: 1.1; text-align: left; letter-spacing: -0.01em; }
  .home .home-title span { display: inline; margin-left: 0.25em; }
  .home .fd-live-strip { order: 2; display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 0 12px; justify-content: flex-start; }
  .home .fd-live-strip::-webkit-scrollbar { display: none; }
  .home .fd-live-strip:empty { display: none; }
  .home .fd-live-strip .fd-pill { flex: none; font-size: 12px; padding: 5px 10px; white-space: nowrap; }
  /* the play box's parts take their own places in the column */
  .home .fd-hero-text .fd-playbox { display: contents; }
  .home .fd-playbox .pb-captain { order: 3; padding: 12px; gap: 10px; border-radius: 16px; background: rgba(16, 20, 46, 0.9); border: 1px solid rgba(245, 197, 66, 0.35); }
  .home .fd-playbox .pb-online { order: 4; }
  .home .fd-playbox .online { order: 4; }
  .home .fd-modes { order: 5; }
  .home .fd-playbox .pb-deck { order: 6; }
  .home .fd-playbox .pb-more { order: 7; justify-content: center; }
  .home .fd-hero-text .home-tag { order: 8; font-size: 13px; line-height: 1.45; text-align: left; margin: 0; opacity: 0.8; }
  .home .fd-road { order: 9; }

  /* mode tiles: the central choice */
  .home .fd-playbox .pb-opts { display: grid; grid-template-columns: 1fr; gap: 8px; justify-content: stretch; }
  .home #mode-home .mode-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0; background: none; border: 0; border-radius: 0; }
  .home #mode-home .mode-pick button { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px; min-height: 58px; padding: 8px 10px; white-space: normal; text-align: left;
    border-radius: 14px; background: rgba(255, 255, 255, 0.04); border: 1.5px solid rgba(255, 255, 255, 0.14); color: #c9cbe6; }
  .home #mode-home .mode-ico { width: 24px; height: 30px; }
  .home #mode-home .mode-txt { display: grid; gap: 1px; min-width: 0; }
  .home #mode-home .mode-txt b { font: 900 15px/1.1 system-ui, sans-serif; color: #fff; }
  .home #mode-home .mode-txt small { display: block; font: 600 11px/1.25 system-ui, sans-serif; color: #a3acd2; }
  .home #mode-home .mode-classic[aria-checked="true"] { background: linear-gradient(135deg, rgba(61, 91, 209, 0.45), rgba(38, 56, 154, 0.35)); border-color: #6f8dff; box-shadow: 0 0 0 1px #6f8dff inset; }
  .home #mode-home .mode-strategy[aria-checked="true"] { background: linear-gradient(135deg, rgba(47, 143, 85, 0.5), rgba(29, 107, 61, 0.35)); border-color: #52d98a; box-shadow: 0 0 0 1px #52d98a inset; }
  .home #mode-home .mode-pick button[aria-checked="true"] .mode-txt small { color: #e3f5ea; }
  /* level: a full-width segmented control; his deck: one row */
  .home #lvl-home .lvl-pick { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; box-sizing: border-box; }
  .home #lvl-home .lvl-pick button { min-height: 40px; padding: 6px 4px; font-size: 13px; }
  .home .fd-playbox .pb-opts .rival-row { flex: none; min-height: 40px; }
  .home .fd-playbox .pb-opts .rival-row select { min-height: 40px; }
  .home .fd-playbox #play-ai { min-height: 54px; font-size: 18px; }
  /* Play online: clearly the other (real players) choice */
  .home .fd-playbox .pb-online .online-btn { min-height: 50px; width: 100%; background: rgba(58, 214, 255, 0.08); border: 1.5px solid rgba(58, 214, 255, 0.55); color: #e7f8ff; }

  /* Boss + Strategy: two compact tiles side by side */
  .home .fd-modes { display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
  .home .fm-tile { position: relative; display: grid; min-height: 0; padding: 0; border-radius: 14px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.12); background: #10142e; }
  .home .fm-boss { border-color: rgba(168, 85, 247, 0.7); background: linear-gradient(160deg, #1d0f33, #0d0716); }
  .home .fm-boss .fm-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; opacity: 0.32; pointer-events: none; }
  .home .fm-strat { background: linear-gradient(160deg, rgba(47, 143, 85, 0.35), #10142e); border-color: rgba(53, 196, 106, 0.55); }
  .home .fm-tile .fm-body { position: relative; display: grid; align-content: start; justify-items: start; text-align: left; padding: 10px; gap: 4px; height: 100%; box-sizing: border-box; }
  .home .fm-boss .fm-eyebrow { color: #c79bff; }
  .home .fm-strat .fm-eyebrow { color: #f5c542; }
  .home .fm-tile .fm-go { align-self: end; }
  .home .fm-boss .fm-go { background: linear-gradient(135deg, #b46cff, #7c3aed 60%, #5b21b6); color: #fff; border-color: transparent; }
  .home .fm-strat .fm-go { background: rgba(53, 196, 106, 0.16); border: 1px solid rgba(53, 196, 106, 0.6); color: #b8f5cf; }
  .home .fm-tile .fm-eyebrow { font-size: 9.5px; letter-spacing: 0.1em; margin: 0; }
  .home .fm-tile .fm-h { font-size: 17px; margin: 0; }
  .home .fm-tile .fm-txt { font-size: 11.5px; line-height: 1.3; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .home .fm-tile .fm-go { min-height: 40px; width: 100%; margin-top: 4px; padding: 6px 8px; font-size: 13px; white-space: nowrap; }
  .home .fm-strat .fm-ico { display: none; }

  /* your deck: one compact card, its stars in a row you can swipe */
  .home .fd-playbox .pb-deck { grid-template-columns: 56px minmax(0, 1fr); gap: 10px; padding: 10px; border-radius: 16px; }
  .home .pb-deck-pack, .home .pb-deck-pack .pack { width: 56px; }
  .home .pb-deck-pack .pack { height: 78px; padding: 8px 3px 6px; }
  .home .pb-deck-pack .pack-emblem { width: 38px; height: 38px; }
  .home .pb-deck-main { display: grid; gap: 6px; min-width: 0; }
  .home .pb-deck-info { display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; scrollbar-width: none; font-size: 12px; }
  .home .pb-deck-info::-webkit-scrollbar { display: none; }
  .home .pb-deck-info .df-chip { flex: none; }
  .home .pb-deck-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .home .pb-deck-acts .pb-deck-btn { min-height: 40px; font-size: 12.5px; padding: 6px 8px; }

  /* How to play's facts: one compact row of four */
  .home .fd-how .fd-facts { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .home .fd-how .fd-facts > div { padding: 8px 4px; border-radius: 12px; }
  .home .fd-how .fd-facts b { font-size: 20px; }
  .home .fd-how .fd-facts span { font-size: 10.5px; line-height: 1.2; display: block; }
  /* the sections below: tighter spacing */
  .home .fd-wrap { gap: 14px; }
  .home .fd-wrap > section { scroll-margin-top: 60px; }
}
@media (max-width: 380px) {
  .home #mode-home .mode-txt small { font-size: 10.5px; }
  .home .fm-tile .fm-txt { -webkit-line-clamp: 2; }
}

/* a new visitor's Play button pulses gently until the first tap (main.js welcomeNewPlayer, 2026-11-27) */
#play-ai.nudge { animation: play-nudge 1.8s ease-in-out infinite; }
@keyframes play-nudge { 0%, 100% { box-shadow: 0 0 0 0 rgba(245, 197, 66, 0.55); } 50% { box-shadow: 0 0 0 10px rgba(245, 197, 66, 0); } }
@media (prefers-reduced-motion: reduce) { #play-ai.nudge { animation: none; } }
/* short phones (≤ 700 px tall): the whole first screen still fits above the bottom bar */
@media (max-width: 760px) and (max-height: 700px) {
  .home .home-title { font-size: 21px; }
  .home #mode-home .mode-pick button { min-height: 46px; padding: 6px 8px; }
  .home #mode-home .mode-txt small { display: none; }
  .home #lvl-home .lvl-pick button, .home .fd-playbox .pb-opts .rival-row, .home .fd-playbox .pb-opts .rival-row select { min-height: 38px; }
  .home .fd-playbox #play-ai { min-height: 50px; }
  .home .fd-playbox .pb-online .online-btn { min-height: 46px; }
  .home .fd-hero-text { gap: 8px; }
  .home .fm-tile .fm-txt { -webkit-line-clamp: 2; }
}
/* narrow phones (≤ 400 px): the header row and the tile buttons fit */
@media (max-width: 400px) {
  .home .fd-top { gap: 6px; padding: 8px 10px; }
  .home .fd-brand { gap: 6px; }
  .home .fd-brand b, .home .fd-brand i { font-size: 14px; }
  .home .fd-brand .fd-mark { width: 28px; height: 28px; }
  .home .fd-top-actions { gap: 4px; }
  .home .fd-top-actions .support-btn, .home .fd-top-actions .settings-btn { min-width: 38px; min-height: 38px; padding: 0 8px; }
  .home .acc-chip { padding: 0 10px; font-size: 12.5px; min-height: 38px; }
  .home .fm-tile .fm-go { font-size: 12px; padding: 6px 4px; letter-spacing: -0.01em; }
}
@media (max-width: 350px) { .home .fd-brand b, .home .fd-brand i { display: none; } }

/* Eagle Eye (reward card): its owner sees the opponent's next card, in a small panel (ui.js eagleFx) */
.eagle-peek { position: fixed; right: 12px; top: 84px; z-index: 30; display: grid; justify-items: center; gap: 4px; padding: 6px 8px 8px; border-radius: 12px;
  background: rgba(10, 16, 36, 0.92); border: 1px solid rgba(255, 209, 102, 0.5); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); pointer-events: none; --cw: 64px; }
.eagle-peek p { margin: 0; font: 900 10px system-ui; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); }
.eagle-peek em { font-size: 11px; color: var(--muted); }
@media (max-width: 760px) { .eagle-peek { top: auto; bottom: 150px; right: 6px; --cw: 48px; } }

/* ---------- Weekly puzzle (home.js renderPuzzle): the week's reward card in 10 pieces, 1 per win against the Boss ---------- */
.fd-puzzle { border-color: rgba(123, 108, 255, 0.45); }
.fd-puzzle .fd-ph { background: linear-gradient(90deg, rgba(123, 108, 255, 0.3), rgba(245, 197, 66, 0.1) 60%, transparent); }
.pz-body { grid-template-columns: 230px minmax(0, 1fr); align-items: center; gap: 22px; }
.pz-info { display: grid; gap: 10px; }
.pz-count { margin: 0; font-size: 15px; color: #fff; }
.pz-grid { display: grid; grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(2, 1fr); gap: 3px; width: 100%; aspect-ratio: 1; padding: 3px;
  border-radius: 12px; background: rgba(0, 0, 0, 0.35); box-shadow: 0 0 0 2px rgba(245, 197, 66, 0.55), 0 10px 26px rgba(0, 0, 0, 0.45); }
.pz-grid i { display: grid; place-items: center; border-radius: 4px; font: 900 18px system-ui; font-style: normal; color: rgba(255, 255, 255, 0.35);
  background: linear-gradient(160deg, #23194d, #0d0a22); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); }
.pz-grid i.on { background: var(--art) var(--x) var(--y) / 500% 200% no-repeat; box-shadow: inset 0 0 0 1px rgba(255, 220, 120, 0.5); animation: pz-in 0.5s ease-out both; }
@keyframes pz-in { from { transform: scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }
.pz-pop { display: grid; justify-items: center; gap: 8px; text-align: center; }
.pz-pop .pz-grid { width: 200px; }
.pz-pop h2 { margin: 0; }
@media (max-width: 760px) { .pz-body { grid-template-columns: 1fr; justify-items: center; } .pz-grid { width: 220px; } .pz-info { width: 100%; } }
@media (prefers-reduced-motion: reduce) { .pz-grid i.on { animation: none; } }
