/* kit.css: the shell the four small games share, in glass. The header and the HUD float
   over the game's own scene as rounded glass bars; buttons, the reveal card, help, toasts
   and status pills are glass too. Each game's stylesheet sets the palette and the scene
   (--scene) and draws its board. Without backdrop-filter the glass is a translucent fill,
   which still reads. */
:root {
  --bg: #0d1017; --bg-2: #121722; --surface: #171d29; --surface-2: #1f2735; --line: rgba(255, 255, 255, .12);
  --text: #eef1f6; --muted: #b3bbc8; --accent: #ffc53d; --accent-ink: #1c1404; --gold: #ffc53d;
  --scene: var(--bg);
  /* glass */
  --glass: linear-gradient(180deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .05));
  --glass-solid: rgba(22, 26, 36, .62);
  --glass-edge: rgba(255, 255, 255, .17);
  --glass-rim: inset 0 1px 0 rgba(255, 255, 255, .26), inset 0 -1px 0 rgba(255, 255, 255, .04);
  --glass-drop: 0 12px 32px -10px rgba(0, 0, 0, .6), 0 2px 6px -2px rgba(0, 0, 0, .35);
  --blur: blur(22px) saturate(170%);
  --sans: Inter, system-ui, -apple-system, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  --disp: -apple-system, "SF Pro Display", Inter, system-ui, "Segoe UI", Roboto, sans-serif;
  --r: 18px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--bg); color: var(--text); font: 400 16px/1.5 var(--sans); -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--scene); background-color: var(--bg); }
a { color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* The material, for anything that floats. */
.glass, .bar, .hud, .icon-btn, .btn.ghost, .help, .card-in, .bitem, .status > span, .hint {
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, .28); color: var(--accent-ink); cursor: pointer; white-space: nowrap;
  background: linear-gradient(180deg, rgba(255, 255, 255, .34), rgba(255, 255, 255, 0) 55%), var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 6px 18px -8px var(--accent), 0 1px 2px rgba(0, 0, 0, .3);
  font: 650 15px/1 var(--sans); letter-spacing: -.005em; text-decoration: none;
  transition: transform .15s, filter .15s;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(.97); }
.btn.ghost { background: var(--glass), var(--glass-solid); color: var(--text); border-color: var(--glass-edge); box-shadow: var(--glass-rim), 0 4px 14px -8px rgba(0, 0, 0, .6); }
.btn.ghost:hover { background: linear-gradient(180deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, .08)), var(--glass-solid); filter: none; }
.icon-btn {
  width: 44px; height: 44px; flex: none; display: inline-grid; place-items: center; border-radius: 50%; padding: 0; cursor: pointer; color: var(--text);
  background: var(--glass), var(--glass-solid); border: 1px solid var(--glass-edge); box-shadow: var(--glass-rim), 0 4px 14px -8px rgba(0, 0, 0, .6);
  transition: transform .15s;
}
.icon-btn:hover { background: linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .08)), var(--glass-solid); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 21px; height: 21px; }
#soundBtn .cross { display: none; }
#soundBtn[aria-pressed="false"] .cross { display: inline; }
#soundBtn[aria-pressed="false"] .wave { display: none; }

/* A build's token: a glossy disc in its stack colour with its number. Games restyle it. */
.tok {
  --c: #888; flex: none; width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center;
  background: radial-gradient(circle at 34% 26%, rgba(255, 255, 255, .6), rgba(255, 255, 255, 0) 46%), var(--c);
  box-shadow: inset 0 -3px 6px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .45), 0 2px 6px -2px rgba(0, 0, 0, .5);
}
.tok b { width: 60%; height: 60%; border-radius: 50%; background: #fbfaf5; color: #111; display: grid; place-items: center; font: 750 12px/1 var(--sans); }
.tok.gold { --c: #e8a317; background: radial-gradient(circle at 34% 26%, #fff7cf, rgba(255, 247, 207, 0) 46%), linear-gradient(145deg, #ffd54f, #e09a00); }
.tok.gold b { background: transparent; color: #4a2c00; font-size: 17px; }

/* ---- Header: a floating glass bar ---- */
.bar {
  display: flex; align-items: center; gap: 10px; flex: none; position: relative; z-index: 5;
  margin: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left));
  padding: 6px 6px 6px 12px; border-radius: 28px;
  background: var(--glass), var(--glass-solid); border: 1px solid var(--glass-edge); box-shadow: var(--glass-rim), var(--glass-drop);
}
.brand { margin: 0; display: flex; align-items: center; gap: 10px; font: 700 18px/1 var(--disp); letter-spacing: -.015em; flex: 1; min-width: 0; white-space: nowrap; }
.brand-t { overflow: hidden; text-overflow: ellipsis; }
.app-icon { width: 30px; height: 30px; flex: none; display: block; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .35)); }
.bar-end { display: flex; gap: 6px; flex: none; }
#viewBtn { padding: 0 16px; gap: 0; }
@media (max-width: 440px) {
  .vb-more { display: none; }
  .brand { font-size: 15px; gap: 8px; }
  .app-icon { width: 26px; height: 26px; }
  #viewBtn { padding: 0 12px; font-size: 13.5px; }
  .bar { gap: 6px; padding-left: 10px; }
  .bar-end { gap: 4px; }
}
@media (max-width: 359px) { .brand-t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }

/* ---- Views: the list by default; html.play shows the game ---- */
main { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.game { display: none; }
html.play:not(.browsing) body { height: 100vh; height: 100dvh; overflow: hidden; }
html.play:not(.browsing) .browse { display: none; }
html.play:not(.browsing) .game { display: grid; }
html:not(.js) #viewBtn { display: none; }

/* ---- The list: glass cards over the scene ---- */
.browse { padding: 26px max(16px, env(safe-area-inset-right)) max(40px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.browse-in { max-width: 1120px; margin: 0 auto; }
.eyebrow { margin: 0 0 6px; font: 650 12px/1.2 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.browse h2 { margin: 0 0 10px; font: 750 clamp(28px, 4.6vw, 44px)/1.08 var(--disp); letter-spacing: -.025em; }
.lede { margin: 0 0 24px; color: var(--muted); max-width: 64ch; }
.reduced-note, .broken-note { display: none; margin: -8px 0 22px; color: var(--muted); }
html.reduced:not(.play) .reduced-note { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
html.broken .broken-note { display: block; }
.blist { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.bitem {
  padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; border-radius: 22px;
  background: var(--glass), var(--glass-solid); border: 1px solid var(--glass-edge); box-shadow: var(--glass-rim), var(--glass-drop);
}
.bhead { display: flex; gap: 12px; align-items: center; }
.bitem h3 { margin: 0; font: 700 18px/1.2 var(--disp); letter-spacing: -.01em; }
.tagline { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.bitem .shot { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border-radius: 14px; border: 1px solid var(--line); background: var(--bg-2); }
.blurb { margin: 0; }
.links { margin: auto 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.bitem.contact { margin-bottom: 18px; border-color: rgba(255, 210, 110, .45); background: linear-gradient(135deg, rgba(255, 197, 61, .14), transparent 60%), var(--glass), var(--glass-solid); }
.foot { color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); padding-top: 14px; }

/* ---- The game area: the stage, then a floating glass HUD ---- */
.game { flex: 1; min-height: 0; grid-template-rows: 1fr auto; position: relative; }
.stage { position: relative; min-height: 0; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.stage:focus { outline: none; }
.stage:focus-visible { outline: 2px solid rgba(255, 255, 255, .45); outline-offset: -4px; border-radius: 22px; }
.hud {
  display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; min-width: 0; position: relative; z-index: 2;
  margin: 0 max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  padding: 7px 8px 7px 8px; border-radius: 30px;
  background: var(--glass), var(--glass-solid); border: 1px solid var(--glass-edge); box-shadow: var(--glass-rim), var(--glass-drop);
}
.tray-wrap { flex: 1 1 160px; min-width: 0; display: flex; align-items: center; min-height: 44px; }
.tray-empty { margin: 0; color: var(--muted); font-size: 14px; padding: 0 6px; }
.tray { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.tray::-webkit-scrollbar { display: none; }
.tray button { width: 44px; height: 44px; border-radius: 50%; border: 0; padding: 5px; background: transparent; cursor: pointer; display: grid; place-items: center; flex: none; }
.tray button .tok { width: 32px; height: 32px; transition: transform .15s; }
.tray button:hover .tok { transform: scale(1.1); }
.tray li { animation: tray-in .4s cubic-bezier(.2, .9, .2, 1.2); }
@keyframes tray-in { from { transform: translateY(10px) scale(.5); opacity: 0; } }
/* Status pills on the stage, and the toast: small glass capsules. */
.status > span {
  background: var(--glass), rgba(10, 12, 18, .5); border: 1px solid var(--glass-edge); box-shadow: var(--glass-rim);
  padding: 7px 12px; border-radius: 999px; display: inline-block;
}
.toast {
  position: absolute; left: 50%; top: 12px; transform: translateX(-50%); margin: 0; max-width: min(92%, 520px); text-align: center; z-index: 3;
  pointer-events: none; font: 650 14px/1.35 var(--sans); padding: 9px 16px; border-radius: 999px; transition: opacity .3s;
  color: var(--accent-ink); border: 1px solid rgba(255, 255, 255, .35);
  background: linear-gradient(180deg, rgba(255, 255, 255, .35), rgba(255, 255, 255, 0) 60%), var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 10px 26px -8px rgba(0, 0, 0, .6);
}
.toast:empty { opacity: 0; }
/* A one-line hint at the foot of the stage. */
.hint {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); margin: 0; max-width: calc(100% - 24px); z-index: 2;
  font: 550 13.5px/1.35 var(--sans); color: var(--text); padding: 8px 14px; border-radius: 999px; pointer-events: none; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity .3s;
  background: var(--glass), rgba(10, 12, 18, .55); border: 1px solid var(--glass-edge); box-shadow: var(--glass-rim), 0 8px 22px -10px rgba(0, 0, 0, .6);
}
.hint:empty { opacity: 0; }

.help {
  position: absolute; z-index: 6; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(92vw, 460px);
  max-height: 90%; overflow: auto; padding: 20px 22px 22px; border-radius: 26px;
  background: var(--glass), rgba(20, 24, 33, .78); border: 1px solid var(--glass-edge); box-shadow: var(--glass-rim), 0 30px 80px -20px rgba(0, 0, 0, .8);
}
.help h2 { margin: 0 0 8px; font: 700 21px/1.2 var(--disp); letter-spacing: -.015em; }
.help ul { margin: 0 0 12px; padding-left: 18px; }
.help li, .help p { font-size: 14.5px; }
.help li + li { margin-top: 5px; }
html:not(.coarse) .k-touch, html.coarse .k-kbm { display: none; }

/* ---- Reveal card: a glass sheet ---- */
.card { padding: 0; border: 0; background: transparent; color: var(--text); width: min(500px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: visible; }
.card::backdrop { background: rgba(4, 6, 10, .42); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.card[open] { animation: card-in .38s cubic-bezier(.2, .9, .25, 1.15); }
@keyframes card-in { from { transform: translateY(26px) scale(.94); opacity: 0; } }
.card-in {
  position: relative; overflow: auto; max-height: calc(100dvh - 24px); border-radius: 30px;
  background: var(--glass), rgba(20, 24, 33, .8); border: 1px solid var(--glass-edge);
  box-shadow: var(--glass-rim), 0 40px 100px -24px rgba(0, 0, 0, .85);
}
.card-x { position: absolute; top: 18px; right: 18px; z-index: 2; }
.card .shot { display: block; width: calc(100% - 20px); margin: 10px 10px 0; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; background: var(--bg-2); border-radius: 21px; box-shadow: 0 1px 0 rgba(255, 255, 255, .08); }
.card-body { padding: 16px 22px 22px; display: flex; flex-direction: column; gap: 10px; }
.card .bhead { padding-right: 48px; }
.card .shot + .card-body .bhead { padding-right: 0; }
.card h2 { margin: 0; font: 750 25px/1.12 var(--disp); letter-spacing: -.02em; }
.card .eyebrow { margin: 0 0 3px; }
.card .icon { width: 42px; height: 42px; border-radius: 11px; margin-left: auto; flex: none; box-shadow: 0 2px 8px rgba(0, 0, 0, .4); }
.card .tagline { font-size: 15px; }
.card .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.card .actions.center { justify-content: center; }
.card .contact-hero { padding: 34px 22px 4px; display: grid; justify-items: center; text-align: center; gap: 6px; }
.card .contact-hero .tok { width: 66px; height: 66px; margin-bottom: 4px; }
.card .contact-hero .tok b { font-size: 30px; }

html.reduced *, html.reduced *::before, html.reduced *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
