:root {
  color-scheme: dark;
  --bg: #070b1a;
  --panel: #0f1630;
  --line: #243061;
  --text: #f1f5ff;
  --muted: #9fb0d9;
  --ice: #8fe3ff;
  --purple: #8b5cf6;
  --red: #c8102e;
  --pad: 4.2rem;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--text);
  font: 1rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(60rem 30rem at 50% -10%, rgba(139,92,246,.28), transparent 70%),
    radial-gradient(40rem 24rem at 100% 100%, rgba(143,227,255,.14), transparent 70%),
    radial-gradient(34rem 20rem at 0% 100%, rgba(200,16,46,.22), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
#snow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.stripe { position: relative; z-index: 1; height: 6px; background: linear-gradient(90deg, var(--red) 0 33.3%, #fff 33.3% 66.6%, #2a4cc9 66.6%); }
.top, main { position: relative; z-index: 1; }
.top { display: flex; justify-content: space-between; align-items: center; max-width: 60rem; margin: 0 auto; padding: .6rem 1.25rem; }
main { max-width: 60rem; margin: 0 auto; padding: 0 1.25rem 4rem; }
a { color: var(--ice); text-underline-offset: .15em; }
a:hover { color: #fff; }
:focus-visible { outline: 3px solid #fff; outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--purple); color: #fff; padding: .5rem 1rem; z-index: 5; }
.skip:focus { left: 0; }
.back { text-decoration: none; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; font-size: .85rem; }

.chip {
  min-height: 44px; padding: .5rem 1rem; border-radius: 999px; cursor: pointer;
  border: 2px solid var(--line); background: var(--panel); color: var(--text); font: 600 .9rem system-ui, sans-serif;
  transition: background .3s ease, border-color .3s ease;
}
.chip[aria-pressed="true"] { border-color: var(--ice); background: #14305a; }

.hero { text-align: center; padding: 1.5rem 0 1rem; }
.penguin { width: min(52vw, 13rem); height: auto; filter: drop-shadow(0 10px 30px rgba(139,92,246,.45)); }
.penguin .head, .penguin .horn { transform-box: fill-box; transform-origin: 50% 90%; transition: transform .5s ease; }
.penguin.sing .head { transform: rotate(-3deg); }
.penguin.sing .horn { transform: rotate(2deg); }
.wordmark {
  margin: .5rem 0 0; line-height: .95; text-transform: uppercase; font-style: italic; font-weight: 900;
  font-size: clamp(2.6rem, 12vw, 5rem); text-shadow: 0 0 28px rgba(143,227,255,.5);
}
.wordmark span { color: var(--ice); }
.wordmark small { display: block; font-size: .38em; letter-spacing: .5em; color: var(--purple); text-shadow: none; margin-top: .3em; padding-left: .5em; }
.lede { max-width: 34rem; margin: 1rem auto .5rem; color: var(--muted); font-size: 1.1rem; }
.hint { max-width: 36rem; margin: .5rem auto 0; color: var(--muted); font-size: .9rem; }
kbd { background: var(--panel); border: 1px solid var(--line); border-radius: 5px; padding: 0 .35em; font: inherit; font-size: .85em; }

/* The field: an ice rink painted like a gridiron */
.field {
  margin: 1.25rem 0; padding: .75rem; border-radius: 18px; outline-offset: 4px;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.07) 0 2px, transparent 2px 12.5%),
    linear-gradient(180deg, #123a63, #0c2a4d);
  border: 2px solid #3b66a8; box-shadow: inset 0 0 40px rgba(143,227,255,.15), 0 12px 40px rgba(0,0,0,.4);
}
.row { display: grid; grid-template-columns: repeat(8, 1fr); gap: .5rem; }
.row + .row { margin-top: .5rem; }
.pad {
  position: relative; min-height: var(--pad); height: clamp(5rem, 16vw, 8.5rem);
  border: 2px solid rgba(255,255,255,.55); border-radius: 12px; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none;
  color: #0a1a33; font: 800 clamp(.95rem, 3.4vw, 1.35rem) system-ui, sans-serif; letter-spacing: .02em;
  background: linear-gradient(180deg, #f2fbff, #bfe9fb 60%, #8fd0ee);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: .1rem; padding-bottom: .5rem;
  transition: background .25s ease, box-shadow .25s ease, transform .15s ease, color .25s ease;
}
.pad small { font-weight: 700; opacity: .65; font-size: .7em; }
.pad b { font-size: .7em; opacity: .55; font-weight: 700; }
.pad.root { border-color: #fff; box-shadow: 0 0 0 2px var(--red); }
.pad.on, .pad:active { background: linear-gradient(180deg, #b79cff, var(--purple)); color: #fff; box-shadow: 0 0 24px rgba(139,92,246,.8); transform: translateY(2px); }

.plays { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.btn {
  min-height: 56px; border-radius: 12px; border: 2px solid transparent; cursor: pointer; padding: .6rem 1rem;
  font: 900 1.05rem system-ui, sans-serif; text-transform: uppercase; font-style: italic; letter-spacing: .03em;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1;
  transition: filter .2s ease, transform .15s ease;
}
.btn small { font-size: .65em; font-style: normal; font-weight: 600; letter-spacing: .08em; opacity: .8; }
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(2px); }
.red { background: var(--red); color: #fff; }
.white { background: #f4f8ff; color: #0a1a33; }
.purple { background: var(--purple); color: #fff; }
.ghost { background: transparent; color: var(--text); border-color: var(--line); }

.board { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 1rem 1.25rem 1.25rem; }
h2 { font-size: 1.2rem; margin: 0 0 .75rem; text-transform: uppercase; letter-spacing: .06em; }
h2::after { content: ""; display: block; width: 3rem; height: 3px; margin-top: .4rem; background: linear-gradient(90deg, var(--red), var(--purple)); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .9rem 1.25rem; }
label { display: flex; flex-direction: column; gap: .25rem; font-weight: 600; font-size: .9rem; color: var(--muted); }
output { float: right; color: var(--ice); font-variant-numeric: tabular-nums; }
select { min-height: 44px; border-radius: 8px; border: 1px solid var(--line); background: #0a1028; color: var(--text); font: inherit; padding: 0 .5rem; }
input[type=range] { width: 100%; min-height: 44px; accent-color: var(--purple); }
.toggles { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.about { margin-top: 2rem; color: var(--muted); max-width: 40rem; }
.about strong, .about em { color: var(--text); }
.made { font-size: .9rem; }

/* VR-lite: bigger targets, no animation, no background canvas */
html[data-vr] { --pad: 6.5rem; font-size: 118%; }
html[data-vr] .pad { height: 9rem; }
html[data-vr] #snow { display: none; }
html[data-vr] * { transition: none !important; }

@media (max-width: 34rem) {
  .row { gap: .3rem; }
  .field { padding: .5rem; }
  .pad small { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  #snow { display: none; }
}
