@import url('https://fonts.googleapis.com/css2?family=Uncial+Antiqua&family=IM+Fell+English:ital@0;1&display=swap');

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

html, body, #cesiumContainer {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: 'Georgia', serif;
}

#infoPanel {
  position: absolute;
  bottom: 40px;
  left: 40px;
  width: 380px;
  background: rgba(201, 169, 110, 0.92);
  border: 2px solid rgba(80, 45, 10, 0.6);
  border-radius: 2px;
  padding: 25px;
  color: #2c1508;
  font-family: 'IM Fell English', Georgia, serif;
  z-index: 999;
  box-shadow:
    inset 0 0 20px rgba(80, 40, 10, 0.1),
    0 4px 20px rgba(0, 0, 0, 0.4);
  transform: translateX(-420px);
  transition: transform 0.4s ease, opacity 0.4s ease;
  opacity: 0;
  pointer-events: none;
}

#infoPanel.visible {
  transform: translateX(0);
  opacity: 1;
  pointer-events: all;
}

#infoPanel h2 {
  font-family: 'Uncial Antiqua', Georgia, serif;
  color: #2c1508;
  font-size: 1.4rem;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(80, 45, 10, 0.3);
}

.panelRow {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.95rem;
  border-bottom: 1px solid rgba(80, 45, 10, 0.15);
  padding-bottom: 8px;
}

.panelLabel {
  color: #4a2510;
  font-size: 0.9rem;
  font-style: italic;
}

#panelNotes {
  font-size: 0.92rem;
  line-height: 1.7;
  color: #3b1f0a;
  margin-top: 12px;
  font-style: normal;
  font-family: Georgia, serif;
}

#closePanel {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  border: none;
  color: #4a2510;
  font-size: 1rem;
  cursor: pointer;
}

.hidden {
  display: none;
}

#loadingScreen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 1.5s ease;
  overflow: hidden;
  background-color: #c9a96e;
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 60px,
      rgba(101, 67, 33, 0.06) 60px,
      rgba(101, 67, 33, 0.06) 61px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 60px,
      rgba(101, 67, 33, 0.06) 60px,
      rgba(101, 67, 33, 0.06) 61px
    ),
    radial-gradient(ellipse at 0% 0%,    rgba(80, 40, 10, 0.7) 0%, transparent 30%),
    radial-gradient(ellipse at 100% 0%,  rgba(80, 40, 10, 0.7) 0%, transparent 30%),
    radial-gradient(ellipse at 0% 100%,  rgba(80, 40, 10, 0.7) 0%, transparent 30%),
    radial-gradient(ellipse at 100% 100%,rgba(80, 40, 10, 0.7) 0%, transparent 30%),
    radial-gradient(ellipse at center,   #d9b97a 0%, #c4a060 40%, #a07840 100%);
}

#loadingScreen::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 0%,   rgba(80, 40, 10, 0.4) 0%, transparent 25%),
    radial-gradient(ellipse at 50% 100%, rgba(80, 40, 10, 0.4) 0%, transparent 25%),
    radial-gradient(ellipse at 0% 50%,   rgba(80, 40, 10, 0.4) 0%, transparent 25%),
    radial-gradient(ellipse at 100% 50%, rgba(80, 40, 10, 0.4) 0%, transparent 25%);
  pointer-events: none;
}

#loadingScreen::after {
  content: '';
  position: absolute;
  inset: 12px;
  border-top:    3px solid rgba(80, 45, 10, 0.5);
  border-bottom: 3px solid rgba(80, 45, 10, 0.5);
  border-left:   3px solid rgba(80, 45, 10, 0.5);
  border-right:  3px solid rgba(80, 45, 10, 0.5);
  box-shadow:
    inset 0 0 0 4px rgba(80, 45, 10, 0.15),
    inset 0 0 60px rgba(80, 40, 10, 0.2);
  pointer-events: none;
}

.sea-route {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.15;
}

#loadingUnit {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: 100%;
  height: 100%;
}

.compass-rose {
  width: 180px;
  height: 180px;
  opacity: 0.6;
}

#loadingContent {
  text-align: center;
  position: relative;
  z-index: 1;
  padding: 45px 65px;
  background: rgba(190, 145, 75, 0.35);
  border: 1px solid rgba(80, 45, 10, 0.4);
  box-shadow:
    inset 0 0 30px rgba(80, 40, 10, 0.15),
    0 0 40px rgba(80, 40, 10, 0.2);
}

#loadingContent h1 {
  font-family: 'Uncial Antiqua', serif;
  font-size: 5.5rem;
  color: #2c1508;
  letter-spacing: 4px;
  margin: 0;
  line-height: 1;
  text-shadow:
    1px 1px 0px rgba(255,255,255,0.1),
    -1px -1px 0px rgba(0,0,0,0.1);
}

#loadingContent h2 {
  font-family: 'IM Fell English', serif;
  font-style: italic;
  font-size: 1.1rem;
  color: #4a2510;
  letter-spacing: 6px;
  font-weight: normal;
  margin: 10px 0 40px;
  padding: 8px 0;
  border-top: 1px solid rgba(80, 45, 10, 0.35);
  border-bottom: 1px solid rgba(80, 45, 10, 0.35);
}

#loadingBar {
  width: 300px;
  height: 6px;
  background: rgba(44, 21, 8, 0.15);
  margin: 0 auto 18px;
  position: relative;
  border: 1px solid rgba(80, 45, 10, 0.35);
}

#loadingBar::before {
  content: '✦';
  position: absolute;
  left: -22px;
  top: -9px;
  color: rgba(44, 21, 8, 0.5);
  font-size: 0.75rem;
}

#loadingBar::after {
  content: '✦';
  position: absolute;
  right: -22px;
  top: -9px;
  color: rgba(44, 21, 8, 0.5);
  font-size: 0.75rem;
}

#loadingFill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4a2510, #8b5e2a, #4a2510);
  background-size: 200% 100%;
  animation: shimmer 3s linear infinite;
  transition: width 0.5s ease;
}

@keyframes shimmer {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}

#loadingText {
  font-family: 'IM Fell English', serif;
  font-style: italic;
  font-size: 1.05rem;
  color: #2c1508;
  letter-spacing: 1px;
  transition: opacity 0.3s ease;
  margin-top: 14px;
}

#searchContainer {
  position: absolute;
  top: 40px;
  right: 40px;
  width: 320px;
  z-index: 999;
  font-family: 'IM Fell English', Georgia, serif;
}

#searchInput {
  width: 100%;
  padding: 15px 22px;
  background: rgba(201, 169, 110, 0.92);
  border: 2px solid rgba(80, 45, 10, 0.6);
  border-radius: 2px;
  color: #2c1508;
  font-family: 'IM Fell English', Georgia, serif;
  font-style: italic;
  font-size: 1.4rem;
  outline: none;
  box-shadow: 
    inset 0 0 20px rgba(80, 40, 10, 0.1),
    0 4px 20px rgba(0, 0, 0, 0.4);
}

#searchInput::placeholder {
  color: rgba(44, 21, 8, 0.6);
}

#searchInput:focus {
  border-color: rgba(80, 45, 10, 0.9);
}

#searchDropdown {
  width: 100%;
  background: rgba(201, 169, 110, 0.97);
  border: 2px solid rgba(80, 45, 10, 0.6);
  border-top: none;
  border-radius: 0 0 2px 2px;
  max-height: 300px;
  height: auto;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  position: relative;
}

.searchResult {
  padding: 10px 15px;
  cursor: pointer;
  border-bottom: 1px solid rgba(80, 45, 10, 0.15);
  transition: background 0.3s ease;
}

.searchResult:last-child {
  border-bottom: none;
} 

.searchResult:hover {
  background: rgba(180, 30, 70, 0.5);
}

.searchResultName {
  font-family: 'IM Fell English', Georgia, serif;
  color: #2c1508;
  font-size: 0.95rem;
  font-weight: bold;
}

.searchResultSea {
  font-family: 'IM Fell English', Georgia, serif;
  color: #4a2510;
  font-size: 0.75rem;
  margin-top: 2px;
}

#filterPanel {
  position: absolute;
  top: 0px;
  right: 40px;
  width: 320px;
  z-index: 999;
  font-family: 'IM Fell English', Georgia, serif;
}

#filterToggle {
  width: 100%;
  padding: 15px 22px;
  background: rgba(201, 169, 110, 0.92);
  border: 2px solid rgba(80, 45, 10, 0.6);
  border-radius: 2px;
  color: #2c1508;
  font-family: 'IM Fell English', Georgia, serif;
  font-style: italic;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow:
    inset 0 0 20px rgba(80, 40, 10, 0.1),
    0 4px 20px rgba(0, 0, 0, 0.4);
}

#filterToggle:hover {
  background: rgba(201, 169, 110, 1);
}

#filterContent {
  background: rgba(201, 169, 110, 0.97);
  border: 2px solid rgba(80, 45, 10, 0.6);
  border-top: none;
  border-radius: 0 0 2px 2px;
  padding: 15px;
  max-height: 60vh;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.filterSection {
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(80, 45, 10, 0.2);
}

.filterSection:last-of-type {
  border-bottom: none;
  margin-bottom: 10px;
}

.filterSection h3 {
  font-family: 'Uncial Antiqua', Georgia, serif;
  color: #2c1508;
  font-size: 1.75rem;
  margin-bottom: 10px;
  font-weight: normal;
}

.filterCheck {
  accent-color: #4a2510;
  cursor: pointer;
  width: 16px;
  height: 16px;
}

.filterSection label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.35rem;
  color: #3b1f0a;
  margin-bottom: 8px;
  cursor: pointer;
  font-style: italic;
}

.filterSection label:hover {
  color: #2c1508;
}

.filterActions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.filterActionBtn {
  flex: 1;
  padding: 7px 0;
  background: rgba(80, 45, 10, 0.15);
  border: 1px solid rgba(80, 45, 10, 0.45);
  border-radius: 2px;
  color: #2c1508;
  font-family: 'IM Fell English', Georgia, serif;
  font-style: italic;
  font-size: 1.15rem;
  cursor: pointer;
}

.filterActionBtn:hover {
  background: rgba(80, 45, 10, 0.25);
}

#locationCounter {
  position: absolute;
  top: 40px;
  left: 40px;
  width: 330px;
  background: rgba(201, 169, 110, 0.92);
  border: 2px solid rgba(80, 45, 10, 0.6);
  border-radius: 2px;
  padding: 12px 22px;
  color: #2c1508;
  font-family: 'IM Fell English', Georgia, serif;
  font-style: italic;
  font-size: 1.4rem;
  z-index: 999;
  box-shadow:
    inset 0 0 20px rgba(80, 40, 10, 0.1),
    0 4px 20px rgba(0, 0, 0, 0.4);
}

#controlsLegend {
  position: absolute;
  top: 110px;
  left: 40px;
  width: 330px;
  background: rgba(201, 169, 110, 0.6);
  border: 1px solid rgba(80, 45, 10, 0.3);
  border-radius: 2px;
  padding: 12px 22px;
  color: #2c1508;
  font-family: 'IM Fell English', Georgia, serif;
  font-style: italic;
  font-size: 1.4rem;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#controlsTitle {
  font-family: 'Uncial Antiqua', Georgia, serif;
  font-size: 1.5rem;
  color: #2c1508;
  font-style: normal;
  margin-bottom: 4px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(80, 45, 10, 0.3);
}

.controlRow {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.controlLabel {
  font-size: 1.4rem;
  color: #2c1508;
}

.controlKey {
  background: rgba(80, 45, 10, 0.15);
  border: 1px solid rgba(80, 45, 10, 0.4);
  border-radius: 2px;
  padding: 2px 10px;
  font-style: normal;
  font-family: Georgia, serif;
  font-size: 1.1rem;
  color: #2c1508;
}

#spoilerPanel {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  background: rgba(201, 169, 110, 0.92);
  border: 2px solid rgba(80, 45, 10, 0.6);
  border-radius: 2px;
  padding: 12px 20px;
  color: #2c1508;
  font-family: 'IM Fell English', Georgia, serif;
  z-index: 999;
  box-shadow:
    inset 0 0 20px rgba(80, 40, 10, 0.1),
    0 4px 20px rgba(0, 0, 0, 0.4);
}

#spoilerTitle {
  font-family: 'Uncial Antiqua', Georgia, serif;
  font-size: 1.1rem;
  color: #2c1508;
  margin-bottom: 4px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(80, 45, 10, 0.3);
}

#spoilerArc {
  font-family: 'IM Fell English', Georgia, serif;
  font-style: italic;
  font-size: 1.5rem;
  color: #4a2510;
  margin-bottom: 8px;
  margin-top: 6px;
  text-align: center;
}

#spoilerSlider {
  width: 100%;
  accent-color: #4a2510;
  cursor: pointer;
  height: 6px;
}

#routeToggle {
  position: absolute;
  bottom: 40px;
  right: 40px;
  padding: 15px 22px;
  background: rgba(201, 169, 110, 0.92);
  border: 2px solid rgba(80, 45, 10, 0.6);
  border-radius: 2px;
  color: #2c1508;
  font-family: 'IM Fell English', Georgia, serif;
  font-style: italic;
  font-size: 1.4rem;
  cursor: pointer;
  z-index: 999;
  box-shadow:
    inset 0 0 20px rgba(80, 40, 10, 0.1),
    0 4px 20px rgba(0, 0, 0, 0.4);
  transition: background 0.2s ease;
}

#routeToggle:hover {
  background: rgba(201, 169, 110, 1);
}

#routeToggle.active {
  background: rgba(80, 45, 10, 0.7);
  color: #f0d080;
}

#mobileMenuBtn {
  display: none;
  position: absolute;
  top: 20px;
  right: 20px;
  padding: 12px 16px;
  background: rgba(201, 169, 110, 0.92);
  border: 2px solid rgba(80, 45, 10, 0.6);
  border-radius: 2px;
  color: #2c1508;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}



#mobileDrawer {
  position: absolute;
  top: 0;
  right: 0;
  width: 85vw;
  max-width: 380px;
  height: 100%;
  background: rgba(201, 169, 110, 0.98);
  border-left: 2px solid rgba(80, 45, 10, 0.6);
  z-index: 1001;
  overflow-y: auto;
  padding: 20px;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.4);
}

#mobileSpoilerArc {
  font-family: 'IM Fell English', Georgia, serif;
  font-style: italic;
  font-size: 0.95rem;
  color: #4a2510;
  text-align: center;
  margin-bottom: 8px;
}

#mobileSpoilerSlider {
  width: 100%;
  accent-color: #4a2510;
  cursor: pointer;
}

#mobileRouteToggle {
  width: 100%;
  margin-top: 15px;
  padding: 12px;
  background: rgba(80, 45, 10, 0.15);
  border: 1px solid rgba(80, 45, 10, 0.45);
  border-radius: 2px;
  color: #2c1508;
  font-family: 'IM Fell English', Georgia, serif;
  font-style: italic;
  font-size: 1rem;
  cursor: pointer;
}

#mobileRouteToggle.active {
  background: rgba(80, 45, 10, 0.7);
  color: #f0d080;
}

#drawerHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(80, 45, 10, 0.3);
  font-family: 'Uncial Antiqua', Georgia, serif;
  font-size: 1.2rem;
  color: #2c1508;
}

#drawerClose {
  background: transparent;
  border: none;
  color: #4a2510;
  font-size: 1.2rem;
  cursor: pointer;
}

#drawerSearch input {
  width: 100%;
  padding: 12px 15px;
  background: rgba(180, 130, 70, 0.3);
  border: 1px solid rgba(80, 45, 10, 0.4);
  border-radius: 2px;
  color: #2c1508;
  font-family: 'IM Fell English', Georgia, serif;
  font-style: italic;
  font-size: 1rem;
  outline: none;
  margin-bottom: 8px;
}

#drawerSearch input::placeholder {
  color: rgba(44, 21, 8, 0.7);
}

#mobileSearchDropdown {
  background: rgba(201, 169, 110, 0.97);
  border: 1px solid rgba(80, 45, 10, 0.4);
  border-radius: 2px;
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 15px;
}

#drawerFilters h3 {
  font-family: 'Uncial Antiqua', Georgia, serif;
  font-size: 1rem;
  color: #2c1508;
  margin: 15px 0 8px;
  font-weight: normal;
}

#drawerSpoiler h3 {
  font-family: 'Uncial Antiqua', Georgia, serif;
  font-size: 1rem;
  color: #2c1508;
  margin: 15px 0 8px;
  font-weight: normal;
}

.drawerFilterGroup {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 10px;
}

.drawerFilterGroup label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'IM Fell English', Georgia, serif;
  font-size: 0.9rem;
  color: #3b1f0a;
  font-style: italic;
  cursor: pointer;
}

@media (max-width: 1024px), 
       (max-height: 600px) and (orientation: landscape),
       (max-width: 1366px) and (orientation: landscape) and (hover: none) {
  #mobileMenuBtn    { display: block; }
  #searchContainer  { display: none; }
  #filterPanel      { display: none; }
  #locationCounter  { display: none; }
  #controlsLegend   { display: none; }
  #spoilerPanel     { display: none; }
  #routeToggle      { display: none; }

  #infoPanel {
    width: 90vw;
    left: 5vw;
    bottom: 20px;
  }
}