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

:root {
  --navy: #01235b;
  --blue: #1c4a9f;
  --cyan: #00a3de;
  --sky: #7bc6ec;
  --pale: #e5f4fb;
}

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(circle at 50% 20%, var(--blue) 0%, var(--navy) 75%);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
}

.header {
  padding: 16px;
  background: #ffffff;
  width: 100%;
  display: flex;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(1, 35, 91, 0.3);
}
.header__logo { height: 44px; }

.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: 100%;
  padding: 12px;
}

.title {
  font-size: clamp(1.8rem, 4.5vw, 3rem);
  letter-spacing: 0.02em;
  text-shadow: 0 2px 8px rgba(1, 35, 91, 0.5);
}

.wheel-wrap {
  position: relative;
  width: min(78vw, 56vh);
  aspect-ratio: 1;
}

#wheel {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.35));
}

#slices {
  transform-box: view-box;
  transform-origin: 50% 50%;
}

.slice-label {
  /* font-size set inline per label by layoutLabel */
  font-weight: 700;
}

.pointer {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-top: 30px solid #ffffff;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
  z-index: 2;
}

.hub {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 27%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #ffffff;
  border: 4px solid var(--pale);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}
.hub img { width: 78%; }

.big-btn {
  font-size: clamp(1.3rem, 3vw, 2rem);
  font-weight: 800;
  padding: 14px 56px;
  border: none;
  border-radius: 999px;
  background: var(--cyan);
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(1, 35, 91, 0.6);
  letter-spacing: 0.08em;
}
.big-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(1, 35, 91, 0.6); }
.big-btn:disabled { opacity: 0.5; }

.small-btn {
  font-size: 1rem;
  font-weight: 700;
  padding: 8px 24px;
  border: none;
  border-radius: 999px;
  background: var(--blue);
  color: #ffffff;
  cursor: pointer;
}

.link-btn {
  background: none;
  border: none;
  color: var(--blue);
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.95rem;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(1, 35, 91, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.overlay.hidden { display: none; }
.overlay__card {
  background: #ffffff;
  color: var(--navy);
  border-radius: 24px;
  padding: 40px 48px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 90vw;
}
.overlay__eyebrow { font-size: 1.2rem; }
.overlay__prize { font-size: clamp(2rem, 6vw, 3.4rem); font-weight: 800; color: var(--blue); }
.overlay .link-btn { color: #9aa7b8; }

#confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
}

.panel {
  border: none;
  border-radius: 16px;
  padding: 24px;
  min-width: 300px;
  color: var(--navy);
}
.panel--wide { width: min(560px, 94vw); }
.panel::backdrop { background: rgba(1, 35, 91, 0.6); }
.panel h2 { margin-bottom: 16px; }
.panel input {
  font-size: 1.1rem;
  padding: 8px 10px;
  border: 2px solid var(--pale);
  border-radius: 8px;
  width: 100%;
}
.panel__field { display: block; margin-top: 12px; font-weight: 600; }
.panel__actions {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 20px;
  align-items: center;
}

.prize-row {
  display: grid;
  grid-template-columns: 1fr 84px 52px 36px;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}
.prize-row input[type='color'] { padding: 2px; height: 40px; }
.prize-row .remove { color: #ad0000; }

#weight-total { margin: 8px 0 4px; font-weight: 700; }
#weight-total.bad { color: #ad0000; }

.errors { color: #ad0000; margin-top: 8px; white-space: pre-line; }
