:root {
  --ivory: #f4eddf;
  --muted-ivory: rgba(244, 237, 223, 0.72);
  --gold: #d8b26a;
  --scene-image: url("../Station.png?v=ecea035a9c47");
}

@supports (background-image: image-set(url("station.webp?v=ef40da03f680") type("image/webp"))) {
  :root {
    --scene-image: image-set(
      url("station.webp?v=ef40da03f680") type("image/webp"),
      url("../Station.png?v=ecea035a9c47") type("image/png")
    );
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #151412;
}

body {
  color: var(--ivory);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button {
  font: inherit;
}

[hidden] {
  display: none !important;
}

.platform,
.scene {
  position: absolute;
  inset: 0;
}

.platform {
  isolation: isolate;
  overflow: hidden;
  background: #171613;
}

.scene {
  z-index: -2;
  overflow: hidden;
  background: #a6a29b;
  pointer-events: none;
}

.scene__base {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-image: var(--scene-image);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.arrival-ui {
  position: absolute;
  z-index: 20;
  top: clamp(1.5rem, 7.5vh, 5rem);
  left: clamp(18rem, 29.5vw, 34rem);
  width: min(31rem, calc(100vw - 3rem));
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 700ms ease 150ms, transform 800ms ease 150ms;
}

body.is-loaded .arrival-ui {
  opacity: 1;
  transform: none;
}

.identity {
  padding-left: 0.08rem;
  text-shadow: 0 2px 24px rgba(7, 7, 6, 0.68);
}

.identity__eyebrow {
  margin: 0 0 0.45rem;
  color: rgba(248, 242, 229, 0.68);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.28em;
}

.identity h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 3.25vw, 3.8rem);
  font-weight: 400;
  line-height: 0.94;
  letter-spacing: 0.075em;
}

.identity > p:last-child {
  margin: 0.6rem 0 0;
  color: rgba(248, 242, 229, 0.82);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(0.82rem, 1.05vw, 1.02rem);
  letter-spacing: 0.08em;
}

.departure-board {
  width: min(29rem, 100%);
  margin-top: clamp(1rem, 2.6vh, 1.8rem);
  padding: 0.86rem 1rem 0.78rem;
  color: #eee6d7;
  border: 1px solid rgba(230, 208, 167, 0.22);
  border-radius: 2px;
  background:
    linear-gradient(115deg, rgba(21, 20, 17, 0.84), rgba(29, 25, 20, 0.68)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 4px);
  box-shadow: 0 14px 40px rgba(6, 6, 5, 0.22), inset 0 1px rgba(255, 255, 255, 0.05);
}

.departure-board__topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.68rem;
  border-bottom: 1px solid rgba(231, 215, 185, 0.2);
  color: rgba(242, 234, 218, 0.76);
  font-size: clamp(0.58rem, 0.78vw, 0.68rem);
  font-weight: 650;
  letter-spacing: 0.14em;
  white-space: nowrap;
}

.departure-board dl {
  display: grid;
  grid-template-columns: 0.78fr 1.42fr;
  gap: 1.2rem;
  margin: 0.72rem 0 0;
}

.departure-board dl > div {
  min-width: 0;
}

.departure-board dt {
  margin-bottom: 0.25rem;
  color: rgba(242, 234, 218, 0.5);
  font-size: 0.58rem;
  font-weight: 650;
  letter-spacing: 0.18em;
}

.departure-board dd {
  margin: 0;
  color: #f3ead9;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(0.91rem, 1.25vw, 1.12rem);
  letter-spacing: 0.075em;
  text-shadow: 0 0 18px rgba(230, 190, 116, 0.2);
}

.departure-board .status {
  color: #e6c882;
  white-space: normal;
}

.departure-board .status.is-departed {
  color: rgba(240, 229, 207, 0.75);
  font-size: clamp(0.73rem, 1vw, 0.94rem);
}

.departure-board__note {
  margin: 0.62rem 0 0;
  color: rgba(241, 232, 215, 0.46);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.67rem;
  letter-spacing: 0.04em;
}

.hotspot {
  position: absolute;
  z-index: 32;
  padding: 0;
  cursor: pointer;
  border: 0;
  border-radius: 50%;
  background: transparent;
  touch-action: manipulation;
}

.hotspot:focus-visible {
  outline: 1px solid rgba(255, 232, 183, 0.82);
  outline-offset: 3px;
}

.ticket {
  --ticket-dx: -180px;
  --ticket-dy: 86px;
  position: absolute;
  z-index: 42;
  width: min(22rem, calc(100vw - 2rem));
  padding: 1rem 1.15rem 0.9rem;
  color: #392b1e;
  border: 1px solid rgba(104, 68, 30, 0.46);
  border-radius: 3px;
  background:
    radial-gradient(circle at 0 50%, transparent 0 8px, #e9dbbb 9px),
    radial-gradient(circle at 100% 50%, transparent 0 8px, #e9dbbb 9px),
    linear-gradient(105deg, rgba(255, 255, 255, 0.35), transparent 26%),
    #e9dbbb;
  background-repeat: no-repeat;
  box-shadow: 0 20px 45px rgba(14, 11, 8, 0.34), inset 0 0 0 4px rgba(112, 79, 41, 0.08);
  opacity: 0;
  transform: translate(-50%, -20%) rotate(-6deg) scale(0.8);
  transform-origin: 50% 0;
  pointer-events: none;
}

.ticket.is-visible {
  opacity: 1;
  transform: translate(calc(-50% + var(--ticket-dx)), var(--ticket-dy)) rotate(-2deg) scale(1);
  transition: opacity 180ms ease, transform 620ms cubic-bezier(0.16, 0.76, 0.28, 1.12);
  pointer-events: auto;
}

.ticket__close {
  position: absolute;
  top: 0.35rem;
  right: 0.45rem;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  color: rgba(57, 43, 30, 0.55);
  cursor: pointer;
  border: 0;
  background: transparent;
  font-size: 1.25rem;
  line-height: 1;
}

.ticket__rail {
  padding-bottom: 0.62rem;
  border-bottom: 1px dashed rgba(72, 47, 24, 0.42);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.19em;
}

.ticket__number {
  position: absolute;
  top: 2.55rem;
  right: 1.15rem;
  margin: 0;
  color: rgba(80, 54, 30, 0.52);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.66rem;
  letter-spacing: 0.12em;
}

.ticket dl {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 0.72rem 1rem;
  margin: 0.9rem 0 0.75rem;
}

.ticket dl > div:first-child {
  grid-column: 1 / -1;
}

.ticket dt {
  margin-bottom: 0.12rem;
  color: rgba(69, 47, 27, 0.57);
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.ticket dd {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.84rem;
  letter-spacing: 0.055em;
}

.ticket__fineprint {
  margin: 0;
  padding-top: 0.55rem;
  border-top: 1px dashed rgba(72, 47, 24, 0.34);
  color: rgba(64, 44, 25, 0.58);
  font-size: 0.54rem;
  letter-spacing: 0.055em;
}

.not-found {
  position: absolute;
  z-index: 40;
  top: 50%;
  left: 50%;
  width: min(37rem, calc(100vw - 2rem));
  padding: clamp(1.6rem, 4vw, 2.8rem);
  color: #f2eadc;
  border: 1px solid rgba(230, 210, 175, 0.24);
  background: rgba(18, 17, 15, 0.78);
  box-shadow: 0 20px 70px rgba(7, 6, 5, 0.34);
  text-align: center;
  opacity: 0;
  transform: translate(-50%, calc(-50% + 8px));
  transition: opacity 600ms ease 100ms, transform 700ms ease 100ms;
}

body.is-loaded .not-found {
  opacity: 1;
  transform: translate(-50%, -50%);
}

.not-found__mark {
  margin: 0 0 0.8rem;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.5rem;
}

.not-found h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.35rem, 3.5vw, 2.15rem);
  font-weight: 400;
  line-height: 1.25;
}

.not-found > p:not(.not-found__mark) {
  margin: 0.75rem 0 1.45rem;
  color: var(--muted-ivory);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(0.88rem, 1.7vw, 1.02rem);
}

.not-found a {
  display: inline-block;
  padding: 0.72rem 1rem 0.66rem;
  color: #eadab9;
  border: 1px solid rgba(224, 192, 128, 0.44);
  border-radius: 2px;
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: color 220ms ease, background 220ms ease, border-color 220ms ease;
}

.not-found a:hover,
.not-found a:focus-visible {
  color: #21180f;
  border-color: #d9ba7d;
  background: #d9ba7d;
  outline: 0;
}

body.not-found-mode .arrival-ui,
body.not-found-mode .hotspot {
  display: none;
}

footer {
  position: absolute;
  z-index: 25;
  right: 1.2rem;
  bottom: max(0.8rem, env(safe-area-inset-bottom));
  color: rgba(246, 239, 225, 0.48);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(0.55rem, 0.8vw, 0.68rem);
  letter-spacing: 0.105em;
  text-shadow: 0 1px 12px rgba(7, 7, 6, 0.7);
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 760px) {
  .arrival-ui {
    top: max(1.25rem, env(safe-area-inset-top));
    left: 1rem;
    width: calc(100vw - 2rem);
  }

  .identity h1 {
    font-size: clamp(1.8rem, 9vw, 2.7rem);
  }

  .departure-board {
    width: min(28rem, 100%);
    background: rgba(22, 20, 17, 0.76);
  }

  .departure-board dl {
    grid-template-columns: 0.72fr 1.4fr;
    gap: 0.8rem;
  }

  .ticket {
    position: fixed;
    top: auto !important;
    left: 1rem !important;
    right: 1rem;
    bottom: max(2.6rem, calc(env(safe-area-inset-bottom) + 2rem));
    width: auto;
    transform: translateY(30px) rotate(-1deg) scale(0.96);
  }

  .ticket.is-visible {
    transform: none;
  }

  footer {
    right: 0;
    left: 0;
    padding: 0 1rem;
    text-align: center;
  }
}

@media (max-height: 610px) and (min-width: 761px) {
  .arrival-ui {
    top: 1rem;
  }

  .identity h1 {
    font-size: 2.2rem;
  }

  .departure-board {
    margin-top: 0.75rem;
    padding-top: 0.66rem;
    padding-bottom: 0.58rem;
  }
}

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