/* ---------- fonts ---------- */
@font-face {
  font-family: 'Lilita One';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/lilita-one.woff2') format('woff2');
}
@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('../fonts/figtree.woff2') format('woff2');
}

/* ---------- tokens ---------- */
:root {
  --surf:   #0F3A42;   /* deep Pacific teal — hero, overlay, footer */
  --surf-2: #14464F;   /* teal step-up for cards on dark */
  --sand:   #F6F1E6;   /* warm sand — page ground */
  --coral:  #FF5A4E;   /* hot coral — pointer, decorative accents */
  --coral-d:#E04437;   /* coral deep — button fills (5.06:1 with white text) */
  --coral-x:#C4372B;   /* coral darkest — button borders */
  --mango:  #FFB43A;   /* mango — distance chips, wheel */
  --palm:   #2E7D5B;   /* palm green — wheel, success */
  --ink:    #22333B;   /* body text on sand */
  --ink-soft: #5C6B72; /* secondary text */
  --line:   #E4DCCB;   /* hairlines on sand */
  --display: 'Lilita One', 'Arial Black', sans-serif;
  --body: 'Figtree', system-ui, sans-serif;
  --radius: 14px;
  --cta-h: 84px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--sand);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.45;
}

/* ---------- hero ---------- */
.hero {
  background: var(--surf);
  color: var(--sand);
  padding: calc(20px + env(safe-area-inset-top)) 20px 26px;
  text-align: center;
  background-image:
    radial-gradient(circle at 12% -20%, rgba(255,180,58,.16), transparent 46%),
    radial-gradient(circle at 88% 120%, rgba(255,90,78,.14), transparent 46%);
}
.hero-eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--mango);
}
.hero-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(38px, 11vw, 56px);
  line-height: 1.02;
  letter-spacing: .01em;
  text-shadow: 0 3px 0 rgba(0,0,0,.18);
}
.hero-sub {
  margin: 8px 0 0;
  font-size: 15px;
  color: rgba(246,241,230,.75);
}

/* ---------- toolbar ---------- */
.toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--sand);
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.loc-chip {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: 600 13px var(--body);
  padding: 7px 14px 7px 11px;
  border-radius: 999px;
  cursor: pointer;
}
.loc-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--palm);
  flex: none;
}
.loc-chip.is-locating .loc-dot { background: var(--mango); animation: pulse 1.1s ease-in-out infinite; }
.loc-chip.is-fallback .loc-dot { background: var(--coral); }
@keyframes pulse { 50% { opacity: .25; } }

.search-wrap { position: relative; }
.search-icon {
  position: absolute;
  left: 13px; top: 50%;
  transform: translateY(-50%);
  color: var(--ink-soft);
  pointer-events: none;
}
#searchInput {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 11px 14px 11px 38px;
  font: 400 16px var(--body);
  color: var(--ink);
}
#searchInput::placeholder { color: #6E7A80; }

/* ---------- list ---------- */
main { padding: 4px 16px calc(var(--cta-h) + 18px + env(safe-area-inset-bottom)); max-width: 640px; margin: 0 auto; }
.toolbar, .hero, .foot { --pad-side: max(16px, env(safe-area-inset-left)); }
.spot-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}
.spot-list li + li { margin-top: 8px; }
.spot-link {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  text-decoration: none;
  color: inherit;
  transition: transform .1s ease, box-shadow .1s ease;
}
.spot-link:active { transform: scale(.985); }
@media (hover: hover) {
  .spot-link:hover { box-shadow: 0 4px 14px rgba(34,51,59,.10); border-color: #D6CDB8; }
}
.spot-text { min-width: 0; flex: 1; }
.spot-name {
  margin: 0;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.25;
}
.spot-addr {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.spot-dist {
  flex: none;
  font: 700 14px/1 var(--body);
  color: var(--ink);
  background: var(--mango);
  border-radius: 999px;
  padding: 7px 11px;
  min-width: 58px;
  text-align: center;
}
.spot-dist small { font-weight: 600; font-size: 10px; }
.empty-msg {
  text-align: center;
  color: var(--ink-soft);
  padding: 40px 10px;
}

/* ---------- bottom CTA ---------- */
.cta-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--sand) 62%, rgba(246,241,230,0));
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.cta-btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: min(100%, 420px);
  justify-content: center;
  background: var(--coral-d);
  color: #fff;
  border: none;
  border-bottom: 3px solid var(--coral-x);
  border-radius: 999px;
  padding: 15px 26px;
  font-family: var(--display);
  font-size: 20px;
  letter-spacing: .02em;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(224,68,55,.35);
}
.cta-btn:active { transform: translateY(1px); box-shadow: 0 4px 12px rgba(224,68,55,.3); }
.cta-btn:disabled { opacity: .55; cursor: default; }
.cta-wheel { flex: none; }

/* ---------- overlay ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--surf);
  color: var(--sand);
  overflow-y: auto;
  overscroll-behavior: contain;
  background-image:
    radial-gradient(circle at 85% 8%, rgba(255,180,58,.14), transparent 42%),
    radial-gradient(circle at 8% 95%, rgba(255,90,78,.12), transparent 42%);
}
.overlay-inner {
  max-width: 480px;
  margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top)) 20px calc(28px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
}
.overlay-close {
  align-self: flex-end;
  background: rgba(246,241,230,.12);
  color: var(--sand);
  border: none;
  width: 40px; height: 40px;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.overlay-title {
  margin: 2px 0 14px;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(28px, 8vw, 36px);
  text-align: center;
  text-shadow: 0 3px 0 rgba(0,0,0,.2);
}

.radius-block { width: 100%; margin-bottom: 14px; }
.radius-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--mango);
  margin-bottom: 8px;
  text-align: center;
}
.radius-row { display: flex; align-items: center; gap: 14px; }
.radius-value {
  flex: none;
  font-family: var(--display);
  font-size: 22px;
  min-width: 74px;
  text-align: right;
}
.radius-count {
  margin: 8px 0 0;
  text-align: center;
  font-size: 14px;
  color: rgba(246,241,230,.8);
  min-height: 1.4em;
}
input[type="range"] {
  flex: 1;
  appearance: none;
  -webkit-appearance: none;
  height: 6px;
  border-radius: 3px;
  background: rgba(246,241,230,.25);
  outline-offset: 4px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--mango);
  border: 3px solid var(--sand);
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--mango);
  border: 3px solid var(--sand);
  cursor: pointer;
}

.wheel-stage {
  position: relative;
  width: min(84vw, 400px, 46vh);
  aspect-ratio: 1;
  margin: 6px 0 4px;
}
#wheel { width: 100%; height: 100%; display: block; }
.wheel-pointer {
  position: absolute;
  top: -6px; left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-top: 26px solid var(--coral);
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.35));
  z-index: 2;
}

.spin-row { margin: 14px 0 4px; }
.spin-btn {
  background: var(--coral-d);
  color: #fff;
  border: none;
  border-bottom: 3px solid var(--coral-x);
  border-radius: 999px;
  padding: 14px 58px;
  font-family: var(--display);
  font-size: 24px;
  letter-spacing: .04em;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0,0,0,.3);
}
.spin-btn:disabled { opacity: .55; cursor: default; }
.spin-btn:active:not(:disabled) { transform: translateY(1px); }

.winner-card {
  width: 100%;
  margin-top: 16px;
  background: var(--surf-2);
  border: 1px solid rgba(246,241,230,.14);
  border-radius: 18px;
  padding: 18px 18px 16px;
  text-align: center;
  animation: rise .35s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.winner-eyebrow {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--mango);
}
.winner-name {
  margin: 6px 0 2px;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(24px, 7vw, 32px);
  line-height: 1.1;
}
.winner-meta {
  margin: 0 0 14px;
  font-size: 14px;
  color: rgba(246,241,230,.8);
}
.winner-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.winner-go {
  background: var(--mango);
  color: var(--surf);
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  border-radius: 999px;
  padding: 12px 22px;
}
.winner-respin {
  background: transparent;
  color: var(--sand);
  border: 1px solid rgba(246,241,230,.4);
  border-radius: 999px;
  padding: 12px 22px;
  font: 600 15px var(--body);
  cursor: pointer;
}

/* ---------- footer ---------- */
.foot {
  background: var(--surf);
  color: rgba(246,241,230,.65);
  text-align: center;
  font-size: 12.5px;
  /* bottom padding clears the fixed CTA bar so the credit line stays readable */
  padding: 14px 20px calc(14px + var(--cta-h) + env(safe-area-inset-bottom));
  margin-top: 8px;
}
.foot a { color: var(--mango); }
.foot p { margin: 0; }

/* ---------- focus & motion ---------- */
/* deep coral ring on light surfaces (4.5:1 on sand), mango inside the dark overlay */
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid var(--coral-x);
  outline-offset: 2px;
}
.overlay button:focus-visible, .overlay a:focus-visible, .overlay input:focus-visible {
  outline-color: var(--mango);
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- wider screens ---------- */
@media (min-width: 700px) {
  .toolbar { flex-direction: row; align-items: center; justify-content: center; }
  .toolbar .search-wrap { width: 340px; }
  .loc-chip { align-self: auto; }
}
