/* ============================================================================
   TIVOLI - ORDKLASSERNES FORLYSTELSESPARK (CARTOON STIL)
   Designet til 8-12 år - tilpasset både laptops/Chromebooks, desktops og iPads
   ============================================================================ */

:root {
  --ink: #1d2d44;
  --tivoli-red: #e63946;
  --tivoli-red-dark: #b81d2a;
  --tivoli-gold: #ffd166;
  --tivoli-amber: #ffb703;
  --tivoli-green: #2dc653;
  --tivoli-green-dark: #1b9aaa;
  --park-bg: #eef8ff;
  --cream: #fffdf7;
  --card-shadow: 0 5px 0 var(--ink);
  --btn-shadow: 0 4px 0 var(--ink);
}

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

html,
body {
  min-height: 100%;
  font-family: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top, #fff9e6 0%, #dff3ff 60%, #cdeac0 100%);
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

button,
.map-plaza-spot {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3,
.brand-word,
.tivoli-btn,
.spot-ride-title,
.sign-title,
.ticket-word-text,
.capacity-badge {
  font-family: "Fredoka", "Nunito", sans-serif;
  font-kerning: none;
}

.hidden {
  display: none !important;
}

/* ============================================================================
   TOPBAR
   ============================================================================ */
.tivoli-topbar {
  min-height: 62px;
  padding: max(5px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) 5px max(18px, env(safe-area-inset-left));
  background: linear-gradient(90deg, #c1121f 0%, #e63946 50%, #c1121f 100%);
  border-bottom: 3.5px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 4px 12px rgba(29, 45, 68, 0.16);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.brand-logo-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  background: linear-gradient(180deg, #ffe58f 0%, #ffd166 100%);
  border: 2.8px solid var(--ink);
  border-radius: 14px;
  padding: 4px 16px 5px;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--ink);
  transition: transform 0.12s ease;
}

.brand-logo-btn:hover {
  transform: translateY(-2px);
}

.brand-word {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  color: #b81d2a;
}

.brand-word-svg {
  height: 17.5px;
  width: auto;
  display: block;
}

.brand-tag {
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0.2px;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--cream);
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  padding: 5px 13px;
  font-weight: 800;
  font-size: 0.92rem;
  box-shadow: 0 3px 0 rgba(29, 45, 68, 0.45);
}

.tivoli-star-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: block;
  overflow: visible;
}

.tivoli-star-mini {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: -3px;
  overflow: visible;
}

.tivoli-ticket-icon {
  width: 34px;
  height: 20px;
  flex-shrink: 0;
  display: block;
  overflow: visible;
}

.tivoli-book-icon {
  width: 25px;
  height: 20px;
  flex-shrink: 0;
  display: block;
  overflow: visible;
}

@keyframes ticketEarnedPop {
  0% { transform: scale(1); }
  45% { transform: scale(1.1); background: #fff4cc; }
  100% { transform: scale(1); }
}

.pill-tickets.ticket-pop {
  animation: ticketEarnedPop 0.28s ease-out;
}

/* ============================================================================
   CARTOON KNAPPER
   ============================================================================ */
.tivoli-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 1rem;
  font-weight: 700;
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 9px 18px;
  cursor: pointer;
  box-shadow: var(--btn-shadow);
  transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.12s ease;
  user-select: none;
  color: var(--ink);
  background: var(--cream);
}

.tivoli-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.03);
}

.tivoli-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--ink);
}

.btn-small {
  padding: 6px 13px;
  font-size: 0.9rem;
  border-radius: 12px;
}

.btn-back {
  background: #fff;
  padding: 6px 14px;
  font-size: 0.95rem;
}

.btn-gold {
  background: var(--tivoli-gold);
}

.btn-cream {
  background: var(--cream);
}

.btn-green {
  background: linear-gradient(180deg, #1e824c 0%, #135b33 100%);
  color: #fffdf7;
  text-shadow: 0 1.5px 0 rgba(7, 26, 15, 0.5);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.26), var(--btn-shadow);
}

.btn-green:active {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 0 var(--ink);
}

/* ============================================================================
   SKÆRM-BEHOLDER
   ============================================================================ */
.screen-container {
  max-width: 1380px;
  margin: 0 auto;
  padding: 10px max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.mobile-park-list {
  display: none;
}

/* ============================================================================
   SKÆRM 1: CARTOON OVERSIGTSKORT
   ============================================================================ */
.map-welcome-banner {
  text-align: center;
  margin-bottom: 8px;
}

.map-welcome-banner h1 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: clamp(1.3rem, 2.1vw, 1.85rem);
  color: var(--ink);
  text-shadow: 0 2px 0 #fff;
}

.welcome-tent-icon {
  width: clamp(32px, 2.7vw, 42px);
  height: auto;
  flex-shrink: 0;
  overflow: visible;
}

.map-welcome-banner p {
  font-size: 0.96rem;
  font-weight: 700;
  color: #334e68;
}

.park-map-frame {
  display: flex;
  justify-content: center;
  align-items: center;
}

.park-map-stage {
  position: relative;
  width: 100%;
  /* Passer ind på skærmen inkl. bundtekst uden at man skal scrolle på en Chromebook eller iPad! */
  max-width: min(1240px, calc((100vh - 170px) * 16 / 9));
  max-width: min(1240px, calc((100dvh - 170px) * 16 / 9));
  aspect-ratio: 16 / 9;
  border: 4px solid var(--ink);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 10px 0 var(--ink), 0 16px 32px rgba(29, 45, 68, 0.22);
  background: #67b95b;
}

.frontpage-credit {
  margin-top: 14px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #334e68;
  letter-spacing: 0.2px;
}

.park-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
}

.map-hotspots-layer {
  position: absolute;
  inset: 0;
}

.map-plaza-spot {
  position: absolute;
  transform: translateX(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 0;
  z-index: 5;
  outline: none;
}

.spot-hover-glow {
  position: absolute;
  inset: -6%;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 232, 130, 0.48) 0%,
    rgba(255, 209, 102, 0.2) 45%,
    rgba(255, 209, 102, 0) 72%
  );
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.map-plaza-spot:hover,
.map-plaza-spot:focus-visible {
  z-index: 14;
}

.map-plaza-spot:hover .spot-hover-glow,
.map-plaza-spot:focus-visible .spot-hover-glow {
  opacity: 1;
  transform: scale(1.06);
}

.map-plaza-spot:hover .spot-label-plate,
.map-plaza-spot:focus-visible .spot-label-plate {
  transform: translateY(-3px) scale(1.06);
  background: #fff9e2;
  box-shadow: 0 6px 0 var(--ink), 0 8px 18px rgba(0, 0, 0, 0.28);
}

.spot-label-plate {
  position: relative;
  z-index: 2;
  background: rgba(255, 253, 247, 0.96);
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  padding: 2px 9px 3px;
  box-shadow: 0 3px 0 var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 108px;
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.16s ease, background 0.16s ease;
}

.spot-ride-title {
  font-size: clamp(0.72rem, 0.96vw, 0.9rem);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
  white-space: nowrap;
}

.spot-class-pill {
  margin-top: 2px;
  background: var(--spot-color, var(--tivoli-red));
  color: #fff;
  font-size: clamp(0.62rem, 0.8vw, 0.74rem);
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1.6px solid var(--ink);
  white-space: nowrap;
}

.plate-maze .spot-class-pill {
  background: #2d6a4f;
}

.spot-star-badge {
  position: absolute;
  top: 4%;
  right: 2%;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--cream);
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 0.78rem;
  font-weight: 800;
  box-shadow: 0 2px 0 var(--ink);
  z-index: 4;
}

/* Små levende animationer på oversigtskortet */
@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes bobGentle {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-4px); }
}
@keyframes swayGentle {
  0%, 100% { transform: rotate(-7deg); }
  50% { transform: rotate(7deg); }
}
@keyframes towerDropMini {
  0%, 100% { transform: translateY(10px); }
  45%, 60% { transform: translateY(-14px); }
}

.map-spin-slow {
  animation: spinSlow 22s linear infinite;
}
.map-bob {
  animation: bobGentle 2.6s ease-in-out infinite;
}
.map-sway {
  animation: swayGentle 3.2s ease-in-out infinite;
}
.map-tower-drop {
  animation: towerDropMini 4s ease-in-out infinite;
}

/* ============================================================================
   SKÆRM 2: FORLYSTELSE (SKILT + ANSATTE + FORLYSTELSE + KØ)
   ============================================================================ */
.ride-layout {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

/* Venstre panel: Træskilt + Tivoli-ansatte */
.ride-sidebar {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.wooden-sign-card {
  background: #fff7e2;
  border: 3.5px solid var(--ink);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

.sign-awning-strip {
  height: 8px;
  background: repeating-linear-gradient(
    90deg,
    #c1121f 0 14px,
    #fffdf7 14px 28px
  );
  border-bottom: 2px solid var(--ink);
}

.sign-lights-strip {
  height: 10px;
  background:
    radial-gradient(
      circle,
      #fffef2 0 2px,
      #ffd166 2.2px 3.4px,
      rgba(255, 209, 102, 0.28) 4.4px,
      transparent 5px
    )
    repeat-x center / 20px 10px,
    #1d2d44;
  border-bottom: 2px solid var(--ink);
}

.sign-brass-header {
  background: linear-gradient(180deg, #ffe694 0%, #f4b63f 100%);
  border-bottom: 2.5px solid var(--ink);
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.sign-bolt {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff9db, #d9941e);
  border: 1.8px solid var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-size: 0.62rem;
  line-height: 1;
  flex-shrink: 0;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}

.sign-header-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 3px 7px;
  text-align: center;
  flex: 1;
}

.sign-title {
  font-family: "Fredoka", sans-serif;
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.08;
  color: var(--ink);
  letter-spacing: 0.4px;
}

.sign-latin {
  background: var(--ink);
  color: #ffe694;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 1px 8px;
  border-radius: 999px;
  letter-spacing: 0.3px;
}

.sign-body {
  padding: 9px 11px 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  background: #fff7e2;
  box-shadow: inset 0 0 0 2.5px rgba(244, 182, 63, 0.35);
}

.sign-rule {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.28;
  font-weight: 800;
  color: var(--ink);
  text-align: center;
  padding: 0 3px 6px;
  border-bottom: 1.5px dashed rgba(29, 45, 68, 0.22);
}

.sign-trick-box {
  position: relative;
  background: linear-gradient(180deg, #ffffff 0%, #fffaf0 100%);
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  padding: 7px 13px 8px;
  box-shadow: 0 2.5px 0 rgba(29, 45, 68, 0.14);
}

.sign-trick-box::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1.5px dashed rgba(217, 148, 30, 0.55);
  border-radius: 8px;
  pointer-events: none;
}

.sign-ticket-notch {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff7e2;
  border: 2.5px solid transparent;
  pointer-events: none;
  z-index: 2;
}

.sign-ticket-notch.notch-l {
  left: -7.25px;
  border-top-color: var(--ink);
  border-right-color: var(--ink);
  transform: translateY(-50%) rotate(45deg);
}

.sign-ticket-notch.notch-r {
  right: -7.25px;
  border-bottom-color: var(--ink);
  border-left-color: var(--ink);
  transform: translateY(-50%) rotate(45deg);
}

.sign-trick-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(180deg, #ffe89e 0%, #ffd166 100%);
  border: 1.8px solid var(--ink);
  border-radius: 999px;
  padding: 1.5px 10px 1.5px 7px;
  font-family: "Fredoka", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
  box-shadow: 0 1.5px 0 var(--ink);
}

.trick-color-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ride-color, var(--tivoli-red));
  border: 1.5px solid var(--ink);
  flex-shrink: 0;
}

.sign-trick-text {
  position: relative;
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.3;
  font-weight: 500;
  color: var(--ink);
}

.sign-trick-text strong,
.maze-rule-text strong,
.turpas-card p strong {
  font-weight: 800;
  color: #0f1c2e;
}

.sign-examples-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sign-examples-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: "Fredoka", sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: #7c4d12;
}

.sign-examples-label::before,
.sign-examples-label::after {
  content: "";
  flex: 1;
  height: 1.5px;
  background: rgba(29, 45, 68, 0.2);
}

.sign-examples-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.sign-example-chip {
  flex: 1 1 auto;
  text-align: center;
  background: linear-gradient(180deg, #ffec99 0%, #ffd166 100%);
  border: 1.8px solid var(--ink);
  border-radius: 8px;
  padding: 2.5px 6.5px;
  font-family: "Fredoka", sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink);
  box-shadow: 0 2px 0 var(--ink);
  white-space: nowrap;
}

.sign-note {
  margin: 0;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  background: rgba(29, 45, 68, 0.055);
  border: 1.5px solid rgba(29, 45, 68, 0.18);
  border-radius: 9px;
  padding: 5px 8px;
  font-size: 0.76rem;
  color: #2b3d52;
  font-weight: 700;
  line-height: 1.28;
}

.sign-note-icon {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.sign-tent-mini {
  width: 19px;
  height: 18px;
  display: block;
}

.challenge-toggle-btn {
  margin-top: 1px;
  width: 100%;
  padding: 6px 9px;
  border-radius: 10px;
  border: 2px solid var(--ink);
  background: #eef5ff;
  font-family: "Fredoka", sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2.5px 0 var(--ink);
}

.challenge-toggle-btn.active {
  background: #ffd166;
}

/* Tivoli-ansatte boks */
.employee-booth {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #fffdf7 0%, #fff3d6 100%);
  border: 3.5px solid var(--ink);
  border-radius: 18px;
  padding: 16px 10px 9px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.booth-awning-mini {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: repeating-linear-gradient(
    90deg,
    #c1121f 0 14px,
    #fffdf7 14px 28px
  );
  border-bottom: 2px solid var(--ink);
}

.employee-figures-row {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

#employee-svg-holder,
#maze-emp-svg {
  width: 100%;
}

.emp-portrait-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  border: 3px solid var(--ink);
  overflow: hidden;
  box-shadow: 0 3px 0 var(--ink);
  background: #2d6a4f;
}

.emp-portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  display: block;
}

.emp-attention {
  animation: shakeSign 0.3s ease-in-out;
}

.employee-speech-bubble {
  width: 100%;
  background: #ffffff;
  border: 2.2px solid var(--ink);
  border-radius: 12px;
  padding: 7px 10px;
  font-size: 0.85rem;
  line-height: 1.3;
  position: relative;
  box-shadow: 0 2px 0 rgba(29, 45, 68, 0.1);
}

.employee-speech-bubble.bubble-oops {
  background: #fff0f3;
  border-color: #c1121f;
}

@keyframes popIn {
  0% { transform: scale(0.96); }
  60% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

@keyframes shakeSign {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.bubble-pop,
.bubble-oops {
  animation: popIn 0.22s ease-out;
}

.sign-shake {
  animation: shakeSign 0.28s ease-in-out;
}

.employee-nametag {
  background: var(--ink);
  color: var(--tivoli-gold);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 3px 12px;
  border-radius: 999px;
}

/* Højre hovedkolonne: Forlystelsen + Køen */
.ride-main-column {
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ride-top-strip {
  background: var(--cream);
  border: 3px solid var(--ink);
  border-radius: 18px;
  padding: 8px 16px;
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.ride-title {
  font-size: 1.35rem;
  color: var(--ink);
}

.ride-subtitle {
  font-size: 0.88rem;
  font-weight: 700;
  color: #486581;
}

.ride-progress-widget {
  min-width: 210px;
  text-align: right;
}

.capacity-badge {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}

.ride-progress-bar {
  width: 100%;
  height: 14px;
  background: #e2e8f0;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
}

.ride-progress-fill {
  height: 100%;
  width: 0%;
  background: #2d9355;
  transition: width 0.28s ease;
}

.ride-stage-card {
  position: relative;
  background: var(--cream);
  border: 3.5px solid var(--ink);
  border-radius: 22px;
  padding: 6px;
  box-shadow: var(--card-shadow);
}

.ride-svg-holder {
  width: 100%;
  display: flex;
  justify-content: center;
}

.ride-stage-svg {
  width: 100%;
  max-height: calc(100vh - 365px);
  max-height: calc(100dvh - 365px);
  min-height: 235px;
  height: auto;
  display: block;
  border-radius: 16px;
}

/* ============================================================================
   KØ-STATION MED ÆGTE TIVOLI-TEMA (VIMPLER, FLØJLSTOV, BROSTEN & BILLETLUGE)
   ============================================================================ */
.queue-station-bar {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  background: linear-gradient(180deg, #dff3ff 0%, #fff6da 62%, #d8cfc2 62%, #bfb4a3 100%);
  border: 3.5px solid var(--ink);
  border-radius: 22px;
  padding: 20px 14px 10px;
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
}

/* Kulørt Tivoli-vimpelranke & lyskæde langs toppen af køen */
.queue-bunting-strip {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 15px;
  background-image:
    radial-gradient(circle at 16px 4px, #fffbe0 2.5px, #ffd166 4px, transparent 4.5px),
    repeating-linear-gradient(
      90deg,
      #e63946 0px 18px,
      #ffd166 18px 36px,
      #2ec4b6 36px 54px,
      #9b5de5 54px 72px,
      #ff9f1c 72px 90px
    );
  background-size: 32px 10px, 90px 100%;
  border-bottom: 2.5px solid var(--ink);
  z-index: 2;
}

.queue-area {
  flex: 1 1 0%;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
}

.queue-gate-post {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-right: 6px;
}

.gate-arrow {
  background: linear-gradient(180deg, #e63946 0%, #b81d2a 100%);
  color: #fffbe0;
  font-family: "Fredoka", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 3px 12px;
  border-radius: 999px;
  border: 2.2px solid var(--ink);
  box-shadow: 0 2px 0 var(--ink);
}

.queue-walkway-scene {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border-radius: 14px;
  padding: 4px 6px 0;
  /* Diskret brostens-mønster nederst på gangstien */
  background-image:
    linear-gradient(180deg, rgba(116, 198, 157, 0.22) 0%, rgba(255, 248, 225, 0.25) 68%, rgba(108, 117, 125, 0.28) 68%),
    repeating-linear-gradient(90deg, transparent 0 26px, rgba(29, 45, 68, 0.12) 26px 28px);
}

.ride-queue-track {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 4px 4px 2px;
  min-height: 126px;
  position: relative;
  z-index: 2;
}

.queue-velvet-rope {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 26px;
  pointer-events: none;
  z-index: 3;
}

.queue-guest {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.queue-guest-front {
  margin-right: 8px;
  animation: bobGentle 2.2s ease-in-out infinite;
}

.queue-guest-waiting {
  opacity: 1;
}

/* Ægte udstanset Tivoli-billet med hak i siderne */
.guest-word-ticket {
  position: relative;
  background: #fffdf7;
  border: 2.6px solid var(--ink);
  border-radius: 10px;
  padding: 4px 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 3px 0 var(--ink);
  margin-bottom: 3px;
}

.guest-word-ticket.ticket-front {
  background: linear-gradient(180deg, #ffe66d 0%, #ffd166 100%);
  border-width: 3px;
  padding: 6px 16px;
  box-shadow: 0 4px 0 var(--ink), 0 0 14px rgba(255, 209, 102, 0.75);
}

.ticket-notch {
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  background: #e5f3fb;
  border: 2.2px solid var(--ink);
  border-radius: 50%;
  transform: translateY(-50%);
}

.notch-left {
  left: -5px;
}

.notch-right {
  right: -5px;
}

.ticket-star {
  color: #e63946;
  font-size: 0.82rem;
}

.ticket-word-text {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--ink);
}

.ticket-front .ticket-word-text {
  font-size: 1.38rem;
}

.guest-figure-wrap {
  display: flex;
  justify-content: center;
}

.guest-critter-svg {
  width: 88px;
  height: 70px;
  overflow: visible;
}

.queue-guest-front .guest-critter-svg,
.queue-guest-arriving-front .guest-critter-svg {
  width: 104px;
  height: 82px;
}

.queue-guest-arriving {
  transition: none;
  will-change: transform;
  animation: queueWalkAcross var(--walk-dur, 2.8s) cubic-bezier(0.22, 0.61, 0.36, 1) var(--walk-delay, 0.7s) both;
}

.queue-guest-arriving-front {
  margin-right: 8px;
}

.queue-guest-arriving .guest-figure-wrap {
  transform-origin: 50% 90%;
  animation-name: queueStepGait;
  animation-duration: 0.44s;
  animation-timing-function: ease-in-out;
  animation-delay: var(--walk-delay, 0.7s);
  animation-iteration-count: var(--walk-steps, 6);
}

.guest-word-ticket.ticket-tucked {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.guest-word-ticket.ticket-reveal {
  transform-origin: 50% 100%;
  animation: ticketPullOut 0.42s cubic-bezier(0.22, 1, 0.36, 1) var(--reveal-delay, 0ms) both;
}

@keyframes queueWalkAcross {
  0% {
    transform: translateX(var(--walk-dist, 700px));
  }
  100% {
    transform: translateX(0);
  }
}

@keyframes queueStepGait {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-4px) rotate(-2deg);
  }
  50% {
    transform: translateY(0) rotate(0deg);
  }
  75% {
    transform: translateY(-4px) rotate(2deg);
  }
}

@keyframes ticketPullOut {
  0% {
    opacity: 0;
    transform: translateY(22px) scale(0.52) rotate(-4deg);
  }
  68% {
    opacity: 1;
    transform: translateY(-3px) scale(1.04) rotate(1deg);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0deg);
  }
}

.queue-running-banner {
  font-family: "Fredoka", sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: #b81d2a;
  padding: 32px 12px;
  background: rgba(255, 253, 247, 0.92);
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  width: 100%;
  text-align: center;
}

/* Rød/hvid-stribet Tivoli-Billetluge til højre */
.ticket-controls {
  position: relative;
  overflow: hidden;
  flex: 0 0 auto;
  background: linear-gradient(180deg, #fffdf7 0%, #ffe8a3 100%);
  border: 3px solid var(--ink);
  border-radius: 18px;
  padding: 22px 12px 10px;
  box-shadow: 0 4px 0 var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.ticket-booth-awning {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 16px;
  background: repeating-linear-gradient(
    90deg,
    #e63946 0px 18px,
    #fffdf7 18px 36px
  );
  border-bottom: 2.5px solid var(--ink);
}

.controls-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.controls-label {
  font-family: "Fredoka", sans-serif;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: var(--ink);
}

.controls-buttons-row {
  display: flex;
  gap: 10px;
}

.btn-reject {
  background: linear-gradient(180deg, #dc1f2e 0%, #a3121e 100%);
  color: #fffdf7;
  text-shadow: 0 1.5px 0 rgba(20, 10, 14, 0.35);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.28), 0 4px 0 var(--ink);
}

.btn-allow {
  background: linear-gradient(180deg, #239658 0%, #15683b 100%);
  color: #fffdf7;
  text-shadow: 0 1.5px 0 rgba(10, 24, 16, 0.35);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.28), 0 4px 0 var(--ink);
}

#ride-ticket-controls .btn-reject,
#ride-ticket-controls .btn-allow {
  flex-direction: column;
  gap: 4px;
  min-width: 120px;
  padding: 8px 15px 7px;
  border-width: 2.8px;
  border-radius: 12px;
}

#ride-ticket-controls .btn-reject:active,
#ride-ticket-controls .btn-allow:active {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 0 var(--ink);
}

.btn-main-label {
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.3px;
}

.key-hint {
  font-family: "Nunito", sans-serif;
  font-size: 0.71rem;
  font-weight: 800;
  line-height: 1.2;
  color: #fffdf7;
  background: rgba(15, 23, 36, 0.24);
  padding: 1px 8px;
  border-radius: 999px;
  text-shadow: none;
}

/* ============================================================================
   OVERLAY VED GENNEMFØRT TUR / LABYRINT
   ============================================================================ */
.stage-overlay {
  position: absolute;
  inset: 0;
  background: rgba(29, 45, 68, 0.72);
  backdrop-filter: blur(3px);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 20;
}

.overlay-card {
  background: var(--cream);
  border: 4px solid var(--ink);
  border-radius: 22px;
  padding: 20px 24px;
  max-width: 560px;
  width: 100%;
  text-align: center;
  box-shadow: 0 8px 0 var(--ink);
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: popIn 0.28s ease-out;
}

.complete-badge {
  align-self: center;
  background: var(--tivoli-gold);
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 4px 16px;
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  font-size: 1rem;
}

.badge-retry {
  background: #ffccd5;
}

.completed-words-box {
  background: #fff8e6;
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  padding: 10px;
}

.completed-words-label {
  font-size: 0.85rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.completed-words-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.completed-word-chip {
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 2px 10px;
  font-weight: 800;
  font-size: 0.86rem;
}

.complete-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
}

/* ============================================================================
   SKÆRM 3: ORDKLASSE-LABYRINTEN (PAC-MAN STIL)
   ============================================================================ */
.maze-layout {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.maze-sidebar {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

#maze-sign-panel {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.maze-picker-card {
  background: linear-gradient(180deg, #fffdf7 0%, #fff4d6 100%);
  border: 3.5px solid var(--ink);
  border-radius: 18px;
  padding: 10px 12px;
  box-shadow: var(--card-shadow);
}

.maze-picker-card h2 {
  font-size: 1.08rem;
  margin-bottom: 3px;
}

.maze-picker-hint {
  font-size: 0.8rem;
  color: #486581;
  font-weight: 700;
  margin-bottom: 8px;
}

.maze-class-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.maze-class-chip {
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  padding: 5px 11px;
  font-family: "Fredoka", sans-serif;
  font-size: 0.86rem;
  font-weight: 700;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 2.5px 0 var(--ink);
  transition: transform 0.1s ease;
}

.maze-class-chip.active {
  background: var(--chip-color, #38b000);
  color: #fff;
}

.maze-sign-rule-item {
  background: linear-gradient(180deg, #ffffff 0%, #fffaf0 100%);
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 6px 9px;
  font-size: 0.82rem;
  line-height: 1.28;
  box-shadow: 0 2px 0 rgba(29, 45, 68, 0.12);
}

.maze-rule-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: "Fredoka", sans-serif;
  font-size: 0.86rem;
  color: var(--ink);
  margin-bottom: 2px;
}

.maze-rule-text {
  font-weight: 500;
  color: var(--ink);
}

.maze-sign-mini-ex {
  margin-top: 3px;
  font-size: 0.76rem;
  color: #52606d;
  font-weight: 800;
}

.compact-booth .employees-svg {
  height: 92px;
}

.maze-main-column {
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Labyrint-type vælger (Trædestens-labyrint vs. Hæklabyrint) */
.maze-mode-switcher {
  background: linear-gradient(180deg, #fffdf7 0%, #fff3d1 100%);
  border: 3px solid var(--ink);
  border-radius: 18px;
  padding: 7px 12px;
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.maze-mode-label {
  font-family: "Fredoka", sans-serif;
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--ink);
}

.maze-mode-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex: 1;
}

.maze-mode-btn {
  flex: 1 1 200px;
  text-align: center;
  border: 2.8px solid var(--ink);
  border-radius: 14px;
  padding: 8px 18px;
  font-family: "Fredoka", sans-serif;
  font-size: 0.96rem;
  font-weight: 700;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 3px 0 var(--ink);
  transition: transform 0.1s ease, background 0.15s ease;
}

.maze-mode-btn:hover {
  transform: translateY(-1px);
}

.maze-mode-btn.active {
  background: linear-gradient(180deg, #1e824c 0%, #135b33 100%);
  color: #fffdf7;
  text-shadow: 0 1.5px 0 rgba(7, 26, 15, 0.45);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.24), 0 3px 0 var(--ink);
}

.maze-mode-btn .mode-sub {
  font-family: "Nunito", sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  opacity: 0.92;
}

.maze-hud-bar {
  background: var(--cream);
  border: 3px solid var(--ink);
  border-radius: 18px;
  padding: 8px 14px;
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.maze-hud-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 1rem;
}

.hud-label {
  font-weight: 800;
  color: #486581;
}

.maze-hearts {
  display: inline-flex;
  gap: 4px;
  font-size: 1.25rem;
}

.maze-heart.lost {
  opacity: 0.35;
}

.maze-hud-actions {
  display: flex;
  gap: 8px;
}

#btn-maze-turbo.active {
  background: var(--tivoli-gold);
}

.maze-stage-wrapper {
  display: flex;
  align-items: center;
  gap: 14px;
}

.maze-canvas-box {
  position: relative;
  flex: 1;
  background: linear-gradient(180deg, #1b4332 0%, #122e20 100%);
  border: 3.5px solid var(--ink);
  border-radius: 20px;
  padding: 5px;
  box-shadow: var(--card-shadow);
  display: flex;
  justify-content: center;
}

#maze-canvas {
  width: min(100%, calc((100vh - 230px) * 880 / 560));
  width: min(100%, calc((100dvh - 230px) * 880 / 560));
  height: auto;
  display: block;
  border-radius: 15px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.maze-dpad-panel {
  background: var(--cream);
  border: 3px solid var(--ink);
  border-radius: 18px;
  padding: 12px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.dpad-title {
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
  color: #486581;
}

.dpad-grid {
  display: grid;
  grid-template-columns: repeat(3, 46px);
  grid-template-rows: repeat(2, 46px);
  gap: 6px;
}

.dpad-btn {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  border: 3px solid var(--ink);
  background: var(--tivoli-gold);
  font-size: 1.15rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--ink);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.dpad-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--ink);
}

/* ============================================================================
   MODAL: TURPAS & ORDKLASSE-HJÆLP
   ============================================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(29, 45, 68, 0.68);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 100;
}

.modal-dialog {
  background: var(--cream);
  border: 4px solid var(--ink);
  border-radius: 24px;
  padding: 20px 22px;
  max-width: 940px;
  width: 100%;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 10px 0 var(--ink);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.modal-intro {
  font-weight: 700;
  color: #486581;
  margin-bottom: 14px;
}

.turpas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

.turpas-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #fffdf7 0%, #fff6df 100%);
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  padding: 15px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  box-shadow: 0 3px 0 var(--ink);
}

.turpas-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--card-color, var(--tivoli-red));
  border-bottom: 2px solid var(--ink);
}

.turpas-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.98rem;
}

.turpas-ride-sub {
  font-size: 0.82rem;
  font-weight: 800;
  color: #e63946;
}

.turpas-card p {
  font-size: 0.86rem;
  line-height: 1.32;
  font-weight: 500;
}

.turpas-ex {
  font-size: 0.8rem;
  font-weight: 800;
  color: #334e68;
}

.modal-footer {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}

/* ============================================================================
   KONFETTI
   ============================================================================ */
#confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 120;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -18px;
  width: 12px;
  height: 18px;
  border-radius: 3px;
  border: 1.5px solid var(--ink);
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(105vh) rotate(540deg);
    opacity: 0.85;
  }
}

/* ============================================================================
   RESPONSIV TILPASNING (COMPUTER, IPAD / TABLET & TELEFON)
   ============================================================================ */

/* Touch-enheder (telefon og iPad uden mus): skjul tastaturgenveje & undgå hængende hover */
@media (hover: none) and (pointer: coarse) {
  .key-hint,
  .dpad-desktop-hint {
    display: none;
  }

  .tivoli-btn:hover,
  .brand-logo-btn:hover,
  .maze-mode-btn:hover {
    transform: none;
    filter: none;
  }

  .map-plaza-spot:hover .spot-hover-glow {
    opacity: 0;
  }

  .map-plaza-spot:hover .spot-label-plate {
    transform: none;
    background: rgba(255, 253, 247, 0.96);
    box-shadow: 0 3px 0 var(--ink);
  }

  #ride-ticket-controls .btn-reject,
  #ride-ticket-controls .btn-allow {
    min-height: 48px;
    justify-content: center;
  }
}

/* iPad liggende (1024px–1180px) & kompakte bærbare: behold 2 kolonner side om side */
@media (max-width: 1180px) {
  .ride-layout,
  .maze-layout {
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 12px;
  }

  .spot-label-plate {
    min-width: 88px;
    padding: 2px 7px 3px;
  }

  #ride-ticket-controls .btn-reject,
  #ride-ticket-controls .btn-allow {
    min-width: 104px;
    padding: 8px 12px 7px;
  }
}

/* iPad stående (768px–960px) & mellemstore tablets */
@media (max-width: 960px) {
  .tivoli-topbar {
    padding: max(5px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 5px max(12px, env(safe-area-inset-left));
    gap: 8px;
  }

  .topbar-left,
  .topbar-right {
    gap: 7px;
  }

  .stat-pill {
    padding: 4px 10px;
    font-size: 0.85rem;
  }

  .spot-label-plate {
    min-width: 74px;
    padding: 2px 6px;
    border-radius: 10px;
  }

  .spot-ride-title {
    font-size: clamp(0.66rem, 1.15vw, 0.82rem);
  }

  .spot-class-pill {
    font-size: clamp(0.58rem, 0.95vw, 0.7rem);
    padding: 1px 6px;
  }

  /* Forlystelse: selve spillet øverst, skilt + billetkontrol side om side nedenunder */
  .ride-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .ride-main-column {
    order: 1;
  }

  .ride-sidebar {
    order: 2;
    display: grid;
    grid-template-columns: 1.25fr 0.95fr;
    gap: 12px;
    align-items: start;
  }

  .ride-stage-svg {
    max-height: none;
    min-height: 0;
  }

  .queue-station-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 18px 12px 10px;
    gap: 10px;
  }

  .ticket-controls {
    width: 100%;
    padding: 20px 12px 10px;
  }

  .controls-buttons-row {
    width: 100%;
  }

  #ride-ticket-controls .btn-reject,
  #ride-ticket-controls .btn-allow {
    flex: 1 1 0;
    min-height: 50px;
    justify-content: center;
  }

  /* Labyrint: ordklasse-chips øverst, labyrint i midten, hjælpeskilt nederst */
  .maze-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .maze-sidebar {
    display: contents;
  }

  .maze-picker-card {
    order: 1;
  }

  .maze-main-column {
    order: 2;
  }

  #maze-sign-panel {
    order: 3;
    display: grid;
    grid-template-columns: 1.25fr 0.95fr;
    gap: 12px;
    align-items: start;
  }

  .maze-stage-wrapper {
    flex-direction: column;
    gap: 10px;
  }

  .maze-canvas-box {
    width: 100%;
  }

  #maze-canvas {
    width: 100%;
  }

  .maze-dpad-panel {
    width: 100%;
    flex-direction: row;
    justify-content: center;
    gap: 18px;
    padding: 10px 14px;
  }

  .dpad-grid {
    grid-template-columns: repeat(3, 52px);
    grid-template-rows: repeat(2, 52px);
    gap: 7px;
  }

  .dpad-btn {
    width: 52px;
    height: 52px;
    font-size: 1.25rem;
  }

  .stage-overlay {
    overflow-y: auto;
  }
}

/* Fuldskærms-overlay på mindre skærme så afslutningskort aldrig klippes over */
@media (max-width: 720px), (max-height: 560px) {
  .stage-overlay {
    position: fixed;
    inset: 0;
    z-index: 95;
    border-radius: 0;
    padding: 14px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .overlay-card {
    max-height: calc(100vh - 28px);
    max-height: calc(100dvh - 28px);
    overflow-y: auto;
    padding: 16px 16px;
    gap: 10px;
    margin: auto;
  }

  .overlay-card h2 {
    font-size: 1.22rem;
  }

  .complete-actions .tivoli-btn {
    width: 100%;
  }
}

/* Telefon (op til 640px) */
@media (max-width: 640px) {
  .screen-container {
    padding: 8px max(10px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  }

  .tivoli-topbar {
    min-height: 0;
    padding: max(5px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 6px max(10px, env(safe-area-inset-left));
    gap: 6px;
    flex-wrap: wrap;
  }

  .brand-tag {
    display: none;
  }

  .brand-logo-btn {
    padding: 5px 11px;
    border-radius: 11px;
  }

  .brand-word-svg {
    height: 15px;
  }

  .btn-back {
    padding: 5px 10px;
    font-size: 0.82rem;
    border-radius: 10px;
  }

  .stat-pill {
    padding: 3px 8px;
    font-size: 0.78rem;
    gap: 5px;
  }

  .tivoli-star-icon {
    width: 17px;
    height: 17px;
  }

  .tivoli-ticket-icon {
    width: 26px;
    height: 16px;
  }

  .tivoli-book-icon {
    width: 20px;
    height: 16px;
  }

  #btn-turpas {
    padding: 4px 9px;
    font-size: 0.8rem;
    border-radius: 10px;
    gap: 5px;
  }

  /* Oversigtskort på telefon: kompakt kort + store touch-venlige kort nedenunder */
  .map-welcome-banner h1 {
    font-size: 1.15rem;
    gap: 6px;
  }

  .welcome-tent-icon {
    width: 26px;
  }

  .map-welcome-banner p {
    font-size: 0.84rem;
    line-height: 1.28;
  }

  .park-map-stage {
    border-radius: 16px;
    border-width: 3px;
    box-shadow: 0 5px 0 var(--ink);
  }

  .park-map-stage .spot-ride-title {
    display: none;
  }

  .park-map-stage .spot-label-plate {
    min-width: 0;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
  }

  .park-map-stage .spot-class-pill {
    margin-top: 0;
    font-size: 0.56rem;
    padding: 1.5px 5px;
    box-shadow: 0 2px 0 var(--ink);
  }

  .spot-star-badge {
    padding: 1px 4px;
    font-size: 0.65rem;
    border-width: 1.8px;
  }

  .spot-star-badge .tivoli-star-mini {
    width: 12px;
    height: 12px;
  }

  .mobile-park-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-top: 12px;
  }

  .mobile-spot-card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #fffdf7 0%, #fff5dc 100%);
    border: 2.8px solid var(--ink);
    border-radius: 15px;
    padding: 12px 10px 9px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    cursor: pointer;
    box-shadow: 0 3.5px 0 var(--ink);
    text-align: left;
    font-family: inherit;
    color: var(--ink);
  }

  .mobile-spot-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--spot-color, var(--tivoli-red));
    border-bottom: 2px solid var(--ink);
  }

  .mobile-spot-card:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 var(--ink);
  }

  .mobile-spot-maze {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .mobile-spot-top {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
  }

  .mobile-spot-maze .mobile-spot-top {
    width: auto;
  }

  .mobile-spot-title {
    font-family: "Fredoka", sans-serif;
    font-size: 0.96rem;
    font-weight: 700;
    line-height: 1.15;
    color: var(--ink);
  }

  .mobile-spot-star {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 0.78rem;
    font-weight: 800;
    flex-shrink: 0;
  }

  .mobile-spot-card .spot-class-pill {
    font-size: 0.72rem;
    padding: 2px 8px;
  }

  /* Forlystelse på telefon */
  .ride-top-strip {
    padding: 7px 11px;
    gap: 6px;
    border-radius: 14px;
  }

  .ride-title {
    font-size: 1.08rem;
  }

  .ride-subtitle {
    font-size: 0.78rem;
  }

  .ride-progress-widget {
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
  }

  .capacity-badge {
    font-size: 0.85rem;
    margin-bottom: 0;
    white-space: nowrap;
  }

  .ride-progress-bar {
    flex: 1;
    height: 12px;
  }

  .ride-stage-card {
    padding: 4px;
    border-radius: 16px;
  }

  .ride-stage-svg {
    border-radius: 12px;
  }

  .queue-station-bar {
    padding: 16px 8px 8px;
    border-radius: 16px;
    gap: 8px;
  }

  .ride-queue-track {
    min-height: 98px;
    gap: 7px;
    padding: 3px 2px 2px;
  }

  .queue-guest-front,
  .queue-guest-arriving-front {
    margin-right: 3px;
  }

  .guest-word-ticket {
    padding: 3px 9px;
    gap: 4px;
  }

  .guest-word-ticket.ticket-front {
    padding: 4px 11px;
  }

  .ticket-word-text {
    font-size: 0.92rem;
  }

  .ticket-front .ticket-word-text {
    font-size: 1.1rem;
  }

  .guest-critter-svg {
    width: 66px;
    height: 53px;
  }

  .queue-guest-front .guest-critter-svg,
  .queue-guest-arriving-front .guest-critter-svg {
    width: 80px;
    height: 63px;
  }

  .ticket-controls {
    padding: 18px 8px 8px;
    border-radius: 14px;
    gap: 6px;
  }

  .controls-label {
    font-size: 0.8rem;
  }

  #ride-ticket-controls .btn-reject,
  #ride-ticket-controls .btn-allow {
    min-width: 0;
    min-height: 46px;
    padding: 8px 10px;
  }

  .btn-main-label {
    font-size: 1.04rem;
  }

  /* På telefon: Billetkontrol-taleboble lige under knapperne, træskilt nedenunder */
  .ride-sidebar,
  #maze-sign-panel {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .ride-sidebar .employee-booth,
  #maze-sign-panel .employee-booth {
    order: -1;
    flex-direction: row;
    align-items: center;
    padding: 13px 10px 8px;
    gap: 10px;
  }

  .ride-sidebar .employee-figures-row,
  #maze-sign-panel .employee-figures-row {
    width: 96px;
    flex-shrink: 0;
    order: -1;
    gap: 4px;
  }

  .ride-sidebar .employee-nametag,
  #maze-sign-panel .employee-nametag {
    font-size: 0.68rem;
    padding: 2px 7px;
  }

  .ride-sidebar .employee-speech-bubble,
  #maze-sign-panel .employee-speech-bubble {
    flex: 1;
    font-size: 0.82rem;
  }

  /* Labyrint på telefon */
  .maze-picker-card {
    padding: 8px 10px;
    border-radius: 15px;
  }

  .maze-picker-card h2 {
    font-size: 0.98rem;
  }

  .maze-picker-hint {
    font-size: 0.76rem;
    margin-bottom: 6px;
  }

  .maze-class-chip {
    padding: 4px 9px;
    font-size: 0.8rem;
  }

  .maze-mode-switcher {
    padding: 6px 9px;
    border-radius: 15px;
    gap: 6px;
  }

  .maze-mode-label {
    width: 100%;
    font-size: 0.86rem;
  }

  .maze-mode-btn {
    flex: 1 1 135px;
    padding: 7px 10px;
    font-size: 0.84rem;
    border-radius: 11px;
  }

  .maze-hud-bar {
    padding: 7px 10px;
    border-radius: 15px;
    gap: 7px;
    font-size: 0.88rem;
  }

  .maze-hud-item {
    font-size: 0.88rem;
  }

  .maze-hearts {
    font-size: 1.05rem;
  }

  .maze-hud-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .maze-dpad-panel {
    flex-direction: row;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 15px;
  }

  .dpad-title {
    text-align: left;
    font-size: 0.76rem;
  }

  .dpad-grid {
    grid-template-columns: repeat(3, 50px);
    grid-template-rows: repeat(2, 50px);
    gap: 5px;
  }

  .dpad-btn {
    width: 50px;
    height: 50px;
  }

  /* Modal på telefon */
  .modal-backdrop {
    padding: 10px;
  }

  .modal-dialog {
    padding: 14px;
    border-radius: 18px;
  }

  .modal-header h2 {
    font-size: 1.15rem;
  }

  .turpas-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 360px) {
  .mobile-park-list {
    grid-template-columns: 1fr;
  }
}

/* Telefon i liggende tilstand: lad topbaren rulle væk så spillet får fuld skærmhøjde */
@media (max-height: 520px) and (orientation: landscape) {
  .tivoli-topbar {
    position: relative;
  }

  .park-map-stage {
    max-width: min(100%, calc((100dvh - 36px) * 16 / 9));
  }
}
