:root {
  color-scheme: light;
  --ink: #202344;
  --muted: #747795;
  --purple: #7657e8;
  --purple-dark: #5c40c7;
  --pink: #ff78a8;
  --yellow: #ffdc71;
  --paper: #fffdf9;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: #f1efff;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
button, input { font: inherit; }
.page-shell { max-width: 760px; margin: 0 auto; padding: 28px 22px 38px; }
.hero {
  position: relative;
  overflow: hidden;
  padding: 46px 34px 42px;
  border-radius: 30px;
  color: white;
  text-align: center;
  background: radial-gradient(circle at 14% 19%, #836cff 0 3px, transparent 4px), radial-gradient(circle at 84% 30%, #ffda6c 0 4px, transparent 5px), radial-gradient(circle at 77% 77%, #ff85b2 0 3px, transparent 4px), linear-gradient(145deg, #26264f, #5842a7 58%, #755de0);
  box-shadow: 0 16px 40px #5847a329;
}
.brand-mark { display: inline-grid; width: 48px; height: 48px; place-items: center; margin-bottom: 16px; border: 1px solid #ffffff62; border-radius: 16px; color: var(--yellow); background: #ffffff16; font-size: 27px; }
.eyebrow { margin: 0 0 9px; font-size: 11px; font-weight: 800; letter-spacing: .19em; }
.hero .eyebrow { color: #d9d2ff; }
h1, h2 { font-family: 'Trebuchet MS', system-ui, sans-serif; }
h1 { margin: 0; font-size: clamp(48px, 11vw, 76px); line-height: .94; letter-spacing: -.035em; }
h1 span { color: var(--yellow); }
.intro { max-width: 390px; margin: 20px auto 23px; color: #e7e3ff; font-size: 16px; line-height: 1.6; }
.jump-link { display: inline-flex; align-items: center; gap: 9px; padding: 11px 17px; border-radius: 999px; color: #312457; background: var(--yellow); font-weight: 800; text-decoration: none; transition: transform .15s ease; }
.jump-link:hover { transform: translateY(2px); }
.game-card, .scores-card { margin-top: 20px; padding: 27px 30px; border: 1px solid #e7e5f2; border-radius: 24px; background: var(--paper); box-shadow: 0 8px 25px #4039750b; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-heading .eyebrow { color: var(--purple); }
h2 { margin: 0; font-size: clamp(25px, 6vw, 32px); letter-spacing: -.025em; }
.game-icon, .trophy { display: grid; width: 50px; height: 50px; flex: 0 0 auto; place-items: center; border-radius: 16px; background: #fff3c8; font-size: 25px; }
.game-copy { margin: 18px 0; color: var(--muted); line-height: 1.5; }
.game-stats { display: flex; gap: 12px; margin-bottom: 18px; }
.game-stats > div { flex: 1; padding: 13px 15px; border-radius: 16px; background: #f5f3ff; }
.stat-label { display: block; margin-bottom: 2px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .13em; }
.game-stats strong { color: var(--purple-dark); font-family: 'Trebuchet MS', system-ui, sans-serif; font-size: 27px; }
.game-stats small { font-family: system-ui, sans-serif; font-size: 13px; }
.play-button, .form-row button { min-height: 49px; border: 0; border-radius: 14px; color: white; background: var(--purple); font-weight: 800; cursor: pointer; transition: background .15s ease, transform .15s ease; }
.play-button { width: 100%; }
.play-button:hover, .form-row button:hover { background: var(--purple-dark); transform: translateY(-1px); }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid #ff9bc0; outline-offset: 3px; }
.play-button:disabled { cursor: default; opacity: .72; }
.game-message { min-height: 22px; margin: 11px 0 0; color: var(--muted); text-align: center; font-size: 13px; }
.save-score { margin-top: 17px; padding-top: 18px; border-top: 1px solid #eeedf5; }
.save-score[hidden] { display: none; }
.save-score label { display: block; margin-bottom: 9px; font-size: 14px; font-weight: 700; }
.form-row { display: flex; gap: 8px; }
.form-row input { min-width: 0; min-height: 47px; flex: 1; padding: 0 13px; border: 1px solid #dcd9ec; border-radius: 13px; color: var(--ink); background: white; }
.form-row button { padding: 0 15px; }
.form-note { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.trophy { background: #fff0dd; }
.score-list { display: grid; gap: 9px; margin: 20px 0 0; padding: 0; list-style: none; }
.score-list li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; border-radius: 13px; background: #f8f7fd; }
.score-list li:first-child:not(.empty-score) { background: #fff5d9; }
.rank-name { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 700; }
.rank { width: 25px; color: var(--muted); font-size: 12px; text-align: center; }
.score-value { flex: 0 0 auto; color: var(--purple-dark); font-family: 'Trebuchet MS', system-ui, sans-serif; font-size: 18px; }
.empty-score { justify-content: center !important; color: var(--muted); font-size: 14px; }
footer { padding: 26px 0 0; color: var(--muted); text-align: center; font-size: 13px; }
footer span { color: var(--purple); }
@media (max-width: 520px) {
  .page-shell { padding: 14px 13px 26px; }
  .hero { padding: 36px 22px 34px; border-radius: 24px; }
  .game-card, .scores-card { padding: 22px 19px; border-radius: 20px; }
  .form-row { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; } }
