/* ========================================
   LANDSCAPE.CSS – Scrollable Map Layout
   ======================================== */

/* Page – fixed black background */
.page-landscape {
  background: #0a0a0a;
  background-attachment: fixed;
  color: var(--color-text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ========================================
   GAME HEADER (sticky, hidden until start)
   ======================================== */

.game-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: none;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-lg);
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transform: translateY(-100%);
  opacity: 0;
  transition: transform 0.5s ease, opacity 0.5s ease;
}

.game-header.is-active {
  display: flex;
  transform: translateY(0);
  opacity: 1;
}

.game-header__avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--color-secondary);
  flex-shrink: 0;
}

.game-header__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ability-indicator {
  font-size: 1.1rem;
  flex-shrink: 0;
  cursor: default;
  transition: opacity 0.2s ease;
}

.ability-indicator:empty {
  display: none;
}

.ability-indicator.is-used {
  opacity: 0.3;
  filter: grayscale(1);
}

.game-header__info {
  flex: 1;
  min-width: 0;
}

.game-header__level {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: 2px;
}

.level-badge {
  background: linear-gradient(135deg, #c8a84e, #e0c068);
  color: #1a1400;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 1px 8px;
  border-radius: 10px;
  letter-spacing: 0.05em;
}

.level-name {
  font-size: 0.85rem;
  color: var(--color-text);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-header__progress {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.xp-bar {
  flex: 1;
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  min-width: 60px;
}

.xp-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  border-radius: 3px;
  width: 0%;
  transition: width 0.8s ease;
}

.xp-text {
  font-size: 0.7rem;
  color: var(--color-secondary);
  white-space: nowrap;
  font-weight: 600;
}

.game-header__stats {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}

.stat {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 10px;
  border-radius: 12px;
  white-space: nowrap;
}

/* ========================================
   AVATAR SELECTION
   ======================================== */

.avatar-select {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  background:
    url('../assets/landing-bg.webp') center center / cover no-repeat fixed;
  position: relative;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.avatar-select::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.05) 0%,
    rgba(0, 0, 0, 0.2) 30%,
    rgba(10, 10, 10, 0.55) 60%,
    rgba(10, 10, 10, 0.8) 100%
  );
  z-index: 0;
}

.avatar-select > * {
  position: relative;
  z-index: 1;
}

.avatar-select > .lang-switcher--landing {
  position: absolute;
  z-index: 2;
}

/* Landing Hero */
.landing-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-md) var(--space-lg);
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.landing-hero__title {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-family: var(--font-heading);
  color: var(--color-secondary);
  text-shadow: 0 2px 20px rgba(200, 168, 78, 0.4), 0 0 60px rgba(0, 0, 0, 0.8);
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.landing-hero__tagline {
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  color: rgba(255, 255, 255, 0.85);
  max-width: 550px;
  line-height: 1.5;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}

.landing-hero__explorers {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: var(--space-xs);
}

.site-footer__admin-link {
  color: inherit;
  text-decoration: none;
}

.site-footer__admin-link:hover {
  text-decoration: underline;
}

.avatar-select.is-hidden {
  display: none;
}

.avatar-select__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  max-width: 700px;
  text-align: center;
}

.avatar-select__title {
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  color: var(--color-secondary);
  text-shadow: 0 2px 12px rgba(200, 168, 78, 0.3);
}

.avatar-select__subtitle {
  font-size: clamp(0.95rem, 2.5vw, 1.15rem);
  color: var(--color-text-muted);
  line-height: 1.6;
}

.avatar-select__options {
  display: flex;
  gap: var(--space-xl);
  flex-wrap: wrap;
  justify-content: center;
}

.avatar-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-xl);
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  min-width: 160px;
}

.avatar-option img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.15);
  transition: border-color var(--transition);
}

.avatar-option__name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
}

.avatar-option__ability {
  display: block;
  font-size: 0.7rem;
  color: var(--color-text-muted, rgba(255, 255, 255, 0.6));
  font-weight: 400;
  margin-top: 2px;
  line-height: 1.3;
}

.avatar-option:hover {
  transform: translateY(-4px);
  border-color: var(--color-secondary);
  box-shadow: 0 8px 32px rgba(200, 168, 78, 0.2);
}

.avatar-option:hover img {
  border-color: var(--color-secondary);
}

.avatar-option.is-selected {
  border-color: var(--color-secondary);
  background: rgba(200, 168, 78, 0.1);
  box-shadow: 0 0 24px rgba(200, 168, 78, 0.3);
}

.avatar-select__fields {
  display: flex;
  gap: var(--space-md);
  width: 100%;
  max-width: 500px;
}

.avatar-select__name-field {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  flex: 1;
}

.avatar-select__label {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.avatar-select__required {
  color: #e74c3c;
}

.avatar-select__optional {
  font-size: 0.75rem;
  text-transform: none;
  letter-spacing: normal;
  opacity: 0.6;
}

.avatar-select__input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  font-size: 1.2rem;
  font-family: var(--font-heading);
  text-align: center;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--border-radius);
  color: var(--color-text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.avatar-select__input:focus {
  border-color: var(--color-secondary);
  box-shadow: 0 0 16px rgba(200, 168, 78, 0.2);
}

.avatar-select__input::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.avatar-select__confirm {
  margin-top: var(--space-lg);
  padding: var(--space-md) var(--space-2xl);
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-heading);
  background: linear-gradient(135deg, #c8a84e, #e0c068);
  color: #1a1400;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
}

.avatar-select__confirm:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(200, 168, 78, 0.4);
}

.avatar-select__confirm:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.header-player-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text);
}

.header-separator {
  color: var(--color-text-muted);
  margin: 0 2px;
}

/* ========================================
   START ZONE (Sofa / Komfortzone)
   ======================================== */

.start-zone {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl) var(--space-lg);
  background:
    radial-gradient(ellipse at center, rgba(26, 46, 26, 0.4) 0%, transparent 70%),
    #0a0a0a;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.start-zone.is-hidden {
  display: none;
}

.start-zone__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xl);
  max-width: 500px;
  text-align: center;
  position: relative;
}

.start-zone__sofa {
  width: 280px;
  height: 280px;
  object-fit: contain;
  filter: drop-shadow(0 8px 32px rgba(91, 186, 122, 0.2));
  animation: sofa-float 4s ease-in-out infinite;
}

@keyframes sofa-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.start-zone__avatar {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--color-secondary);
  box-shadow: 0 0 30px rgba(200, 168, 78, 0.4);
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.6s ease;
  animation: sofa-float 4s ease-in-out infinite;
}

.start-zone__text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.start-zone__title {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  color: var(--color-secondary);
  text-shadow: 0 2px 12px rgba(200, 168, 78, 0.3);
}

.start-zone__subtitle {
  font-size: clamp(0.95rem, 2.5vw, 1.15rem);
  color: var(--color-text-muted);
  line-height: 1.6;
  max-width: 400px;
}

.start-zone__btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-2xl);
  background: linear-gradient(135deg, var(--color-primary), #3d8a5a);
  color: white;
  border-radius: 50px;
  font-size: 1.15rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 20px rgba(74, 158, 110, 0.4);
  animation: btn-pulse 2s ease-in-out infinite;
}

.start-zone__btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 8px 32px rgba(74, 158, 110, 0.6);
}

@keyframes btn-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(74, 158, 110, 0.4); }
  50% { box-shadow: 0 4px 30px rgba(74, 158, 110, 0.7); }
}

/* ========================================
   MAP CONTAINER – Durchgehende scrollbare Karte
   ======================================== */

.map-container {
  display: none;
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
}

.map-container.is-active {
  display: block;
}

/* Background Panels */
.map-panel {
  width: 100%;
  aspect-ratio: 1536 / 1024;
  background-size: cover;
  background-position: center;
  display: block;
  position: relative;
}

/* Fade-Overlay between panels */
.map-panel + .map-panel::before {
  content: '';
  position: absolute;
  top: -25px;
  left: 0;
  right: 0;
  height: 50px;
  background: linear-gradient(to bottom, #0a0a0a, transparent);
  z-index: 1;
  pointer-events: none;
}

#map-panel-0 { background-image: url('../assets/map-panel-0.png'); }
#map-panel-1 { background-image: url('../assets/map-panel-1.png'); }
#map-panel-2 { background-image: url('../assets/map-panel-2.png'); }
#map-panel-3 { background-image: url('../assets/map-panel-3.png'); }
#map-panel-4 { background-image: url('../assets/map-panel-4.png'); }

/* Fallback gradient when images are missing */
.map-panel {
  background-color: #0a0a0a;
}

#map-panel-0 { background-color: #1a2e1a; }
#map-panel-1 { background-color: #0a1e2e; }
#map-panel-2 { background-color: #1a0a2e; }
#map-panel-3 { background-color: #0a1a0a; }
#map-panel-4 { background-color: #0d1a0d; }

/* ========================================
   MAP STATIONS (absolute positioned)
   ======================================== */

.map-station {
  position: absolute;
  top: var(--pos-top);
  left: var(--pos-left);
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--color-text);
  z-index: 10;
  transition: transform 0.3s ease, filter 0.3s ease;
  cursor: pointer;
  animation: marker-float 3s ease-in-out infinite;
}

.map-station:nth-child(3n+1) { animation-delay: 0s; }
.map-station:nth-child(3n+2) { animation-delay: 0.8s; }
.map-station:nth-child(3n)   { animation-delay: 1.6s; }

@keyframes marker-float {
  0%, 100% { transform: translate(-50%, -50%) translateY(0); }
  50% { transform: translate(-50%, -50%) translateY(-6px); }
}

.map-station__img {
  width: 135px;
  height: 135px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.map-station__label {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
  text-align: center;
}

.map-station__badge {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: linear-gradient(135deg, #c8a84e, #e0c068);
  color: #1a1400;
  padding: 1px 8px;
  border-radius: 8px;
}

.map-station__check {
  display: none;
  position: absolute;
  top: -4px;
  right: -4px;
  width: 24px;
  height: 24px;
  background: var(--color-secondary);
  border-radius: 50%;
  color: #1a1400;
  font-weight: 700;
  font-size: 0.75rem;
  line-height: 24px;
  text-align: center;
}

.map-station__check::after {
  content: '\2714';
}

/* Station hover */
.map-station:hover {
  transform: translate(-50%, -50%) scale(1.1);
  filter: drop-shadow(0 0 16px rgba(200, 168, 78, 0.5));
}

.map-station:hover .map-station__img {
  border-color: var(--color-secondary);
  box-shadow: 0 0 24px rgba(200, 168, 78, 0.4);
}

/* World-specific station colors */
.map-station[data-world="jungle"] .map-station__img { border-color: var(--world-jungle-primary); }
.map-station[data-world="ocean"] .map-station__img { border-color: var(--world-ocean-primary); }
.map-station[data-world="cosmos"] .map-station__img { border-color: var(--world-cosmos-primary); }
.map-station[data-world="metro"] .map-station__img { border-color: var(--world-metro-primary); }

/* Completed station */
.map-station.is-completed .map-station__img {
  border-color: var(--color-secondary);
  box-shadow: 0 0 20px rgba(200, 168, 78, 0.4);
}

.map-station.is-completed .map-station__check {
  display: block;
}

/* Locked station */
.map-station.is-locked {
  opacity: 0.35;
  filter: grayscale(0.8);
  pointer-events: none;
  animation: none;
}

.map-station.is-locked .map-station__img {
  border-color: rgba(255, 255, 255, 0.15);
}

/* Finale marker */
.map-station--finale {
  z-index: 11;
}

.map-station__finale-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 135px;
  height: 135px;
  border-radius: 50%;
  font-size: 3.5rem;
  background: radial-gradient(circle, rgba(200, 168, 78, 0.2), rgba(200, 168, 78, 0.05));
  border: 3px solid var(--color-secondary);
  box-shadow: 0 0 24px rgba(200, 168, 78, 0.5), 0 0 48px rgba(200, 168, 78, 0.2);
  transition: box-shadow 0.3s ease;
}

.map-station--finale:not(.is-locked) .map-station__finale-icon {
  animation: finale-glow 2s ease-in-out infinite;
}

@keyframes finale-glow {
  0%, 100% { box-shadow: 0 0 24px rgba(200, 168, 78, 0.5), 0 0 48px rgba(200, 168, 78, 0.2); }
  50% { box-shadow: 0 0 36px rgba(200, 168, 78, 0.8), 0 0 64px rgba(200, 168, 78, 0.4); }
}

.map-station--finale.is-locked {
  opacity: 0.3;
  filter: grayscale(0.8);
  pointer-events: auto;
  animation: none;
}

.map-station--finale.is-locked .map-station__finale-icon {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: none;
}

/* Mobile finale card */
.mobile-finale {
  padding: var(--space-xl) var(--space-md);
  max-width: 500px;
  margin: 0 auto;
}

.mobile-station-card--finale {
  border-left-color: var(--color-secondary);
  background: rgba(200, 168, 78, 0.08);
  border: 2px solid rgba(200, 168, 78, 0.3);
  border-left: 4px solid var(--color-secondary);
}

.mobile-station-card--finale:hover {
  box-shadow: 0 4px 24px rgba(200, 168, 78, 0.3);
}

/* Fork-locked (mandatory not done yet) */
.map-station.is-fork-locked {
  opacity: 0.5;
  filter: grayscale(0.5);
  pointer-events: none;
  animation: none;
}

/* ========================================
   INSTANT TOOLTIPS (data-tooltip, no native delay)
   ======================================== */

[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 6px;
  padding: 3px 8px;
  background: rgba(0, 0, 0, 0.9);
  color: #f1c40f;
  font-size: 0.65rem;
  font-weight: 600;
  white-space: nowrap;
  border-radius: 4px;
  pointer-events: none;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.12s ease;
}

[data-tooltip]:hover::after {
  opacity: 1;
}

/* ========================================
   MINIGAME TOGGLE BUTTON
   ======================================== */

.minigame-toggle {
  margin-top: 0;
  padding: 4px 8px;
  font-size: 1rem;
  line-height: 1;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(200, 168, 78, 0.15);
  border: 1px solid rgba(200, 168, 78, 0.3);
  color: var(--color-secondary);
  cursor: pointer;
  opacity: 0.7;
  transition: opacity var(--transition), background var(--transition);
}

.minigame-toggle:hover {
  opacity: 1;
  background: rgba(200, 168, 78, 0.25);
}

.minigame-toggle[aria-pressed="true"] {
  opacity: 1;
  background: rgba(200, 168, 78, 0.35);
  border-color: rgba(200, 168, 78, 0.6);
}

/* ========================================
   MINIGAME NODE VISIBILITY
   ======================================== */

.map-minigame.minigame-hidden,
.mobile-minigame.minigame-hidden {
  display: none !important;
}

/* ========================================
   MAP MINIGAME NODES (between worlds)
   ======================================== */

.map-minigame {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  z-index: 10;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  font-family: inherit;
  transition: top 0.8s ease-in-out, left 0.8s ease-in-out, transform 0.3s ease, opacity 0.3s ease;
  animation: marker-float 3s ease-in-out infinite;
  animation-delay: 0.4s;
}

.map-minigame__img {
  width: 68px;
  height: 68px;
  object-fit: contain;
  border-radius: 50%;
  border: 2px dashed rgba(241, 196, 15, 0.5);
  background: rgba(0, 0, 0, 0.25);
  padding: 4px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.map-minigame__label {
  font-size: 0.65rem;
  font-weight: 600;
  color: #f1c40f;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
}

.map-minigame:hover:not(:disabled) {
  transform: translate(-50%, -50%) scale(1.1);
}

.map-minigame:hover:not(:disabled) .map-minigame__img {
  border-color: #f1c40f;
  box-shadow: 0 0 20px rgba(241, 196, 15, 0.4);
}

.map-minigame.is-locked {
  opacity: var(--locked-opacity, 0.25);
  pointer-events: none;
  filter: grayscale(0.6);
  animation: none;
}

.map-minigame.is-completed .map-minigame__img {
  border-style: solid;
  border-color: rgba(46, 204, 113, 0.6);
}

.map-minigame.is-completed .map-minigame__label {
  color: #2ecc71;
}

.map-minigame.is-completed::after {
  content: '\2714';
  position: absolute;
  top: -4px;
  right: -4px;
  background: #2ecc71;
  color: #fff;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========================================
   SVG PATH LINES
   ======================================== */

.map-paths {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.map-path {
  fill: none;
  stroke-width: 3px;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.map-path--jungle { stroke: #5bba7a; }
.map-path--ocean  { stroke: #4ecdc4; }
.map-path--cosmos { stroke: #7c6cff; }
.map-path--metro  { stroke: #39ff14; }

.map-path.is-completed {
  opacity: 0.8;
  stroke-width: 4px;
  filter: drop-shadow(0 0 6px currentColor);
}

.map-path.is-active {
  opacity: 0.6;
  stroke-dasharray: 8 6;
  animation: path-march 1.5s linear infinite;
}

.map-path.is-locked {
  opacity: 0.12;
  stroke-dasharray: 4 8;
  stroke-width: 2px;
}

@keyframes path-march {
  to { stroke-dashoffset: -28; }
}

/* ========================================
   MAP AVATAR (moves along the path)
   ======================================== */

.map-avatar {
  position: absolute;
  z-index: 20;
  display: none;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  transform: translate(-50%, -100%);
  animation: avatar-idle 2s ease-in-out infinite;
}

/* Avatar image on map */
.map-avatar__img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-secondary);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

.map-avatar__name {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-secondary);
  background: rgba(0, 0, 0, 0.8);
  padding: 2px 10px;
  border-radius: 10px;
  margin-top: 4px;
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

/* Idle: gentle bob animation (shows only first frame) */
@keyframes avatar-idle {
  0%, 100% { transform: translate(-50%, -100%) translateY(0); }
  50% { transform: translate(-50%, -100%) translateY(-6px); }
}

/* Reduced motion: disable bob animation */
@media (prefers-reduced-motion: reduce) {
  .map-avatar {
    animation: none;
    transform: translate(-50%, -100%);
  }
}

/* ========================================
   MAP WORLD LABELS
   ======================================== */

.map-world-label {
  position: absolute;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: none;
}

.map-world-label__number {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-text);
  background: rgba(0, 0, 0, 0.7);
  padding: 2px 10px;
  border-radius: 10px;
}

.map-world-label__name {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9), 0 2px 12px rgba(0, 0, 0, 0.6);
}

.map-world-label--jungle .map-world-label__name { color: var(--world-jungle-secondary); }
.map-world-label--ocean .map-world-label__name { color: var(--world-ocean-secondary); }
.map-world-label--cosmos .map-world-label__name { color: var(--world-cosmos-secondary); }
.map-world-label--metro .map-world-label__name { color: var(--world-metro-secondary); }

.map-world-label.is-locked {
  opacity: 0.25;
  filter: grayscale(0.7);
}

/* ========================================
   MAP PARTICLES
   ======================================== */

.map-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 3;
}

.particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  will-change: transform, opacity;
  left: calc(var(--x) * 1%);
  top: calc(var(--y) * 1%);
  width: calc(var(--size) * 1px);
  height: calc(var(--size) * 1px);
}

/* Jungle: Fireflies */
.particle--jungle {
  background: radial-gradient(circle, rgba(200, 200, 60, 0.9), rgba(120, 200, 60, 0) 70%);
  animation: firefly var(--duration) var(--delay) ease-in-out infinite;
}

@keyframes firefly {
  0%, 100% { transform: translate(0, 0); opacity: 0.2; }
  25% { opacity: 0.8; }
  50% { transform: translate(calc(var(--dx) * 1px), calc(var(--dy) * 1px)); opacity: 0.1; }
  75% { opacity: 0.9; }
}

/* Ocean: Bubbles */
.particle--ocean {
  background: radial-gradient(circle, rgba(0, 180, 216, 0.6), rgba(0, 180, 216, 0) 70%);
  animation: bubble var(--duration) var(--delay) ease-in-out infinite;
}

@keyframes bubble {
  0% { transform: translate(0, 0) scale(1); opacity: 0.4; }
  50% { transform: translate(calc(var(--dx) * 0.5px), calc(var(--dy) * -1px)) scale(1.2); opacity: 0.7; }
  100% { transform: translate(calc(var(--dx) * 1px), calc(var(--dy) * -2px)) scale(0.8); opacity: 0; }
}

/* Cosmos: Stars */
.particle--cosmos {
  background: radial-gradient(circle, rgba(224, 170, 255, 0.9), rgba(199, 125, 255, 0) 70%);
  animation: twinkle var(--duration) var(--delay) ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% { transform: scale(1); opacity: 0.3; }
  50% { transform: scale(1.5); opacity: 1; }
}

/* Metro: Data particles */
.particle--metro {
  background: radial-gradient(circle, rgba(57, 255, 20, 0.8), rgba(57, 255, 20, 0) 70%);
  animation: data-stream var(--duration) var(--delay) linear infinite;
}

@keyframes data-stream {
  0% { transform: translate(0, 0); opacity: 0; }
  20% { opacity: 0.8; }
  80% { opacity: 0.6; }
  100% { transform: translate(calc(var(--dx) * 1px), calc(var(--dy) * 1px)); opacity: 0; }
}

/* Start zone sparkles */
.start-sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.particle--sparkle {
  background: radial-gradient(circle, rgba(200, 168, 78, 0.8), rgba(200, 168, 78, 0) 70%);
  animation: firefly var(--duration) var(--delay) ease-in-out infinite;
}

/* ========================================
   MOBILE LANDSCAPE (Card Layout)
   ======================================== */

.mobile-landscape {
  display: none;
}

.mobile-landscape.is-active {
  display: block;
  padding: var(--space-lg) 0;
}

.mobile-world {
  padding: var(--space-xl) var(--space-md);
}

.mobile-world__header {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.mobile-world__number {
  display: inline-block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-text);
  background: rgba(0, 0, 0, 0.5);
  padding: 2px 12px;
  border-radius: 20px;
  margin-bottom: var(--space-xs);
}

.mobile-world__title {
  font-size: clamp(1.3rem, 4vw, 1.8rem);
  margin-bottom: var(--space-xs);
}

.mobile-world[data-world="jungle"] .mobile-world__title { color: var(--world-jungle-secondary); }
.mobile-world[data-world="ocean"] .mobile-world__title { color: var(--world-ocean-secondary); }
.mobile-world[data-world="cosmos"] .mobile-world__title { color: var(--world-cosmos-secondary); }
.mobile-world[data-world="metro"] .mobile-world__title { color: var(--world-metro-secondary); }

.mobile-world__progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

.mobile-world__bar {
  width: 100px;
  height: 4px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  overflow: hidden;
}

.mobile-world__fill {
  height: 100%;
  border-radius: 2px;
  width: 0%;
  transition: width 0.8s ease;
}

.mobile-world[data-world="jungle"] .mobile-world__fill { background: var(--world-jungle-primary); }
.mobile-world[data-world="ocean"] .mobile-world__fill { background: var(--world-ocean-primary); }
.mobile-world[data-world="cosmos"] .mobile-world__fill { background: var(--world-cosmos-primary); }
.mobile-world[data-world="metro"] .mobile-world__fill { background: var(--world-metro-primary); }

.mobile-world__text {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.mobile-world__lock-msg {
  display: none;
  text-align: center;
  padding: var(--space-md) var(--space-lg);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--border-radius);
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin-bottom: var(--space-lg);
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.mobile-world__lock-msg::before {
  content: '\1F512';
  display: block;
  font-size: 1.3rem;
  margin-bottom: var(--space-xs);
}

.mobile-world.is-locked {
  opacity: 0.4;
  filter: grayscale(0.7);
}

.mobile-world.is-locked .mobile-stations {
  pointer-events: none;
}

/* Minigame Node (inside world, after stations) */
.mobile-minigame {
  max-width: 500px;
  margin: var(--space-sm) auto 0;
  position: relative;
}

.mobile-minigame::before {
  content: '';
  display: block;
  width: 2px;
  height: 14px;
  background: rgba(241, 196, 15, 0.2);
  margin: 0 auto;
}

.mobile-minigame__btn {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: auto;
  margin: 0 auto;
  padding: var(--space-sm) var(--space-md);
  background: linear-gradient(135deg, rgba(241, 196, 15, 0.06), rgba(243, 156, 18, 0.03));
  border: 2px dashed rgba(241, 196, 15, 0.25);
  border-radius: 50px;
  color: var(--color-text);
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: left;
  font-family: inherit;
}

.mobile-minigame__btn:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: rgba(241, 196, 15, 0.6);
  background: linear-gradient(135deg, rgba(241, 196, 15, 0.14), rgba(243, 156, 18, 0.08));
  box-shadow: 0 4px 20px rgba(241, 196, 15, 0.15);
}

.mobile-minigame__img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
}

.mobile-minigame__content h3 {
  font-size: 0.8rem;
  font-weight: 700;
  margin: 0;
  color: #f1c40f;
}

.mobile-minigame__lock-hint {
  font-size: 0.65rem;
  margin: 1px 0 0;
  color: rgba(255, 255, 255, 0.4);
  font-style: italic;
}

.mobile-minigame__status {
  margin-left: auto;
  font-size: 1rem;
  flex-shrink: 0;
}

.mobile-minigame.is-locked {
  opacity: 0.35;
  pointer-events: none;
  filter: grayscale(0.5);
}

.mobile-minigame.is-completed .mobile-minigame__btn {
  border-style: solid;
  border-color: rgba(46, 204, 113, 0.3);
  background: rgba(46, 204, 113, 0.05);
  cursor: default;
}

.mobile-minigame.is-completed .mobile-minigame__content h3 {
  color: rgba(46, 204, 113, 0.8);
}

.mobile-minigame.is-completed .mobile-minigame__status {
  color: #2ecc71;
}

/* Mobile Stations */
.mobile-stations {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  max-width: 500px;
  margin: 0 auto;
}

.mobile-station-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius);
  border-left: 4px solid var(--color-primary);
  transition: transform var(--transition), box-shadow var(--transition);
  color: var(--color-text);
  text-decoration: none;
}

.mobile-station-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

/* Mandatory card highlight */
.mobile-station-card--mandatory {
  border-left-color: var(--color-secondary);
  background: rgba(200, 168, 78, 0.06);
}

/* World-specific borders for fork cards */
.mobile-world[data-world="jungle"] .mobile-station-card--fork { border-left-color: var(--world-jungle-primary); }
.mobile-world[data-world="ocean"] .mobile-station-card--fork { border-left-color: var(--world-ocean-primary); }
.mobile-world[data-world="cosmos"] .mobile-station-card--fork { border-left-color: var(--world-cosmos-primary); }
.mobile-world[data-world="metro"] .mobile-station-card--fork { border-left-color: var(--world-metro-primary); }

.mobile-station-card.is-completed {
  background: rgba(200, 168, 78, 0.08);
  border-left-color: var(--color-secondary);
}

.mobile-station-card.is-fork-locked {
  opacity: 0.45;
  pointer-events: none;
  filter: grayscale(0.3);
}

.mobile-station-card__icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.mobile-station-card__content h3 {
  font-size: 1.05rem;
  margin-bottom: var(--space-xs);
}

.mobile-station-card__content p {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.mobile-station-card__tag {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: linear-gradient(135deg, #c8a84e, #e0c068);
  color: #1a1400;
  padding: 2px 8px;
  border-radius: 8px;
  flex-shrink: 0;
}

.mobile-station-card__status {
  margin-left: auto;
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* Fork indicator */
.mobile-fork-indicator {
  text-align: center;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  padding: var(--space-sm) 0;
  position: relative;
}

.mobile-fork-indicator::before {
  content: '';
  display: block;
  width: 2px;
  height: 12px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 auto var(--space-xs);
}

.mobile-fork-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* ========================================
   BADGE BAR
   ======================================== */

.badge-bar {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-size: 0.9rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  opacity: 0.3;
  filter: grayscale(1);
  transition: opacity 0.4s ease, transform 0.4s ease, filter 0.4s ease;
}

.badge.is-earned {
  opacity: 1;
  filter: grayscale(0);
  animation: badge-pop 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes badge-pop {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

/* ========================================
   LEVEL-UP EFFECTS
   ======================================== */

.level-up-flash {
  position: fixed;
  inset: 0;
  background: white;
  z-index: 9998;
  pointer-events: none;
  opacity: 0;
}

.level-up-flash.is-active {
  animation: level-flash 0.6s ease-out forwards;
}

@keyframes level-flash {
  0% { opacity: 0; }
  30% { opacity: 0.3; }
  100% { opacity: 0; }
}

.level-badge.is-leveling-up {
  animation: level-badge-burst 1s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes level-badge-burst {
  0% { transform: scale(1); box-shadow: 0 0 0 rgba(200, 168, 78, 0); }
  40% { transform: scale(1.4); box-shadow: 0 0 24px rgba(200, 168, 78, 0.8); }
  100% { transform: scale(1); box-shadow: 0 0 0 rgba(200, 168, 78, 0); }
}

/* ========================================
   START ZONE DRAMATIC EFFECTS
   ======================================== */

.start-zone__avatar.is-leaving {
  transform: translateX(200px) translateY(-100px) scale(0.3) rotate(15deg);
  opacity: 0;
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.6s ease;
}

@keyframes camera-shake {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-3px, 2px); }
  20% { transform: translate(4px, -2px); }
  30% { transform: translate(-2px, 3px); }
  40% { transform: translate(3px, -1px); }
  50% { transform: translate(-4px, 1px); }
  60% { transform: translate(2px, -3px); }
  70% { transform: translate(-1px, 2px); }
  80% { transform: translate(3px, -2px); }
  90% { transform: translate(-2px, 1px); }
}

.start-zone__content.is-shaking {
  animation: camera-shake 0.4s ease-out;
}

/* Spark burst */
.spark {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-secondary);
  pointer-events: none;
  will-change: transform, opacity;
  animation: spark-fly var(--duration) ease-out forwards;
}

@keyframes spark-fly {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(calc(var(--dx) * 1px), calc(var(--dy) * 1px)) scale(0); opacity: 0; }
}

/* ========================================
   NOTEBOOK BUTTON + MODAL
   ======================================== */

.notebook-btn {
  margin-top: 0;
  padding: 4px 8px;
  font-size: 1rem;
  line-height: 1;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(200, 168, 78, 0.15);
  border: 1px solid rgba(200, 168, 78, 0.3);
  color: var(--color-secondary);
  cursor: pointer;
  opacity: 0.7;
  transition: opacity var(--transition), background var(--transition);
}

.notebook-btn:hover {
  opacity: 1;
  background: rgba(200, 168, 78, 0.25);
}

.notebook-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0);
  transition: background 0.3s ease, backdrop-filter 0.3s ease;
  padding: var(--space-lg);
  pointer-events: none;
}

.notebook-modal.is-visible {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  pointer-events: auto;
}

.notebook-card {
  background: #1a1a2e;
  border: 1px solid rgba(200, 168, 78, 0.3);
  border-radius: var(--border-radius);
  max-width: 520px;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.6);
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.notebook-modal.is-visible .notebook-card {
  transform: translateY(0);
  opacity: 1;
}

.notebook-card__header {
  text-align: center;
  padding: var(--space-xl) var(--space-xl) var(--space-md);
}

.notebook-card__icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: var(--space-sm);
}

.notebook-card__title {
  font-size: 1.4rem;
  color: var(--color-secondary);
  margin-bottom: var(--space-xs);
}

.notebook-card__subtitle {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.notebook-card__tabs {
  display: flex;
  gap: 2px;
  padding: 0 var(--space-xl);
  margin-bottom: var(--space-md);
}

.notebook-tab {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
  transition: background var(--transition), color var(--transition);
}

.notebook-tab:hover {
  background: rgba(255, 255, 255, 0.08);
}

.notebook-tab.is-active {
  background: rgba(200, 168, 78, 0.15);
  color: var(--color-secondary);
  border-bottom: 2px solid var(--color-secondary);
}

.notebook-card__content {
  flex: 1;
  overflow-y: auto;
  padding: 0 var(--space-xl) var(--space-md);
  min-height: 120px;
}

.notebook-entry {
  padding: var(--space-md);
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--border-radius-sm);
  margin-bottom: var(--space-sm);
  border-left: 3px solid var(--color-primary);
}

.notebook-entry--challenges {
  border-left-color: #f0a500;
}

.notebook-entry--reflections {
  border-left-color: #9b7fda;
}

.notebook-entry--notes {
  border-left-color: #4caf50;
}

.notebook-entry__station {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-secondary);
  margin-bottom: var(--space-xs);
}

.notebook-entry__context {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}

.notebook-entry__text {
  font-size: 0.9rem;
  color: var(--color-text);
  line-height: 1.6;
  white-space: pre-wrap;
  padding-left: var(--space-md);
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--border-radius-sm);
  padding: var(--space-sm) var(--space-md);
}

.notebook-empty {
  text-align: center;
  color: var(--color-text-muted);
  font-style: italic;
  padding: var(--space-xl) 0;
}

.notebook-card__close {
  flex: 1;
  padding: var(--space-sm) var(--space-lg);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--border-radius-sm);
  color: var(--color-text);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}

.notebook-card__actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.notebook-card__export {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  background: rgba(200, 168, 78, 0.2);
  border: 1px solid rgba(200, 168, 78, 0.4);
  border-radius: var(--border-radius-sm);
  color: var(--color-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}

.notebook-card__export:hover {
  background: rgba(200, 168, 78, 0.35);
}

.notebook-card__close:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ========================================
   NOTEBOOK EXPORT MODAL
   ======================================== */

.notebook-export-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.notebook-export-modal.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.notebook-export-card {
  background: #f5f5f0;
  color: #1a1a2e;
  border-radius: var(--border-radius-lg);
  padding: var(--space-lg);
  max-width: 680px;
  width: 92%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.notebook-export-modal.is-visible .notebook-export-card {
  transform: translateY(0);
}

.notebook-export-card__header {
  margin-bottom: var(--space-md);
}

.notebook-export-card__title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  margin: 0 0 4px;
  color: #1a1a2e;
}

.notebook-export-card__subtitle {
  font-size: 0.85rem;
  color: #555;
  margin: 0;
}

.notebook-export-card__content {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.notebook-export-card__text {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.8rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: var(--border-radius-sm);
  padding: var(--space-md);
  margin: 0;
  color: #222;
  user-select: all;
}

.notebook-export-card__actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.notebook-export-card__btn {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  border: none;
  border-radius: var(--border-radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}

.notebook-export-card__btn--copy {
  background: #2d6a4f;
  color: #fff;
}

.notebook-export-card__btn--copy:hover {
  background: #1b4332;
}

.notebook-export-card__btn--print {
  background: #264653;
  color: #fff;
}

.notebook-export-card__btn--print:hover {
  background: #1a323d;
}

.notebook-export-card__btn--close {
  background: #ddd;
  color: #333;
}

.notebook-export-card__btn--close:hover {
  background: #ccc;
}

/* Print styles for export */
@media print {
  body:not(.is-printing-export) * {
    /* Normal print: show everything */
  }

  body.is-printing-export * {
    visibility: hidden !important;
  }

  body.is-printing-export .notebook-export-modal,
  body.is-printing-export .notebook-export-card,
  body.is-printing-export .notebook-export-card__header,
  body.is-printing-export .notebook-export-card__content,
  body.is-printing-export .notebook-export-card__text,
  body.is-printing-export .notebook-export-card__title,
  body.is-printing-export .notebook-export-card__subtitle {
    visibility: visible !important;
  }

  body.is-printing-export .notebook-export-modal {
    position: static;
    background: none;
    backdrop-filter: none;
  }

  body.is-printing-export .notebook-export-card {
    max-width: 100%;
    max-height: none;
    padding: 0;
    background: #fff;
    box-shadow: none;
    border: none;
  }

  body.is-printing-export .notebook-export-card__text {
    border: none;
    padding: 0;
    font-size: 10pt;
  }

  body.is-printing-export .notebook-export-card__actions {
    display: none !important;
  }
}

/* ========================================
   HIGHSCORE BUTTON (Header)
   ======================================== */

.highscore-btn {
  margin-top: 0;
  padding: 4px 8px;
  font-size: 1rem;
  line-height: 1;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(200, 168, 78, 0.15);
  border: 1px solid rgba(200, 168, 78, 0.3);
  color: var(--color-secondary);
  cursor: pointer;
  opacity: 0.7;
  transition: opacity var(--transition), background var(--transition);
}

.highscore-btn:hover {
  opacity: 1;
  background: rgba(200, 168, 78, 0.25);
}

/* ========================================
   LANGUAGE SWITCHER
   ======================================== */

.lang-switcher {
  background: rgba(200, 168, 78, 0.3);
  border: 1px solid rgba(200, 168, 78, 0.5);
  color: var(--color-gold, #c8a84e);
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  transition: background 0.2s ease;
}

.lang-switcher:hover {
  background: rgba(200, 168, 78, 0.5);
}

.lang-switcher--landing {
  top: var(--space-md, 16px);
  right: var(--space-md, 16px);
}

/* ========================================
   HIGHSCORE MODAL
   ======================================== */

.highscore-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0);
  transition: background 0.3s ease, backdrop-filter 0.3s ease;
  padding: var(--space-lg);
}

.highscore-modal.is-visible {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
}

.highscore-card {
  background: #1a1a2e;
  border: 1px solid rgba(200, 168, 78, 0.3);
  border-radius: var(--border-radius);
  max-width: 440px;
  width: 100%;
  max-height: calc(100dvh - var(--space-xl) * 2);
  display: flex;
  flex-direction: column;
  padding: var(--space-xl);
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.6);
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.highscore-modal.is-visible .highscore-card {
  transform: translateY(0);
  opacity: 1;
}

.highscore-card__header {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.highscore-card__icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: var(--space-sm);
}

.highscore-card__title {
  font-size: 1.4rem;
  color: var(--color-secondary);
  margin-bottom: var(--space-xs);
}

.highscore-card__subtitle {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* Group filter dropdown */
.highscore-filter {
  margin-bottom: var(--space-md);
}

.highscore-filter__select {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  font-size: 0.9rem;
  font-family: var(--font-heading);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--border-radius-sm);
  color: var(--color-text);
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition);
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23c8a84e' stroke-width='2' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.highscore-filter__select:focus {
  border-color: var(--color-secondary);
}

.highscore-filter__select option {
  background: #1a1a2e;
  color: var(--color-text);
}

/* Player highlight card at top of modal */
.highscore-player-highlight {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: linear-gradient(135deg, rgba(200, 168, 78, 0.15), rgba(200, 168, 78, 0.05));
  border: 1px solid rgba(200, 168, 78, 0.3);
  border-radius: var(--border-radius);
  margin-bottom: var(--space-lg);
}

.highscore-player-highlight__avatar img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--color-secondary);
  object-fit: cover;
}

.highscore-player-highlight__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.highscore-player-highlight__name {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--color-text);
}

.highscore-player-highlight__stats {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.highscore-player-highlight__rank {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--color-secondary);
  text-shadow: 0 2px 8px rgba(200, 168, 78, 0.3);
}

.highscore-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: var(--space-lg);
  overflow-y: auto;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(200, 168, 78, 0.3) transparent;
}

.highscore-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--border-radius-sm);
  transition: background 0.2s ease;
}

.highscore-row:hover {
  background: rgba(255, 255, 255, 0.08);
}

.highscore-row--self {
  background: rgba(200, 168, 78, 0.12);
  border: 1px solid rgba(200, 168, 78, 0.3);
}

.highscore-row--self:hover {
  background: rgba(200, 168, 78, 0.18);
}

.highscore-row__rank {
  width: 32px;
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-secondary);
  flex-shrink: 0;
}

.highscore-row__name {
  flex: 1;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.highscore-row__stations {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.highscore-row__xp {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-secondary);
  white-space: nowrap;
}

.highscore-divider {
  text-align: center;
  color: var(--color-text-muted);
  padding: var(--space-xs) 0;
  font-size: 0.9rem;
}

.highscore-empty {
  text-align: center;
  color: var(--color-text-muted);
  font-style: italic;
  padding: var(--space-lg) 0;
}

.highscore-card__close {
  display: block;
  width: 100%;
  padding: var(--space-sm) var(--space-lg);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--border-radius-sm);
  color: var(--color-text);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}

.highscore-card__close:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ========================================
   RESET BUTTON
   ======================================== */

.reset-btn {
  display: inline-block;
  margin-top: var(--space-md);
  padding: var(--space-xs) var(--space-md);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  opacity: 0.5;
  transition: opacity var(--transition);
}

.reset-btn:hover {
  opacity: 1;
}

.reset-btn--header {
  margin-top: 0;
  padding: 4px 8px;
  font-size: 1rem;
  line-height: 1;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reset-link {
  display: block;
  margin-top: var(--space-lg);
  padding: var(--space-xs) var(--space-md);
  font-size: 0.75rem;
  color: var(--color-text-muted);
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity var(--transition);
}

.reset-link:hover {
  opacity: 1;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: var(--space-sm) var(--space-lg);
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.site-footer__credit {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  margin-top: var(--space-xs);
}

.site-footer__credit a {
  color: inherit;
  text-decoration: none;
}

.site-footer__credit a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* ========================================
   RESPONSIVE: Desktop shows map, mobile shows cards
   ======================================== */

@media (max-width: 600px) {
  /* === MOBILE MAP: show map-container, hide card layout === */
  .mobile-landscape {
    display: none !important;
  }

  .map-container.is-active {
    display: block;
  }

  /* Mobile panel backgrounds: lightweight WebP instead of heavy PNGs */
  #map-panel-0, #map-panel-1, #map-panel-2, #map-panel-3, #map-panel-4 {
    background-image: none !important;
  }

  #map-panel-0 {
    background: linear-gradient(180deg, rgba(26,46,26,0.35), rgba(10,10,10,0.55)),
                url('../assets/mobile/map-panel-0.webp') center/cover no-repeat !important;
  }
  #map-panel-1 {
    background: linear-gradient(180deg, rgba(10,30,46,0.35), rgba(10,10,10,0.55)),
                url('../assets/mobile/map-panel-1.webp') center/cover no-repeat !important;
  }
  #map-panel-2 {
    background: linear-gradient(180deg, rgba(26,10,46,0.35), rgba(10,10,10,0.55)),
                url('../assets/mobile/map-panel-2.webp') center/cover no-repeat !important;
  }
  #map-panel-3 {
    background: linear-gradient(180deg, rgba(10,26,10,0.35), rgba(10,10,10,0.55)),
                url('../assets/mobile/map-panel-3.webp') center/cover no-repeat !important;
  }
  #map-panel-4 {
    background: linear-gradient(180deg, rgba(10,26,10,0.35), rgba(10,10,10,0.55)),
                url('../assets/mobile/map-panel-4.webp') center/cover no-repeat !important;
  }

  /* Slightly taller panels on mobile for more vertical space */
  .map-panel {
    aspect-ratio: 1 / 1;
  }

  /* Scale down station markers for mobile */
  .map-station {
    gap: 3px;
  }

  .map-station__img {
    width: 72px;
    height: 72px;
    border-width: 2px;
  }

  .map-station__label {
    font-size: 0.6rem;
    max-width: 90px;
    white-space: normal;
    line-height: 1.2;
  }

  .map-minigame__img {
    width: 38px;
    height: 38px;
    padding: 3px;
  }

  .map-minigame__label {
    font-size: 0.5rem;
  }

  .map-station__badge {
    font-size: 0.5rem;
    padding: 1px 5px;
  }

  .map-station__check {
    width: 18px;
    height: 18px;
    font-size: 0.6rem;
    line-height: 18px;
    top: -2px;
    right: -2px;
  }

  /* Smaller finale marker */
  .map-station__finale-icon {
    width: 72px;
    height: 72px;
    font-size: 2rem;
    border-width: 2px;
  }

  /* Smaller map avatar on mobile */
  .map-avatar__img {
    width: 40px;
    height: 40px;
  }

  .map-avatar__name {
    font-size: 0.6rem;
    padding: 1px 6px;
  }

  /* World labels smaller */
  .map-world-label__name {
    font-size: 0.9rem;
  }

  .map-world-label__number {
    font-size: 0.55rem;
    padding: 1px 8px;
  }

  /* Path lines thinner on mobile */
  .map-path {
    stroke-width: 2px;
  }

  .map-path.is-completed {
    stroke-width: 3px;
  }

  /* Avatar selection */
  .avatar-select__fields {
    flex-direction: column;
    max-width: 280px;
  }

  .avatar-select__options {
    gap: var(--space-md);
  }

  .avatar-option {
    min-width: 120px;
    padding: var(--space-md);
  }

  .avatar-option img {
    width: 80px;
    height: 80px;
  }

  /* Start zone */
  .start-zone__sofa {
    width: 200px;
    height: 200px;
  }

  .start-zone__avatar {
    width: 140px;
    height: 140px;
  }

  /* Game header */
  .game-header {
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
  }

  .game-header__avatar {
    width: 32px;
    height: 32px;
  }

  .game-header__stats {
    flex-direction: row;
    gap: var(--space-sm);
  }

  .level-name,
  .header-separator {
    display: none;
  }

  .header-player-name {
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
  }

  .badge-bar {
    display: none;
  }
}

@media (max-width: 400px) {
  .avatar-option {
    min-width: 90px;
    padding: var(--space-sm);
  }

  .avatar-option img {
    width: 64px;
    height: 64px;
  }

  .avatar-option__name {
    font-size: 0.85rem;
  }

  .start-zone__sofa {
    width: 160px;
    height: 160px;
  }

  .start-zone__avatar {
    width: 110px;
    height: 110px;
  }

  /* Even smaller station markers on tiny screens */
  .map-station__img {
    width: 58px;
    height: 58px;
  }

  .map-station__label {
    font-size: 0.5rem;
    max-width: 72px;
  }

  .map-minigame__img {
    width: 30px;
    height: 30px;
    padding: 2px;
  }

  .map-minigame__label {
    font-size: 0.45rem;
  }

  .map-station__finale-icon {
    width: 58px;
    height: 58px;
    font-size: 1.6rem;
  }

  .map-avatar__img {
    width: 34px;
    height: 34px;
  }
}

/* Mobile landscape card layout is replaced by the map on all screen sizes */
.mobile-landscape {
  display: none !important;
}

/* ========================================
   REDUCED MOTION
   ======================================== */

@media (prefers-reduced-motion: reduce) {
  .map-station,
  .map-avatar,
  .particle,
  .start-zone__sofa,
  .start-zone__btn,
  .mobile-station-card.is-completed {
    animation: none !important;
  }

  .map-particles,
  .start-sparkles {
    display: none !important;
  }

  .level-up-flash {
    display: none !important;
  }

  .map-avatar {
    transition: none !important;
  }
}
