/* Hexi Pop website. Shared by every language version of the page. */

/* Fredoka ships with the app; self-hosted so the page makes no third-party requests. */
@font-face { font-family: "Fredoka"; src: url("/fonts/Fredoka-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Fredoka"; src: url("/fonts/Fredoka-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }

/* The app's Palette.swift, one to one. The game is always on purple, so the page is too. */
:root {
  --background: #3D2C8D;
  --deep: #2E2070;
  --well: #33247F;
  --card: #4F3DAB;
  --card-edge: #3A2B8A;
  --empty-cell: #4A3AA8;
  --empty-cell-edge: #5B4BC0;
  --text: #FFFFFF;
  --text-secondary: #CFC6FF;
  --muted: #A99EE8;
  --outside: #241760;

  --yellow: #FFD23F;  --yellow-edge: #D9A400;  --yellow-text: #4A3500;
  --pink: #FF5FA2;    --pink-edge: #D63B80;    --pink-text: #5C0F33;
  --mint: #3EE0A8;    --mint-edge: #1FB582;    --mint-text: #0B4D36;
  --sky: #4CC9F0;     --sky-edge: #2A9FC6;
  --orange: #FF8C42;  --orange-edge: #E06A1F;

  --radius: 22px;
  --max: 1080px;

  /* Fredoka has Latin only. Greek and Chinese fall through to the system's
     rounded or plain sans, while digits and Latin words stay in Fredoka. */
  --font: "Fredoka", ui-rounded, system-ui, sans-serif;
}
:lang(el) { --font: "Fredoka", ui-rounded, system-ui, "Segoe UI", Roboto, "Noto Sans", sans-serif; }
:lang(zh) { --font: "Fredoka", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: var(--font);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video, svg { display: block; max-width: 100%; }
a { color: var(--yellow); }
h1, h2, h3 { font-weight: 500; line-height: 1.1; margin: 0; text-wrap: balance; }
:lang(zh) :is(h1, h2, h3) { line-height: 1.3; }
p { margin: 0; text-wrap: pretty; }

/* Read by screen readers, not shown. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

/* ---------- Nav ---------- */
.nav {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-top: 18px; padding-bottom: 18px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 500; font-size: 20px; }
.brand svg { width: 32px; height: 32px; }
.nav-end { display: flex; align-items: center; gap: 22px; }
.nav-links { display: flex; gap: 22px; }
.nav-links a { color: var(--text-secondary); text-decoration: none; font-size: 16px; }
.nav-links a:hover { color: var(--text); }
@media (max-width: 760px) { .nav-links { display: none; } }

/* ---------- Language menu: a plain <details>, so it works without JS ---------- */
.lang { position: relative; }
.lang summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--card); color: var(--text);
  font-size: 15px; font-weight: 500;
}
.lang summary::-webkit-details-marker { display: none; }
.lang summary svg { width: 16px; height: 16px; }
.lang summary::after { content: ""; width: 7px; height: 7px; border: solid var(--text-secondary); border-width: 0 2px 2px 0; transform: translateY(-2px) rotate(45deg); }
.lang[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.lang summary:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.lang ul {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 10;
  min-width: 170px; margin: 0; padding: 6px; list-style: none;
  background: var(--deep); border-radius: 16px;
  box-shadow: 0 0 0 2px var(--card-edge), 0 18px 40px -12px rgba(10, 4, 40, .8);
}
.lang li a {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 8px 12px; border-radius: 10px;
  color: var(--text-secondary); text-decoration: none; font-size: 16px;
}
.lang li a:hover, .lang li a:focus-visible { background: var(--card); color: var(--text); outline: none; }
.lang li a[aria-current="page"] { color: var(--yellow); }
.lang li a[aria-current="page"]::after { content: "✓"; }

/* ---------- Store badges: Apple's and Google's official artwork, unmodified ---------- */
.badge { display: inline-block; position: relative; border-radius: 10px; line-height: 0; }
/* Every badge is trimmed to its visible edge, so one height fits all languages. */
.badge img { height: 54px; width: auto; }
a.badge { transition: transform .12s ease-out; }
a.badge:hover { transform: translateY(-2px); }
a.badge:focus-visible { outline: 3px solid var(--text); outline-offset: 4px; }
/* Not released yet: greyed out, not clickable. */
.badge.soon img { filter: grayscale(1); opacity: .45; }
/* Sits just above the badge's top edge, so it never covers the badge's own text. */
.badge.soon .pill { position: absolute; bottom: calc(100% - 4px); right: -8px; line-height: 1.4; font-size: 12px; box-shadow: 0 3px 0 var(--pink-edge); white-space: nowrap; }
.cta { row-gap: 22px; }

.pill {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  font-weight: 500; font-size: 14px;
}
.pill-pink { background: var(--pink); color: var(--pink-text); }
.pill-yellow { background: var(--yellow); color: var(--yellow-text); }
.pill-mint { background: var(--mint); color: var(--mint-text); }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 24px 0 72px; }
.hero-grid { display: grid; gap: 48px; align-items: center; }
@media (min-width: 880px) { .hero-grid { grid-template-columns: 1.1fr .9fr; } }
.hero-logo { width: 148px; margin-bottom: 20px; }
.hero h1 { font-size: clamp(52px, 9vw, 88px); letter-spacing: -.01em; }
.tagline { font-size: clamp(20px, 2.6vw, 26px); color: var(--text-secondary); margin-top: 10px; }
.hero-copy { margin-top: 20px; max-width: 34em; color: var(--text-secondary); }
.cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; padding-bottom: 5px; }
.hero-note { margin-top: 18px; font-size: 14px; color: var(--muted); }
.hero-media { position: relative; }

/* The phone that holds the trailer. */
.phone {
  position: relative;
  width: min(340px, 100%);
  margin: 0 auto;
  aspect-ratio: 9 / 16;  /* the trailer's own ratio (720x1280) */
  border-radius: 44px;
  padding: 12px;
  background: var(--outside);
  box-shadow: 0 0 0 2px var(--card-edge), 0 30px 60px -20px rgba(20, 10, 60, .7);
}
.phone video {
  width: 100%; height: 100%;
  border-radius: 33px;
  object-fit: cover;
  background: var(--deep);
}
/* Pause/play for the looping trailer. */
.video-toggle {
  position: absolute; right: 24px; bottom: 24px;
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  border: 0; cursor: pointer;
  background: rgba(36, 23, 96, .7); color: var(--text);
  backdrop-filter: blur(6px);
}
.video-toggle:hover { background: var(--card); }
.video-toggle:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.video-toggle svg { width: 16px; height: 16px; }
.video-toggle .play { display: none; }
.video-toggle[aria-pressed="true"] .play { display: block; }
.video-toggle[aria-pressed="true"] .pause { display: none; }

.floating-hex { position: absolute; pointer-events: none; opacity: .9; }
.floating-hex.a { width: 54px; left: 2%; top: 10%; }
.floating-hex.b { width: 38px; right: 4%; bottom: 14%; }
.floating-hex.c { width: 30px; left: 8%; bottom: 6%; }
@media (prefers-reduced-motion: no-preference) {
  .floating-hex { animation: bob 3.2s ease-in-out infinite alternate; }
  .floating-hex.b { animation-delay: -1.1s; }
  .floating-hex.c { animation-delay: -2.2s; }
}
@keyframes bob { to { transform: translateY(-10px) rotate(8deg); } }

/* ---------- Sections ---------- */
section { padding: 72px 0; }
.section-head { max-width: 40em; margin-bottom: 36px; }
.eyebrow { color: var(--yellow); font-weight: 500; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; }
:lang(zh) .eyebrow { letter-spacing: .12em; }
.section-head h2 { font-size: clamp(32px, 5vw, 46px); margin-top: 8px; }
.section-head p { color: var(--text-secondary); margin-top: 12px; font-size: 18px; }
.band { background: var(--deep); }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 5px 0 var(--card-edge);
  padding: 22px;
}

/* ---------- How to play ---------- */
.steps { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); counter-reset: step; }
.step { display: flex; flex-direction: column; gap: 14px; }
.step .board-well { background: var(--well); border-radius: 16px; padding: 14px; aspect-ratio: 1.15; display: grid; place-items: center; }
.step .board-well svg { width: 100%; height: 100%; }
.step-num {
  counter-increment: step;
  display: inline-grid; place-items: center; flex: none;
  width: 30px; height: 34px; margin-right: 8px;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: var(--yellow); color: var(--yellow-text);
  font-size: 15px; vertical-align: middle;
}
.step-num::before { content: counter(step); }
.step h3 { font-size: 21px; display: flex; align-items: center; }
.step p { color: var(--text-secondary); font-size: 16px; }

.scoring { margin-top: 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; color: var(--text-secondary); }
.scoring strong { color: var(--text); font-weight: 500; }

/* The tutorial's marching-ants target ring. */
@media (prefers-reduced-motion: no-preference) {
  .ants { animation: ants .6s linear infinite; }
  @keyframes ants { to { stroke-dashoffset: -9; } }
}

/* ---------- Features ---------- */
.features { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.feature h3 { font-size: 21px; margin: 14px 0 6px; }
.feature p { color: var(--text-secondary); font-size: 16px; }
.feature-icon { width: 44px; height: 44px; }

/* ---------- Difficulty ---------- */
.levels { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.level h3 { font-size: 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.meter { display: flex; gap: 4px; }
.meter i { width: 14px; height: 16px; background: var(--empty-cell-edge); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.meter i.on { background: var(--yellow); }
.level ul { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; color: var(--text-secondary); font-size: 16px; }
.level li { display: flex; gap: 10px; align-items: baseline; }
.level li::before { content: ""; flex: none; width: 9px; height: 10px; background: var(--mint); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); transform: translateY(1px); }

/* ---------- Screenshots ---------- */
#screens { position: relative; overflow: hidden; }
/* A soft yellow glow behind the phones, so they don't float on flat purple. */
#screens::before {
  content: ""; position: absolute; inset: 30% -10% auto; height: 70%;
  background: radial-gradient(closest-side, rgba(255, 210, 63, .14), transparent);
  pointer-events: none;
}
.shots {
  position: relative;
  display: grid; grid-auto-flow: column; grid-auto-columns: 230px;
  gap: 20px;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  /* Bleed to the screen edge on phones so the next screen peeks in. */
  margin: 0 -16px; padding: 8px 16px 24px; scroll-padding: 0 16px;
}
.shots::-webkit-scrollbar { display: none; }
.shots:focus-visible { outline: 3px solid var(--text); outline-offset: 4px; border-radius: 12px; }
.shots figure { margin: 0; scroll-snap-align: start; }
/* The same device as the hero, just smaller. The screenshots are all 300x620. */
.device {
  padding: 8px;
  border-radius: 34px;
  background: var(--outside);
  box-shadow: 0 0 0 2px var(--card-edge), 0 24px 44px -18px rgba(20, 10, 60, .75);
}
/* height: auto, or the height="620" attribute wins over aspect-ratio and the
   narrower-than-300px image gets its sides cropped. */
.device img { width: 100%; height: auto; aspect-ratio: 300 / 620; object-fit: cover; border-radius: 27px; }
.shots figcaption { margin-top: 18px; text-align: center; }
.shots figcaption strong { display: block; font-weight: 500; font-size: 19px; }
.shots figcaption span { display: block; color: var(--text-secondary); font-size: 15px; margin-top: 2px; }
@media (min-width: 880px) {
  /* All four fit, so drop the scroller and stagger them instead. */
  .shots { grid-auto-flow: row; grid-template-columns: repeat(4, 1fr); gap: 32px; overflow: visible; margin: 0; padding: 8px 0 56px; }
  .shots figure:nth-child(even) { transform: translateY(48px); }
}

/* ---------- Privacy + download ---------- */
.privacy { display: grid; gap: 24px; align-items: center; }
@media (min-width: 800px) { .privacy { grid-template-columns: auto 1fr; } }
.privacy-icon { width: 96px; }
.privacy h2 { font-size: clamp(28px, 4vw, 38px); }
.privacy p { color: var(--text-secondary); margin-top: 10px; }
.privacy h2 + p { margin-top: 12px; }

.download { text-align: center; }
.download .cta { justify-content: center; }
.download h2 { font-size: clamp(34px, 5.5vw, 52px); }
.download p { color: var(--text-secondary); margin-top: 12px; font-size: 18px; }

/* ---------- Footer ---------- */
footer { background: var(--outside); padding: 32px 0; color: var(--muted); font-size: 15px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; align-items: center; }
footer nav { display: flex; flex-wrap: wrap; gap: 20px; }
footer a { color: var(--text-secondary); text-decoration: none; }
footer a:hover, footer a[aria-current="page"] { color: var(--text); }
footer nav { gap: 10px 20px; }

/* ================= Shared by the inner pages ================= */

/* Header: the current page is marked, and "Play online" stays visible on phones as a pill. */
.nav-links a[aria-current="page"] { color: var(--text); }
.nav-links .nav-play {
  padding: 6px 14px; border-radius: 999px;
  background: var(--yellow); color: var(--yellow-text); font-weight: 500;
  box-shadow: 0 3px 0 var(--yellow-edge);
}
.nav-links .nav-play:hover, .nav-links .nav-play[aria-current="page"] { color: var(--yellow-text); }
@media (max-width: 760px) {
  .nav-links { display: flex; }
  .nav-links a:not(.nav-play) { display: none; }
  .nav-links .nav-play { font-size: 15px; white-space: nowrap; }
}
/* On the narrowest phones the wordmark gives way to the pill and language menu. */
@media (max-width: 380px) { .brand { font-size: 0; gap: 0; } }

.text-link { font-weight: 500; text-decoration: none; }
.text-link::after { content: " →"; }
.text-link:hover { text-decoration: underline; }
.hero .text-link { display: inline-block; margin-top: 10px; font-size: 16px; }
.more { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 10px 28px; }

.button {
  display: inline-block; padding: 12px 24px; border: 0; border-radius: 16px; cursor: pointer;
  background: var(--yellow); color: var(--yellow-text); box-shadow: 0 5px 0 var(--yellow-edge);
  font: inherit; font-weight: 500; font-size: 18px; text-decoration: none;
}
.button:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--yellow-edge); }
.button-quiet { background: var(--card); color: var(--text); box-shadow: 0 5px 0 var(--card-edge); }
.button-quiet:active { box-shadow: 0 2px 0 var(--card-edge); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--card); color: var(--text); box-shadow: 0 3px 0 var(--card-edge);
  font: inherit; font-weight: 500; font-size: 15px; text-decoration: none;
}
.chip:hover { background: var(--empty-cell-edge); }
.chip:disabled { opacity: .45; cursor: default; background: var(--card); }
:is(.button, .chip, .slot):focus-visible { outline: 3px solid var(--text); outline-offset: 3px; }

.page-hero { padding: 24px 0 64px; }
.page-hero h1 { font-size: clamp(38px, 6.5vw, 64px); margin-top: 8px; }
.lede { color: var(--text-secondary); font-size: 19px; margin-top: 16px; max-width: 36em; }
.page-hero .button, .page-hero .cta { margin-top: 28px; }
.page-hero .cta { align-items: center; }
.split { display: grid; gap: 40px; align-items: center; }
@media (min-width: 880px) { .split { grid-template-columns: 1.2fr .8fr; } }
.board-well { background: var(--well); border-radius: 16px; padding: 14px; margin: 0; display: grid; place-items: center; }
.board-well svg { width: 100%; height: 100%; }
.board-well.big { aspect-ratio: 1.15; max-width: 380px; width: 100%; margin: 0 auto; border-radius: var(--radius); }

/* Readable line length, but on the same left edge as the other sections. */
.prose > * { max-width: 760px; }
.prose h2 { font-size: clamp(28px, 4vw, 38px); }
.prose h2 + p, .prose h2 + ul, .prose h2 + .faq { margin-top: 16px; }
.prose p { color: var(--text-secondary); margin-top: 12px; }
.prose * + h2 { margin-top: 48px; }
.center { text-align: center; }
.center > * { margin-left: auto; margin-right: auto; }
.center .button { margin-top: 12px; }
.muted { color: var(--text-secondary); }
.fine { color: var(--muted); font-size: 14px; margin-top: 16px; }

.hex-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; color: var(--text-secondary); }
.hex-list li { display: flex; gap: 12px; align-items: baseline; }
.hex-list li::before { content: ""; flex: none; width: 10px; height: 11px; background: var(--mint); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); transform: translateY(1px); }
.hex-list strong { color: var(--text); font-weight: 500; }

.example { margin-top: 24px; }
.example h3 { font-size: 20px; color: var(--yellow); }
.example p { font-variant-numeric: tabular-nums; }

.two-col { display: grid; gap: 20px; }
@media (min-width: 800px) { .two-col { grid-template-columns: 1fr 1fr; } }
.two-col h2 { font-size: 26px; }

/* Comparison tables scroll sideways on phones rather than squashing. */
.table-scroll { overflow-x: auto; border-radius: var(--radius); box-shadow: 0 5px 0 var(--card-edge); }
.table-scroll:focus-visible { outline: 3px solid var(--text); outline-offset: 4px; }
.compare { width: 100%; min-width: 520px; border-collapse: collapse; background: var(--card); font-size: 16px; }
.compare th, .compare td { padding: 14px 18px; text-align: left; vertical-align: top; }
.compare thead th { background: var(--deep); color: var(--yellow); font-weight: 500; }
.compare tbody th { font-weight: 500; color: var(--text); }
.compare td { color: var(--text-secondary); }
.compare tbody tr + tr { border-top: 2px solid var(--card-edge); }
@media (max-width: 600px) {
  .compare { min-width: 0; font-size: 15px; }
  .compare th, .compare td { padding: 10px 12px; }
}

.faq { display: grid; gap: 12px; }
.faq details { background: var(--card); border-radius: 16px; box-shadow: 0 4px 0 var(--card-edge); }
.faq summary {
  cursor: pointer; list-style: none; padding: 16px 48px 16px 20px; position: relative;
  font-weight: 500; font-size: 18px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 22px; top: 22px; width: 8px; height: 8px; border: solid var(--yellow); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.faq details[open] summary::after { transform: translateY(4px) rotate(-135deg); }
.faq summary:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; border-radius: 16px; }
.faq details p { margin: 0; padding: 0 20px 18px; }

/* ---------- Tips ---------- */
.tips { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; counter-reset: tip; }
.tip { display: grid; gap: 20px; align-items: center; counter-increment: tip; }
.tip h2 { font-size: 24px; display: flex; align-items: center; gap: 10px; }
.tip h2::before {
  content: counter(tip); flex: none; display: grid; place-items: center;
  width: 34px; height: 38px; font-size: 16px;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: var(--yellow); color: var(--yellow-text);
}
.tip p { color: var(--text-secondary); margin-top: 10px; }
.tip .board-well { aspect-ratio: 1.15; }
@media (min-width: 720px) { .tip:has(.board-well) { grid-template-columns: 240px 1fr; } }

/* ---------- Press ---------- */
.facts { margin: 16px 0 0; display: grid; gap: 10px; }
.facts div { display: grid; grid-template-columns: 9.5em 1fr; gap: 12px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.two-col h3 { font-size: 17px; color: var(--muted); margin-top: 20px; }
blockquote { margin: 8px 0 0; padding: 12px 16px; border-radius: 12px; background: var(--well); color: var(--text); }
.assets { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.asset { margin: 0; display: flex; flex-direction: column; gap: 14px; }
.asset img { height: auto; }
.asset.card > img { width: 100%; aspect-ratio: 1.3; object-fit: contain; background: var(--well); border-radius: 12px; padding: 12px; }
.asset .asset-icon { padding: 28px; }
.asset figcaption { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: auto; }
.asset figcaption strong { font-weight: 500; font-size: 18px; flex-basis: 100%; }
.asset figcaption span { color: var(--text-secondary); font-size: 15px; flex: 1; }
.assets-sub { font-size: 24px; margin: 48px 0 20px; }
.assets-sub span { color: var(--muted); font-size: 16px; margin-left: 8px; }
.shots-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.shots-grid .device { max-width: 220px; }

/* ---------- Play ---------- */
.play { padding: 8px 0 64px; }
.play-head { margin-bottom: 24px; }
.play-head h1 { font-size: clamp(32px, 5.5vw, 52px); }
/* The whole game (score, board, tray) should fit on screen without scrolling;
   it's about 1.25 times as tall as it is wide. */
.game { max-width: min(560px, calc((100svh - 100px) / 1.25)); margin: 0 auto; }
@media (min-width: 1000px) {
  .play > .wrap { display: grid; grid-template-columns: 1fr auto; gap: 48px; align-items: start; }
  .play .game { width: min(560px, calc((100svh - 100px) / 1.25)); }
}
.hud { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 22px; margin-bottom: 12px; }
.stat { display: grid; }
.stat-label { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.stat strong { font-weight: 500; font-size: 28px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.hud-actions { margin-left: auto; display: flex; gap: 8px; }
.combo-pill { font-size: 16px; }
.combo-pill[hidden] { display: none; }
.board-wrap { position: relative; background: var(--outside); border-radius: 28px; padding: 12px; }
.board { width: 100%; height: auto; touch-action: none; cursor: pointer; }
.board:focus-visible { outline: 3px solid var(--yellow); outline-offset: 4px; border-radius: 16px; }
.tray-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 14px; }
.tray { flex: 1 1 300px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.slot {
  aspect-ratio: 1; padding: 10%; border: 0; border-radius: 18px; cursor: grab;
  background: var(--well); touch-action: none; transition: transform .1s ease-out;
}
.slot svg { width: 100%; height: 100%; pointer-events: none; }
.slot[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--yellow); transform: translateY(-3px); }
/* Doesn't fit anywhere right now. */
.slot.stuck svg { opacity: .35; filter: grayscale(.6); }
.slot.lifted svg { opacity: .2; }
.slot:disabled { cursor: default; }
.next { display: flex; align-items: center; gap: 8px; }
.next > div { display: flex; gap: 4px; }
.next svg { width: 34px; height: 34px; opacity: .8; }
.ghost { position: fixed; left: 0; top: 0; pointer-events: none; z-index: 50; opacity: .9; filter: drop-shadow(0 10px 14px rgba(10, 4, 40, .5)); }
.pop { animation: pop .45s ease-out forwards; }
@keyframes pop { to { transform: scale(1.5); opacity: 0; } }
.float { fill: var(--yellow); font-family: var(--font); font-weight: 500; font-size: 22px; paint-order: stroke; stroke: var(--outside); stroke-width: 4px; animation: float .9s ease-out forwards; }
@keyframes float { to { transform: translateY(-36px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .pop, .float { animation-duration: .01s; } }
.over { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(36, 23, 96, .85); border-radius: 28px; backdrop-filter: blur(3px); }
.over[hidden] { display: none; }
.over-card { text-align: center; max-width: 340px; display: grid; justify-items: center; gap: 10px; }
.over-card h2 { font-size: 32px; }
.over-card p { color: var(--text-secondary); }
.over-score strong { font-size: 52px; font-weight: 500; color: var(--text); line-height: 1; }
.over-stats { display: flex; gap: 28px; margin: 0; }
.over-stats div { display: grid; }
.over-stats dt { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.over-stats dd { margin: 0; font-size: 22px; font-weight: 500; }
.over-actions { display: flex; gap: 10px; align-items: center; margin: 6px 0; }
.over-pitch { font-size: 15px; }
.over .badge img { height: 44px; }
.noscript { padding: 20px; text-align: center; color: var(--text-secondary); }
.rules { margin: 0; padding-left: 1.4em; display: grid; gap: 10px; color: var(--text-secondary); max-width: 44em; font-size: 18px; }
.rules li::marker { color: var(--yellow); font-weight: 500; }
