/* ==========================================================================
   COOPI — The Cooperative Raffle Buddy
   Royal blue / navy / white / gold · presentation-first
   ========================================================================== */

:root {
  --navy-950: #040b1c;
  --navy-900: #071229;
  --navy-800: #0a1b3f;
  --navy-700: #102a5e;
  --royal-600: #1e44c9;
  --royal-500: #2b5cf0;
  --royal-400: #4c7bff;
  --royal-300: #7fa2ff;
  --ice-50: #f7faff;
  --ice-100: #e9f0ff;
  --ice-200: #cfddff;
  --gold-500: #ffd05a;
  --gold-400: #ffe08a;
  --gold-600: #f0b42c;
  --gold-700: #c98c12;
  --ok: #5bd6a8;
  --warn: #ffbe55;
  --danger-soft: #ffb27a;
  --text: #eef3ff;
  --text-dim: #a9b8dd;
  --text-faint: #7c8db8;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --radius: 20px;
  --font: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --sp-1: 8px;
  --sp-2: 16px;
  --sp-3: 24px;
  --sp-4: 32px;
  --ease-out: cubic-bezier(0.22, 0.8, 0.24, 1);
}

* { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  height: 100%;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  background: #050b1a;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

body.has-overlay { overflow: hidden; }

button, input { font-family: inherit; }

button { cursor: pointer; }

img { max-width: 100%; display: block; }

h1, h2, h3, h4, p { margin: 0; }

:focus-visible {
  outline: 2px solid var(--gold-500);
  outline-offset: 3px;
  border-radius: 6px;
}

::selection { background: rgba(255, 208, 90, 0.35); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.26); background-clip: content-box; }

.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;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -60px;
  z-index: 500;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--gold-500);
  color: var(--navy-900);
  font-weight: 700;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus { top: 16px; }

.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* --------------------------------------------------------------------------
   Backdrop
   -------------------------------------------------------------------------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(1100px 640px at 12% -12%, rgba(43, 92, 240, 0.26), transparent 62%),
    radial-gradient(900px 520px at 104% 4%, rgba(255, 190, 60, 0.09), transparent 55%),
    radial-gradient(1000px 700px at 50% 118%, rgba(23, 53, 121, 0.55), transparent 62%),
    linear-gradient(180deg, #071026 0%, #050b1a 60%, #04091a 100%);
}

.backdrop-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.032) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 10%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 10%, transparent 75%);
  opacity: 0.7;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.4;
  animation: orbFloat 16s ease-in-out infinite alternate;
}
.orb-blue { width: 520px; height: 520px; left: -160px; bottom: -120px; background: rgba(43, 92, 240, 0.55); }
.orb-gold { width: 320px; height: 320px; right: -80px; top: 8%; background: rgba(255, 190, 60, 0.3); animation-delay: -6s; }
.orb-navy { width: 640px; height: 640px; left: 46%; top: 30%; background: rgba(18, 43, 105, 0.55); animation-delay: -10s; }

.backdrop-floor {
  position: absolute;
  left: 50%;
  bottom: -28%;
  width: 120vw;
  height: 46vh;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(43, 92, 240, 0.18), transparent 65%);
  filter: blur(30px);
}

.backdrop-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(2, 5, 14, 0.55) 100%);
}

@keyframes orbFloat {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(30px, -26px, 0) scale(1.06); }
}

/* --------------------------------------------------------------------------
   App shell / top bar
   -------------------------------------------------------------------------- */

.app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100svh;
}

.topbar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 28px;
  min-height: 72px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  flex: 1 1 0;
  min-width: 0;
}

.brand-logo {
  position: relative;
  display: grid;
  place-items: center;
  height: 48px;
  min-width: 86px;
  padding: 5px 11px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), inset 0 -2px 0 rgba(10, 27, 63, 0.08);
}

.brand-logo img { max-height: 38px; max-width: 128px; object-fit: contain; }

.brand-logo-fallback {
  display: none;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: var(--navy-800);
}
.brand-logo.is-fallback img { display: none; }
.brand-logo.is-fallback .brand-logo-fallback { display: block; }

.brand-text { min-width: 0; }

.wordmark {
  font-size: clamp(20px, 1.9vw, 26px);
  font-weight: 900;
  letter-spacing: 0.16em;
  line-height: 1;
  color: #fff;
}
.wordmark-dot { color: var(--gold-500); letter-spacing: 0; }

.tagline {
  margin-top: 5px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-faint);
  white-space: nowrap;
}

.topbar-title {
  flex: 0 1 auto;
  text-align: center;
  min-width: 0;
  padding: 0 8px;
}

.eyebrow {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold-500);
}

.raffle-title {
  margin-top: 3px;
  max-width: 34vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  flex: 1 1 0;
  min-width: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 208, 90, 0.28);
  background: rgba(255, 208, 90, 0.07);
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
}
.pill strong { color: var(--gold-400); font-size: 14px; font-variant-numeric: tabular-nums; }
.pill-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold-500); box-shadow: 0 0 10px rgba(255, 208, 90, 0.8); }

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-dim);
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.08); color: #fff; border-color: var(--line-strong); }
.icon-btn:active { transform: scale(0.96); }
.icon-btn.is-off { color: var(--text-faint); }
.icon-btn .icon-sound-off { display: none; }
.icon-btn.is-off .icon-sound-on { display: none; }
.icon-btn.is-off .icon-sound-off { display: block; }

.icon { width: 18px; height: 18px; flex: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 17px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  background: transparent;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s, box-shadow 0.2s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-admin { border-color: var(--line); background: rgba(255, 255, 255, 0.04); }
.btn-admin:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.08); }

.btn-outline { border-color: var(--line-strong); background: transparent; }
.btn-outline:hover { background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.28); }

.btn-ghost { color: var(--text-dim); }
.btn-ghost:hover { color: #fff; background: rgba(255, 255, 255, 0.07); }

.btn-gold {
  color: #0a1633;
  background: linear-gradient(180deg, #ffe08a, #ffc63f 48%, #e9a614);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 12px 28px rgba(255, 180, 30, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.8), inset 0 -3px 0 rgba(160, 100, 0, 0.25);
}
.btn-gold:hover { filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 16px 34px rgba(255, 180, 30, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.85); }

.btn-danger-ghost { color: var(--warn); border-color: rgba(255, 190, 85, 0.3); }
.btn-danger-ghost:hover { background: rgba(255, 190, 85, 0.09); }
.btn-danger-ghost:disabled { border-color: var(--line); }

.btn-sm { padding: 8px 13px; font-size: 12.5px; border-radius: 10px; }
.btn-lg { padding: 15px 26px; font-size: 16px; border-radius: 14px; }

.link-btn {
  padding: 0;
  border: none;
  background: none;
  font-size: 12px;
  font-weight: 600;
  color: #c7d6ff;
  text-decoration: none;
  transition: color 0.2s;
}
.link-btn:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:disabled { opacity: 0.35; cursor: not-allowed; text-decoration: none; }
.link-btn.is-danger { color: var(--warn); }
.link-btn.is-danger:hover { color: #ffd894; }

/* --------------------------------------------------------------------------
   Stage layout
   -------------------------------------------------------------------------- */

.stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(300px, 22vw, 360px);
  gap: 18px;
  flex: 1;
  min-height: 0;
  padding: 14px 28px 20px;
}

.stage-main {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  min-height: 0;
  gap: 8px;
}

/* --------------------------------------------------------------------------
   Wheel
   -------------------------------------------------------------------------- */

.wheel-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  flex: 1;
  min-height: 0;
  padding: 10px 0;
}

.wheel-tilt {
  position: relative;
  width: min(calc(100svh - 180px), 64vw, 940px, 100%);
  aspect-ratio: 1;
  transform-style: preserve-3d;
  transform: perspective(1600px) rotateX(var(--tiltX, 5deg)) rotateY(var(--tiltY, 0deg));
  transition: transform 0.35s ease-out;
  will-change: transform;
}

.wheel-pedestal {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(calc(100svh - 180px), 64vw, 940px, 100%);
  aspect-ratio: 1;
  transform: translate(-50%, calc(-50% + 18px)) scale(0.985);
  border-radius: 50%;
  background: linear-gradient(180deg, #0d2150, #071026);
  box-shadow: 0 50px 70px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

.wheel-frame {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #071026;
  box-shadow:
    0 34px 70px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 0 90px rgba(43, 92, 240, 0.18),
    inset 0 0 0 12px rgba(255, 255, 255, 0.02);
}

#wheelCanvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
  position: relative;
  z-index: 1;
}

.wheel-glass {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: 50%;
  pointer-events: none;
  background:
    radial-gradient(circle at 30% 18%, rgba(255, 255, 255, 0.2), transparent 40%),
    radial-gradient(circle at 74% 88%, rgba(0, 0, 0, 0.2), transparent 52%);
  mix-blend-mode: screen;
  opacity: 0.75;
}

.wheel-rim-dots {
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: 50%;
  pointer-events: none;
  box-shadow: inset 0 0 0 2px rgba(255, 232, 170, 0.25), inset 0 0 0 9px rgba(7, 16, 38, 0.35);
}

.wheel-stage.is-empty #wheelCanvas { opacity: 0.25; }
.wheel-stage.is-empty .wheel-frame::after {
  content: "";
  position: absolute;
  inset: 3.5%;
  z-index: 1;
  border-radius: 50%;
  background: repeating-conic-gradient(from -90deg, rgba(43, 92, 240, 0.55) 0deg 30deg, rgba(255, 255, 255, 0.06) 30deg 60deg);
  -webkit-mask: radial-gradient(circle, transparent 27%, #000 28%);
  mask: radial-gradient(circle, transparent 27%, #000 28%);
  opacity: 0.5;
  pointer-events: none;
}
.wheel-stage.is-empty .wheel-hub { opacity: 0.35; pointer-events: none; }

.wheel-hub {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 26.5%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  padding: 0;
  border: none;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 26%, #ffffff, #eef4ff 62%, #d7e3fa);
  box-shadow:
    0 0 0 5px var(--gold-500),
    0 0 0 8px rgba(8, 20, 52, 0.92),
    0 16px 36px rgba(0, 0, 0, 0.5),
    inset 0 8px 18px rgba(43, 92, 240, 0.14);
  transition: box-shadow 0.25s, filter 0.25s;
  cursor: pointer;
}
.wheel-hub:hover { box-shadow: 0 0 0 5px var(--gold-400), 0 0 0 8px rgba(8, 20, 52, 0.92), 0 20px 44px rgba(0, 0, 0, 0.55), 0 0 42px rgba(255, 208, 90, 0.35), inset 0 8px 18px rgba(43, 92, 240, 0.14); }
.wheel-hub:active { filter: brightness(0.97); }

.hub-face {
  position: relative;
  display: grid;
  place-items: center;
  width: 72%;
  height: 54%;
}
.hub-face img { max-width: 100%; max-height: 100%; object-fit: contain; }
.hub-fallback {
  display: none;
  font-size: clamp(13px, 1.3vw, 19px);
  font-weight: 900;
  letter-spacing: 0.1em;
  color: var(--navy-800);
}
.hub-face.is-fallback img { display: none; }
.hub-face.is-fallback .hub-fallback { display: block; }

.hub-label {
  position: absolute;
  bottom: 13%;
  font-size: clamp(7px, 0.62vw, 10px);
  font-weight: 900;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: rgba(10, 27, 77, 0.78);
}

.wheel-pointer {
  position: absolute;
  top: -2.2%;
  left: 50%;
  z-index: 6;
  width: 9.5%;
  min-width: 42px;
  max-width: 74px;
  transform: translateX(-50%);
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.5));
  pointer-events: none;
}
.wheel-pointer svg { width: 100%; height: auto; display: block; }

.wheel-ground-shadow {
  position: absolute;
  left: 50%;
  bottom: -2%;
  transform: translateX(-50%);
  width: 62%;
  height: 42px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(2, 6, 18, 0.55), transparent 68%);
  filter: blur(12px);
  pointer-events: none;
}

/* Empty onboarding card */

.wheel-empty {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: grid;
  place-items: center;
  padding: 18px;
  pointer-events: none;
}
.wheel-empty[hidden] { display: none; }

.empty-card {
  pointer-events: auto;
  width: min(460px, 92%);
  padding: 30px 32px 24px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: linear-gradient(180deg, rgba(11, 25, 55, 0.88), rgba(6, 14, 33, 0.9));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  text-align: center;
  animation: cardIn 0.5s var(--ease-out);
}

.empty-icon {
  width: 62px;
  height: 62px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: var(--gold-400);
  background: rgba(255, 208, 90, 0.08);
  border: 1px solid rgba(255, 208, 90, 0.24);
}
.empty-icon svg { width: 34px; height: 34px; }

.empty-card h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.01em; }
.empty-card p { margin-top: 8px; font-size: 13.5px; color: var(--text-dim); max-width: 34ch; margin-inline: auto; }
.empty-card p strong { color: var(--ice-100); }

.empty-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.empty-links {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 14px;
}
.empty-privacy {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  width: 100%;
  justify-content: center;
  font-size: 11px;
  color: var(--text-faint);
}
.empty-privacy svg { width: 14px; height: 14px; }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   Spin controls
   -------------------------------------------------------------------------- */

.controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 4px 0 2px;
  flex: none;
}

.btn-spin {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  width: min(320px, 78vw);
  padding: 12px 28px 13px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  color: #081430;
  background: linear-gradient(180deg, #ffe492 0%, #ffc94a 45%, #e8a413 100%);
  box-shadow:
    0 20px 46px rgba(255, 176, 26, 0.26),
    0 4px 0 rgba(146, 92, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -3px 0 rgba(160, 100, 0, 0.22);
  transition: transform 0.2s var(--ease-out), box-shadow 0.25s, filter 0.25s;
}
.btn-spin::after {
  content: "";
  position: absolute;
  top: -60%;
  left: -30%;
  width: 40%;
  height: 220%;
  transform: rotate(24deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  animation: spinSheen 4.6s ease-in-out infinite;
  pointer-events: none;
}
.btn-spin:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.04);
  box-shadow:
    0 26px 54px rgba(255, 176, 26, 0.34),
    0 5px 0 rgba(146, 92, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -3px 0 rgba(160, 100, 0, 0.22);
}
.btn-spin:active:not(:disabled) { transform: translateY(1px); }
.btn-spin:disabled {
  cursor: not-allowed;
  filter: saturate(0.35) brightness(0.66);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.btn-spin:disabled::after { display: none; }

.btn-spin-glow {
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.32), transparent 55%);
  opacity: 0.6;
  pointer-events: none;
}
.btn-spin-star { font-size: 19px; color: rgba(8, 20, 48, 0.4); line-height: 1; }
.btn-spin-text { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.btn-spin-label {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-indent: 0.16em;
}
.btn-spin-sub {
  margin-top: 6px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(8, 20, 48, 0.55);
}

@keyframes spinSheen {
  0%, 55% { left: -40%; }
  78%, 100% { left: 130%; }
}

.stage-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  text-transform: uppercase;
}
.stage-meta strong { color: var(--ice-100); font-variant-numeric: tabular-nums; }
.meta-dot { width: 3px; height: 3px; border-radius: 50%; background: rgba(255, 255, 255, 0.24); }
.stage-meta .link-btn { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim); }
.stage-meta .link-btn:hover { color: var(--gold-400); }
.stage-meta .link-btn:disabled { color: var(--text-faint); }

.preview-note {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 5px 12px;
  border: 1px solid rgba(255, 208, 90, 0.2);
  border-radius: 999px;
  background: rgba(8, 20, 48, 0.36);
  color: var(--text-dim);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
}
.preview-note[hidden] { display: none; }
.preview-note strong { color: var(--gold-400); font-variant-numeric: tabular-nums; }
.preview-dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--gold-400);
  box-shadow: 0 0 8px rgba(255, 208, 90, 0.6);
}

/* --------------------------------------------------------------------------
   Mascot rail & speech
   -------------------------------------------------------------------------- */

.mascot-rail {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-height: 0;
  padding: 6px 4px 8px;
}

.speech {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 290px;
  margin: auto auto 8px;
  padding: 12px 16px;
  border-radius: 16px;
  background: #ffffff;
  color: var(--navy-800);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4), inset 0 -2px 0 rgba(10, 27, 77, 0.06);
  animation: speechPop 0.45s var(--ease-out);
  transition: transform 0.3s var(--ease-out);
}
.speech::after {
  content: "";
  position: absolute;
  left: 38%;
  bottom: -9px;
  width: 18px;
  height: 18px;
  background: #fff;
  transform: rotate(45deg) skew(6deg, 6deg);
  border-radius: 4px;
  box-shadow: 6px 6px 12px rgba(0, 0, 0, 0.08);
}
.speech-star { color: var(--gold-600); font-size: 15px; line-height: 1.1; }
.speech.is-pop { animation: speechPop 0.45s var(--ease-out); }

@keyframes speechPop {
  0% { opacity: 0; transform: translateY(8px) scale(0.94); }
  60% { opacity: 1; transform: translateY(-2px) scale(1.02); }
  100% { transform: none; }
}

.mascot-stage {
  position: relative;
  height: min(42svh, 420px);
  max-width: 100%;
  aspect-ratio: 380 / 440;
  perspective: 1000px;
  flex: none;
}

.mascot-caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  margin-top: 4px;
  text-align: center;
}
.mascot-caption strong {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  color: var(--gold-400);
}
.mascot-caption span {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* Spin controls live under COOPI so the wheel keeps the full stage height */
.mascot-rail .controls {
  width: 100%;
  max-width: 340px;
  margin-top: 10px;
}
.mascot-rail .btn-spin {
  width: 100%;
  max-width: 320px;
  gap: 12px;
  padding: 11px 16px 12px;
}
.mascot-rail .btn-spin-label { font-size: 27px; }
.mascot-rail .btn-spin-sub { font-size: 9px; letter-spacing: 0.16em; }
.mascot-rail .stage-meta { gap: 8px; font-size: 10.5px; }
.mascot-rail .preview-note { border-radius: 14px; }

/* --------------------------------------------------------------------------
   COOPI mascot
   -------------------------------------------------------------------------- */

.mascot {
  position: relative;
  width: 100%;
  height: 100%;
}

.coopi-svg {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 26px 26px rgba(2, 6, 18, 0.32));
  transform-origin: 50% 62%;
  will-change: transform;
}

.mascot.is-idle .coopi-svg { animation: idleSway 9s ease-in-out infinite; }

@keyframes idleSway {
  0%, 100% { transform: rotateY(-5deg) rotateX(1.2deg); }
  50% { transform: rotateY(5deg) rotateX(-1.2deg); }
}

.coopi-bob { animation: coopiBob 3.6s ease-in-out infinite; }
@keyframes coopiBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}

.coopi-shadow {
  transform-box: fill-box;
  transform-origin: center;
  animation: shadowPulse 3.6s ease-in-out infinite;
}
@keyframes shadowPulse {
  0%, 100% { transform: scale(1); opacity: 0.95; }
  50% { transform: scale(0.9); opacity: 0.65; }
}

.coopi-eye {
  transform-box: fill-box;
  transform-origin: 50% 55%;
  animation: coopiBlink 5.8s infinite;
}
.coopi-eyes-normal .coopi-eye:nth-of-type(2) { animation-delay: 0.05s; }

@keyframes coopiBlink {
  0%, 92.5%, 100% { transform: scaleY(1); }
  94.5%, 96% { transform: scaleY(0.07); }
}

.coopi-eyes-happy { opacity: 0; }
.mascot.is-celebrating .coopi-eyes-normal { opacity: 0; }
.mascot.is-celebrating .coopi-eyes-happy { opacity: 1; }

.arm-rest {
  transform-origin: 0 0;
  transform: translate(84px, 286px) rotate(12deg);
}
.arm-wave {
  transform-origin: 0 0;
  transform: translate(298px, 286px) rotate(-34deg);
  animation: idleWave 7s ease-in-out infinite;
}

@keyframes idleWave {
  0%, 56%, 100% { transform: translate(298px, 286px) rotate(-34deg); }
  62% { transform: translate(298px, 286px) rotate(-58deg); }
  68% { transform: translate(298px, 286px) rotate(-26deg); }
  74% { transform: translate(298px, 286px) rotate(-54deg); }
  80% { transform: translate(298px, 286px) rotate(-34deg); }
}

.coopi-whistle-body {
  transform-box: fill-box;
  transform-origin: 50% 0%;
  animation: whistleSway 3.4s ease-in-out infinite;
}
@keyframes whistleSway {
  0%, 100% { transform: rotate(3deg); }
  50% { transform: rotate(-5deg); }
}

.coopi-sparkles { opacity: 0; }
.mascot.is-celebrating .coopi-sparkles { opacity: 1; }
.coopi-sparkles .spark {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: sparkPulse 1.5s ease-in-out infinite;
}
.coopi-sparkles .spark:nth-child(2) { animation-delay: 0.25s; }
.coopi-sparkles .spark:nth-child(3) { animation-delay: 0.55s; }
.coopi-sparkles .spark:nth-child(4) { animation-delay: 0.8s; }
.coopi-sparkles .spark:nth-child(5) { animation-delay: 1.05s; }

@keyframes sparkPulse {
  0%, 100% { opacity: 0; }
  35% { opacity: 1; }
  65% { opacity: 0.25; }
}

/* Spin state — energetic twirl synced with the wheel duration */
.mascot.is-spinning .coopi-svg {
  animation: coopiTwirl var(--twirl-duration, 6.6s) cubic-bezier(0.15, 0.62, 0.07, 1) both;
  transform-origin: 50% 58%;
  filter: none;
}
.mascot.is-spinning .arm-wave,
.mascot.is-spinning .coopi-bob,
.mascot.is-spinning .coopi-shadow { animation-play-state: paused; }

@keyframes coopiTwirl {
  0% { transform: rotateZ(0deg) scale(1); }
  42% { transform: rotateZ(330deg) scale(1.045); }
  72% { transform: rotateZ(560deg) scale(1.015); }
  100% { transform: rotateZ(720deg) scale(1); }
}

.spin-streaks {
  position: absolute;
  inset: 2% -6%;
  z-index: 0;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  background: repeating-conic-gradient(from 0deg, rgba(255, 208, 90, 0.55) 0deg 2deg, transparent 2deg 17deg);
  -webkit-mask-image: radial-gradient(closest-side, transparent 56%, #000 66%, transparent 94%);
  mask-image: radial-gradient(closest-side, transparent 56%, #000 66%, transparent 94%);
  filter: blur(1px);
  transition: opacity 0.3s;
}
.mascot.is-spinning .spin-streaks { opacity: 0.5; animation: streakSpin 1s linear infinite; }
@keyframes streakSpin { to { transform: rotate(360deg); } }

/* Celebration state */
.mascot.is-celebrating .coopi-svg {
  animation: cheerJump 0.64s cubic-bezier(0.32, 1.4, 0.5, 1) infinite;
  transform-origin: 50% 92%;
}
@keyframes cheerJump {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  34% { transform: translateY(-26px) rotate(-2deg); }
  58% { transform: translateY(-7px) rotate(2deg); }
}
.mascot.is-celebrating .coopi-bob { animation-duration: 0.64s; }
.mascot.is-celebrating .coopi-shadow { animation-duration: 0.64s; }
.mascot.is-celebrating .arm-rest { animation: cheerLeft 0.62s ease-in-out infinite alternate; }
.mascot.is-celebrating .arm-wave { animation: cheerRight 0.62s ease-in-out infinite alternate; }
.mascot.is-celebrating .coopi-eye { animation: none; }
.mascot.is-celebrating .coopi-whistle-body { animation-duration: 0.62s; }

@keyframes cheerLeft {
  from { transform: translate(84px, 284px) rotate(142deg); }
  to { transform: translate(84px, 284px) rotate(160deg); }
}
@keyframes cheerRight {
  from { transform: translate(298px, 286px) rotate(-138deg); }
  to { transform: translate(298px, 286px) rotate(-160deg); }
}

/* --------------------------------------------------------------------------
   Admin drawer
   -------------------------------------------------------------------------- */

.scrim {
  position: fixed;
  inset: 0;
  z-index: 85;
  background: rgba(2, 6, 16, 0.6);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}
.scrim.is-open { opacity: 1; visibility: visible; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  width: min(600px, 100vw);
  height: 100%;
  background: linear-gradient(180deg, #0a1738 0%, #071127 100%);
  border-left: 1px solid rgba(255, 208, 90, 0.16);
  box-shadow: -34px 0 80px rgba(0, 0, 0, 0.55);
  transform: translateX(102%);
  visibility: hidden;
  transition: transform 0.38s var(--ease-out), visibility 0.38s;
}
.drawer.is-open { transform: none; visibility: visible; }

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 26px 16px;
  border-bottom: 1px solid var(--line);
}
.drawer-head h2 { font-size: 22px; font-weight: 800; margin-top: 2px; }
.drawer-head-actions { display: flex; align-items: center; gap: 8px; flex: none; }

.tabs {
  display: flex;
  gap: 4px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.tab {
  position: relative;
  padding: 13px 14px 14px;
  border: none;
  background: none;
  color: var(--text-faint);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}
.tab::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: transparent;
  transition: background 0.2s;
}
.tab:hover { color: var(--ice-100); }
.tab.is-active { color: #fff; }
.tab.is-active::after { background: var(--gold-500); }

.tab-badge {
  display: inline-grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  margin-left: 4px;
  border-radius: 999px;
  background: rgba(255, 208, 90, 0.16);
  color: var(--gold-400);
  font-size: 10.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.drawer-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 24px 30px;
}

.tab-panel[hidden] { display: none; }

/* Dropzone */

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 20px 20px;
  border: 1.5px dashed rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.025);
  text-align: center;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
  cursor: pointer;
}
.dropzone:hover,
.dropzone:focus-visible { border-color: rgba(255, 208, 90, 0.55); background: rgba(255, 208, 90, 0.04); }
.dropzone.is-dragover {
  border-color: var(--gold-500);
  background: rgba(255, 208, 90, 0.08);
  transform: scale(1.006);
}
.dropzone-icon { width: 38px; height: 38px; color: var(--gold-400); }
.dropzone-text { display: flex; flex-direction: column; gap: 3px; }
.dropzone-text strong { font-size: 14.5px; }
.dropzone-text span { font-size: 11.5px; color: var(--text-faint); }
.dropzone-text .dropzone-limit {
  color: var(--gold-400);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.inline-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding: 0 2px;
}

/* Summary */

.summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 18px;
}
.summary[hidden] { display: none; }
.summary-stat {
  padding: 12px 12px 10px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}
.summary-stat span {
  display: block;
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.summary-stat label {
  display: block;
  margin-top: 3px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.summary-stat.is-ok span { color: var(--ok); }
.summary-stat.is-warn span { color: var(--warn); }

.warning-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 13px;
  border-radius: 12px;
  border: 1px solid rgba(255, 190, 85, 0.3);
  background: rgba(255, 190, 85, 0.07);
  color: #ffd894;
  font-size: 12px;
  line-height: 1.4;
}
.warning-banner[hidden] { display: none; }
.warning-banner svg { width: 17px; height: 17px; flex: none; }
.warning-banner span { flex: 1; }

/* Table tools */

.table-tools {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}
.search-box {
  position: relative;
  display: flex;
  align-items: center;
}
.search-box svg {
  position: absolute;
  left: 12px;
  width: 15px;
  height: 15px;
  color: var(--text-faint);
  pointer-events: none;
}
.search-box input {
  width: 100%;
  padding: 10px 12px 10px 35px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.search-box input::placeholder { color: var(--text-faint); }
.search-box input:focus { border-color: rgba(255, 208, 90, 0.45); background: rgba(255, 255, 255, 0.06); }

.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-faint);
  font-size: 11.5px;
  font-weight: 700;
  transition: all 0.18s;
}
.chip:hover { color: var(--ice-100); border-color: var(--line-strong); }
.chip.is-active {
  background: rgba(255, 208, 90, 0.12);
  border-color: rgba(255, 208, 90, 0.4);
  color: var(--gold-400);
}

/* Table */

.table-wrap {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: auto;
  max-height: min(42vh, 430px);
  background: rgba(255, 255, 255, 0.015);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 10px;
  text-align: left;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-faint);
  background: #0a1837;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background 0.15s; }
.data-table tbody tr:hover { background: rgba(255, 255, 255, 0.035); }
.data-table tbody tr.is-off td { opacity: 0.62; }

.th-check { width: 56px; }
.th-x { width: 40px; }

.cell-ticket {
  font-family: "Cascadia Mono", "Consolas", ui-monospace, monospace;
  font-weight: 700;
  font-size: 12px;
  color: var(--gold-400);
  white-space: nowrap;
}
.cell-name { font-weight: 600; color: var(--ice-50); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-status { display: flex; flex-wrap: wrap; gap: 4px; }

.check {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  cursor: pointer;
}
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check span {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  place-items: center;
  transition: all 0.15s;
}
.check span::after {
  content: "";
  width: 9px;
  height: 5px;
  border-left: 2px solid #0a1633;
  border-bottom: 2px solid #0a1633;
  transform: rotate(-45deg) translateY(-1px);
  opacity: 0;
}
.check input:checked + span { background: var(--gold-500); border-color: var(--gold-500); }
.check input:checked + span::after { opacity: 1; }
.check input:focus-visible + span { outline: 2px solid var(--gold-500); outline-offset: 2px; }
.check input:disabled + span { opacity: 0.35; cursor: not-allowed; }
.check.is-disabled { cursor: not-allowed; }

.chip-status {
  display: inline-flex;
  align-items: center;
  padding: 2.5px 7px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
  white-space: nowrap;
}
.chip-status.is-ok { color: var(--ok); background: rgba(91, 214, 168, 0.09); border-color: rgba(91, 214, 168, 0.24); }
.chip-status.is-warn { color: var(--warn); background: rgba(255, 190, 85, 0.09); border-color: rgba(255, 190, 85, 0.26); }
.chip-status.is-muted { color: var(--text-dim); background: rgba(255, 255, 255, 0.05); border-color: var(--line); }
.chip-status.is-drawn { color: var(--gold-400); background: rgba(255, 208, 90, 0.08); border-color: rgba(255, 208, 90, 0.3); }

.row-del {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-faint);
  transition: color 0.15s, background 0.15s;
}
.row-del:hover { color: var(--warn); background: rgba(255, 190, 85, 0.1); }
.row-del svg { width: 15px; height: 15px; }

.table-empty {
  padding: 34px 20px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-faint);
}
.table-empty[hidden] { display: none; }

.table-foot {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-faint);
  text-align: right;
}

.panel-note {
  margin-top: 10px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-faint);
}

/* Settings */

.field { margin-bottom: 22px; }
.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.field input[type="text"] {
  width: 100%;
  padding: 11px 14px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.field input[type="text"]:focus { border-color: rgba(255, 208, 90, 0.45); background: rgba(255, 255, 255, 0.06); }

.hint { margin-top: 7px; font-size: 11.5px; color: var(--text-faint); line-height: 1.5; }

.logo-row { display: flex; align-items: center; gap: 14px; }
.logo-preview {
  display: grid;
  place-items: center;
  width: 132px;
  height: 62px;
  padding: 8px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  flex: none;
}
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.setting-copy strong { display: block; font-size: 14px; font-weight: 700; }
.setting-copy span { display: block; margin-top: 3px; font-size: 11.5px; color: var(--text-faint); max-width: 38ch; line-height: 1.5; }

.switch { position: relative; flex: none; width: 46px; height: 26px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--line);
  transition: background 0.22s, border-color 0.22s;
}
.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #c7d3ee;
  transition: transform 0.22s var(--ease-out), background 0.22s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.switch input:checked + .switch-track { background: var(--gold-500); border-color: var(--gold-500); }
.switch input:checked + .switch-track::after { transform: translateX(20px); background: #0a1633; }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--gold-500); outline-offset: 2px; }

.settings-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.shortcuts { margin-top: 24px; }
.shortcuts h4 {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 8px;
}
.shortcuts div { display: flex; align-items: center; gap: 12px; padding: 4px 0; font-size: 12px; color: var(--text-dim); }
kbd {
  display: inline-block;
  min-width: 26px;
  padding: 3px 7px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  background: rgba(255, 255, 255, 0.05);
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 700;
  text-align: center;
  color: var(--ice-100);
}

.privacy-note {
  display: flex;
  gap: 9px;
  margin-top: 22px;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid rgba(91, 214, 168, 0.22);
  background: rgba(91, 214, 168, 0.05);
  font-size: 11px;
  line-height: 1.6;
  color: #a9d9c8;
}
.privacy-note svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }

/* History */

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.history-head-copy strong { display: block; font-size: 17px; font-weight: 800; }
.history-head-copy span { font-size: 11px; color: var(--text-faint); }
.history-head-actions { display: flex; align-items: center; gap: 12px; }

.history-list { display: flex; flex-direction: column; gap: 8px; }

.history-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  animation: histIn 0.3s var(--ease-out);
}
@keyframes histIn { from { opacity: 0; transform: translateY(5px); } }

.hist-seq {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 208, 90, 0.12);
  border: 1px solid rgba(255, 208, 90, 0.28);
  color: var(--gold-400);
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.hist-main { min-width: 0; }
.hist-main strong { display: block; font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-main span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--gold-400);
  font-family: "Cascadia Mono", "Consolas", ui-monospace, monospace;
}
.history-item time { font-size: 10.5px; color: var(--text-faint); white-space: nowrap; }

.history-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 50px 20px;
  color: var(--text-faint);
}
.history-empty[hidden] { display: none; }
.history-empty svg { width: 44px; height: 44px; color: rgba(255, 208, 90, 0.35); margin-bottom: 12px; }
.history-empty h3 { font-size: 16px; color: var(--text-dim); font-weight: 700; }
.history-empty p { margin-top: 4px; font-size: 12px; max-width: 30ch; }

/* --------------------------------------------------------------------------
   Winner screen
   -------------------------------------------------------------------------- */

.winner-screen {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 40px;
  background:
    radial-gradient(120% 90% at 50% -16%, #1c3f8f 0%, #0b1b44 42%, #040b1e 100%);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s;
}
.winner-screen.is-open { opacity: 1; visibility: visible; }

.winner-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.winner-rays {
  position: absolute;
  inset: -35%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 208, 90, 0.16) 0deg 5deg, transparent 5deg 17deg);
  -webkit-mask-image: radial-gradient(circle at center, #000 0%, transparent 62%);
  mask-image: radial-gradient(circle at center, #000 0%, transparent 62%);
  animation: raySpin 110s linear infinite;
  opacity: 0.55;
  pointer-events: none;
}
@keyframes raySpin { to { transform: rotate(360deg); } }

.winner-glow {
  position: absolute;
  right: 8%;
  top: 52%;
  width: 60vw;
  height: 60vw;
  max-width: 900px;
  max-height: 900px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 196, 60, 0.2), transparent 62%);
  filter: blur(30px);
  pointer-events: none;
}

.winner-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
  align-items: center;
  gap: clamp(20px, 4vw, 70px);
  width: min(1480px, 100%);
}

.winner-copy { min-width: 0; }

.winner-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.32em;
  color: var(--gold-500);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.winner-brand-line { width: 34px; height: 1px; background: rgba(255, 208, 90, 0.45); }

.winner-title {
  font-size: clamp(64px, 9.6vw, 158px);
  font-weight: 900;
  line-height: 0.88;
  letter-spacing: -0.015em;
  background: linear-gradient(180deg, #fff4c6 4%, #ffd257 44%, #e9a013 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 14px 34px rgba(255, 186, 30, 0.18));
  text-transform: uppercase;
}
.winner-bang { color: var(--gold-500); -webkit-text-fill-color: var(--gold-500); }

.winner-ticket {
  display: inline-block;
  margin: 22px 0 14px;
  padding: 0.14em 0.5em 0.18em;
  border-radius: 16px;
  background: #ffffff;
  color: var(--navy-800);
  font-size: clamp(28px, 3vw, 46px);
  font-weight: 900;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 4px rgba(255, 208, 90, 0.9), 0 14px 34px rgba(0, 0, 0, 0.35);
}

.winner-name {
  font-size: clamp(40px, 5.2vw, 92px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.015em;
  color: #fff;
  text-wrap: balance;
  overflow-wrap: anywhere;
  text-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
}

.winner-meta {
  margin-top: 14px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.winner-note {
  display: inline-block;
  margin-top: 14px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 208, 90, 0.4);
  background: rgba(255, 208, 90, 0.08);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-400);
}
.winner-note[hidden] { display: none; }

.winner-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.winner-mascot {
  width: min(100%, 480px);
  aspect-ratio: 380 / 440;
  justify-self: center;
  filter: drop-shadow(0 30px 50px rgba(0, 0, 0, 0.4));
}
.winner-mascot .mascot { width: 100%; height: 100%; }

.winner-screen.is-open .winner-title { animation: winnerPop 0.7s cubic-bezier(0.2, 1.2, 0.3, 1) both; }
.winner-screen.is-open .winner-ticket { animation: winnerRise 0.6s 0.12s var(--ease-out) both; }
.winner-screen.is-open .winner-name { animation: winnerRise 0.6s 0.2s var(--ease-out) both; }
.winner-screen.is-open .winner-meta,
.winner-screen.is-open .winner-note { animation: winnerRise 0.6s 0.28s var(--ease-out) both; }
.winner-screen.is-open .winner-actions { animation: winnerRise 0.6s 0.34s var(--ease-out) both; }
.winner-screen.is-open .winner-mascot { animation: winnerRise 0.7s 0.16s var(--ease-out) both; }
.winner-screen.is-open .winner-brand { animation: winnerRise 0.5s 0.05s var(--ease-out) both; }

@keyframes winnerRise {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: none; }
}
@keyframes winnerPop {
  0% { opacity: 0; transform: scale(0.86); }
  60% { opacity: 1; transform: scale(1.02); }
  100% { transform: none; }
}

#confettiCanvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Modal + toasts
   -------------------------------------------------------------------------- */

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 6, 16, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal-layer[hidden] { display: none; }

.modal {
  width: min(440px, 100%);
  padding: 26px;
  border-radius: 20px;
  border: 1px solid rgba(255, 208, 90, 0.2);
  background: linear-gradient(180deg, #0c1a3c, #071127);
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.6);
  animation: modalIn 0.25s var(--ease-out);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } }

.modal-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: rgba(255, 190, 85, 0.1);
  border: 1px solid rgba(255, 190, 85, 0.28);
  color: var(--warn);
}
.modal-icon svg { width: 22px; height: 22px; }

.modal h3 { font-size: 19px; font-weight: 800; }
.modal p { margin-top: 8px; font-size: 13px; line-height: 1.6; color: var(--text-dim); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

.toast-stack {
  position: fixed;
  left: 22px;
  bottom: 22px;
  z-index: 130;
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: min(390px, calc(100vw - 44px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 15px;
  border-radius: 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--royal-400);
  background: rgba(9, 20, 42, 0.96);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  animation: toastIn 0.3s var(--ease-out);
  transition: opacity 0.25s, transform 0.25s;
}
.toast.is-leaving { opacity: 0; transform: translateY(8px); }
.toast p { font-size: 12.5px; line-height: 1.5; color: var(--ice-100); }
.toast-dot {
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--royal-400);
}
.toast-success { border-left-color: var(--ok); }
.toast-success .toast-dot { background: var(--ok); }
.toast-warn { border-left-color: var(--warn); }
.toast-warn .toast-dot { background: var(--warn); }
.toast-error { border-left-color: var(--danger-soft); }
.toast-error .toast-dot { background: var(--danger-soft); }

@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

.noscript {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  place-items: center;
  background: var(--navy-900);
  color: var(--text);
  font-size: 18px;
  padding: 30px;
  text-align: center;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1240px) {
  .topbar-title { display: none; }
}

@media (max-width: 1024px) {
  .stage { grid-template-columns: minmax(0, 1fr) 300px; gap: 10px; padding: 12px 18px 18px; }
  .topbar { padding: 10px 18px; }
  .brand-text .tagline { display: none; }
  .mascot-stage { height: min(38svh, 340px); }
  .speech { max-width: 230px; font-size: 12.5px; }
  .btn-spin { width: min(280px, 70vw); }
}

@media (max-width: 860px) {
  body { overflow: auto; }
  .app { min-height: 100svh; height: auto; }
  .stage {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    min-height: 0;
    padding: 10px 16px 30px;
  }
  .topbar { gap: 10px; flex-wrap: wrap; padding: 10px 14px; }
  .brand { flex: 0 1 auto; }
  .topbar-actions { flex: 0 1 auto; margin-left: auto; gap: 6px; }
  .pill-entries { display: none; }
  .btn-admin { padding: 9px 12px; }
  .wheel-stage { min-height: 0; padding: 6px 0 0; }
  .wheel-tilt { width: min(86vw, 560px); }
  .wheel-pedestal { width: min(86vw, 560px); }
  .mascot-rail { flex-direction: column; justify-content: flex-start; align-items: center; gap: 0; padding: 0; margin-top: 6px; }
  .speech { position: relative; top: auto; left: auto; transform: none; width: auto; margin: 0 auto 4px; max-width: min(290px, 80vw); }
  .mascot-stage { height: min(26svh, 210px); }
  .mascot-caption { display: none; }
  .mascot-rail .controls { margin-top: 10px; }
  .stage-meta { font-size: 10.5px; gap: 8px; }
  .empty-card { padding: 24px 22px 20px; }
  .empty-card h2 { font-size: 20px; }
  .empty-card p { font-size: 12.5px; }
  .winner-screen { padding: 26px 18px; align-items: start; }
  .winner-inner { grid-template-columns: 1fr; text-align: center; gap: 22px; }
  .winner-brand { justify-content: center; }
  .winner-ticket { margin-top: 16px; }
  .winner-actions { justify-content: center; }
  .winner-mascot { width: min(64vw, 300px); order: -1; }
  .winner-meta, .winner-name, .winner-ticket { text-align: center; }
}

@media (max-width: 560px) {
  .wordmark { font-size: 19px; }
  .brand-logo { height: 42px; min-width: 64px; padding: 4px 8px; }
  .brand-logo img { max-height: 30px; }
  .topbar-actions .icon-btn { width: 36px; height: 36px; }
  .btn-admin { font-size: 0; gap: 0; padding: 9px 11px; }
  .btn-admin .icon { width: 20px; height: 20px; }
  .wheel-tilt { width: min(92vw, 520px); }
  .wheel-pedestal { width: min(92vw, 520px); }
  .btn-spin { width: min(280px, 84vw); gap: 10px; padding: 10px 18px 11px; }
  .btn-spin-label { font-size: 25px; }
  .btn-spin-star { font-size: 15px; }
  .stage-meta .meta-dot { display: none; }
  .stage-meta { flex-direction: row; flex-wrap: wrap; gap: 6px 12px; }
  .mascot-rail { flex-direction: column; }
  .mascot-stage { height: 180px; }
  .speech { position: relative; top: auto; left: auto; transform: none; width: auto; max-width: min(290px, 80vw); margin: 0 auto 2px; }
  .winner-title { font-size: clamp(56px, 18vw, 82px); }
  .winner-name { font-size: clamp(32px, 10vw, 52px); }
  .winner-ticket { font-size: 26px; }
  .winner-actions .btn { flex: 1 1 auto; }
  .drawer-body { padding: 16px 16px 26px; }
  .drawer-head { padding: 18px 18px 12px; }
  .summary { grid-template-columns: repeat(2, 1fr); }
  .table-wrap { max-height: 40vh; }
  .empty-card { width: 100%; }
  .toast-stack { left: 12px; bottom: 12px; width: calc(100vw - 24px); }
}

@media (max-height: 700px) and (min-width: 861px) {
  .topbar { min-height: 60px; padding-top: 8px; padding-bottom: 8px; }
  .brand-logo { height: 42px; }
  .wheel-tilt, .wheel-pedestal { width: min(calc(100svh - 150px), 62vw, 820px, 100%); }
  .mascot-stage { height: min(36svh, 300px); }
  .btn-spin { padding: 9px 24px 10px; }
  .btn-spin-label { font-size: 26px; }
  .btn-spin-sub { font-size: 8.5px; }
  .stage { padding-bottom: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .wheel-tilt { transform: none !important; }
}
