:root {
  --bg: #1a0e22;
  --bg-2: #24132f;
  --bg-3: #321b42;
  --line: #4a2a5e;
  --text: #fff1f5;
  --soft: #ecd9ea;
  --muted: #c4a8c8;
  --rose: #ff4f8b;
  --rose-deep: #5a1838;
  --mint: #5ee6c1;
  --pixel: "Pixelify Sans", ui-monospace, monospace;
  --sans: "Outfit", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body { font: 400 15px/1.45 var(--sans); -webkit-font-smoothing: antialiased; overflow: hidden; }

/* One screen: masthead, then the games. If the list ever outgrows the screen, the list scrolls, not the page. */
.home-app { height: 100vh; height: 100dvh; max-width: 980px; margin: 0 auto; display: flex; flex-direction: column; justify-content: center; padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); }

.masthead { flex: none; text-align: center; padding: 0 0 clamp(16px, 4vh, 40px); }
.masthead h1 { margin: 0; font: 700 clamp(34px, 7vw, 64px)/1 var(--pixel); color: var(--rose); text-shadow: 3px 3px 0 var(--rose-deep); letter-spacing: .01em; }
.masthead p { margin: 10px 0 0; font-size: clamp(15px, 2vw, 18px); color: var(--soft); }

.games { flex: 0 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-wrap: wrap; align-content: flex-start; justify-content: center; gap: clamp(14px, 3vw, 28px); padding: 4px; }

/* A game card: the game's own board, framed the way the game frames it, then its name and what you do. */
.game { width: min(100%, 300px); display: flex; flex-direction: column; gap: 12px; padding: 12px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); color: inherit; text-decoration: none; }
.shot { display: block; width: 100%; height: auto; aspect-ratio: 1; border-radius: 8px; border: 2px solid var(--frame, var(--line)); image-rendering: pixelated; background: #140a10; }
.info { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 0 2px 2px; }
.name { font: 700 24px/1.1 var(--pixel); color: var(--text); }
.hook { color: var(--muted); font-size: 14.5px; line-height: 1.4; }
.foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.play { display: inline-block; padding: 8px 22px; border-radius: 8px; background: var(--rose); color: #1a0e22; font-weight: 600; font-size: 15px; }
.best { font: 500 14px/1.2 var(--pixel); color: var(--mint); white-space: nowrap; }
.best[hidden] { display: none; }

.game:hover { background: var(--bg-3); }
.game:hover .play { background: #ff76a5; }
.game:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }

/* Short desktop windows: keep both boards on screen by sizing them from the height. */
@media (min-width: 641px) {
  .game { width: min(300px, calc((100dvh - 330px) + 24px)); min-width: 220px; }
}

/* Phones: each game is a row, board on the left, so several fit on one screen. */
@media (max-width: 640px) {
  .games { flex-direction: column; flex-wrap: nowrap; align-items: stretch; justify-content: flex-start; gap: 12px; }
  .game { width: 100%; flex-direction: row; align-items: center; gap: 14px; padding: 10px; }
  .shot { width: 112px; flex: none; }
  .name { font-size: 21px; }
  .hook { font-size: 13.5px; }
  .foot { margin-top: 6px; }
  .play { padding: 6px 16px; font-size: 14px; }
}

/* Studio splash. One loud moment: the studio name in pixel type over a pixel loading bar. */
.splash { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; background: var(--bg); transition: opacity .45s ease; cursor: pointer; }
.splash.done { opacity: 0; pointer-events: none; }
.splash-inner { display: flex; flex-direction: column; align-items: center; padding: 0 16px; }
.studio { margin: 0; font: 700 clamp(40px, 11vw, 104px)/1 var(--pixel); color: var(--mint); text-shadow: 4px 4px 0 #1f5a4c; white-space: nowrap; animation: studio-in .5s steps(5) both; }
.presents { margin: 14px 0 26px; font-size: clamp(14px, 2vw, 17px); color: var(--muted); letter-spacing: .02em; animation: fade-in .4s .35s both; }
.loadbar { width: min(260px, 70vw); height: 14px; padding: 2px; border: 2px solid var(--line); border-radius: 2px; }
.loadbar span { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--rose) 0 14px, transparent 14px 18px); animation: load 1.7s steps(13, end) .1s forwards; }
@keyframes load { to { width: 100%; } }
@keyframes studio-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes fade-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .studio, .presents { animation: none; }
  .loadbar span { animation-duration: .4s; }
  .splash { transition: none; }
}
