* { box-sizing: border-box; }

body {
  margin: 0;
  background: #0a0806;
  color: #F2ECE2;
  font-family: 'Space Grotesk', 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.page { position: relative; display: flex; flex-direction: column; min-height: 100%; }
.container { width: 100%; max-width: 680px; margin: 0 auto; padding-inline: clamp(20px, 5vw, 40px); }

.scanlines {
  position: fixed; inset: 0; pointer-events: none; z-index: 50;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,0.035) 0px, rgba(255,255,255,0.035) 1px, transparent 1px, transparent 3px);
  mix-blend-mode: overlay;
  animation: scanDrift 9s linear infinite;
}
@keyframes scanDrift { 0% { background-position: 0 0; } 100% { background-position: 0 120px; } }

.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px clamp(20px, 5vw, 40px);
  background: #0a0806;
  border-bottom: 3px solid #2b2419;
}
.wordmark { font-family: 'Archivo Black', 'Arial Black', sans-serif; font-size: 20px; letter-spacing: -0.01em; }
.nav-ticker {
  font-family: 'IBM Plex Mono', monospace; font-size: 12px; letter-spacing: 0.04em;
  color: #A1C281; text-shadow: 0 0 6px #A1C281, 0 0 16px #A1C281;
}

.eyebrow {
  font-family: 'IBM Plex Mono', monospace; font-size: 12px; letter-spacing: 0.16em;
  text-transform: uppercase; color: #A1C281;
}
.hero-mini {
  padding-block: clamp(36px, 7vw, 64px) clamp(20px, 4vw, 32px);
  text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.h1 {
  font-family: 'Archivo Black', 'Arial Black', sans-serif;
  font-size: clamp(2rem, 6.5vw, 3.4rem);
  line-height: 1.02; margin: 0; max-width: 14ch;
}
.hero-sub { font-size: clamp(0.95rem, 2vw, 1.1rem); color: #C9BFAF; max-width: 46ch; margin: 0; line-height: 1.5; }

.wheel-section { padding-block: clamp(8px, 2vw, 16px) clamp(32px, 6vw, 56px); }

.cabinet {
  position: relative; background: #171209; border: 5px solid #060503; border-radius: 26px;
  padding: clamp(16px, 4vw, 30px);
  box-shadow: inset 0 0 50px rgba(0,0,0,0.85), 0 24px 60px rgba(0,0,0,0.55);
}
.cabinet::before {
  content: ''; position: absolute; inset: 10px; border-radius: 18px;
  border: 2px solid #2b2419; pointer-events: none;
}
.cabinet.glitching { animation: glitchShake 0.35s steps(2, end); }
@keyframes glitchShake {
  0%, 100% { filter: none; transform: translate(0,0); }
  20% { filter: hue-rotate(24deg) saturate(2.1); transform: translate(-3px, 1px); }
  40% { filter: hue-rotate(-16deg) saturate(1.6); transform: translate(3px, -1px); }
  60% { filter: hue-rotate(10deg) contrast(1.35); transform: translate(-2px, 2px); }
  80% { filter: hue-rotate(-8deg); transform: translate(2px, -1px); }
}

.wheel-wrap { display: flex; align-items: center; justify-content: center; }
.wheel-stage { position: relative; width: 100%; max-width: 480px; aspect-ratio: 1; container-type: inline-size; }
.wheel-layer { position: absolute; inset: 0; width: 100%; height: 100%; }
.wheel-svg { display: block; touch-action: manipulation; }
#wheel-rotor { transform-origin: 300px 300px; transition: transform 4.2s cubic-bezier(0.15,0.75,0.2,1); }
#wheel-paddle { transform-origin: 300px 6px; transition: transform 0.08s ease-out; }

.wheel-hub-btn {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 31.6%; aspect-ratio: 1; border-radius: 50%;
  background: #0a0806; border: 4px solid #F2ECE2; color: #F2ECE2;
  font-family: 'Archivo Black', 'Arial Black', sans-serif; font-size: clamp(1rem, 4.5cqi, 1.6rem);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.wheel-hub-btn:disabled { cursor: not-allowed; }
.wheel-hub-btn:hover:not(:disabled) { border-color: #FFAF00; }

.wheel-controls {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px;
  margin-top: clamp(18px, 4vw, 28px);
}
.spin-tax-chip {
  font-family: 'IBM Plex Mono', monospace; font-size: 12px; letter-spacing: 0.04em;
  text-transform: uppercase; padding: 10px 14px; border: 2px solid #4a4030;
  background: #171209; color: #C9BFAF;
}
.progress-chip {
  font-family: 'IBM Plex Mono', monospace; font-size: 12px; letter-spacing: 0.04em;
  text-transform: uppercase; padding: 10px 14px; border: 2px dashed #4a4030; color: #A1C281;
}
.tip-row { display: flex; align-items: center; gap: 8px; font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: #C9BFAF; }
.tip-btns { display: flex; gap: 6px; }
.tip-btn {
  position: relative;
  font-family: 'IBM Plex Mono', monospace; font-size: 12px; font-weight: 700;
  padding: 9px 12px; border: 2px solid #4a4030; background: #171209; color: #C9BFAF;
  cursor: pointer; text-decoration: none; display: inline-block;
}
.tip-btn:hover { border-color: #74ADEA; color: #74ADEA; }
/* Expand the tap target to ~44px tall without changing the visible chip size. */
.tip-btn::after { content: ''; position: absolute; inset: -8px 0; }

.result-panel {
  margin-top: clamp(18px, 4vw, 28px); border: 3px solid #F2ECE2; background: #171209;
  padding: clamp(18px, 4vw, 26px); text-align: center;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.result-tag {
  display: block; font-family: 'IBM Plex Mono', monospace; font-size: 12px;
  letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 8px;
}
.result-label {
  font-family: 'Archivo Black', 'Arial Black', sans-serif;
  font-size: clamp(1.4rem, 4.5vw, 2rem); margin: 0 0 8px;
}
.result-spoken { font-size: 15px; color: #C9BFAF; margin: 0; line-height: 1.5; }

.share-toggle {
  position: relative;
  margin-top: 16px; font-family: 'IBM Plex Mono', monospace; font-size: 12px;
  letter-spacing: 0.04em; text-transform: uppercase; padding: 10px 18px;
  border: 2px solid #4a4030; background: transparent; color: #C9BFAF; cursor: pointer;
}
.share-toggle:hover { border-color: #74ADEA; color: #74ADEA; }
.share-toggle::after { content: ''; position: absolute; inset: -7px 0; }

.share-preview {
  margin-top: 16px; border-radius: 22px; background: #FFFDF8;
  padding: clamp(24px, 5vw, 36px); text-align: center; transition: box-shadow 0.3s ease;
}
.share-recipient-row { margin-bottom: 14px; }
.share-recipient-input {
  font-family: 'Space Grotesk', sans-serif; font-size: 13px; text-align: center;
  padding: 12px 14px; border-radius: 999px; border: 1.5px solid #E4DAC8;
  background: #FBF7EE; color: #4a4030; width: 220px; max-width: 100%;
}
.share-recipient-input::placeholder { color: #b3a68c; }
.share-recipient-label {
  display: block; font-family: 'IBM Plex Mono', monospace; font-size: 10px;
  letter-spacing: 0.08em; text-transform: uppercase; color: #b3a68c; margin-bottom: 6px;
}
.share-quote {
  font-family: 'Newsreader', serif; font-style: italic; font-size: clamp(1.2rem, 3.2vw, 1.6rem);
  color: #2b2419; line-height: 1.4; margin: 0;
}
.share-quote-for {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 0.06em;
  text-transform: uppercase; color: #a89a7a; margin: 14px 0 0;
}
.share-buttons { display: flex; gap: 10px; justify-content: center; margin-top: 18px; }
.share-btn {
  position: relative;
  font-family: 'IBM Plex Mono', monospace; font-size: 12px; padding: 9px 16px;
  border-radius: 999px; border: 1.5px solid #E4DAC8; background: transparent;
  color: #6b5f47; cursor: pointer; text-decoration: none; display: inline-block;
}
.share-btn:hover { border-color: #74ADEA; color: #3d6fa8; }
.share-btn::after { content: ''; position: absolute; inset: -8px 0; }

.section { padding-block: clamp(32px, 6vw, 56px); border-top: 3px solid #2b2419; }
.section-head {
  display: flex; flex-direction: column; gap: 6px; align-items: center;
  text-align: center; margin-bottom: clamp(20px, 4vw, 30px);
}
.h2 { font-family: 'Archivo Black', 'Arial Black', sans-serif; font-size: clamp(1.4rem, 3.6vw, 2rem); margin: 0; }

.counter-panel {
  position: relative; overflow: visible; background: #FAF7F1; color: #17140F;
  border: 3px solid #17140F; padding: clamp(20px, 4vw, 32px); text-align: center;
}
.counter-label { font-family: 'IBM Plex Mono', monospace; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: #5C564E; }
.counter-value { font-family: 'IBM Plex Mono', monospace; font-weight: 700; font-size: clamp(2rem, 6vw, 3rem); margin: 6px 0; }
.counter-bar-track { height: 16px; border: 2px solid #17140F; background: #EFE9DD; margin-top: 10px; }
.counter-bar-fill { height: 100%; background: #FFAF00; transition: width 0.6s ease; }
.counter-caption { font-size: 13px; color: #5C564E; margin-top: 10px; }
.counter-disclaimer { font-size: 13px; color: #332F29; margin-top: 14px; max-width: 42ch; margin-left: auto; margin-right: auto; }
.counter-panel-pulse { animation: counterPulse 0.5s ease; }
@keyframes counterPulse { 0% { transform: scale(1); } 30% { transform: scale(1.025); } 100% { transform: scale(1); } }

.burst-wrap { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.burst-dot { position: absolute; top: 50%; left: 50%; width: 9px; height: 9px; transform: translate(-50%,-50%); animation: burstFly 0.9s ease-out forwards; }
@keyframes burstFly {
  from { transform: translate(-50%,-50%) rotate(var(--a)) translateX(0) scale(1); opacity: 1; }
  to { transform: translate(-50%,-50%) rotate(var(--a)) translateX(120px) scale(0.3); opacity: 0; }
}

.hints-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
.hint-chip {
  font-family: 'IBM Plex Mono', monospace; font-size: 11px; padding: 8px 10px;
  border: 2px solid #D8CFBE; background: #F1EBDE; color: #8a8072; max-width: 220px;
}
.hint-chip-unlocked { border-color: #17140F; background: #FAF7F1; color: #17140F; }

.footer-wrap {
  border-top: 3px solid #2b2419; padding-block: clamp(32px, 6vw, 52px);
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 20px;
}
.footer-verse { font-family: 'Newsreader', serif; font-style: italic; font-size: 13px; color: #8a8072; margin: 0; }
.footer-verse-cite { font-family: 'IBM Plex Mono', monospace; font-style: normal; font-size: 10px; letter-spacing: 0.04em; color: #5c5346; margin-left: 6px; }
.footer-divider { width: 32px; height: 2px; background: #2b2419; }
.footer { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.footer-legal { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: #6b6153; max-width: 44ch; line-height: 1.6; margin: 0; }
.footer-tag { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: #4a4030; letter-spacing: 0.06em; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 3px solid #74ADEA; outline-offset: 2px; }
.wheel-hub-btn:focus-visible { outline-offset: 4px; }

@media (prefers-reduced-motion: reduce) {
  .scanlines { animation: none; }
  .cabinet.glitching { animation: none; }
  .burst-dot { animation: none; opacity: 0; }
  .counter-panel-pulse { animation: none; }
  #wheel-rotor { transition-duration: 0.6s; }
  #wheel-paddle { transition: none; }
}
