/*
 * GeoGuess Online CSS
 *
 * The colour palette uses cool blue accents on a neutral grey base. Feel
 * free to tweak these values or extend the palette for your own themes.
 */

:root {
  /* Base colours */
  --gray-10: #f3f4f6;
  --gray-20: #e5e7eb;
  --gray-50: #9ca3af;
  --gray-80: #374151;
  --gray-100: #1f2937;

  /* Accent colours */
  --blue-50: #3b82f6;
  --blue-80: #1e40af;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
    Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--gray-100);
  color: var(--gray-10);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header.header {
  padding: 0.75rem 1rem;
  background-color: var(--blue-80);
  color: var(--gray-10);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

header .title {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 700;
}

header .title a {
  color: inherit;
  text-decoration: none;
}


.user-menu {
  position: absolute;
  top: 50%;
  right: 1rem;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-menu .username {
  font-weight: 500;
}

.user-menu .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
}

.user-menu .dropdown {
  position: absolute;
  right: 0;
  margin-top: 0.5rem;
  background-color: var(--gray-100);
  border: 1px solid var(--gray-80);
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
}

.user-menu .dropdown a {
  color: var(--gray-10);
  padding: 0.5rem 1rem;
  text-decoration: none;
  white-space: nowrap;
}

.user-menu .dropdown a:hover {
  background-color: var(--gray-80);
}

main.main {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

/* Main game area */
.game-area {
  width: 100%;
  height: 55vh;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  background-color: var(--gray-100);
  position: relative;
}

/* Street View panorama */
.panorama {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* HUD: scoreboard and controls */
.hud {
  width: 100%;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
}

.scoreboard {
  display: flex;
  gap: 2rem;
  background-color: var(--gray-100);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--gray-80);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.stat .label {
  font-size: 0.8rem;
  color: var(--gray-20);
  letter-spacing: 0.5px;
}

.stat .value {
  font-size: 1.6rem;
  font-weight: 700;
  margin-top: 0.25rem;
  color: var(--blue-50);
}

.controls {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 0.5rem;
}

.btn {
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-10);
  background-color: var(--gray-80);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}
.btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: none;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Specific button colours */
.btn-start {
  background-color: var(--blue-50);
}
.btn-guess {
  background-color: var(--blue-80);
}
.btn-next {
  background-color: var(--gray-50);
}

.message {
  margin-top: 0.5rem;
  min-height: 1.5rem;
  font-size: 1rem;
  color: var(--blue-50);
}

/* Guess map container */
.map-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

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

.login-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(31, 41, 55, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.login-box {
  background-color: var(--gray-100);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#usernamePrompt {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#usernamePrompt input {
  padding: 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--gray-80);
}

#usernamePrompt button {
  background-color: var(--blue-50);
}

.hidden {
  display: none !important;
}

/* Start screen and result popup overlays */
.start-screen,
.result-popup {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.start-screen {
  background-color: var(--gray-100);
  z-index: 5;
}

.result-popup {
  background-color: rgba(31, 41, 55, 0.95);
  z-index: 10;
}

.result-box {
  background-color: var(--gray-100);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

footer.footer {
  padding: 0.75rem 1rem;
  background-color: var(--blue-80);
  color: var(--gray-10);
  text-align: center;
  font-size: 0.75rem;
}

@media (max-width: 700px) {
  header.header {
    justify-content: flex-start;
  }
  .scoreboard {
    flex-direction: column;
    gap: 1rem;
    align-items: center;
  }
  .stat .value {
    font-size: 1.4rem;
  }
  .btn {
    font-size: 0.9rem;
  }
}
