:root {
  --bg-a: #0f1f2f;
  --bg-b: #172f49;
  --card: rgba(12, 24, 39, 0.7);
  --text: #eef5ff;
  --muted: #b7c6d8;
  --accent: #ffbe4d;
  --accent-2: #fe844d;
  --ok: #21c196;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Segoe UI", Tahoma, sans-serif;
  background: radial-gradient(circle at 15% 5%, #2c4f78 0%, #16283e 38%, #0e1b2b 100%);
  color: var(--text);
}

.app {
  width: min(100%, 520px);
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 14px max(16px, env(safe-area-inset-bottom));
}

.eyebrow {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

h1 {
  margin: 6px 0 8px;
  font-size: clamp(24px, 6vw, 33px);
}

.subtitle {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.35;
}

.wheel-wrap {
  position: relative;
  width: min(82vw, 300px);
  aspect-ratio: 1;
  margin: 0 auto 16px;
}

.pointer {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: -6px;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 0;
  border-bottom: 20px solid #ffd176;
  z-index: 2;
}

.wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 10px solid #f6c06f;
  background: conic-gradient(
    #ffc26b 0deg 45deg,
    #ff9f5f 45deg 90deg,
    #ffd77e 90deg 135deg,
    #ff9755 135deg 180deg,
    #ffca73 180deg 225deg,
    #f98a52 225deg 270deg,
    #ffd17a 270deg 315deg,
    #47c788 315deg 360deg
  );
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.35);
  position: relative;
  transition: transform 2.4s cubic-bezier(0.16, 0.9, 0.13, 0.99);
}

.wheel span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 78px;
  margin-left: -39px;
  margin-top: -114px;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  color: #1f2d40;
  line-height: 1.1;
  white-space: nowrap;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.22);
  transform-origin: 50% 114px;
}

.wheel span.jackpot {
  color: #fffbe7;
  font-size: 10px;
  letter-spacing: 0.3px;
  text-shadow: 0 0 6px rgba(255, 238, 171, 0.95);
}

.wheel span:nth-child(1) {
  transform: rotate(22.5deg);
}

.wheel span:nth-child(2) {
  transform: rotate(67.5deg);
}

.wheel span:nth-child(3) {
  transform: rotate(112.5deg);
}

.wheel span:nth-child(4) {
  transform: rotate(157.5deg);
}

.wheel span:nth-child(5) {
  transform: rotate(202.5deg);
}

.wheel span:nth-child(6) {
  transform: rotate(247.5deg);
}

.wheel span:nth-child(7) {
  transform: rotate(292.5deg);
}

.wheel span:nth-child(8) {
  transform: rotate(337.5deg);
}

.actions {
  display: grid;
  gap: 10px;
}

button {
  border: 0;
  border-radius: 12px;
  padding: 13px;
  font: inherit;
  font-weight: 700;
}

button:disabled {
  opacity: 0.5;
}

.primary {
  background: linear-gradient(120deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #15253c;
}

.secondary {
  background: linear-gradient(120deg, rgba(33, 193, 150, 0.3), rgba(33, 193, 150, 0.15));
  color: #dcfff5;
  border: 1px solid rgba(33, 193, 150, 0.5);
}

.result,
.debug {
  margin-top: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: var(--card);
  padding: 12px;
}

.result p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.debug pre {
  white-space: pre-wrap;
  font-size: 12px;
  color: #cde2ff;
}

.debug button {
  width: 100%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.hidden {
  display: none;
}
