* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --green-dark: #1b4332;
  --green: #2d6a4f;
  --green-light: #52b788;
  --red: #c1121f;
  --red-light: #e63946;
  --cream: #f8f4e3;
  --gold: #d4a017;
  --text: #222;
}

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--cream);
  color: var(--text);
  overflow-x: hidden;
}

/* ===== ЭКРАНЫ ===== */
.screen {
  display: none;
  min-height: 100vh;
}
.screen.active {
  display: block;
}

/* ===== СТАРТОВЫЙ ЭКРАН ===== */
#start-screen {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: linear-gradient(135deg, #1b4332 0%, #2d6a4f 60%, #40916c 100%);
}
#start-screen.active {
  display: flex;
}

.start-content {
  max-width: 720px;
  background: var(--cream);
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  text-align: center;
}

.start-content h1 {
  color: var(--green-dark);
  font-size: 2.2rem;
  line-height: 1.2;
  margin-bottom: 12px;
}

.subtitle {
  color: var(--green);
  font-size: 1.1rem;
  margin-bottom: 24px;
}

.legend-box {
  text-align: left;
  background: #fff;
  border-left: 5px solid var(--gold);
  padding: 20px 24px;
  border-radius: 8px;
  margin-bottom: 28px;
  line-height: 1.6;
}

.legend-box h2 {
  color: var(--green-dark);
  margin-bottom: 10px;
  font-size: 1.2rem;
}

.legend-box p {
  margin-bottom: 10px;
}

.btn-primary {
  background: var(--red);
  color: #fff;
  border: none;
  padding: 14px 40px;
  font-size: 1.1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  font-weight: 600;
}
.btn-primary:hover {
  background: #9d0e19;
}
.btn-primary:active {
  transform: scale(0.98);
}

/* ===== ИГРОВОЙ ЭКРАН ===== */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: var(--green-dark);
  color: #fff;
  flex-wrap: wrap;
  gap: 10px;
}
.game-header h1 {
  font-size: 1.2rem;
}
.stats {
  display: flex;
  gap: 20px;
  font-weight: 600;
}
.stats span {
  background: rgba(255, 255, 255, 0.15);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.95rem;
}

.game-main {
  display: flex;
  height: calc(100vh - 56px);
}

#map {
  flex: 2;
  min-height: 300px;
  z-index: 1;
}

#panel {
  flex: 1;
  min-width: 320px;
  max-width: 480px;
  padding: 24px;
  overflow-y: auto;
  background: #fff;
  border-left: 3px solid var(--green);
}

.panel-default h2 {
  color: var(--green-dark);
  margin-bottom: 12px;
}
.panel-default p {
  margin-bottom: 8px;
  line-height: 1.5;
}
.hint {
  color: #888;
  font-size: 0.9rem;
  font-style: italic;
}

/* ===== ПАНЕЛЬ ТОЧКИ ===== */
.point-title {
  color: var(--green-dark);
  font-size: 1.3rem;
  margin-bottom: 8px;
  border-bottom: 2px solid var(--gold);
  padding-bottom: 8px;
}
.point-image {
  width: 100%;
  height: 160px;
  background: linear-gradient(135deg, #2d6a4f, #52b788);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 3rem;
  margin-bottom: 14px;
}
.point-desc {
  line-height: 1.6;
  margin-bottom: 14px;
}
.audio-btn {
  background: var(--gold);
  color: var(--green-dark);
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 16px;
  font-size: 0.9rem;
}
.audio-btn:hover {
  background: #b88a0f;
}
.question {
  background: #f0f7f4;
  border-left: 4px solid var(--green);
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 14px;
  font-weight: 600;
  line-height: 1.5;
}
.answer {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  margin-bottom: 8px;
  background: #f8f8f8;
  border: 2px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.15s;
}
.answer:hover:not(:disabled) {
  border-color: var(--green);
  background: #eef7f2;
}
.answer:disabled {
  cursor: default;
}
.answer.correct {
  background: #d4edda;
  border-color: #28a745;
  color: #155724;
  font-weight: 600;
}
.answer.wrong {
  background: #f8d7da;
  border-color: #dc3545;
  color: #721c24;
}
.feedback {
  margin-top: 12px;
  font-weight: 600;
  min-height: 24px;
}
.feedback.ok { color: #28a745; }
.feedback.err { color: #dc3545; }
.feedback.info { color: var(--gold); }

/* ===== ФИНАЛЬНЫЙ ЭКРАН ===== */
#final-screen {
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: linear-gradient(135deg, #1b4332 0%, #2d6a4f 100%);
}
#final-screen.active {
  display: flex;
}
.final-content {
  max-width: 560px;
  background: var(--cream);
  border-radius: 16px;
  padding: 48px 40px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}
.final-content h1 {
  color: var(--green-dark);
  font-size: 2rem;
  margin-bottom: 20px;
}
.final-score {
  font-size: 3rem;
  color: var(--red);
  font-weight: 700;
  margin-bottom: 12px;
}
.final-message {
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 28px;
  color: var(--green-dark);
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 768px) {
  .start-content { padding: 24px; }
  .start-content h1 { font-size: 1.6rem; }
  .game-main { flex-direction: column; height: auto; }
  #map { height: 50vh; flex: none; }
  #panel {
    flex: none;
    max-width: 100%;
    border-left: none;
    border-top: 3px solid var(--green);
    min-height: 50vh;
  }
  .game-header h1 { font-size: 1rem; }
  .stats { font-size: 0.8rem; }
}