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

:root {
  --navy:    #1c1610;
  --deep:    #261d14;
  --mid:     #36281c;
  --rim:     #503c28;
  --gold:    #e8924a;
  --cyan:    #c9a96e;
  --correct: #7ecb8f;
  --wrong:   #e05c5c;
  --text:    #f0ebe4;
  --muted:   #8a7d6e;
  --header-h: 56px;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--navy);
  color: var(--text);
  font-family: 'EB Garamond', sans-serif;
}

/* ── Header ─────────────────────────────────────────────────── */

header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--deep);
  border-bottom: 1px solid var(--rim);
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 20px;
}

.header-inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: 'Playfair Display', sans-serif;
  font-size: 1.35rem;
  letter-spacing: 0.18em;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-bird {
  font-size: 1.2rem;
  letter-spacing: 0;
}

/* ── Progress dots ───────────────────────────────────────────── */

.progress-dots {
  display: flex;
  gap: 8px;
  align-items: center;
}

.progress-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--rim);
  transition: background 0.3s ease;
}

.progress-dot.answered { background: var(--correct); }
.progress-dot.current  { background: var(--gold); }

/* ── Map ─────────────────────────────────────────────────────── */

#map {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0; bottom: 0;
  z-index: 1;
  cursor: crosshair;
}

.leaflet-control-attribution {
  font-size: 0.6rem;
  opacity: 0.4;
}

/* ── Clue card ───────────────────────────────────────────────── */

.clue-card {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--deep);
  border-top: 1px solid var(--rim);
  padding: 20px 20px 24px;
  z-index: 500;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  max-width: 640px;
  margin: 0 auto;
}

.clue-card.hidden {
  transform: translateY(110%);
}

.clue-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.clue-category {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}

.clue-value {
  font-family: 'Playfair Display', sans-serif;
  font-size: 0.85rem;
  color: var(--gold);
}

.clue-text {
  font-family: 'Playfair Display', sans-serif;
  font-size: 1.15rem;
  line-height: 1.45;
  color: var(--text);
  margin-bottom: 14px;
}

.tap-hint {
  font-size: 0.78rem;
  color: var(--muted);
  text-align: center;
  animation: pulse-hint 2.5s ease-in-out infinite;
}

@keyframes pulse-hint {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.9; }
}

/* ── Answer panel ────────────────────────────────────────────── */

.answer-panel {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--deep);
  border-top: 1px solid var(--rim);
  padding: 20px 20px 24px;
  z-index: 600;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  max-width: 640px;
  margin: 0 auto;
}

.answer-panel.hidden {
  transform: translateY(110%);
}

.answer-rows {
  margin-bottom: 16px;
}

.answer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--rim);
}

.answer-label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.answer-value {
  font-family: 'Playfair Display', sans-serif;
  font-size: 1rem;
  color: var(--correct);
}

.answer-distance {
  font-family: 'Playfair Display', sans-serif;
  font-size: 1rem;
  color: var(--text);
}

.score-display {
  text-align: center;
  padding: 14px 0 6px;
}

.score-points {
  font-family: 'Playfair Display', sans-serif;
  font-size: 2.6rem;
  color: var(--gold);
}

.score-label {
  font-size: 0.85rem;
  color: var(--muted);
  margin-left: 4px;
}

/* ── Buttons ─────────────────────────────────────────────────── */

.btn-primary {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--gold);
  color: var(--navy);
  border: none;
  border-radius: 8px;
  font-family: 'Playfair Display', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn-primary:hover { opacity: 0.88; }
.btn-primary:active { opacity: 0.75; }

/* ── Results screen ──────────────────────────────────────────── */

.results-screen {
  position: fixed;
  inset: var(--header-h) 0 0 0;
  background: var(--navy);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}

.results-screen.hidden {
  display: none;
}

.results-inner {
  width: 100%;
  max-width: 400px;
  padding: 36px 20px 48px;
  text-align: center;
}

.results-already-played {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.results-already-played.hidden { display: none; }

.results-title {
  font-family: 'Playfair Display', sans-serif;
  font-size: 1.8rem;
  letter-spacing: 0.22em;
  color: var(--gold);
  margin-bottom: 4px;
}

.results-date {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 24px;
}

.results-score-big {
  font-family: 'Playfair Display', sans-serif;
  font-size: 3.2rem;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}

.score-out-of {
  font-family: 'Playfair Display', sans-serif;
  font-size: 1.4rem;
  color: var(--muted);
}

.results-breakdown {
  margin: 24px 0;
  border: 1px solid var(--rim);
  border-radius: 8px;
  overflow: hidden;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 16px;
  border-bottom: 1px solid var(--rim);
  background: var(--deep);
}

.breakdown-row:last-child { border-bottom: none; }

.breakdown-answer {
  font-size: 0.9rem;
  color: var(--text);
  text-align: left;
}

.breakdown-score {
  font-family: 'Playfair Display', sans-serif;
  font-size: 0.9rem;
  min-width: 44px;
  text-align: right;
}

.breakdown-score.high   { color: var(--correct); }
.breakdown-score.medium { color: var(--gold); }
.breakdown-score.low    { color: var(--wrong); }

.share-confirm {
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--correct);
  height: 1.2em;
}

.share-confirm.hidden { visibility: hidden; }

/* ── Rules modal ─────────────────────────────────────────────── */

.rules-modal {
  position: fixed;
  inset: 0;
  background: rgba(12, 9, 6, 0.85);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.rules-modal.hidden {
  display: none;
}

.rules-inner {
  background: var(--deep);
  border: 1px solid var(--rim);
  border-radius: 12px;
  padding: 36px 28px 28px;
  max-width: 380px;
  width: 100%;
  text-align: center;
}

.rules-title {
  font-family: 'Playfair Display', sans-serif;
  font-size: 1.5rem;
  color: var(--gold);
  letter-spacing: 0.08em;
  margin-bottom: 24px;
}

.rules-list {
  list-style: none;
  text-align: left;
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rules-list li {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text);
  padding-left: 16px;
  position: relative;
}

.rules-list li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--gold);
  font-size: 1.2rem;
  line-height: 1.3;
}

.rules-shoulders {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 24px;
  line-height: 1.5;
}

.rules-shoulders a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.rules-shoulders a:hover {
  color: var(--cyan);
}

/* ── Map markers ─────────────────────────────────────────────── */

.marker-guess {
  width: 14px;
  height: 14px;
  background: var(--cyan);
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 10px var(--cyan);
}

.marker-correct {
  width: 14px;
  height: 14px;
  background: var(--correct);
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 10px var(--correct);
  position: relative;
}

.marker-correct::before,
.marker-correct::after {
  content: '';
  position: absolute;
  top: -8px;
  left: -8px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--correct);
  animation: sonar-ring 2s ease-out infinite;
}

.marker-correct::after {
  animation-delay: 1s;
}

@keyframes sonar-ring {
  0%   { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(4); opacity: 0; }
}
