:root {
  --gold: #e8c36a;
  --gold-2: #f6e2a7;
  --ink: #1a1208;
  --cream: #fff7e8;
  --glass: rgba(18, 10, 8, 0.58);
  --line: rgba(232, 195, 106, 0.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100%;
  font-family: "Be Vietnam Pro", system-ui, sans-serif;
  color: var(--cream);
  background: #120808;
}

.bg {
  position: fixed;
  inset: 0;
  background: url("/assets/bg-default.png") center / cover no-repeat;
}

.sparkles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 22%, rgba(255, 230, 160, 0.8), transparent),
    radial-gradient(1.5px 1.5px at 78% 18%, rgba(255, 230, 160, 0.55), transparent),
    radial-gradient(1px 1px at 64% 72%, rgba(255, 230, 160, 0.7), transparent),
    radial-gradient(1.5px 1.5px at 28% 78%, rgba(255, 230, 160, 0.45), transparent);
  animation: twinkle 4s ease-in-out infinite;
}

@keyframes twinkle {
  50% { opacity: 0.45; }
}

.stage {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 40px 7vw;
}
.stage.wheel-left { justify-content: flex-start; }
.stage.wheel-right { justify-content: flex-end; }

.account-btn {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 8;
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--gold-2);
  backdrop-filter: blur(12px);
  border-radius: 999px;
  padding: 10px 16px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.account-btn:hover { filter: brightness(1.08); }

.panel .kicker,
.modal-card .kicker {
  font-family: Cinzel, serif;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  font-size: 12px;
}

.panel h1 {
  font-family: Cinzel, serif;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.15;
  margin: 8px 0 10px;
  text-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}

.subtitle { color: rgba(255, 247, 232, 0.78); margin-bottom: 24px; }

.card {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px;
  backdrop-filter: blur(16px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.card label {
  display: block;
  margin-bottom: 14px;
}

.card label span,
.muted {
  display: block;
  font-size: 12px;
  color: rgba(255, 247, 232, 0.62);
  margin-bottom: 6px;
}

.card input {
  width: 100%;
  border: 1px solid rgba(232, 195, 106, 0.28);
  background: rgba(255, 247, 232, 0.08);
  color: var(--cream);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  outline: none;
}

.card input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(232, 195, 106, 0.18);
}

.btn-gold, .spin-btn {
  font: inherit;
  cursor: pointer;
}

.btn-gold {
  width: 100%;
  margin-top: 6px;
  border: 0;
  border-radius: 12px;
  padding: 13px 16px;
  font-weight: 700;
  color: var(--ink);
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  box-shadow: 0 10px 24px rgba(212, 160, 23, 0.28);
}

.btn-gold:hover { filter: brightness(1.06); }

.error {
  color: #ffb4b4;
  font-size: 13px;
  margin: 0 0 10px;
}

.player-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.player-head strong { font-size: 20px; }

.linkish {
  background: none;
  border: 0;
  color: var(--gold);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.stats div {
  background: rgba(255, 247, 232, 0.06);
  border: 1px solid rgba(232, 195, 106, 0.18);
  border-radius: 12px;
  padding: 10px;
}

.stats span { font-size: 11px; color: rgba(255, 247, 232, 0.55); }
.stats b { display: block; margin-top: 4px; font-size: 16px; }

.hint { font-size: 13px; color: rgba(255, 247, 232, 0.7); margin-bottom: 14px; }

.history ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.history li {
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 247, 232, 0.06);
}

.wheel-wrap {
  position: relative;
  width: min(560px, 88vw);
  aspect-ratio: 1;
  flex: 0 0 auto;
}

.wheel-glow {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 195, 106, 0.28), transparent 70%);
  filter: blur(12px);
}

#wheel {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.45));
}

.pointer {
  position: absolute;
  top: -6px;
  left: 50%;
  z-index: 3;
  width: 0;
  height: 0;
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-top: 36px solid #f6e2a7;
  transform: translateX(-50%);
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.4));
}

.spin-btn {
  position: absolute;
  z-index: 4;
  inset: 50% auto auto 50%;
  width: 92px;
  height: 92px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 4px solid #f8e7b0;
  color: var(--ink);
  font-family: Cinzel, serif;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: radial-gradient(circle at 35% 30%, #fff3cc, #d4a017 68%);
  box-shadow: inset 0 -8px 16px rgba(0, 0, 0, 0.18), 0 8px 18px rgba(0, 0, 0, 0.28);
}

.spin-btn:disabled {
  cursor: not-allowed;
  filter: grayscale(0.35);
  opacity: 0.72;
}

.spin-btn:not(:disabled):hover { transform: translate(-50%, -50%) scale(1.04); }

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(8, 4, 4, 0.62);
  padding: 24px;
}

.modal[hidden] { display: none; }

.modal-card {
  width: min(420px, 100%);
  text-align: center;
  background: #1b1010;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 32px 24px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.modal-card h2 {
  font-family: Cinzel, serif;
  font-size: 32px;
  margin: 10px 0 8px;
  color: var(--gold-2);
}

.join-card {
  text-align: left;
}

.join-card h2 { text-align: center; }
.join-card .muted { text-align: center; margin-bottom: 16px; }
.join-card label { display: block; margin-bottom: 14px; }
.join-card label span {
  display: block;
  font-size: 12px;
  color: rgba(255, 247, 232, 0.62);
  margin-bottom: 6px;
}
.join-card input {
  width: 100%;
  border: 1px solid rgba(232, 195, 106, 0.28);
  background: rgba(255, 247, 232, 0.08);
  color: var(--cream);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  outline: none;
}
.join-card input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(232, 195, 106, 0.18);
}
.join-card .linkish {
  display: block;
  width: 100%;
  margin-top: 10px;
  text-align: center;
}

@media (max-width: 900px) {
  .stage { padding: 24px 16px 48px; }
}
