* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--night); color: var(--pearl);
  font-family: var(--font-sans); line-height: 1.5; }
main { max-width: 980px; margin: 0 auto; padding: var(--space-5) var(--space-4) var(--space-7); }
.sitemark { display: block; width: 190px; margin: 0 auto var(--space-5); }
.sitemark img { width: 100%; height: auto; display: block; }
h1 { font: 700 clamp(2.2rem, 7vw, 3.4rem)/1.1 var(--font-display); text-align: center; margin: 0; }
.stage { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: var(--space-6);
  align-items: center; margin-top: var(--space-6); }
.wheel-wrap { position: relative; isolation: isolate; max-width: 460px; width: 100%; margin: 0 auto; }
/* A box-shadow on a circle, not a larger blurred box: shadows can't cause sideways scroll on phones. */
.wheel-wrap::before { content: ""; position: absolute; inset: 6%; z-index: -1; border-radius: 50%;
  box-shadow: 0 0 60px 24px rgba(var(--glow-pink-rgb), .55), 0 0 140px 60px rgba(var(--glow-pink-rgb), .28); }
.wheel { display: block; width: 100%; height: auto; overflow: visible; }
.rotor { transform-origin: 0 0; }   /* user-space origin: the hub, which is not the viewBox centre */
.slice { stroke: var(--night); stroke-width: .6; }
.slice-a { fill: var(--hotpink); }
.slice-b { fill: var(--panel-2); }
.slice-c { fill: var(--goldsoft); }
.slice-win { fill: var(--gold); }
.slice-label { fill: var(--pearl); font: 600 6.6px var(--font-sans); }
.slice-label-win { fill: var(--night); }
.rim { fill: none; stroke: var(--gold); stroke-width: 1.6; filter: drop-shadow(0 0 5px rgba(231,200,115,.55)); }
.hub { fill: var(--night); stroke: var(--gold); stroke-width: 1.2; }
.pointer { fill: var(--gold); stroke: var(--night); stroke-width: .8; }
.result { min-height: 3.2em; margin: var(--space-4) 0 0; text-align: center; color: var(--muted); }
.result strong { display: block; font: 700 1.8rem/1.2 var(--font-display); color: var(--gold); }
.tally h2 { font: 700 1.4rem/1.2 var(--font-display); margin: 0 0 var(--space-1); }
.tally p { margin: 0 0 var(--space-3); color: var(--muted); font-size: .92rem; }
.toys { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.toy { position: relative; isolation: isolate; overflow: hidden; display: flex; width: 100%;
  justify-content: space-between; gap: var(--space-3); padding: 10px var(--space-3); min-height: 44px;
  align-items: center; background: var(--panel); color: var(--pearl); border: 1px solid var(--line);
  border-radius: var(--radius-sm); font: 500 1rem var(--font-sans); text-align: left; }
.toy::before { content: ""; position: absolute; inset: 0 auto 0 0; z-index: -1; width: var(--fill, 0%);
  background: rgba(var(--glow-pink-rgb), .28); transition: width .4s; }
button.toy { cursor: pointer; }
button.toy:hover { border-color: var(--line-2); }
.toy-mine { border-color: var(--hotpink); box-shadow: var(--shadow-neon-soft); }
.toy-n { font-variant-numeric: tabular-nums; color: var(--muted); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.status { min-height: 1.5em; margin: var(--space-3) 0 0; color: var(--muted); font-size: .92rem; }
.status.err { color: var(--error); }
.btn { min-height: 48px; padding: 10px var(--space-5); border: 1px solid var(--hotpink); border-radius: 999px;
  background: var(--hotpink); color: var(--night); font: 700 1rem var(--font-sans); cursor: pointer; }
.btn[hidden] { display: none; }
.btn:hover { box-shadow: var(--shadow-neon); }
.btn:disabled { opacity: .5; cursor: default; box-shadow: none; }
.btn-quiet { background: transparent; border-color: var(--line-2); color: var(--pearl); }
.actions { display: flex; flex-wrap: wrap; gap: var(--space-3); justify-content: center; margin-top: var(--space-4); }
.gate { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: var(--space-4);
  background: var(--night); }
.gate[hidden] { display: none; }
.gate-card { max-width: 400px; text-align: center; padding: var(--space-6) var(--space-5);
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; }
.gate-card img { width: 200px; height: auto; }
.gate-title { font: 700 1.5rem var(--font-display); margin: var(--space-4) 0 var(--space-2); }
.gate-card p { color: var(--muted); }
.gate-card a { display: block; margin-top: var(--space-3); color: var(--muted); font-size: .9rem; }
.editor { margin-top: var(--space-7); max-width: 560px; margin-inline: auto; }
.editor h2 { font: 700 1.4rem/1.2 var(--font-display); margin: 0 0 var(--space-1); }
.editor > p { margin: 0 0 var(--space-3); color: var(--muted); font-size: .92rem; }
.edit-row { display: flex; gap: var(--space-2); margin-bottom: var(--space-2); }
.edit-row input { flex: 1; min-width: 0; min-height: 44px; padding: 8px var(--space-3); background: var(--panel);
  color: var(--pearl); border: 1px solid var(--line-2); border-radius: var(--radius-sm); font: 500 1rem var(--font-sans); }
.edit-row input:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.btn-small { min-height: 44px; padding: 8px var(--space-3); font-size: .9rem; font-weight: 500; }
@keyframes wheel-glow { from { opacity: .7; } to { opacity: 1; } }
@media (prefers-reduced-motion: no-preference) {
  .wheel-wrap::before { animation: wheel-glow 3.2s ease-in-out infinite alternate; }
}
@media (max-width: 720px) { .stage { grid-template-columns: minmax(0, 1fr); gap: var(--space-5); } }
@media (prefers-reduced-motion: reduce) { .toy::before { transition: none; } }
