/* TodayGames — the pages around the games: the home page (a card per game) and each game's page
   (a slim bar, then the game filling the rest of the screen). Nunito is self-hosted (the same
   file the Dirt Flip game uses). */
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 700 900; font-display: swap; src: url(/fonts/nunito-v32-latin.woff2) format('woff2'); }

:root { --bg: #0e1322; --bar: #0a0f1c; --panel: #182038; --line: rgba(255, 255, 255, .09); --text: #f4f6fb; --muted: #aab2c8; --gold: #ffc93c; }
* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 700 16px/1.45 Nunito, system-ui, -apple-system, 'Segoe UI', sans-serif; }
a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* the bar at the top of every page */
.top { display: flex; align-items: center; gap: 14px; height: 56px; padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); background: var(--bar); border-bottom: 1px solid var(--line); }
.logo { display: inline-flex; align-items: center; gap: 9px; font-size: 22px; font-weight: 900; letter-spacing: .2px; color: #fff; text-decoration: none; white-space: nowrap; }
.logo svg { width: 28px; height: 28px; flex: none; }
.logo b { color: var(--gold); font-weight: inherit; }
.logo:focus-visible, .all:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 8px; }

/* the home page */
.home { max-width: 880px; margin: 0 auto; padding: 28px max(16px, env(safe-area-inset-right)) 24px max(16px, env(safe-area-inset-left)); }
.home h1 { margin: 0 0 6px; font-size: 28px; font-weight: 900; }
.lead { margin: 0 0 24px; color: var(--muted); font-size: 17px; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.card { display: block; height: 100%; border-radius: 18px; overflow: hidden; background: var(--panel); text-decoration: none; box-shadow: 0 12px 30px rgba(0, 0, 0, .35), inset 0 0 0 1px var(--line); transition: transform .15s ease, box-shadow .15s ease; }
.card:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(255, 201, 60, .45); }
.card:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.card img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: #1d2742; }
.card .t { display: block; padding: 13px 16px 2px; font-size: 21px; font-weight: 900; color: #fff; }
.card .d { display: block; padding: 0 16px 17px; color: var(--muted); font-size: 15px; }
.foot { padding: 28px 16px 36px; text-align: center; color: var(--muted); font-size: 13px; }

/* a game's page: the bar, then the game in the rest of the screen, nothing to scroll */
body.play { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; overscroll-behavior: none; }
body.play .top { flex: none; height: 48px; }
body.play .logo { font-size: 19px; }
body.play .logo svg { width: 24px; height: 24px; }
.game-name { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; font-weight: 800; color: var(--muted); }
.game-name::before { content: ''; display: inline-block; width: 1px; height: 18px; margin-right: 14px; vertical-align: -3px; background: var(--line); }
.all { margin-left: auto; flex: none; padding: 7px 13px; border-radius: 999px; background: rgba(255, 255, 255, .07); color: var(--muted); font-size: 14px; text-decoration: none; }
.all:hover { color: #fff; background: rgba(255, 255, 255, .13); }
.stage { position: relative; flex: 1; min-height: 0; background: #000; }
.stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
/* a phone held sideways: every pixel of height goes to the game */
@media (orientation: landscape) and (max-height: 500px) {
  body.play .top { height: 34px; }
  body.play .logo { font-size: 16px; }
  body.play .logo svg { width: 20px; height: 20px; }
  .game-name { font-size: 14px; }
  .all { padding: 3px 11px; font-size: 13px; }
}
@media (max-width: 360px) { .game-name { display: none; } }
@media (prefers-reduced-motion: reduce) { .card { transition: none; } .card:hover { transform: none; } }

/* not found */
.missing { max-width: 560px; margin: 0 auto; padding: 72px 16px; text-align: center; }
.missing h1 { margin: 0 0 8px; font-size: 30px; font-weight: 900; }
.missing p { margin: 0 0 22px; color: var(--muted); }
.btn { display: inline-block; padding: 12px 24px; border-radius: 999px; background: var(--gold); color: #1b1300; font-weight: 900; text-decoration: none; }
