:root {
  --ink: #111111;
  --paper: #FAFAF7;
  --paper-2: #F1ECE2;
  --edge: #D9D1C3;
  --clay: #D76A45;
  --muted: #6E675E;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; color: var(--ink);
  background: #EFE9DE url(assets/paper-bg.png) 0 0 / 512px repeat;
  font: 500 16px/1.3 ui-rounded, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif; }
#app { height: 100%; max-width: 520px; margin: 0 auto; }
.screen { height: 100%; display: flex; flex-direction: column;
  padding: max(14px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); }
.screen[hidden] { display: none; }
.center { align-items: center; justify-content: center; text-align: center; gap: 18px; }
.logo { width: 96px; height: 96px; border-radius: 24px; }

button { font: inherit; color: inherit; cursor: pointer; border: 0; touch-action: manipulation; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--clay); outline-offset: 3px; }
.primary, .twists button, .lvl, .icon, .ghost {
  background: var(--paper); border-radius: 18px;
  box-shadow: 0 5px 0 var(--edge), 0 10px 18px rgba(17, 17, 17, .10);
  transition: transform .08s, box-shadow .08s;
}
.primary:active, .twists button:active, .lvl:active, .icon:active, .ghost:active {
  transform: translateY(4px); box-shadow: 0 1px 0 var(--edge), 0 4px 8px rgba(17, 17, 17, .10);
}
button:disabled { opacity: .45; cursor: default; }
.primary { height: 56px; padding: 0 34px; font-size: 19px; font-weight: 800; }

.hero { text-align: center; padding-top: 6vh; }
h1 { font-size: 64px; letter-spacing: -2px; margin: 0; font-weight: 900; }
h2 { font-size: 30px; margin: 0; }
.sub { color: var(--muted); font-size: 17px; margin: 8px 0 22px; }
.levels { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin: 28px 4px 0; }
.lvl { height: 52px; font-weight: 800; font-size: 16px; position: relative; }
.lvl.star::after { content: "★"; position: absolute; top: -9px; right: -5px; color: var(--clay); font-size: 18px; }
.by { margin-top: auto; text-align: center; color: var(--muted); font-size: 14px; }
.by a, .follow { color: var(--ink); font-weight: 700; }

.bar { display: flex; align-items: center; gap: 8px; min-height: 52px; }
.title { flex: 1; min-width: 0; }
.title b { display: block; font-size: 20px; font-weight: 800; }
.title small { color: var(--muted); font-size: 14px; }
.icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.icon svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
#sound .mute { display: none; }
#sound.off .mute { display: inline; }
#sound.off .wave { display: none; }

.stage { flex: 1; position: relative; min-height: 0; margin: 8px -16px; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: manipulation; }
.twists { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.twists button { height: 78px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; font-weight: 800; font-size: 14px; }
.twists img { width: 30px; height: 30px; }

.win { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; padding: 0 16px 6%; }
.win[hidden] { display: none; }
.card { background: var(--paper); border-radius: 22px; padding: 18px 20px 20px; min-width: 250px; text-align: center;
  box-shadow: 0 6px 0 var(--edge), 0 18px 40px rgba(17, 17, 17, .18); animation: up .32s ease-out; }
.card b { display: block; font-size: 24px; font-weight: 900; }
.card small { display: block; color: var(--muted); font-size: 15px; margin: 4px 0 14px; }
.card .primary { width: 100%; }
.star-big { display: block; color: var(--clay); font-size: 30px; line-height: 1; margin-bottom: 4px; }
.star-big[hidden] { display: none; }
.ghost { height: 48px; padding: 0 22px; font-weight: 700; }
@keyframes up { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (max-height: 680px) {
  h1 { font-size: 48px; }
  .hero { padding-top: 2vh; }
  .levels { gap: 9px; margin-top: 16px; }
  .lvl { height: 44px; }
  .twists button { height: 64px; }
}
@media (prefers-reduced-motion: reduce) {
  .card { animation: none; }
  .primary, .twists button, .lvl, .icon, .ghost { transition: none; }
}

/* ?capture=1: board only, for clip tools */
.capture .bar, .capture .twists, .capture .win { display: none !important; }
.capture #play { padding: 0; }
.capture .stage { margin: 0; }

.notify { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.notify label { font-weight: 700; }
.notify .row { display: flex; gap: 8px; }
.notify input[type=email] { flex: 1; min-width: 0; height: 52px; border-radius: 14px; border: 2px solid var(--edge);
  background: var(--paper); padding: 0 14px; font: inherit; color: var(--ink); }
.notify input[type=email]:focus { outline: 3px solid var(--clay); outline-offset: 1px; }
.notify .primary { height: 52px; padding: 0 16px; font-size: 16px; }
.notify .msg { margin: 0; min-height: 20px; font-weight: 700; }
.notify .fine { margin: 0; color: var(--muted); font-size: 13px; }
.notify .fine a { color: var(--ink); }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
