:root {
  --void: #0e0d14;
  --panel: rgba(18, 16, 27, 0.9);
  --line: #262238;
  --text: #d9d4ea;
  --dim: #6f6a88;
  --gold: #ffd24a;
  --star: #fff9e8;
  --err: #ff9a9a;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--void) url(/specks.png) repeat;
  background-size: 512px 512px;
  color: var(--text);
  font: 15px/1.6 var(--mono);
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 40px 16px 24px;
}

[hidden] { display: none !important; }
.view { width: min(560px, 100%); }

/* pixel text: the SVG is sized by its own pixel width times --px */
[data-pixel] { display: block; }
[data-pixel] svg { display: block; width: calc(var(--w) * var(--px, 4px)); max-width: 100%; height: auto; }

.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* hero */
.hero { display: flex; flex-direction: column; align-items: center; gap: 30px; text-align: center; }
.hero [data-pixel] { width: 100%; }
.hero [data-pixel] svg { margin: 0 auto; }
.wordmark { margin: 0; color: var(--star); --px: 12px; }
.tagline { margin: 0; color: var(--dim); --px: 3px; }
.hero-actions { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 6px; }

/* the ten stars */
.stars svg { display: block; width: var(--size, 140px); height: auto; margin: 0 auto; }
.star { fill: var(--line); transition: fill 0.45s ease; }
.star.on { fill: var(--gold); }
.star.flash { fill: #4d4769; }
.hero-stars { --size: 126px; }
.step-stars { --size: 98px; margin: 6px 0 22px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 30px;
  border: 1px solid var(--gold); border-radius: 0;
  background: transparent; color: var(--gold);
  font: inherit; letter-spacing: 0.24em; text-transform: lowercase; text-decoration: none;
  cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn:hover:not([disabled]), .btn:focus-visible { background: var(--gold); color: var(--void); outline: none; }
.btn[disabled] { opacity: 0.3; cursor: not-allowed; }
.btn.small { min-height: 38px; padding: 0 16px; letter-spacing: 0.16em; }
.btn.ghost { border-color: var(--line); color: var(--text); }
.btn.ghost:hover, .btn.ghost:focus-visible { background: var(--line); color: var(--star); }
.btn.done, .btn.done:hover { border-color: var(--line); background: transparent; color: var(--dim); }

.link {
  background: none; border: 0; padding: 8px;
  color: var(--dim); font: inherit; font-size: 13px; cursor: pointer;
  text-decoration: underline dotted; text-underline-offset: 4px;
}
.link:hover, .link:focus-visible { color: var(--text); outline: none; }

/* panels: thin frame with gold corners, like the card */
.panel {
  position: relative;
  padding: 34px 30px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.panel::before {
  --c: var(--gold);
  --l: 14px;
  content: '';
  position: absolute;
  inset: -1px;
  pointer-events: none;
  background:
    linear-gradient(var(--c) 0 0) top left / var(--l) 1px,
    linear-gradient(var(--c) 0 0) top left / 1px var(--l),
    linear-gradient(var(--c) 0 0) top right / var(--l) 1px,
    linear-gradient(var(--c) 0 0) top right / 1px var(--l),
    linear-gradient(var(--c) 0 0) bottom left / var(--l) 1px,
    linear-gradient(var(--c) 0 0) bottom left / 1px var(--l),
    linear-gradient(var(--c) 0 0) bottom right / var(--l) 1px,
    linear-gradient(var(--c) 0 0) bottom right / 1px var(--l);
  background-repeat: no-repeat;
}

.step { margin: 0 0 16px; color: var(--dim); font-size: 12px; letter-spacing: 0.3em; }
.heading { margin: 0 0 8px; color: var(--star); --px: 4px; }
.sub { margin: 0 0 18px; color: var(--dim); }

/* fields */
.label { display: block; margin: 16px 0 6px; color: var(--dim); font-size: 12px; letter-spacing: 0.2em; }
.field {
  width: 100%; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 0; outline: none;
  background: #0a0910; color: var(--star);
  font: inherit; font-size: 16px;
}
.field:focus { border-color: var(--gold); }
.field::placeholder { color: #3f3a55; }
.number-field { font-size: 40px; text-align: center; letter-spacing: 0.12em; padding: 10px; }

.error { min-height: 1.4em; margin: 10px 0 0; color: var(--err); font-size: 13px; }
.fine { margin: 14px 0 0; color: var(--dim); font-size: 12px; }

.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 22px; }
.row.wrap { flex-wrap: wrap; justify-content: flex-start; }

.tasks { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.task { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.task b { color: var(--star); font-weight: normal; }

.card-img {
  display: block; width: 100%; height: auto; margin: 6px 0 2px;
  border: 1px solid var(--line);
  image-rendering: pixelated;
}

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.foot {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 10px;
  padding: 18px 16px 28px;
  color: var(--dim); font-size: 12px; letter-spacing: 0.1em;
}
.foot a { color: var(--dim); }
.foot a:hover { color: var(--text); }

.fade-in { animation: rise 0.5s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (max-width: 540px) {
  main { padding-top: 28px; }
  .panel { padding: 26px 18px; }
  .wordmark { --px: 8px; }
  .heading { --px: 3px; }
  .number-field { font-size: 32px; }
  .row.wrap .btn { flex: 1 1 100%; }
}

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