@import url("bluwhale-assets/fonts.css");

:root {
  color-scheme: dark;
  font-family: Inter, system-ui, sans-serif;
  color: #eaf2ff;
  background: #0b101a;
  --muted: #a6b6cc;
  --line: #27364c;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; background: radial-gradient(ellipse at 42% 40%, #122443 0%, transparent 63%); }
#fluid { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; }
.site-header {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  margin: 0 auto; max-width: 1120px; padding: 22px clamp(18px, 4vw, 40px); border-bottom: 1px solid var(--line);
}
.site-header img { width: clamp(104px, 20vw, 144px); height: auto; display: block; }
.invite {
  display: inline-flex; gap: 8px; align-items: center; padding: 10px 14px; border-radius: 9px;
  background: #24294d; color: #f0f1ff; border: 1px solid #414976;
  font-size: .88rem; font-weight: 700; text-decoration: none; white-space: nowrap;
}
.invite:hover { background: #323966; }
:focus-visible { outline: 2px solid #9cceff; outline-offset: 4px; }
main { max-width: 1040px; margin: auto; padding: clamp(24px, 5vw, 48px) clamp(16px, 4vw, 40px) 36px; }
.intro { text-align: center; margin-bottom: clamp(22px, 4vw, 40px); }
h1, h2, h3, p { margin: 0; }
h1 { font-family: Sora, Inter, sans-serif; font-size: clamp(2.2rem, 5.2vw, 4rem); line-height: 1.02; letter-spacing: -.055em; }
.intro p { margin-top: 11px; color: var(--muted); line-height: 1.5; }
.layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(245px, 1fr); gap: clamp(24px, 5vw, 64px); align-items: center; }
.wheel-panel { min-width: 0; text-align: center; }
.wheel-stage { max-width: 500px; width: 100%; margin: 10px auto 0; position: relative; aspect-ratio: 1; }
.wheel-frame {
  width: 100%; height: 100%; border-radius: 50%; padding: 6px;
  border: 1px solid #496687; background: #080f1b; box-shadow: 0 12px 46px #0007, inset 0 0 0 3px #172941;
}
#wheel { width: 100%; height: 100%; display: block; will-change: transform; }
.pointer { position: absolute; left: 50%; top: -11px; width: 34px; transform: translateX(-50%); }
.pointer svg { display: block; width: 100%; transform-origin: 50% 29.545%; }
#spin-button {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 21%; aspect-ratio: 1;
  border-radius: 50%; background: #0b172d; border: 2px solid #98c8ff; color: #f4f8ff;
  box-shadow: 0 5px 18px #0008; font: 700 clamp(.86rem, 2.1vw, 1.12rem) Inter, sans-serif; cursor: pointer;
}
#spin-button:hover:enabled { background: #1a365f; }
#spin-button:disabled { cursor: wait; }
#prize-dialog {
  box-sizing: border-box; width: min(360px, calc(100% - 32px)); max-height: calc(100% - 32px);
  padding: 28px 24px 24px; border: 1px solid #527499; border-radius: 18px;
  text-align: center; color: #eaf2ff;
  background: radial-gradient(ellipse at top, #1b3150, #101a2b 63%);
  box-shadow: 0 20px 64px #030711b3;
}
#prize-dialog[open] { animation: prize-enter .2s ease-out both; }
#prize-dialog::backdrop { background: #050b169e; }
#prize-title { color: #bed2ea; font-size: 1rem; }
#prize-amount { margin: 9px 0 23px; font: 700 clamp(2.25rem, 12vw, 3.4rem)/1.08 Sora, Inter, sans-serif; }
#prize-dialog button {
  min-width: 104px; padding: 9px 20px; border: 1px solid #678ab5;
  border-radius: 9px; background: #24456c; color: #f3f8ff; font: 700 .9rem Inter, sans-serif; cursor: pointer;
}
#prize-dialog button:hover { background: #335c8b; }
@keyframes prize-enter {
  from { opacity: 0; transform: translateY(7px) scale(.98); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  #prize-dialog[open] { animation: none; }
}
#jackpot {
  position: fixed; z-index: 10; inset: 0; display: grid; place-items: center;
  pointer-events: none; overflow: clip; isolation: isolate; padding: 16px;
}
#jackpot[hidden] { display: none; }
#jackpot::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, #071327df 0%, #060d1af0 65%, #030711f7);
  animation: jackpot-screen 3.3s both;
}
.jackpot-aura {
  position: absolute; inset: 0; mix-blend-mode: screen;
  animation: jackpot-smoke 3.3s both;
}
.jackpot-aura img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.jackpot-title {
  position: relative; display: grid; gap: 10px; text-align: center; white-space: nowrap;
  text-shadow: 0 0 26px #1c7af28a, 0 3px 12px #04091b;
  animation: jackpot-title 3.3s both;
}
.jackpot-title span { color: #ffe0a3; letter-spacing: .26em; text-transform: uppercase; font-weight: 750; font-size: clamp(.75rem, 2vw, 1.15rem); }
.jackpot-title strong { font: 700 clamp(2.5rem, min(12vw, 15vh), 7rem)/1.05 Sora, Inter, sans-serif; color: #f3faff; }
@keyframes jackpot-screen { 0%, 100% { opacity: 0; } 10%, 82% { opacity: 1; } }
@keyframes jackpot-smoke { 0%, 88% { opacity: 1; } 100% { opacity: 0; } }
@keyframes jackpot-title {
  0%, 17% { opacity: 0; transform: translateY(10px) scale(.96); }
  32%, 86% { opacity: 1; transform: none; }
  100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  #jackpot::before, .jackpot-title { animation: none; }
  .jackpot-aura { display: none; }
}
#spin-result { margin: 16px 0 5px; font-size: 1.18rem; font-weight: 700; min-height: 1.5em; }
.preview-note, .reset { color: var(--muted); font-size: .82rem; line-height: 1.45; }
.wheel-action { margin-top: 12px; padding: 8px 13px; border: 1px solid #395476; border-radius: 8px; background: #182e4a; color: inherit; font: inherit; cursor: pointer; }
.wheel-action:disabled { opacity: .5; cursor: default; }
.history { margin: 24px auto 0; max-width: 720px; }
.history ol { padding: 0; margin: 10px 0 0; list-style: none; max-height: 260px; overflow: auto; }
.history li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: baseline; gap: 12px; padding: 9px 0; border-top: 1px solid #28384d; }
.history li span { overflow-wrap: anywhere; }
.history time { font-size: .78rem; color: var(--muted); }
@media (max-width: 440px) { .history li { grid-template-columns: minmax(0, 1fr) auto; } .history time { grid-column: 1 / -1; } }
.rewards {
  background: #111a29; border: 1px solid var(--line); border-radius: 16px;
  padding: clamp(17px, 3vw, 28px); min-width: 0;
}
h2 { font-size: 1.35rem; }
table { width: 100%; border-collapse: collapse; margin-top: 9px; font-variant-numeric: tabular-nums; }
th, td { padding: 11px 0; text-align: left; border-bottom: 1px solid var(--line); }
th:last-child, td:last-child { text-align: right; }
th { color: var(--muted); font-size: .82rem; font-weight: 500; }
.swatch { display: inline-block; margin-right: 9px; width: .65rem; height: .65rem; border-radius: 50%; }
h3 { font-size: .98rem; margin-top: 22px; }
.prices { list-style: none; padding: 0; margin: 8px 0 11px; }
.prices li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: .9rem; }
.prices li span { color: var(--muted); }
@media (max-width: 690px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .wheel-stage { max-width: min(100%, 420px, 58dvh); }
  .rewards { width: 100%; max-width: 420px; margin-inline: auto; }
}
