:root {
  color-scheme: light;
  --cream: #FFF1DB;
  --pink: #F83078;
  --pink-soft: #FFD7D9;
  --blue-soft: #BAEAFB;
  --orange: #FF8F31;
  --brown: #6B3012;
  --copy: #81543B;
  --white: #FFFFFF;
  --magenta: #B320A6;
  --card-shadow: 0 12px 30px rgba(107, 48, 18, .12);
  --card-radius: 30px;
  --button-radius: 18px;
  --font-body: "Nunito", "Trebuchet MS", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Arial Rounded MT Bold", "Nunito", "Trebuchet MS", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: var(--cream); }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--brown);
  background:
    radial-gradient(circle at 8% 23%, rgba(255, 215, 217, .72) 0 46px, transparent 47px),
    radial-gradient(circle at 95% 66%, rgba(186, 234, 251, .8) 0 66px, transparent 67px),
    var(--cream);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, a { font: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--magenta); outline-offset: 4px; }

.game-shell {
  width: min(100% - 28px, 620px);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 0 max(24px, env(safe-area-inset-bottom));
}
.back-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  color: var(--brown);
  font-size: .88rem;
  font-weight: 900;
  text-decoration: none;
}
.back-link span { color: var(--pink); font-size: 1.4rem; line-height: 1; }
.back-link:hover { text-decoration: underline; text-underline-offset: 4px; }

.game-header { position: relative; padding: 18px 12px 24px; text-align: center; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 0 12px;
  color: #B9634C;
  font-size: .66rem;
  font-weight: 1000;
  letter-spacing: .16em;
}
.eyebrow-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 0 4px rgba(248, 48, 120, .12); }
h1 {
  margin: 0;
  color: var(--brown);
  font-family: var(--font-display);
  font-size: clamp(2.45rem, 10vw, 4rem);
  font-weight: 1000;
  line-height: .98;
  letter-spacing: -.055em;
}
h1 span { display: block; color: var(--pink); text-shadow: 0 3px 0 rgba(255,255,255,.85); }
.intro { max-width: 390px; margin: 14px auto 0; color: var(--copy); font-size: .98rem; font-weight: 700; line-height: 1.5; }

.game-card {
  position: relative;
  overflow: hidden;
  padding: clamp(19px, 5vw, 30px);
  border: 2px solid rgba(255,255,255,.82);
  border-radius: var(--card-radius);
  background: rgba(255,255,255,.66);
  box-shadow: var(--card-shadow);
  text-align: center;
  isolation: isolate;
}
.game-card::before {
  position: absolute;
  z-index: -1;
  top: -62px;
  right: -58px;
  width: 148px;
  height: 148px;
  border-radius: 50%;
  background: rgba(255,215,217,.5);
  content: "";
}
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; text-align: left; }
.card-kicker { margin: 0 0 5px; color: var(--magenta); font-size: .62rem; font-weight: 1000; letter-spacing: .14em; }
.card-heading h2 { margin: 0; color: var(--brown); font-family: var(--font-display); font-size: clamp(1.25rem, 5vw, 1.65rem); line-height: 1.12; }
.wheel-sparkle { color: var(--orange); font-size: 2rem; line-height: 1; transform: rotate(12deg); }

.wheel-wrap {
  position: relative;
  width: min(100%, 430px);
  aspect-ratio: 1;
  margin: 26px auto 15px;
  padding: 12px;
  border: 3px solid rgba(255,255,255,.9);
  border-radius: 50%;
  background: #FFE6D0;
  box-shadow: 0 9px 0 rgba(107,48,18,.08), 0 15px 24px rgba(107,48,18,.12);
}
.flavor-wheel { display: block; width: 100%; height: 100%; border-radius: 50%; }
.wheel-pointer {
  position: absolute;
  z-index: 3;
  top: -7px;
  left: 50%;
  width: 34px;
  height: 43px;
  transform: translateX(-50%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  background: var(--pink);
  filter: drop-shadow(0 3px 1px rgba(107,48,18,.22));
}
.wheel-shadow { position: absolute; inset: 12px; border: 2px solid rgba(107,48,18,.08); border-radius: 50%; pointer-events: none; }

.demo-notice {
  max-width: 430px;
  margin: 0 auto 14px;
  padding: 9px 12px;
  border: 1px solid rgba(255,143,49,.42);
  border-radius: 12px;
  background: rgba(255,218,174,.55);
  color: #78471F;
  font-size: .74rem;
  font-weight: 800;
  line-height: 1.4;
}
.spin-button {
  position: relative;
  display: inline-flex;
  width: min(100%, 330px);
  min-height: 56px;
  align-items: center;
  justify-content: center;
  gap: 11px;
  padding: 14px 22px;
  border: 2px solid rgba(255,255,255,.9);
  border-radius: var(--button-radius);
  background: var(--pink);
  box-shadow: 0 6px 0 #C91F5D, 0 10px 17px rgba(248,48,120,.18);
  color: var(--white);
  cursor: pointer;
  font-size: .98rem;
  font-weight: 1000;
  letter-spacing: .08em;
  transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}
.spin-button:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 0 #C91F5D, 0 13px 19px rgba(248,48,120,.2); }
.spin-button:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 3px 0 #C91F5D; }
.spin-button:disabled { cursor: wait; opacity: .72; }
.button-spark { font-size: 1.1rem; color: #FFE89D; }
.helper-text { min-height: 21px; margin: 15px 0 0; color: var(--copy); font-size: .79rem; font-weight: 700; line-height: 1.4; }

.result-panel {
  margin: 20px auto 0;
  padding: 18px 14px 16px;
  border: 2px solid rgba(255,255,255,.9);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255,215,217,.76), rgba(186,234,251,.68));
  animation: result-pop .34s ease-out both;
}
.result-kicker { margin: 0 0 5px; color: var(--magenta); font-size: .62rem; font-weight: 1000; letter-spacing: .15em; }
.result-title { margin: 0; color: var(--pink); font-family: var(--font-display); font-size: clamp(1.75rem, 7vw, 2.5rem); line-height: 1.05; overflow-wrap: anywhere; }
.result-copy { margin: 8px 0 0; color: var(--brown); font-size: .9rem; font-weight: 800; line-height: 1.45; }
.game-note { max-width: 420px; margin: 19px auto 0; color: #92725F; font-size: .68rem; line-height: 1.45; }
.game-footer { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 19px 10px 0; color: #A48670; text-align: center; }
.game-footer span { color: var(--pink); font-size: 1.15rem; }
.game-footer p { margin: 0; font-size: .68rem; font-weight: 700; }

@keyframes result-pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
[hidden] { display: none !important; }

@media (max-width: 390px) {
  .game-shell { width: min(100% - 22px, 620px); }
  .game-header { padding-inline: 4px; }
  .game-card { padding: 17px 14px 19px; }
  .wheel-wrap { padding: 9px; margin-top: 22px; }
  .wheel-pointer { width: 29px; height: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
