:root {
  --earth-bg: #141210;
  --earth-surface: #1E1B18;
  --wheel-white: #F6F2E9;
  --wheel-yellow: #EAB832;
  --wheel-red: #C8372D;
  --wheel-black: #181715;
  --sacred-gold: #CFA75E;
  --text-primary: #FAF6EE;
  --text-muted: #C7BEA9;
}

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

html,
body {
  height: 100%;
  background-color: var(--earth-bg);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  touch-action: manipulation;
  overscroll-behavior: none;
}

body {
  background-image:
    radial-gradient(circle at 50% 44%, rgba(207, 167, 94, 0.11) 0%, rgba(20, 18, 16, 0) 68%);
}

.sanctuary {
  min-height: 100vh;
  min-height: 100svh;
  max-width: 460px;
  margin: 0 auto;
  padding:
    max(1.25rem, env(safe-area-inset-top))
    1.25rem
    max(1.75rem, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Header & Native Four-Color Motif */
.header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.stepped-motif {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 0.2rem;
}

.stepped-motif .bar {
  display: block;
  width: 22px;
  height: 5px;
  border-radius: 2px;
}

.bar-white {
  background-color: var(--wheel-white);
}

.bar-yellow {
  background-color: var(--wheel-yellow);
}

.bar-red {
  background-color: var(--wheel-red);
}

.bar-black {
  background-color: var(--wheel-black);
  border: 1px solid var(--sacred-gold);
}

.title {
  font-size: clamp(1.65rem, 6vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--wheel-white);
}

.subtitle {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--text-muted);
}

/* Medicine Wheel Centerpiece */
.wheel-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  flex: 1 1 auto;
}

.wheel-button-wrap {
  position: relative;
  width: min(82vw, 336px);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  filter: drop-shadow(0 14px 32px rgba(0, 0, 0, 0.65));
}

.medicine-wheel {
  width: 100%;
  height: 100%;
  display: block;
}

.wheel-ring {
  transform-origin: 50% 50%;
  will-change: transform;
  transition: transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* Center Number Display — Ultra-High Contrast for Phone Readability */
.number-readout {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  text-align: center;
  padding: 1rem;
}

.readout-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sacred-gold);
  margin-bottom: 0.15rem;
}

.message-number {
  font-size: clamp(3.6rem, 15.5vw, 4.9rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  transition: opacity 140ms ease, transform 180ms ease;
}

.message-number.is-idle {
  font-size: clamp(2.4rem, 10vw, 3rem);
  color: var(--sacred-gold);
  opacity: 0.9;
}

.message-number.is-updating {
  opacity: 0.35;
  transform: scale(0.92);
}

/* Primary Thumb-Zone CTA Button */
.actions {
  width: 100%;
  display: flex;
  justify-content: center;
}

.find-btn {
  appearance: none;
  width: 100%;
  max-width: 340px;
  min-height: 64px;
  padding: 1rem 1.5rem;
  border-radius: 999px;
  border: 2px solid var(--sacred-gold);
  background: var(--wheel-white);
  color: #141210;
  font-family: inherit;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.5),
    inset 0 -3px 0 rgba(207, 167, 94, 0.35);
  transition: transform 110ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.find-btn:hover {
  background: #FFFDF8;
}

.find-btn:active {
  transform: scale(0.975);
  background: var(--wheel-yellow);
}

.find-btn:focus-visible {
  outline: 3px solid var(--wheel-yellow);
  outline-offset: 4px;
}

/* Compact landscape phones */
@media (max-height: 600px) {
  .sanctuary {
    padding-top: 0.75rem;
    padding-bottom: 0.9rem;
    gap: 0.5rem;
  }

  .wheel-button-wrap {
    width: min(48vh, 240px);
  }

  .message-number {
    font-size: clamp(2.5rem, 10vh, 3.5rem);
  }

  .find-btn {
    min-height: 54px;
    font-size: 1.15rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wheel-ring,
  .message-number,
  .find-btn {
    transition: none !important;
  }
}
