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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.game-container {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 900px;
  width: 100%;
  position: relative;
}

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

.header h1 {
  color: #667eea;
  font-size: 2.5em;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.instructions {
  color: #666;
  font-size: 1.1em;
  margin-bottom: 10px;
}

.info-panel {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 15px;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  border-radius: 10px;
}

.caught-list h3 {
  color: #667eea;
  margin-bottom: 10px;
  font-size: 1.2em;
}

#caught-countries {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 600px;
}

.country-tag {
  background: #667eea;
  color: white;
  padding: 5px 12px;
  border-radius: 15px;
  font-size: 0.9em;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.progress {
  text-align: right;
  color: #666;
  font-size: 1.1em;
  font-weight: bold;
}

#remaining-count {
  color: #667eea;
  font-size: 1.5em;
}

.timer-container {
  position: relative;
  margin-bottom: 10px;
}

.countdown-timer {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 48px;
  font-weight: bold;
  color: #667eea;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
  z-index: 100;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  animation: timerPulse 1s ease infinite;
}

.countdown-timer.warning {
  color: #ff4444;
  animation: timerWarning 0.5s ease infinite;
}

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

@keyframes timerWarning {
  0%, 100% {
    transform: scale(1);
    color: #ff4444;
  }
  50% {
    transform: scale(1.15);
    color: #ff0000;
  }
}

#gameCanvas {
  display: block;
  margin: 0 auto;
  background: #f0f4f8;
  border-radius: 10px;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
}

.result-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeInOverlay 0.5s ease;
}

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

.result-overlay.hidden {
  display: none;
}

.result-content {
  background: white;
  padding: 50px;
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.5s ease;
}

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

.result-content h2 {
  color: #667eea;
  font-size: 2.5em;
  margin-bottom: 30px;
}

.final-country {
  font-size: 3em;
  font-weight: bold;
  color: #764ba2;
  margin: 30px 0;
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: pulse 1s ease infinite;
}

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

.restart-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 15px 40px;
  font-size: 1.2em;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
  transition: all 0.3s ease;
}

.restart-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.6);
}

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

@media (max-width: 768px) {
  .header h1 {
    font-size: 1.8em;
  }
  
  .instructions {
    font-size: 0.9em;
  }
  
  .info-panel {
    flex-direction: column;
    gap: 15px;
  }
  
  .countdown-timer {
    font-size: 36px;
  }
  
  .result-content {
    padding: 30px;
  }
  
  .final-country {
    font-size: 2em;
  }
}
