:root {
  --gold: #f3cf7a;
  --gold-hi: #fff3c4;
  --gold-deep: #b8862b;
  --ink: #050819;
  --cream: #f8f0dc;
  --dim: rgba(232, 226, 255, .66);
  --glass: rgba(255, 255, 255, .075);
  --stroke: rgba(255, 233, 180, .2);
  --st: env(safe-area-inset-top, 0px);
  --sr: env(safe-area-inset-right, 0px);
  --sb: env(safe-area-inset-bottom, 0px);
  --sl: env(safe-area-inset-left, 0px);
  --display: "Cinzel", "Trajan Pro", "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "Noto Serif", Georgia, serif;
  --ui: "Avenir Next", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--ink);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  position: fixed;
  inset: 0;
  font-family: var(--ui);
  color: var(--cream);
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  background:
    radial-gradient(90% 55% at 22% 8%, rgba(92, 108, 220, .34), transparent 70%),
    radial-gradient(120% 70% at 50% 108%, rgba(120, 70, 30, .3), transparent 62%),
    linear-gradient(180deg, #0c1447 0%, #080d32 46%, #04061a 100%);
}

#sky, #fx {
  position: fixed;
  left: 0; top: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
#sky { z-index: 0; }
#fx { z-index: 15; }

.town {
  position: fixed;
  left: 0; bottom: 0;
  width: 100%;
  height: min(24vh, 210px);
  z-index: 0;
  opacity: .9;
  pointer-events: none;
}

/* ---------- layout ---------- */
#app {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  grid-template: "top" auto "stage" minmax(0, 1fr) "panel" auto / minmax(0, 1fr);
  padding: calc(var(--st) + 10px) calc(var(--sr) + 14px) calc(var(--sb) + 12px) calc(var(--sl) + 14px);
  gap: 6px;
}

.top {
  grid-area: top;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}
.brand { min-width: 0; }
h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(22px, 6.3vw, 46px);
  line-height: 1.08;
  letter-spacing: .045em;
  white-space: nowrap;
  background: linear-gradient(180deg, #fff6d6 8%, #f6d98c 42%, #d9a441 68%, #9a6913 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 10px rgba(255, 200, 100, .28));
}
.status {
  margin: 3px 0 0;
  font-size: clamp(12px, 3.3vw, 16px);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top-actions { display: flex; gap: 8px; flex: none; }

.icon-btn {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--stroke);
  background: var(--glass);
  color: var(--gold);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  cursor: pointer;
}
.icon-btn svg { width: 24px; height: 24px; }
.icon-btn:active { transform: scale(.92); background: rgba(255, 255, 255, .16); }
.icon-btn .ic-off { display: none; }
.icon-btn.is-muted .ic-on { display: none; }
.icon-btn.is-muted .ic-off { display: block; }
.icon-btn.is-muted { color: var(--dim); }

.stage {
  grid-area: stage;
  min-width: 0; min-height: 0;
  display: grid;
}
#wheelWrap {
  position: relative;
  min-width: 0; min-height: 0;
  width: 100%; height: 100%;
}
#wheel {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  touch-action: none;
  cursor: pointer;
  outline: none;
}

.panel {
  grid-area: panel;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0; min-height: 0;
}

/* ---------- buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 12px 22px;
  border: 0;
  border-radius: 999px;
  font: 700 clamp(17px, 4.6vw, 22px)/1.15 var(--ui);
  letter-spacing: .03em;
  color: #2a1a02;
  cursor: pointer;
  overflow: hidden;
  touch-action: manipulation;
  transition: transform .12s ease, filter .2s ease, opacity .2s ease;
}
.btn:active { transform: scale(.965); }
.btn:disabled { opacity: .45; filter: saturate(.6); cursor: default; }
.btn-gold {
  background: linear-gradient(180deg, #fff3c4 0%, #f3cf7a 38%, #d9a441 72%, #b07c1f 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 -3px 8px rgba(120, 70, 0, .35) inset, 0 10px 30px rgba(243, 190, 90, .32), 0 2px 6px rgba(0, 0, 0, .5);
}
.btn-glass {
  color: var(--cream);
  background: rgba(255, 255, 255, .09);
  border: 1px solid var(--stroke);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.btn-danger { color: #fff; background: linear-gradient(180deg, #c8375f, #8c1c44); box-shadow: 0 6px 18px rgba(140, 28, 68, .4); }
.btn-crown {
  color: var(--gold-hi);
  background: linear-gradient(180deg, rgba(120, 70, 190, .5), rgba(60, 30, 120, .55));
  border: 1.5px solid rgba(243, 207, 122, .75);
  box-shadow: 0 0 26px rgba(243, 207, 122, .22), 0 0 0 1px rgba(0, 0, 0, .3) inset;
}
.btn-sm { min-height: 50px; font-size: 16px; padding: 10px 18px; flex: 1 1 0; }

.btn-spin {
  align-self: center;
  width: min(100%, 460px);
  min-height: 66px;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(24px, 7vw, 32px);
  letter-spacing: .3em;
  text-transform: uppercase;
}
.btn-spin span { padding-left: .3em; }
.btn-spin.is-small-label { font-size: clamp(16px, 4.6vw, 22px); letter-spacing: .12em; }
.btn-spin::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: -40%;
  width: 34%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .65), transparent);
  transform: skewX(-20deg);
  animation: sheen 4.2s ease-in-out infinite;
}
.btn-spin:disabled::after { display: none; }
@keyframes sheen { 0%, 62% { left: -40%; } 100% { left: 130%; } }

.link-btn {
  border: 0;
  background: none;
  color: var(--gold);
  font: 600 14px var(--ui);
  letter-spacing: .04em;
  padding: 8px 4px 8px 14px;
  margin: -8px 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link-btn[hidden] { display: none; }

/* ---------- picked list ---------- */
.picked {
  min-width: 0; min-height: 0;
  padding: 10px 12px 10px;
  border-radius: 20px;
  border: 1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(255, 255, 255, .085), rgba(255, 255, 255, .035));
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
}
.picked-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 8px;
}
#pickedList {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior: contain;
  touch-action: pan-x;
  scrollbar-width: none;
  min-height: 42px;
  -webkit-overflow-scrolling: touch;
}
#pickedList::-webkit-scrollbar { display: none; }
#pickedList li {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 14px 0 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .1);
  white-space: nowrap;
}
#pickedList li b {
  display: grid; place-items: center;
  min-width: 30px; height: 30px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(243, 207, 122, .16);
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
}
#pickedList .who { display: flex; flex-direction: column; line-height: 1.12; }
#pickedList .nm { font-size: 15px; font-weight: 600; }
#pickedList small { font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--dim); }
#pickedList li.latest { border-color: rgba(243, 207, 122, .6); background: rgba(243, 207, 122, .13); }
#pickedList li.empty {
  background: none; border: 0; padding: 0 2px;
  color: var(--dim); font-size: 14px; font-style: italic;
}

/* ---------- landscape: wheel left, controls right ---------- */
@media (orientation: landscape) and (min-aspect-ratio: 6/5) {
  #app {
    grid-template: "stage top" auto "stage panel" minmax(0, 1fr) / minmax(0, 1fr) clamp(250px, 34vw, 430px);
    column-gap: 18px;
    padding-top: calc(var(--st) + 8px);
    padding-bottom: calc(var(--sb) + 8px);
  }
  .top { align-items: flex-start; padding-top: 4px; }
  h1 { font-size: clamp(20px, 3.2vw, 40px); white-space: normal; }
  .status { font-size: clamp(11px, 1.5vw, 15px); }
  .panel { justify-content: flex-end; }
  .picked { order: 1; flex: 1 1 auto; margin-top: 6px; }
  .btn-spin { order: 2; width: 100%; }
  #pickedList {
    flex-wrap: wrap;
    align-content: flex-start;
    overflow-x: hidden;
    overflow-y: auto;
    touch-action: pan-y;
    flex: 1 1 0;
    min-height: 0;
  }
  #pickedList li.empty { white-space: normal; height: auto; flex: 1 1 100%; }
}
@media (orientation: landscape) and (max-height: 480px) {
  .icon-btn { width: 42px; height: 42px; }
  .btn-spin { min-height: 54px; font-size: 24px; }
  .picked { padding: 8px 10px; }
  #pickedList li { height: 36px; }
  #pickedList li b { min-width: 26px; height: 26px; }
}
@media (min-width: 700px) and (min-height: 700px) {
  #app { gap: 12px; padding-left: calc(var(--sl) + 24px); padding-right: calc(var(--sr) + 24px); padding-bottom: calc(var(--sb) + 20px); padding-top: calc(var(--st) + 18px); }
  .icon-btn { width: 54px; height: 54px; }
  .btn-spin { min-height: 78px; }
  #pickedList li { height: 50px; padding-right: 18px; }
  #pickedList .nm { font-size: 18px; }
  #pickedList small { font-size: 11.5px; }
  .picked-head { font-size: 13px; }
}

/* ---------- overlays ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  transition: opacity .35s ease, visibility 0s linear .35s;
  padding: calc(var(--st) + 14px) calc(var(--sr) + 18px) calc(var(--sb) + 18px) calc(var(--sl) + 18px);
}
.overlay.on { visibility: visible; opacity: 1; transition: opacity .35s ease, visibility 0s; }
#reveal { background: radial-gradient(circle at 50% 40%, rgba(16, 22, 78, .86), rgba(4, 6, 24, .95) 72%); }
#finale { background: radial-gradient(circle at 50% 30%, #3b2a12 0%, #1a1540 34%, #060820 78%); }

.rays {
  position: absolute;
  left: 50%; top: 40%;
  width: 150vmax; height: 150vmax;
  margin: -75vmax 0 0 -75vmax;
  background: repeating-conic-gradient(from 0deg, rgba(255, 220, 140, .15) 0deg 5deg, transparent 5deg 18deg, rgba(255, 220, 140, .07) 18deg 21deg, transparent 21deg 30deg);
  -webkit-mask: radial-gradient(circle, #000 0%, rgba(0, 0, 0, .5) 22%, transparent 52%);
  mask: radial-gradient(circle, #000 0%, rgba(0, 0, 0, .5) 22%, transparent 52%);
  opacity: 0;
  pointer-events: none;
}
.overlay.on .rays { animation: raysIn 1.2s ease-out .15s both, turn 60s linear infinite; }
.rays-big {
  top: 30%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 224, 150, .3) 0deg 6deg, transparent 6deg 15deg, rgba(255, 224, 150, .12) 15deg 18deg, transparent 18deg 24deg);
}
.overlay.on .rays-big { animation: raysIn 1.6s ease-out .1s both, turn 44s linear infinite; }
@keyframes raysIn { from { opacity: 0; scale: .4; } to { opacity: 1; scale: 1; } }
@keyframes turn { to { rotate: 360deg; } }

.card {
  position: relative;
  width: 100%;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.eyebrow {
  margin: 0 0 1vh;
  font-size: clamp(13px, 3.4vmin, 22px);
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0;
}
.on .eyebrow { animation: rise .6s ease-out .05s both; }

.bigname {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: .01em;
  filter: drop-shadow(0 0 22px rgba(255, 205, 110, .55)) drop-shadow(0 4px 2px rgba(0, 0, 0, .55));
}
.bigname .line { display: block; width: max-content; margin: 0 auto; white-space: nowrap; }
.bigname .ch {
  display: inline-block;
  background: linear-gradient(180deg, #ffffff 4%, #fff0b8 30%, #f3cf7a 52%, #d39b34 74%, #8a5a12 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0;
  padding: 0 .01em;
}
.on .bigname .ch { animation: chIn .7s cubic-bezier(.2, 1.5, .4, 1) both; }
.on .bigname { animation: glowPulse 2.6s ease-in-out 1.2s infinite; }
@keyframes chIn {
  0% { opacity: 0; transform: translateY(.55em) scale(.2) rotate(-14deg); filter: blur(10px); }
  55% { opacity: 1; filter: blur(0); }
  100% { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes glowPulse {
  0%, 100% { filter: drop-shadow(0 0 22px rgba(255, 205, 110, .5)) drop-shadow(0 4px 2px rgba(0, 0, 0, .55)); }
  50% { filter: drop-shadow(0 0 40px rgba(255, 215, 130, .95)) drop-shadow(0 4px 2px rgba(0, 0, 0, .55)); }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.family {
  margin: 1.2vh 0 0;
  padding: 6px 18px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, .07);
  font-size: clamp(13px, 3.4vmin, 22px);
  letter-spacing: .26em;
  text-indent: .26em;
  text-transform: uppercase;
  color: var(--gold-hi);
  opacity: 0;
}
.family[hidden] { display: none; }
.on .family { animation: rise .6s ease-out .75s both; }

.hint {
  margin: 2.2vh 0 0;
  font-size: clamp(15px, 3.8vmin, 24px);
  font-style: italic;
  color: var(--dim);
  opacity: 0;
}
.on .hint { animation: rise .6s ease-out .9s both; }

.actions {
  margin-top: clamp(16px, 4.5vh, 48px);
  width: min(100%, 460px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  opacity: 0;
  pointer-events: none;
}
.actions .btn { width: 100%; min-height: 62px; }
#reveal.on .actions { animation: rise .5s ease-out 1s both; }
#reveal.ready .actions { pointer-events: auto; }
#btnNext { min-height: 70px; font-size: clamp(20px, 5.4vw, 26px); }
.actions-row { flex-direction: row; }
.actions-row .btn { flex: 1 1 0; }

/* finale */
.flash { position: absolute; inset: 0; background: radial-gradient(circle at 50% 30%, #fffbe6, #ffe9a8 40%, rgba(255, 220, 140, .6)); opacity: 0; pointer-events: none; }
#finale.on .flash { animation: flash 1.3s ease-out both; }
@keyframes flash { 0% { opacity: 1; } 100% { opacity: 0; } }

.beth {
  position: absolute;
  left: 50%; top: 30%;
  width: 0; height: 0;
  pointer-events: none;
}
.beth i {
  position: absolute;
  left: 0; top: 0;
  translate: -50% -50%;
  border-radius: 50%;
}
.beth i:nth-child(1) { width: 62vmin; height: 62vmin; background: radial-gradient(circle, rgba(255, 250, 225, .95) 0%, rgba(255, 228, 150, .5) 9%, rgba(255, 210, 120, .16) 30%, transparent 62%); }
.beth i:nth-child(2) { width: 1.6vmin; height: 150vmin; background: radial-gradient(ellipse at center, #fff 0%, rgba(255, 236, 170, .75) 16%, transparent 68%); }
.beth i:nth-child(3) { width: 110vmin; height: 1.4vmin; background: radial-gradient(ellipse at center, #fff 0%, rgba(255, 236, 170, .7) 16%, transparent 68%); }
#finale.on .beth { animation: starIn 1.5s cubic-bezier(.2, 1.3, .3, 1) both, starPulse 3.4s ease-in-out 1.5s infinite; }
@keyframes starIn { 0% { scale: 0; rotate: -50deg; opacity: 0; } 55% { opacity: 1; } 100% { scale: 1; rotate: 0deg; opacity: 1; } }
@keyframes starPulse { 0%, 100% { scale: 1; } 50% { scale: 1.09; } }

.crown {
  width: clamp(64px, 20vmin, 150px);
  height: auto;
  margin-bottom: .6vh;
  filter: drop-shadow(0 0 18px rgba(255, 215, 120, .85)) drop-shadow(0 4px 3px rgba(0, 0, 0, .5));
  opacity: 0;
}
#finale.on .crown { animation: crownDrop 1.1s cubic-bezier(.3, 1.6, .5, 1) .95s both, bob 3s ease-in-out 2.1s infinite; }
@keyframes crownDrop { 0% { opacity: 0; transform: translateY(-60vh) rotate(-28deg) scale(1.5); } 60% { opacity: 1; } 100% { opacity: 1; transform: none; } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-6px) rotate(2deg); } }

.wins {
  margin: 1.6vh 0 0;
  font-family: var(--display);
  font-size: clamp(19px, 5.6vmin, 44px);
  font-weight: 600;
  letter-spacing: .05em;
  color: var(--cream);
  text-shadow: 0 2px 12px rgba(0, 0, 0, .6);
  opacity: 0;
}
.wins strong {
  font-weight: 800;
  white-space: nowrap;
  background: linear-gradient(180deg, #fff6d6, #f3cf7a 50%, #c8912c);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
#finale.on .wins { animation: rise .7s ease-out 1.15s both; }
.finale-sub { margin: 1.2vh 0 0; font-size: clamp(14px, 3.4vmin, 22px); font-style: italic; color: var(--dim); opacity: 0; }
#finale.on .finale-sub { animation: rise .7s ease-out 1.5s both; }
.manger { width: clamp(70px, 17vmin, 130px); height: auto; margin-top: 2vh; opacity: 0; filter: drop-shadow(0 0 16px rgba(255, 215, 120, .5)); }
#finale.on .manger { animation: rise .8s ease-out 1.8s both; }
#finale .actions { width: min(100%, 420px); margin-top: clamp(14px, 3.5vh, 40px); }
#finale.on .actions { animation: rise .6s ease-out 2.6s both; pointer-events: auto; }
#finale .actions .btn { min-height: 54px; font-size: 17px; }
#finale .family { animation-delay: 1.3s; }

@media (max-height: 520px) {
  .manger, .finale-sub { display: none; }
  .crown { width: 15vmin; }
  .hint { margin-top: 1vh; }
  .actions { flex-direction: row; width: min(100%, 640px); margin-top: 3vh; }
  .actions .btn { flex: 1 1 0; min-height: 54px; font-size: 16px; }
  #btnNext { min-height: 54px; font-size: 18px; }
  .family { margin-top: .5vh; padding: 3px 14px; }
}

/* ---------- sheet + confirm ---------- */
.modal { position: fixed; inset: 0; z-index: 20; visibility: hidden; opacity: 0; transition: opacity .25s ease, visibility 0s linear .25s; }
.modal.on { visibility: visible; opacity: 1; transition: opacity .25s ease, visibility 0s; }
#confirm { z-index: 30; display: grid; place-items: center; padding: 20px; }
.modal-back { position: absolute; inset: 0; background: rgba(2, 4, 16, .72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }

.sheet-panel, .confirm-panel {
  position: relative;
  border: 1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(30, 38, 104, .97), rgba(12, 16, 54, .98));
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
  color: var(--cream);
}
.sheet-panel {
  position: absolute;
  left: 50%;
  top: calc(var(--st) + 10px);
  translate: -50% 12px;
  width: min(560px, calc(100% - 20px - var(--sl) - var(--sr)));
  max-height: calc(100% - var(--st) - var(--sb) - 20px);
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  border-radius: 26px;
  padding: 16px 18px 20px;
  transition: translate .3s cubic-bezier(.2, .9, .3, 1);
}
.modal.on .sheet-panel { translate: -50% 0; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sheet-head h2, .confirm-panel h2 { margin: 0; font-family: var(--display); font-size: 22px; letter-spacing: .04em; color: var(--gold); }
.field-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.muted { color: var(--dim); font-weight: 400; }
.small { font-size: 13px; margin: 14px 0 0; }
textarea {
  display: block;
  width: 100%;
  min-height: 150px;
  max-height: 46vh;
  resize: vertical;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, .32);
  color: var(--cream);
  font: 16px/1.5 var(--ui);            /* 16px keeps iOS from zooming on focus */
  padding: 12px 14px;
  -webkit-user-select: text;
  user-select: text;
  touch-action: pan-y;
  outline: none;
}
textarea:focus { border-color: var(--gold); }
.error { min-height: 18px; margin: 6px 2px 8px; color: #ff9bb3; font-size: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.toggle { display: flex; align-items: center; gap: 12px; margin: 18px 0; font-size: 15px; line-height: 1.3; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.switch { flex: none; width: 56px; height: 32px; border-radius: 999px; background: rgba(255, 255, 255, .16); border: 1px solid var(--stroke); position: relative; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; }
.toggle input:checked + .switch { background: linear-gradient(180deg, #f3cf7a, #c8912c); }
.toggle input:checked + .switch::after { transform: translateX(24px); }
.toggle input:focus-visible + .switch { outline: 2px solid #fff; outline-offset: 2px; }

.confirm-panel { width: min(420px, 100%); border-radius: 24px; padding: 22px 20px 20px; text-align: center; }
.confirm-panel p { margin: 10px 0 20px; color: var(--dim); font-size: 16px; line-height: 1.4; }

#toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--sb) + 22px);
  z-index: 40;
  translate: -50% 20px;
  max-width: calc(100% - 32px);
  padding: 12px 20px;
  border-radius: 999px;
  background: rgba(16, 22, 70, .96);
  border: 1px solid var(--stroke);
  color: var(--cream);
  font-size: 15px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, translate .25s;
}
#toast.on { opacity: 1; translate: -50% 0; }

button:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .btn-spin::after { display: none; }
  .overlay.on .rays, .overlay.on .rays-big { animation: raysIn .4s ease-out both; }
  .on .bigname .ch { animation: fadeOnly .35s ease-out both; animation-delay: 0s !important; }
  .on .bigname, #finale.on .beth { animation: none; }
  #finale.on .crown { animation: fadeOnly .4s ease-out both; }
  #finale.on .flash { animation: none; }
}
@keyframes fadeOnly { from { opacity: 0; } to { opacity: 1; } }
