/* Home page styles. Lives here, not inline, so it gets site/.htaccess no-cache (platform 1.6.1). */
:root {
  color-scheme: dark;
  --bg: #0b0d1a; --panel: #151a30; --line: #2a3260; --text: #f3f5ff; --muted: #8d97c4; --accent: #ffd23f; --danger: #ff5d6c;
}
@media (prefers-color-scheme: light) {
  :root { color-scheme: light; --bg: #f4f5fb; --panel: #ffffff; --line: #d7dbef; --text: #12152b; --muted: #5b6390; --accent: #b98a00; --danger: #c62f3e; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 "Trebuchet MS", "Avenir Next", system-ui, sans-serif; }
/* minmax(0, 1fr): never let one wide item (e.g. a long game name in the picker) widen the page past the
   screen. Without it, iPhone Safari zooms out to fit and the page hangs off the right. */
main { max-width: 880px; margin: 0 auto; padding: max(24px, env(safe-area-inset-top)) 16px 48px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
header h1 { margin: 0; font-size: clamp(30px, 8vw, 44px); letter-spacing: -0.02em; }
header h1 span { color: var(--accent); }
header p { margin: 4px 0 0; color: var(--muted); }
header .lead { margin-top: 6px; color: var(--text); font-size: 15px; font-weight: 700; }
header .sub { margin-top: 1px; font-size: 13px; line-height: 1.4; }
/* Rotating pitch (home.js): fades between lines. home.js sets min-height to the tallest line at the current
   width, so the cards below never jump; 6.6em is only the starting guess. */
#pitch { min-height: 4.2em; transition: opacity .8s ease; }
#pitch.fading { opacity: 0; }
@media (prefers-reduced-motion: reduce) { #pitch { transition: none; } }
h2 { margin: 0 0 10px; font-size: 14px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
#games { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.game { position: relative; display: grid; grid-template-rows: auto 1fr; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; color: inherit; text-decoration: none; transition: transform .15s, border-color .15s; }
.game:hover, .game:focus-visible { border-color: var(--accent); outline: none; transform: translateY(-2px); }
.game .art { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; background: var(--line); }
.game .body { display: grid; grid-template-rows: auto 1fr auto; gap: 8px; padding: 14px 16px 16px; }
.game h3 { margin: 0; font-size: 20px; }
.game .ver { margin-left: 8px; font-size: 12px; font-weight: 400; letter-spacing: 0.02em; color: var(--muted); opacity: 0.6; vertical-align: 2px; }
/* "Update!" seal: a tilted 20-point gold star on the picture's corner, for games uploaded in the last 12
   hours. Layers, outside in: brown edge, white rim, gold, a faint star line inset along the points, gold.
   The word is wider than the star on purpose; its white outline keeps it readable over the picture. */
.sticker { --star: polygon(50% 0%, 56.4% 9.5%, 65.5% 2.4%, 68.6% 13.5%, 79.4% 9.5%, 79% 21%, 90.5% 20.6%, 86.5% 31.4%, 97.6% 34.5%, 90.5% 43.6%, 100% 50%, 90.5% 56.4%, 97.6% 65.5%, 86.5% 68.6%, 90.5% 79.4%, 79% 79%, 79.4% 90.5%, 68.6% 86.5%, 65.5% 97.6%, 56.4% 90.5%, 50% 100%, 43.6% 90.5%, 34.5% 97.6%, 31.4% 86.5%, 20.6% 90.5%, 21% 79%, 9.5% 79.4%, 13.5% 68.6%, 2.4% 65.5%, 9.5% 56.4%, 0% 50%, 9.5% 43.6%, 2.4% 34.5%, 13.5% 31.4%, 9.5% 20.6%, 21% 21%, 20.6% 9.5%, 31.4% 13.5%, 34.5% 2.4%, 43.6% 9.5%);
  --gold: radial-gradient(circle at 40% 35%, #ffe680, #ffc21a 72%);
  position: absolute; top: 12px; right: 22px; width: 48px; height: 48px; transform: rotate(12deg);
  pointer-events: none; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .45)); }
.sticker::before, .sticker::after, .sticker .seal, .sticker .seal::after { content: ""; position: absolute; clip-path: var(--star); }
.sticker::before { inset: 0; background: #8a5a00; }
.sticker::after { inset: 1.5px; background: #fff; }
.sticker .seal { inset: 4px; z-index: 1; background: var(--gold); }
.sticker .seal::before { content: ""; position: absolute; inset: 3.5px; clip-path: var(--star); background: #f0b416; }
.sticker .seal::after { inset: 4.7px; background: var(--gold); }
.sticker b { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2; white-space: nowrap;
  font: 900 14px/1 "Trebuchet MS", system-ui, sans-serif; text-transform: uppercase; color: #5a2d00;
  text-shadow: 1.5px 0 #fff, -1.5px 0 #fff, 0 1.5px #fff, 0 -1.5px #fff, 1px 1px #fff, -1px 1px #fff, 1px -1px #fff, -1px -1px #fff; }
.game p { margin: 0; color: var(--muted); font-size: 14px; }
/* Phone / computer icons under the tagline (registry "devices", platform 1.8.0). */
.game .devices { display: flex; gap: 12px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.game .device { display: inline-flex; align-items: center; gap: 4px; }
.game .device svg { width: 16px; height: 16px; fill: currentColor; }
.game .meta { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .game { transition: none; } .game:hover { transform: none; } }
.game .play { color: var(--accent); font-weight: 700; font-size: 15px; }
/* The line between released games and betas: extra space, a hairline across the grid fading out to the sides,
   and a small centered label with a gold-outlined BETA tag. Quiet, but you can't miss where the betas start. */
.beta-divider { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; margin: 18px 0 2px;
  font-size: 13px; font-weight: 700; letter-spacing: 0.06em; color: var(--muted); }
.beta-divider::before, .beta-divider::after { content: ""; flex: 1; height: 1px; }
.beta-divider::before { background: linear-gradient(to right, transparent, var(--line) 30%); }
.beta-divider::after { background: linear-gradient(to left, transparent, var(--line) 30%); }
.beta-divider b { margin-right: 8px; padding: 2px 8px; border: 1px solid var(--accent); border-radius: 99px;
  color: var(--accent); font-size: 11px; letter-spacing: 0.12em; }
.hidden-tag { font-size: 11px; border: 1px solid var(--line); border-radius: 99px; padding: 1px 8px; margin-left: 6px; vertical-align: middle; color: var(--muted); }
/* "Got a code?" join box: its own panel. Row 1: the game picker, full width. Row 2: code + Join. */
form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
input, select, button { font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; min-height: 48px; padding: 0 14px; }
input:focus-visible, select:focus-visible { outline: none; border-color: var(--accent); }
input { min-width: 0; text-transform: uppercase; letter-spacing: 0.12em; }
input::placeholder { text-transform: none; letter-spacing: normal; }
/* Our own chevron instead of the browser's, so it looks the same on iPhone, Android and desktop. */
select { grid-column: 1 / -1; min-width: 0; max-width: 100%; text-overflow: ellipsis; font-weight: 700; cursor: pointer;
  -webkit-appearance: none; appearance: none; padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
button { background: var(--accent); color: #12152b; border-color: var(--accent); font-weight: 700; cursor: pointer; padding: 0 22px; }
/* Wider screens: the same two-row box as on a phone, at phone width, centered with its heading and error. */
form { width: 100%; max-width: 420px; margin: 0 auto; }
section:has(> #join) h2, #joinErr { text-align: center; }
#joinErr { color: var(--danger); font-size: 14px; min-height: 1.4em; margin: 6px 0 0; }
#status { color: var(--muted); }
/* Reload button at the very bottom (home.js). Small and quiet; it brightens on hover or focus. */
.reload { justify-self: center; display: grid; place-items: center; width: 40px; height: 40px; min-height: 0; padding: 0;
  border-radius: 50%; background: transparent; border: 1px solid var(--line); color: var(--muted); opacity: 0.7; }
.reload svg { width: 20px; height: 20px; fill: currentColor; }
.reload:hover, .reload:focus-visible { opacity: 1; color: var(--accent); border-color: var(--accent); outline: none; }
/* Beta cards (platform 1.10.5): about a third of a full card. Their own grid under the divider, twice as many
   across (2 on a phone, up to 6 on a computer); just the picture, name, players and device icons. */
.betas { grid-column: 1 / -1; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(125px, 1fr)); }
.game.small { border-radius: 10px; }
.game.small .body { gap: 4px; padding: 8px 10px 10px; }
.game.small h3 { font-size: 14px; line-height: 1.25; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.game.small .ver { margin-left: 4px; font-size: 10px; vertical-align: 1px; }
.game.small .meta { font-size: 11px; }
.game.small .devices { margin-top: 0; gap: 4px; }
.game.small .device span { display: none; }
.game.small .device svg { width: 13px; height: 13px; }
.game.small .sticker { top: 4px; right: 8px; transform: rotate(12deg) scale(.6); transform-origin: top right; }
/* Bigger card for a beta card (home.js peekSetup): pops up on hover on a computer; on a phone, the first tap
   opens it mid-screen over a dimmed page and tapping it plays. */
.peek { position: fixed; z-index: 10; width: min(380px, calc(100vw - 20px)); overflow: hidden; pointer-events: none;
  background: var(--panel); border: 1px solid var(--accent); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, .5);
  opacity: 0; transform: translateY(4px); transition: opacity .15s, transform .15s; }
.peek.on { opacity: 1; transform: none; }
.peek.tap.on { pointer-events: auto; }
.peek { color: inherit; text-decoration: none; }
.peek .play { color: var(--accent); font-weight: 700; font-size: 15px; justify-self: end; margin-top: 4px; }
.peek:not(.tap) .play { display: none; }
.peek-back { position: fixed; inset: 0; z-index: 9; background: rgba(0, 0, 0, .55); opacity: 0; pointer-events: none; transition: opacity .15s; }
.peek-back.on { opacity: 1; pointer-events: auto; }
.peek img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; background: var(--line); }
.peek div { display: grid; gap: 2px; padding: 8px 12px 10px; }
.peek b { font-size: 15px; }
.peek span:not(.play) { font-size: 13px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .peek, .peek-back { transition: none; transform: none; } }
/* How it works (platform 1.14.0): 3 steps on the home page (home.js) and the full /how/ page. */
.how { padding: 16px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
/* 1.14.14: 3 matching steps. Phone: compact rows (badge | title over one small line). Wider: 3 columns. */
.how-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.how-step-item { display: grid; grid-template-columns: 30px minmax(0, 1fr); column-gap: 10px; align-items: start; }
.how-num { grid-row: span 2; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #12152b; font-weight: 800; font-size: 15px; }
.how-step-item b { font-size: 15px; line-height: 1.3; }
.how-line { color: var(--muted); font-size: 13px; line-height: 1.35; }
@media (min-width: 640px) { .how-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
.how-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin: 14px 0 0; padding-top: 12px;
  border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.how-foot a { color: var(--accent); font-weight: 700; text-decoration: none; }
.how-foot a:hover, .how-foot a:focus-visible { text-decoration: underline; }
.how-page { max-width: 640px; }
.home-link { color: inherit; text-decoration: none; }
.how-back { justify-self: center; display: inline-grid; place-items: center; min-height: 48px; padding: 0 22px; border-radius: 10px;
  background: var(--accent); color: #12152b; font-weight: 700; text-decoration: none; }
/* "See how it works" (home.js, platform 1.14.14): a round play icon beside the rotating headline, on the
   same lines (the header becomes two columns: headline, icon), so it adds no line. */
header { display: grid; grid-template-columns: minmax(0, 740px) auto; justify-content: start; column-gap: 12px; align-items: center; }
header h1 { grid-column: 1; grid-row: 1; }
header #pitch { grid-column: 1; grid-row: 2; }
header .how-link { grid-column: 2; grid-row: 2; }
.how-link { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--accent);
  text-decoration: none; transition: transform .15s, color .15s; }
.how-link svg { width: 34px; height: 34px; }
.how-link:hover, .how-link:focus-visible { transform: scale(1.1); outline: none; }
.how-link:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
@media (prefers-reduced-motion: reduce) { .how-link { transition: none; } .how-link:hover { transform: none; } }
