:root {
  --night: #061720;
  --night-soft: #0a2631;
  --panel: rgba(7, 26, 34, 0.94);
  --panel-solid: #091e27;
  --parchment: #e2cfaa;
  --parchment-soft: #cdb98f;
  --gold: #c99845;
  --gold-light: #e1bb6b;
  --terracotta: #a84730;
  --ink: #172329;
  --line: rgba(220, 179, 94, 0.32);
  --serif: "Iowan Old Style", "Palatino Linotype", "Noto Serif SC", "Songti SC", STSong, Georgia, serif;
  --display: "Times New Roman", "Noto Serif SC", "Songti SC", serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--parchment);
  background: var(--night);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
}

button,
a {
  color: inherit;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 3px;
}

.voyage {
  position: relative;
  width: 100%;
  height: 100svh;
  min-height: 560px;
  isolation: isolate;
  overflow: hidden;
  background: #142c31;
}

#mediterranean-map {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 60% 45%, #789394, #334f54 55%, #102c34);
}

.leaflet-tile-pane {
  filter: sepia(0.42) saturate(0.7) brightness(0.67) contrast(1.05) hue-rotate(348deg);
}

.leaflet-tile {
  transition: opacity 0.25s linear;
}

.leaflet-control-zoom {
  margin-top: 90px !important;
  margin-right: 24px !important;
  border: 1px solid rgba(221, 184, 108, 0.42) !important;
  border-radius: 0 !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25) !important;
}

.leaflet-control-zoom a {
  width: 34px !important;
  height: 34px !important;
  color: #dfcda4 !important;
  background: rgba(6, 25, 33, 0.88) !important;
  border-color: rgba(221, 184, 108, 0.25) !important;
  border-radius: 0 !important;
  line-height: 32px !important;
}

.leaflet-control-zoom a:hover {
  color: #091d25 !important;
  background: var(--gold-light) !important;
}

.leaflet-control-attribution {
  right: 24px;
  bottom: 118px;
  padding: 4px 7px !important;
  color: rgba(235, 218, 181, 0.65);
  background: rgba(5, 20, 27, 0.72) !important;
  font-size: 9px !important;
  backdrop-filter: blur(5px);
}

.leaflet-control-attribution a {
  color: #d5ad63;
}

.leaflet-tooltip.location-tooltip {
  padding: 5px 8px;
  color: #ecd8ad;
  background: rgba(6, 24, 31, 0.93);
  border: 1px solid rgba(211, 168, 83, 0.45);
  border-radius: 0;
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.3);
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.leaflet-tooltip.location-tooltip::before {
  border-top-color: rgba(6, 24, 31, 0.93);
}

.map-tone {
  position: absolute;
  z-index: 400;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(3, 16, 22, 0.68) 0, rgba(3, 16, 22, 0.26) 27%, transparent 50%),
    linear-gradient(180deg, rgba(3, 15, 21, 0.62) 0, transparent 22%, transparent 72%, rgba(2, 12, 17, 0.55) 100%),
    radial-gradient(circle at 58% 45%, transparent 42%, rgba(3, 14, 19, 0.36) 100%);
  box-shadow: inset 0 0 140px rgba(0, 0, 0, 0.35);
}

.grain {
  position: absolute;
  z-index: 900;
  inset: 0;
  opacity: 0.16;
  pointer-events: none;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.32'/%3E%3C/svg%3E");
}

.topbar {
  position: absolute;
  z-index: 700;
  top: 0;
  left: 0;
  width: 100%;
  height: 72px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 25px;
  border-bottom: 1px solid rgba(220, 179, 94, 0.23);
  background: linear-gradient(180deg, rgba(3, 17, 23, 0.86), rgba(3, 17, 23, 0.48));
  backdrop-filter: blur(8px);
}

.brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--parchment);
  text-decoration: none;
}

.brand-omega {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--gold-light);
  border: 1px solid rgba(211, 168, 83, 0.54);
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 15px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-copy b {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.23em;
}

.brand-copy small {
  color: rgba(229, 210, 170, 0.46);
  font-family: Georgia, serif;
  font-size: 7px;
  letter-spacing: 0.22em;
}

.voyage-status {
  display: flex;
  align-items: center;
  gap: 14px;
  color: rgba(231, 214, 176, 0.72);
  font-size: 10px;
  letter-spacing: 0.14em;
}

.voyage-status i {
  width: 44px;
  height: 1px;
  background: rgba(209, 168, 83, 0.38);
}

.voyage-status strong {
  color: var(--gold-light);
  font-family: Georgia, serif;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.1em;
}

.top-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
}

.text-button,
.icon-button {
  height: 34px;
  color: rgba(234, 216, 177, 0.78);
  background: rgba(6, 27, 35, 0.55);
  border: 1px solid rgba(213, 173, 92, 0.31);
  cursor: pointer;
  transition: color 0.25s, background 0.25s, border-color 0.25s;
}

.text-button:hover,
.icon-button:hover,
.icon-button[aria-pressed="true"] {
  color: #0b222a;
  background: var(--gold-light);
  border-color: var(--gold-light);
}

.text-button {
  padding: 0 13px;
  font-size: 10px;
  letter-spacing: 0.08em;
}

.overview-icon {
  margin-right: 5px;
  font-family: sans-serif;
}

.icon-button {
  width: 34px;
}

.sound-button > span {
  height: 12px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.sound-button i {
  display: block;
  width: 1px;
  height: 5px;
  background: currentColor;
}

.sound-button i:nth-child(2) {
  height: 11px;
}

.sound-button[aria-pressed="true"] i {
  animation: sound-wave 0.8s ease-in-out infinite alternate;
}

.sound-button[aria-pressed="true"] i:nth-child(2) { animation-delay: -0.3s; }
.sound-button[aria-pressed="true"] i:nth-child(3) { animation-delay: -0.55s; }

@keyframes sound-wave {
  from { height: 3px; }
  to { height: 12px; }
}

.intro-panel {
  position: absolute;
  z-index: 650;
  top: 50%;
  left: 9vw;
  width: min(560px, 45vw);
  transform: translateY(-48%);
  text-align: center;
  transition: opacity 0.65s ease, visibility 0.65s, transform 0.65s cubic-bezier(0.22, 0.76, 0.25, 1);
}

.voyage.started .intro-panel {
  opacity: 0;
  visibility: hidden;
  transform: translate(-35px, -48%);
  pointer-events: none;
}

.intro-panel::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 50%;
  left: 50%;
  width: 750px;
  height: 620px;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse, rgba(4, 20, 27, 0.95) 0, rgba(4, 20, 27, 0.78) 40%, transparent 72%);
  pointer-events: none;
}

.intro-kicker {
  margin: 0 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 9px;
  letter-spacing: 0.27em;
}

.intro-kicker span {
  width: 32px;
  height: 1px;
  background: rgba(207, 160, 70, 0.55);
}

.intro-panel h1 {
  margin: 0;
  color: #ead9b3;
  font-family: var(--display);
  font-size: clamp(4rem, 7vw, 7.2rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: 0.09em;
  text-shadow: 0 10px 35px rgba(0, 0, 0, 0.5);
}

.intro-panel h1 small {
  display: block;
  margin-top: 24px;
  color: var(--gold-light);
  font-family: var(--serif);
  font-size: clamp(1rem, 1.8vw, 1.5rem);
  letter-spacing: 0.52em;
  transform: translateX(0.26em);
}

.intro-subtitle {
  margin: 27px 0 0;
  color: rgba(236, 220, 185, 0.84);
  font-size: 14px;
  letter-spacing: 0.25em;
}

.intro-description {
  margin: 21px 0 29px;
  color: rgba(231, 214, 177, 0.55);
  font-size: 11px;
  line-height: 1.9;
  letter-spacing: 0.08em;
}

.begin-button {
  position: relative;
  width: 202px;
  height: 56px;
  display: grid;
  grid-template-columns: 1fr 28px;
  grid-template-rows: 29px 14px;
  align-items: end;
  padding: 6px 17px 7px 24px;
  color: #ead7ae;
  background: rgba(7, 32, 41, 0.72);
  border: 1px solid rgba(216, 174, 89, 0.75);
  cursor: pointer;
  overflow: hidden;
  transition: color 0.3s, transform 0.3s, box-shadow 0.3s;
}

.begin-button::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(217, 176, 92, 0.17);
}

.begin-button::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: var(--gold-light);
  transform: translateX(-101%);
  transition: transform 0.4s ease;
}

.begin-button:hover {
  color: var(--night);
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

.begin-button:hover::after {
  transform: translateX(0);
}

.begin-button > span,
.begin-button > small {
  justify-self: start;
  position: relative;
  z-index: 1;
}

.begin-button > span {
  font-size: 14px;
  letter-spacing: 0.24em;
}

.begin-button > small {
  align-self: start;
  opacity: 0.55;
  font-family: Georgia, serif;
  font-size: 6px;
  letter-spacing: 0.15em;
}

.begin-button > b {
  position: relative;
  z-index: 1;
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  font-weight: 400;
}

.map-note {
  margin: 22px 0 0;
  color: rgba(229, 209, 167, 0.35);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.event-panel {
  position: absolute;
  z-index: 650;
  top: 92px;
  bottom: 132px;
  left: 24px;
  width: 380px;
  overflow: hidden;
  color: #e8d6b0;
  background: var(--panel);
  border: 1px solid rgba(213, 173, 91, 0.39);
  border-top: 3px solid var(--terracotta);
  box-shadow: 0 22px 65px rgba(0, 0, 0, 0.37);
  backdrop-filter: blur(15px);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-30px);
  transition: opacity 0.52s ease, visibility 0.52s, transform 0.52s cubic-bezier(0.22, 0.76, 0.25, 1);
}

.voyage.started .event-panel {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.event-panel::before,
.event-panel::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.event-panel::before {
  inset: 8px;
  border: 1px solid rgba(218, 178, 96, 0.12);
}

.event-panel::after {
  right: -40px;
  bottom: -50px;
  width: 170px;
  height: 170px;
  border: 1px solid rgba(213, 169, 80, 0.1);
  border-radius: 50%;
  box-shadow: inset 0 0 0 14px rgba(213, 169, 80, 0.025), inset 0 0 0 15px rgba(213, 169, 80, 0.08);
}

.event-panel-inner {
  position: relative;
  z-index: 1;
  height: 100%;
  padding: clamp(24px, 3.1vh, 36px) 29px 24px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 153, 69, 0.4) transparent;
}

.event-panel.changing .event-panel-inner {
  animation: event-change 0.45s ease both;
}

@keyframes event-change {
  0% { opacity: 0; transform: translateX(14px); }
  100% { opacity: 1; transform: translateX(0); }
}

.event-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.event-order {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--gold-light);
}

.event-order > span {
  font-family: Georgia, serif;
  font-size: 27px;
}

.event-order i {
  width: 25px;
  height: 1px;
  background: rgba(215, 172, 86, 0.45);
}

.event-order small {
  color: rgba(229, 210, 170, 0.4);
  font-family: Georgia, serif;
  font-size: 9px;
}

.event-time {
  padding: 5px 8px;
  color: rgba(229, 211, 172, 0.63);
  border: 1px solid rgba(210, 169, 88, 0.25);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.event-stage {
  margin: 19px 0 7px;
  color: var(--gold);
  font-size: 9px;
  letter-spacing: 0.19em;
}

.event-panel h2 {
  margin: 0;
  color: #edddbd;
  font-size: clamp(26px, 2.2vw, 35px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 0.1em;
}

.event-greek {
  margin: 8px 0 7px;
  color: rgba(206, 158, 72, 0.72);
  font-family: Georgia, serif;
  font-size: 9px;
  letter-spacing: 0.28em;
}

.event-location {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 12px;
  color: rgba(231, 214, 177, 0.55);
  font-size: 8px;
  letter-spacing: 0.07em;
}

.event-location > span::before {
  content: "⌖";
  margin-right: 6px;
  color: var(--gold);
}

.event-location small {
  flex: 0 0 auto;
  padding: 3px 6px;
  border: 1px solid currentColor;
  font-size: 7px;
  font-weight: 400;
  letter-spacing: 0.08em;
}

.event-location .confidence-high { color: rgba(133, 190, 159, 0.8); }
.event-location .confidence-medium { color: rgba(216, 177, 96, 0.82); }
.event-location .confidence-low { color: rgba(202, 115, 88, 0.86); }

.event-visual {
  position: relative;
  height: clamp(112px, 17vh, 158px);
  margin: 0 0 18px;
  overflow: hidden;
  color: #ead7ad;
  background:
    linear-gradient(135deg, rgba(178, 76, 50, 0.22), transparent),
    #102b33;
  border: 1px solid rgba(214, 172, 87, 0.36);
  box-shadow: 0 9px 24px rgba(0, 0, 0, 0.24);
}

.event-visual::before,
.event-visual::after {
  content: "";
  position: absolute;
  z-index: 3;
  pointer-events: none;
}

.event-visual::before {
  inset: 6px;
  border: 1px solid rgba(236, 210, 154, 0.18);
}

.event-visual::after {
  top: 0;
  left: 0;
  width: 42px;
  height: 3px;
  background: var(--terracotta);
  box-shadow: calc(100% + 268px) 0 0 var(--gold);
}

.event-visual img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.035);
  filter: saturate(0.84) contrast(1.06) brightness(0.82) sepia(0.08);
  transition: opacity 0.55s ease, transform 5s ease, filter 0.5s ease;
}

.event-visual.loaded img {
  opacity: 1;
  transform: scale(1);
}

.event-visual:hover img {
  transform: scale(1.035);
  filter: saturate(0.98) contrast(1.04) brightness(0.9) sepia(0.02);
}

.event-visual.artwork::before {
  border-color: rgba(238, 215, 169, 0.27);
  box-shadow: inset 0 0 0 1px rgba(7, 25, 32, 0.24);
}

.visual-shade {
  position: absolute;
  z-index: 1;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5, 18, 23, 0.08) 25%, rgba(4, 17, 23, 0.9) 100%),
    linear-gradient(90deg, rgba(5, 19, 25, 0.34), transparent 55%);
  pointer-events: none;
}

.event-visual figcaption {
  position: absolute;
  z-index: 4;
  right: 12px;
  bottom: 9px;
  left: 12px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
}

.event-visual figcaption span {
  font-size: 9px;
  letter-spacing: 0.1em;
}

.event-visual figcaption a {
  flex: 0 0 auto;
  color: rgba(233, 210, 163, 0.66);
  font-family: Georgia, serif;
  font-size: 7px;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: color 0.2s;
}

.event-visual figcaption a:hover {
  color: var(--gold-light);
}

.visual-loading {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: opacity 0.3s;
}

.event-visual.loaded .visual-loading {
  opacity: 0;
  pointer-events: none;
}

.visual-loading span {
  width: 4px;
  height: 4px;
  background: var(--gold-light);
  border-radius: 50%;
  animation: visual-loading 0.9s ease-in-out infinite alternate;
}

.visual-loading span:nth-child(2) { animation-delay: -0.3s; }
.visual-loading span:nth-child(3) { animation-delay: -0.6s; }

@keyframes visual-loading {
  from { opacity: 0.28; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(-3px); }
}

.event-visual.fallback {
  display: grid;
  place-items: center;
  color: #151a18;
  background: var(--terracotta);
  border-top: 5px solid #151a18;
  border-bottom: 5px solid #151a18;
}

.event-visual.fallback svg {
  width: 88%;
  height: 88%;
}

.event-visual.fallback .figure-fill { fill: currentColor; }
.event-visual.fallback .figure-stroke {
  fill: none;
  stroke: currentColor;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.event-visual.fallback .fine { stroke-width: 2.6; }
.event-visual.fallback .clay-cut { fill: var(--terracotta); }

.visual-fallback-note {
  position: absolute;
  right: 8px;
  bottom: 5px;
  color: rgba(20, 25, 23, 0.62);
  font-size: 7px;
}

.event-summary {
  margin: 0;
  color: rgba(235, 220, 188, 0.76);
  font-size: 12px;
  line-height: 1.75;
  letter-spacing: 0.045em;
}

.event-cost {
  margin-top: 15px;
  padding: 12px 14px;
  background: rgba(202, 152, 65, 0.07);
  border-left: 2px solid var(--terracotta);
}

.event-cost strong {
  display: block;
  margin-bottom: 5px;
  color: var(--gold);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.18em;
}

.event-cost p {
  margin: 0;
  color: rgba(234, 217, 181, 0.63);
  font-size: 11px;
  line-height: 1.65;
}

.event-panel blockquote {
  margin: 15px 0 0;
  color: #d7bd88;
  font-size: 11px;
  font-style: italic;
  line-height: 1.7;
}

.map-legend {
  position: absolute;
  z-index: 640;
  right: 24px;
  bottom: 134px;
  display: flex;
  gap: 16px;
  padding: 8px 11px;
  color: rgba(236, 220, 185, 0.62);
  background: rgba(5, 21, 28, 0.72);
  border: 1px solid rgba(213, 173, 91, 0.22);
  font-size: 9px;
  letter-spacing: 0.06em;
  backdrop-filter: blur(8px);
}

.map-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.map-legend a {
  color: rgba(222, 184, 111, 0.72);
  text-decoration: none;
}

.map-legend a:hover,
.map-legend a:focus-visible {
  color: var(--gold-light);
  text-decoration: underline;
}

.legend-dot {
  width: 7px;
  height: 7px;
  display: inline-block;
  border-radius: 50%;
}

.legend-dot.visited { background: var(--gold); }
.legend-dot.current { background: var(--terracotta); box-shadow: 0 0 0 3px rgba(183, 73, 47, 0.24); }
.legend-dot.ahead { border: 1px solid rgba(232, 216, 179, 0.55); }

.legend-waypoint {
  width: 7px;
  height: 7px;
  display: inline-block;
  background: rgba(9, 33, 42, 0.9);
  border: 1px solid rgba(229, 198, 132, 0.8);
  transform: rotate(45deg);
}

.voyage-controls {
  position: absolute;
  z-index: 700;
  right: 24px;
  bottom: 22px;
  left: 24px;
  height: 92px;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) 46px 88px;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  color: #ead8b4;
  background: rgba(5, 23, 30, 0.94);
  border: 1px solid rgba(217, 176, 92, 0.36);
  border-top: 2px solid rgba(197, 145, 57, 0.66);
  box-shadow: 0 15px 55px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(15px);
}

.step-button,
.autoplay-button {
  height: 42px;
  color: #dfc797;
  background: rgba(12, 42, 51, 0.7);
  border: 1px solid rgba(209, 168, 83, 0.36);
  cursor: pointer;
  transition: color 0.25s, background 0.25s, border-color 0.25s, opacity 0.25s;
}

.step-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.step-button small {
  font-size: 10px;
  letter-spacing: 0.09em;
}

.step-button > span {
  font-family: sans-serif;
  font-size: 14px;
}

.step-button:hover:not(:disabled),
.autoplay-button:hover,
.autoplay-button[aria-pressed="true"] {
  color: #09202a;
  background: var(--gold-light);
  border-color: var(--gold-light);
}

.step-button:disabled {
  opacity: 0.25;
  cursor: default;
}

.autoplay-button {
  width: 42px;
  border-radius: 50%;
}

.play-symbol {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 2px;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid currentColor;
}

.autoplay-button[aria-pressed="true"] .play-symbol {
  width: 8px;
  height: 10px;
  margin-left: 0;
  border: 0;
  border-right: 2px solid currentColor;
  border-left: 2px solid currentColor;
}

.timeline-wrap {
  min-width: 0;
}

.timeline-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin: 0 3px 10px;
  color: rgba(231, 213, 175, 0.7);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.timeline-heading span:last-child {
  color: rgba(204, 158, 72, 0.65);
  font-family: Georgia, serif;
  font-size: 8px;
  letter-spacing: 0.15em;
}

.timeline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(14, 1fr);
  align-items: center;
}

.timeline::before,
.timeline::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 3.5%;
  height: 1px;
  transform: translateY(-50%);
  pointer-events: none;
}

.timeline::before {
  right: 3.5%;
  background: rgba(219, 185, 118, 0.22);
}

.timeline::after {
  width: var(--timeline-progress, 0%);
  background: var(--gold);
  transition: width 0.75s ease;
}

.timeline-node {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 24px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.timeline-node::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  transform: translate(-50%, -50%) rotate(45deg);
  background: #0c2a34;
  border: 1px solid rgba(224, 207, 170, 0.55);
  transition: width 0.25s, height 0.25s, background 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.timeline-node:hover::before {
  width: 10px;
  height: 10px;
  border-color: var(--gold-light);
}

.timeline-node.visited::before {
  background: var(--gold);
  border-color: var(--gold-light);
}

.timeline-node.active::before {
  width: 12px;
  height: 12px;
  background: var(--terracotta);
  border-color: #f0d28f;
  box-shadow: 0 0 0 5px rgba(180, 71, 48, 0.22);
}

.timeline-node span {
  position: absolute;
  bottom: 21px;
  left: 50%;
  width: max-content;
  max-width: 110px;
  padding: 5px 7px;
  color: #e7d3aa;
  background: #071d26;
  border: 1px solid rgba(212, 170, 84, 0.36);
  font-size: 8px;
  letter-spacing: 0.07em;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 5px);
  transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
  pointer-events: none;
}

.timeline-node:hover span,
.timeline-node:focus-visible span {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.event-marker-shell,
.route-waypoint-shell,
.ship-marker-shell {
  background: transparent !important;
  border: 0 !important;
}

.route-waypoint {
  width: 9px;
  height: 9px;
  display: block;
  background: rgba(7, 28, 35, 0.94);
  border: 1px solid rgba(232, 202, 137, 0.92);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  transform: rotate(45deg);
}

.leaflet-tooltip.waypoint-tooltip {
  color: rgba(232, 210, 166, 0.86);
  font-size: 9px;
}

.event-marker {
  position: relative;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  color: rgba(232, 216, 181, 0.85);
  background: rgba(7, 28, 35, 0.89);
  border: 1px solid rgba(230, 211, 170, 0.75);
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.42);
  font-family: Georgia, serif;
  font-size: 9px;
  transition: color 0.3s, background 0.3s, border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}

.event-marker::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(230, 211, 170, 0.25);
  border-radius: 50%;
}

.event-marker-shell.visited .event-marker {
  color: #10252a;
  background: var(--gold);
  border-color: #f0cf8a;
}

.event-marker-shell.active {
  z-index: 1000 !important;
}

.event-marker-shell.active .event-marker {
  color: #f4dda8;
  background: var(--terracotta);
  border-color: #f3d491;
  transform: scale(1.3);
  box-shadow: 0 0 0 6px rgba(177, 67, 44, 0.22), 0 5px 20px rgba(0, 0, 0, 0.5);
}

.event-marker-shell.active .event-marker::after {
  content: "";
  position: absolute;
  inset: -7px;
  border: 1px solid rgba(226, 181, 94, 0.7);
  border-radius: 50%;
  animation: marker-pulse 2s ease-out infinite;
}

@keyframes marker-pulse {
  from { opacity: 0.75; transform: scale(0.75); }
  to { opacity: 0; transform: scale(1.65); }
}

.ship-marker {
  position: relative;
  width: 46px;
  height: 42px;
  filter: drop-shadow(0 6px 5px rgba(0, 0, 0, 0.5));
  transition: transform 0.25s ease;
}

.ship-marker svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.ship-marker .ship-fill {
  fill: #a9432f;
  stroke: #efd28e;
  stroke-width: 0.6;
}

.ship-marker .ship-line {
  fill: none;
  stroke: #efd28e;
  stroke-width: 1.4;
}

.ship-marker.sailing {
  animation: ship-rock 1.4s ease-in-out infinite alternate;
}

@keyframes ship-rock {
  from { transform: rotate(-5deg) translateY(-1px); }
  to { transform: rotate(5deg) translateY(1px); }
}

.route-shadow {
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6));
}

.route-complete {
  filter: drop-shadow(0 0 3px rgba(224, 169, 67, 0.5));
}

.route-active-segment {
  filter: drop-shadow(0 0 5px rgba(239, 190, 97, 0.75));
}

.ending-panel {
  position: absolute;
  z-index: 820;
  top: 50%;
  left: 50%;
  width: min(760px, calc(100% - 48px));
  padding: 60px 55px 52px;
  color: #ead8b2;
  text-align: center;
  background:
    radial-gradient(circle at 50% 35%, rgba(30, 75, 76, 0.4), transparent 55%),
    rgba(4, 20, 27, 0.97);
  border: 1px solid rgba(215, 174, 87, 0.52);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.72);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -46%) scale(0.96);
  transition: opacity 0.5s ease, visibility 0.5s, transform 0.5s cubic-bezier(0.22, 0.76, 0.25, 1);
}

.ending-panel.visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.ending-panel::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(216, 174, 88, 0.13);
  pointer-events: none;
}

.ending-close {
  position: absolute;
  z-index: 1;
  top: 12px;
  right: 14px;
  width: 32px;
  height: 32px;
  color: rgba(234, 216, 177, 0.65);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 22px;
  font-weight: 300;
}

.ending-omega {
  width: 57px;
  height: 57px;
  display: inline-grid;
  place-items: center;
  color: var(--gold-light);
  border: 1px solid rgba(213, 169, 81, 0.43);
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 19px;
}

.ending-panel > p {
  margin: 25px 0 18px;
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 9px;
  letter-spacing: 0.28em;
}

.ending-panel h2 {
  margin: 0;
  font-size: clamp(20px, 2.7vw, 32px);
  font-weight: 400;
  line-height: 1.75;
  letter-spacing: 0.07em;
}

#replay-button {
  position: relative;
  z-index: 1;
  margin-top: 31px;
  padding: 11px 19px;
  color: #dfc895;
  background: transparent;
  border: 1px solid rgba(209, 166, 81, 0.47);
  cursor: pointer;
  font-size: 10px;
  letter-spacing: 0.13em;
}

#replay-button:hover {
  color: var(--night);
  background: var(--gold-light);
}

.loading-state {
  position: absolute;
  z-index: 850;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  color: #dec797;
  background: #071a22;
  transition: opacity 0.6s, visibility 0.6s;
}

.loading-state.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-state.error {
  color: #e1b8a5;
}

.loading-state p {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.16em;
}

.loading-ship {
  color: var(--gold-light);
  font-size: 30px;
  animation: loading-sail 1.5s ease-in-out infinite alternate;
}

@keyframes loading-sail {
  from { transform: translateX(-12px) rotate(-6deg); }
  to { transform: translateX(12px) rotate(6deg); }
}

noscript {
  position: fixed;
  z-index: 1000;
  right: 20px;
  bottom: 20px;
  padding: 12px 16px;
  color: white;
  background: #963d2d;
}

@media (max-width: 980px) {
  .event-panel {
    width: 340px;
  }

  .intro-panel {
    left: 5vw;
    width: min(500px, 58vw);
  }

  .voyage-controls {
    grid-template-columns: 50px minmax(0, 1fr) 42px 50px;
    gap: 9px;
  }

  .step-button small {
    display: none;
  }
}

@media (max-width: 700px) {
  .voyage {
    min-height: 500px;
  }

  .topbar {
    height: 58px;
    padding: 0 13px;
    grid-template-columns: 1fr auto;
  }

  .brand-copy small,
  .voyage-status,
  .text-button {
    display: none;
  }

  .brand-omega {
    width: 30px;
    height: 30px;
  }

  .brand-copy b {
    font-size: 12px;
  }

  .icon-button {
    width: 30px;
    height: 30px;
  }

  .leaflet-control-zoom {
    margin-top: 70px !important;
    margin-right: 12px !important;
  }

  .leaflet-control-zoom a {
    width: 30px !important;
    height: 30px !important;
    line-height: 28px !important;
  }

  .leaflet-control-attribution {
    right: 8px;
    bottom: 108px;
    max-width: 230px;
    font-size: 7px !important;
  }

  .map-tone {
    background:
      linear-gradient(180deg, rgba(3, 15, 21, 0.58) 0, transparent 18%, transparent 58%, rgba(2, 12, 17, 0.72) 100%),
      radial-gradient(circle at 50% 38%, transparent 30%, rgba(3, 14, 19, 0.32) 100%);
  }

  .intro-panel {
    top: 44%;
    left: 50%;
    width: calc(100% - 34px);
    transform: translate(-50%, -50%);
  }

  .voyage.started .intro-panel {
    transform: translate(-50%, -50%) scale(0.95);
  }

  .intro-panel::before {
    width: 125vw;
    height: 610px;
  }

  .intro-panel h1 {
    font-size: clamp(3.5rem, 19vw, 5.2rem);
    letter-spacing: 0.04em;
  }

  .intro-panel h1 small {
    margin-top: 18px;
    font-size: 15px;
    letter-spacing: 0.38em;
  }

  .intro-subtitle {
    margin-top: 22px;
    font-size: 12px;
  }

  .intro-description {
    margin: 17px 0 22px;
    font-size: 10px;
  }

  .intro-description br {
    display: none;
  }

  .map-note {
    font-size: 7px;
  }

  .event-panel {
    top: auto;
    right: 12px;
    bottom: 112px;
    left: 12px;
    width: auto;
    max-height: 46vh;
    min-height: 265px;
    border-top-width: 2px;
    transform: translateY(25px);
  }

  .voyage.started .event-panel {
    transform: translateY(0);
  }

  .event-panel-inner {
    padding: 17px 20px 18px;
  }

  .event-order > span {
    font-size: 21px;
  }

  .event-stage {
    margin-top: 12px;
  }

  .event-panel h2 {
    font-size: 25px;
  }

  .event-greek {
    margin-bottom: 6px;
  }

  .event-location {
    margin-bottom: 9px;
  }

  .event-visual {
    height: 96px;
    margin-bottom: 12px;
  }

  .event-visual figcaption {
    right: 9px;
    bottom: 7px;
    left: 9px;
  }

  .event-visual figcaption a {
    max-width: 45%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .event-summary {
    font-size: 11px;
    line-height: 1.65;
  }

  .event-cost {
    margin-top: 11px;
    padding: 9px 11px;
  }

  .event-panel blockquote {
    margin-top: 11px;
  }

  .map-legend {
    display: none;
  }

  .voyage-controls {
    right: 9px;
    bottom: 9px;
    left: 9px;
    height: 92px;
    grid-template-columns: 35px minmax(0, 1fr) 36px 35px;
    gap: 5px;
    padding: 0 8px;
  }

  .step-button,
  .autoplay-button {
    width: 34px;
    height: 34px;
  }

  .timeline-heading {
    gap: 8px;
    margin-bottom: 8px;
    font-size: 8px;
  }

  .timeline-heading span:first-child {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .timeline-heading span:last-child {
    font-size: 6px;
  }

  .timeline-node::before {
    width: 5px;
    height: 5px;
  }

  .timeline-node.active::before {
    width: 9px;
    height: 9px;
    box-shadow: 0 0 0 3px rgba(180, 71, 48, 0.22);
  }

  .timeline-node span {
    display: none;
  }

  .ending-panel {
    width: calc(100% - 24px);
    padding: 48px 25px 40px;
  }

  .ending-panel h2 br {
    display: none;
  }

  .ending-panel h2 {
    font-size: 19px;
  }
}

@media (max-height: 720px) and (min-width: 701px) {
  .event-panel {
    top: 80px;
    bottom: 118px;
  }

  .event-panel-inner {
    padding-top: 20px;
  }

  .event-stage {
    margin-top: 11px;
  }

  .event-greek {
    margin-bottom: 5px;
  }

  .event-location {
    margin-bottom: 8px;
  }

  .event-visual {
    height: 92px;
    margin-bottom: 11px;
  }

  .event-cost {
    margin-top: 10px;
  }

  .event-panel blockquote {
    margin-top: 10px;
  }

  .voyage-controls {
    bottom: 12px;
    height: 88px;
  }

  .leaflet-control-attribution,
  .map-legend {
    bottom: 110px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
