:root {
  --night: #0b1a3a;
  --night-2: #1d2f63;
  --dusk: #3a2a4f;
  --paper: #fbf3df;
  --gold: #c8a96a;
  --ink: #4a2f1a;
  --red: #b3202c;
  --red-dark: #861620;
  --green: #2f6b3f;
  --green-dark: #1f4d2c;
  --snow: #f4f1ea;
  --glow: #ffcf7a;
  --display: "Mountains of Christmas", Georgia, serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--body);
  color: var(--snow);
  background: radial-gradient(ellipse at 50% 120%, #4a3352 0%, transparent 60%), linear-gradient(180deg, var(--night) 0%, var(--night-2) 60%, var(--dusk) 100%);
  overflow: hidden;
}
#globe { position: fixed; inset: 0; }
#globe canvas { display: block; cursor: grab; touch-action: none; }
#globe canvas:active { cursor: grabbing; }

.g-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  padding: 22px 16px 0;
  text-align: center;
  pointer-events: none;
  z-index: 2;
}
.kicker { margin: 0; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--glow); }
h1 {
  margin: 2px 0 4px;
  font-family: var(--display);
  font-size: clamp(2rem, 7vw, 3.2rem);
  line-height: 1;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.25), 0 0 30px rgba(255, 207, 122, 0.35);
}
h1 span { color: #ff6b6b; }
.g-stats { margin: 4px 0 0; font-weight: 700; opacity: 0.9; }
.g-stats strong { color: var(--glow); font-size: 1.15em; }

.g-bottom {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  padding: 0 16px calc(14px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 2;
  pointer-events: none;
}
.g-bottom > * { pointer-events: auto; }

.ticker {
  margin: 0;
  padding: 8px 14px;
  max-width: min(520px, 100%);
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--gold);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.ticker.in { animation: pop 0.45s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes pop { from { transform: translateY(8px) scale(0.96); opacity: 0; } to { transform: none; opacity: 1; } }

.legend { display: flex; align-items: center; gap: 8px; font-size: 0.75rem; font-weight: 700; opacity: 0.85; }
.legend-bar { width: 110px; height: 8px; border-radius: 999px; background: linear-gradient(90deg, #ffe08a, #ff9a3c, #ff3b4a); }

.g-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  font: 800 1rem var(--body);
  color: #fff;
  text-decoration: none;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
}
.btn:active { transform: translateY(2px); }
.btn-red { background: var(--red); box-shadow: 0 4px 0 var(--red-dark); }
.btn-green { background: var(--green); box-shadow: 0 4px 0 var(--green-dark); }

.places {
  width: min(360px, 100%);
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--gold);
  border-radius: 14px;
  padding: 6px 14px;
  font-size: 0.9rem;
}
.places[hidden] { display: none; }
.places summary { cursor: pointer; font-weight: 800; padding: 4px 0; }
.places ol { margin: 4px 0 8px; padding-left: 1.3em; max-height: 30vh; overflow: auto; }
.places li span { margin-right: 6px; }
.places li strong { float: right; font-variant-numeric: tabular-nums; }

.hint { margin: 0; font-size: 0.72rem; opacity: 0.65; text-align: center; }

.g-tip {
  position: fixed;
  z-index: 5;
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--gold);
  border-radius: 10px;
  pointer-events: none;
  white-space: nowrap;
}
.no-webgl { position: fixed; top: 45%; left: 16px; right: 16px; text-align: center; font-weight: 700; }

@media (max-height: 700px) {
  .legend, .hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ticker.in { animation: none; }
}
