:root {
  --bg: #f6f4f0;
  --accent: #c9a76b;
  --panel: #fff;
  --muted: #666;
}

html {
  height: 100%;
  margin: 0;
  font-family: 'MFAGarnett-Regular', Georgia, serif;
  font-size: 18px;
  background: #000;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  word-spacing: 0.1em;
}

body {
  min-height: 100%;
  margin: 0;
  font-family: 'MFAGarnett-Regular', Georgia, serif;
  font-size: inherit;
  background: #000;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  word-spacing: 0.1em;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

* {
  box-sizing: border-box;
}

/* Prevent text overflow globally */
h1, h2, h3, h4, h5, h6, p, div {
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Ensure buttons are tappable on mobile */
button {
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
  touch-action: manipulation;
}

/* Custom Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #2a7a8c;
  border-radius: 4px;
  transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: #3a8a9c;
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: #2a7a8c rgba(0, 0, 0, 0.3);
}

b, strong {
  font-family: 'MFAGarnett-Semibold', Georgia, serif;
  font-weight: normal;
}

i, em {
  font-family: 'MFAGarnett-RegularItalic', Georgia, serif;
  font-style: normal;
}

b i, i b, strong em, em strong, b em, em b, strong i, i strong {
  font-family: 'MFAGarnett-SemiboldItalic', Georgia, serif;
  font-weight: normal;
  font-style: normal;
}

.hidden {
  display: none !important;
}

/* Attract */
.attract {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000 url('../attract.png') center center no-repeat;
  background-size: cover;
  color: #fff;
  cursor: pointer;
}

.attract::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1;
}

.attract-logos {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.attract-logo-secondary {
  width: 405px;
  height: auto;
  max-width: 40vw;
}

.attract-logo {
  width: 210px;
  height: auto;
  max-width: 40vw;
}

.attract-cta {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 20px;
  max-width: 100%;
  box-sizing: border-box;
}

.attract-cta h1 {
  font-family: 'MFAGarnett-Semibold', Georgia, serif;
  font-size: 2rem;
  font-weight: normal;
  margin: 0 0 1rem 0;
  line-height: 1.2;
  max-width: 100%;
  word-wrap: break-word;
}

.attract-cta p {
  font-family: 'MFAGarnett-Regular', Georgia, serif;
  font-size: 1.125rem;
  margin: 0;
  font-weight: normal;
}

/* Show mobile text by default, hide desktop text */
.attract-text-mobile {
  display: inline;
}

.attract-text-desktop {
  display: none;
}

/* Desktop attract screen */
@media (min-width: 1367px) {
  .attract-logos {
    bottom: 40px;
    gap: 18px;
  }

  .attract-logo-secondary {
    width: 540px;
  }

  .attract-logo {
    width: 300px;
  }

  .attract-cta {
    max-width: 1100px;
  }

  .attract-cta h1 {
    font-size: 50px;
    margin: 0 0 20px 0;
  }

  .attract-cta p {
    font-size: 22px;
  }

  /* Hide mobile text, show desktop text */
  .attract-text-mobile {
    display: none;
  }

  .attract-text-desktop {
    display: inline;
  }
}


/* App Layout */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: #000;
}

.header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: 20px;
  background: transparent;
  z-index: 100;
  pointer-events: none;
}

.header .icon-btn {
  pointer-events: auto;
}

/* Desktop header with blue bar offset */
@media (min-width: 1367px) {
  .header {
    padding: 30px 20px 30px 70px;
  }
}

.icon-btn {
  width: 24px !important;
  height: 24px !important;
  cursor: pointer;
  display: block !important;
  transition: opacity 0.25s ease-out, transform 0.1s ease;
  max-width: 24px !important;
  max-height: 24px !important;
  padding: 0 !important;
  margin: 0 !important;
  line-height: 0 !important;
}

.icon-btn img,
.icon-btn svg,
#restartBtn img,
#restartBtn svg {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  display: block !important;
  object-fit: contain !important;
}

.icon-btn:hover {
  opacity: 0.8;
}

.icon-btn:active {
  transform: scale(0.95);
}

.icon-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  border-radius: 4px;
}

.stop-title {
  margin: 0 0 1rem 0;
  padding-top: 0.5rem;
  font-size: 1.5rem;
  color: #fff;
  font-weight: 400;
  line-height: 1.3;
  max-width: 100%;
  word-wrap: break-word;
  position: relative;
  z-index: 1;
}

/* Desktop stop title */
@media (min-width: 1367px) {
  .stop-title {
    margin: 32px 0;
    font-size: 30px;
  }
}

.menu-btn {
  position: absolute;
  top: 10px;
  right: 20px;
  padding: 8px;
  border: none;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-size: 0.875rem;
  text-decoration: none;
  text-decoration-line: underline;
  text-decoration-color: #145064;
  text-decoration-thickness: 20%;
  text-underline-offset: 25%;
  z-index: 9999;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
  pointer-events: auto;
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

/* Desktop menu button */
@media (min-width: 1367px) {
  .menu-btn {
    top: 20px;
    right: 30px;
    font-size: 1rem;
  }
}

.menu-btn:hover {
  color: #2a7a8c;
  text-decoration-color: #2a7a8c;
}

.menu-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}

/* Main: viewer + side panel - MOBILE FIRST */
.main {
  display: flex;
  flex: 1;
  flex-direction: column;
  overflow-x: hidden;
  padding: 0;
  position: relative;
  background:
    linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)),
    url('../assets/main-bg.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.viewer {
  flex-shrink: 0;
  margin: 0 20px 20px 20px;
  width: calc(100% - 40px);
  height: 55vh;
  min-height: 300px;
  background: rgba(0, 0, 0, 0);
  border-radius: 5px;
  overflow: hidden;
  position: relative;
  z-index: 0;
  order: 2;
}

/* Desktop viewer */
@media (min-width: 1367px) {
  .main {
    flex-direction: row-reverse;
    overflow: hidden;
  }

  .viewer {
    flex: 1;
    width: auto;
    height: auto;
    margin: 40px 60px 40px 20px;
    order: initial;
  }
}

/* Loading overlay for viewer */
.viewer-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.viewer-loading.hidden {
  opacity: 0;
  pointer-events: none;
}

.viewer-loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spinner 0.8s linear infinite;
}

.viewer-loading-text {
  color: #fff;
  margin-top: 20px;
  font-size: 16px;
  position: absolute;
  bottom: 40%;
}

.panel {
  width: 100%;
  background: transparent;
  padding: 60px 20px 20px 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  position: relative;
  flex-shrink: 0;
  box-sizing: border-box;
  order: 1;
  overflow-y: visible;
  z-index: 1;
}

/* Desktop panel */
@media (min-width: 1367px) {
  .panel {
    width: 550px;
    padding: 80px 40px 40px 70px;
    order: initial;
  }

  .viewer {
    order: initial;
  }
}

.panel-styling {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  background-color: #145064;
  width: 40px;
  z-index: 5;
  display: none; /* Hidden by default on mobile/tablet */
}

/* Show blue bar only on desktop 1367px+ */
@media (min-width: 1367px) {
  .panel-styling {
    display: block;
  }
}
.stop-text {
  color: #fff;
  line-height: 1.6;
  overflow: visible;
  flex: 0 1 auto;
  margin-bottom: 1rem;
  max-height: none;
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
  font-size: 1rem;
}

/* Desktop stop text */
@media (min-width: 1367px) {
  .stop-text {
    line-height: 1.7;
  }
}

.stop-text ul {
  list-style-type: square;
  padding-left: 20px;
}

.stop-text ul li::marker {
  color: #ffffff;
}

/* Credits logo styling */
.credits-logo {
  text-align: center;
  margin-top: 115px;
  padding-top: 30px;
}

.credits-logo a {
  display: inline-block;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.credits-logo a:hover {
  opacity: 0.66;
}

.credits-logo img {
  max-width: 350px;
  height: auto;
}

/* Stop image styling */
.stop-image {
  margin-top: 24px;
  min-height: 220px;
  cursor: pointer;
  border-radius: 4px;
  overflow: visible;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stop-image.hidden {
  min-height: 220px;
  cursor: default;
}

.stop-image img {
  width: 70%;
  height: auto;
  max-height: none;
  display: block;
  margin: 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  object-fit: contain;
}

.stop-image:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.stop-image:active {
  transform: scale(0.98);
}

/* Image caption styling */
.image-caption {
  margin-top: 12px;
  min-height: 50px;
  color: #ccc;
  font-size: 12px;
  line-height: 1.5;
  text-align: left;
  padding: 0;
}

.image-caption.hidden {
  min-height: 50px;
}

/* Image modal/lightbox */
.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.image-modal.active {
  display: flex;
  opacity: 1;
}

.image-modal-content {
  max-width: 90vw;
  max-height: 90vh;
  position: relative;
}

.image-modal-content img {
  max-width: 100%;
  max-height: 90vh;
  width: auto;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  animation: imageZoomIn 0.3s ease-out;
}

@keyframes imageZoomIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.image-modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  padding: 8px 16px;
  transition: color 0.2s ease;
}

.image-modal-close:hover {
  color: #2a7a8c;
}

.image-modal-close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}

.controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: auto;
  padding-top: 30px;
  margin-bottom: 60px;
}

/* Buttons */
.nav-btn {
  padding: 16px 24px;
  border-radius: 4px;
  border: none;
  background: #2a7a8c;
  cursor: pointer;
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  text-align: center;
  transition: background-color 0.2s ease, opacity 0.2s ease, transform 0.1s ease;
  position: relative;
}

.nav-btn:hover {
  background: #3a8a9c;
}

.nav-btn:active {
  transform: scale(0.98);
}

.nav-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #2a7a8c;
}

.nav-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Loading spinner for buttons */
.nav-btn.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  right: 10px;
  margin-top: -8px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
  to { transform: rotate(360deg); }
}

/* Menu overlay - Full screen takeover */
.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.97);
  padding: 60px 20px 20px 20px;
  display: none;
  flex-direction: column;
  z-index: 10000;
  opacity: 0;
  overflow-y: auto;
}

/* Desktop menu overlay */
@media (min-width: 1367px) {
  .menu-overlay {
    padding: 80px 70px 60px 70px;
  }

  .menu-title {
    font-size: 2rem;
  }

  .menu-subtitle {
    font-size: 1rem;
  }

  .stop-list li {
    font-size: 1.125rem;
    margin-bottom: 20px;
  }
}

.menu-overlay:not(.hidden) {
  display: flex;
  animation: fadeInMenu 0.4s ease-in-out forwards;
}

@keyframes fadeInMenu {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Smooth fade-out and fade-in for content swap */
.panel .stop-title,
.panel .stop-text,
.panel .controls {
  transition: opacity 0.25s ease-out;
}

/* Content fade animations for next/back navigation */
@keyframes contentFadeOut {
  0% {
    opacity: 1;
    transform: translateX(0);
  }
  100% {
    opacity: 0;
    transform: translateX(-15px);
  }
}

@keyframes contentFadeIn {
  0% {
    opacity: 0;
    transform: translateX(15px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

.panel.fade-out .stop-title,
.panel.fade-out .stop-text,
.panel.fade-out .stop-image,
.panel.fade-out .controls {
  animation: contentFadeOut 0.2s ease-out forwards;
}

.panel.fade-in .stop-title,
.panel.fade-in .stop-text,
.panel.fade-in .stop-image,
.panel.fade-in .controls {
  animation: contentFadeIn 0.3s ease-out forwards;
}

/* Attract screen fade out */
.attract.fade-out {
  animation: attractFadeOut 0.5s ease-out forwards;
}

@keyframes attractFadeOut {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

/* App fade in */
.app.fade-in {
  animation: appFadeIn 0.5s ease-out forwards;
}

@keyframes appFadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* App fade out (for restart) */
.app.fade-out {
  animation: appFadeOut 0.5s ease-out forwards;
}

@keyframes appFadeOut {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

/* Hide elements when menu is open - using class instead of :has() for better browser support */
.app.menu-open .stop-title,
.app.menu-open .stop-text,
.app.menu-open .stop-image,
.app.menu-open .image-caption,
.app.menu-open .controls {
  display: none !important;
}

.app.menu-open .menu-btn {
  display: none !important;
}

/* Hide restart button when menu is open */
.app.menu-open .header #restartBtn {
  display: none !important;
}

/* Hide viewer when menu is open */
.app.menu-open .viewer {
  display: none !important;
}

/* Hide the blue panel styling when menu is open */
.app.menu-open .panel-styling {
  display: none !important;
}

/* Hide main background when menu is open */
.app.menu-open .main {
  background: none !important;
}

/* Ensure panel background is transparent when menu is open */
.app.menu-open .panel {
  background: transparent !important;
}

.close-menu-x {
  position: fixed;
  top: 10px;
  right: 20px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  z-index: 10001;
  font-weight: 300;
  text-align: center;
  transition: color 0.2s ease, transform 0.1s ease;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

/* Desktop close button */
@media (min-width: 1367px) {
  .close-menu-x {
    top: 20px;
    right: 30px;
  }
}

.close-menu-x:hover {
  color: #2a7a8c;
}

.close-menu-x:active {
  transform: scale(0.95);
}

.close-menu-x:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}

.menu-title {
  margin: 0 0 8px 0;
  font-size: 1.5rem;
  color: #fff;
  font-family: 'MFAGarnett-Regular';
  font-weight: 400;
}

.menu-subtitle {
  margin: 0 0 32px 0;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  font-family: 'MFAGarnett-Regular';
}

.stop-list {
  list-style: decimal;
  list-style-position: outside;
  padding: 0 0 0 20px;
  margin: 0;
}

.stop-list li {
  margin: 0 0 16px 0;
  font-size: 1rem;
  color: #fff;
  font-family: 'MFAGarnett-Regular';
  cursor: pointer;
  transition: color 0.2s ease;
  line-height: 1.4;
}

.stop-list li:hover {
  color: #2a7a8c;
}

.stop-list li.active {
  color: #2a7a8c;
}

.stop-list li a {
  color: inherit;
  text-decoration: none;
  display: block;
  padding: 4px 0;
}

.stop-list li:last-child {
  list-style: none;
}

/* SVG overlay default styles (inside OSD overlay) */
.osd-svg-overlay * {
  pointer-events: none;
}

/* Viewer z-index management */
.viewer .openseadragon-container {
  z-index: 1;
}

.viewer-loading {
  z-index: 100;
}

/* ============================================
   SVG PATH STYLING WITH OUTER GLOW
   Add your custom SVG path classes below
   ============================================ */

/* Balanced stroke and glow */
.svg-path-glow {
  fill: none;
  stroke: rgba(255, 255, 255, 0.85);  
  stroke-width: 1px;
  /* Strong white glow */
  filter:
    drop-shadow(0 0 4px #ffffff)
    drop-shadow(0 0 4px #ffffff)
    drop-shadow(0 0 6px rgba(255, 255, 255, 1))
    drop-shadow(0 0 8px rgba(255, 255, 255, 0.7))
    /* drop-shadow(0 0 12px rgba(255, 255, 255, 0.5));  */
}

/* Adjust glow properties:
   - Change stroke color for path color
   - Change drop-shadow colors for glow color
   - Adjust px values for glow size (12px, 24px, 36px)
   - Adjust rgba opacity values (0.9, 0.7, 0.5) for glow intensity
*/

/* Brighter highlight specifically for stop-11 */
#stop-11.svg-path-glow {
  stroke: rgba(255, 255, 255, 1);
  stroke-width: 1.5px;
  filter:
    drop-shadow(0 0 6px #ffffff)
    drop-shadow(0 0 8px #ffffff)
    drop-shadow(0 0 10px rgba(255, 255, 255, 1))
    drop-shadow(0 0 12px rgba(255, 255, 255, 0.9))
    drop-shadow(0 0 16px rgba(255, 255, 255, 0.7));
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   Minimal GPU acceleration only where needed
   ============================================ */
.attract,
.image-modal {
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Image optimization */
img {
  image-rendering: auto;
}

/* Smooth scrolling */
.menu-overlay {
  scroll-behavior: smooth;
}

/* ============================================
   RESPONSIVE DESIGN
   Mobile-first approach matching original design
   ============================================ */

/* ============================================
   MOBILE & TABLET - ALL PORTRAIT & SMALL SCREENS
   Content ABOVE map, NO blue bar
   ============================================ */
@media (max-width: 1366px) {
  /* HIDE BLUE BAR on all non-desktop screens */
  .panel-styling {
    display: none !important;
  }
}

/* ============================================
   MOBILE PORTRAIT (320px - 767px)
   Matching original design: text above, map below
   ============================================ */
@media screen and (max-width: 767px) {
  html, body {
    font-size: 16px !important;
    overflow-x: hidden !important;
  }

  body {
    overflow-y: auto !important;
  }

  .main {
    display: flex !important;
    flex-direction: column !important;
    overflow-y: visible !important;
    overflow-x: hidden !important;
    min-height: 100vh !important;
  }

  /* Panel appears ABOVE viewer - explicit order */
  .panel {
    width: 100% !important;
    padding: 60px 20px 20px 20px !important;
    order: 1 !important;
    flex-shrink: 0 !important;
    overflow-y: visible !important;
  }

  /* Viewer appears BELOW panel - explicit order */
  .viewer {
    width: calc(100% - 40px) !important;
    height: 55vh !important;
    min-height: 320px !important;
    margin: 0 20px 30px 20px !important;
    order: 2 !important;
    flex-shrink: 0 !important;
  }

  .header {
    padding: 12px 20px !important;
  }

  .icon-btn,
  .icon-btn img,
  .icon-btn svg,
  #restartBtn,
  #restartBtn img,
  #restartBtn svg {
    width: 20px !important;
    height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
  }

  .stop-title {
    font-size: 1.5rem !important;
    margin: 0 0 1rem 0 !important;
    line-height: 1.3 !important;
  }

  .stop-text {
    font-size: 1rem !important;
    line-height: 1.6 !important;
    max-height: none !important;
    overflow-y: visible !important;
    margin-bottom: 1rem !important;
  }

  .stop-image {
    margin-top: 1rem !important;
    min-height: 150px !important;
  }

  .stop-image img {
    width: 100% !important;
  }

  .image-caption {
    margin-top: 0.75rem !important;
    min-height: 0 !important;
    font-size: 0.75rem !important;
    padding: 0 !important;
  }

  .menu-btn {
    top: 2px !important;
    right: 20px !important;
    font-size: 0.875rem !important;
    min-width: 44px !important;
    min-height: 44px !important;
    padding: 12px 8px !important;
    z-index: 9999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    pointer-events: auto !important;
    position: absolute !important;
    cursor: pointer !important;
  }

  .menu-btn b {
    pointer-events: none !important;
  }

  .close-menu-x {
    top: 2px !important;
    right: 20px !important;
    font-size: 1.5rem !important;
    min-width: 44px !important;
    min-height: 44px !important;
  }

  .controls {
    gap: 0.75rem !important;
    margin-top: 1.5rem !important;
    margin-bottom: 1.5rem !important;
    padding-top: 1rem !important;
  }

  .nav-btn {
    padding: 14px 20px !important;
    font-size: 1rem !important;
    min-height: 44px !important;
  }

  .menu-overlay {
    padding: 60px 20px 40px 20px !important;
  }

  .menu-title {
    font-size: 1.5rem !important;
    margin-bottom: 8px !important;
  }

  .menu-subtitle {
    font-size: 0.875rem !important;
    margin-bottom: 32px !important;
  }

  .stop-list {
    max-height: none !important;
    overflow-y: visible !important;
    padding-left: 20px !important;
  }

  .stop-list li {
    font-size: 1rem !important;
    margin-bottom: 16px !important;
    line-height: 1.4 !important;
  }

  .stop-list li a {
    padding: 4px 0 !important;
    display: block !important;
    width: 100% !important;
  }

  .attract-cta {
    padding: 0 20px !important;
  }

  .attract-cta h1 {
    font-size: 2rem !important;
    line-height: 1.2 !important;
    margin: 0 0 1rem 0 !important;
  }

  .attract-cta p {
    font-size: 1.125rem !important;
    margin: 0 !important;
  }

  .credits-logo {
    margin-top: 2rem !important;
    padding-top: 1rem !important;
  }

  .credits-logo img {
    max-width: 85% !important;
  }
}

/* ============================================
   SMALL MOBILE PORTRAIT (320px - 480px)
   ============================================ */
@media screen and (max-width: 480px) {
  html, body {
    font-size: 15px !important;
  }

  .panel {
    padding: 55px 15px 15px 15px !important;
  }

  .viewer {
    width: calc(100% - 30px) !important;
    height: 45vh !important;
    min-height: 250px !important;
    margin: 0 15px 15px 15px !important;
  }

  .header {
    padding: 10px 15px !important;
  }

  .icon-btn,
  .icon-btn img,
  .icon-btn svg,
  #restartBtn,
  #restartBtn img,
  #restartBtn svg {
    width: 18px !important;
    height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
  }

  .stop-title {
    font-size: 1.33rem !important;
  }

  .stop-text {
    font-size: 0.93rem !important;
  }

  .menu-btn {
    top: 0px !important;
    right: 15px !important;
  }

  .close-menu-x {
    top: 0px !important;
    right: 15px !important;
  }

  .nav-btn {
    padding: 12px 18px !important;
    font-size: 0.93rem !important;
  }

  .menu-overlay {
    padding: 55px 15px 30px 15px !important;
  }

  .stop-list {
    padding-left: 18px !important;
  }

  .stop-list li {
    font-size: 0.93rem !important;
    margin-bottom: 14px !important;
  }

  .attract-cta {
    padding: 0 15px !important;
  }

  .attract-cta h1 {
    font-size: 1.75rem !important;
    line-height: 1.2 !important;
  }

  .attract-cta p {
    font-size: 1rem !important;
  }
}

/* ============================================
   MOBILE & SMALL TABLET LANDSCAPE
   Side-by-side layout
   ============================================ */
@media screen and (max-width: 896px) and (orientation: landscape) {
  html, body {
    font-size: 14px !important;
  }

  .main {
    flex-direction: row-reverse !important;
    overflow: hidden !important;
  }

  .panel {
    width: 40% !important;
    min-width: 280px !important;
    max-width: 400px !important;
    padding: 45px 18px 18px 18px !important;
    order: initial !important;
    overflow-y: auto !important;
  }

  .viewer {
    flex: 1 !important;
    margin: 15px !important;
    min-height: 240px !important;
    order: initial !important;
  }

  .header {
    padding: 10px 15px !important;
  }

  .icon-btn {
    width: 18px !important;
    height: 18px !important;
  }

  .stop-title {
    font-size: 1.29rem !important;
    margin-bottom: 0.71rem !important;
  }

  .stop-text {
    font-size: 1rem !important;
    line-height: 1.5 !important;
  }

  .nav-btn {
    padding: 12px 18px !important;
    font-size: 1rem !important;
  }
}

/* ============================================
   TABLET PORTRAIT (768px - 1024px)
   Stacked: text ABOVE, map BELOW
   ============================================ */
@media screen and (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
  html, body {
    font-size: 17px !important;
    overflow-x: hidden !important;
  }

  body {
    overflow-y: auto !important;
  }

  .main {
    display: flex !important;
    flex-direction: column !important;
    overflow-y: visible !important;
    min-height: 100vh !important;
  }

  /* Panel ABOVE */
  .panel {
    width: 100% !important;
    padding: 70px 30px 25px 30px !important;
    order: 1 !important;
    flex-shrink: 0 !important;
  }

  /* Viewer BELOW */
  .viewer {
    width: calc(100% - 60px) !important;
    height: 55vh !important;
    min-height: 400px !important;
    margin: 0 30px 35px 30px !important;
    order: 2 !important;
    flex-shrink: 0 !important;
  }

  .header {
    padding: 18px 30px !important;
  }

  .icon-btn {
    width: 22px !important;
    height: 22px !important;
  }

  .stop-title {
    font-size: 1.65rem !important;
    margin-bottom: 1rem !important;
  }

  .stop-text {
    font-size: 1.06rem !important;
    line-height: 1.65 !important;
    max-height: none !important;
    overflow-y: visible !important;
  }

  .stop-image {
    margin-top: 1.2rem !important;
    min-height: 200px !important;
  }

  .stop-image img {
    width: 90% !important;
  }

  .menu-btn {
    top: 8px !important;
    right: 30px !important;
  }

  .close-menu-x {
    top: 8px !important;
    right: 30px !important;
  }

  .controls {
    gap: 0.75rem !important;
    margin-top: 1.5rem !important;
    padding-top: 1.25rem !important;
    margin-bottom: 1.5rem !important;
  }

  .nav-btn {
    padding: 15px 24px !important;
    font-size: 1.06rem !important;
  }

  .menu-overlay {
    padding: 70px 30px 40px 30px !important;
  }

  .menu-title {
    font-size: 1.75rem !important;
    margin-bottom: 8px !important;
  }

  .menu-subtitle {
    font-size: 0.94rem !important;
    margin-bottom: 36px !important;
  }

  .stop-list {
    padding-left: 22px !important;
  }

  .stop-list li {
    font-size: 1.06rem !important;
    margin-bottom: 18px !important;
  }
}

/* ============================================
   TABLET LANDSCAPE & SMALL DESKTOP (897px - 1366px)
   Side-by-side layout, NO blue bar
   ============================================ */
@media screen and (min-width: 897px) and (max-width: 1366px) {
  html, body {
    font-size: 16px !important;
  }

  .main {
    flex-direction: row-reverse !important;
  }

  .panel {
    width: 400px !important;
    padding: 55px 28px 28px 28px !important;
    order: initial !important;
    overflow-y: auto !important;
  }

  .viewer {
    flex: 1 !important;
    margin: 25px !important;
    order: initial !important;
  }

  .header {
    padding: 18px 25px !important;
  }

  .icon-btn {
    width: 20px !important;
    height: 20px !important;
  }

  .stop-title {
    font-size: 1.5rem !important;
  }

  .stop-text {
    font-size: 1rem !important;
    line-height: 1.6 !important;
  }

  .nav-btn {
    padding: 14px 22px !important;
    font-size: 1rem !important;
  }
}

/* ============================================
   DESKTOP (1367px+)
   BLUE BAR APPEARS HERE
   ============================================ */
@media screen and (min-width: 1367px) {
  /* SHOW BLUE BAR on desktop */
  .panel-styling {
    display: block !important;
  }
}

@media screen and (min-width: 1367px) and (max-width: 1920px) {
  html, body {
    font-size: 18px !important;
  }

  .main {
    flex-direction: row-reverse !important;
  }

  .panel {
    width: 550px !important;
    padding: 80px 40px 40px 70px !important;
  }

  .viewer {
    flex: 1 !important;
    margin: 40px 60px 40px 20px !important;
  }

  .header {
    padding: 30px 20px 30px 70px !important;
  }

  .icon-btn {
    width: 24px !important;
    height: 24px !important;
  }

  .stop-title {
    font-size: 1.67rem !important;
    margin: 1.78rem 0 !important;
  }

  .stop-text {
    font-size: 1rem !important;
    line-height: 1.7 !important;
  }

  .menu-btn {
    top: 20px !important;
    right: 30px !important;
  }

  .close-menu-x {
    top: 20px !important;
    right: 30px !important;
  }

  .nav-btn {
    padding: 16px 24px !important;
    font-size: 16px !important;
  }

  .menu-overlay {
    padding: 80px 70px 60px 70px !important;
  }
}

/* ============================================
   LARGE DISPLAYS (1921px+)
   4K, ultrawide, large screens
   ============================================ */
@media screen and (min-width: 1921px) {
  html, body {
    font-size: 20px !important;
  }

  .panel {
    width: 650px !important;
    padding: 90px 60px 60px 90px !important;
  }

  .viewer {
    margin: 60px 80px 60px 30px !important;
  }

  .header {
    padding: 40px 30px 40px 90px !important;
  }

  .icon-btn {
    width: 28px !important;
    height: 28px !important;
  }

  .stop-title {
    font-size: 1.8rem !important;
    margin: 2rem 0 1.6rem 0 !important;
  }

  .stop-text {
    font-size: 1rem !important;
    line-height: 1.8 !important;
  }

  .nav-btn {
    padding: 18px 28px !important;
    font-size: 18px !important;
  }

  .menu-overlay {
    padding: 90px 80px 70px 80px !important;
  }

  .menu-title {
    font-size: 2.25rem !important;
  }

  .menu-subtitle {
    font-size: 1.125rem !important;
  }

  .stop-list li {
    font-size: 1.25rem !important;
    margin-bottom: 22px !important;
  }
}

/* ============================================
   TOUCH DEVICE OPTIMIZATIONS
   ============================================ */
@media (hover: none) and (pointer: coarse) {
  button, a, .icon-btn, [role="button"] {
    min-width: 44px;
    min-height: 44px;
  }

  button:active, a:active, .icon-btn:active, [role="button"]:active {
    opacity: 0.8;
  }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .viewer,
  .panel {
    will-change: auto;
  }
}

/* ============================================
   HIGH CONTRAST MODE
   ============================================ */
@media (prefers-contrast: high) {
  .nav-btn {
    border: 2px solid #fff;
  }

  .menu-btn,
  .close-menu-x {
    text-decoration-thickness: 2px;
  }

  .stop-list li a {
    text-decoration: underline;
  }
}