/* ==================== VARIABLES ==================== */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a26;
  --bg-card-hover: #222233;
  --text-primary: #f0ece4;
  --text-secondary: #9a968e;
  --text-muted: #5a5750;
  --accent: #f59e0b;
  --accent-glow: rgba(245, 158, 11, 0.3);
  --accent-dim: #b8780a;
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.3);
  --error: #ef4444;
  --error-glow: rgba(239, 68, 68, 0.2);
  --bone-color: #e8d5b7;
  --bone-dark: #c4a882;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'Space Mono', monospace;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==================== 3D CANVAS ==================== */
#bone-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100;
  pointer-events: none;
}

/* ==================== OVERLAYS ==================== */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

.overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* ==================== LANDING PAGE ==================== */
#landing {
  background: radial-gradient(ellipse at 50% 40%, rgba(245, 158, 11, 0.06) 0%, transparent 60%),
              linear-gradient(180deg, rgba(10, 10, 15, 0.85) 0%, rgba(10, 10, 15, 0.7) 50%, rgba(10, 10, 15, 0.9) 100%);
}

.landing-content {
  text-align: center;
  max-width: 600px;
  padding: 2rem;
  animation: fadeUp 0.8s ease-out;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.logo-icon {
  font-size: 2.5rem;
  filter: drop-shadow(0 0 20px var(--accent-glow));
}

.logo h1 {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--bone-color) 50%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tagline {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 2rem;
  max-width: 450px;
  margin-left: auto;
  margin-right: auto;
}

/* ==================== BUTTONS ==================== */
.btn-primary {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  padding: 1rem 2.5rem;
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.25s ease;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 24px var(--accent-glow), 0 0 0 0 var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--accent-glow), 0 0 0 4px rgba(245, 158, 11, 0.1);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.65rem 1.5rem;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-icon {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* ==================== FEATURES ==================== */
.features {
  display: flex;
  gap: 2rem;
  margin-top: 3rem;
  justify-content: center;
}

.feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.feature span {
  font-size: 1.8rem;
  display: block;
  width: 56px;
  height: 56px;
  line-height: 56px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.feature p {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* ==================== TOOLBAR ==================== */
.toolbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: rgba(10, 10, 15, 0.7);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toolbar.hidden {
  display: flex !important;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-100%);
}

.toolbar-center h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.toolbar-actions {
  display: flex;
  gap: 0.25rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 50px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-mode {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 1rem;
  background: transparent;
  color: var(--text-secondary);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-mode.active {
  background: var(--accent);
  color: var(--bg-primary);
}

.btn-mode:not(.active):hover {
  color: var(--text-primary);
}

/* ==================== EXPLORE LABELS ==================== */
#explore-labels {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 15;
}

.explore-label {
  position: absolute;
  pointer-events: auto;
  padding: 4px 10px;
  background: rgba(10, 10, 15, 0.75);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
  backdrop-filter: blur(4px);
  transform: translate(-50%, -50%);
}

.explore-label:hover {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--accent);
  transform: translate(-50%, -50%) scale(1.05);
  z-index: 5;
}

.explore-label-line {
  position: absolute;
  pointer-events: none;
  width: 1px;
  background: rgba(245, 158, 11, 0.2);
  transform-origin: top center;
}

.explore-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* ==================== INFO TOOLTIP ==================== */
.info-tooltip {
  position: fixed;
  z-index: 25;
  max-width: 280px;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  animation: tooltipIn 0.2s ease-out;
  pointer-events: auto;
}

@keyframes tooltipIn {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.info-tooltip h4 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.info-tooltip p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ==================== QUIZ PANEL ==================== */
.quiz-panel {
  position: fixed;
  top: 60px;
  right: 0;
  bottom: 0;
  width: 320px;
  z-index: 20;
  background: linear-gradient(180deg, rgba(18, 18, 26, 0.95) 0%, rgba(10, 10, 15, 0.97) 100%);
  backdrop-filter: blur(20px);
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.quiz-panel.hidden {
  display: flex !important;
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
}

.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quiz-header h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
}

.quiz-score {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
}

.quiz-instructions {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* ==================== LANDMARK LABELS (QUIZ) ==================== */
.landmark-labels {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.landmark-label-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.85rem;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: grab;
  transition: all 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.landmark-label-item:hover {
  background: var(--bg-card-hover);
  border-color: rgba(245, 158, 11, 0.2);
  transform: translateX(-2px);
}

.landmark-label-item:active {
  cursor: grabbing;
}

.landmark-label-item.correct {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--success);
  cursor: default;
  opacity: 0.7;
}

.landmark-label-item.correct .label-icon {
  color: var(--success);
}

.landmark-label-item .label-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.landmark-label-item .label-text {
  flex: 1;
}

/* ==================== DRAGGING ==================== */
.drag-ghost {
  position: fixed;
  z-index: 200;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: var(--bg-primary);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  pointer-events: none;
  transform: translate(-50%, -50%) rotate(-2deg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 0 2px var(--accent);
  white-space: nowrap;
  animation: dragPulse 1s ease-in-out infinite;
}

@keyframes dragPulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 0 2px var(--accent); }
  50% { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 0 4px var(--accent-glow); }
}

.drop-indicator {
  position: fixed;
  width: 40px;
  height: 40px;
  border: 2px dashed var(--accent);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 150;
  animation: dropPulse 0.8s ease-in-out infinite;
}

@keyframes dropPulse {
  0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
}

/* ==================== QUIZ FEEDBACK ==================== */
.quiz-feedback {
  min-height: 60px;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  line-height: 1.5;
  transition: all 0.3s ease;
}

.quiz-feedback.correct {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--success);
}

.quiz-feedback.incorrect {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.quiz-feedback.complete {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: var(--accent);
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
}

/* ==================== GLOW MARKER ==================== */
.glow-marker {
  position: fixed;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 20px var(--success-glow), 0 0 40px var(--success-glow);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 30;
  animation: glowPop 0.6s ease-out forwards;
}

@keyframes glowPop {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
  50% { transform: translate(-50%, -50%) scale(2); opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
}

/* ==================== COMPLETION OVERLAY ==================== */
.completion-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.completion-card {
  text-align: center;
  padding: 3rem;
  background: var(--bg-card);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  max-width: 400px;
  animation: cardPop 0.5s ease-out 0.2s both;
}

@keyframes cardPop {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.completion-card .trophy {
  font-size: 4rem;
  display: block;
  margin-bottom: 1rem;
}

.completion-card h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--accent) 0%, #fbbf24 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.completion-card p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.completion-card .score-display {
  font-family: var(--font-mono);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.completion-buttons {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

/* ==================== MOBILE HINT ==================== */
.mobile-hint {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  padding: 0.5rem 1rem;
  background: rgba(26, 26, 38, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 50px;
  font-size: 0.7rem;
  color: var(--text-muted);
  backdrop-filter: blur(8px);
  white-space: nowrap;
  transition: opacity 0.3s ease;
}

.mobile-hint.hidden {
  opacity: 0;
  pointer-events: none;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  .logo h1 {
    font-size: 2.5rem;
  }

  .tagline {
    font-size: 1.1rem;
  }

  .subtitle {
    font-size: 0.9rem;
  }

  .features {
    gap: 1rem;
  }

  .feature span {
    width: 48px;
    height: 48px;
    line-height: 48px;
    font-size: 1.5rem;
  }

  .feature p {
    font-size: 0.7rem;
  }

  .quiz-panel {
    width: 100%;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 45vh;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .quiz-panel.hidden {
    transform: translateY(100%);
  }

  .toolbar {
    padding: 0.5rem 0.75rem;
  }

  .toolbar-center h2 {
    font-size: 0.95rem;
  }

  .btn-mode {
    font-size: 0.7rem;
    padding: 0.35rem 0.8rem;
  }

  .explore-label {
    font-size: 0.55rem;
    padding: 3px 7px;
  }

  .btn-primary {
    font-size: 1rem;
    padding: 0.85rem 2rem;
  }

  .info-tooltip {
    max-width: 220px;
    padding: 0.75rem;
  }
}

@media (max-width: 480px) {
  .logo h1 {
    font-size: 2rem;
  }

  .features {
    gap: 0.75rem;
  }

  .quiz-panel {
    max-height: 50vh;
    padding: 1rem;
  }
}

/* ==================== SCROLLBAR ==================== */
.quiz-panel::-webkit-scrollbar {
  width: 4px;
}

.quiz-panel::-webkit-scrollbar-track {
  background: transparent;
}

.quiz-panel::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

/* ==================== UTILITY ==================== */
.hidden {
  display: none !important;
}
