:root {
  --bg: #05070d;
  --panel-bg: rgba(12, 16, 28, 0.85);
  --accent: #4fd1c5;
  --accent-dark: #2c9c92;
  --text: #eef2f7;
  --text-dim: #9aa5b8;
  --border: rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  overflow: hidden;
}

#app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--panel-bg);
  border-bottom: 1px solid var(--border);
  z-index: 20;
}

#header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

#app-header h1 {
  font-size: 1.25rem;
  margin: 0;
  letter-spacing: 0.02em;
  color: var(--accent);
}

/* Bingbongblitz.com hosts this alongside Jesse's other games; this returns to
   that landing page. Deliberately not styled to match #mode-toggle's pill
   buttons -- a plain circular icon reads as "leave this app" rather than "a
   mode of this app," which is the distinction that matters here. */
#hub-back-link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--text-dim);
  text-decoration: none;
  font-size: 1.1rem;
  line-height: 1;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

#hub-back-link:hover,
#hub-back-link:focus-visible {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

#hub-back-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

#mode-toggle {
  display: flex;
  gap: 8px;
}

.mode-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.mode-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

#threshold-bar {
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  z-index: 19;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  background: var(--panel-bg);
  border-bottom: 1px solid var(--border);
}

#threshold-bar label {
  font-size: 0.85rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

#threshold-value {
  color: var(--text);
  font-weight: 600;
}

#threshold-count {
  color: var(--text-dim);
  font-size: 0.8rem;
}

#threshold-slider {
  flex: 1;
  max-width: 320px;
  accent-color: var(--accent);
}

.mode-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #04201c;
  font-weight: 600;
}

main {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

#globeViz {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
}

#globeViz:active {
  cursor: grabbing;
}

#hud {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 20px;
  pointer-events: none;
}

#prompt-panel,
#controls-panel {
  pointer-events: auto;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  backdrop-filter: blur(6px);
}

#prompt-panel {
  max-width: 420px;
}

#round-indicator {
  margin: 0 0 4px;
  font-size: 0.8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

#city-prompt {
  margin: 0 0 8px;
  font-size: 1.4rem;
  font-weight: 600;
}

#round-result {
  margin: 0 0 8px;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.5;
}

#round-result .score-value {
  color: var(--accent);
  font-weight: 700;
}

#cumulative-score {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-dim);
}

#controls-panel {
  display: flex;
  align-items: center;
  gap: 10px;
}

#guess-btn,
#next-btn {
  background: var(--accent);
  color: #04201c;
  border: none;
  border-radius: 8px;
  padding: 12px 28px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

#guess-btn:hover:not(:disabled),
#next-btn:hover {
  background: var(--accent-dark);
}

#guess-btn:active:not(:disabled),
#next-btn:active {
  transform: scale(0.97);
}

#guess-btn:disabled {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-dim);
  cursor: not-allowed;
}

.hidden {
  display: none !important;
}

#game-over-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 4, 10, 0.75);
  backdrop-filter: blur(4px);
}

#game-over-panel {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 40px;
  text-align: center;
  max-width: 360px;
}

#game-over-panel h2 {
  margin: 0 0 12px;
  color: var(--accent);
}

#final-score {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 8px;
}

.game-over-note {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin: 0 0 20px;
}

#play-again-btn {
  background: var(--accent);
  color: #04201c;
  border: none;
  border-radius: 8px;
  padding: 10px 24px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

#play-again-btn:hover {
  background: var(--accent-dark);
}

@media (max-width: 640px) {
  #hud {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  #prompt-panel {
    max-width: none;
  }

  #controls-panel {
    justify-content: center;
  }
}
