/* цвета */
:root {
  --bumaga: #f4eedf;
  --bumaga2: #ebe2cc;
  --liniya: #cdbf9f;
  --chernila: #2a2219;
  --seryy: #6f6352;
  --krasnyy: #8e2424;
  --more: #a9d2e6;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bumaga);
  color: var(--chernila);
  font-family: "PT Sans", "Trebuchet MS", Arial, sans-serif;
  font-size: 15px;
}

h1, h2, .god-bolshoy {
  font-family: Georgia, "PT Serif", "Times New Roman", serif;
  font-weight: normal;
}

#app {
  display: flex;
  height: 100vh;
}

/* ---------- карта ---------- */

#karta-blok {
  position: relative;
  flex: 1;
  min-width: 0;
}

#karta {
  position: absolute;
  inset: 0;
  background: var(--more);
}

.leaflet-container {
  font-family: inherit;
}

.shapka {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 500;
  background: var(--bumaga);
  border: 1px solid var(--liniya);
  padding: 8px 14px 9px;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.08);
}

.shapka h1 {
  margin: 0;
  font-size: 24px;
  color: var(--krasnyy);
}

.shapka-pod {
  font-size: 13px;
  color: var(--seryy);
}

.legenda {
  position: absolute;
  top: 12px;
  right: 60px;
  z-index: 500;
  background: var(--bumaga);
  border: 1px solid var(--liniya);
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1.6;
}

.kv {
  display: inline-block;
  width: 12px;
  height: 12px;
  vertical-align: -1px;
  border: 1px solid #5a4a3a;
  margin-right: 4px;
}
.kv-nasha { background: #d3222a; }
.kv-rus { background: #f07a6a; }

#zagruzka {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 600;
  background: var(--chernila);
  color: var(--bumaga);
  padding: 8px 14px;
  font-size: 14px;
}

/* ---------- лента с ползунком ---------- */

#lenta {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 14px;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bumaga);
  border: 1px solid var(--liniya);
  padding: 10px 12px 22px;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.08);
}

#lenta button {
  flex: none;
  width: 36px;
  height: 32px;
  border: 1px solid var(--liniya);
  background: #fffaf0;
  color: var(--chernila);
  font-size: 18px;
  cursor: pointer;
}

#lenta button:hover {
  background: var(--bumaga2);
}

#play {
  background: var(--krasnyy) !important;
  color: white !important;
  border-color: var(--krasnyy) !important;
  font-size: 14px !important;
}

.polzunok-blok {
  position: relative;
  flex: 1;
  margin: 0 6px;
}

#polzunok {
  width: 100%;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  height: 24px;
  cursor: pointer;
}

#polzunok::-webkit-slider-runnable-track {
  height: 4px;
  background: #8c7d62;
}
#polzunok::-moz-range-track {
  height: 4px;
  background: #8c7d62;
}
#polzunok::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 22px;
  margin-top: -9px;
  background: var(--krasnyy);
  border: 2px solid #fffaf0;
  outline: 1px solid var(--krasnyy);
}
#polzunok::-moz-range-thumb {
  width: 12px;
  height: 20px;
  border-radius: 0;
  background: var(--krasnyy);
  border: 2px solid #fffaf0;
}

#metki {
  position: absolute;
  left: 7px;
  right: 7px;
  top: 22px;
  height: 16px;
  pointer-events: none;
}

.metka {
  position: absolute;
  top: 0;
  width: 1px;
  height: 5px;
  background: #8c7d62;
}

.metka-podpis {
  position: absolute;
  top: 5px;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--seryy);
  white-space: nowrap;
}

.vvod {
  flex: none;
  font-size: 13px;
  color: var(--seryy);
}

#vvod-goda {
  width: 64px;
  padding: 5px;
  border: 1px solid var(--liniya);
  background: #fffaf0;
  font: inherit;
  color: var(--chernila);
}

/* ---------- столбец справа ---------- */

#stolbec {
  flex: none;
  width: 380px;
  overflow-y: auto;
  background: var(--bumaga);
  border-left: 1px solid var(--liniya);
  padding: 0 18px 18px;
}

.god-shapka {
  position: sticky;
  top: 0;
  background: var(--bumaga);
  padding: 14px 0 10px;
  border-bottom: 2px solid var(--chernila);
  z-index: 2;
}

.god-bolshoy {
  font-size: 52px;
  line-height: 1;
  color: var(--krasnyy);
}

.god-bolshoy small {
  font-size: 20px;
  margin-left: 8px;
  color: var(--chernila);
}

.karta-god {
  margin-top: 4px;
  font-size: 13px;
  color: var(--seryy);
}

#stolbec section {
  margin-top: 16px;
}

#stolbec h2 {
  font-size: 18px;
  margin: 0 0 8px;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--liniya);
}

#nasha-blok {
  background: #fffaf0;
  border: 1px solid var(--liniya);
  border-left: 5px solid var(--krasnyy);
  padding: 10px 12px;
}

.metka-malaya {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--seryy);
}

.nasha-nazv {
  font-family: Georgia, "PT Serif", serif;
  font-size: 20px;
  margin: 2px 0 8px;
  color: var(--krasnyy);
}

.pravitel {
  font-weight: bold;
  margin: 2px 0;
}

.stolica {
  font-size: 13px;
  color: var(--seryy);
  margin-top: 4px;
}

.gody {
  font-weight: normal;
  font-size: 13px;
  color: var(--seryy);
}

.leaflet-tooltip.podpis-stolicy {
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
  font-family: Georgia, serif;
  font-size: 13px;
  font-weight: bold;
  color: #111;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff;
}
.leaflet-tooltip.podpis-stolicy::before { display: none; }

.strana {
  padding: 8px 0;
  border-bottom: 1px dotted var(--liniya);
}

.strana:last-child {
  border-bottom: none;
}

.strana-nazv {
  font-size: 13px;
  color: var(--seryy);
}

.strana-verh {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}

.knopka-mal {
  flex: none;
  border: none;
  background: none;
  color: var(--krasnyy);
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  padding: 0;
}

.sobytie {
  margin: 0 0 8px;
  line-height: 1.35;
}

.sobytie b {
  color: var(--krasnyy);
}

.sobytie-drugoe {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  padding: 3px 0;
  font: inherit;
  font-size: 13px;
  color: var(--seryy);
  cursor: pointer;
}

.sobytie-drugoe:hover {
  color: var(--chernila);
}

.sobytie-drugoe .g {
  display: inline-block;
  min-width: 42px;
  color: var(--krasnyy);
}

.pusto {
  color: var(--seryy);
  font-style: italic;
  margin: 0 0 8px;
}

#klik-info {
  background: var(--chernila);
  color: var(--bumaga);
  padding: 10px 12px;
  position: relative;
}

#klik-info .klik-nazv {
  font-family: Georgia, serif;
  font-size: 19px;
  margin-right: 20px;
}

#klik-info .malo {
  font-size: 13px;
  color: #cbbfa6;
}

#klik-info .zakryt {
  color: var(--bumaga);
  top: 4px;
  right: 6px;
}

.zakryt {
  position: absolute;
  border: none;
  background: none;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}

.knopka-tekst {
  margin-top: 22px;
  width: 100%;
  padding: 9px;
  border: 1px solid var(--liniya);
  background: #fffaf0;
  font: inherit;
  color: var(--chernila);
  cursor: pointer;
}

.knopka-tekst:hover {
  background: var(--bumaga2);
}

/* подпись страны при наведении */
.leaflet-tooltip.podskazka {
  background: var(--chernila);
  color: var(--bumaga);
  border: none;
  border-radius: 0;
  box-shadow: none;
  font-size: 13px;
}
.leaflet-tooltip.podskazka::before { display: none; }

/* ---------- окно «о проекте» ---------- */

#okno {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(30, 24, 16, 0.55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 30px 12px;
}

#okno[hidden] { display: none; }

.okno-vnutri {
  position: relative;
  max-width: 760px;
  width: 100%;
  background: var(--bumaga);
  border: 1px solid var(--liniya);
  padding: 10px 26px 20px;
  line-height: 1.45;
}

.okno-vnutri h2 {
  color: var(--krasnyy);
  border-bottom: 1px solid var(--liniya);
  padding-bottom: 3px;
}

.okno-vnutri .zakryt {
  top: 8px;
  right: 12px;
  color: var(--chernila);
  font-size: 28px;
}

.tablica {
  border-collapse: collapse;
  width: 100%;
  background: #fffaf0;
  font-size: 14px;
}

.tablica td, .tablica th {
  border: 1px solid var(--liniya);
  padding: 5px 8px;
  text-align: left;
  vertical-align: top;
}

.tablica th {
  background: var(--bumaga2);
}

.podpis {
  margin-top: 24px;
  font-size: 13px;
  color: var(--seryy);
}

a { color: var(--krasnyy); }

/* ---------- телефон ---------- */

@media (max-width: 820px) {
  #app {
    flex-direction: column;
    height: auto;
  }
  #karta-blok {
    height: 70vh;
    flex: none;
  }
  #stolbec {
    width: auto;
    border-left: none;
    border-top: 1px solid var(--liniya);
  }
  .legenda { display: none; }
  .shapka h1 { font-size: 19px; }
  .vvod { display: none; }
  #lenta { left: 6px; right: 6px; bottom: 6px; gap: 4px; padding: 8px 8px 20px; }
  #lenta button { width: 30px; }
  .god-bolshoy { font-size: 40px; }
}

.tablica td:first-child {
  white-space: nowrap;
}

/* названия стран прямо на карте */
.podpis-strany {
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  line-height: 1.15;
  font-family: Georgia, "PT Serif", serif;
  font-weight: bold;
  color: #1f1a14;
  text-shadow: 0 0 2px #fff, 0 0 3px #fff, 0 0 4px rgba(255, 255, 255, 0.9);
}

.podpis-nasha {
  color: #fff;
  text-shadow: 0 0 2px #5a0c0c, 0 0 3px #5a0c0c, 0 0 5px #5a0c0c;
  letter-spacing: 0.03em;
}

/* ---------- тест «угадай страну» ---------- */

.knopka-test {
  display: block;
  margin-top: 7px;
  padding: 5px 10px;
  border: 1px solid var(--krasnyy);
  background: var(--krasnyy);
  color: #fff;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.knopka-test:hover { background: #a83232; }

#test-blok { display: none; }

/* во время теста прячем всё, что подсказывает ответ */
body.test-rezhim #test-blok { display: block; }
body.test-rezhim #lenta,
body.test-rezhim .legenda,
body.test-rezhim .knopka-test,
body.test-rezhim #nasha-blok,
body.test-rezhim #klik-info,
body.test-rezhim #o-proekte,
body.test-rezhim #stolbec section:not(#test-blok) { display: none !important; }

.test-malo {
  font-size: 13px;
  color: var(--seryy);
  margin: 4px 0;
  line-height: 1.4;
}

.test-schet {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--seryy);
  margin: 10px 0 6px;
}

.test-zadanie {
  font-family: Georgia, "PT Serif", serif;
  font-size: 19px;
  margin-bottom: 4px;
}

#test-forma {
  display: flex;
  gap: 6px;
  margin: 12px 0 8px;
}

#test-vvod {
  flex: 1;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--liniya);
  background: #fffaf0;
  font: inherit;
  font-size: 16px;
  color: var(--chernila);
}
#test-vvod:focus { outline: 2px solid #e8590c; border-color: #e8590c; }

.test-knopka-glavnaya {
  padding: 8px 14px;
  border: 1px solid var(--krasnyy);
  background: var(--krasnyy);
  color: #fff;
  font: inherit;
  cursor: pointer;
}
.test-knopka-glavnaya:hover { background: #a83232; }

.test-knopki {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.test-knopka {
  flex: 1;
  padding: 7px 8px;
  border: 1px solid var(--liniya);
  background: #fffaf0;
  color: var(--chernila);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.test-knopka:hover { background: var(--bumaga2); }
.test-knopka:disabled { opacity: 0.5; cursor: default; }

#test-varianty { margin-bottom: 8px; }

.test-variant {
  display: block;
  width: 100%;
  text-align: left;
  margin-bottom: 5px;
  padding: 8px 10px;
  border: 1px solid #e8590c;
  background: #fff3e8;
  color: var(--chernila);
  font: inherit;
  cursor: pointer;
}
.test-variant:hover { background: #ffe2c9; }

.test-itog {
  font-size: 20px;
  font-weight: bold;
  margin: 4px 0;
}
.test-verno { color: #2b7a2b; }
.test-neverno { color: var(--krasnyy); }

.test-otvet {
  font-family: Georgia, "PT Serif", serif;
  font-size: 22px;
  margin: 2px 0 6px;
}

.test-dalshe {
  display: block;
  width: 100%;
  margin: 12px 0 6px;
  font-size: 16px;
}

.test-bolshoy {
  font-family: Georgia, "PT Serif", serif;
  font-size: 44px;
  color: var(--krasnyy);
  line-height: 1.1;
}

.test-oshibki {
  margin: 4px 0 8px;
  padding-left: 20px;
  line-height: 1.4;
}

#test-blok .test-knopka {
  display: block;
  width: 100%;
  margin-bottom: 6px;
}

/* окно настроек теста */
#test-okno {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(30, 24, 16, 0.55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 30px 12px;
}
#test-okno[hidden] { display: none; }

.test-nastroyki { max-width: 560px; }

.test-gruppa {
  margin: 14px 0;
  padding: 10px 12px;
  background: #fffaf0;
  border: 1px solid var(--liniya);
}

.test-gruppa label {
  display: block;
  margin: 3px 0;
  cursor: pointer;
}

.test-zag {
  font-weight: bold;
  margin-bottom: 4px;
}

.test-pole {
  margin: 8px 0 2px 22px;
}
.test-pole[hidden] { display: none; }

.test-pole select,
.test-pole input {
  padding: 5px;
  border: 1px solid var(--liniya);
  background: #fff;
  font: inherit;
  color: var(--chernila);
}
.test-pole input { width: 80px; }

#test-oshibka {
  color: var(--krasnyy);
  font-weight: bold;
  margin-bottom: 6px;
}

@media (max-width: 820px) {
  body.test-rezhim #karta-blok { height: 55vh; }
}

.test-ryad {
  display: flex;
  flex-wrap: wrap;
  gap: 0 16px;
}
.test-gruppa .test-ryad label { display: inline-block; }
