body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
}

.pre-game {
  padding: 20px;
}

#map {
  height: 100vh;
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1;
}

#guessMap {
  height: 250px;
  width: 300px;
  border: 2px solid #333;
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: 0.5s all;
}

#guessMap:hover {
  height: 400px;
  width: 500px;
}

#gameContainer {
  position: relative;
  z-index: 5;
}

#controls {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 11;
  background: rgba(76, 175, 80, 0.95);
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  text-align: center;
  border: 3px solid #4caf50;
  display: none;
  animation: fadeInBounce 0.5s ease-out;
  white-space: nowrap;
}

@keyframes fadeInBounce {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
  }

  60% {
    opacity: 1;
    transform: scale(1.05) translateY(-5px);
  }

  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

#submitBtn,
#newGameBtn,
#endTrainingBtn,
#startGameBtn {
  margin: 0;
  padding: 12px 20px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
}

#submitBtn {
  background-color: #ffffff;
  color: #4caf50;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#submitBtn:hover {
  background-color: #f5f5f5;
  transform: scale(1.05);
}

#newGameBtn {
  background-color: #ffffff;
  color: #008cba;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#newGameBtn:hover {
  background-color: #f5f5f5;
  transform: scale(1.05);
}

#endTrainingBtn {
  background-color: #ff5722;
  color: white;
  border: 2px solid #ff5722;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  margin-left: 10px;
}

#endTrainingBtn:hover {
  background-color: #e64a19;
  transform: scale(1.05);
}

#startGameBtn {
  background-color: #ff9800;
  color: white;
  border: none;
}

#result {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 100;
  display: none;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

#result .result-content {
  background: white;
  padding: 40px;
  border-radius: 15px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  text-align: center;
  max-width: 500px;
  width: 90%;
  overflow: auto;
}

#result .result-content h2 {
  margin: 0 0 20px 0;
  color: #333;
  font-size: 28px;
}

#result .result-content .distance-info {
  font-size: 32px;
  font-weight: bold;
  margin: 25px 0;
  color: #333;
  line-height: 1.3;
}

#result .result-content .score-info {
  font-size: 18px;
  font-weight: normal;
  color: #888;
  margin: 15px 0;
}

#result .result-content .result-map {
  margin: 20px 0;
  text-align: center;
}

#result .result-content .result-map #resultMapContainer {
  height: 250px;
  width: 100%;
  border: 2px solid #ddd;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  margin-bottom: 15px;
}

#result .close-result-btn {
  background: #008cba;
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 16px;
  border-radius: 8px;
  cursor: pointer;
  margin: 10px;
}

#result .close-result-btn:hover {
  background: #007bb5;
}

#result .new-game-result-btn {
  background: #4caf50;
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 16px;
  border-radius: 8px;
  cursor: pointer;
  margin: 10px;
}

#result .new-game-result-btn:hover {
  background: #45a049;
}

#result .end-training-result-btn {
  background: #ff5722;
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 16px;
  border-radius: 8px;
  cursor: pointer;
  margin: 10px;
}

#result .end-training-result-btn:hover {
  background: #e64a19;
}

#result .result-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

#gameInfo {
  display: none;
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  background: rgba(255, 255, 255, 0.95);
  padding: 10px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  text-align: center;
  max-width: 500px;
}

#gameTimer {
  position: fixed;
  top: 20px;
  left: 80px;
  z-index: 15;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 24px;
  font-weight: bold;
  font-family: "Courier New", monospace;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  display: none;
}

.score {
  color: #4caf50;
}

.error {
  color: #ff0000;
  background-color: #ffe6e6;
  padding: 10px;
  border-radius: 5px;
  margin: 10px 0;
}

.info {
  color: #0066cc;
  background-color: #e6f3ff;
  padding: 10px;
  border-radius: 5px;
  margin: 10px 0;
}

.debug {
  color: #666;
  font-size: 12px;
  margin: 5px 0;
}

.settings-row {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.settings-label {
  font-weight: bold;
  margin-bottom: 8px;
  color: #fff;
  font-size: 16px;
}

#locationInput {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  box-sizing: border-box;
}

#radiusSelect,
#roundsSelect,
#customRoundsInput {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  box-sizing: border-box;
}

.settings-buttons {
  display: flex;
  gap: 15px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.generate-share-btn {
  flex: 1;
  background: linear-gradient(45deg, #2196f3, #1976d2);
  color: white;
  border: none;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(33, 150, 243, 0.4);
  min-width: 180px;
}

.generate-share-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(33, 150, 243, 0.6);
}

.back-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.4);
  padding: 12px 20px;
  font-size: 16px;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.back-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.6);
}

.start-game-btn {
  flex: 2;
  background: linear-gradient(45deg, #ff9800, #ff5722);
  color: white;
  border: none;
  padding: 12px 20px;
  font-size: 16px;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 152, 0, 0.4);
}

.start-game-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 152, 0, 0.6);
}



/* Game Summary Styles */
.game-summary {
  text-align: left;
}

.rounds-summary {
  margin: 20px 0;
  padding: 15px;
  background-color: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #dee2e6;
}

.round-result {
  padding: 8px 0;
  border-bottom: 1px solid #e9ecef;
  font-family: monospace;
}

.round-result:last-child {
  border-bottom: none;
}

/* Accordion styling for round summaries */
.round-accordion-item {
  border: 1px solid #e9ecef;
  border-radius: 8px;
  margin-bottom: 10px;
  overflow: hidden;
}

.round-accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background-color: #f8f9fa;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.round-accordion-header:hover {
  background-color: #e9ecef;
}

.round-accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  padding: 0 15px;
}

.round-accordion-content.expanded {
  max-height: 300px;
  padding: 15px;
}

.accordion-toggle {
  font-size: 16px;
  font-weight: bold;
  color: #666;
  transition: transform 0.3s ease;
}

.round-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex: 1;
  margin-right: 15px;
}

/* Updated round summary styling */
.round-summary-item {
  display: flex;
  flex-direction: column;
  padding: 15px 0;
  border-bottom: 1px solid #e9ecef;
  font-size: 16px;
}

.round-summary-item:last-child {
  border-bottom: none;
}

.round-label {
  font-weight: bold;
  color: #333;
  font-size: 18px;
}

.round-stats {
  display: flex;
  gap: 20px;
  align-items: center;
}

.round-distance {
  font-size: 16px;
  font-weight: bold;
  color: #666;
}

.round-time {
  font-size: 14px;
  color: #888;
}

.round-score {
  font-size: 18px;
  font-weight: bold;
  color: #4caf50;
}

.round-map-container {
  margin-top: 10px;
}

.summary-map {
  height: 200px;
  width: 100%;
  border: 2px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.total-summary {
  margin-top: 20px;
  padding: 15px;
  background-color: #e3f2fd;
  border-radius: 8px;
  border: 2px solid #2196f3;
}

.total-summary h4 {
  margin-top: 0;
  color: #1976d2;
}

/* New clean total summary styling */
.total-summary-clean {
  margin-top: 25px;
  padding: 20px;
  background-color: #e8f5e8;
  border-radius: 12px;
  border: 2px solid #4caf50;
  text-align: center;
}

.summary-title {
  font-size: 24px;
  font-weight: bold;
  color: #2e7d2e;
  margin-bottom: 15px;
}

.total-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px 0;
  padding: 8px 0;
}

.total-label {
  font-size: 16px;
  color: #333;
  font-weight: normal;
}

.total-value {
  font-size: 18px;
  font-weight: bold;
  color: #333;
}

.total-value.large {
  font-size: 24px;
  color: #666;
}

.total-value.average-time {
  font-size: 22px;
  color: #666;
}

.total-value.score-large {
  font-size: 28px;
  color: #4caf50;
}

.total-summary p {
  margin: 8px 0;
  font-weight: bold;
}

.map-toggle-btn {
  display: none !important;
}

.map-toggle-btn:hover {
  background: white;
}

#guessMap.minimized {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  opacity: 0.7;
}

#debug {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 10px;
  border-radius: 5px;
  max-width: 300px;
  max-height: 200px;
  overflow-y: auto;
  font-size: 10px;
}

@media (max-width: 768px) {
  #guessMap {
    width: 200px;
    height: 150px;
    top: 10px;
    right: 10px;
  }

  #controls {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 10px;
  }

  .map-toggle-btn {
    top: 170px;
    right: 20px;
  }

  #gameInfo {
    top: 10px;
    max-width: 300px;
    font-size: 14px;
  }

  #result {
    top: 10px;
    left: 10px;
    max-width: 200px;
    font-size: 14px;
  }
}

/* Start Screen Styles */
.start-screen {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-align: center;
  padding: 20px;
}

.start-content {
  background: rgba(255, 255, 255, 0.1);
  padding: 40px;
  border-radius: 15px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  max-width: 600px;
  width: 100%;
}

.start-content h1 {
  font-size: 2.5em;
  margin-bottom: 20px;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.start-content p {
  font-size: 1.2em;
  line-height: 1.6;
  margin-bottom: 30px;
  color: #f0f0f0;
}

.settings-form {
  text-align: left;
  margin-top: 30px;
}

.start-btn {
  background: linear-gradient(45deg, #ff9800, #ff5722);
  color: white;
  border: none;
  padding: 15px 30px;
  font-size: 1.1em;
  font-weight: bold;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 20px;
  box-shadow: 0 4px 15px rgba(255, 152, 0, 0.4);
}

.start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 152, 0, 0.6);
}

.start-game-btn {
  background: linear-gradient(45deg, #ff9800, #ff5722);
  color: white;
  border: none;
  padding: 15px 30px;
  font-size: 1.1em;
  font-weight: bold;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 20px;
  box-shadow: 0 4px 15px rgba(255, 152, 0, 0.4);
  width: 100%;
}

.start-game-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 152, 0, 0.6);
}

@media (max-width: 768px) {
  .start-content {
    padding: 30px 20px;
  }

  .start-content h1 {
    font-size: 2em;
  }

  .start-content p {
    font-size: 1.1em;
  }
}

/* Shared Game Screen Styles */
.shared-game-info {
  background: rgba(255, 255, 255, 0.15);
  padding: 20px;
  border-radius: 10px;
  margin: 20px 0;
  text-align: left;
}

.shared-game-info h3 {
  margin: 0 0 15px 0;
  color: #fff;
  text-align: center;
}

.info-item {
  display: flex;
  justify-content: space-between;
  margin: 10px 0;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.info-item:last-child {
  border-bottom: none;
}

.info-item strong {
  color: #fff;
}

.info-item span {
  color: #e0e0e0;
  font-weight: bold;
}

.shared-game-buttons {
  display: flex;
  gap: 15px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.back-setup-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.4);
  padding: 15px 25px;
  font-size: 16px;
  font-weight: bold;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 200px;
}

.back-setup-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-2px);
}

.start-shared-game-btn {
  flex: 2;
  background: linear-gradient(45deg, #4caf50, #45a049);
  color: white;
  border: none;
  padding: 15px 30px;
  font-size: 1.1em;
  font-weight: bold;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
  min-width: 180px;
}

.start-shared-game-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.6);
}
