/* Dejadot Clash. The dejadot-page Night theme, with the Duel arena's gold coin. */
:root {
  --ink: #0E1124;
  --panel: #151935;
  --panel-2: #1B2042;
  --grid: #262B58;
  --text: #ECE9FF;
  --muted: #8C90C2;
  --you: #FFB547;
  --ghost: #9D8CFF;
  --coin: #FFD54A;
  --danger: #FF5D7A;
  --ok: #3DDC84;
  --on-you: #0E1124;
  --radius: 22px;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, "Courier New", monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ink); color: var(--text);
  font-family: var(--display); font-weight: 600; font-size: 17px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
/* Nothing on the page may be wider than the screen (phones scroll sideways otherwise). */
main, footer, .nav, .invite-bar { max-width: 100%; overflow-x: clip; }
body.locked { overflow: hidden; }
a { color: inherit; }
svg, canvas { display: block; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }
h1, h2, h3 { margin: 0; line-height: 1.02; letter-spacing: -.03em; font-weight: 800; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
.eyebrow, .label { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow { color: var(--you); }
.label { color: var(--muted); }
:focus-visible { outline: 2px solid var(--you); outline-offset: 3px; border-radius: 8px; }
.muted { color: var(--muted); }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--ink) 78%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--grid) 60%, transparent);
}
.nav .wrap { display: flex; align-items: center; gap: 22px; height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 22px; letter-spacing: -.02em; text-decoration: none; white-space: nowrap; }
.brand em { font-style: normal; color: var(--ghost); }
.mark { display: flex; align-items: center; gap: 4px; }
.mark i { border-radius: 50%; display: block; }
.mark i:nth-child(1) { width: 12px; height: 12px; background: #7EF0D0; }
.mark i:nth-child(2) { width: 10px; height: 10px; background: var(--ghost); }
.mark i:nth-child(3) { width: 12px; height: 12px; background: #FF4FD8; }
.nav-links { display: flex; gap: 22px; margin-left: auto; font-size: 15px; }
.nav-links a { text-decoration: none; color: var(--muted); transition: color .2s; }
.nav-links a:hover { color: var(--text); }

/* invite bar (a visitor who opened an invite link) */
.invite-bar { position: sticky; top: 64px; z-index: 19; background: color-mix(in srgb, var(--panel-2) 92%, transparent); border-bottom: 1px solid var(--grid); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.invite-bar .wrap { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 8px 0; font-size: 15px; }
.invite-bar .wrap > span:nth-child(2) { flex: 1; min-width: 0; }
.invite-bar b { color: var(--text); }
.pdot { width: 12px; height: 12px; border-radius: 50%; background: var(--c, var(--you)); flex: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--c, var(--you)) 20%, transparent); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px 26px; border-radius: 999px;
  font-family: var(--mono); font-weight: 700; font-size: 13.5px; letter-spacing: .1em; text-transform: uppercase;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: transform .18s ease, box-shadow .25s ease, border-color .2s, opacity .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--you); color: var(--on-you); box-shadow: 0 10px 34px -10px color-mix(in srgb, var(--you) 70%, transparent); }
.btn-ghost { border-color: var(--grid); color: var(--text); background: var(--panel); }
.btn-ghost:hover { border-color: var(--you); }
.btn-sm { padding: 10px 18px; font-size: 12px; }
.btn-danger { background: transparent; border-color: color-mix(in srgb, var(--danger) 50%, var(--grid)); color: var(--danger); }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; cursor: pointer;
  background: var(--panel); border: 1px solid var(--grid); color: var(--text); transition: border-color .2s;
}
.icon-btn:hover { border-color: var(--you); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- hero ---------- */
/* overflow-x: clip keeps the glow below from widening the page, without clipping it vertically. */
.hero { position: relative; padding: 56px 0 88px; overflow-x: clip; }
.hero::before {
  content: ""; position: absolute; inset: -120px -20% auto; height: 760px; pointer-events: none;
  background:
    radial-gradient(520px 380px at 76% 42%, color-mix(in srgb, var(--ghost) 16%, transparent), transparent 70%),
    radial-gradient(420px 320px at 18% 12%, color-mix(in srgb, var(--you) 9%, transparent), transparent 70%);
}
.hero .wrap { position: relative; display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(54px, 9vw, 112px); margin: 18px 0 22px; }
.hero h1 span { color: var(--ghost); }
.lede { font-size: clamp(17px, 1.6vw, 20px); color: var(--muted); max-width: 32em; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; }
.chip { font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--muted); padding: 6px 12px; border-radius: 999px; border: 1px solid var(--grid); background: var(--panel); }
.chip b { color: var(--coin); font-weight: 700; }

.stage { display: grid; justify-items: center; gap: 14px; }
.frame {
  width: min(440px, 100%); border-radius: 30px; padding: 14px; background: #090B19;
  box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--grid) 80%, transparent), 0 40px 90px -30px rgba(0,0,0,.65), 0 0 110px -30px color-mix(in srgb, var(--ghost) 55%, transparent);
  display: grid; gap: 10px;
}
.frame canvas { width: 100%; border-radius: 16px; border: 1px solid var(--grid); background: var(--panel); }
.stage-note { color: var(--muted); font-size: 14px; text-align: center; max-width: 26em; }

/* player chips: the bar along the top of the arena */
.pchips { display: flex; flex-wrap: wrap; gap: 6px; }
.pchip {
  display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px 4px 5px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--grid); font-size: 13.5px; line-height: 1.2; max-width: 100%;
  transition: opacity .3s, border-color .3s, background .3s;
}
.pchip .st { width: 20px; height: 20px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent); transition: background .25s, box-shadow .25s; }
.pchip .st svg { width: 12px; height: 12px; fill: none; stroke: #0E1124; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; display: none; }
.pchip .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pchip .tag { font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }
.pchip.me { border-color: color-mix(in srgb, var(--c) 55%, var(--grid)); }
.pchip.coin .st { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
.pchip.coin .st .ok { display: block; }
.pchip.out { opacity: .55; background: transparent; }
.pchip.out .st { background: var(--danger); box-shadow: none; }
.pchip.out .st .x { display: block; stroke: #fff; }
.pchip.out .nm { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--muted); }
.pchip.small { font-size: 12px; padding: 3px 9px 3px 4px; }
.pchip.small .st { width: 16px; height: 16px; }
.pchip.small .st svg { width: 10px; height: 10px; }

/* ---------- sections ---------- */
section { padding: 88px 0; scroll-margin-top: 64px; }
.sec-head { max-width: 660px; margin-bottom: 44px; }
.sec-head h2 { font-size: clamp(32px, 4.6vw, 52px); margin: 12px 0 14px; }
.sec-head p { color: var(--muted); }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: step; margin-bottom: 18px; }
.step { position: relative; padding: 28px 26px 30px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--grid); transition: transform .25s ease, border-color .25s; }
.step:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--you) 60%, var(--grid)); }
.step::before { counter-increment: step; content: "0" counter(step); font-family: var(--mono); font-size: 13px; font-weight: 700; letter-spacing: .1em; color: var(--you); }
.step h3 { font-size: 26px; margin: 14px 0 10px; }
.step p { color: var(--muted); font-size: 16px; }

.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px; }
.card { grid-column: span 2; padding: 26px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--grid); transition: transform .25s ease, border-color .25s; }
.card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--you) 60%, var(--grid)); }
.card.wide { grid-column: span 3; }
.card .ico { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; margin-bottom: 18px; background: color-mix(in srgb, var(--c, var(--you)) 14%, transparent); color: var(--c, var(--you)); }
.card .ico svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.card h3 { font-size: 21px; margin-bottom: 8px; letter-spacing: -.02em; }
.card p { color: var(--muted); font-size: 15.5px; }
.card kbd, .kbd { font-family: var(--mono); font-size: 12px; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--grid); background: var(--ink); color: var(--text); }

/* legend swatches for the arena look */
.legend { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 26px; color: var(--muted); font-size: 14.5px; }
.legend span { display: inline-flex; align-items: center; gap: 9px; }
.legend i { width: 14px; height: 14px; border-radius: 50%; display: block; flex: none; }

/* ---------- arena explorer ---------- */
.panel { padding: 40px; border-radius: 30px; background: var(--panel); border: 1px solid var(--grid); position: relative; overflow: hidden; }
.explorer { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.explorer .preview { aspect-ratio: 318 / 287; width: 100%; max-width: 440px; justify-self: center; position: relative; }
.explorer svg { width: 100%; height: 100%; overflow: visible; }
.range-row { display: flex; align-items: center; gap: 16px; margin: 22px 0 26px; }
.range-row output { font-family: var(--mono); font-weight: 700; font-size: 34px; min-width: 2ch; color: var(--you); line-height: 1; }
input[type=range] { flex: 1; accent-color: var(--you); height: 28px; }
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stat-box { padding: 14px 16px; border-radius: 16px; background: var(--ink); border: 1px solid var(--grid); }
.stat-box b { display: block; font-family: var(--mono); font-size: 20px; font-weight: 700; color: var(--text); margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat-box .label { font-size: 10.5px; }
.note { margin-top: 18px; color: var(--muted); font-size: 14.5px; }

/* ---------- practice ---------- */
.practice { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.field { display: grid; gap: 10px; margin-bottom: 22px; }
.field > .label { font-size: 11px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button {
  padding: 9px 14px; border-radius: 12px; border: 1px solid var(--grid); background: var(--ink); color: var(--muted);
  font-family: var(--mono); font-weight: 700; font-size: 13px; cursor: pointer; min-width: 44px; transition: border-color .2s, color .2s, background .2s;
}
.seg button[aria-pressed="true"] { border-color: var(--you); color: var(--text); background: color-mix(in srgb, var(--you) 12%, var(--ink)); }
.seg button:hover { color: var(--text); }

/* colour swatches (profile modal and practice) */
.swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.sw {
  position: relative; display: grid; justify-items: center; gap: 6px; padding: 10px 4px 8px; border-radius: 14px; cursor: pointer;
  border: 1.5px solid var(--grid); background: var(--ink); color: var(--muted); font-family: var(--mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase;
  transition: border-color .2s, color .2s, transform .15s;
}
.sw:hover:not(:disabled) { transform: translateY(-2px); color: var(--text); }
.sw i { width: 22px; height: 22px; border-radius: 50%; background: var(--c); display: block; box-shadow: 0 0 0 5px color-mix(in srgb, var(--c) 16%, transparent); }
.sw[aria-checked="true"] { border-color: var(--c); color: var(--text); background: color-mix(in srgb, var(--c) 10%, var(--ink)); }
.sw:disabled { cursor: not-allowed; opacity: .35; }
.sw:disabled i { box-shadow: none; background: repeating-linear-gradient(45deg, var(--c) 0 3px, transparent 3px 6px); }
.sw:disabled::after { content: "Taken"; position: absolute; top: 4px; right: 6px; font-size: 7.5px; color: var(--danger); }

/* ---------- lobby ---------- */
.lobby-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 40px; align-items: start; }
.how-lobby { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 12px; counter-reset: i; }
.how-lobby li { counter-increment: i; display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: start; color: var(--muted); font-size: 15.5px; }
.how-lobby li::before { content: counter(i); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--you); color: var(--on-you); font-family: var(--mono); font-weight: 700; font-size: 13px; }
.how-lobby b { color: var(--text); }
.lobby-card { padding: 30px; border-radius: 24px; background: var(--ink); border: 1px solid var(--grid); display: grid; gap: 18px; }
.lobby-card h3 { font-size: 28px; }
.lobby-card .big-invite { font-size: clamp(24px, 3vw, 32px); line-height: 1.15; }
.lobby-card .big-invite b { color: var(--c, var(--you)); }
.linkbox { display: flex; gap: 8px; }
.linkbox input {
  flex: 1; min-width: 0; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--grid); background: var(--panel); color: var(--text);
  font-family: var(--mono); font-size: 13px;
}
.roster { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.roster li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--grid); animation: pop .35s ease; }
.roster li .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roster li .tag { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.roster li.empty { justify-content: center; color: var(--muted); font-size: 14px; border-style: dashed; background: transparent; animation: none; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row.spread { justify-content: space-between; }
.status-line { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 15px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--grid); border-top-color: var(--you); animation: spin .9s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.mode-note { font-family: var(--mono); font-size: 11.5px; color: var(--muted); padding: 10px 12px; border-radius: 12px; border: 1px dashed var(--grid); line-height: 1.5; }
.mode-note b { color: var(--coin); }

/* ---------- faq ---------- */
.two-col { display: grid; grid-template-columns: .85fr 1.15fr; gap: 48px; align-items: start; }
details { border-bottom: 1px solid var(--grid); padding: 4px 0; }
details:first-of-type { border-top: 1px solid var(--grid); }
summary { list-style: none; cursor: pointer; padding: 18px 40px 18px 0; position: relative; font-weight: 800; font-size: 19px; letter-spacing: -.015em; }
summary::-webkit-details-marker { display: none; }
summary::after { content: ""; position: absolute; right: 6px; top: 50%; width: 10px; height: 10px; margin-top: -8px; border-right: 2px solid var(--you); border-bottom: 2px solid var(--you); transform: rotate(45deg); transition: transform .25s; }
details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
details p { color: var(--muted); padding: 0 40px 20px 0; font-size: 16px; }

footer { padding: 36px 0 48px; color: var(--muted); font-size: 14.5px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; border-top: 1px solid var(--grid); padding-top: 28px; }
footer a { text-decoration: none; }footer a:hover { color: var(--you); }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(5, 6, 16, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } }
.modal-card { width: min(480px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; overscroll-behavior: contain; padding: 28px; border-radius: 26px; background: var(--panel); border: 1px solid var(--grid); box-shadow: 0 40px 90px -30px rgba(0,0,0,.8); display: grid; gap: 18px; animation: rise .28s cubic-bezier(.2,.7,.2,1); }
@keyframes rise { from { transform: translateY(16px) scale(.98); opacity: 0; } }
.modal-card h3 { font-size: 28px; }
.modal-card .sub { color: var(--muted); font-size: 15px; margin-top: -8px; }
.text-input { width: 100%; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--grid); background: var(--ink); color: var(--text); font: inherit; font-size: 17px; }
.text-input:focus { outline: none; border-color: var(--you); }
.form-error { color: var(--danger); font-size: 14px; min-height: 1em; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- game overlay ---------- */
/* minmax(0, 1fr): the arena row must never grow to fit the canvas, or fitting the canvas to the row feeds back. */
/* 100dvh: on phones the visible height excludes the browser's address bar, so the arena never hides behind it. */
.game {
  position: fixed; top: 0; left: 0; width: 100%; height: 100vh; height: 100dvh; z-index: 50; background: var(--ink);
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr);
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
  overscroll-behavior: none;
}
.g-top { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px 10px; border-bottom: 1px solid var(--grid); background: color-mix(in srgb, var(--panel) 60%, var(--ink)); }
.g-top .pchips { flex: 1; min-width: 0; }
.g-meta { display: flex; align-items: center; gap: 8px; flex: none; }
.g-meta .label { white-space: nowrap; margin-right: 4px; }
.g-stage { position: relative; display: grid; place-items: center; padding: 12px; min-height: 0; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; cursor: crosshair; }
.g-stage canvas { border-radius: 14px; border: 1px solid var(--grid); background: var(--panel); touch-action: none; }
.g-banner { position: absolute; left: 50%; top: 22px; transform: translateX(-50%); padding: 9px 16px; border-radius: 999px; background: color-mix(in srgb, var(--panel) 92%, transparent); border: 1px solid var(--grid); font-size: 14px; color: var(--muted); white-space: nowrap; max-width: calc(100% - 32px); overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.g-banner b { color: var(--danger); }
.g-hint { text-align: center; padding: 0 16px 12px; font-size: 10px; }

.toasts { position: fixed; z-index: 70; left: 50%; bottom: 26px; transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; pointer-events: none; width: calc(100% - 32px); }
.toast { display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--grid); box-shadow: 0 16px 40px -16px rgba(0,0,0,.7); font-size: 14.5px; animation: toast-in .3s cubic-bezier(.2,.7,.2,1); max-width: 100%; }
.toast.leaving { opacity: 0; transform: translateY(8px); transition: opacity .3s, transform .3s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

.win { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 16px; background: rgba(5, 6, 16, .55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade .3s ease; }
/* A column: the winner part and the buttons always show; only the standings list scrolls when it doesn't fit. */
.win-card { width: min(460px, 100%); max-height: calc(100% - 16px); overflow: hidden; padding: 32px 28px 26px; border-radius: 28px; background: var(--panel); border: 1px solid var(--grid); text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; box-shadow: 0 40px 100px -30px rgba(0,0,0,.85), 0 0 120px -40px var(--c, var(--coin)); animation: rise .35s cubic-bezier(.2,.7,.2,1); }
.win-dots { display: flex; gap: 12px; }
.win-dot { width: 64px; height: 64px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 10px color-mix(in srgb, var(--c) 18%, transparent), 0 0 0 22px color-mix(in srgb, var(--c) 8%, transparent); animation: beat 1.6s ease-in-out infinite; margin: 18px 0 10px; }
@keyframes beat { 50% { transform: scale(1.08); } }
.win-card h2 { font-size: clamp(36px, 7vw, 56px); }
.win-card h2 span { color: var(--c, var(--coin)); }
.win-card .sub { color: var(--muted); }
.standings { list-style: none; margin: 6px 0 4px; padding: 0 4px 0 0; display: grid; gap: 6px; width: 100%; text-align: left; counter-reset: s; flex: 0 1 auto; min-height: 64px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--grid) transparent; }
.win-card > :not(.standings) { flex-shrink: 0; }
.standings li { counter-increment: s; display: grid; grid-template-columns: 22px 14px 1fr auto; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: var(--ink); font-size: 14.5px; }
.standings li::before { content: counter(s); font-family: var(--mono); font-size: 12px; color: var(--muted); }
.standings li .pdot { width: 12px; height: 12px; box-shadow: none; }
.standings li .why { font-family: var(--mono); font-size: 10.5px; color: var(--muted); letter-spacing: .04em; text-align: right; }
.standings li.w .why { color: var(--coin); }
.standings .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 6px; }

/* "You died" */
.died-card { --c: var(--danger); width: min(400px, 100%); }
.died-x { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 14px 0 8px; background: var(--danger); box-shadow: 0 0 0 10px color-mix(in srgb, var(--danger) 18%, transparent), 0 0 0 22px color-mix(in srgb, var(--danger) 7%, transparent); animation: rise .35s cubic-bezier(.2,.7,.2,1); }
.died-x svg { width: 30px; height: 30px; fill: none; stroke: #fff; stroke-width: 3.2; stroke-linecap: round; }
.died-card h2 span { color: var(--danger); }
.died-card .left { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); transition-delay: calc(var(--i, 0) * 70ms); }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .hero { padding: 36px 0 56px; }
  .hero::before { inset: -120px 0 auto; }
  /* minmax(0, 1fr): a column may shrink below its content's width instead of pushing the page wider. */
  .hero .wrap, .two-col, .explorer, .practice, .lobby-grid { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .bento { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal { padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
  .modal-card { max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); }
  .card, .card.wide { grid-column: span 3; }
  .nav-links { display: none; }
  section { padding: 64px 0; }
  .panel { padding: 26px 20px; }
  .invite-bar { top: 64px; }
}
@media (max-width: 560px) {
  .wrap { width: calc(100% - 32px); }
  .nav .wrap { height: 56px; }
  .invite-bar { top: 56px; }
  section { scroll-margin-top: 56px; }
  .brand { font-size: 20px; }
  .hero h1 { font-size: clamp(44px, 14vw, 64px); }
  .panel { padding: 22px 16px; border-radius: 24px; }
  .stat-box { padding: 12px; }
  .stat-box b { font-size: 16px; overflow-wrap: anywhere; }
  .range-row output { font-size: 28px; }
  .step { padding: 22px 20px 24px; }
  .card { padding: 22px 20px; }
  summary { font-size: 17px; }
  details p { padding-right: 0; }
  .modal-card { padding: 22px 18px; gap: 16px; border-radius: 22px; }
  .modal-card h3 { font-size: 24px; }
  .modal-actions .btn { flex: 1; }
  .linkbox input { font-size: 16px; } /* under 16px, iOS zooms the page in on focus */
  .lobby-card h3 { font-size: 24px; }
  .roster li { padding: 9px 12px; }
  .pchip .nm { max-width: 10ch; }
  .win-card { padding: 24px 18px 20px; border-radius: 22px; }
  .win-dot, .died-x { width: 52px; height: 52px; }
  .g-banner { font-size: 12.5px; padding: 7px 12px; top: 14px; }
  .g-hint { padding-bottom: 8px; }
  .toasts { bottom: max(16px, env(safe-area-inset-bottom)); }
  .card, .card.wide { grid-column: span 6; }
  .cta .btn { width: 100%; }
  .swatches { grid-template-columns: repeat(5, 1fr); gap: 6px; }
  .sw { font-size: 0; padding: 10px 2px; }
  .sw:disabled::after { font-size: 0; }
  .lobby-card { padding: 22px 18px; }
  .linkbox { flex-direction: column; }
  .g-top { padding: 8px 10px; }
  .pchip { font-size: 12px; padding: 3px 9px 3px 4px; }
  .pchip .st { width: 16px; height: 16px; }
  .g-stage { padding: 8px; }
  .icon-btn { width: 36px; height: 36px; }
  .g-meta .label { display: none; }
}
/* Phones held sideways: very little height, so the game chrome shrinks and the arena gets the room. */
@media (max-height: 520px) {
  .g-top { padding: 6px 10px; }
  .pchip { font-size: 12px; padding: 2px 8px 2px 3px; }
  .pchip .st { width: 15px; height: 15px; }
  .icon-btn { width: 34px; height: 34px; }
  .g-stage { padding: 6px; }
  .g-hint { display: none; }
  .win { padding: 8px; }
  .win-card { padding: 16px 18px 14px; gap: 8px; border-radius: 20px; max-height: calc(100% - 8px); }
  .win-dot, .died-x { width: 40px; height: 40px; margin: 8px 0 4px; }
  .win-card h2 { font-size: 30px; }
  .modal-card { padding: 18px; gap: 12px; }
  .modal-card h3 { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { transition: none; }
  .win-dot, .spinner { animation: none; }
}
