/* Stoked: shared tokens, dark mode, safe areas and iOS/WebView behaviour.
   Loaded by every Stoked screen before its own styles. Light values are unchanged. */

@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(fonts/instrument-sans-latin.woff2) format('woff2');
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/instrument-serif-latin.woff2) format('woff2');
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/instrument-serif-italic-latin.woff2) format('woff2');
}
@font-face {
  font-family: 'Reenie Beanie';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/reenie-beanie-latin.woff2) format('woff2');
}

:root {
  color-scheme: light;
  --s-bg: #FBF6EA;
  --s-bg-rgb: 251, 246, 234;
  --s-surface: #FFFFFF;
  --s-surface-rgb: 255, 255, 255;
  --s-text: #2A2420;
  --s-text-rgb: 42, 36, 32;
  --s-accent: #C8381F;
  --s-accent-rgb: 200, 56, 31;
  --s-accent-text: #A62E19;
  --s-sand: #EADCC2;
  --s-gold: #F0C15A;
  --s-on-gold: #2A2420;
  --s-tabbar: 78px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --s-bg: #17120F;
    --s-bg-rgb: 23, 18, 15;
    --s-surface: #241D19;
    --s-surface-rgb: 36, 29, 25;
    --s-text: #F5EDE2;
    --s-text-rgb: 245, 237, 226;
    --s-accent: #F2795C;
    --s-accent-rgb: 242, 121, 92;
    --s-accent-text: #FF9E82;
    --s-sand: #46382B;
    --s-gold: #F0C15A;
    --s-on-gold: #1E1712;
  }
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--s-bg);
  color: var(--s-text);
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

/* Scroll containers: safe-area aware bottom, no rubber-band on the document. */
.dc-root div[style*="overflow-y: auto"],
.dc-root div[style*="overflow-y:auto"] {
  padding-top: env(safe-area-inset-top);
  overscroll-behavior-y: none;
  -webkit-overflow-scrolling: touch;
}
/* Only the screens that carry the tab bar are lifted above the home indicator. */
.dc-root div[style*="overflow-y: auto"][style*="bottom: 78px"],
.dc-root div[style*="overflow-y:auto"][style*="bottom: 78px"] {
  bottom: calc(var(--s-tabbar) + env(safe-area-inset-bottom)) !important;
}

.dc-root > div,
.dc-root > div > div {
  overscroll-behavior: none;
}

/* Fixed bottom tab bars sit above the home indicator. */
nav[aria-label="Main"] {
  height: calc(var(--s-tabbar) + env(safe-area-inset-bottom)) !important;
  padding-bottom: calc(16px + env(safe-area-inset-bottom)) !important;
  overscroll-behavior: none;
}

/* Beach map screen. */
.app .top { padding-top: calc(14px + env(safe-area-inset-top)); }
.app #map { bottom: calc(var(--s-tabbar) + env(safe-area-inset-bottom)); }
.app .legend { bottom: calc(90px + env(safe-area-inset-bottom)); }

/* Icon-only remove button in the host editor: a 44px target without moving its glyph. */
button[style*="width: 36px"][style*="height: 36px"] {
  width: 44px !important;
  height: 44px !important;
}

/* No text selection on controls; body copy stays selectable. */
nav a,
nav button,
button,
[role="button"],
a[style*="border-radius: 999px"],
span[style*="border-radius: 999px"],
a[aria-label="Back"],
a[aria-label="Profile"],
a[aria-label="Share your location"],
a[aria-label="Instant share"] {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Screen transitions (skipped when the visitor prefers reduced motion). */
.stoked-anim {
  animation-duration: 0.2s;
  animation-timing-function: cubic-bezier(0.2, 0.75, 0.3, 1);
  animation-fill-mode: both;
}
.stoked-out-fwd { animation-name: stoked-out-fwd; }
.stoked-out-back { animation-name: stoked-out-back; }
.stoked-in-fwd { animation-name: stoked-in-fwd; animation-duration: 0.24s; }
.stoked-in-back { animation-name: stoked-in-back; animation-duration: 0.24s; }
@keyframes stoked-out-fwd { to { opacity: 0; transform: translateX(-18px); } }
@keyframes stoked-out-back { to { opacity: 0; transform: translateX(18px); } }
@keyframes stoked-in-fwd { from { opacity: 0; transform: translateX(22px); } to { opacity: 1; transform: none; } }
@keyframes stoked-in-back { from { opacity: 0; transform: translateX(-22px); } to { opacity: 1; transform: none; } }

/* Bottom sheet: single-select and destructive confirmations. */
.stoked-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(20, 14, 10, 0.44);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.stoked-backdrop.open { opacity: 1; }
.stoked-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2001;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  box-sizing: border-box;
  max-height: 82vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--s-surface);
  color: var(--s-text);
  border: 1px solid rgba(var(--s-accent-rgb), 0.3);
  border-bottom: 0;
  border-radius: 24px 24px 0 0;
  padding: 10px 16px calc(16px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 40px rgba(20, 14, 10, 0.28);
  transform: translateY(102%);
  transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.25, 1);
}
.stoked-sheet.open { transform: translateY(0); }
.stoked-sheet .stoked-grip {
  width: 44px;
  height: 4px;
  border-radius: 999px;
  background: rgba(var(--s-accent-rgb), 0.3);
  margin: 2px auto 12px;
}
.stoked-sheet h2 {
  margin: 0 0 4px;
  font: 400 28px/1.02 'Instrument Serif', serif;
  letter-spacing: -0.01em;
  color: var(--s-accent-text);
}
.stoked-sheet p {
  margin: 0 0 12px;
  font: 400 14px/1.45 'Instrument Sans', sans-serif;
  color: var(--s-text);
}
.stoked-sheet-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 0 2px;
  background: none;
  border: 0;
  border-bottom: 1px solid rgba(var(--s-accent-rgb), 0.25);
  font: 400 16px/1.3 'Instrument Sans', sans-serif;
  color: var(--s-text);
  text-align: left;
  cursor: pointer;
}
.stoked-sheet-option:last-of-type { border-bottom: 0; }
.stoked-sheet-option[aria-checked="true"] {
  color: var(--s-accent-text);
  font-weight: 600;
}
.stoked-sheet-option .stoked-tick { flex: none; opacity: 0; color: var(--s-accent-text); }
.stoked-sheet-option[aria-checked="true"] .stoked-tick { opacity: 1; }
.stoked-sheet-cancel,
.stoked-sheet-confirm {
  width: 100%;
  min-height: 54px;
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font: 400 14px 'Instrument Serif', serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.stoked-sheet-cancel {
  border: 1px solid var(--s-accent);
  background: none;
  color: var(--s-accent-text);
}
.stoked-sheet-confirm {
  border: 1px solid #C8381F;
  background: #C8381F;
  color: #FFF6EE;
  margin-top: 8px;
}
.stoked-sheet-confirm[disabled] { opacity: 0.45; cursor: default; }

/* Pull-to-refresh spinner, clear of the tab bar. */
.stoked-ptr {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 10px);
  left: 50%;
  z-index: 1500;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--s-surface);
  border: 1px solid rgba(var(--s-accent-rgb), 0.3);
  box-shadow: 0 4px 16px rgba(20, 14, 10, 0.2);
  opacity: 0;
  transform: translate(-50%, -52px);
  transition: transform 0.2s ease, opacity 0.2s ease;
  pointer-events: none;
}
.stoked-ptr.show { opacity: 1; transform: translate(-50%, 0); }
.stoked-ptr svg { display: block; color: var(--s-accent); }
.stoked-select svg path { stroke: currentColor; }
.stoked-ptr.spinning svg { animation: stoked-spin 0.8s linear infinite; }
@keyframes stoked-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .stoked-anim,
  .stoked-in-fwd,
  .stoked-in-back,
  .stoked-out-fwd,
  .stoked-out-back { animation: none !important; }
  .stoked-sheet,
  .stoked-backdrop,
  .stoked-ptr { transition: none !important; }
  .stoked-ptr.spinning svg { animation: none !important; }
}
