/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #2196f3;
  --primary-dark: #1976d2;
  --secondary-color: #ff5722;
  --success-color: #4caf50;
  --warning-color: #ff9800;
  --error-color: #f44336;
  --background-color: #0f1419;
  --surface-color: #1e2328;
  --text-primary: #ffffff;
  --text-secondary: #b0bec5;
  --border-color: #37474f;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  --border-radius: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: var(--background-color);
  color: var(--text-primary);
  overflow: hidden;
  line-height: 1.6;
}

/* Loading Screen */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 0.5s ease;
}

.loading-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-content {
  text-align: center;
  color: white;
}

.loading-logo {
  font-size: 5rem;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 2rem;
}

.loading-content h2 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.loading-content p {
  font-size: 1.2rem;
  opacity: 0.9;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* Screen Management */
.screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
  transform: translateY(20px);
}

.screen.active {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--border-radius);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.btn-secondary {
  background: var(--surface-color);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
  background: #2a3038;
  transform: translateY(-2px);
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.2rem;
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

.btn-icon {
  padding: 0.75rem;
  width: 48px;
  height: 48px;
}

.btn-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: var(--transition);
}

.btn-close:hover {
  color: var(--text-primary);
}

/* Main Menu */
#main-menu {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.menu-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
      135deg,
      rgba(102, 126, 234, 0.9) 0%,
      rgba(118, 75, 162, 0.9) 100%
    ),
    url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.15)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>'),
    radial-gradient(
      circle at 20% 80%,
      rgba(120, 119, 198, 0.3) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 20%,
      rgba(255, 119, 198, 0.3) 0%,
      transparent 50%
    );
  background-size: cover, 50px 50px, 100% 100%, 100% 100%;
  animation: backgroundShift 20s ease-in-out infinite;
}

@keyframes backgroundShift {
  0%,
  100% {
    background-position: 0% 0%, 0px 0px, 0% 0%, 0% 0%;
  }
  50% {
    background-position: 100% 100%, 25px 25px, 100% 100%, 100% 100%;
  }
}

.menu-container {
  text-align: center;
  max-width: 500px;
  padding: 2rem;
  position: relative;
  z-index: 1;
}

.logo-section {
  margin-bottom: 3rem;
}

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

.logo i {
  font-size: 4rem;
  color: white;
}

.logo h1 {
  font-size: 3.5rem;
  font-weight: 800;
  color: white;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.tagline {
  font-size: 1.3rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 400;
}

.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 3rem;
}

.menu-buttons .btn {
  width: 100%;
  justify-content: flex-start;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

.menu-buttons .btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.menu-buttons .btn-primary {
  background: rgba(76, 175, 80, 0.9);
  border-color: rgba(76, 175, 80, 1);
}

.menu-buttons .btn-primary:hover {
  background: rgba(76, 175, 80, 1);
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: var(--transition);
}

.modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.95);
}

.modal-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
      135deg,
      rgba(102, 126, 234, 0.95) 0%,
      rgba(118, 75, 162, 0.95) 100%
    ),
    url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.15)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>'),
    radial-gradient(
      circle at 20% 80%,
      rgba(120, 119, 198, 0.3) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 20%,
      rgba(255, 119, 198, 0.3) 0%,
      transparent 50%
    );
  background-size: cover, 50px 50px, 100% 100%, 100% 100%;
  animation: backgroundShift 20s ease-in-out infinite;
}

/* Confirmation Modal */
.confirmation-container {
  background: rgba(30, 35, 40, 0.95);
  border-radius: var(--border-radius);
  padding: 2rem;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  position: relative;
  z-index: 10000;
}

.confirmation-header {
  margin-bottom: 1.5rem;
}

.confirmation-header i {
  font-size: 3rem;
  color: var(--warning-color);
  margin-bottom: 1rem;
  display: block;
}

.confirmation-header h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.confirmation-content {
  margin-bottom: 2rem;
}

.confirmation-content p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.confirmation-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.confirmation-actions .btn {
  flex: 1;
  max-width: 120px;
}

/* Settings Screen */
#settings-screen {
  background: linear-gradient(
      135deg,
      rgba(102, 126, 234, 0.95) 0%,
      rgba(118, 75, 162, 0.95) 100%
    ),
    url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.15)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>'),
    radial-gradient(
      circle at 20% 80%,
      rgba(120, 119, 198, 0.3) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 20%,
      rgba(255, 119, 198, 0.3) 0%,
      transparent 50%
    );
  background-size: cover, 50px 50px, 100% 100%, 100% 100%;
  animation: backgroundShift 20s ease-in-out infinite;
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-container {
  background: rgba(30, 35, 40, 0.95);
  border-radius: 20px;
  padding: 2.5rem;
  max-width: 600px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(25px);
  position: relative;
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

.settings-header::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 60px;
  height: 2px;
  background: linear-gradient(
    90deg,
    var(--primary-color),
    var(--secondary-color)
  );
  border-radius: 2px;
}

.settings-header h2 {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff, #e3f2fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.setting-group {
  margin-bottom: 2rem;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.05),
    rgba(255, 255, 255, 0.02)
  );
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
}

.setting-group h3 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.setting-group h3::before {
  content: "";
  width: 4px;
  height: 20px;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  border-radius: 2px;
}

.setting-item {
  margin-bottom: 1.5rem;
}

.setting-item label {
  display: block;
  margin-bottom: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
}

.setting-item select {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0.05)
  );
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

.setting-item select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.2);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.15),
    rgba(255, 255, 255, 0.08)
  );
}

.setting-item select option {
  background: var(--surface-color);
  color: var(--text-primary);
  padding: 0.75rem;
  border: none;
}

.setting-item select option:hover,
.setting-item select option:focus,
.setting-item select option:checked {
  background: var(--primary-color);
  color: white;
}

.setting-item input[type="checkbox"] {
  margin-right: 0.75rem;
  width: 18px;
  height: 18px;
  accent-color: var(--primary-color);
}

.settings-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 2px solid rgba(255, 255, 255, 0.1);
}

.settings-actions .btn {
  padding: 1rem 2rem;
  font-weight: 600;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.settings-actions .btn-secondary {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0.05)
  );
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.settings-actions .btn-secondary:hover {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.15),
    rgba(255, 255, 255, 0.08)
  );
  transform: translateY(-2px);
}

.settings-actions .btn-primary {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--primary-dark)
  );
  border: none;
  box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

.settings-actions .btn-primary:hover {
  box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
  transform: translateY(-2px);
}

/* Statistics Screen */
#stats-screen {
  background: linear-gradient(
      135deg,
      rgba(102, 126, 234, 0.95) 0%,
      rgba(118, 75, 162, 0.95) 100%
    ),
    url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.15)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>'),
    radial-gradient(
      circle at 20% 80%,
      rgba(120, 119, 198, 0.3) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 20%,
      rgba(255, 119, 198, 0.3) 0%,
      transparent 50%
    );
  background-size: cover, 50px 50px, 100% 100%, 100% 100%;
  animation: backgroundShift 20s ease-in-out infinite;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stats-container {
  background: rgba(30, 35, 40, 0.95);
  border-radius: 20px;
  padding: 2.5rem;
  max-width: 800px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(25px);
  position: relative;
}

.stats-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

.stats-header::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 60px;
  height: 2px;
  background: linear-gradient(
    90deg,
    var(--primary-color),
    var(--secondary-color)
  );
  border-radius: 2px;
}

.stats-header h2 {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff, #e3f2fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stats-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0.05)
  );
  border-radius: 16px;
  padding: 2rem 1.5rem;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--primary-color),
    var(--secondary-color)
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.25);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-card.highlight {
  background: linear-gradient(
    135deg,
    rgba(33, 150, 243, 0.9),
    rgba(25, 118, 210, 0.9)
  );
  border-color: rgba(33, 150, 243, 0.5);
  box-shadow: 0 10px 30px rgba(33, 150, 243, 0.3);
}

.stat-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.stat-value {
  font-size: 2.3rem;
  font-weight: 900;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #ffffff, #e3f2fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

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

.recent-games-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.recent-games h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.recent-games-header .btn {
  background: linear-gradient(
    135deg,
    rgba(244, 67, 54, 0.9),
    rgba(211, 47, 47, 0.9)
  );
  border: none;
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(244, 67, 54, 0.3);
}

.recent-games-header .btn:hover {
  background: linear-gradient(
    135deg,
    rgba(244, 67, 54, 1),
    rgba(211, 47, 47, 1)
  );
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(244, 67, 54, 0.4);
}

.games-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.game-item {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.08),
    rgba(255, 255, 255, 0.03)
  );
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

.game-item:hover {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.12),
    rgba(255, 255, 255, 0.06)
  );
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateX(5px);
}

.no-games {
  text-align: center;
  color: var(--text-secondary);
  padding: 2rem;
  font-style: italic;
}

/* Game Screen */
#game-screen {
  background: var(--background-color);
  display: flex;
  flex-direction: column;
}

.game-header {
  background: var(--surface-color);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
}

.game-info {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.round-counter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.round-text {
  color: var(--text-secondary);
}

.round-numbers {
  color: var(--primary-color);
  font-size: 1.1rem;
}

.score-display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--success-color);
}

.timer-display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--warning-color);
}

.timer-display.warning {
  color: var(--error-color);
  animation: pulse 1s infinite;
}

/* Street View */
.streetview-container {
  flex: 1;
  position: relative;
  background: #000;
}

.panorama {
  width: 100%;
  height: 100%;
}

.panorama-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: white;
  z-index: 100;
  background: rgba(0, 0, 0, 0.8);
  padding: 2rem;
  border-radius: var(--border-radius);
  backdrop-filter: blur(10px);
}

.panorama-loading.hidden {
  display: none;
}

.streetview-controls {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 200;
  display: flex;
  gap: 0.5rem;
}

.streetview-controls .btn {
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

.streetview-controls .btn:hover {
  background: rgba(0, 0, 0, 0.9);
}

/* Map Panel */
.map-panel {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  width: 400px;
  height: 300px;
  background: var(--surface-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  z-index: 500;
  transition: var(--transition);
  border: 1px solid var(--border-color);
}

.map-panel.minimized {
  width: 200px;
  height: 150px;
}

.map-panel.maximized {
  width: 60%;
  height: 60%;
  bottom: 50%;
  right: 50%;
  transform: translate(50%, 50%);
}

.map-panel.hover-expanded {
  width: 500px;
  height: 400px;
  transition: all 0.3s ease;
}

.map-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface-color);
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.map-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.map-controls {
  display: flex;
  gap: 0.5rem;
}

.map-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.guess-map {
  width: 100%;
  height: 100%;
}

.map-actions {
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 0.5rem;
  background: var(--surface-color);
  border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.map-actions .btn {
  flex: 1;
}

/* Results Screen */
#results-screen {
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
}

.results-overlay {
  background: rgba(0, 0, 0, 0.5);
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
}

.results-container {
  background: var(--surface-color);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  max-width: 500px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
}

.results-header h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.results-score {
  margin-bottom: 1.5rem;
}

.score-circle {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--success-color), #66bb6a);
  color: white;
  margin: 0 auto;
}

.score-circle.large {
  width: 160px;
  height: 160px;
}

.score-circle .score-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}

.score-circle.large .score-value {
  font-size: 2.5rem;
}

.score-circle .score-label {
  font-size: 0.8rem;
  opacity: 0.9;
  font-weight: 500;
}

.results-details {
  margin-bottom: 1.5rem;
}

.distance-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: var(--background-color);
  border-radius: var(--border-radius);
  padding: 1rem;
  border: 1px solid var(--border-color);
}

.distance-icon {
  font-size: 2rem;
}

.distance-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-color);
}

.distance-unit {
  font-size: 1rem;
  color: var(--text-secondary);
}

.result-map-container {
  margin: 1.5rem 0;
  border-radius: var(--border-radius);
  overflow: hidden;
  height: 200px;
  border: 1px solid var(--border-color);
}

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

.results-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

/* Final Results */
#final-results-screen {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  overflow-y: auto;
}

.final-results-container {
  text-align: center;
  max-width: 700px;
  padding: 2rem;
  max-height: 90vh;
  overflow-y: auto;
}

.final-header {
  margin-bottom: 3rem;
}

.final-header h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 2rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.final-score {
  margin-bottom: 2rem;
}

.score-rating {
  margin-bottom: 2rem;
}

.rating-stars {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 2rem;
  color: #ffd700;
}

.rating-text {
  font-size: 1.5rem;
  font-weight: 600;
}

.rounds-summary {
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius);
  padding: 2rem;
  margin-bottom: 2rem;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.rounds-summary h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.rounds-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.round-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.final-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.final-actions .btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
}

.final-actions .btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.final-actions .btn-primary {
  background: rgba(76, 175, 80, 0.9);
  border-color: rgba(76, 175, 80, 1);
}

.final-actions .btn-primary:hover {
  background: rgba(76, 175, 80, 1);
}

/* Notification System */
.notification {
  position: fixed;
  top: 2rem;
  right: 2rem;
  background: rgba(30, 35, 40, 0.95);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  z-index: 10001;
  transform: translateX(400px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 350px;
}

.notification.show {
  transform: translateX(0);
  opacity: 1;
}

.notification-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-primary);
  font-weight: 500;
}

.notification-success {
  border-left: 4px solid var(--success-color);
}

.notification-success .notification-content i {
  color: var(--success-color);
}

.notification-error {
  border-left: 4px solid var(--error-color);
}

.notification-error .notification-content i {
  color: var(--error-color);
}

.notification-warning {
  border-left: 4px solid var(--warning-color);
}

.notification-warning .notification-content i {
  color: var(--warning-color);
}

.notification-info {
  border-left: 4px solid var(--primary-color);
}

.notification-info .notification-content i {
  color: var(--primary-color);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .game-header {
    padding: 0.75rem 1rem;
  }

  .game-info {
    gap: 1rem;
    font-size: 0.9rem;
  }

  .map-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 60%;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    transform: translateY(calc(100% - 100px));
    transition: transform 0.3s ease;
    z-index: 1000;
  }

  .map-panel.expanded {
    transform: translateY(0);
  }

  .map-panel.minimized,
  .map-panel.maximized {
    width: 100%;
    height: 60%;
    bottom: 0;
    right: 0;
    transform: translateY(calc(100% - 100px));
  }

  .map-panel.expanded.minimized,
  .map-panel.expanded.maximized {
    transform: translateY(0);
  }

  /* Ensure map header is always visible on mobile */
  .map-header {
    background: var(--surface-color);
    border-bottom: 2px solid var(--primary-color);
    min-height: 60px;
    display: flex;
    align-items: center;
  }

  /* Make map container take remaining space */
  .map-container {
    flex: 1;
    min-height: 200px;
  }

  .streetview-controls {
    top: 0.5rem;
    right: 0.5rem;
  }

  .stats-overview {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .stat-card {
    padding: 1.5rem 1rem;
  }

  .stat-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
  }

  .stat-value {
    font-size: 2.2rem;
    margin-bottom: 0.25rem;
  }

  .stat-label {
    font-size: 0.85rem;
  }

  .results-actions,
  .final-actions {
    flex-direction: column;
  }

  .logo h1 {
    font-size: 2.5rem;
  }

  .menu-container {
    padding: 1rem;
  }

  .final-header h1 {
    font-size: 2rem;
  }

  .notification {
    top: 1rem;
    right: 1rem;
    left: 1rem;
    max-width: none;
    transform: translateY(-100px);
  }

  .notification.show {
    transform: translateY(0);
  }
}

/* Extra small screens */
@media (max-width: 480px) {
  .stats-overview {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .stat-card {
    padding: 1.25rem 1rem;
  }

  .stat-icon {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
  }

  .stat-value {
    font-size: 2rem;
  }

  .stat-label {
    font-size: 0.8rem;
  }

  .stats-container {
    padding: 1.5rem;
    width: 95%;
  }

  .stats-header h2 {
    font-size: 2rem;
  }
}
