* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #000010; }
#globe-canvas { display: block; width: 100%; height: 100%; cursor: grab; }
#globe-canvas:active { cursor: grabbing; }

/* Окно с годом */
#year-display {
  position: fixed;
  top: 24px;
  right: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(5, 15, 35, 0.75);
  border: 1px solid rgba(80, 140, 255, 0.35);
  border-radius: 10px;
  padding: 10px 16px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  user-select: none;
  z-index: 10;
}

.year-btn {
  background: rgba(80, 140, 255, 0.15);
  border: 1px solid rgba(80, 140, 255, 0.3);
  border-radius: 6px;
  color: #88aadd;
  font-size: 18px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}

.year-btn:hover {
  background: rgba(80, 140, 255, 0.35);
  color: #ffffff;
}

.year-btn:active {
  background: rgba(80, 140, 255, 0.55);
}

#year-input {
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-family: 'Georgia', serif;
  font-size: 24px;
  font-weight: bold;
  width: 80px;
  text-align: center;
  text-shadow: 0 0 12px rgba(100, 160, 255, 0.6);
  letter-spacing: 1px;
}

#year-input::selection {
  background: rgba(80, 140, 255, 0.4);
}

/* Скрываем стрелки у числового input — все браузеры */
#year-input::-webkit-outer-spin-button,
#year-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
#year-input[type=number] {
  -moz-appearance: textfield;
  appearance: textfield;
}

#year-era {
  color: #88aadd;
  font-family: 'Georgia', serif;
  font-size: 14px;
  white-space: nowrap;
  min-width: 48px;
}

/* Карточка события */
#event-card {
  display: none;
  position: fixed;
  left: 28px;
  bottom: 40px;
  width: 300px;
  background: rgba(5, 15, 35, 0.88);
  border: 1px solid rgba(80, 140, 255, 0.4);
  border-radius: 12px;
  padding: 20px 20px 18px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10;
  animation: fadeIn 0.25s ease;
}

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

#event-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: #667799;
  font-size: 14px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 4px;
  transition: color 0.2s;
}
#event-close:hover { color: #aabbdd; }

#event-year {
  font-family: 'Georgia', serif;
  font-size: 13px;
  color: #6688bb;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

#event-title {
  font-family: 'Georgia', serif;
  font-size: 18px;
  font-weight: bold;
  color: #ddeeff;
  margin-bottom: 10px;
  text-shadow: 0 0 8px rgba(80,140,255,0.3);
}

#event-desc {
  font-family: Arial, sans-serif;
  font-size: 13px;
  color: #99bbcc;
  line-height: 1.6;
}

/* Маркеры событий на глобусе */
.event-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffcc44;
  border: 2px solid #fff;
  box-shadow: 0 0 8px rgba(255,200,50,0.8);
  cursor: pointer;
  position: absolute;
  transform: translate(-50%, -50%);
  transition: transform 0.2s;
  pointer-events: auto;
}
.event-dot:hover {
  transform: translate(-50%, -50%) scale(1.5);
  box-shadow: 0 0 16px rgba(255,200,50,1);
}


.step-divider {
  width: 1px;
  height: 20px;
  background: rgba(80, 140, 255, 0.25);
  margin: 0 4px;
}

#step-select {
  background: rgba(80, 140, 255, 0.12);
  border: 1px solid rgba(80, 140, 255, 0.25);
  border-radius: 6px;
  color: #aaccee;
  font-size: 13px;
  padding: 4px 6px;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  text-align: center;
}

#step-select option {
  background: #0a1530;
  color: #aaccee;
}

#step-select:hover {
  border-color: rgba(80, 140, 255, 0.5);
  color: #fff;
}

#step-custom {
  display: none;
  background: transparent;
  border: 1px solid rgba(80, 140, 255, 0.25);
  border-radius: 6px;
  outline: none;
  color: #ffffff;
  font-size: 13px;
  width: 52px;
  text-align: center;
  padding: 4px 6px;
}

#step-custom::-webkit-outer-spin-button,
#step-custom::-webkit-inner-spin-button { -webkit-appearance: none; }
#step-custom[type=number] { -moz-appearance: textfield; appearance: textfield; }

/* Блок автовоспроизведения */
#play-display {
  position: fixed;
  top: 78px;
  right: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(5, 15, 35, 0.75);
  border: 1px solid rgba(80, 140, 255, 0.35);
  border-radius: 10px;
  padding: 8px 14px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  user-select: none;
  z-index: 10;
}

#btn-play {
  background: none;
  border: none;
  color: #88aadd;
  font-size: 16px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  transition: color 0.2s, transform 0.15s;
}

#btn-play:hover {
  color: #ffffff;
  transform: scale(1.2);
}

#btn-play.playing {
  color: #ff8844;
}

#play-speed-select {
  background: rgba(80, 140, 255, 0.12);
  border: 1px solid rgba(80, 140, 255, 0.25);
  border-radius: 6px;
  color: #aaccee;
  font-size: 13px;
  padding: 4px 6px;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

#play-speed-select option {
  background: #0a1530;
  color: #aaccee;
}

/* Чекбокс империй */
#empires-toggle {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: rgba(5, 15, 35, 0.75);
  border: 1px solid rgba(80, 140, 255, 0.35);
  border-radius: 10px;
  padding: 10px 16px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10;
}

#empires-toggle label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: #aaccee;
  font-family: Arial, sans-serif;
  font-size: 13px;
  user-select: none;
}

#empires-toggle input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1px solid rgba(80, 140, 255, 0.5);
  border-radius: 4px;
  background: rgba(80, 140, 255, 0.1);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s;
}

#empires-toggle input[type="checkbox"]:checked {
  background: rgba(80, 140, 255, 0.45);
}

#empires-toggle input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: -1px;
  left: 2px;
  color: #ffffff;
  font-size: 12px;
  line-height: 1;
}

#empires-toggle label:hover span {
  color: #ffffff;
}
