/* WallOut website v4 — the approved teardown plan (intel/WEBSITE_TEARDOWN.md), in the app's own look
   (tokens.css + ui.css are the app's colours, panels, pills and the Play button).
   Craft rules: the wall is the shape (wall-gap notches on the header and dividers), cyan only ever means
   you and pink only means them, one texture (a faint board grid), huge Roboto Black, no glow at rest. */
:root {
  --line: rgba(255, 255, 255, 0.13);
  --wrap: 1240px;
  --gut-l: max(16px, env(safe-area-inset-left, 0px));
  --gut-r: max(16px, env(safe-area-inset-right, 0px));
  --top-h: 64px;
  --gold: #ffc233; --silver: #d6d8de; --bronze: #d08b5b;
}
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--top-h) + 16px); }
body {
  background-color: var(--backdrop);
  /* the one texture: the board's grid, very faint */
  background-image: linear-gradient(rgba(255, 255, 255, 0.026) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.026) 1px, transparent 1px);
  background-size: 56px 56px; background-position: center -1px;
  overflow-x: hidden;
}
img { max-width: 100%; }
.small { font-size: 13px; }
.skip { position: absolute; inset-inline-start: 12px; top: -80px; z-index: 100; background: #fff; color: #111; font-weight: 900; padding: 10px 16px; border-radius: 12px; }
.skip:focus { top: 8px; }   /* hidden above the page, not off to one side: a far-left offset scrolls sideways on right-to-left pages */
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* the app's Play button, without the blurred halo: no glow at rest */
.hero::after { display: none; }

/* ================= top bar ================= */
.top { position: sticky; top: 0; z-index: 40; background: #050506; }   /* solid: at 0.93 the big headings showed through while scrolling */
.top::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--line); }
.top-in { max-width: var(--wrap); margin: 0 auto; height: var(--top-h); padding-left: var(--gut-l); padding-right: var(--gut-r); display: flex; align-items: center; gap: 14px; }
/* the slot: a gap in the wall line, bracketed by two wall pieces. The wordmark drops into it once the
   big hero logo has scrolled away. */
.slot { display: flex; align-items: center; width: 150px; flex: none; margin-right: 18px; }
.slot .brand { display: block; width: 100%; height: auto; }

.nav { display: flex; gap: 2px; }
.nav a { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 12px; font-weight: 900; font-size: 14.5px; color: var(--soft); transition: color 0.15s, background 0.15s; }
.nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.code { margin-left: auto; display: flex; align-items: center; height: 40px; border: 1.2px solid var(--ghost-line); border-radius: 12px; background: var(--field); transition: border-color 0.15s; }
.code:focus-within { border-color: #fff; }
.code input { width: 112px; height: 100%; border: 0; background: transparent; padding: 0 4px 0 12px; font-weight: 900; font-size: 14px; letter-spacing: 0.14em; text-transform: uppercase; outline: none; }
.code input::placeholder { color: var(--faint); letter-spacing: 0; text-transform: none; font-weight: 700; }
.code button { width: 36px; height: 100%; border: 0; background: transparent; color: var(--soft); display: grid; place-items: center; border-radius: 0 12px 12px 0; }
.code button:hover { color: #fff; }
.code button svg, .app-strip button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.code.bad { border-color: var(--bad); animation: nudge 0.3s; }
@keyframes nudge { 30% { transform: translateX(-5px); } 70% { transform: translateX(4px); } }
.icon-btn { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; border: 1.2px solid var(--ghost-line); background: var(--ghost-fill); color: var(--soft); transition: color 0.15s, border-color 0.15s; }
.icon-btn:hover { color: #fff; border-color: rgba(255, 255, 255, 0.4); }
.icon-btn .on { display: none; } .icon-btn[aria-pressed='true'] .on { display: block; } .icon-btn[aria-pressed='true'] .off { display: none; }
.icon-btn[aria-pressed='true'] { color: #fff; }
.top-play { flex: none; }
.app-strip { display: none; }
.code-open { display: none; }

/* ================= scroll progress: ten wall pips ================= */
.pips-rail { position: fixed; right: max(18px, env(safe-area-inset-right, 0px)); top: 50%; transform: translateY(-50%); z-index: 30; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.pips-rail i { display: block; width: 4px; height: 18px; border-radius: 2px; background: rgba(255, 255, 255, 0.16); transition: background 0.25s, transform 0.35s var(--ease-back); }
.pips-rail i.on { background: var(--me); }
@media (max-width: 1320px) { .pips-rail { display: none; } }

/* ================= 1 · first screen ================= */
.first { max-width: var(--wrap); margin: 0 auto; padding: clamp(20px, 4.5vh, 56px) var(--gut-r) clamp(12px, 3vh, 40px) var(--gut-l);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.06fr); gap: clamp(24px, 4vw, 64px); align-items: center; min-height: min(calc(100vh - var(--top-h)), 880px); min-height: min(calc(100svh - var(--top-h)), 880px); }
.hero-copy { min-width: 0; }
#h-play { font-size: clamp(44px, 5.4vw, 76px); line-height: 0.95; letter-spacing: -0.032em; margin-bottom: 16px; }
.lede { font-size: clamp(16px, 1.25vw, 19px); color: var(--soft); max-width: 38ch; line-height: 1.5; }
.learn { border: 0; background: none; padding: 6px 2px; color: var(--soft); font-weight: 700; font-size: 15px; }
.learn b { color: #fff; font-weight: 900; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.learn:hover b { text-decoration-color: var(--me); }
.quick { list-style: none; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; max-width: 560px; }
.quick a { display: grid; grid-template-columns: 24px minmax(0, 1fr); column-gap: 10px; align-items: center; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--hairline); background: linear-gradient(180deg, var(--panel-top), var(--panel-bottom)); transition: border-color 0.15s, transform 0.2s var(--ease-back); }
.quick a:hover { border-color: var(--hairline-selected); }
.quick a:active { transform: translateY(3px); }
.quick .ic, .quick .ico { width: 22px; height: 22px; grid-row: span 2; }
.quick b { font-size: 14.5px; }
.quick span { color: var(--soft); font-size: 12.5px; font-weight: 700; line-height: 1.25; overflow-wrap: break-word; }   /* wraps rather than cutting: longer words in other languages */
/* open games: only there when someone is really waiting (GET /rooms) */
.open { margin-top: 22px; max-width: 560px; }
.open h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 13px; font-weight: 900; color: var(--soft); letter-spacing: 0; }
.open h2::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 4px rgba(70, 220, 130, 0.14); }
.open ul { list-style: none; margin: 0; padding: 0; border: 1px solid var(--hairline); border-radius: 16px; background: linear-gradient(180deg, var(--panel-top), var(--panel-bottom)); overflow: hidden; }
.open li + li { border-top: 1px solid rgba(255, 255, 255, 0.07); }
.open a { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; align-items: center; column-gap: 12px; padding: 10px 10px 10px 14px; transition: background 0.15s; }
.open a:hover { background: rgba(255, 255, 255, 0.03); }
.open .pip { width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffd0de, var(--op) 60%); }
.open .pip.four { background: conic-gradient(var(--me) 0 25%, var(--op) 0 50%, #b6ff3c 0 75%, #ffc233 0); }
.open .who { min-width: 0; display: flex; flex-direction: column; }
.open .who b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.open .who span { color: var(--soft); font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.open .join { display: inline-flex; align-items: center; height: 32px; padding: 0 16px; border-radius: 999px; background: #fff; color: #0b0b0d; font-size: 13.5px; font-weight: 900; }
.cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: clamp(18px, 3vh, 28px); }
.play-now { width: auto; min-width: 320px; padding-right: 28px; text-decoration: none; }
.hero.pill.play-now { min-height: 72px; } /* beats ui.css .hero.pill 60px: the mark's balls need clear space from the pill's edge */
.play-now .mark { width: 92px; }
.play-now .mark-bar { left: 28px; top: calc(50% - 3px); width: 40px; height: 6px; }
.play-now .ball { width: 17px; height: 17px; }
.play-now .ball.op { left: 51px; top: calc(50% - 26px); }
.play-now .ball.me { left: 28px; top: calc(50% + 9px); }
.play-now .title { display: block; font-size: 26px; }
.play-now .sub { display: block; margin-top: 4px; }
.play-now .chev { margin-left: auto; flex: none; }
.play-now > span:nth-child(2) { margin-right: 22px; } /* the arrow keeps 22px from the text and sits at the right end when the pill is full width */
@media (max-width: 1100px) { .play-now .nd { display: none; } } /* phones and tablets: one line, so the text never wraps or spills out of the pill */
.take { min-height: 60px; border-radius: 999px; padding: 0 24px 0 20px; gap: 10px; }
.take[aria-pressed='true'] { border-color: var(--me); }
.online { margin-top: 16px; display: flex; gap: 10px; align-items: center; font-weight: 700; color: var(--soft); }
.online .dot { animation: beat 2.4s ease-in-out infinite; }
@keyframes beat { 0%, 100% { transform: scale(1); } 50% { transform: scale(0.72); } }
.hero-board { margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.board-box { position: relative; width: min(100%, max(calc(100vh - 240px), 360px), 640px); width: min(100%, max(calc(100svh - 240px), 360px), 640px); aspect-ratio: 1; margin-inline: auto; }   /* short screens (a phone on its side) keep a real-size board */
.coach, .race { width: calc(min(100%, max(calc(100vh - 240px), 360px), 640px) * 0.9); width: calc(min(100%, max(calc(100svh - 240px), 360px), 640px) * 0.9); margin-inline: auto; }
.board-box canvas, .tv-board canvas, .art canvas, .daily-board canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: manipulation; }
#hero-board, #daily-board { outline: none; border-radius: 22px; }
#hero-board:focus-visible, #daily-board:focus-visible { outline: 2px solid var(--me); outline-offset: 4px; }   /* keyboard players see where they are */
.race { display: flex; align-items: center; gap: 12px; }
.race .side { display: flex; align-items: center; gap: 7px; flex: none; }
.race .side b { font-size: 24px; font-weight: 900; }
.race .side span:not(.pip-ball) { color: var(--soft); font-size: 13px; font-weight: 700; }
.race .cap { flex: 1; }
.coach { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 10px 10px 10px 16px; border-radius: 16px; border: 1px solid var(--hairline); transition: border-color 0.25s; background: linear-gradient(180deg, var(--panel-top), var(--panel-bottom)); }
.coach.live { border-color: rgba(70, 214, 255, 0.55); }
.coach p { flex: 1; min-width: 0; font-weight: 900; font-size: 15px; line-height: 1.35; color: var(--soft); }
.coach.live p { color: #fff; }
.coach .steps[hidden] { display: none; }
.coach .steps { display: flex; gap: 4px; flex: none; }
.coach .steps i { display: block; width: 16px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.16); }
.coach .steps i.on { background: var(--me); }
.coach-btns { display: flex; gap: 8px; flex: none; }
.bump { animation: bump 0.32s var(--ease-back); }
@keyframes bump { 40% { transform: scale(1.25); } }

/* arrival: the wordmark is revealed by a white wall bar sweeping across it, the three verbs are drawn in
   the same way, the rest simply appears; the board drops in from the canvas (board.js intro). */
/* arrival: everything is there at first paint; the one moving piece is the wordmark, revealed by a white wall
   bar sweeping across it (CSS only, so it never waits for fonts or scripts). The board drops in on its canvas. */
.hero-mark img { clip-path: inset(0 100% 0 0); animation: draw 0.56s 0.08s cubic-bezier(0.65, 0, 0.35, 1) forwards; }
.sweep { position: absolute; top: -8%; bottom: -8%; left: 0; width: 9px; margin-left: -4px; border-radius: 3px; background: #fff; opacity: 0; animation: sweep 0.56s 0.08s cubic-bezier(0.65, 0, 0.35, 1) forwards; }
@keyframes draw { to { clip-path: inset(0 0 0 0); } }
@keyframes sweep { 0% { left: 0; opacity: 1; } 85% { left: 100%; opacity: 1; } 100% { left: 100%; opacity: 0; } }

/* ================= wall-gap divider: a wall with a gap you scroll through ================= */
.wall-gap { position: relative; max-width: var(--wrap); height: 4px; margin: clamp(64px, 10vh, 112px) auto; }
.wall-gap::before { content: ''; position: absolute; left: var(--gut-l); right: var(--gut-r); top: 1.5px; height: 1px;
  background: linear-gradient(90deg, var(--line) calc(50% - 92px), transparent calc(50% - 92px), transparent calc(50% + 92px), var(--line) calc(50% + 92px)); }
.wall-gap i { position: absolute; top: 0; width: 60px; height: 4px; border-radius: 2px; background: #fff; opacity: 0; transition: transform 0.6s var(--ease-back), opacity 0.2s; }
.wall-gap i:first-child { left: calc(50% - 92px); transform: translateX(-46px); }
.wall-gap i:last-child { left: calc(50% + 32px); transform: translateX(46px); }
.wall-gap.in i { opacity: 1; transform: none; }

/* ================= sections ================= */
.sec { max-width: var(--wrap); margin: clamp(104px, 15vh, 168px) auto 0; padding-left: var(--gut-l); padding-right: var(--gut-r); }
.wall-gap + .sec, .app-strip + .wall-gap + .sec { margin-top: 0; }
.sec-head.center, .sec-foot.center { text-align: center; }
.sec-head.center p { margin-inline: auto; }
.sec-head { margin-bottom: clamp(22px, 3vw, 36px); }
.sec-head h2, .daily h2, .ladder h2, .app-copy h2 { font-size: clamp(38px, 5.4vw, 76px); line-height: 0.95; letter-spacing: -0.032em; text-wrap: balance; }
.sec-head p { color: var(--soft); font-size: 17px; margin-top: 12px; max-width: 52ch; line-height: 1.45; }
.sec-foot { margin-top: 22px; }

/* ---------- 3 · WallOut TV ---------- */
.tv { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr); gap: clamp(24px, 4vw, 64px); align-items: center; }
.tv-head { margin-bottom: 4px; }
.tv-screen { display: flex; flex-direction: column; gap: 10px; min-width: 0; max-width: 720px; }
.strip { display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 0 16px; border-radius: 16px; background: linear-gradient(180deg, var(--panel-top), var(--panel-bottom)); border: 1px solid var(--hairline); transition: border-color 0.2s; }
.strip.on { border-color: rgba(255, 255, 255, 0.55); }
.strip .nm { font-weight: 900; font-size: 16px; }
a.nm { color: inherit; text-decoration: none; }
a.nm:hover { text-decoration: underline; text-underline-offset: 3px; }
.strip .lv { color: var(--soft); font-size: 12.5px; font-weight: 700; }
.strip .pips { display: flex; gap: 3px; margin-inline-start: auto; }
.strip .pips i { display: block; width: 4px; height: 14px; border-radius: 2px; background: #fff; transition: background 0.3s; }
.strip .pips i.used { background: rgba(255, 255, 255, 0.14); }
.strip .clock { font-weight: 900; font-size: 19px; min-width: 58px; text-align: right; color: var(--soft); font-variant-numeric: tabular-nums; }
.strip.on .clock { color: #fff; }
.strip .won { display: none; height: 22px; padding: 0 9px; border-radius: 11px; background: #fff; color: #111; font-size: 12px; font-weight: 900; align-items: center; }
.strip.is-won .won { display: inline-flex; }
.tv-board { position: relative; aspect-ratio: 1; width: min(100%, max(calc(100vh - 250px), 360px)); width: min(100%, max(calc(100svh - 250px), 360px)); margin-inline: auto; }
.badge { position: absolute; left: 50%; bottom: 1.4%; transform: translateX(-50%); height: 24px; padding: 0 11px; display: inline-flex; align-items: center; border-radius: 12px; background: rgba(8, 8, 9, 0.94); border: 1px solid var(--hairline); color: var(--soft); font-size: 12px; font-weight: 900; white-space: nowrap; }
.tv-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.stat b { display: block; font-size: clamp(64px, 7vw, 104px); line-height: 0.88; letter-spacing: -0.04em; }
.stat span { color: var(--soft); font-weight: 900; font-size: 16px; }
.tourney h3 { font-size: 20px; }
.tourney p { color: var(--soft); font-weight: 700; margin-top: 6px; line-height: 1.45; }
.countdown { display: flex; gap: 8px; margin: 16px 0 8px; }
.countdown span { display: flex; flex-direction: column; min-width: 0; flex: 1; padding: 10px 10px 8px; border-radius: 14px; background: var(--field); border: 1px solid var(--hairline); }
.countdown b { font-size: 26px; line-height: 1; }
.countdown i { font-style: normal; font-size: 11.5px; color: var(--soft); font-weight: 700; margin-top: 4px; }
.tourney .ghost { margin-top: 12px; }
.tv-side > .ghost { align-self: flex-start; justify-self: start; grid-column: 1 / -1; }
.tv-now { display: flex; flex-direction: column; gap: 4px; padding-top: 4px; }
.tv-now b { font-size: 22px; }

/* ---------- 4 · ways to play ---------- */
.modes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.mode.big { grid-row: span 2; }
.mode.big a { padding: 14px 14px 22px; }
.mode.big .art { width: min(100%, 340px); align-self: center; }
.mode.big .name { font-size: 28px; }
.mode.big .status { font-size: 15px; }
.mode.big .txt { grid-template-columns: 30px minmax(0, 1fr); padding: 10px 8px 0; }
.mode.big .txt .ico { width: 28px; height: 28px; }
.mode .go { grid-column: 2; justify-self: start; margin-top: 14px; pointer-events: none; }
.mode:not(.big) a { flex-direction: row; align-items: center; gap: 14px; padding: 10px 16px 10px 10px; }
.mode:not(.big) .art { width: 48%; flex: none; }
.mode:not(.big) .txt { flex: 1; padding: 0; }
.mode { min-width: 0; }
.mode a { display: flex; flex-direction: column; height: 100%; border-radius: 22px; padding: 10px 10px 16px; background: linear-gradient(180deg, var(--panel-top), var(--panel-bottom)); border: 1px solid var(--hairline);
  box-shadow: 0 6px 0 var(--slab), 0 16px 30px rgba(0, 0, 0, 0.45); transition: transform 0.26s var(--ease-back), box-shadow 0.26s var(--ease-back), border-color 0.15s; }
.mode a:hover { border-color: var(--hairline-selected); }
.mode a:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--slab), 0 10px 22px rgba(0, 0, 0, 0.45); transition-duration: 0.09s; }
.art { position: relative; aspect-ratio: 1; }
.mode .txt { display: grid; grid-template-columns: 26px minmax(0, 1fr); column-gap: 10px; align-items: center; padding: 6px 6px 0; }
.mode .txt .ic, .mode .txt .ico { width: 24px; height: 24px; }
.mode .ico { position: relative; display: block; }
.mode .name { font-weight: 900; font-size: 17px; }
.mode .status { grid-column: 2; color: var(--soft); font-size: 13px; font-weight: 700; line-height: 1.35; margin-top: 2px; }

/* ---------- 5 · bots ---------- */
.bots { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; align-items: end; }
.bot { min-width: 0; display: flex; flex-direction: column; gap: 10px; padding: 10px 10px 16px; border-radius: 22px; background: linear-gradient(180deg, var(--panel-top), var(--panel-bottom)); border: 1px solid var(--hairline); margin-bottom: calc((var(--lv) - 1) * 26px); }
.bot > div { padding: 0 6px; }
.bot h3 { font-size: 22px; }
.bot .lvl { display: flex; align-items: center; gap: 3px; margin: 6px 0 9px; }
.bot .lvl i { display: block; width: 14px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.14); }
.bot .lvl i.on { background: #fff; }
.bot .lvl span { margin-left: 8px; color: var(--soft); font-size: 12.5px; font-weight: 900; }
.bot p { color: var(--soft); font-size: 14px; line-height: 1.4; font-weight: 700; }

/* ---------- 6 · today's wall ---------- */
.daily { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr); gap: clamp(20px, 4vw, 56px); align-items: center; padding: clamp(14px, 2.4vw, 28px); border-radius: 32px;
  background: linear-gradient(180deg, var(--panel-top), var(--panel-bottom)); border: 1px solid var(--hairline); box-shadow: 0 6px 0 var(--slab), 0 16px 30px rgba(0, 0, 0, 0.45); }
.daily-board { position: relative; aspect-ratio: 1; width: 100%; max-width: 580px; }
.daily-copy { min-width: 0; padding-right: clamp(0px, 2vw, 24px); }
.date { font-weight: 900; color: var(--soft); font-size: 15px; }
.daily h2 { margin: 8px 0 14px; }
.task { font-size: 18px; line-height: 1.45; max-width: 36ch; }
.tries { display: flex; gap: 6px; margin: 20px 0 12px; }
.tries i { display: block; width: 30px; height: 6px; border-radius: 3px; background: #fff; transition: background 0.3s; }
.tries i.used { background: rgba(255, 255, 255, 0.14); }
.msg { font-weight: 900; min-height: 1.45em; margin-bottom: 14px; line-height: 1.45; }
.msg.good { color: var(--good); } .msg.bad { color: var(--bad); }
.streak { font-weight: 900; margin-bottom: 14px; }
.daily-copy .row { margin-bottom: 14px; }

/* ---------- 7 · leaderboard ---------- */
.ladder-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: clamp(24px, 5vw, 72px); align-items: center; }
.ladder p { margin-top: 10px; font-size: 17px; }
.rows { list-style: none; padding: 0; margin: 18px 0 22px; }
.rows li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 14px; min-height: 54px; border-top: 1px solid rgba(255, 255, 255, 0.08); font-weight: 900; }
.rows .rk { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: var(--soft); font-size: 14px; }
.rows .rk.m1 { background: var(--gold); color: #1a1406; } .rows .rk.m2 { background: var(--silver); color: #16171a; } .rows .rk.m3 { background: var(--bronze); color: #1d1108; }
.rows .who { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 16px; }
.rows .who > span:last-child, .rows .who > a.pl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows a.pl { color: inherit; text-decoration: none; min-width: 0; }
.rows a.pl:hover { text-decoration: underline; text-underline-offset: 3px; }
.rows .who small { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; color: var(--soft); font-weight: 700; font-size: 12.5px; line-height: 1.35; white-space: normal; overflow: hidden; } /* two lines, never cut mid-sentence on phones */
.rows .rt { font-variant-numeric: tabular-nums; font-size: 17px; color: var(--soft); }
.rows .rt.t1 { color: var(--gold); } .rows .rt.t2 { color: #fff; }
/* nobody ranked yet: the board is shown as open places (the first one says "Get your name on this list"),
   beside the heading and a Play ranked button. No stand-in names, no repeat of the computer levels. */
.ladder-grid.vacant, .ladder-grid.vacant.solo { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); }
.ladder-grid.vacant .ladder-cta { display: block; padding: 6px 22px; }
.ladder-grid.vacant .rows { margin: 0; }
.ladder-grid.vacant .rows li:first-child { border-top: 0; }
.ladder-grid.vacant .ladder > a { margin-top: 22px; }
.rows li.seat .who { color: var(--soft); font-weight: 700; }
.rows li.seat .who > span { white-space: normal; }
.rows li.seat .bar { display: block; width: 46%; height: 14px; border-radius: 7px; border: 1.5px dashed rgba(255, 255, 255, 0.16); }
.rows li.seat .bar.b2 { width: 58%; } .rows li.seat .bar.b3 { width: 38%; } .rows li.seat .bar.b4 { width: 50%; }
.rows li.seat .rt { width: 44px; height: 14px; border-radius: 7px; border: 1.5px dashed rgba(255, 255, 255, 0.12); }
.ladder-cta { display: none; }
.ladder-grid.solo { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); }
.ladder-grid.solo .ladder-cta { display: block; }
.ladder-cta h3 { font-size: 26px; line-height: 1.1; }
.ladder-cta p { color: var(--soft); font-weight: 700; margin: 10px 0 18px; line-height: 1.45; }
.bignum b { display: block; font-size: clamp(96px, 14vw, 210px); line-height: 0.84; letter-spacing: -0.05em; }
.bignum span { display: block; color: var(--soft); font-weight: 900; font-size: 18px; margin-top: 10px; }

/* ---------- 8 · the app ---------- */
.app { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 360px); gap: clamp(24px, 6vw, 96px); align-items: center; }
.app-copy p { color: var(--soft); font-size: 17px; max-width: 46ch; margin: 16px 0 24px; line-height: 1.5; }
.store { display: inline-flex; align-items: center; gap: 10px; height: 56px; padding: 0 20px 0 15px; border-radius: 14px; background: #000; border: 1.2px solid rgba(255, 255, 255, 0.42); color: #fff; transition: border-color 0.15s, transform 0.2s var(--ease-back); }
.store:hover { border-color: #fff; } .store:active { transform: translateY(3px); }
.store svg { width: 22px; height: 22px; }
.store span { display: flex; flex-direction: column; align-items: flex-start; font-weight: 900; font-size: 19px; line-height: 1.05; }
.store small { font-size: 11px; font-weight: 700; color: var(--soft); }
.phone-wrap { perspective: 1400px; width: min(100%, 340px); margin-inline: auto; }
.phone-outer { position: relative; aspect-ratio: 410 / 884; transform-style: preserve-3d; transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1); }
.phone { position: absolute; left: 0; top: 0; width: 410px; height: 884px; transform-origin: 0 0; border-radius: 52px; background: linear-gradient(160deg, #2e2f35, #0a0a0c 60%, #1c1d22); box-shadow: 0 0 0 1.5px #3a3b44, 0 60px 90px -30px rgba(0, 0, 0, 0.9); }
.phone::before { content: ''; position: absolute; inset: 0; border-radius: 52px; background: linear-gradient(115deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, 0) 70%, rgba(255, 255, 255, 0.07)); pointer-events: none; z-index: 4; }
.phone .screen { position: absolute; left: 10px; top: 20px; width: 390px; height: 844px; overflow: hidden; border-radius: 42px; background: #0b0b0b; }
.phone .screen iframe { display: block; width: 390px; height: 844px; border: 0; background: #0b0b0b; }
.phone .boot { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 16px; align-items: center; justify-content: center; background: #0b0b0b; color: var(--soft); font-weight: 900; font-size: 18px; transition: opacity 0.5s; z-index: 2; }
.phone .boot img { width: 96px; height: 96px; }
.phone .boot.gone { opacity: 0; pointer-events: none; }

/* ---------- 10 · bottom ---------- */
.closing { display: flex; flex-direction: column; align-items: center; gap: 30px; text-align: center; padding: clamp(80px, 14vh, 160px) var(--gut-r) clamp(64px, 10vh, 120px) var(--gut-l); }
.closing h2 { font-size: clamp(64px, 12vw, 184px); letter-spacing: -0.05em; line-height: 0.84; }
.qa { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: clamp(28px, 5vw, 72px); padding-bottom: 80px; align-items: start; }   /* four questions beside ten guides: the guides get the wider side and two columns, so both sides end near the same line */
.qa h2 { font-size: 30px; margin-bottom: 16px; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; position: relative; padding: 18px 40px 18px 0; font-weight: 900; font-size: 17px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before, .faq summary::after { content: ''; position: absolute; right: 6px; top: 50%; width: 16px; height: 4px; margin-top: -2px; border-radius: 2px; background: #fff; transition: transform 0.3s var(--ease-back); }
.faq summary::before { transform: rotate(90deg); }
.faq details[open] summary::before { transform: rotate(0deg); }
.faq details p { color: var(--soft); padding: 0 0 20px; max-width: 60ch; line-height: 1.55; font-weight: 700; }
.guides { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-content: start; }
.guides h2 { grid-column: 1 / -1; }
@media (max-width: 1100px) { .guides { grid-template-columns: minmax(0, 1fr); } }
.guides a { display: flex; flex-direction: column; gap: 3px; padding: 16px 18px; border-radius: 18px; border: 1px solid var(--hairline); background: linear-gradient(180deg, var(--panel-top), var(--panel-bottom)); transition: border-color 0.15s, transform 0.2s var(--ease-back); }
.guides a:hover { border-color: var(--hairline-selected); }
.guides a:active { transform: translateY(3px); }
.guides b { font-size: 17px; }
.guides span { color: var(--soft); font-size: 14px; font-weight: 700; }
.foot { position: relative; }
.foot::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--line); }
.foot-in { max-width: var(--wrap); margin: 0 auto; padding: 28px var(--gut-r) calc(40px + env(safe-area-inset-bottom, 0px)) var(--gut-l); display: flex; flex-wrap: wrap; gap: 18px 36px; align-items: center; justify-content: space-between; }
.lockup { display: flex; align-items: center; gap: 12px; }
.lockup img:first-child { width: 44px; height: 44px; }
.lockup img:last-child { width: 150px; height: auto; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.foot nav a { color: var(--soft); font-weight: 700; }
.foot nav a:hover { color: #fff; }
.foot p { flex-basis: 100%; }

/* the phone dock: once the hero's Play button scrolls away, a Play pill rises from the bottom */
.dock { position: fixed; z-index: 45; left: calc(12px + env(safe-area-inset-left, 0px)); right: calc(12px + env(safe-area-inset-right, 0px)); bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  display: none; align-items: center; justify-content: center; gap: 10px; height: 56px; border-radius: 999px; font-weight: 900; font-size: 17px; color: #1d1d1d;
  background: linear-gradient(180deg, #fff, var(--pill-face)); box-shadow: 0 4px 0 #858585, 0 14px 30px rgba(0, 0, 0, 0.6);
  transform: translateY(calc(100% + 40px)); visibility: hidden; transition: transform 0.4s var(--ease-back), visibility 0s 0.4s; }
.dock .soft { color: #666; font-size: 14px; }
.dock.show { transform: none; visibility: visible; transition-delay: 0s; }
.toast { position: fixed; z-index: 90; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, calc(100% + 60px)); visibility: hidden; max-width: calc(100vw - 32px);
  background: #101012; border: 1px solid var(--hairline-selected); border-radius: 16px; padding: 12px 20px; font-weight: 700; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6); transition: transform 0.4s var(--ease-back), visibility 0s 0.4s; }
.toast.show { transform: translate(-50%, 0); visibility: visible; transition-delay: 0s; }

/* ================= tablet ================= */
@media (max-width: 1100px) {
  .nav a span { display: none; } .nav a { padding: 0 10px; }
  .modes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mode.big { grid-row: auto; grid-column: 1 / -1; }
  .mode.big a { flex-direction: row; align-items: center; gap: 18px; }
  .mode.big .art { width: 46%; flex: none; align-self: auto; }
  .mode.big .txt { flex: 1; }
  .bots { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
  .bot { margin-bottom: calc((var(--lv) - 1) * 16px); }
  .bot p { font-size: 13px; }
  .tv { grid-template-columns: minmax(0, 1fr); }
  .tv-screen { max-width: 680px; margin-inline: auto; width: 100%; }
  .tv-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); max-width: 680px; margin-inline: auto; width: 100%; }
  .quick { grid-template-columns: minmax(0, 1fr); max-width: 420px; }   /* tablets: three cards side by side leave the words no room */
}

/* ================= phone ================= */
@media (max-width: 760px) {
  :root { --top-h: 56px; }
  .top-in { gap: 8px; }
  .slot { width: 124px; margin-right: 0; }
  .nav { display: none; }
  .app-strip:not([hidden]) { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 26px max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); padding: 10px 6px 10px 16px; border-radius: 16px; border: 1px solid var(--hairline); background: linear-gradient(180deg, var(--panel-top), var(--panel-bottom)); font-size: 13.5px; font-weight: 700; }
  .code-open { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; margin-left: auto; border-radius: 12px; border: 1.2px solid var(--ghost-line); background: var(--ghost-fill); color: var(--soft); font-weight: 900; font-size: 14px; }
  .code-open svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .code-open[aria-expanded='true'] { color: #fff; border-color: #fff; }
  .code { display: none; position: absolute; left: var(--gut-l); right: var(--gut-r); top: calc(100% + 8px); height: 48px; margin: 0; background: var(--backdrop); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6); }
  .top.code-on .code { display: flex; }
  .code input { flex: 1; width: auto; font-size: 16px; }
  .app-strip p { color: var(--soft); }
  .app-strip a { color: #fff; font-weight: 900; text-decoration: underline; text-underline-offset: 3px; }
  .app-strip button { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border: 0; background: transparent; color: var(--soft); }
  .first { grid-template-columns: minmax(0, 1fr); min-height: 0; gap: 18px; padding-top: 18px; }
  .hero-copy { display: contents; }
  #h-play { order: 1; font-size: clamp(36px, 10.5vw, 48px); margin: 0; }
  .hero-board { order: 2; }
  .lede { order: 3; }
  .cta { order: 4; margin-top: 0; }
  .online { order: 5; margin-top: 0; }
  .quick { order: 6; margin-top: 0; grid-template-columns: minmax(0, 1fr); }
  .open { order: 7; margin-top: 4px; max-width: none; }
  .quick a { padding: 12px 14px; }
  .learn { width: 100%; text-align: center; }
  .coach, .race { width: 100%; }
  .coach { flex-wrap: wrap; }
  .coach p { flex-basis: calc(100% - 70px); }
  .board-box { width: 100%; }
  .race .cap { font-size: 12.5px; }
  .play-now { min-width: 0; width: 100%; }
  .take { width: 100%; justify-content: center; min-height: 52px; }
  .modes { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .mode.big .art { width: 132px; align-self: auto; }
  .mode.big .name { font-size: 22px; }
  .mode.big .status { font-size: 13.5px; }
  .mode:not(.big) .art { width: 104px; }
  .mode a { flex-direction: row; align-items: center; gap: 14px; padding: 8px 14px 8px 8px; border-radius: 20px; }
  .mode .art { width: 104px; flex: none; }
  .mode .txt { flex: 1; padding: 0; }
  .bots { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .bot { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 14px; align-items: center; padding: 8px 14px 8px 8px; margin-bottom: 0; }
  .bot > div { padding: 0; }
  .bot h3 { font-size: 19px; }
  .daily { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 10px 10px 18px; border-radius: 26px; }
  .daily-copy { padding: 0 8px; }
  .task { font-size: 16.5px; }
  .ladder-grid, .ladder-grid.solo, .ladder-grid.vacant, .ladder-grid.vacant.solo { grid-template-columns: minmax(0, 1fr); }
  .top .lang-pick summary { padding: 0 9px; } .top .lang-pick summary span { display: none; }   /* phones: the globe alone */
  .app { grid-template-columns: minmax(0, 1fr); }
  .phone-wrap { width: min(100%, 290px); }
  .qa { grid-template-columns: minmax(0, 1fr); }
  .dock { display: flex; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 420px) { .icon-btn { display: none; } .top-play { padding: 0 14px; } }
/* the narrowest phones: a slightly smaller wordmark leaves room for the longer room-code and play labels (Portuguese "Código" + "Jogar") */
@media (max-width: 359px) { .slot { width: 112px; } }
@media (max-width: 379px) { .top .lang-pick { display: none; } }   /* no room beside the room-code and Play buttons; the list stays in the footer */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-mark img { clip-path: none !important; animation: none !important; }
  .wall-gap i { opacity: 1 !important; transform: none !important; }
  .sweep { display: none; }
}

/* install the app (section 8) */
.app-btns { align-items: center; }
.install { display: inline-flex; align-items: center; gap: 10px; height: 56px; padding: 0 22px 0 18px; }
.install svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.install-how { margin-top: 14px; color: var(--soft); font-size: 14.5px; }
.install-how b { color: #fff; }

/* rank badges in the leaderboard and on TV (web/img/ranks) */
.rows .who img.rank { width: 30px; height: 30px; flex: none; }
.dpips { display: inline-flex; gap: 3px; margin-left: 8px; vertical-align: middle; } .dpips i { display: block; width: 9px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.16); } .dpips i.on { background: #fff; }
.strip img.rank { width: 22px; height: 22px; flex: none; }

/* ---------- touch sizes and the smallest phones (layout check, 16 Nov) ---------- */
@media (max-width: 760px) {
  .foot nav { gap: 0 20px; }
  .foot nav a { display: inline-flex; align-items: center; min-height: 40px; min-width: 40px; }   /* every footer link is a full thumb tall */
  .slot { min-height: 40px; }
  .app-btns .install, .app-btns .store { width: 100%; justify-content: center; }   /* one width, stacked, like the Play now pill */
}
@media (max-width: 360px) {
  .mode.big .art { width: 100px; }   /* leaves the Ranked card's words room on a 320 px phone */
}

/* Start-up speed: sections below the first screen skip layout and paint until they come near (on a mid-range phone
   that cut the first layout from about 0.3 s). The sizes are estimates, measured per section; once a section has
   been shown the browser keeps its real size ("auto"), so the page doesn't jump on the way back up. */
main > section.sec, main > section.closing { content-visibility: auto; contain-intrinsic-size: auto 900px; }
#live { contain-intrinsic-size: auto 1030px; }
#modes { contain-intrinsic-size: auto 900px; }
#bots { contain-intrinsic-size: auto 935px; }
#daily { contain-intrinsic-size: auto 690px; }
#ladder-sec { contain-intrinsic-size: auto 665px; }
#app { contain-intrinsic-size: auto 1015px; }
main > section.closing { contain-intrinsic-size: auto 370px; }
main > section.qa { contain-intrinsic-size: auto 1010px; }
@media (min-width: 900px) {
  #live { contain-intrinsic-size: auto 780px; }
  #modes { contain-intrinsic-size: auto 655px; }
  #bots { contain-intrinsic-size: auto 680px; }
  #daily { contain-intrinsic-size: auto 630px; }
  #ladder-sec { contain-intrinsic-size: auto 470px; }
  #app { contain-intrinsic-size: auto 735px; }
  main > section.closing { contain-intrinsic-size: auto 445px; }
  main > section.qa { contain-intrinsic-size: auto 680px; }
}

/* the language switcher the release adds to the footer (web/tools/i18n.mjs) */
.foot nav.langs { flex-basis: 100%; gap: 4px 14px; }
.foot nav.langs a { color: var(--faint); font-size: 13px; display: inline-flex; align-items: center; min-height: 32px; }
.foot nav.langs a:hover, .foot nav.langs a[aria-current] { color: #fff; }
/* long words in other languages break with a hyphen instead of running off a phone screen */
h1, h2, h3 { hyphens: auto; overflow-wrap: break-word; }
.foot nav.langs a { min-width: 32px; justify-content: center; }
/* TV name strips: name and level side by side on wide screens, stacked on phones, so longer names and levels in
   other languages fit whole and the walls and the clock always stay on the strip */
.strip .who { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 0 1 auto; }
.strip .meta { display: inline-flex; align-items: center; gap: 8px; }
.strip .pips, .strip .clock { flex: none; }
.strip .pips { margin-inline-start: auto; }
@media (max-width: 600px) {
  .strip .who { flex-direction: column; align-items: flex-start; gap: 1px; padding-block: 6px; }
  .strip .nm { font-size: 15px; line-height: 1.15; }
  .strip .lv { line-height: 1.2; }
}
/* a long button label wraps inside its card instead of pushing out of it */
.mode .go { max-width: 100%; white-space: normal; text-align: center; height: auto; min-height: 36px; padding-block: 6px; }

/* the streak reminder card under today's wall (web/js/reminder.js): offered only after two solved days */
.remind { margin: 0 0 16px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--hairline); background: rgba(255, 255, 255, 0.035); }
.remind p { margin: 0; color: var(--soft); font-size: 14.5px; line-height: 1.45; font-weight: 700; }
.remind .row { margin-top: 12px; gap: 8px; }
.remind .remind-note { margin-top: 10px; color: var(--bad); }
.remind .remind-on { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.remind .remind-on b { color: #fff; }
.remind select { height: 34px; padding: 0 10px; border-radius: 10px; border: 1.2px solid var(--ghost-line); background: var(--field); color: #fff; font: inherit; font-weight: 900; font-size: 13.5px; }
.remind .link { min-height: 34px; padding: 0 2px; border: 0; background: none; color: var(--soft); font: inherit; font-weight: 800; font-size: 13.5px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.remind .link:hover { color: #fff; }
.remind .remind-time select { margin-inline: 4px 1px; vertical-align: middle; }
/* the footer's "ways to play" row: every game-section page one tap from home (and one link away for search engines) */
.foot .foot-play { flex-basis: 100%; order: 1; padding-top: 14px; border-top: 1px solid var(--line); }
.foot nav.langs { order: 2; }
.foot .foot-play a { color: var(--white); }
.foot p { order: 3; }
