/* nearest — shared engine styles.
   Per-app palette comes from a config's `theme` (applied to these CSS vars in app.js).
   Defaults below are the BierVanafHier beer palette so the page looks right pre-JS. */

:root {
  --bg:        #f6ead0;   /* warm cream  */
  --bg-2:      #f1e0bd;
  --ink:       #3a2c17;   /* dark roast  */
  --ink-soft:  #7a6647;
  --accent:    #d8902a;   /* brand accent (beer amber by default) */
  --accent-dk: #b9741a;
  --foam:      #fffaf0;
  --shadow:    0 10px 40px rgba(0, 0, 0, 0.14);
  --radius:    20px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; margin: 0; }

body {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
  background: radial-gradient(120% 120% at 50% 0%, var(--bg) 0%, var(--bg-2) 100%);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.4;
  text-align: center;
  overflow: hidden;
}

main {
  width: 100%;
  max-width: 26rem;
  animation: rise 0.5s ease both;
}

@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* --- shared bits --- */
.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 0.5rem;
}
.muted { color: var(--ink-soft); }

/* --- start screen --- */
.mark { font-size: clamp(3rem, 18vw, 4.5rem); line-height: 1; margin-bottom: 0.5rem; }
h1 {
  font-size: clamp(1.9rem, 9vw, 2.6rem);
  margin: 0 0 0.4rem;
  letter-spacing: -0.02em;
  font-weight: 800;
}
.tagline { margin: 0 auto 2rem; max-width: 22rem; color: var(--ink-soft); }

button.cta {
  appearance: none;
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--foam);
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dk) 100%);
  padding: 1rem 1.8rem;
  border-radius: 999px;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.2s ease;
}
button.cta:active { transform: translateY(2px) scale(0.99); }
button.cta:disabled { opacity: 0.6; cursor: default; }

/* --- result screen --- */
.disc {
  width: clamp(7rem, 38vw, 9rem);
  height: clamp(7rem, 38vw, 9rem);
  margin: 0 auto 1.4rem;
  border-radius: 50%;
  background: var(--foam);
  box-shadow: var(--shadow), inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.glyph { font-size: clamp(2.4rem, 13vw, 3.2rem); }

/* the arrow rotates (in JS) to point at the chosen place as you turn */
.arrow {
  width: 56%;
  height: 56%;
  transform-origin: 50% 50%;
  will-change: transform;
}
.arrow path { fill: var(--accent-dk); transition: fill 0.25s ease; }

/* you're facing the place (universal green, not themed) */
.disc.aligned {
  background: #f1fbef;
  box-shadow: var(--shadow), inset 0 0 0 2px rgba(47, 157, 74, 0.55);
}
.disc.aligned .arrow path { fill: #2f9d4a; }
@media (prefers-reduced-motion: reduce) { .arrow { transition: none; } }

.name {
  font-size: clamp(1.6rem, 8vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 0.25rem;
  overflow-wrap: anywhere;
}
.kind {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-dk);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 1.1rem;
}
.dist {
  font-size: clamp(2.6rem, 15vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}
.dist .unit { font-size: 0.4em; font-weight: 700; color: var(--ink-soft); margin-left: 0.15em; }
.heading-word { margin: 0.4rem 0 1.6rem; color: var(--ink-soft); }
.heading-word strong { color: var(--ink); }

/* open-now status (only used by configs with openNow: true) */
.open-state { margin: -0.9rem 0 1.4rem; font-weight: 700; font-size: 0.95rem; }
.open-state.is-open    { color: #2f9d4a; }
.open-state.is-closed  { color: #c4452f; }
.open-state.is-unknown { color: var(--ink-soft); font-weight: 600; }

a.go {
  display: inline-block;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--foam);
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dk) 100%);
  padding: 0.95rem 1.6rem;
  border-radius: 999px;
  box-shadow: var(--shadow);
}
a.go:active { transform: translateY(2px); }

.again {
  display: inline-block;
  margin-top: 1.2rem;
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* --- status / spinner --- */
.pulse {
  width: 56px; height: 56px; margin: 0 auto 1.2rem;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(0.7); opacity: 0.5; }
  50%      { transform: scale(1);   opacity: 1; }
}

[hidden] { display: none !important; }
.stack > * + * { margin-top: 0; }
