:root {
  --bg: #f6f2ea;
  --bg-soft: #fffdf8;
  --text: #18120b;
  --muted: #5f574e;
  --accent: #007a61;
  --accent-deep: #005f4a;
  --border: #e0d7ca;
  --card: #ffffff;
  --shadow: 0 16px 34px rgba(36, 20, 0, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 18%, #f1d9bd 0%, transparent 39%),
    radial-gradient(circle at 84% 0%, #bfdcd3 0%, transparent 33%),
    var(--bg);
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
}

.wheel-shell {
  width: min(1200px, 94vw);
  margin: 0 auto;
  padding: 2rem 0 2.5rem;
}

.back-link {
  color: var(--accent-deep);
  text-decoration: none;
  font-size: 0.95rem;
}

.wheel-header {
  text-align: center;
  margin: 0.8rem 0 1.2rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.76rem;
  margin: 0;
  color: var(--muted);
}

h1 {
  margin: 0.3rem 0 0.7rem;
  line-height: 1.08;
  font-size: clamp(2rem, 4.2vw, 3rem);
}

.subtitle {
  margin: 0;
  color: var(--muted);
}

.wheel-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 1rem;
  align-items: start;
}

.control-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 1rem;
}

.control-card label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.control-card select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fdfcf8;
  color: #1f1f1f;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.9rem;
  padding: 0.55rem 0.6rem;
}

.button-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.primary-btn,
.ghost-btn {
  border-radius: 999px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  padding: 0.5rem 0.9rem;
}

.primary-btn {
  border: 1px solid var(--accent);
  color: #fff;
  background: var(--accent);
}

.ghost-btn {
  border: 1px solid var(--border);
  color: var(--text);
  background: #fff;
}

.settings-link {
  display: inline-block;
  margin-top: 0.8rem;
  color: var(--accent-deep);
  font-weight: 600;
  text-decoration: none;
}

.settings-link:hover,
.settings-link:focus-visible {
  text-decoration: underline;
}

.result-label {
  margin: 0.95rem 0 0.4rem;
  font-size: 0.79rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.result-text {
  margin: 0;
  min-height: 1.6rem;
  font-size: clamp(1.3rem, 3.4vw, 1.8rem);
  font-weight: 700;
  color: var(--accent-deep);
}

.wheel-stage {
  position: relative;
  display: grid;
  place-items: center;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.4));
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  min-height: 460px;
  padding: 1rem;
}

.pointer {
  position: absolute;
  top: 0.9rem;
  left: 50%;
  width: 0;
  height: 0;
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-top: 30px solid #111;
  transform: translateX(-50%);
  z-index: 3;
}

#wheelCanvas {
  display: block;
  width: min(82vw, 720px);
  max-width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
}

@media (max-width: 900px) {
  .wheel-layout {
    grid-template-columns: 1fr;
  }

  .wheel-stage {
    min-height: 300px;
    order: -1;
  }

  #wheelCanvas {
    width: min(88vw, 620px);
    aspect-ratio: 1 / 1;
    height: auto;
  }
}
