:root {
  --bg: #0f172a;
  --card: rgba(15, 23, 42, 0.78);
  --text: #f8fafc;
  --muted: #94a3b8;
  --primary: #38bdf8;
  --primary-strong: #0284c7;
  --zone-big: #1e293b;
  --zone-small: #facc15;
  --ring: rgba(255, 255, 255, 0.12);
  --danger: #fb7185;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.22), transparent 35%),
    radial-gradient(circle at bottom right, rgba(250, 204, 21, 0.15), transparent 32%),
    var(--bg);
  display: grid;
  place-items: center;
  padding: 24px;
}

.app-shell { width: min(680px, 100%); }

.card {
  border: 1px solid var(--ring);
  background: var(--card);
  backdrop-filter: blur(18px);
  border-radius: 28px;
  padding: clamp(22px, 5vw, 42px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.hidden { display: none; }

.eyebrow {
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 800;
  margin: 0 0 10px;
}

h1 {
  font-size: clamp(2.1rem, 7vw, 4.2rem);
  line-height: 0.94;
  margin: 0;
}

.intro {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 18px 0 30px;
}

.choice-form {
  display: grid;
  gap: 18px;
}

.choice-field {
  position: relative;
  display: grid;
  gap: 9px;
  padding: 16px;
  border: 1px solid var(--ring);
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.62);
}

.choice-field span {
  color: var(--muted);
  font-weight: 700;
}

.choice-field.preferred {
  background:
    linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(250, 204, 21, 0.08)),
    rgba(15, 23, 42, 0.72);
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 0 26px rgba(56, 189, 248, 0.13);
  animation: softGlow 2.8s ease-in-out infinite;
}

@keyframes softGlow {
  0%, 100% { box-shadow: 0 0 18px rgba(56, 189, 248, 0.10); }
  50% { box-shadow: 0 0 34px rgba(56, 189, 248, 0.24); }
}

input {
  width: 100%;
  border: 0;
  outline: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 15px 16px;
  font-size: 1rem;
}

.primary-button,
.spin-button,
.ghost-button {
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  font-weight: 900;
}

.primary-button,
.spin-button {
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  padding: 16px 20px;
  font-size: 1.05rem;
  box-shadow: 0 16px 28px rgba(2, 132, 199, 0.25);
}

.ghost-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  padding: 10px 14px;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
}

.badge {
  color: var(--muted);
  font-size: 0.85rem;
  text-align: right;
}

.wheel-wrap {
  position: relative;
  width: min(74vw, 420px);
  aspect-ratio: 1;
  margin: 0 auto 28px;
}

.wheel {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 12px solid rgba(255, 255, 255, 0.12);
  background:
    radial-gradient(circle at center, rgba(255,255,255,0.10) 0 13%, transparent 14%),
    conic-gradient(
      from 162deg,
      var(--zone-small) 0deg 36deg,
      var(--zone-big) 36deg 360deg
    );
  box-shadow:
    inset 0 0 50px rgba(0, 0, 0, 0.35),
    0 20px 45px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  background-clip: padding-box;
}

.wheel::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -2px;
  width: 30%;
  height: 8px;
  transform: translateX(-50%);
  background: var(--zone-small);
  border-radius: 999px 999px 0 0;
  z-index: 2;
}

.wheel::after {
  content: "";
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  z-index: 3;
  pointer-events: none;
}

.zone-label {
  position: absolute;
  left: 50%;
  max-width: 40%;
  text-align: center;
  font-weight: 950;
  text-wrap: balance;
  text-shadow: 0 2px 7px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}

.big-zone-label {
  top: 28%;
  transform: translate(-50%, -50%);
  font-size: clamp(1.1rem, 4vw, 1.55rem);
}

.small-zone-label {
  bottom: 8%;
  left: 50%;
  width: 22%;
  max-width: 22%;
  transform: translateX(-50%);
  text-align: center;
  white-space: normal;
  overflow-wrap: break-word;
  font-size: clamp(0.7rem, 2vw, 0.9rem);
  line-height: 1.1;
}

.hub {
  position: absolute;
  width: 22%;
  aspect-ratio: 1;
  border-radius: 50%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #f8fafc, #94a3b8);
  border: 8px solid rgba(15, 23, 42, 0.86);
  z-index: 4;
}

.needle {
  position: absolute;
  inset: 0;
  transform: rotate(0deg);
  transition: none;
  z-index: 5;
}

.needle-line {
  position: absolute;
  left: calc(50% - 5px);
  top: 12%;
  width: 10px;
  height: 44%;
  border-radius: 999px;
  background: linear-gradient(#f8fafc, #fb7185);
  transform-origin: 50% 86%;
  box-shadow: 0 0 18px rgba(251, 113, 133, 0.45);
}

.needle-dot {
  position: absolute;
  width: 18px;
  aspect-ratio: 1;
  border-radius: 50%;
  left: calc(50% - 9px);
  top: calc(50% - 9px);
  background: #020617;
  border: 4px solid #f8fafc;
}

.spin-button {
  width: 100%;
}

.spin-button:disabled {
  opacity: 0.72;
  cursor: wait;
}

.result-text {
  min-height: 28px;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
  margin: 18px 0 0;
}

@media (max-width: 520px) {
  body { padding: 14px; }
  .card { border-radius: 22px; }
  .top-bar { align-items: flex-start; }
}
