:root {
  --bg1: #2b1e66;
  --bg2: #4b2fa3;
  --accent: #ffd166;
  --card: rgba(255, 255, 255, 0.10);
  --card-border: rgba(255, 255, 255, 0.22);
  --text: #ffffff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: "Nunito", system-ui, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 700px at 20% -10%, #6a3ff0 0%, transparent 60%),
              radial-gradient(1000px 800px at 110% 20%, #ff5f9e 0%, transparent 55%),
              linear-gradient(160deg, var(--bg1), var(--bg2) 55%, #1a1240);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.bg-bubbles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.14) 2px, transparent 2px),
    radial-gradient(circle, rgba(255,255,255,.10) 3px, transparent 3px);
  background-size: 140px 140px, 220px 220px;
  background-position: 0 0, 70px 90px;
  animation: drift 40s linear infinite;
  z-index: 0;
}

@keyframes drift {
  to { background-position: 140px 140px, -150px 310px; }
}

.top {
  position: relative;
  z-index: 2;
  padding: 18px 24px 0;
  display: flex;
  justify-content: center;
}

.brand {
  background: var(--card);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(8px);
  border-radius: 999px;
  padding: 10px 22px;
  display: flex;
  align-items: baseline;
  gap: 14px;
  box-shadow: 0 8px 30px rgba(0,0,0,.25);
}

.brand__logo {
  font-weight: 900;
  font-size: 20px;
  letter-spacing: .5px;
}
.brand__dot { color: var(--accent); }
.brand__sub {
  font-size: 13px;
  opacity: .8;
  font-weight: 700;
}

.stage {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 14px 16px 30px;
  text-align: center;
}

.title {
  margin: 6px 0 0;
  font-size: clamp(26px, 4.5vw, 44px);
  font-weight: 900;
  text-shadow: 0 6px 24px rgba(0,0,0,.35);
}
.title__accent {
  background: linear-gradient(90deg, #ffd166, #ff7ab8, #7af0ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.wheel-wrap {
  position: relative;
  width: min(92vw, 470px);
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
}

#wheel {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 18px 40px rgba(0,0,0,.45));
  transition: transform .2s ease;
}
#wheel.spinning { animation: wobble 1.1s ease-in-out infinite; }
@keyframes wobble {
  0%, 100% { transform: rotate(-.6deg); }
  50% { transform: rotate(.6deg); }
}

.pointer {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  font-size: clamp(34px, 7vw, 54px);
  color: #ff4d6d;
  text-shadow: 0 3px 0 #7a0f24, 0 8px 18px rgba(0,0,0,.5);
  z-index: 5;
  transition: transform .12s ease;
  line-height: 1;
}
.pointer.tick { transform: translateX(-50%) translateY(6px); }

.spin-btn {
  position: absolute;
  z-index: 6;
  width: clamp(96px, 22vw, 132px);
  height: clamp(96px, 22vw, 132px);
  border-radius: 50%;
  border: 6px solid #ffffff;
  cursor: pointer;
  font-family: inherit;
  font-weight: 900;
  font-size: clamp(18px, 3.6vw, 24px);
  color: #4b1f7a;
  background: radial-gradient(circle at 32% 28%, #fff3c4, var(--accent) 55%, #f4a300);
  box-shadow: 0 10px 0 #b87400, 0 18px 34px rgba(0,0,0,.45);
  transition: transform .1s ease, box-shadow .1s ease;
}
.spin-btn:hover:not(:disabled) { transform: translateY(-3px); box-shadow: 0 13px 0 #b87400, 0 22px 38px rgba(0,0,0,.5); }
.spin-btn:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 4px 0 #b87400, 0 10px 20px rgba(0,0,0,.4); }
.spin-btn:disabled { cursor: not-allowed; filter: grayscale(.35) brightness(.9); }

.result {
  min-height: 86px;
  width: min(94vw, 560px);
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 14px 18px;
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  box-shadow: 0 10px 30px rgba(0,0,0,.28);
}

.result__hint { font-size: 15px; opacity: .85; font-weight: 700; }

.result__emoji {
  font-size: clamp(34px, 6vw, 48px);
  line-height: 1.1;
  animation: pop .5s cubic-bezier(.2, 1.6, .4, 1);
}
.result__name {
  font-size: clamp(22px, 4.5vw, 32px);
  font-weight: 900;
  animation: pop .5s .05s backwards cubic-bezier(.2, 1.6, .4, 1);
}
.result__count {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}

@keyframes pop {
  from { transform: scale(.4); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.mini-btn {
  font-family: inherit;
  font-weight: 800;
  font-size: 14px;
  color: #fff;
  background: rgba(255,255,255,.12);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 9px 16px;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.mini-btn:hover { background: rgba(255,255,255,.22); transform: translateY(-2px); }

.scoreboard {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  width: min(94vw, 640px);
}

.score-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 14px;
  animation: pop .4s backwards cubic-bezier(.2, 1.6, .4, 1);
}
.score-card b { color: var(--accent); font-size: 18px; }
.score-card.zero { opacity: .5; }

.foot {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 12px;
  font-size: 13px;
  opacity: .75;
  font-weight: 700;
}
.foot a { color: var(--accent); text-decoration: none; }

.confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 40;
}
.confetti span {
  position: absolute;
  top: -20px;
  width: 12px;
  height: 18px;
  border-radius: 3px;
  animation: fall linear forwards;
}
@keyframes fall {
  to { transform: translateY(110vh) rotate(720deg); opacity: .9; }
}

@media (max-width: 480px) {
  .brand { flex-direction: column; gap: 2px; align-items: center; text-align: center; }
}
