/* /attention-test and /attention-test/leaderboard in the dark theme (founder, 23 Nov 2026):
   a full black page, blackish-grey cards, a hero of drifting blue and green light with film grain,
   a standard leaderboard and the About page's FAQ accordion. Everything is scoped to body.at-dark and
   loads after the light stylesheets (attention-test.css, attention-board.css, attention-share.css,
   attention-dialog.css), which stay as they were. Inner tiles use the card's grey with a hairline. */

body.at-dark {
  --dk-bg: #000;
  --dk-card: #161617;
  --dk-raise: #1f1f21;
  --dk-ink: #f5f5f7;
  --dk-muted: #a1a1a6;
  --dk-faint: #86868b;
  --dk-line: rgba(255, 255, 255, 0.1);
  --dk-line-strong: rgba(255, 255, 255, 0.18);
  --dk-blue: #2997ff;
  --dk-green: #30d158;
  --dk-orange: #ff9f0a;
  background: var(--dk-bg);
  color: var(--dk-ink);
  color-scheme: dark;
}
body.at-dark .lp-page { background: var(--dk-bg); }
body.at-dark .lp-card { background: var(--dk-card); }

/* ─── Site chrome: announcement, nav, mobile menu, footer ─── */
body.at-dark .announcement-bar p { color: var(--dk-faint); }
body.at-dark .announcement-cta { color: var(--dk-blue); }
body.at-dark .navbar { background: rgba(30, 30, 32, 0.92); }
body.at-dark .navbar.scrolled { background: rgba(30, 30, 32, 0.6); }
body.at-dark .nav-link { color: rgba(255, 255, 255, 0.82); }
body.at-dark .nav-link:hover,
body.at-dark .nav-link.active { color: #fff; }
@media (max-width: 768px) {
  body.at-dark .navbar { background: rgba(0, 0, 0, 0.78) !important; }
  body.at-dark .navbar.m-open { background: #000 !important; }
  body.at-dark .navbar-inner { color: var(--dk-ink); }
  body.at-dark .m-sheet { background: #000; }
  body.at-dark .m-pages a,
  body.at-dark .m-row,
  body.at-dark .m-search input,
  body.at-dark .m-result b { color: var(--dk-ink); }
  body.at-dark .m-label,
  body.at-dark .m-result span { color: var(--dk-faint); }
}
body.at-dark .footer-legal-section { background: var(--dk-bg); border-top-color: var(--dk-line); }
body.at-dark .footer-legal-inner .legal-block p,
body.at-dark .legal-block p { color: var(--dk-faint); }
body.at-dark .legal-block p a { color: var(--dk-blue) !important; }
body.at-dark .af-cols,
body.at-dark .af-bottom { border-top-color: #333336; }
body.at-dark .af-head,
body.at-dark .af-copy,
body.at-dark .af-region { color: #d2d2d7; }
body.at-dark .af-list a,
body.at-dark .af-note,
body.at-dark .af-bottom-link,
body.at-dark .af-sep { color: var(--dk-faint); }
body.at-dark .af-list a:hover,
body.at-dark .af-bottom-link:hover { color: #fff; }
body.at-dark .af-note a { color: var(--dk-blue); }

/* ─── The game card ─── */
body.at-dark .at-game {
  --at-ink: var(--dk-ink); --at-muted: var(--dk-muted); --at-line: var(--dk-line); --at-blue: var(--dk-blue);
  --at-pad: #3a3a3c; --at-green: var(--dk-green); --at-green-ink: var(--dk-green); --at-orange-ink: var(--dk-orange);
  --at-answer: #0a84ff;
  position: relative; overflow: hidden; isolation: isolate;
  margin-top: 63px; padding: 72px 56px 64px; text-align: center;
  transition: min-height 0.5s ease;
}
body.at-dark .at-game > .at-screen { position: relative; z-index: 1; }

/* Buttons: white pill on dark, blue outline for the secondary one. */
body.at-dark .at-btn-primary { background: #f5f5f7; color: #000; }
body.at-dark .at-btn-primary:hover { background: #fff; }
body.at-dark .at-btn-secondary { color: var(--dk-ink); box-shadow: inset 0 0 0 1.5px var(--dk-line-strong); }
body.at-dark .at-btn-secondary:hover { background: rgba(255, 255, 255, 0.06); }
body.at-dark .at-btn-answer { background: var(--at-answer); color: #fff; }
body.at-dark .at-btn-answer:hover { background: #2a93ff; }
body.at-dark .at-btn-answer.is-pressed { background: #0066d6; }
body.at-dark .at-link-btn,
body.at-dark .at-link-btn:hover { color: var(--dk-blue); }
body.at-dark .at-game :focus-visible { outline: 2px solid var(--dk-blue); outline-offset: 3px; }

/* Inner surfaces: the card's grey with a hairline, never white. */
body.at-dark .at-inter-note,
body.at-dark .at-clock,
body.at-dark .at-pad,
body.at-dark .at-last-list li,
body.at-dark .at-mem-board,
body.at-dark .at-key,
body.at-dark .at-rule-board,
body.at-dark .at-vs,
body.at-dark .at-cta,
body.at-dark .at-stored {
  background: var(--dk-card); box-shadow: none; border: 1px solid var(--dk-line); color: var(--dk-ink);
}
body.at-dark .at-pad { border-color: var(--dk-line); }
body.at-dark .at-pad[data-state="missed"] .at-pad-circle { background: #2c2c2e; }
body.at-dark .at-key:active { background: var(--dk-raise); }
body.at-dark .at-tiles li { border-color: var(--dk-line); }
body.at-dark .at-kbd { background: rgba(255, 255, 255, 0.22); }
body.at-dark .at-cta .desktop-notify-btn { background: #f5f5f7; color: #000; }

/* ─── Intro: two tiles like a news list. A small square of drifting light with film grain,
       and the heading and text outside it, on the right. No card behind them. ─── */
body.at-dark .at-game.is-intro {
  background: none; padding: 40px 0 8px; min-height: 0; text-align: left; overflow: visible;
}
body.at-dark .at-intro { max-width: none; }
.at-feature-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 48px; }
.at-feature { display: flex; align-items: center; gap: 32px; min-width: 0; }
.at-feature-text { min-width: 0; animation: at-rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) both; }
.at-feature + .at-feature .at-feature-text { animation-delay: 0.1s; }
body.at-dark .at-intro h1,
body.at-dark .at-intro .at-feature-title {
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 26px; font-weight: 500; line-height: 1.2; letter-spacing: -0.3px; color: #fff; margin: 0 0 12px;
}
.at-feature-desc {
  font-family: 'SF Pro Text', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 16px; line-height: 1.5; color: var(--dk-muted, #a1a1a6); margin: 0;
}
.at-feature-meta { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 16px 0 0; font-size: 15px; line-height: 1.4; }
.at-feature-meta span:first-child { color: #fff; }
.at-feature-meta span + span { color: var(--dk-faint, #86868b); }
body.at-dark .at-hero-btn { min-width: 0; min-height: 0; margin-top: 18px; padding: 10px 22px; font-size: 15px; }

/* The squares */
.at-square {
  position: relative; flex: none; width: 180px; aspect-ratio: 1; border-radius: 8px; overflow: hidden; isolation: isolate;
  animation: at-rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.at-square-test { background: linear-gradient(160deg, #1f5fe0 0%, #1a4bb8 45%, #11a37f 100%); }
.at-square-about { background: linear-gradient(160deg, #ff9a62 0%, #ff6a1a 50%, #ff8f8f 100%); animation-delay: 0.1s; }
.at-glow {
  position: absolute; border-radius: 50%; filter: blur(26px); opacity: 0.9; will-change: transform; mix-blend-mode: screen;
}
.at-glow-1 { width: 80%; height: 80%; left: -20%; top: -20%; animation: at-drift-1 14s ease-in-out infinite alternate; }
.at-glow-2 { width: 75%; height: 75%; right: -20%; bottom: -20%; animation: at-drift-2 17s ease-in-out infinite alternate; }
.at-glow-3 { width: 55%; height: 55%; right: 0; top: -10%; opacity: 0.7; animation: at-drift-3 12s ease-in-out infinite alternate; }
.at-glow-4 { width: 60%; height: 60%; left: 0; bottom: -20%; opacity: 0.5; animation: at-drift-4 19s ease-in-out infinite alternate; }
.at-square-test .at-glow-1 { background: radial-gradient(circle, #4d86ff 0%, rgba(77, 134, 255, 0) 70%); }
.at-square-test .at-glow-2 { background: radial-gradient(circle, #23e0a8 0%, rgba(35, 224, 168, 0) 70%); }
.at-square-test .at-glow-3 { background: radial-gradient(circle, #5fd0f5 0%, rgba(95, 208, 245, 0) 70%); }
.at-square-test .at-glow-4 { background: radial-gradient(circle, #9af0d2 0%, rgba(154, 240, 210, 0) 70%); }
.at-square-about .at-glow-1 { background: radial-gradient(circle, #ff5a00 0%, rgba(255, 90, 0, 0) 70%); mix-blend-mode: normal; }
.at-square-about .at-glow-2 { background: radial-gradient(circle, #ffb3a1 0%, rgba(255, 179, 161, 0) 70%); }
.at-square-about .at-glow-3 { background: radial-gradient(circle, #ffd0a8 0%, rgba(255, 208, 168, 0) 70%); }
.at-square-about .at-glow-4 { background: radial-gradient(circle, #ff8a5c 0%, rgba(255, 138, 92, 0) 70%); }
@keyframes at-drift-1 { 0% { transform: translate(0, 0) scale(1); } 100% { transform: translate(28%, 22%) scale(1.2); } }
@keyframes at-drift-2 { 0% { transform: translate(0, 0) scale(1.05); } 100% { transform: translate(-26%, -18%) scale(0.9); } }
@keyframes at-drift-3 { 0% { transform: translate(0, 0) scale(0.95); } 100% { transform: translate(-40%, 34%) scale(1.15); } }
@keyframes at-drift-4 { 0% { transform: translate(0, 0) scale(1); } 100% { transform: translate(40%, -26%) scale(1.2); } }

/* Film grain: an SVG noise tile, shifted a few pixels each step so it shimmers like film. */
.at-grain {
  position: absolute; inset: -50%; width: 200%; height: 200%; z-index: 1;
  background-image: url("/assets/images/attention-test/grain.svg");
  background-size: 160px 160px; opacity: 0.35; mix-blend-mode: overlay;
  animation: at-grain 0.9s steps(6) infinite;
}
@keyframes at-grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}
@keyframes at-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* The challenge line and the saved-scores box under the tiles */
body.at-dark .at-intro .at-challenge { margin: 14px 0 0; text-align: left; }
body.at-dark .at-intro .at-stored { margin-top: 32px; }

@media (prefers-reduced-motion: reduce) {
  .at-glow, .at-grain, .at-square, .at-feature-text { animation: none !important; }
}
@media (max-width: 900px) {
  .at-feature-row { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
  .at-feature { gap: 18px; }
  .at-square { width: 112px; border-radius: 6px; }
  body.at-dark .at-intro h1,
  body.at-dark .at-intro .at-feature-title { font-size: 20px; margin-bottom: 8px; }
  .at-feature-desc { font-size: 15px; }
  .at-feature-meta { font-size: 14px; margin-top: 10px; }
  body.at-dark .at-hero-btn { margin-top: 12px; width: auto; }
}

/* ─── Leaderboard: a standard board in a blackish-grey card ─── */
body.at-dark .atb {
  --atb-card: var(--dk-card); --atb-ink: var(--dk-ink); --atb-muted: var(--dk-muted); --atb-line: var(--dk-line);
  --atb-blue: #0a84ff; --atb-blue-hover: #2a93ff; --atb-me: rgba(10, 132, 255, 0.14); --atb-danger: #ff6961;
  --atb-ok: var(--dk-green);
  max-width: none;
}
body.at-dark .atb-card { padding: 40px 48px; }
body.at-dark .atb-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
body.at-dark .atb-title { font-size: clamp(26px, 2.2vw + 16px, 34px); letter-spacing: -0.5px; }
body.at-dark .atb-sub { margin: 0; color: var(--dk-faint); }

/* Global | Friends and the period / device switches */
body.at-dark .atb-scope,
body.at-dark .atb-tabs,
body.at-dark .atb-seg { background: rgba(255, 255, 255, 0.07); }
body.at-dark .atb-scope-btn[aria-pressed='true'] { background: #f5f5f7; color: #000; }
body.at-dark .atb-tab[aria-selected='true'],
body.at-dark .atb-seg-btn[aria-pressed='true'] { background: #3a3a3c; color: #fff; box-shadow: none; }

/* Column heads, then the rows: rank, avatar, player, device, score */
.atb-cols { display: none; }
body.at-dark .atb-cols {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) 64px; gap: 12px;
  padding: 0 16px 10px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--dk-faint);
}
body.at-dark .atb-cols span:last-child { text-align: right; }
body.at-dark .atb-panel:has(.atb-friends-box:not([hidden])) .atb-cols,
body.at-dark .atb-panel:has(.atb-error:not([hidden])) .atb-cols { display: none; }
body.at-dark .atb-list,
body.at-dark .atb-empty,
body.at-dark .atb-error,
body.at-dark .atb-error p,
body.at-dark .atb-friends-card,
body.at-dark .atb-invite,
body.at-dark .atb-edit,
body.at-dark .atb-invite-box,
body.at-dark .atb-best-box,
body.at-dark .atb-join-score {
  background: var(--dk-card); border: 1px solid var(--dk-line);
}
body.at-dark .atb-error p { border: 0; }
body.at-dark .atb-list:empty { border: 0; }
body.at-dark .atb-row {
  grid-template-columns: 44px 36px minmax(0, 1fr) auto 64px; gap: 12px; padding: 12px 16px; font-size: 15px;
}
body.at-dark .atb-rank {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%;
  font-size: 14px; color: var(--dk-muted);
}
.atb-avatar { display: none; }
body.at-dark .atb-avatar {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%;
  background: #2c2c2e; color: var(--dk-ink); font-size: 14px; font-weight: 600;
}
body.at-dark .atb-name { flex-direction: column; align-items: flex-start; gap: 2px; }
body.at-dark .atb-name-line { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
body.at-dark .atb-you { background: #0a84ff; }
body.at-dark .atb-dev { color: var(--dk-faint); }
body.at-dark .atb-score { font-size: 18px; color: #fff; }
body.at-dark .atb-row.is-me { background: var(--atb-me); }
@keyframes atb-flash-dark { 0% { background: rgba(10, 132, 255, 0.4); } 100% { background: var(--atb-me); } }
body.at-dark .atb-row.is-new { animation: atb-flash-dark 1.6s ease-out 1; }

/* Your row, pinned under the list */
body.at-dark .atb-me {
  margin: 12px 0 0; padding: 0; border-radius: 14px; overflow: hidden; background: none; font-weight: inherit;
  border: 1px solid rgba(10, 132, 255, 0.45);
}
body.at-dark .atb-me-row { grid-template-columns: 44px 36px minmax(0, 1fr) 64px; border-top: 0; }
body.at-dark .atb-me-row .atb-avatar { background: #0a84ff; color: #fff; }
.atb-me-line { font-size: 12.5px; color: var(--dk-faint, #6e6e73); }
body.at-dark .atb-me-line { color: var(--dk-muted); }

/* Text, inputs and buttons on dark */
body.at-dark .atb-link,
body.at-dark .atb-more-link { color: var(--dk-blue); }
body.at-dark .atb-btn-primary { background: #f5f5f7; color: #000; }
body.at-dark .atb-btn-primary:hover { background: #fff; }
body.at-dark .atb-btn-ghost { color: var(--dk-ink); border-color: var(--dk-line-strong); }
body.at-dark .atb-btn-ghost:hover { background: rgba(255, 255, 255, 0.06); border-color: var(--dk-ink); }
body.at-dark .atb-input { background: var(--dk-card); color: var(--dk-ink); border-color: var(--dk-line-strong); }
body.at-dark .atb-google { background: #f5f5f7; border-color: transparent; color: #1f1f1f; }
body.at-dark .atb-google:hover { background: #fff; }
body.at-dark .atb-switch .atb-switch-input { background: #48484a; }
body.at-dark .atb-switch .atb-switch-input:checked { background: var(--dk-green); }
body.at-dark .atb-friend-notice { background: rgba(48, 209, 88, 0.14); }

@media (max-width: 600px) {
  body.at-dark .atb-card { padding: 24px 16px; }
  body.at-dark .atb-cols { grid-template-columns: 34px minmax(0, 1fr) 48px; padding: 0 12px 8px; gap: 10px; }
  body.at-dark .atb-row { grid-template-columns: 34px 30px minmax(0, 1fr) 48px; gap: 10px; padding: 11px 12px; }
  body.at-dark .atb-me-row { grid-template-columns: 34px 30px minmax(0, 1fr) 48px; }
  body.at-dark .atb-dev { display: none; }
  body.at-dark .atb-rank { width: 28px; height: 28px; font-size: 13px; }
  body.at-dark .atb-avatar { width: 28px; height: 28px; font-size: 13px; }
}

/* ─── Share block and dialog on dark ─── */
body.at-dark .ats { --ats-ink: var(--dk-ink); --ats-grey: var(--dk-muted); --ats-line: var(--dk-line-strong); --ats-focus: var(--dk-blue); }
body.at-dark .ats-input,
body.at-dark .ats-btn-ghost,
body.at-dark .ats-panel { background: var(--dk-card); color: var(--dk-ink); }
body.at-dark .ats-opt { background: var(--dk-raise); color: var(--dk-ink); }
body.at-dark .ats-btn-primary { background: #f5f5f7; color: #000; border-color: #f5f5f7; }
body.at-dark .ats-btn-primary:hover { background: #fff; }
body.at-dark .ats-preview-img { background: var(--dk-raise); }
body.at-dark .atd { --atd-ink: var(--dk-ink); --atd-muted: var(--dk-muted); --atd-card: var(--dk-card); --atd-focus: var(--dk-blue); }
body.at-dark .atd-close { background: rgba(255, 255, 255, 0.1); color: var(--dk-ink); }
body.at-dark .atd-close:hover { background: rgba(255, 255, 255, 0.16); }

/* ─── FAQ: the About page's accordion, on a blackish-grey card ─── */
body.at-dark .at-faq { padding: 56px 56px 40px; }
.at-faq .faq-heading {
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 36px; font-weight: 500; letter-spacing: -0.5px; line-height: 1.15; color: var(--dk-ink, #1d1d1f);
  margin: 0 0 40px;
}
.at-faq .faq-grid { display: flex; flex-direction: column; }
.at-faq .faq-item { border-top: 1px solid var(--dk-line, #e0e0e0); }
.at-faq .faq-item:first-child { border-top: none; }
.at-faq .faq-trigger {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 18px 0; background: none; border: none; cursor: pointer; text-align: left; font-family: inherit; color: inherit;
}
.at-faq .faq-trigger:focus-visible { outline: 2px solid var(--dk-blue, #0071e3); outline-offset: 4px; border-radius: 4px; }
.at-faq .faq-q { font-size: 20px; font-weight: 400; line-height: 1.4; letter-spacing: -0.2px; color: var(--dk-ink, #111); }
.at-faq .faq-icon {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--dk-line-strong, rgba(0, 0, 0, 0.18));
  display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 300; line-height: 1;
  color: var(--dk-ink, #111);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), background 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              color 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.at-faq .faq-item.open .faq-icon { transform: rotate(45deg); background: var(--dk-ink, #111); color: var(--dk-bg, #fff); border-color: var(--dk-ink, #111); }
.at-faq .faq-body {
  overflow: hidden; max-height: 0; opacity: 0;
  transition: max-height 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.at-faq .faq-item.open .faq-body { max-height: 800px; opacity: 1; }
.at-faq .faq-a { font-size: 17px; font-weight: 400; line-height: 1.7; color: var(--dk-muted, #666); margin: 0; padding-bottom: 28px; max-width: 760px; }

/* ─── About the test: quiet footer-style paragraphs, like the home page ─── */
.at-about { max-width: 1100px; margin: 48px auto 0; padding: 0 40px; box-sizing: border-box; text-align: left; }
.at-about-block { margin: 0 0 16px; }
.at-about-block:last-child { margin-bottom: 0; }
.at-about h2,
.at-about p,
.at-about strong {
  display: inline; margin: 0; font-family: inherit; font-size: 12px; line-height: 18px; font-weight: 400;
  letter-spacing: normal; color: var(--dk-faint, rgb(112, 112, 118));
}
.at-about h2::after { content: ". "; }
.at-about p::after { content: " "; }
.at-about a { color: var(--dk-blue, #0071e3); text-decoration: none; }
.at-about a:hover { text-decoration: underline; }

/* ─── Sizes ─── */
@media (max-width: 768px) {
  body.at-dark .at-game { margin-top: 68px; padding: 48px 28px 40px; }
  body.at-dark .at-faq { padding: 40px 28px 24px; }
  .at-faq .faq-heading { font-size: 28px; margin-bottom: 28px; }
  .at-faq .faq-q { font-size: 16px; }
  .at-faq .faq-a { font-size: 15px; padding-bottom: 20px; }
  .at-faq .faq-trigger { padding: 16px 0; }
  .at-faq .faq-icon { width: 24px; height: 24px; font-size: 14px; }
  .at-about { padding: 0 32px; margin-top: 40px; }
  body.at-dark .atb-card { padding: 32px 28px; }
}
@media (max-width: 480px) {
  body.at-dark .at-game { margin-top: 64px; padding: 40px 16px 32px; }
  body.at-dark .at-faq { padding: 32px 20px 16px; }
  .at-faq .faq-heading { font-size: 24px; }
  .at-about { padding: 0 24px; }
}

/* Leaderboard page hero and any landing-style text on dark */
body.at-dark .lp-hero h1,
body.at-dark .lp-prose h2,
body.at-dark .lp-prose h3 { color: var(--dk-ink); }
body.at-dark .lp-eyebrow,
body.at-dark .lp-lead { color: var(--dk-muted); }
body.at-dark .at-lb-hero .at-btn-primary { background: #f5f5f7; color: #000; }

/* ─── Flat leaderboard and FAQ (owner, 23 Nov 2026): no background card and no rounded
       corners on the board; rows are separated by divider lines only. ─── */
body.at-dark .atb-card.atb-board { background: none; padding: 0; border-radius: 0; }
body.at-dark .at-board-section { margin-top: 72px; }
body.at-dark .atb-board .atb-head { align-items: center; margin-bottom: 20px; }
body.at-dark .atb-board > .atb-sub { margin: -8px 0 18px; }

/* Global | Friends: a small dropdown on the right of the heading */
body.at-dark .atb-scope { position: relative; display: inline-flex; width: auto; max-width: none; margin: 0; padding: 0; background: none; border-radius: 0; }
body.at-dark .atb-scope::after {
  content: ''; position: absolute; right: 12px; top: 50%; width: 6px; height: 6px; margin-top: -5px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg);
  color: var(--dk-muted); pointer-events: none;
}
body.at-dark .atb-scope-select {
  appearance: none; -webkit-appearance: none; min-height: 32px; padding: 5px 32px 5px 14px;
  border: 1px solid var(--dk-line-strong); border-radius: 980px; background: transparent; color: var(--dk-ink);
  font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
}
body.at-dark .atb-scope-select:hover { border-color: var(--dk-muted); }
body.at-dark .atb-scope-select:focus-visible { outline: 2px solid var(--dk-blue); outline-offset: 2px; }
body.at-dark .atb-scope-select option { background: #1c1c1e; color: var(--dk-ink); }

/* Rows: divider lines only */
body.at-dark .atb-panel { border-radius: 0; }
body.at-dark .atb-cols { padding-left: 0; padding-right: 0; border-bottom: 1px solid var(--dk-line); }
body.at-dark .atb-list,
body.at-dark .atb-empty,
body.at-dark .atb-error,
body.at-dark .atb-error p,
body.at-dark .atb-friends-card { background: none; border: 0; border-radius: 0; }
body.at-dark .atb-list { border-bottom: 1px solid var(--dk-line); }
body.at-dark .atb-list:empty { border: 0; }
body.at-dark .atb-friends-card,
body.at-dark .atb-empty { border-bottom: 1px solid var(--dk-line); }
body.at-dark .atb-row { padding-left: 0; padding-right: 0; border-top: 1px solid var(--dk-line); }
body.at-dark .atb-row:first-child { border-top: 0; }
body.at-dark .atb-list .atb-row.is-me { background: none; }
body.at-dark .atb-list .atb-row.is-me .atb-name-text { color: #fff; font-weight: 600; }

/* Your row, pinned under the list: the same row with a blue avatar and the You chip */
body.at-dark .atb-me { margin: 0; border: 0; border-radius: 0; border-bottom: 1px solid var(--dk-line); background: none; }
body.at-dark .atb-me-row { padding-left: 0; padding-right: 0; }
body.at-dark .atb-me-row > :first-child { margin-left: 0; }
body.at-dark .atb-more { margin-top: 20px; }

/* FAQ: no background card */
body.at-dark .lp-card.at-faq { background: none; border-radius: 0; padding: 0; margin-top: 72px; }
body.at-dark .atb-me .atb-row.is-me { background: none; }

/* ─── Third pass (owner, 23 Nov 2026) ─── */
/* Intro tiles: heading and text at the top of the square, the action on its bottom line. */
.at-feature { align-items: stretch; }
.at-feature-text { display: flex; flex-direction: column; justify-content: space-between; gap: 16px; min-height: 180px; }
.at-feature-meta { margin: 0; }
.at-start-link {
  align-self: flex-start; padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 17px; font-weight: 500; line-height: 1.4; color: var(--dk-blue, #2997ff);
  -webkit-tap-highlight-color: transparent;
}
.at-start-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.at-start-link:focus-visible { outline: 2px solid var(--dk-blue, #2997ff); outline-offset: 4px; border-radius: 4px; }
@media (max-width: 480px) {
  .at-feature-text { min-height: 112px; gap: 10px; }
  .at-start-link { font-size: 16px; }
}

/* Board filters: three small dropdowns on the right of the heading. */
body.at-dark .atb-filters { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
body.at-dark .atb-board .atb-controls { display: inline-flex; flex-wrap: wrap; gap: 8px; margin: 0; }
body.at-dark .atb-board .atb-controls[hidden] { display: none !important; }
body.at-dark .at-board-page { margin-top: 112px; }
body.at-dark .at-board-page .atb-title { font-size: clamp(32px, 2.6vw + 18px, 44px); }

/* Rows without avatars: rank, player, device, score. */
body.at-dark .atb-row { grid-template-columns: 44px minmax(0, 1fr) auto 64px; }
body.at-dark .atb-me-row { grid-template-columns: 44px minmax(0, 1fr) 64px; }

body.at-dark .atb-rank { width: auto; height: auto; justify-content: flex-start; border-radius: 0; background: none; }

@media (max-width: 600px) {
  body.at-dark .atb:not(.atb-compact) .atb-board .atb-head { flex-direction: column; align-items: flex-start; }
  body.at-dark .atb-filters { justify-content: flex-start; }
  body.at-dark .atb-row { grid-template-columns: 34px minmax(0, 1fr) 48px; }
  body.at-dark .atb-me-row { grid-template-columns: 34px minmax(0, 1fr) 48px; }
  body.at-dark .at-board-page { margin-top: 88px; }
}
body.at-dark .atb-cols,
body.at-dark .atb-row,
body.at-dark .atb-me-row { padding-left: 14px; padding-right: 14px; }
@media (max-width: 600px) {
  body.at-dark .atb-cols,
  body.at-dark .atb-row,
  body.at-dark .atb-me-row { padding-left: 10px; padding-right: 10px; }
}

/* ─── Fourth pass (owner, 23 Nov 2026): the test itself in the tile language ───
   Flat on black (no card), small grain squares, blue text actions, hairlines and 8 px corners
   like the squares. The leaderboard and FAQ step aside while a part runs (body.at-testing). */
body.at-testing .at-board-section,
body.at-testing .at-faq { display: none !important; }

body.at-dark .at-game,
body.at-dark .at-game.is-intro { background: none; border-radius: 0; padding: 40px 0 8px; min-height: 0; }
body.at-dark .at-play,
body.at-dark .at-result,
body.at-dark .at-invalid { max-width: 720px; }

/* "Part n of 3": one tile, a larger square with the part's colours */
body.at-dark .at-inter { max-width: 760px; margin: 0; text-align: left; }
.at-feature-part .at-square { width: 220px; }
.at-feature-part .at-feature-text { min-height: 220px; }
body.at-dark .at-inter .at-kicker { margin: 0 0 8px; font-size: 14px; font-weight: 500; letter-spacing: 0; color: var(--dk-faint); }
body.at-dark .at-inter .at-feature-title {
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 30px; font-weight: 500; line-height: 1.2; letter-spacing: -0.4px; color: #fff; margin: 0 0 12px; text-align: left;
}
body.at-dark .at-inter .at-feature-desc { max-width: 46ch; }
body.at-dark .at-inter .at-inter-note { margin: 14px 0 0; padding: 0; border: 0; background: none; max-width: 46ch; font-size: 15px; color: var(--dk-orange); }
.at-square-part { background: linear-gradient(160deg, #16b364 0%, #0f8f6e 50%, #1fb3c9 100%); }
.at-square-part .at-glow-1 { background: radial-gradient(circle, #3ee08a 0%, rgba(62, 224, 138, 0) 70%); }
.at-square-part .at-glow-2 { background: radial-gradient(circle, #29c4e8 0%, rgba(41, 196, 232, 0) 70%); }
.at-square-part .at-glow-3 { background: radial-gradient(circle, #b8f5c9 0%, rgba(184, 245, 201, 0) 70%); }
.at-square-part .at-glow-4 { background: radial-gradient(circle, #0fd1a0 0%, rgba(15, 209, 160, 0) 70%); }
.at-inter[data-part="memory"] .at-square-part { background: linear-gradient(160deg, #3d5afe 0%, #5b3fd6 50%, #8a63ff 100%); }
.at-inter[data-part="memory"] .at-glow-1 { background: radial-gradient(circle, #6f8bff 0%, rgba(111, 139, 255, 0) 70%); }
.at-inter[data-part="memory"] .at-glow-2 { background: radial-gradient(circle, #b78cff 0%, rgba(183, 140, 255, 0) 70%); }
.at-inter[data-part="memory"] .at-glow-3 { background: radial-gradient(circle, #9fd0ff 0%, rgba(159, 208, 255, 0) 70%); }
.at-inter[data-part="memory"] .at-glow-4 { background: radial-gradient(circle, #7a5cff 0%, rgba(122, 92, 255, 0) 70%); }
.at-inter[data-part="rules"] .at-square-part { background: linear-gradient(160deg, #ff7a3d 0%, #ff4f6d 55%, #ff9a8a 100%); }
.at-inter[data-part="rules"] .at-glow-1 { background: radial-gradient(circle, #ffb15c 0%, rgba(255, 177, 92, 0) 70%); }
.at-inter[data-part="rules"] .at-glow-2 { background: radial-gradient(circle, #ff6fa0 0%, rgba(255, 111, 160, 0) 70%); }
.at-inter[data-part="rules"] .at-glow-3 { background: radial-gradient(circle, #ffd3b0 0%, rgba(255, 211, 176, 0) 70%); }
.at-inter[data-part="rules"] .at-glow-4 { background: radial-gradient(circle, #ff5a3c 0%, rgba(255, 90, 60, 0) 70%); }

/* Play screens: a heading row over a divider, then the board */
body.at-dark .at-play-head { margin: 0 0 20px; padding-bottom: 14px; border-bottom: 1px solid var(--dk-line); }
body.at-dark .at-game .at-play-title {
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 26px; font-weight: 500; letter-spacing: -0.3px; color: #fff;
}
body.at-dark .at-clock {
  min-width: 0; padding: 0; border: 0; background: none; box-shadow: none;
  font-size: 20px; font-weight: 500; color: var(--dk-blue); font-variant-numeric: tabular-nums;
}
body.at-dark .at-pad,
body.at-dark .at-mem-board,
body.at-dark .at-rule-board { background: none; border: 1px solid var(--dk-line); border-radius: 8px; }
body.at-dark .at-pad[data-state="wait"] .at-pad-circle,
body.at-dark .at-pad .at-pad-circle { background: #2c2c2e; }
body.at-dark .at-pad[data-state="dot"] .at-pad-circle { background: var(--dk-green); box-shadow: 0 0 28px rgba(48, 209, 88, 0.55); }
body.at-dark .at-pad[data-state="missed"] .at-pad-circle { background: #2c2c2e; }

/* "Last times": plain numbers, no pills */
body.at-dark .at-last { justify-content: flex-start; margin-top: 16px; }
body.at-dark .at-last-head { color: var(--dk-faint); }
body.at-dark .at-last-list li { min-width: 0; padding: 0 12px 0 0; border: 0; border-radius: 0; background: none; color: #fff; font-weight: 500; }

/* Keypad and answers: flat keys with hairlines and the squares' corners */
body.at-dark .at-key { background: none; border: 1px solid var(--dk-line); border-radius: 8px; color: #fff; font-weight: 500; }
body.at-dark .at-key:hover { border-color: var(--dk-line-strong); }
body.at-dark .at-key:active { background: var(--dk-raise); }
body.at-dark .at-btn-answer { background: none; border: 1px solid var(--dk-line-strong); border-radius: 8px; color: #fff; font-weight: 500; }
body.at-dark .at-btn-answer:hover { background: var(--dk-raise); }
body.at-dark .at-btn-answer.is-pressed { background: rgba(10, 132, 255, 0.18); border-color: #0a84ff; }
body.at-dark .at-btn-answer:disabled { opacity: 0.45; }
body.at-dark .at-kbd { background: rgba(255, 255, 255, 0.1); color: var(--dk-muted); }

/* Result and "can't be scored": the same flat language */
body.at-dark .at-tiles li,
body.at-dark .at-cta,
body.at-dark .at-vs { border-radius: 8px; background: none; }

@media (max-width: 600px) {
  .at-feature-part .at-square { width: 112px; border-radius: 6px; }
  .at-feature-part .at-feature-text { min-height: 112px; }
  body.at-dark .at-inter .at-feature-title { font-size: 22px; margin-bottom: 8px; }
  body.at-dark .at-inter .at-kicker { font-size: 13px; margin-bottom: 4px; }
  body.at-dark .at-inter .at-feature { gap: 18px; }
  body.at-dark .at-game, body.at-dark .at-game.is-intro { padding: 28px 0 8px; }
  body.at-dark .at-game .at-play-title { font-size: 22px; }
}
body.at-testing .at-about { margin-top: 140px; }
.at-feature .at-square { align-self: flex-start; }

/* ─── Fifth pass (owner, 24 Nov 2026): one layout system for every screen ───
   1. One content width for the game, the board, the FAQ and the footer-style text.
   2. One vertical rhythm (--at-space): the gap under the nav equals the gap between blocks.
   3. A single tile on its own is centred on the page.
   4. Result, "can't be scored", share, join and saved-score blocks in the same flat language. */
body.at-dark { --at-space: 96px; --at-gutter: 40px; --at-max: 1020px; }
@media (max-width: 768px) { body.at-dark { --at-space: 72px; --at-gutter: 32px; } }
@media (max-width: 480px) { body.at-dark { --at-space: 56px; --at-gutter: 24px; } }

body.at-dark .at-game,
body.at-dark .at-game.is-intro,
body.at-dark .at-board-section,
body.at-dark .lp-card.at-faq,
body.at-dark .at-about {
  width: calc(100% - 2 * var(--at-gutter)); max-width: var(--at-max);
  margin-left: auto; margin-right: auto; padding-left: 0; padding-right: 0; box-sizing: border-box;
}
/* --at-top is measured so the first block sits --at-space under the nav (see the script note in the commit). */
body.at-dark .at-game,
body.at-dark .at-game.is-intro { margin-top: var(--at-top, 60px); padding-top: 0; padding-bottom: 0; }
body.at-dark .at-board-section,
body.at-dark .lp-card.at-faq,
body.at-dark .at-about,
body.at-testing .at-about { margin-top: var(--at-space); }
body.at-dark .at-board-page { margin-top: var(--at-top, 60px); }

/* A single tile is centred */
body.at-dark .at-inter,
body.at-dark .at-invalid,
body.at-dark .at-result { max-width: none; margin: 0; text-align: left; }
body.at-dark .at-feature-part { width: fit-content; max-width: 100%; margin: 0 auto; }
body.at-dark .at-feature-part .at-feature-text { max-width: 460px; }
body.at-dark .at-invalid .at-kicker,
body.at-dark .at-result .at-kicker { margin: 0 0 8px; font-size: 14px; font-weight: 500; letter-spacing: 0; color: var(--dk-faint); }
body.at-dark .at-invalid .at-feature-title,
body.at-dark .at-result .at-feature-title {
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 30px; font-weight: 500; line-height: 1.2; letter-spacing: -0.4px; color: #fff; margin: 0 0 12px; text-align: left;
}
.at-square-invalid { background: linear-gradient(160deg, #5a5a60 0%, #2f2f33 55%, #6b6b72 100%); }
.at-square-invalid .at-glow-1 { background: radial-gradient(circle, #9a9aa2 0%, rgba(154, 154, 162, 0) 70%); }
.at-square-invalid .at-glow-2 { background: radial-gradient(circle, #c7c7cc 0%, rgba(199, 199, 204, 0) 70%); opacity: 0.5; }
.at-square-invalid .at-glow-3 { background: radial-gradient(circle, #7d7d85 0%, rgba(125, 125, 133, 0) 70%); }
.at-square-invalid .at-glow-4 { background: radial-gradient(circle, #48484d 0%, rgba(72, 72, 77, 0) 70%); }
.at-square-result { background: linear-gradient(160deg, #1f5fe0 0%, #1a4bb8 45%, #11a37f 100%); }
.at-square-result .at-glow-1 { background: radial-gradient(circle, #4d86ff 0%, rgba(77, 134, 255, 0) 70%); }
.at-square-result .at-glow-2 { background: radial-gradient(circle, #23e0a8 0%, rgba(35, 224, 168, 0) 70%); }
.at-square-result .at-glow-3 { background: radial-gradient(circle, #5fd0f5 0%, rgba(95, 208, 245, 0) 70%); }
.at-square-result .at-glow-4 { background: radial-gradient(circle, #9af0d2 0%, rgba(154, 240, 210, 0) 70%); }

/* Result: the big number in the tile, the parts as divided rows, then share and the app link */
body.at-dark .at-result .at-score #at-score {
  display: block; margin-top: 2px; font-size: 64px; font-weight: 600; line-height: 1; letter-spacing: -1.5px;
  color: #fff; font-variant-numeric: tabular-nums;
}
body.at-dark .at-result .at-band { margin: 0; font-size: inherit; font-weight: 500; color: #fff; }
body.at-dark .at-result .at-beta { font-size: 13px; color: var(--dk-faint); }
body.at-dark .at-result .at-vs { display: block; margin: 12px 0 0; padding: 0; border: 0; background: none; font-size: 15px; font-weight: 500; color: var(--dk-blue); }
body.at-dark .at-result .at-vs[hidden] { display: none; }
body.at-dark .at-result > :not(.at-feature-part) { max-width: 720px; margin-left: auto; margin-right: auto; }
body.at-dark .at-tiles { display: block; margin-top: var(--at-space); padding: 0; list-style: none; border-top: 1px solid var(--dk-line); }
body.at-dark .at-tiles li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 56px; align-items: baseline; gap: 16px;
  padding: 16px 0; border: 0; border-bottom: 1px solid var(--dk-line); border-radius: 0; background: none; text-align: left;
}
body.at-dark .at-tile-name { font-size: 17px; font-weight: 500; color: #fff; }
body.at-dark .at-tile-raw { grid-column: auto; font-size: 14px; color: var(--dk-faint); text-align: right; }
body.at-dark .at-tile-score { font-size: 22px; font-weight: 600; color: #fff; text-align: right; }
body.at-dark .at-share { margin-top: var(--at-space); }
body.at-dark .at-cta {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px;
  margin-top: var(--at-space); padding: 20px 0; border: 0; border-top: 1px solid var(--dk-line); border-bottom: 1px solid var(--dk-line);
  border-radius: 0; background: none; text-align: left;
}
body.at-dark .at-cta-text { margin: 0; font-size: 16px; font-weight: 400; color: var(--dk-muted); }
.at-cta-link { font-size: 16px; font-weight: 500; color: var(--dk-blue, #2997ff); text-decoration: none; white-space: nowrap; }
.at-cta-link:hover { text-decoration: underline; text-underline-offset: 3px; }
body.at-dark .at-result .at-disclaimer { margin-top: 16px; text-align: left; color: var(--dk-faint); }

/* Share block: flat, left aligned, hairline buttons with the squares' corners */
body.at-dark .ats-title { text-align: left; font-size: 22px; font-weight: 500; color: #fff; }
body.at-dark .ats-input { border-radius: 8px; background: none; }
body.at-dark .ats-preview { justify-content: flex-start; }
body.at-dark .ats-preview-img { border-radius: 8px; box-shadow: none; border: 1px solid var(--dk-line); }
body.at-dark .ats-btn,
body.at-dark .ats-opt { border-radius: 8px; background: none; border: 1px solid var(--dk-line-strong); color: #fff; font-weight: 500; }
body.at-dark .ats-btn:hover,
body.at-dark .ats-opt:hover { background: var(--dk-raise); }
body.at-dark .ats-btn-primary { color: var(--dk-blue); border-color: var(--dk-line-strong); }
body.at-dark .ats-panel { background: none; border: 1px solid var(--dk-line); border-radius: 8px; box-shadow: none; }

/* Board notices (join, saving, rank, errors) and account boxes: hairline, 8 px corners, no fill */
body.at-dark .atb-card:not(.atb-board) { background: none; border: 1px solid var(--dk-line); border-radius: 8px; padding: 24px; }
body.at-dark .atb-join-score,
body.at-dark .atb-invite-box,
body.at-dark .atb-best-box,
body.at-dark .atb-edit,
body.at-dark .atb-input { border-radius: 8px; background: none; }
/* "See the full leaderboard ›" as a blue text link, like "View more" */
body.at-dark .atb-more-btn {
  display: inline-flex; width: auto; min-height: 0; padding: 0; border: 0; background: none;
  color: var(--dk-blue); font-size: 16px; font-weight: 500;
}
body.at-dark .atb-more-btn:hover { background: none; text-decoration: underline; text-underline-offset: 3px; }

/* Saved scores under the start tiles: a divided row, not a box */
body.at-dark .at-intro .at-stored {
  margin-top: 40px; padding: 20px 0 0; border: 0; border-top: 1px solid var(--dk-line); border-radius: 0;
  background: none; -webkit-backdrop-filter: none; backdrop-filter: none; text-align: left; color: var(--dk-ink);
}
body.at-dark .at-intro .at-stored-label,
body.at-dark .at-intro .at-stored-last { color: var(--dk-faint); }
body.at-dark .at-intro .at-link-btn { color: var(--dk-blue); text-decoration: none; }

@media (max-width: 600px) {
  body.at-dark .at-invalid .at-feature-title,
  body.at-dark .at-result .at-feature-title { font-size: 22px; margin-bottom: 8px; }
  body.at-dark .at-result .at-score #at-score { font-size: 48px; }
  body.at-dark .at-invalid .at-kicker,
  body.at-dark .at-result .at-kicker { font-size: 13px; margin-bottom: 4px; }
  body.at-dark .at-tiles li { grid-template-columns: minmax(0, 1fr) 48px; }
  body.at-dark .at-tile-raw { grid-column: 1; grid-row: 2; text-align: left; margin-top: -10px; }
  body.at-dark .at-tile-score { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
}
/* The first block sits --at-space under the nav: on desktop the nav ends 40 px below where the page
   content starts (after the announcement bar); at 768 px and under there is no bar and it ends at 48 px. */
body.at-dark { --at-top: calc(var(--at-space) + 40px); }
@media (max-width: 768px) { body.at-dark { --at-top: calc(var(--at-space) + 48px); } }
body.at-dark .at-game > .at-screen { padding-top: 0; padding-bottom: 0; min-height: 0; }

/* ─── Sixth pass (owner, 24 Nov 2026): the result page as tiles ───
   Row 1: the result tile (Share my score › / Challenge a friend ›) and, beside it, the join tile in
   violet, built from the board's join card. Then the parts, "Play again", the score card tile and the app row. */
body.at-dark .at-result > :not(.at-feature-part) { max-width: none; }
body.at-dark .at-result-row { margin: 0; }
body.at-dark .at-result-row.is-single { display: flex; justify-content: center; }
body.at-dark .at-result-row .at-feature { align-items: stretch; }
body.at-dark .at-result-row .at-square { width: 180px; }
body.at-dark .at-result-row .at-feature-text { min-height: 180px; }
.at-tile-links { display: flex; flex-wrap: wrap; gap: 6px 24px; margin: 0; }

/* Join tile: violet square; the board's card restyled as tile text */
.at-square-join { background: linear-gradient(160deg, #7b5cff 0%, #b14fe0 50%, #ff6fb5 100%); }
.at-square-join .at-glow-1 { background: radial-gradient(circle, #9d84ff 0%, rgba(157, 132, 255, 0) 70%); }
.at-square-join .at-glow-2 { background: radial-gradient(circle, #ff8ccf 0%, rgba(255, 140, 207, 0) 70%); }
.at-square-join .at-glow-3 { background: radial-gradient(circle, #e0b8ff 0%, rgba(224, 184, 255, 0) 70%); }
.at-square-join .at-glow-4 { background: radial-gradient(circle, #6a4dff 0%, rgba(106, 77, 255, 0) 70%); }
body.at-dark .at-join-slot { justify-content: flex-start; }
body.at-dark .at-join-slot .atb-notice { flex: 1; display: flex; flex-direction: column; }
body.at-dark .at-join-slot .atb-card,
body.at-dark .at-join-slot .atb-card:not(.atb-board) {
  flex: 1; display: flex; flex-direction: column; padding: 0; border: 0; border-radius: 0; background: none;
}
body.at-dark .at-join-slot .atb-join-score { display: none; }
body.at-dark .at-join-slot .atb-join-body { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
body.at-dark .at-join-slot .atb-status-title {
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 26px; font-weight: 500; line-height: 1.2; letter-spacing: -0.3px; color: #fff; margin: 0 0 2px;
}
body.at-dark .at-join-slot .atb-eyebrow { font-size: 14px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--dk-faint); }
body.at-dark .at-join-slot .atb-status-text { margin: 0; font-size: 16px; line-height: 1.5; color: var(--dk-muted); }
body.at-dark .at-join-slot .atb-google {
  margin-top: auto; min-height: 0; padding: 0; gap: 8px; border: 0; border-radius: 0; background: none; box-shadow: none;
  color: var(--dk-blue); font-size: 17px; font-weight: 500;
}
body.at-dark .at-join-slot .atb-google::after { content: ' ›'; }
body.at-dark .at-join-slot .atb-google:hover { background: none; box-shadow: none; text-decoration: underline; text-underline-offset: 3px; }
body.at-dark .at-join-slot .atb-google svg { width: 16px; height: 16px; }
body.at-dark .at-join-slot .atb-check { font-size: 14px; color: var(--dk-muted); }
body.at-dark .at-join-slot .atb-check input { width: 16px; height: 16px; }
body.at-dark .at-join-slot .atb-fine { font-size: 13px; color: var(--dk-faint); }
body.at-dark .at-join-slot .atb-status-actions { margin-top: auto; }

/* "Would you like another try? Play again ›" */
.at-again-row {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 24px;
  margin: 0; padding: 18px 0; border-bottom: 1px solid var(--dk-line, rgba(255, 255, 255, 0.1));
  font-size: 16px; color: var(--dk-muted, #a1a1a6); text-align: left;
}

/* The score card: a tile, the card image as the "square" and the text beside it.
   The share buttons stay in the DOM (the result tile's links press them) but are not shown here. */
body.at-dark #at-share .ats {
  display: grid; grid-template-columns: 180px minmax(0, 1fr); column-gap: 32px; row-gap: 10px; align-items: start;
}
body.at-dark #at-share .ats-preview { grid-column: 1; grid-row: 1 / span 4; margin: 0; }
body.at-dark #at-share .ats-preview-img { width: 180px; max-height: none; height: auto; }
body.at-dark #at-share .ats-title { grid-column: 2; grid-row: 1; margin: 0; text-align: left; font-size: 26px; font-weight: 500; letter-spacing: -0.3px; }
body.at-dark #at-share .ats-desc { grid-column: 2; grid-row: 2; margin: 0 0 8px; max-width: 46ch; font-size: 16px; line-height: 1.5; color: var(--dk-muted); }
body.at-dark #at-share .ats-field { grid-column: 2; grid-row: 3; max-width: 420px; }
body.at-dark #at-share .ats-actions { display: none; }
body.at-dark #at-share .ats-panel { grid-column: 1 / -1; margin-top: 16px; }

@media (max-width: 600px) {
  body.at-dark .at-result-row .at-square { width: 112px; }
  body.at-dark .at-result-row .at-feature-text { min-height: 112px; }
  body.at-dark .at-join-slot .atb-status-title { font-size: 20px; }
  body.at-dark .at-join-slot .atb-status-text { font-size: 15px; }
  body.at-dark #at-share .ats { grid-template-columns: 112px minmax(0, 1fr); column-gap: 18px; }
  body.at-dark #at-share .ats-preview-img { width: 112px; }
  body.at-dark #at-share .ats-title { font-size: 20px; }
  body.at-dark #at-share .ats-desc { font-size: 15px; }
  body.at-dark #at-share .ats-field { grid-column: 1 / -1; grid-row: auto; }
}

/* ─── Seventh pass (owner, 24 Nov 2026): every tile fits inside its square ───
   One square size (--sq). The square never shrinks below --sq; the text column is exactly as tall as the
   square (heading at the top, action on the bottom line). If text ever runs longer (a rare restart note,
   a friend invite), the square grows with it so the two edges still line up. */
body.at-dark { --sq: 200px; }
@media (max-width: 600px) { body.at-dark { --sq: 112px; } }
body.at-dark .at-feature { align-items: stretch; gap: 28px; }
body.at-dark .at-feature .at-square,
body.at-dark .at-feature-part .at-square,
body.at-dark .at-result-row .at-square {
  width: var(--sq); min-height: var(--sq); height: auto; aspect-ratio: auto; align-self: stretch;
}
body.at-dark .at-feature .at-feature-text,
body.at-dark .at-feature-part .at-feature-text,
body.at-dark .at-result-row .at-feature-text { min-height: var(--sq); }
body.at-dark .at-feature-row { column-gap: 40px; }

/* Result tile: "Attention" the same size as "Join the leaderboard", the number large, all within the square */
body.at-dark .at-result .at-feature-title,
body.at-dark .at-join-slot .atb-status-title { font-size: 24px; line-height: 1.2; letter-spacing: -0.3px; margin: 0; }
body.at-dark .at-result .at-score #at-score { margin-top: 2px; font-size: 60px; line-height: 0.95; letter-spacing: -1.5px; }
body.at-dark .at-result .at-feature-top .at-feature-desc { margin-top: 8px; font-size: 15px; line-height: 1.4; }
body.at-dark .at-result .at-feature-text { gap: 12px; }
.at-tile-links { gap: 4px 20px; }
.at-tile-links .at-start-link { font-size: 16px; line-height: 1.3; }
/* "You beat Priya by 12" (challenge links only) sits under the tiles so it never pushes past the square */
body.at-dark .at-result > .at-vs { margin: 28px 0 0; text-align: center; }

/* Join tile: title and text at the top; Google and the e-mail box on the bottom line */
body.at-dark .at-join-slot .atb-join-body { gap: 8px; }
body.at-dark .at-join-slot .atb-status-text { font-size: 15px; line-height: 1.45; }
body.at-dark .at-join-slot .atb-google { font-size: 16px; }
body.at-dark .at-join-slot .atb-check { font-size: 13px; line-height: 1.3; }
body.at-dark .at-join-slot .atb-fine { display: none; }

/* Headings focused by the script (after each screen change) get no focus ring; real controls keep theirs. */
body.at-dark .at-game :is(h1, h2)[tabindex="-1"]:focus,
body.at-dark .at-game :is(h1, h2)[tabindex="-1"]:focus-visible { outline: none; }

@media (max-width: 600px) {
  body.at-dark .at-feature { gap: 16px; }
  body.at-dark .at-intro h1,
  body.at-dark .at-intro .at-feature-title,
  body.at-dark .at-result .at-feature-title,
  body.at-dark .at-join-slot .atb-status-title,
  body.at-dark .at-inter .at-feature-title,
  body.at-dark .at-invalid .at-feature-title { font-size: 19px; }
  body.at-dark .at-result .at-score #at-score { font-size: 44px; }
  .at-tile-links .at-start-link,
  .at-start-link { font-size: 15px; }
  body.at-dark .at-join-slot .atb-google { font-size: 15px; }
}

/* Saved scores under the start tiles: one divided row. "Your best on this device 61" on the left,
   blue "Share ›" / "Put it on the leaderboard ›" on the right, the last score and Forget under it in grey. */
body.at-dark .at-intro .at-stored {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 6px 24px;
  max-width: none; margin: var(--at-space) 0 0; padding: 18px 0; border: 0;
  border-top: 1px solid var(--dk-line); border-bottom: 1px solid var(--dk-line); border-radius: 0;
  background: none; box-shadow: none; text-align: left;
}
body.at-dark .at-intro .at-stored[hidden] { display: none; }
body.at-dark .at-stored-best { grid-column: 1; justify-content: flex-start; gap: 4px 10px; }
body.at-dark .at-stored-label { font-size: 16px; font-weight: 400; letter-spacing: 0; color: var(--dk-muted); }
body.at-dark .at-stored-score { font-size: 20px; color: #fff; }
body.at-dark .at-stored-actions { grid-column: 2; grid-row: 1; justify-content: flex-end; gap: 6px 20px; margin: 0; }
body.at-dark .at-stored-actions .at-start-link { font-size: 16px; }
body.at-dark .at-stored-last { grid-column: 1; margin: 0; font-size: 14px; color: var(--dk-faint); }
body.at-dark .at-stored-forget { grid-column: 2; justify-self: end; margin: 0; font-size: 14px; font-weight: 400; color: var(--dk-faint); text-decoration: none; }
body.at-dark .at-intro .at-stored .at-link-btn { text-decoration: none; }
@media (max-width: 600px) {
  body.at-dark .at-intro .at-stored { grid-template-columns: minmax(0, 1fr); }
  body.at-dark .at-stored-actions,
  body.at-dark .at-stored-forget { grid-column: 1; grid-row: auto; justify-content: flex-start; justify-self: start; }
}
body.at-dark .at-intro .at-stored .at-stored-forget { color: var(--dk-faint); }

/* Board filters never stretch: each dropdown keeps its own height; on phones the three share one row. */
body.at-dark .atb-filters,
body.at-dark .atb-board .atb-controls { align-items: center; }
body.at-dark .atb-scope { align-self: center; }
@media (max-width: 600px) {
  body.at-dark .atb-filters { flex-wrap: nowrap; gap: 6px; }
  body.at-dark .atb-board .atb-controls { flex-wrap: nowrap; gap: 6px; }
  body.at-dark .atb-scope-select { min-height: 30px; padding: 4px 24px 4px 11px; font-size: 13px; }
  body.at-dark .atb-scope::after { right: 10px; width: 5px; height: 5px; }
}
@media (max-width: 600px) {
  body.at-dark .atb-board .atb-controls { flex-direction: row; align-items: center; }
  body.at-dark .at-join-slot .atb-google { width: auto; justify-content: flex-start; }
}
/* Leaderboard page: the gap above the footer text equals the gap under the nav (the footer adds its own 24 px). */
body.at-dark .at-board-page { margin-bottom: calc(var(--at-space) - 24px); }
/* Phones: tiles whose text is longer than the square (Parts, can't be scored, result, join) stack — the
   square on top, the text under it — so the square stays square. The short start tiles stay side by side. */
@media (max-width: 600px) {
  body.at-dark .at-feature-part,
  body.at-dark .at-result-row .at-feature { flex-direction: column; align-items: flex-start; gap: 18px; width: 100%; }
  body.at-dark .at-feature-part .at-square,
  body.at-dark .at-result-row .at-square { height: var(--sq); min-height: var(--sq); align-self: flex-start; }
  body.at-dark .at-feature-part .at-feature-text,
  body.at-dark .at-result-row .at-feature-text { min-height: 0; width: 100%; max-width: none; gap: 14px; }
  body.at-dark .at-result-row { row-gap: var(--at-space); }
}
