:root {
  --bg-space: #030712;
  --panel-bg: rgba(11, 18, 34, 0.78);
  --panel-border: rgba(148, 163, 184, 0.16);
  --panel-hover: rgba(30, 41, 59, 0.85);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-cyan: #38bdf8;
  --accent-rose: #fb7185;
  --accent-purple: #c084fc;
  --accent-emerald: #34d399;
  --accent-amber: #fbbf24;
}

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

html, body {
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 35%, #0f172a 0%, #030712 75%);
  color: var(--text-main);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  overflow-x: hidden;
}

/* 3D Globe Background Canvas */
#globe-stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  cursor: grab;
}

#globe-stage:active {
  cursor: grabbing;
}

/* Custom HTML pins on the 3D Globe */
.globe-pin {
  pointer-events: auto;
  cursor: pointer;
  transform: translate(-50%, -100%);
  background: rgba(9, 14, 28, 0.88);
  border: 1.5px solid var(--pin-color, #38bdf8);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  box-shadow: 0 0 14px var(--pin-color, rgba(56, 189, 248, 0.6));
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  backdrop-filter: blur(6px);
}

.globe-pin:hover {
  transform: translate(-50%, -106%) scale(1.1);
  z-index: 20;
}

.globe-pin-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pin-color, #38bdf8);
  box-shadow: 0 0 6px var(--pin-color, #38bdf8);
}

/* Foreground HUD Overlay */
.hud-wrapper {
  position: relative;
  z-index: 10;
  pointer-events: none;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px 18px;
}

.interactive {
  pointer-events: auto;
}

/* Top Navbar */
.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(14px);
  border-radius: 16px;
  padding: 10px 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, #38bdf8 0%, #818cf8 50%, #fb7185 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.35);
}

.brand-title {
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-pill {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.16);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  animation: pulseDot 1.8s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.35); }
}

.brand-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* Mode Tabs & Actions */
.nav-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.btn {
  border: 1px solid var(--panel-border);
  background: rgba(30, 41, 59, 0.72);
  color: var(--text-main);
  padding: 7px 13px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.16s ease;
}

.btn:hover {
  background: rgba(51, 65, 85, 0.9);
  border-color: rgba(56, 189, 248, 0.45);
  transform: translateY(-1px);
}

.btn.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #38bdf8;
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7 0%, #6366f1 100%);
  border-color: rgba(125, 211, 252, 0.45);
  color: #fff;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0369a1 0%, #4f46e5 100%);
}

.visitor-badge {
  font-size: 0.74rem;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 5px 11px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Main Workspace Layout */
.workspace-grid {
  display: grid;
  grid-template-columns: 370px 1fr 370px;
  gap: 16px;
  margin-top: 14px;
  align-items: start;
  flex: 1;
}

.side-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100vh - 105px);
  overflow-y: auto;
  padding-right: 4px;
}

.side-column::-webkit-scrollbar {
  width: 5px;
}

.side-column::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.28);
  border-radius: 999px;
}

/* Extreme Cards */
.extreme-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-left: 4px solid var(--card-color, #38bdf8);
  backdrop-filter: blur(14px);
  border-radius: 14px;
  padding: 13px 15px;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.extreme-card:hover,
.extreme-card.selected {
  background: var(--panel-hover);
  border-color: var(--card-color, #38bdf8);
  transform: translateX(3px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.card-badge {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--card-color, #38bdf8);
}

.card-metric {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.card-city-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.card-city-name {
  font-size: 1rem;
  font-weight: 700;
  color: #f1f5f9;
}

.card-submetric {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.card-story {
  font-size: 0.8rem;
  line-height: 1.45;
  color: #cbd5e1;
}

/* Right Side Interactive Modules */
.glass-box {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(14px);
  border-radius: 15px;
  padding: 15px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.42);
}

.box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.box-title {
  font-size: 0.94rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 7px;
}

.box-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 11px;
  line-height: 1.4;
}

/* Search & Compare My City */
.search-row {
  display: flex;
  gap: 7px;
  margin-bottom: 10px;
}

.input-field {
  flex: 1;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--panel-border);
  border-radius: 9px;
  padding: 8px 11px;
  color: #fff;
  font-size: 0.82rem;
  outline: none;
}

.input-field:focus {
  border-color: var(--accent-cyan);
}

.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}

.chip {
  font-size: 0.72rem;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid var(--panel-border);
  color: #cbd5e1;
  cursor: pointer;
}

.chip:hover {
  border-color: var(--accent-cyan);
  color: #fff;
}

.roast-card {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.92), rgba(30, 27, 75, 0.75));
  border: 1px solid rgba(192, 132, 252, 0.35);
  border-radius: 12px;
  padding: 12px;
  margin-top: 8px;
}

.roast-headline {
  font-size: 0.88rem;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 6px;
}

.roast-body {
  font-size: 0.8rem;
  line-height: 1.48;
  color: #e2e8f0;
  margin-bottom: 10px;
}

/* Daily Extreme Guessr */
.guessr-status {
  background: rgba(15, 23, 42, 0.82);
  border: 1px dashed rgba(56, 189, 248, 0.4);
  border-radius: 11px;
  padding: 10px 12px;
  font-size: 0.8rem;
  line-height: 1.45;
  color: #e2e8f0;
  margin-bottom: 9px;
}

/* Q&A List */
.qa-item {
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  padding: 10px 0;
}

.qa-item:first-child {
  border-top: none;
  padding-top: 2px;
}

.qa-question {
  font-size: 0.83rem;
  font-weight: 700;
  color: #f1f5f9;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.qa-question:hover {
  color: var(--accent-cyan);
}

.qa-answer {
  font-size: 0.78rem;
  line-height: 1.48;
  color: #cbd5e1;
  margin-top: 7px;
  display: none;
}

.qa-item.open .qa-answer {
  display: block;
}

.qa-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

/* Center Bottom Spotlight Banner (during Tour or Selection) */
.center-stage {
  display: flex;
   flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  min-height: calc(100vh - 130px);
  pointer-events: none;
}

.spotlight-toast {
  pointer-events: auto;
  max-width: 540px;
  width: 100%;
  background: rgba(9, 14, 28, 0.88);
  border: 1px solid rgba(56, 189, 248, 0.35);
  backdrop-filter: blur(16px);
  border-radius: 16px;
  padding: 14px 18px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65);
  margin-bottom: 8px;
  transition: all 0.25s ease;
}

/* Responsive layout for tablets & phones */
@media (max-width: 1120px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
  .center-stage {
    min-height: 360px;
    order: -1;
  }
  .side-column {
    max-height: none;
    overflow-y: visible;
  }
}
