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

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: #0a0a1a;
  color: #ffffff;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

.hidden {
  display: none !important;
}

/* ── Start Screen ────────────────────────────────── */
#start-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: linear-gradient(135deg, #0a0a2e 0%, #1a1a4e 50%, #0a2a3e 100%);
  position: relative;
  overflow: hidden;
}

#start-screen::before {
  content: "";
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(66, 135, 245, 0.15) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: pulse 4s ease-in-out infinite;
}

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

.logo {
  font-size: 5rem;
  font-weight: 800;
  letter-spacing: -2px;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
  background: linear-gradient(135deg, #4287f5, #42f5a7);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
}

.globe-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  display: block;
  animation: spin 20s linear infinite;
  position: relative;
  z-index: 1;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.tagline {
  font-size: 1.3rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 2.5rem;
  position: relative;
  z-index: 1;
}

#play-btn {
  padding: 16px 48px;
  font-size: 1.2rem;
  font-weight: 700;
  border: none;
  border-radius: 50px;
  background: linear-gradient(135deg, #4287f5, #42d5f5);
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
  text-transform: uppercase;
  letter-spacing: 2px;
}

#play-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 40px rgba(66, 135, 245, 0.4);
}

#play-btn:active {
  transform: translateY(-1px);
}

.start-info {
  margin-top: 2rem;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.5);
  position: relative;
  z-index: 1;
  text-align: center;
  line-height: 1.8;
}

/* ── Game Screen ─────────────────────────────────── */
#game-screen {
  display: flex;
  height: 100vh;
  width: 100vw;
  position: relative;
}

.streetview-container {
  flex: 1;
  position: relative;
  background: #111;
}

#streetview-frame {
  width: 100%;
  height: 100%;
  border: none;
}

.game-hud {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 1000;
  display: flex;
  gap: 10px;
}

.hud-item {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.hud-round {
  color: #42d5f5;
}

.hud-score {
  color: #42f5a7;
}

.map-panel {
  position: absolute;
  bottom: 24px;
  right: 24px;
  width: 400px;
  height: 300px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.15);
  z-index: 1000;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.map-panel:hover {
  width: 550px;
  height: 400px;
}

#guess-map {
  flex: 1;
  width: 100%;
}

#guess-panel {
  padding: 10px;
  background: rgba(10, 10, 26, 0.95);
  display: flex;
  justify-content: center;
}

#submit-guess {
  width: 100%;
  padding: 10px;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #4287f5, #42d5f5);
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

#submit-guess:disabled {
  background: #333;
  color: #666;
  cursor: not-allowed;
}

#submit-guess:not(:disabled):hover {
  box-shadow: 0 4px 20px rgba(66, 135, 245, 0.4);
}

/* ── Round Result Overlay ────────────────────────── */
#round-result {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(10, 10, 30, 0.95);
  backdrop-filter: blur(20px);
  padding: 32px 40px;
  border-radius: 20px;
  z-index: 2000;
  text-align: center;
  min-width: 360px;
  border: 1px solid rgba(66, 135, 245, 0.3);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  animation: slideIn 0.4s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translate(-50%, -45%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

.result-title {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

#result-location {
  font-size: 1.3rem;
  font-weight: 700;
  color: #42d5f5;
  margin-bottom: 20px;
}

.result-stats {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 20px;
}

.stat {
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: #42f5a7;
}

.stat-label {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.score-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  margin-bottom: 20px;
  overflow: hidden;
}

#score-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #f54242, #f5a742, #42f5a7);
  border-radius: 4px;
  transition: width 1s ease;
  width: 0%;
}

#next-btn {
  padding: 12px 32px;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #4287f5, #42d5f5);
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

#next-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(66, 135, 245, 0.4);
}

/* ── Markers ─────────────────────────────────────── */
.marker-pin {
  width: 24px;
  height: 24px;
  border-radius: 50% 50% 50% 0;
  position: absolute;
  transform: rotate(-45deg);
  left: 50%;
  top: 50%;
  margin: -18px 0 0 -12px;
}

.marker-pin::after {
  content: "";
  width: 12px;
  height: 12px;
  margin: 6px 0 0 6px;
  background: rgba(255, 255, 255, 0.9);
  position: absolute;
  border-radius: 50%;
}

.guess-pin {
  background: #4287f5;
  border: 2px solid #fff;
}

.actual-pin {
  background: #42f5a7;
  border: 2px solid #fff;
}

.guess-marker,
.actual-marker {
  background: transparent;
  border: none;
}

.result-marker {
  background: transparent;
  border: none;
}

.result-marker-label {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4287f5, #42d5f5);
  color: white;
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ── Final Screen ────────────────────────────────── */
#final-screen {
  display: flex;
  height: 100vh;
  background: linear-gradient(135deg, #0a0a2e 0%, #1a1a4e 50%, #0a2a3e 100%);
  overflow: hidden;
}

.final-left {
  flex: 1;
  padding: 40px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.final-header {
  text-align: center;
  margin-bottom: 30px;
}

.final-header h2 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #4287f5, #42f5a7);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

#final-score {
  font-size: 4rem;
  font-weight: 800;
  color: #42f5a7;
}

#max-possible {
  color: rgba(255, 255, 255, 0.4);
  font-size: 1.2rem;
}

#score-percentage {
  font-size: 1.5rem;
  font-weight: 700;
  color: #42d5f5;
}

#rating {
  font-size: 1.3rem;
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.8);
}

#round-summary {
  list-style: none;
  width: 100%;
  max-width: 500px;
}

.summary-item {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 0.2s ease;
}

.summary-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.summary-round {
  font-size: 0.8rem;
  font-weight: 700;
  color: #42d5f5;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.summary-location {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.summary-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
}

.summary-score {
  color: #42f5a7;
  font-weight: 600;
}

.final-right {
  flex: 1;
  position: relative;
}

#result-map {
  width: 100%;
  height: 100%;
}

#play-again-btn {
  margin-top: 24px;
  padding: 14px 40px;
  font-size: 1.1rem;
  font-weight: 700;
  border: none;
  border-radius: 50px;
  background: linear-gradient(135deg, #4287f5, #42d5f5);
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 2px;
}

#play-again-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 40px rgba(66, 135, 245, 0.4);
}

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 768px) {
  .logo {
    font-size: 3rem;
  }

  .tagline {
    font-size: 1rem;
    padding: 0 20px;
    text-align: center;
  }

  .map-panel {
    width: 280px;
    height: 200px;
    bottom: 16px;
    right: 16px;
  }

  .map-panel:hover {
    width: 320px;
    height: 260px;
  }

  #round-result {
    min-width: auto;
    width: 90%;
    padding: 24px 20px;
  }

  #final-screen {
    flex-direction: column;
  }

  .final-left {
    padding: 20px;
  }

  .final-right {
    height: 300px;
  }

  .final-header h2 {
    font-size: 1.8rem;
  }

  #final-score {
    font-size: 2.5rem;
  }
}
