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

:root {
 --bottom-nav-height: 82px;
 --bottom-nav-measured: var(--bottom-nav-height);
 --nav-drift-x: 0px;
 --modal-safe-top: max(12px, env(safe-area-inset-top, 0px));
 --modal-safe-bottom: max(12px, env(safe-area-inset-bottom, 0px));
 --scroll-pad-bottom: calc(var(--bottom-nav-measured) + 16px);
}

html, body {
 width: 100%;
 height: 100%;
 height: 100dvh;
 overflow: hidden;
 background: #0a1628;
 font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
 cursor: crosshair;
 user-select: none;
 -webkit-user-select: none;
 touch-action: none;
}

#game-canvas {
 display: block;
 width: 100%;
 height: 100%;
 height: 100dvh;
 touch-action: none;
}

body.mobile-nav-on #game-canvas {
 height: calc(100dvh - var(--bottom-nav-measured, 82px)) !important;
 max-height: calc(100dvh - var(--bottom-nav-measured, 82px));
}

/* Loading screen */
#loading {
 position: fixed;
 inset: 0;
 display: flex;
 align-items: center;
 justify-content: center;
 background: linear-gradient(135deg, #0a1628 0%, #1a3a5c 50%, #0a1628 100%);
 z-index: 100;
 transition: opacity 0.6s ease;
}

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

.loading-content {
 text-align: center;
 color: #d4c4a0;
}

.loading-content h1 {
 font-size: clamp(1.5rem, 7vw, 2.4rem);
 margin-bottom: 0.5rem;
 text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.loading-content p {
 font-size: clamp(0.9rem, 3.5vw, 1.1rem);
 opacity: 0.7;
 margin-bottom: 1.5rem;
 max-width: min(420px, 88vw);
 margin-left: auto;
 margin-right: auto;
 line-height: 1.5;
}

#loading.loading-error .loading-content p {
 opacity: 1;
 color: #f3ead4;
 font-size: clamp(0.95rem, 3.8vw, 1.12rem);
 padding: 14px 16px;
 border-radius: 10px;
 background: rgba(18, 32, 52, 0.92);
 border: 1px solid rgba(212, 175, 90, 0.35);
 box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

#loading.loading-error .loading-content p.loading-error-message {
 color: #fff8e8;
 background: rgba(12, 22, 38, 0.96);
 border-color: rgba(232, 201, 106, 0.55);
}

#loading.loading-error .loading-content p.loading-error-hint {
 color: #d4c4a0;
 font-size: clamp(0.85rem, 3.2vw, 0.98rem);
 padding: 0;
 margin-top: 12px;
 background: none;
 border: none;
 box-shadow: none;
 opacity: 0.9;
}

#loading.loading-error .loading-content h1 {
 color: #e8c96a;
}

@media (max-width: 768px) {
 .loading-bar {
 width: min(200px, 70vw);
 }
}

.loading-bar {
 width: 200px;
 height: 4px;
 background: rgba(255,255,255,0.1);
 border-radius: 2px;
 margin: 0 auto;
 overflow: hidden;
}

.loading-fill {
 width: 40%;
 height: 100%;
 background: #d4c4a0;
 border-radius: 2px;
 animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
 0% { transform: translateX(-100%); }
 100% { transform: translateX(350%); }
}

/* Help panel */
.help-panel {
 position: fixed;
 top: 50%;
 left: 50%;
 transform: translate(-50%, -50%) scale(0.9);
 background: rgba(30, 20, 10, 0.95);
 border: 2px solid rgba(180, 150, 100, 0.4);
 border-radius: 12px;
 padding: 24px 32px;
 color: #d4c4a0;
 z-index: 50;
 opacity: 0;
 pointer-events: none;
 transition: opacity 0.3s, transform 0.3s;
 min-width: 280px;
}

.help-panel.visible {
 opacity: 1;
 pointer-events: auto;
 transform: translate(-50%, -50%) scale(1);
}

.help-panel h3 {
 margin-bottom: 12px;
 font-size: 1.3rem;
 color: #f1c40f;
}

.help-panel ul {
 list-style: none;
 margin-bottom: 16px;
}

.help-panel li {
 padding: 4px 0;
 font-size: 0.95rem;
 opacity: 0.85;
}

.help-panel button {
 background: rgba(60, 40, 20, 0.8);
 border: 1px solid rgba(180, 150, 100, 0.4);
 color: #d4c4a0;
 padding: 8px 16px;
 border-radius: 6px;
 cursor: pointer;
 font-family: inherit;
 font-size: 0.9rem;
 margin-right: 8px;
 transition: background 0.2s;
}

.help-panel button:hover {
 background: rgba(80, 55, 30, 0.9);
}

#btn-help {
 position: fixed;
 bottom: 16px;
 right: 16px;
 width: 36px;
 height: 36px;
 border-radius: 50%;
 background: rgba(30, 20, 10, 0.8);
 border: 2px solid rgba(180, 150, 100, 0.4);
 color: #d4c4a0;
 font-size: 1.1rem;
 font-weight: bold;
 cursor: pointer;
 z-index: 20;
 transition: background 0.2s;
}

#btn-help:hover {
 background: rgba(60, 40, 20, 0.9);
}

.bug-report-btn {
 position: fixed;
 top: max(8px, env(safe-area-inset-top, 0px));
 left: max(8px, env(safe-area-inset-left, 0px));
 z-index: 9999;
 width: 36px;
 height: 36px;
 border-radius: 10px;
 border: 1px solid rgba(180, 140, 60, 0.45);
 background: rgba(8, 16, 32, 0.92);
 color: #e8d4a8;
 font-size: 1rem;
 line-height: 1;
 cursor: pointer;
 pointer-events: auto !important;
 -webkit-tap-highlight-color: transparent;
 box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
 touch-action: manipulation;
}

.bug-report-btn:active {
 transform: scale(0.94);
}

body.mobile-nav-on #btn-help {
 bottom: calc(var(--bottom-nav-measured) - 6px);
 right: 12px;
}

body.mobile-nav-on #mobile-bottom-nav,
body.mobile-nav-on .mobile-nav-track,
body.mobile-nav-on .mobile-nav-scroll {
 touch-action: manipulation !important;
}

 .mobile-bottom-nav {
 display: none;
 position: fixed;
 bottom: 0;
 left: env(safe-area-inset-left, 0px);
 right: env(safe-area-inset-right, 0px);
 width: auto;
 z-index: 45;
 max-width: none;
 transform: translateX(var(--nav-drift-x, 0px));
 height: auto;
 min-height: var(--bottom-nav-height);
 padding-top: 5px;
 padding-bottom: max(6px, env(safe-area-inset-bottom, 0px));
 padding-left: 0;
 padding-right: 0;
 overflow: visible;
 box-sizing: border-box;
 background: linear-gradient(180deg, rgba(12, 18, 32, 0.94) 0%, rgba(6, 10, 18, 0.98) 100%);
 border-top: 2px solid rgba(180, 140, 60, 0.45);
 border-radius: 20px 20px 0 0;
 box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.6);
 backdrop-filter: blur(10px);
 -webkit-backdrop-filter: blur(10px);
 touch-action: manipulation;
}

.mobile-bottom-nav .nav-tab-hidden {
 display: none !important;
}

.mobile-bottom-nav.visible {
 display: block;
}

.mobile-bottom-nav.nav-hidden {
 display: none !important;
}

@media (min-width: 769px) and (pointer: fine) {
 .mobile-bottom-nav {
 display: none !important;
 }
}

.mobile-bottom-nav.expedition-nav .mobile-nav-track,
.mobile-bottom-nav.expedition-nav .mobile-nav-scroll {
  overflow: visible;
}

.mobile-nav-items {
 display: none;
}

.mobile-nav-track,
.mobile-nav-scroll {
 display: grid;
 grid-template-columns: repeat(var(--nav-tab-count, 4), minmax(0, 1fr));
 width: 100%;
 max-width: 100%;
 overflow: visible;
 align-items: center;
 justify-items: center;
 gap: 0;
 padding: 0 10px;
 margin: 0;
 touch-action: manipulation !important;
 box-sizing: border-box;
 min-height: calc(var(--bottom-nav-height) - 10px);
}

.mobile-nav-item {
 width: 100%;
 max-width: 100%;
 min-width: 0;
 height: auto;
 min-height: 64px;
 max-height: calc(var(--bottom-nav-height) - 8px);
 display: flex;
 flex-direction: column;
 align-items: center;
 justify-content: center;
 gap: 1px;
 padding: 2px 6px 4px;
 background: none;
 border: none;
 cursor: pointer;
 opacity: 1;
 transition: transform 0.2s;
 font-family: inherit;
 -webkit-tap-highlight-color: transparent;
 position: relative;
 overflow: visible;
 box-sizing: border-box;
}

.mobile-nav-item:active {
 transform: scale(0.94);
}

.mobile-nav-item.active {
 opacity: 1;
}

.mobile-nav-item.active .mobile-nav-icon {
 transform: scale(1.04);
}

.mobile-nav-item.active::after {
 content: '';
 position: absolute;
 top: 2px;
 left: 50%;
 transform: translateX(-50%);
 width: min(46px, 82%);
 height: min(46px, 82%);
 border-radius: 14px 14px 0 0;
 border: 2px solid rgba(241, 196, 15, 0.9);
 border-bottom: none;
 box-shadow: 0 0 10px rgba(241, 196, 15, 0.4);
 animation: nav-ring-pulse 1.7s ease-in-out infinite;
 pointer-events: none;
}

@keyframes nav-ring-pulse {
 0%, 100% {
 border-color: rgba(241, 196, 15, 0.65);
 box-shadow: 0 0 8px rgba(241, 196, 15, 0.3);
 transform: translateX(-50%) scale(1);
 }
 50% {
 border-color: rgba(255, 220, 80, 1);
 box-shadow: 0 0 22px rgba(241, 196, 15, 0.7);
 transform: translateX(-50%) scale(1.04);
 }
}

.mobile-nav-icon {
 width: 48px;
 height: 48px;
 flex: 0 0 auto;
 border-radius: 14px;
 object-fit: contain;
 box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
 border: 2px solid rgba(120, 90, 40, 0.3);
 background: rgba(20, 15, 10, 0.65);
 position: relative;
 z-index: 1;
 transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s, filter 0.2s;
}

.mobile-nav-item:not(.active):not(.nav-locked) .mobile-nav-icon {
 filter: brightness(0.78);
 border-color: rgba(180, 140, 60, 0.55);
 box-shadow: 0 0 10px rgba(241, 196, 15, 0.1), 0 4px 14px rgba(0, 0, 0, 0.45);
}

.mobile-nav-item.nav-locked {
 opacity: 0.42;
}

.mobile-nav-item.nav-locked .mobile-nav-icon {
 filter: grayscale(0.35) brightness(0.55);
 box-shadow: none;
 border-color: rgba(90, 70, 40, 0.25);
}

.mobile-nav-item.nav-locked .mobile-nav-label {
 color: #8a7760;
}

.mobile-nav-item.active .mobile-nav-icon {
 box-shadow: 0 4px 16px rgba(0, 0, 0, 0.55);
 border-color: rgba(241, 196, 15, 0.25);
}

.mobile-nav-item[data-tab="compass"].active .mobile-nav-icon {
 box-shadow: 0 0 16px rgba(241, 196, 15, 0.35), 0 4px 14px rgba(0, 0, 0, 0.5);
}

.mobile-nav-label {
 display: block;
 min-height: 12px;
 line-height: 11px;
 font-size: 10px;
 color: #e8d4a8;
 letter-spacing: 0.02em;
 white-space: nowrap;
 max-width: 100%;
 overflow: hidden;
 text-overflow: ellipsis;
 padding: 0 2px;
 text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
 position: relative;
 z-index: 1;
}

.mobile-nav-item.active .mobile-nav-label {
 color: #f1c40f;
}

.mobile-nav-item[data-tab="expedition"].active .mobile-nav-icon {
 animation: expedition-icon-pulse 1.4s ease-in-out infinite;
}

@keyframes expedition-icon-pulse {
 0%, 100% {
 box-shadow: 0 0 10px rgba(241, 196, 15, 0.35), 0 4px 14px rgba(0, 0, 0, 0.5);
 border-color: rgba(241, 196, 15, 0.35);
 }
 50% {
 box-shadow: 0 0 26px rgba(255, 220, 80, 0.85), 0 4px 14px rgba(0, 0, 0, 0.5);
 border-color: rgba(255, 220, 80, 0.95);
 }
}

/* Inventory panel (mobile nav) */
.inventory-panel {
 position: fixed;
 inset: 0;
 z-index: 30;
 background: rgba(5, 8, 15, 0.88);
 display: flex;
 align-items: center;
 justify-content: center;
 padding-bottom: var(--scroll-pad-bottom);
}

.inventory-panel.hidden {
 display: none;
}

.inventory-inner {
 width: min(420px, 94vw);
 max-height: min(520px, 70vh);
 background: linear-gradient(160deg, #2a2218 0%, #1a1510 100%);
 border: 2px solid rgba(180, 150, 100, 0.4);
 border-radius: 12px;
 display: flex;
 flex-direction: column;
 overflow: hidden;
}

.inventory-header {
 padding: 18px 20px 12px;
 position: relative;
 border-bottom: 1px solid rgba(180, 150, 100, 0.2);
}

.inventory-header h1 {
 color: #d4c4a0;
 font-family: 'Palatino Linotype', serif;
 font-size: 1.4rem;
 margin: 0;
}

.inventory-subtitle {
 color: rgba(210, 180, 140, 0.5);
 font-size: 0.82rem;
 margin: 4px 0 0;
}

.inventory-header .inventory-close {
 position: absolute;
 top: 14px;
 right: 14px;
}

.inventory-content {
 flex: 1;
 overflow-y: auto;
 padding: 20px;
}

.inventory-empty {
 color: rgba(210, 180, 140, 0.65);
 font-style: italic;
 text-align: center;
 line-height: 1.5;
 margin: 0;
}

.inventory-footer {
 padding: 10px 20px;
 border-top: 1px solid rgba(180, 150, 100, 0.15);
 color: rgba(210, 180, 140, 0.45);
 font-size: 0.75rem;
 text-align: center;
}

body.mobile-nav-on .harbor-panel,
body.mobile-nav-on .map-viewer {
 padding:
 var(--modal-safe-top)
 12px
 calc(var(--bottom-nav-measured) + 8px)
 12px;
 box-sizing: border-box;
 height: 100dvh;
 align-items: stretch;
 justify-content: center;
}

body.mobile-nav-on .harbor-inner,
body.mobile-nav-on .map-viewer-inner {
 max-height: 100%;
 width: min(92vw, 480px);
 margin: 0 auto;
 flex: 1 1 auto;
 min-height: 0;
}

body.map-study-mode #mobile-bottom-nav {
 opacity: 0.12;
 pointer-events: none;
}

body.map-study-mode .map-viewer {
 padding-bottom: var(--modal-safe-bottom);
}

@media (max-width: 768px), (pointer: coarse) {
 #btn-help {
 display: none !important;
 }
}

.mobile-side-panel {
 position: fixed;
 inset: 0;
 z-index: 30;
 background: rgba(5, 8, 15, 0.88);
 display: flex;
 align-items: center;
 justify-content: center;
 padding-bottom: var(--scroll-pad-bottom);
}

.mobile-side-panel.hidden {
 display: none;
}

.mobile-side-inner {
 width: min(420px, 94vw);
 max-height: min(520px, 70vh);
 background: linear-gradient(160deg, #2a2218 0%, #1a1510 100%);
 border: 2px solid rgba(180, 150, 100, 0.4);
 border-radius: 12px;
 display: flex;
 flex-direction: column;
 overflow: hidden;
}

.mobile-side-header {
 padding: 18px 20px 12px;
 position: relative;
 border-bottom: 1px solid rgba(180, 150, 100, 0.2);
}

.mobile-side-header h1 {
 color: #d4c4a0;
 font-family: 'Palatino Linotype', serif;
 font-size: 1.4rem;
 margin: 0;
}

.mobile-side-subtitle {
 color: rgba(210, 180, 140, 0.5);
 font-size: 0.82rem;
 margin: 4px 0 0;
}

.mobile-side-header .mobile-side-close {
 position: absolute;
 top: 14px;
 right: 14px;
}

.mobile-side-content {
 flex: 1;
 overflow-y: auto;
 padding: 20px;
 color: rgba(210, 180, 140, 0.75);
 line-height: 1.5;
}

.harbor-market-title {
 color: #d4c4a0;
 font-family: 'Palatino Linotype', serif;
 margin: 0 0 8px;
}

.harbor-market-lead {
 color: rgba(210, 180, 140, 0.65);
 margin: 0 0 16px;
 line-height: 1.45;
}

#btn-reset-fog {
 color: #e74c3c !important;
 border-color: rgba(231, 76, 60, 0.4) !important;
}

/* Mobil joystick */
.joystick-base {
 display: none;
 position: fixed;
 width: 120px;
 height: 120px;
 border-radius: 50%;
 background: rgba(30, 20, 10, 0.5);
 border: 2px solid rgba(180, 150, 100, 0.4);
 z-index: 20;
 touch-action: none;
}

.joystick-stick {
 position: absolute;
 top: 50%;
 left: 50%;
 width: 48px;
 height: 48px;
 margin: -24px 0 0 -24px;
 border-radius: 50%;
 background: rgba(212, 196, 160, 0.7);
 border: 2px solid rgba(180, 150, 100, 0.6);
 pointer-events: none;
}

#explore-canvas {
 touch-action: none;
 z-index: 35;
 background: #0a1628;
}

#landfall-overlay {
 position: fixed;
 inset: 0;
 z-index: 50;
 display: none;
 align-items: center;
 justify-content: center;
 flex-direction: column;
 background: #0a1628;
 color: #d4c4a0;
 font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
 pointer-events: all;
}

#landfall-overlay.visible {
 display: flex;
}

#landfall-overlay .landfall-title {
 font-size: clamp(16px, 4.5vw, 20px);
 margin-bottom: 8px;
}

#landfall-overlay .landfall-island {
 font-size: clamp(14px, 4vw, 17px);
 color: #f1c40f;
 text-align: center;
 padding: 0 24px;
 max-width: 90vw;
}

.explore-return-btn {
 position: fixed;
 top: calc(12px + env(safe-area-inset-top, 0px));
 left: 12px;
 z-index: 48;
 display: none;
 padding: 10px 14px;
 border-radius: 8px;
 border: 2px solid rgba(241, 196, 15, 0.55);
 background: rgba(30, 20, 10, 0.92);
 color: #f1c40f;
 font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
 font-size: 14px;
 cursor: pointer;
 touch-action: manipulation;
}

body.exploring-mode .explore-return-btn {
 display: block;
}

body.exploring-mode #mobile-bottom-nav.visible {
 z-index: 46;
}

body.approaching-mode #explore-canvas,
body.approaching-mode #landfall-overlay {
 display: none !important;
}

#approach-canvas {
 touch-action: none;
}

body.approaching-mode #approach-title-overlay {
 display: flex;
}

#approach-title-overlay {
 position: fixed;
 top: var(--vv-top, 0);
 left: var(--vv-left, 0);
 width: var(--vv-width, 100vw);
 height: var(--vv-height, 100vh);
 right: auto;
 bottom: auto;
 z-index: 61;
 pointer-events: none;
 display: none;
 flex-direction: column;
 align-items: center;
 box-sizing: border-box;
 padding: max(48px, calc(env(safe-area-inset-top, 0px) + 36px)) max(16px, env(safe-area-inset-right, 16px)) 0 max(16px, env(safe-area-inset-left, 16px));
 opacity: 0;
 transition: opacity 0.2s ease;
}

#approach-title-overlay.visible {
 opacity: 1;
}

#approach-title-overlay.mobile {
 padding-top: max(52px, calc(env(safe-area-inset-top, 0px) + 40px));
}

.approach-title-discovered,
.approach-title-name {
 max-width: min(420px, 100%);
 width: fit-content;
 text-align: center;
 border-radius: 8px;
 transition: opacity 0.35s ease;
}

.approach-title-discovered {
 margin-top: 18vh;
 padding: 10px 18px;
 background: rgba(20, 14, 8, 0.82);
 border: 2px solid rgba(241, 196, 15, 0.55);
 color: #f1c40f;
 font: bold 14px "Palatino Linotype", Georgia, serif;
 letter-spacing: 0.04em;
}

#approach-title-overlay.mobile .approach-title-discovered {
 margin-top: 12vh;
 padding: 10px 16px;
 font-size: 13px;
}

.approach-title-name {
 margin-top: 10px;
 padding: 12px 20px;
 background: rgba(20, 14, 8, 0.88);
 border: 2px solid rgba(212, 168, 75, 0.5);
 color: #f5ecd7;
 font: bold clamp(15px, 4.2vw, 18px) "Palatino Linotype", Georgia, serif;
 line-height: 1.25;
}

#approach-title-overlay.mobile .approach-title-name {
 margin-top: 8px;
}

/* Intro felsökningsrapport (mobil) */
#intro-debug-report {
 position: fixed;
 inset: 0;
 z-index: 100;
 background: rgba(0, 0, 0, 0.82);
 display: flex;
 align-items: center;
 justify-content: center;
 padding: 16px;
 padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}

.intro-debug-card {
 width: min(100%, 420px);
 max-height: min(85vh, 640px);
 display: flex;
 flex-direction: column;
 background: #121a28;
 border: 2px solid rgba(241, 196, 15, 0.5);
 border-radius: 12px;
 padding: 16px;
 box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

.intro-debug-card h3 {
 margin: 0 0 4px;
 color: #f1c40f;
 font-size: 1.1rem;
}

.intro-debug-hint {
 margin: 0 0 10px;
 color: #9ab;
 font-size: 0.82rem;
}

.intro-debug-pre {
 flex: 1;
 overflow: auto;
 margin: 0 0 12px;
 padding: 10px;
 background: rgba(0, 0, 0, 0.45);
 border-radius: 8px;
 color: #d4e4f4;
 font-size: 10px;
 line-height: 1.45;
 white-space: pre-wrap;
 word-break: break-all;
 -webkit-overflow-scrolling: touch;
}

.intro-debug-actions {
 display: flex;
 gap: 10px;
}

.intro-debug-actions button {
 flex: 1;
 padding: 12px;
 border-radius: 8px;
 border: 1px solid rgba(241, 196, 15, 0.45);
 background: rgba(30, 20, 10, 0.9);
 color: #f1c40f;
 font-size: 0.95rem;
 cursor: pointer;
 touch-action: manipulation;
}

.intro-debug-continue {
 flex: 1.4 !important;
 background: rgba(46, 125, 50, 0.35) !important;
 border-color: rgba(129, 199, 132, 0.65) !important;
 color: #c8e6c9 !important;
}

.intro-debug-copy {
 background: rgba(241, 196, 15, 0.15) !important;
}

/* Nodbaserad expedition */
.view-hidden {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

body.expedition-mode #game-canvas {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

body.expedition-mode #sailing-cta,
body.expedition-mode #sailing-cta.hidden {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

body.expedition-mode #mobile-bottom-nav.visible {
 z-index: 70;
}

@media (max-width: 768px), (pointer: coarse) {
 body.expedition-mode #expedition-panel.mobile-collapsed {
  display: none !important;
 }

 body.expedition-mode #expedition-panel.minimized:not(.mobile-collapsed) {
  top: max(8px, env(safe-area-inset-top, 0px));
  bottom: auto;
  left: 8px;
  right: 8px;
  transform: none;
  padding: 0;
  z-index: 55;
 }

 body.expedition-mode #expedition-panel.minimized .expedition-panel-inner {
  padding: 6px 10px;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
 }

 body.expedition-mode #expedition-panel.minimized .expedition-map-btn {
  display: none;
 }

 body.expedition-mode #expedition-panel.minimized .expedition-loc {
  font-size: 0.88rem;
 }

 body.expedition-mode #expedition-panel:not(.minimized) {
  bottom: calc(var(--bottom-nav-measured) + 8px);
  z-index: 44;
 }
}

.expedition-back-float {
 position: fixed;
 top: calc(var(--vv-top, 0px) + max(8px, env(safe-area-inset-top, 0px)));
 left: calc(var(--vv-left, 0px) + max(8px, env(safe-area-inset-left, 0px)));
 z-index: 12050;
 width: 48px;
 height: 48px;
 border-radius: 12px;
 border: 2px solid rgba(241, 196, 15, 0.75);
 background: rgba(8, 16, 32, 0.94);
 color: #f1c40f;
 font-size: 1.5rem;
 font-weight: 700;
 line-height: 1;
 cursor: pointer;
 display: none;
 -webkit-tap-highlight-color: transparent;
 box-shadow: 0 3px 16px rgba(0, 0, 0, 0.5);
 pointer-events: auto;
 touch-action: manipulation;
}

.expedition-bug-btn {
 position: fixed;
 top: calc(var(--vv-top, 0px) + max(8px, env(safe-area-inset-top, 0px)));
 right: auto;
 left: calc(var(--vv-left, 0px) + var(--vv-width, 100vw) - max(8px, env(safe-area-inset-right, 0px)));
 transform: translateX(-100%);
 z-index: 12060;
 padding: 8px 12px;
 border-radius: 10px;
 border: 1px solid rgba(212, 168, 75, 0.55);
 background: rgba(8, 16, 32, 0.94);
 color: #ffe082;
 font-size: 0.82rem;
 font-weight: 600;
 cursor: pointer;
 pointer-events: auto;
 box-shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
 touch-action: manipulation;
 white-space: nowrap;
}

body.expedition-mode #btn-bug-report {
 display: none !important;
}

body.expedition-overlay-open #expedition-bug-btn,
body.expedition-overlay-open .expedition-back-float,
body.journal-open #expedition-bug-btn,
body.journal-open .expedition-back-float,
body.camp-activity-open #expedition-bug-btn,
body.camp-activity-open .expedition-back-float {
  display: none !important;
  pointer-events: none !important;
}

.tent-scene-bug-btn {
 position: fixed;
 top: max(8px, calc(env(safe-area-inset-top, 0px) + 4px));
 right: max(8px, env(safe-area-inset-right, 0px));
 z-index: 12060;
 padding: 8px 12px;
 border-radius: 10px;
 border: 1px solid rgba(212, 168, 75, 0.55);
 background: rgba(8, 16, 32, 0.92);
 color: #ffe082;
 font-size: 0.82rem;
 font-weight: 600;
 cursor: pointer;
 pointer-events: auto;
 box-shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
 touch-action: manipulation;
}

.expedition-back-float.visible {
 display: inline-flex;
 align-items: center;
 justify-content: center;
}

#expedition-canvas {
 touch-action: none;
 top: var(--vv-top, 0px);
 left: var(--vv-left, 0px);
 right: auto;
 bottom: auto;
 width: var(--vv-width, 100%);
}

#expedition-panel {
 display: none;
 position: fixed;
 left: 0;
 right: 0;
 bottom: calc(var(--bottom-nav-measured) + 8px);
 z-index: 44;
 padding: 0 12px 0;
 pointer-events: none;
 transform: translateY(110%);
 transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

#expedition-panel.visible {
 display: block;
 transform: translateY(0);
}

#expedition-panel.slide-up {
 transform: translateY(0);
}

.expedition-panel-inner {
 pointer-events: auto;
 max-width: 440px;
 margin: 0 auto;
 padding: 8px 12px 10px;
 border-radius: 10px;
 background: linear-gradient(180deg, rgba(12, 22, 38, 0.92), rgba(8, 14, 26, 0.96));
 border: 1px solid rgba(212, 168, 75, 0.32);
 box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}

.expedition-panel-bar {
 display: flex;
 align-items: center;
 gap: 8px;
}

.expedition-back-btn {
 display: none;
 flex-shrink: 0;
 width: 40px;
 height: 40px;
 border: 1px solid rgba(212, 168, 75, 0.35);
 border-radius: 10px;
 background: rgba(8, 14, 26, 0.85);
 color: #f1c40f;
 font-size: 1.25rem;
 line-height: 1;
 cursor: pointer;
 touch-action: manipulation;
}

.expedition-back-btn.visible {
 display: inline-flex;
 align-items: center;
 justify-content: center;
}

.expedition-back-btn:disabled {
 opacity: 0.35;
 cursor: default;
}

.expedition-panel-body {
 flex: 1;
 min-width: 0;
 background: none;
 border: none;
 padding: 2px 0;
 text-align: left;
 cursor: pointer;
 touch-action: manipulation;
}

.expedition-loc {
 display: block;
 font-family: 'Palatino Linotype', Georgia, serif;
 font-size: 0.95rem;
 color: #f1c40f;
 line-height: 1.25;
}

.expedition-sub {
 display: block;
 margin-top: 2px;
 font-size: 0.78rem;
 color: rgba(200, 214, 229, 0.82);
 line-height: 1.3;
 white-space: pre-line;
 transition: opacity 0.3s ease, max-height 0.3s ease;
}

#expedition-panel.minimized .expedition-sub,
#expedition-panel.minimized .expedition-expanded-detail,
#expedition-panel.minimized .expedition-message {
 display: none;
}

#expedition-panel.detail-open .expedition-expanded-detail {
 display: block;
}

.expedition-expanded-detail {
 display: none;
 margin-top: 8px;
 padding-top: 8px;
 border-top: 1px solid rgba(212, 168, 75, 0.18);
}

.expedition-desc {
 margin: 0;
 color: #b8c8d8;
 font-size: 0.82rem;
 line-height: 1.4;
}

.expedition-message {
 margin: 6px 0 0;
 padding: 6px 8px;
 border-radius: 6px;
 background: rgba(0, 0, 0, 0.25);
 color: #d4e4f4;
 font-size: 0.8rem;
 line-height: 1.35;
}

.expedition-map-btn {
 border: 1px solid rgba(212, 168, 75, 0.35);
 background: rgba(30, 20, 10, 0.75);
 color: #d4c4a0;
 border-radius: 8px;
 width: 36px;
 height: 34px;
 cursor: pointer;
 font-size: 0.95rem;
 flex-shrink: 0;
}

#expedition-panel.transition-mode {
 opacity: 0.4;
 pointer-events: none;
}

.expedition-panel-inner.compact {
 pointer-events: auto;
 max-width: 480px;
 margin: 0 auto;
 padding: 10px 14px 12px;
 border-radius: 12px 12px 0 0;
 background: linear-gradient(180deg, rgba(12, 22, 38, 0.88), rgba(8, 14, 26, 0.94));
 border: 1px solid rgba(212, 168, 75, 0.3);
 border-bottom: none;
 box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.35);
 max-height: 22vh;
 overflow: hidden;
 transition: max-height 0.25s ease;
}

#expedition-panel.expanded .expedition-panel-inner.compact {
 max-height: 42vh;
}

.expedition-compact-row {
 display: flex;
 align-items: center;
 gap: 8px;
}

.expedition-compact-main {
 flex: 1;
 min-width: 0;
}

.expedition-hint {
 margin: 2px 0 0;
 color: rgba(200, 214, 229, 0.75);
 font-size: 0.78rem;
 line-height: 1.3;
}

.expedition-expand-btn {
 border: 1px solid rgba(212, 168, 75, 0.35);
 background: rgba(30, 20, 10, 0.75);
 color: #d4c4a0;
 border-radius: 8px;
 width: 34px;
 height: 34px;
 cursor: pointer;
 font-size: 0.85rem;
 flex-shrink: 0;
}

.expedition-expanded {
 display: none;
 margin-top: 8px;
 padding-top: 8px;
 border-top: 1px solid rgba(212, 168, 75, 0.2);
}

#expedition-panel.expanded .expedition-expanded {
 display: block;
}

.expedition-hotspot-list {
 margin: 8px 0 0;
 padding-left: 18px;
 color: #9ab;
 font-size: 0.8rem;
}

#expedition-confirm-overlay {
 display: none;
 position: fixed;
 inset: 0;
 z-index: 85;
 background: rgba(0, 0, 0, 0.55);
 align-items: center;
 justify-content: center;
 padding: 16px;
}

#expedition-confirm-overlay.visible {
 display: flex;
}

.expedition-confirm-card {
 width: min(100%, 360px);
 padding: 20px 18px 16px;
 border-radius: 14px;
 background: linear-gradient(180deg, rgba(14, 24, 40, 0.98), rgba(8, 14, 26, 0.99));
 border: 1px solid rgba(212, 168, 75, 0.4);
 box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

.exp-confirm-title {
 margin: 0 0 10px;
 color: #f1c40f;
 font-family: 'Palatino Linotype', Georgia, serif;
 font-size: 1.15rem;
 letter-spacing: 0.04em;
 text-align: center;
}

.exp-confirm-body {
 margin: 0 0 18px;
 color: rgba(245, 236, 215, 0.85);
 font-size: 0.9rem;
 line-height: 1.45;
 text-align: center;
}

.exp-symbol-status {
 display: flex;
 flex-direction: column;
 gap: 8px;
 margin-bottom: 12px;
 text-align: left;
}

.exp-symbol-row {
 display: flex;
 justify-content: space-between;
 align-items: center;
 padding: 8px 10px;
 border-radius: 8px;
 background: rgba(0, 0, 0, 0.28);
 font-size: 0.92rem;
}

.exp-symbol-mark {
 color: #f1c40f;
 font-weight: 700;
}

.exp-symbol-hint {
 margin: 0;
 text-align: center;
}

#expedition-location-title {
 position: fixed;
 top: calc(var(--vv-top, 0px) + max(12px, env(safe-area-inset-top, 12px)));
 left: var(--vv-left, 0px);
 width: var(--vv-width, 100vw);
 right: auto;
 bottom: auto;
 z-index: 72;
 pointer-events: none;
 opacity: 0;
 display: flex;
 justify-content: center;
 align-items: flex-start;
 box-sizing: border-box;
 transform: translateY(-8px);
 transition: opacity 0.45s ease, transform 0.45s ease;
 padding: 0 max(16px, env(safe-area-inset-right, 16px)) 0 max(16px, env(safe-area-inset-left, 16px));
 text-align: center;
}

#expedition-location-title.visible {
 opacity: 1;
 transform: translateY(0);
}

#expedition-location-title.fading {
 opacity: 0;
 transform: translateY(-6px);
 transition: opacity 0.65s ease, transform 0.65s ease;
}

#expedition-location-title.extended.visible {
 transition: opacity 0.45s ease, transform 0.45s ease;
}

.exp-location-title-text {
 position: relative;
 display: inline-block;
 overflow: hidden;
 max-width: min(420px, 100%);
 padding: 8px 18px;
 border-radius: 999px;
 font-family: 'Palatino Linotype', Georgia, serif;
 font-size: clamp(1rem, 4.2vw, 1.25rem);
 letter-spacing: 0.06em;
 text-transform: uppercase;
 color: #fff8dc;
 background: rgba(8, 14, 26, 0.62);
 border: 1px solid rgba(212, 168, 75, 0.45);
 box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

#expedition-location-title.warm .exp-location-title-text {
 color: #fff3c4;
 border-color: rgba(241, 196, 15, 0.5);
}

#expedition-location-title.cave .exp-location-title-text {
 color: #dceeff;
 border-color: rgba(120, 180, 220, 0.45);
}

.exp-location-title-text::after {
 content: "";
 position: absolute;
 top: -20%;
 bottom: -20%;
 width: 24%;
 left: -35%;
 background: linear-gradient(90deg, transparent, rgba(255, 255, 220, 0.9), transparent);
 transform: skewX(-18deg);
 opacity: 0;
}

#expedition-location-title.visible .exp-location-title-text::after {
 animation: expTitleShimmer 1.1s ease-out 0.6s forwards;
}

#expedition-location-title.cave.visible .exp-location-title-text::after {
 background: linear-gradient(90deg, transparent, rgba(180, 220, 255, 0.85), transparent);
}

@keyframes expTitleShimmer {
 from { left: -35%; opacity: 0; }
 20% { opacity: 1; }
 to { left: 120%; opacity: 0; }
}

.exp-confirm-actions {
 display: flex;
 flex-direction: column;
 gap: 10px;
}

.exp-confirm-primary,
.exp-confirm-secondary {
 min-height: 44px;
 border-radius: 10px;
 font-family: 'Palatino Linotype', Georgia, serif;
 font-size: 0.95rem;
 cursor: pointer;
}

.exp-confirm-primary {
 border: 1px solid rgba(241, 196, 15, 0.65);
 background: linear-gradient(180deg, #c9a227, #8b6914);
 color: #1a1206;
 font-weight: bold;
}

.exp-confirm-secondary {
 border: 1px solid rgba(120, 140, 160, 0.45);
 background: rgba(12, 20, 32, 0.92);
 color: rgba(245, 236, 215, 0.9);
}

#expedition-context-menu {
 display: none;
 position: fixed;
 top: var(--vv-top, 0px);
 left: var(--vv-left, 0px);
 width: var(--vv-width, 100vw);
 height: var(--vv-height, 100vh);
 right: auto;
 bottom: auto;
 z-index: 76;
 background: rgba(0, 0, 0, 0.28);
 align-items: flex-end;
 justify-content: center;
 box-sizing: border-box;
 overflow-x: hidden;
 padding:
  0
  max(10px, env(safe-area-inset-right, 0px))
  calc(var(--bottom-nav-measured) + 8px)
  max(10px, env(safe-area-inset-left, 0px));
}

#expedition-context-menu.visible {
 display: flex;
}

.exp-context-sheet {
 box-sizing: border-box;
 width: 100%;
 max-width: min(100%, 360px);
 max-height: min(34vh, 280px);
 overflow-x: hidden;
 overflow-y: auto;
 padding: 12px 14px 14px;
 margin: 0 auto;
 border-radius: 14px 14px 10px 10px;
 background: linear-gradient(180deg, rgba(14, 24, 40, 0.97), rgba(8, 14, 26, 0.98));
 border: 1px solid rgba(212, 168, 75, 0.35);
 box-shadow: 0 -6px 28px rgba(0, 0, 0, 0.45);
}

.exp-context-header {
 display: flex;
 align-items: flex-start;
 justify-content: space-between;
 gap: 10px;
 margin-bottom: 4px;
 min-width: 0;
}

.exp-context-title {
 margin: 0;
 flex: 1;
 min-width: 0;
 overflow-wrap: anywhere;
 color: #f1c40f;
 font-family: 'Palatino Linotype', Georgia, serif;
 font-size: 1.05rem;
}

.exp-context-desc {
 margin: 0 0 14px;
 color: rgba(245, 236, 215, 0.82);
 font-size: 0.86rem;
 line-height: 1.4;
}

.exp-context-dismiss {
 border: none;
 background: transparent;
 color: rgba(245, 236, 215, 0.85);
 font-size: 1.65rem;
 line-height: 1;
 min-width: 40px;
 min-height: 40px;
 padding: 0;
 cursor: pointer;
 flex-shrink: 0;
}

#expedition-tutorial-band {
 display: none;
 position: fixed;
 top: calc(72px + env(safe-area-inset-top, 0px));
 left: 50%;
 transform: translateX(-50%);
 z-index: 72;
 padding: 8px 16px;
 border-radius: 20px;
 background: rgba(8, 14, 26, 0.78);
 border: 1px solid rgba(241, 196, 15, 0.35);
 color: #ffe082;
 font-family: 'Palatino Linotype', Georgia, serif;
 font-size: 0.88rem;
 letter-spacing: 0.02em;
 box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
 pointer-events: none;
 transition: opacity 0.4s ease;
}

#expedition-tutorial-band.visible {
 display: block;
}

#expedition-landmark-banner {
 position: fixed;
 top: calc(88px + env(safe-area-inset-top, 0px));
 left: 50%;
 transform: translateX(-50%) translateY(-12px);
 z-index: 78;
 padding: 12px 20px;
 border-radius: 10px;
 text-align: center;
 background: rgba(8, 14, 26, 0.88);
 border: 1px solid rgba(241, 196, 15, 0.5);
 box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
 opacity: 0;
 pointer-events: none;
 transition: opacity 0.5s ease, transform 0.5s ease;
}

#expedition-landmark-banner.visible {
 opacity: 1;
 transform: translateX(-50%) translateY(0);
}

#expedition-landmark-banner .exp-landmark-kicker {
 display: block;
 font-size: 0.68rem;
 letter-spacing: 0.12em;
 color: rgba(241, 196, 15, 0.85);
 margin-bottom: 4px;
}

#expedition-landmark-banner strong {
 display: block;
 font-family: 'Palatino Linotype', Georgia, serif;
 font-size: 1.05rem;
 color: #f5ecd7;
 font-weight: 600;
}

.mobile-nav-item.nav-pulse {
 animation: nav-journal-pulse 1.1s ease-out 1;
}

@keyframes nav-journal-pulse {
 0%, 100% { filter: none; transform: scale(1); }
 35% { filter: drop-shadow(0 0 8px rgba(241, 196, 15, 0.85)); transform: scale(1.06); }
}

.exp-j-item-desc {
 display: block;
 margin-top: 2px;
 font-size: 0.8rem;
 line-height: 1.35;
 color: rgba(30, 58, 82, 0.72);
}

.exp-journal-places li.place-remaining {
 opacity: 0.65;
 font-style: italic;
 list-style: none;
 margin-left: -18px;
}

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

.expedition-map-header h3 {
 margin: 0;
 color: #f1c40f;
}

.expedition-map-dismiss {
 border: none;
 background: transparent;
 color: rgba(245, 236, 215, 0.75);
 font-size: 1.65rem;
 line-height: 1;
 min-width: 40px;
 min-height: 40px;
 cursor: pointer;
}

#expedition-map-overlay {
 z-index: 88;
}

body.expedition-map-open #expedition-panel {
 opacity: 0;
 pointer-events: none;
}

.expedition-map-svg {
 width: 100%;
 height: min(52vh, 420px);
 min-height: 280px;
}

.exp-context-choice.primary,
.exp-context-choice.secondary {
 border: 1px solid rgba(241, 196, 15, 0.75);
 background: linear-gradient(180deg, rgba(60, 45, 12, 0.95), rgba(35, 25, 8, 0.95));
 color: #ffe082;
 font-weight: 600;
}

.exp-context-choice.secondary {
 font-weight: 600;
}

#expedition-journal-overlay {
 display: none;
 position: fixed;
 inset: 0;
 z-index: 12040;
 align-items: flex-start;
 justify-content: center;
 box-sizing: border-box;
 padding:
  max(48px, calc(env(safe-area-inset-top, 0px) + 40px))
  max(10px, env(safe-area-inset-right, 0px))
  max(10px, calc(env(safe-area-inset-bottom, 0px) + 8px))
  max(10px, env(safe-area-inset-left, 0px));
 background: rgba(8, 12, 18, 0.55);
 overflow: hidden;
 min-height: 100dvh;
}

#expedition-journal-overlay.visible {
 display: flex;
}

body.journal-open #expedition-panel {
 opacity: 0;
 pointer-events: none;
}

.expedition-journal-card {
 box-sizing: border-box;
 width: min(100%, 340px);
 max-height: min(68dvh, 480px);
 display: flex;
 flex-direction: column;
 overflow: hidden;
 margin: 0 auto;
 padding: 12px 14px 10px;
 border-radius: 14px;
 background: linear-gradient(180deg, #faf6ee 0%, #f3ead8 100%);
 border: 1px solid rgba(120, 90, 45, 0.28);
 color: #1a1208;
 box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

.exp-journal-header {
 display: flex;
 align-items: flex-start;
 justify-content: space-between;
 gap: 12px;
 margin-bottom: 4px;
}

.exp-journal-header-text h3 {
 margin: 0;
 color: #2c1a0a;
 font-family: 'Palatino Linotype', Georgia, serif;
 font-size: 1.35rem;
 font-weight: 700;
 letter-spacing: 0.02em;
}

.exp-journal-dismiss {
 flex-shrink: 0;
 width: 40px;
 height: 40px;
 border: 1px solid rgba(80, 55, 25, 0.2);
 border-radius: 10px;
 background: rgba(255, 255, 255, 0.55);
 color: #3a2810;
 font-size: 1.5rem;
 line-height: 1;
 cursor: pointer;
}

.exp-journal-scroll {
 overflow-y: auto;
 margin-top: 6px;
 padding-right: 4px;
 -webkit-overflow-scrolling: touch;
}

.exp-j-section-title {
 margin: 0 0 10px;
 font-family: 'Palatino Linotype', Georgia, serif;
 font-size: 0.92rem;
 font-weight: 700;
 color: #2c1a0a;
 text-transform: none;
 letter-spacing: 0.01em;
}

.exp-j-count {
 font-weight: 600;
 color: #6b4e24;
}

.exp-j-divider {
 height: 1px;
 margin: 16px 0;
 background: linear-gradient(90deg, transparent, rgba(100, 70, 30, 0.25), transparent);
}

.exp-j-objective {
 margin: 0;
 font-size: 1.05rem;
 line-height: 1.55;
 color: #1f1508;
 font-weight: 500;
}

.exp-j-mark {
 flex-shrink: 0;
 display: inline-flex;
 align-items: center;
 justify-content: center;
 width: 1.4em;
 font-size: 1rem;
 font-weight: 700;
 color: #1e8449;
}

.exp-j-clue-row.is-unknown .exp-j-mark {
 color: #9a8668;
}

.exp-journal-island {
 margin: 2px 0 0;
 font-size: 0.88rem;
 color: #6b5438;
}

.exp-j-icon-wrap {
 flex-shrink: 0;
 display: inline-flex;
 align-items: center;
 justify-content: center;
 width: 36px;
 height: 36px;
 border-radius: 8px;
 background: rgba(255, 255, 255, 0.65);
 border: 1px solid rgba(100, 70, 30, 0.15);
}

.exp-journal-emoji-icon {
 font-size: 1.15rem;
 line-height: 1;
}

.exp-journal-item-icon,
.exp-journal-clue-icon {
 width: 28px;
 height: 28px;
 object-fit: contain;
}

.exp-j-clue-text {
 display: flex;
 flex-direction: column;
 gap: 3px;
 min-width: 0;
}

.exp-j-clue-text strong {
 font-size: 1rem;
 line-height: 1.35;
 color: #1f1508;
 font-weight: 700;
}

.exp-j-clue-desc,
.exp-j-item-desc {
 display: block;
 font-size: 0.92rem;
 line-height: 1.45;
 color: #4a3820;
}

.expedition-journal-card ul {
 list-style: none;
 margin: 0;
 padding: 0;
}

.expedition-journal-card li.empty {
 padding: 8px 0;
 color: #7a6548;
 font-size: 0.95rem;
}

.exp-j-clue-row,
.exp-j-item-row,
.exp-j-observation-row,
.exp-j-place-row {
 display: flex;
 align-items: flex-start;
 gap: 10px;
 padding: 12px 10px;
 margin-bottom: 6px;
 border-radius: 10px;
 background: rgba(255, 255, 255, 0.45);
 border: 1px solid rgba(100, 70, 30, 0.1);
 min-height: 52px;
}

.exp-j-clue-row.is-unknown {
 opacity: 0.72;
}

.exp-j-place-row.place-remaining {
 opacity: 0.65;
 font-style: italic;
}

@media (max-width: 480px) {
 .expedition-journal-card {
  width: 100%;
  max-height: min(64vh, 440px);
  padding: 12px 12px 10px;
 }

 .exp-journal-header-text h3 {
  font-size: 1.15rem;
 }

 .exp-j-clue-text strong {
  font-size: 1.02rem;
 }

 .exp-j-clue-desc,
 .exp-j-item-desc {
  font-size: 0.95rem;
 }
}

#expedition-item-reward {
 display: none;
 position: fixed;
 inset: 0;
 z-index: 84;
 align-items: center;
 justify-content: center;
 pointer-events: none;
 background: rgba(0, 0, 0, 0.35);
}

#expedition-item-reward.visible {
 display: flex;
}

.exp-item-reward-card {
 position: relative;
 padding: 18px 22px 14px;
 border-radius: 16px;
 background: linear-gradient(180deg, rgba(18, 28, 44, 0.97), rgba(8, 14, 26, 0.98));
 border: 1px solid rgba(241, 196, 15, 0.55);
 box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
 text-align: center;
 transform: scale(0.8);
 opacity: 0;
 animation: exp-item-pop 250ms ease-out forwards;
}

@keyframes exp-item-pop {
 to {
 transform: scale(1);
 opacity: 1;
 }
}

.exp-item-reward-glow {
 position: absolute;
 inset: -20px;
 border-radius: 24px;
 background: radial-gradient(circle, rgba(241, 196, 15, 0.28) 0%, rgba(241, 196, 15, 0) 70%);
 pointer-events: none;
 animation: exp-item-glow 1.8s ease-in-out infinite;
}

@keyframes exp-item-glow {
 0%, 100% { opacity: 0.55; }
 50% { opacity: 1; }
}

.exp-item-reward-img {
 position: relative;
 z-index: 1;
 width: 96px;
 height: 96px;
 object-fit: contain;
 display: block;
 margin: 0 auto 10px;
 filter: drop-shadow(0 4px 14px rgba(241, 196, 15, 0.35));
}

.exp-item-reward-label {
 position: relative;
 z-index: 1;
 margin: 0;
 color: #ffe082;
 font-family: 'Palatino Linotype', Georgia, serif;
 font-size: 0.95rem;
}

/* Expedition reward chest scene */
.exp-reward-scene {
 display: none;
 position: fixed;
 inset: 0;
 z-index: 92;
 align-items: center;
 justify-content: center;
 padding:
 var(--modal-safe-top)
 12px
 calc(var(--bottom-nav-measured) + 8px)
 12px;
 box-sizing: border-box;
}

.exp-reward-scene:not(.hidden) {
 display: flex;
}

body.expedition-reward-open #expedition-panel,
body.expedition-reward-open #expedition-context-menu {
 opacity: 0;
 pointer-events: none;
}

.exp-reward-backdrop {
 position: absolute;
 inset: 0;
 background: rgba(4, 8, 16, 0.82);
 backdrop-filter: blur(4px);
 -webkit-backdrop-filter: blur(4px);
}

.exp-reward-fx {
 position: absolute;
 inset: 0;
 pointer-events: none;
 z-index: 1;
}

.exp-reward-stage {
 position: relative;
 z-index: 2;
 display: flex;
 flex-direction: column;
 align-items: center;
 justify-content: center;
 width: min(700px, 70vw);
 max-width: 100%;
}

.exp-reward-chest-hit {
 background: none;
 border: none;
 padding: 0;
 margin: 0;
 cursor: pointer;
 position: relative;
 width: 100%;
 -webkit-tap-highlight-color: transparent;
 touch-action: manipulation;
}

.exp-reward-chest-hit:disabled {
 cursor: default;
 pointer-events: none;
}

.exp-reward-chest {
 display: block;
 width: 100%;
 height: auto;
 object-fit: contain;
 filter: drop-shadow(0 16px 40px rgba(0, 0, 0, 0.65));
 animation: exp-chest-breathe 3s ease-in-out infinite;
 transform-origin: center bottom;
}

.exp-reward-chest.shake {
 animation: exp-chest-shake 0.15s ease-in-out;
}

.exp-reward-chest.open {
 animation: none;
}

@keyframes exp-chest-breathe {
 0%, 100% { transform: scale(1); }
 50% { transform: scale(1.018); }
}

@keyframes exp-chest-shake {
 0%, 100% { transform: translateX(0); }
 20% { transform: translateX(-3px); }
 40% { transform: translateX(3px); }
 60% { transform: translateX(-2px); }
 80% { transform: translateX(2px); }
}

.exp-reward-glow {
 position: absolute;
 left: 50%;
 top: 46%;
 transform: translate(-50%, -50%);
 width: 72%;
 height: 4px;
 border-radius: 999px;
 background: linear-gradient(90deg,
 rgba(255, 180, 60, 0),
 rgba(255, 210, 90, 0.85),
 rgba(255, 180, 60, 0));
 box-shadow:
 0 0 18px rgba(255, 200, 80, 0.55),
 0 0 36px rgba(255, 160, 40, 0.25);
 pointer-events: none;
 animation: exp-chest-gap-glow 2.6s ease-in-out infinite;
}

.exp-reward-stage.opened .exp-reward-glow {
 opacity: 0;
 animation: none;
 transition: opacity 0.2s ease;
}

@keyframes exp-chest-gap-glow {
 0%, 100% { opacity: 0.4; }
 50% { opacity: 0.8; }
}

.exp-reward-burst {
 position: absolute;
 left: 50%;
 top: 50%;
 transform: translate(-50%, -50%);
 width: 120px;
 height: 120px;
 border-radius: 50%;
 background: radial-gradient(circle, rgba(255, 220, 100, 0.7) 0%, rgba(255, 180, 60, 0) 70%);
 opacity: 0;
 pointer-events: none;
}

.exp-reward-burst.active {
 animation: exp-reward-burst-flash 0.28s ease-out forwards;
}

@keyframes exp-reward-burst-flash {
 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }
 30% { opacity: 0.75; }
 100% { opacity: 0; transform: translate(-50%, -50%) scale(2.8); }
}

.exp-reward-hint {
 margin: 14px 0 0;
 color: rgba(241, 196, 15, 0.75);
 font-size: 0.85rem;
 letter-spacing: 0.04em;
 text-transform: uppercase;
 animation: exp-reward-hint-pulse 2s ease-in-out infinite;
}

.exp-reward-hint.hidden {
 display: none;
}

@keyframes exp-reward-hint-pulse {
 0%, 100% { opacity: 0.55; }
 50% { opacity: 1; }
}

.exp-reward-popup {
 position: absolute;
 inset: 0;
 z-index: 4;
 display: flex;
 align-items: center;
 justify-content: center;
 padding: 24px;
 background: rgba(0, 0, 0, 0.45);
 opacity: 0;
 pointer-events: none;
 transition: opacity 0.35s ease;
}

.exp-reward-popup:not(.hidden) {
 display: flex;
}

.exp-reward-popup.visible {
 opacity: 1;
 pointer-events: auto;
}

.exp-reward-popup-card {
 width: min(100%, 340px);
 padding: 22px 20px 18px;
 border-radius: 14px;
 background: linear-gradient(180deg, rgba(22, 32, 48, 0.98), rgba(10, 16, 28, 0.99));
 border: 1px solid rgba(241, 196, 15, 0.45);
 box-shadow: 0 16px 48px rgba(0, 0, 0, 0.65);
 text-align: center;
 transform: translateY(24px) scale(0.94);
 animation: exp-reward-popup-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes exp-reward-popup-rise {
 to {
 transform: translateY(0) scale(1);
 }
}

.exp-reward-badge {
 display: inline-block;
 margin-bottom: 10px;
 padding: 4px 10px;
 border-radius: 999px;
 background: rgba(241, 196, 15, 0.15);
 border: 1px solid rgba(241, 196, 15, 0.45);
 color: #ffe082;
 font-size: 0.68rem;
 font-weight: 700;
 letter-spacing: 0.12em;
}

.exp-reward-badge.hidden {
 display: none;
}

.exp-reward-relic {
 margin-bottom: 14px;
}

.exp-reward-relic-icon {
 display: block;
 font-size: 2.4rem;
 margin-bottom: 6px;
 filter: drop-shadow(0 4px 12px rgba(241, 196, 15, 0.35));
 animation: exp-reward-relic-rise 0.7s ease-out 0.1s both;
}

@keyframes exp-reward-relic-rise {
 from {
 opacity: 0;
 transform: translateY(18px) scale(0.85);
 }
 to {
 opacity: 1;
 transform: translateY(0) scale(1);
 }
}

.exp-reward-relic-name {
 display: block;
 color: #f5ecd7;
 font-family: 'Palatino Linotype', Georgia, serif;
 font-size: 1.25rem;
}

.exp-reward-stats {
 display: flex;
 flex-direction: column;
 gap: 6px;
 margin-bottom: 12px;
}

.exp-reward-stat {
 font-size: 0.95rem;
 font-weight: 600;
}

.exp-reward-stat.gold { color: #f1c40f; }
.exp-reward-stat.xp { color: #5dade2; }

.exp-reward-message {
 margin: 0 0 16px;
 color: rgba(210, 180, 140, 0.65);
 font-size: 0.82rem;
 font-style: italic;
}

.exp-reward-continue {
 width: 100%;
 padding: 12px 16px;
 border: 1px solid rgba(241, 196, 15, 0.55);
 border-radius: 8px;
 background: linear-gradient(180deg, rgba(60, 45, 12, 0.95), rgba(35, 25, 8, 0.95));
 color: #ffe082;
 font-family: inherit;
 font-size: 0.95rem;
 font-weight: 600;
 cursor: pointer;
}

.exp-journal-clue-icon {
 width: 22px;
 height: 22px;
 vertical-align: middle;
 margin-right: 6px;
 object-fit: contain;
}

#expedition-clue-reveal {
 display: none;
 position: fixed;
 inset: 0;
 z-index: 82;
 align-items: center;
 justify-content: center;
 padding: 24px;
 background: rgba(0, 0, 0, 0.55);
 pointer-events: none;
}

#expedition-clue-reveal.visible {
 display: flex;
}

.exp-clue-reveal-card {
 width: min(100%, 320px);
 padding: 16px 18px 14px;
 border-radius: 14px;
 background: linear-gradient(180deg, rgba(14, 24, 40, 0.98), rgba(8, 14, 26, 0.99));
 border: 1px solid rgba(212, 168, 75, 0.45);
 box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
 text-align: center;
}

.exp-clue-kicker {
 display: block;
 margin-bottom: 10px;
 color: rgba(241, 196, 15, 0.85);
 font-family: 'Palatino Linotype', Georgia, serif;
 font-size: 0.72rem;
 letter-spacing: 0.12em;
}

.exp-clue-reveal-img {
 width: 96px;
 height: 96px;
 object-fit: contain;
 margin: 0 auto 12px;
 display: block;
 filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.45));
}

.exp-clue-reveal-text {
 margin: 0;
 color: rgba(245, 236, 215, 0.9);
 font-family: 'Palatino Linotype', Georgia, serif;
 font-size: 0.9rem;
 line-height: 1.4;
}

.exp-journal-places li.unknown {
 opacity: 0.45;
 list-style: none;
 margin-left: -18px;
}

.exp-j-place-mark {
 display: inline-block;
 width: 1em;
 text-align: center;
 margin-right: 4px;
}

.mobile-bottom-nav.expedition-nav .nav-tab-hidden {
 display: none !important;
}

.expedition-tutorial {
 margin: 0 0 8px;
 padding: 0 4px;
 color: rgba(241, 196, 15, 0.85);
 font-size: 0.82rem;
 font-style: italic;
 text-align: center;
}

#expedition-panel.minimized .expedition-tutorial {
 display: none !important;
}

#expedition-journal-overlay.visible {
 display: flex;
}

.expedition-journal-card ul {
 margin: 0;
 padding-left: 18px;
 font-size: 0.88rem;
}

.expedition-journal-card li.empty {
 list-style: none;
 margin-left: -18px;
 opacity: 0.55;
}

.expedition-journal-close {
 display: block;
 width: 100%;
 margin-top: 14px;
 padding: 10px;
 border-radius: 8px;
 border: 1px solid rgba(212, 168, 75, 0.35);
 background: rgba(30, 20, 10, 0.85);
 color: #f5ecd7;
 cursor: pointer;
}

#landmark-debug-menu {
 display: none;
 position: fixed;
 inset: 0;
 z-index: 75;
 align-items: center;
 justify-content: center;
 padding: 16px;
 background: rgba(0, 0, 0, 0.6);
}

#landmark-debug-menu.visible {
 display: flex;
}

.landmark-debug-card {
 width: min(100%, 400px);
 max-height: 85vh;
 overflow-y: auto;
 padding: 16px;
 border-radius: 12px;
 background: rgba(12, 22, 38, 0.98);
 border: 1px solid rgba(241, 196, 15, 0.45);
 color: #f5ecd7;
}

.landmark-debug-card h3 {
 margin: 0 0 6px;
 color: #f1c40f;
}

.landmark-debug-hint {
 margin: 0 0 12px;
 font-size: 0.82rem;
 opacity: 0.75;
}

.landmark-debug-list {
 display: flex;
 flex-direction: column;
 gap: 6px;
}

.landmark-debug-btn {
 display: block;
 width: 100%;
 padding: 10px 12px;
 text-align: left;
 border-radius: 8px;
 border: 1px solid rgba(212, 168, 75, 0.3);
 background: rgba(30, 20, 10, 0.85);
 color: #f5ecd7;
 font-size: 0.88rem;
 cursor: pointer;
}

.landmark-debug-btn span {
 opacity: 0.55;
 font-size: 0.78rem;
}

.landmark-debug-close {
 display: block;
 width: 100%;
 margin-top: 12px;
 padding: 10px;
 border-radius: 8px;
 border: 1px solid rgba(212, 168, 75, 0.35);
 background: rgba(30, 20, 10, 0.85);
 color: #f5ecd7;
 cursor: pointer;
}

.exp-context-choice {
 display: block;
 box-sizing: border-box;
 width: 100%;
 max-width: 100%;
 margin-bottom: 8px;
 padding: 11px 12px;
 border-radius: 8px;
 border: 1px solid rgba(212, 168, 75, 0.35);
 background: rgba(30, 20, 10, 0.85);
 color: #f5ecd7;
 font-size: 0.92rem;
 cursor: pointer;
 text-align: left;
 white-space: normal;
 overflow-wrap: anywhere;
 word-break: break-word;
}

.exp-context-choice:disabled {
 opacity: 0.4;
}

.exp-context-choice:last-of-type {
 margin-bottom: 0;
}

.exp-context-close {
 display: block;
 width: 100%;
 margin-top: 10px;
 padding: 8px;
 border: none;
 background: transparent;
 color: #9ab;
 font-size: 0.85rem;
 cursor: pointer;
}

.expedition-panel-inner {
 pointer-events: auto;
 max-width: 520px;
 margin: 0 auto;
 padding: 16px 18px 18px;
 border-radius: 14px 14px 0 0;
 background: linear-gradient(180deg, rgba(12, 22, 38, 0.96), rgba(8, 14, 26, 0.98));
 border: 1px solid rgba(212, 168, 75, 0.35);
 border-bottom: none;
 box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.45);
}

#expedition-panel.transition-mode .expedition-choices {
 opacity: 0.35;
 pointer-events: none;
}

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

.expedition-title {
 margin: 0;
 font-size: 1.25rem;
 color: #f1c40f;
 font-family: 'Palatino Linotype', Georgia, serif;
}

.expedition-map-btn {
 border: 1px solid rgba(212, 168, 75, 0.45);
 background: rgba(30, 20, 10, 0.8);
 color: #d4c4a0;
 border-radius: 8px;
 width: 40px;
 height: 36px;
 cursor: pointer;
 font-size: 1rem;
}

.expedition-desc {
 margin: 0 0 10px;
 color: #c8d6e5;
 font-size: 0.92rem;
 line-height: 1.45;
}

.expedition-message {
 margin: 0 0 12px;
 padding: 10px 12px;
 border-radius: 8px;
 background: rgba(46, 134, 193, 0.15);
 border-left: 3px solid #5dade2;
 color: #eaf4ff;
 font-size: 0.9rem;
 line-height: 1.4;
}

.expedition-choices {
 display: flex;
 flex-direction: column;
 gap: 8px;
}

.expedition-choice-btn {
 width: 100%;
 padding: 12px 14px;
 border-radius: 10px;
 border: 1px solid rgba(212, 168, 75, 0.4);
 background: rgba(24, 36, 56, 0.95);
 color: #f5ecd7;
 font-family: 'Palatino Linotype', Georgia, serif;
 font-size: 0.95rem;
 text-align: left;
 cursor: pointer;
 touch-action: manipulation;
}

.expedition-choice-btn:active:not(:disabled) {
 background: rgba(212, 168, 75, 0.2);
}

.expedition-choice-btn.disabled,
.expedition-choice-btn:disabled {
 opacity: 0.45;
 cursor: not-allowed;
}

#expedition-map-overlay {
 display: none;
 position: fixed;
 inset: 0;
 z-index: 88;
 height: 100dvh;
 background: rgba(0, 0, 0, 0.65);
 align-items: flex-start;
 justify-content: center;
 padding:
 calc(env(safe-area-inset-top, 0px) + 12px)
 max(10px, env(safe-area-inset-right, 0px))
 calc(env(safe-area-inset-bottom, 0px) + 12px)
 max(10px, env(safe-area-inset-left, 0px));
 box-sizing: border-box;
 overflow: hidden;
}

#expedition-map-overlay.visible {
 display: flex;
}

.expedition-map-card {
 background: rgba(14, 22, 36, 0.98);
 border: 1px solid rgba(212, 168, 75, 0.4);
 border-radius: 12px;
 width: min(100%, 440px);
 max-width: 100%;
 height: min(72dvh, 620px);
 max-height: 100%;
 margin: 0 auto;
 display: flex;
 flex-direction: column;
 overflow: hidden;
 padding: 0;
 text-align: left;
 transform: none;
}

.expedition-map-header {
 display: flex;
 align-items: center;
 justify-content: space-between;
 gap: 8px;
 padding: 12px 14px;
 flex: 0 0 auto;
 position: sticky;
 top: 0;
 z-index: 5;
 background: rgba(14, 22, 36, 0.98);
 border-bottom: 1px solid rgba(212, 168, 75, 0.2);
 margin-bottom: 0;
}

.expedition-map-body {
 flex: 1 1 auto;
 min-height: 0;
 overflow-y: auto;
 overscroll-behavior: contain;
 padding: 12px 14px 16px;
}

.expedition-map-dismiss {
 border: none;
 background: rgba(30, 20, 10, 0.85);
 color: rgba(245, 236, 215, 0.9);
 font-size: 1.4rem;
 line-height: 1;
 width: 44px;
 height: 44px;
 flex: 0 0 44px;
 border-radius: 8px;
 cursor: pointer;
 display: flex;
 align-items: center;
 justify-content: center;
}

.expedition-map-svg {
 width: 100%;
 height: auto;
 min-height: 240px;
 max-height: min(52vh, 420px);
 background: rgba(0, 0, 0, 0.25);
 border-radius: 8px;
 display: block;
}

.expedition-map-close {
 padding: 8px 20px;
 border-radius: 8px;
 border: 1px solid rgba(212, 168, 75, 0.5);
 background: rgba(30, 20, 10, 0.9);
 color: #f1c40f;
 cursor: pointer;
}

.version-tag {
 margin-top: 12px;
 font-size: 0.75rem;
 opacity: 0.4;
 text-align: center;
}

/* Hamn & skattkartor */
.harbor-panel, .map-viewer {
 position: fixed;
 inset: 0;
 z-index: 30;
 background: rgba(5, 8, 15, 0.88);
 display: flex;
 align-items: center;
 justify-content: center;
}

.harbor-panel.hidden, .map-viewer.hidden {
 display: none;
}

.harbor-inner {
 width: min(720px, 92vw);
 max-height: 85vh;
 background: linear-gradient(160deg, #2a2218 0%, #1a1510 100%);
 border: 2px solid rgba(180, 150, 100, 0.4);
 border-radius: 12px;
 display: flex;
 flex-direction: column;
 overflow: hidden;
}

.harbor-header {
 padding: 20px 24px 12px;
 position: relative;
 border-bottom: 1px solid rgba(180, 150, 100, 0.2);
}

.harbor-header h1 {
 color: #d4c4a0;
 font-family: 'Palatino Linotype', serif;
 font-size: 1.6rem;
 margin: 0;
}

.harbor-subtitle {
 color: rgba(210, 180, 140, 0.5);
 font-size: 0.85rem;
 margin: 4px 0 0;
}

.harbor-header .harbor-btn {
 position: absolute;
 top: max(12px, env(safe-area-inset-top, 0px));
 right: 16px;
 width: 44px;
 height: 44px;
 min-width: 44px;
 padding: 0;
 display: flex;
 align-items: center;
 justify-content: center;
 font-size: 1.25rem;
 line-height: 1;
}

.harbor-nav {
 display: flex;
 gap: 8px;
 padding: 12px 16px;
 border-bottom: 1px solid rgba(180, 150, 100, 0.15);
}

.harbor-tab {
 background: rgba(60, 40, 20, 0.6);
 border: 1px solid rgba(180, 150, 100, 0.3);
 color: #d4c4a0;
 padding: 8px 14px;
 border-radius: 6px;
 cursor: pointer;
 font-family: inherit;
 font-size: 0.85rem;
}

.harbor-tab.active {
 background: rgba(90, 60, 30, 0.9);
 border-color: rgba(241, 196, 15, 0.4);
}

.harbor-content {
 flex: 1;
 overflow-y: auto;
 overscroll-behavior: contain;
 padding: 16px 20px var(--scroll-pad-bottom);
 min-height: 0;
}

.harbor-footer {
 padding: 10px 20px;
 border-top: 1px solid rgba(180, 150, 100, 0.15);
 color: rgba(210, 180, 140, 0.6);
 font-size: 0.8rem;
}

.harbor-btn {
 background: rgba(60, 40, 20, 0.8);
 border: 1px solid rgba(180, 150, 100, 0.4);
 color: #d4c4a0;
 padding: 6px 14px;
 border-radius: 6px;
 cursor: pointer;
 font-family: inherit;
}

.harbor-btn-sm {
 padding: 4px 10px;
 font-size: 0.85rem;
}

.harbor-btn-gold {
 border-color: rgba(241, 196, 15, 0.5);
 color: #f1c40f;
}

.map-archive h2 {
 color: #d4c4a0;
 font-family: 'Palatino Linotype', serif;
 letter-spacing: 2px;
 font-size: 1rem;
}

.map-archive hr {
 border: none;
 border-top: 1px solid rgba(180, 150, 100, 0.3);
 margin: 8px 0 16px;
}

.rarity-section h3 {
 font-size: 0.75rem;
 letter-spacing: 1px;
 text-transform: uppercase;
 margin: 16px 0 8px;
}

.map-list {
 list-style: none;
 padding: 0;
 margin: 0;
}

.map-card {
 background: rgba(40, 30, 20, 0.7);
 border: 1px solid rgba(180, 150, 100, 0.25);
 border-radius: 8px;
 padding: 12px 14px;
 margin-bottom: 8px;
 cursor: pointer;
 transition: border-color 0.2s;
}

.map-card:hover:not(.locked) {
 border-color: rgba(241, 196, 15, 0.5);
}

.map-card.locked {
 opacity: 0.4;
 cursor: default;
}

.map-card.active {
 border-color: rgba(52, 152, 219, 0.6);
}

.map-card-title {
 color: #f5ecd7;
 font-family: 'Palatino Linotype', serif;
 font-size: 1.05rem;
 font-weight: 600;
}

.map-card-meta {
 display: flex;
 gap: 8px;
 margin-top: 6px;
}

.map-card-meta .rarity-chip {
 font-weight: 600;
 font-size: 0.78rem;
}

.status-badge, .progress-badge {
 font-size: 0.65rem;
 text-transform: uppercase;
 padding: 2px 6px;
 border-radius: 3px;
 background: rgba(90, 60, 30, 0.8);
 color: rgba(210, 180, 140, 0.8);
}

.map-card-story {
 font-size: 0.75rem;
 color: rgba(210, 180, 140, 0.5);
 margin-top: 6px;
}

.harbor-services .service-slot {
 padding: 12px;
 border-bottom: 1px solid rgba(180, 150, 100, 0.1);
 color: rgba(210, 180, 140, 0.6);
}

.service-slot.active-service {
 color: #f1c40f;
}

/* Kartvisare */
.map-viewer-inner {
 width: min(960px, 95vw);
 height: min(640px, 90vh);
 background: #1a1510;
 border: 2px solid rgba(180, 150, 100, 0.4);
 border-radius: 12px;
 display: flex;
 flex-direction: column;
}

.map-viewer-header {
 display: flex;
 align-items: center;
 gap: 12px;
 padding: 14px 20px;
 border-bottom: 1px solid rgba(180, 150, 100, 0.2);
}

.map-viewer-header h2 {
 flex: 1;
 color: #d4c4a0;
 font-family: 'Palatino Linotype', serif;
 margin: 0;
 font-size: 1.2rem;
}

.map-rarity-badge {
 text-transform: uppercase;
 font-size: 0.7rem;
 letter-spacing: 1px;
}

.harbor-filters {
 display: flex;
 flex-wrap: wrap;
 gap: 6px;
 padding: 10px 16px;
 border-bottom: 1px solid rgba(180, 150, 100, 0.15);
}

.rarity-filter-btn {
 background: rgba(40, 30, 20, 0.7);
 border: 1px solid rgba(180, 150, 100, 0.25);
 color: rgba(210, 180, 140, 0.75);
 padding: 4px 10px;
 border-radius: 999px;
 cursor: pointer;
 font-family: inherit;
 font-size: 0.7rem;
 text-transform: uppercase;
 letter-spacing: 0.5px;
}

.rarity-filter-btn.active {
 border-color: var(--rarity-color, rgba(241, 196, 15, 0.5));
 color: var(--rarity-color, #f1c40f);
 background: rgba(60, 40, 20, 0.95);
}

.map-card-header {
 display: flex;
 justify-content: space-between;
 align-items: baseline;
 gap: 8px;
}

.map-card-id {
 font-size: 0.65rem;
 color: rgba(210, 180, 140, 0.35);
 font-family: monospace;
}

.map-card-island {
 font-size: 0.72rem;
 color: rgba(210, 180, 140, 0.55);
 margin-top: 4px;
}

.map-expedition-btn {
 margin-top: 10px;
 width: 100%;
}

.rarity-chip {
 font-size: 0.65rem;
 text-transform: uppercase;
}

.status-badge.status-completed { color: #2ecc71; }
.status-badge.status-mastered { color: #f1c40f; }
.status-badge.status-active { color: #3498db; }
.status-badge.status-owned { color: #d4c4a0; }

.archive-empty {
 color: rgba(210, 180, 140, 0.5);
 font-style: italic;
 text-align: center;
 padding: 24px;
}

/* Kartvisare — stående mobilformat */
.map-viewer-inner.map-viewer-portrait {
 width: min(420px, 96vw);
 height: min(820px, 94vh);
}

.map-viewer-title-block {
 flex: 1;
 min-width: 0;
}

.map-viewer-title-block h2 {
 white-space: nowrap;
 overflow: hidden;
 text-overflow: ellipsis;
}

.map-island-tag {
 display: block;
 font-size: 0.7rem;
 color: rgba(210, 180, 140, 0.5);
}

.map-viewer-body {
 flex: 1;
 display: flex;
 flex-direction: column;
 overflow: hidden;
}

.map-viewer-canvas-wrap {
 flex: 1;
 min-height: 0;
 background: #120e0a;
}

#mv-canvas {
 width: 100%;
 height: 100%;
 display: block;
 cursor: grab;
}

.map-viewer-sidebar {
 max-height: 38%;
 overflow-y: auto;
 border-top: 1px solid rgba(180, 150, 100, 0.2);
 display: flex;
 flex-direction: column;
}

.map-viewer-notes {
 width: auto;
 padding: 12px 16px;
 overflow-y: auto;
 border-left: none;
 border-bottom: 1px solid rgba(180, 150, 100, 0.15);
 color: rgba(210, 180, 140, 0.85);
 font-size: 0.82rem;
}

.map-viewer-reward {
 padding: 12px 16px;
 color: rgba(210, 180, 140, 0.85);
 font-size: 0.82rem;
 background: rgba(40, 30, 20, 0.5);
}

.map-viewer-reward h3 {
 margin: 0 0 6px;
 font-size: 0.85rem;
 color: #d4c4a0;
}

.reward-preview-title {
 font-family: 'Palatino Linotype', serif;
 color: #f1c40f;
 margin: 0 0 4px;
}

.reward-preview-desc {
 font-size: 0.78rem;
 opacity: 0.8;
 margin: 0 0 8px;
 line-height: 1.4;
}

.reward-stats {
 display: flex;
 gap: 12px;
 font-size: 0.8rem;
 margin-bottom: 6px;
}

.reward-items {
 margin: 0;
 padding-left: 18px;
 font-size: 0.75rem;
 opacity: 0.85;
}

.map-captain-notes {
 background: rgba(40, 30, 20, 0.5);
 border-left: 2px solid rgba(180, 150, 100, 0.4);
 padding: 8px 10px;
 margin-bottom: 10px;
 font-size: 0.78rem;
}

.map-captain-notes p {
 margin: 4px 0 0;
 font-style: italic;
}

.map-viewer-toolbar {
 flex-wrap: wrap;
}

@media (min-width: 640px) {
 .map-viewer-inner.map-viewer-portrait {
 width: min(720px, 95vw);
 height: min(720px, 90vh);
 }

 .map-viewer-body {
 flex-direction: row;
 }

 .map-viewer-canvas-wrap {
 flex: 1.2;
 }

 .map-viewer-sidebar {
 flex: 0.8;
 max-height: none;
 border-top: none;
 border-left: 1px solid rgba(180, 150, 100, 0.2);
 }

 .map-viewer-notes {
 border-bottom: none;
 }
}

.map-story {
 font-style: italic;
 line-height: 1.5;
 margin-bottom: 12px;
}

.map-clues {
 list-style: none;
 padding: 0;
}

.map-clues li {
 padding: 4px 0;
 opacity: 0.6;
 font-size: 0.8rem;
}

.map-clues li.studied {
 opacity: 1;
 color: #f1c40f;
}

.map-viewer-toolbar {
 display: flex;
 gap: 8px;
 padding: 10px 16px;
 border-top: 1px solid rgba(180, 150, 100, 0.2);
 align-items: center;
}

.map-viewer-toolbar .harbor-btn-gold {
 margin-left: auto;
}

.map-inspect-hint {
 text-align: center;
 color: #f1c40f;
 font-size: 0.85rem;
 padding: 0 16px 10px;
 min-height: 20px;
}

/* Kartupplåsning — UI-lageranimation (ej video) */
.map-reveal {
 position: fixed;
 inset: 0;
 z-index: 45;
 display: flex;
 align-items: center;
 justify-content: center;
 cursor: pointer;
}

.map-reveal.hidden {
 display: none;
}

.map-reveal-backdrop {
 position: absolute;
 inset: 0;
 background: #05080f;
 opacity: 0;
 transition: opacity 0.1s linear;
}

.harbor-guide {
 background: rgba(241, 196, 15, 0.08);
 border: 1px solid rgba(241, 196, 15, 0.25);
 border-radius: 8px;
 padding: 12px 14px;
 margin-bottom: 16px;
 color: rgba(210, 180, 140, 0.9);
 font-size: 0.82rem;
}

.harbor-guide.collapsed {
 padding: 10px 14px;
 cursor: pointer;
}

.harbor-guide.collapsed ol,
.harbor-guide.collapsed h3 {
 display: none;
}

.harbor-guide-toggle {
 background: none;
 border: none;
 color: #f1c40f;
 font: inherit;
 font-size: 0.85rem;
 cursor: pointer;
 padding: 0;
 text-align: left;
 width: 100%;
}

.map-card-id {
 display: none;
}

.map-read-btn,
.map-expedition-btn {
 margin-top: 10px;
 width: 100%;
 font-size: 0.92rem;
 padding: 10px 14px;
}

.map-expedition-btn {
 font-weight: 600;
}

body.map-study-mode .map-viewer-inner.map-viewer-v2 {
 width: 100%;
 max-width: none;
 height: 100%;
 max-height: 100%;
 border-radius: 0;
 border: none;
}

body.map-study-mode .map-viewer-v2 .map-viewer-header-compact {
 padding: 8px 12px !important;
}

body.map-study-mode .map-viewer-v2 .map-viewer-sidebar-min,
body.map-study-mode .map-viewer-v2 .map-viewer-footer,
body.map-study-mode .map-viewer-v2 #mv-guide {
 display: none !important;
}

body.map-study-mode .map-viewer-v2 .map-viewer-body-central {
 flex: 1;
 min-height: 0;
}

body.map-study-mode .map-viewer-v2 .map-viewer-canvas-wrap {
 flex: 1;
 min-height: 0;
}

.map-clue-progress {
 font-size: 0.72rem;
 color: rgba(241, 196, 15, 0.85);
 text-align: center;
 padding: 4px 8px;
}

.harbor-guide h3 {
 margin: 0 0 8px;
 color: #f1c40f;
 font-size: 0.9rem;
}

.harbor-guide ol {
 margin: 0;
 padding-left: 20px;
 line-height: 1.55;
}

.harbor-guide kbd {
 background: rgba(40, 30, 20, 0.8);
 border: 1px solid rgba(180, 150, 100, 0.4);
 border-radius: 3px;
 padding: 1px 5px;
 font-size: 0.75rem;
}

.map-card-new {
 border-color: rgba(241, 196, 15, 0.55) !important;
 box-shadow: 0 0 12px rgba(241, 196, 15, 0.15);
}

.new-badge {
 background: #f1c40f;
 color: #1a1510;
 font-size: 0.6rem;
 padding: 2px 5px;
 border-radius: 3px;
 vertical-align: middle;
 margin-left: 4px;
}

.map-card-locked-hint {
 font-size: 0.72rem;
 color: rgba(210, 180, 140, 0.4);
 margin: 4px 0 0;
 font-style: italic;
}

.map-read-btn {
 margin-top: 8px;
 width: 100%;
}

.map-expedition-btn {
 margin-top: 6px;
}

.map-reading-guide {
 background: rgba(52, 152, 219, 0.12);
 border-bottom: 1px solid rgba(52, 152, 219, 0.25);
 padding: 10px 16px;
 font-size: 0.8rem;
 color: rgba(210, 180, 140, 0.9);
 line-height: 1.45;
}

.map-reading-guide.hidden {
 display: none;
}

.map-reading-guide strong {
 color: #3498db;
 display: block;
 margin-bottom: 4px;
}

.guide-dot {
 color: #f1c40f;
 font-weight: bold;
}

.map-reading-guide button {
 margin-top: 8px;
}

.map-tap-hint {
 position: absolute;
 bottom: 8px;
 left: 0;
 right: 0;
 text-align: center;
 font-size: 0.78rem;
 color: #f1c40f;
 pointer-events: none;
 text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.map-viewer-canvas-wrap {
 position: relative;
}

.map-clue-progress {
 padding: 8px 16px;
 font-size: 0.72rem;
 color: rgba(241, 196, 15, 0.85);
 border-bottom: 1px solid rgba(180, 150, 100, 0.15);
 text-transform: uppercase;
 letter-spacing: 0.5px;
}

.clues-heading {
 font-size: 0.78rem;
 margin: 10px 0 4px;
 color: rgba(210, 180, 140, 0.7);
}

.map-clues li.locked-clue {
 opacity: 0.35;
 font-style: italic;
}

.map-reveal-status {
 position: absolute;
 top: -28px;
 left: 0;
 right: 0;
 text-align: center;
 color: #f1c40f;
 font-size: 0.85rem;
 letter-spacing: 1px;
 text-transform: uppercase;
 margin: 0;
}

.map-reveal-skip {
 position: absolute;
 bottom: -36px;
 left: 0;
 right: 0;
 text-align: center;
 color: rgba(210, 180, 140, 0.55);
 font-size: 0.75rem;
 margin: 0;
 animation: reveal-pulse 1.5s ease-in-out infinite;
}

.map-reveal-skip.hidden {
 display: none;
}

@keyframes reveal-pulse {
 0%, 100% { opacity: 0.5; }
 50% { opacity: 1; }
}

.map-reveal-stage {
 position: relative;
 width: min(420px, 92vw);
 height: min(680px, 82vh);
 display: flex;
 align-items: center;
 justify-content: center;
 z-index: 1;
 margin-bottom: 40px;
}

#map-reveal-canvas {
 width: 100%;
 height: 100%;
 display: block;
 filter: drop-shadow(0 12px 40px rgba(0, 0, 0, 0.6));
}

.map-reveal-compass {
 display: none;
}

.map-reveal-caption {
 position: absolute;
 left: 0;
 right: 0;
 bottom: -8px;
 transform: translateY(100%);
 text-align: center;
 opacity: 0;
 transition: opacity 0.5s ease, transform 0.5s ease;
 pointer-events: none;
}

.map-reveal.show-title .map-reveal-caption {
 opacity: 1;
 transform: translateY(calc(100% + 12px));
}

.map-reveal-label {
 margin: 0 0 4px;
 font-size: 0.65rem;
 letter-spacing: 2px;
 text-transform: uppercase;
 color: rgba(241, 196, 15, 0.7);
}

.map-reveal-caption h2 {
 margin: 0;
 color: #d4c4a0;
 font-family: 'Palatino Linotype', serif;
 font-size: 1.35rem;
}

.map-reveal-subtitle {
 margin: 8px auto 0;
 max-width: 320px;
 font-size: 0.78rem;
 font-style: italic;
 color: rgba(210, 180, 140, 0.65);
 line-height: 1.4;
}

.map-reveal.revealing #map-reveal-canvas {
 animation: map-reveal-glow 1.2s ease-out;
}

@keyframes map-reveal-glow {
 from { filter: drop-shadow(0 0 0 rgba(241, 196, 15, 0)); }
 to { filter: drop-shadow(0 12px 40px rgba(0, 0, 0, 0.6)); }
}

.map-reveal.fade-out .map-reveal-caption {
 opacity: 0;
 transform: translateY(calc(100% + 24px));
}

/* Map Viewer v2 — pinch, pan, unroll */
.map-viewer-inner.map-viewer-v2 {
 width: min(480px, 96vw);
 height: min(860px, 94vh);
 overflow: hidden;
}

.map-viewport-stage {
 width: 100%;
 height: 100%;
 overflow: hidden;
 touch-action: none;
 position: relative;
 transform: none;
 transform-origin: center center;
 will-change: opacity;
}

.map-viewport-stage.map-unroll-enter {
 animation: mapUnrollOpen 280ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes mapUnrollOpen {
 from {
 transform: scaleY(0.07);
 opacity: 0.35;
 }
 to {
 transform: scaleY(1);
 opacity: 1;
 }
}

.map-viewer-v2 .map-viewer-canvas-wrap {
 position: relative;
 overflow: hidden;
 flex: 1;
 min-height: 0;
 background: #120e0a;
}

.map-viewer-v2 #mv-canvas {
 width: 100%;
 height: 100%;
 display: block;
 touch-action: none;
 cursor: grab;
}

.map-viewer-v2 #mv-canvas:active {
 cursor: grabbing;
}

/* Map Viewer v1.10 — stor central karta */
.map-viewer-inner.map-viewer-v110 {
 width: min(480px, 96vw);
 height: min(860px, 94vh);
}

.map-viewer-header-compact {
 padding: 10px 16px !important;
}

.map-viewer-header-compact h2 {
 font-size: 1rem !important;
}

.map-studied-banner {
 background: rgba(46, 204, 113, 0.15);
 border-bottom: 1px solid rgba(46, 204, 113, 0.35);
 color: #2ecc71;
 text-align: center;
 padding: 8px;
 font-size: 0.85rem;
 font-family: 'Palatino Linotype', serif;
}

.map-studied-banner.hidden {
 display: none;
}

.map-reading-guide-compact {
 padding: 6px 16px !important;
 font-size: 0.75rem !important;
 display: flex;
 align-items: center;
 gap: 10px;
 justify-content: space-between;
}

.map-viewer-body-central {
 flex-direction: column !important;
}

.map-viewer-body-central .map-viewer-canvas-wrap {
 flex: 1;
 min-height: 0;
}

.map-viewer-sidebar-min {
 flex: 0 0 auto;
 max-height: none;
 border-top: 1px solid rgba(180, 150, 100, 0.15);
 padding: 8px 12px;
 display: flex;
 gap: 12px;
 align-items: center;
 justify-content: space-between;
}

.map-clues-mini {
 list-style: none;
 margin: 0;
 padding: 0;
 flex: 1;
 font-size: 0.68rem;
 color: rgba(210, 180, 140, 0.5);
 line-height: 1.35;
}

.map-clues-mini li.studied {
 color: #f1c40f;
}

.map-reward-possible {
 text-align: right;
 font-size: 0.65rem;
 color: rgba(180, 150, 100, 0.55);
 white-space: nowrap;
}

.reward-possible-label {
 display: block;
 text-transform: uppercase;
 letter-spacing: 0.5px;
 color: rgba(210, 180, 140, 0.45);
}

.map-viewer-tools {
 position: absolute;
 top: 8px;
 right: 8px;
 display: flex;
 gap: 4px;
 opacity: 0.45;
 transition: opacity 0.2s;
}

.map-viewer-canvas-wrap:hover .map-viewer-tools {
 opacity: 0.85;
}

.map-tool-btn {
 width: 28px;
 height: 28px;
 padding: 0;
 background: rgba(20, 15, 10, 0.7);
 border: 1px solid rgba(180, 150, 100, 0.25);
 color: rgba(210, 180, 140, 0.7);
 border-radius: 4px;
 cursor: pointer;
 font-size: 0.85rem;
}

.map-viewer-footer {
 display: flex;
 align-items: center;
 gap: 12px;
 padding: 10px 16px;
 border-top: 1px solid rgba(180, 150, 100, 0.2);
}

.map-viewer-footer .map-inspect-hint {
 flex: 1;
 text-align: left;
 padding: 0;
 min-height: 0;
}

.map-tap-hint.studied {
 color: #2ecc71;
}

@media (min-width: 640px) {
 .map-viewer-inner.map-viewer-v110 {
 width: min(680px, 94vw);
 height: min(820px, 92vh);
 }
}

/* --- Sailing expedition CTA --- */
#sailing-cta {
 position: fixed;
 left: 50%;
 transform: translateX(-50%);
 z-index: 45;
 width: min(58vw, 228px);
 pointer-events: none;
}

#sailing-cta.hidden {
 display: none;
}

.island-cta-card {
 pointer-events: auto;
 display: flex;
 flex-direction: column;
 gap: 4px;
 padding: 6px 8px 8px;
 border-radius: 10px;
 background: rgba(14, 10, 6, 0.88);
 border: 1px solid rgba(241, 196, 15, 0.4);
 box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.island-cta-card.hidden {
 display: none;
}

.sailing-cta-btn {
 pointer-events: auto;
 display: flex;
 flex-direction: column;
 align-items: stretch;
 justify-content: center;
 gap: 1px;
 width: 100%;
 padding: 7px 10px 8px;
 border: 1.5px solid rgba(241, 196, 15, 0.42);
 border-radius: 8px;
 background: rgba(24, 16, 8, 0.94);
 color: #f1c40f;
 cursor: pointer;
 text-align: left;
 box-shadow: 0 0 10px rgba(241, 196, 15, 0.08);
 transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.sailing-cta-btn .cta-row {
 display: flex;
 align-items: center;
 justify-content: flex-start;
 gap: 8px;
 width: 100%;
}

.sailing-cta-btn.hidden {
 display: none;
}

.sailing-cta-btn.explore {
 animation: cta-breathe 2.8s ease-in-out infinite, cta-glow 2.8s ease-in-out infinite;
}

.sailing-cta-btn.view-map {
 border-color: rgba(180, 140, 60, 0.4);
 animation: none;
}

.sailing-cta-btn .cta-anchor {
 font-size: 1rem;
 flex: 0 0 auto;
 line-height: 1;
}

.sailing-cta-btn.explore .cta-anchor {
 animation: cta-anchor-sway 2.4s ease-in-out infinite;
}

.sailing-cta-btn .cta-title {
 font-family: 'Palatino Linotype', Georgia, serif;
 font-size: 0.82rem;
 font-weight: 600;
 color: #ffe082;
 line-height: 1.2;
}

.sailing-cta-btn.approaching {
 animation: none;
 opacity: 0.72;
 cursor: default;
 pointer-events: none;
 border-color: rgba(241, 196, 15, 0.28);
}

.sailing-cta-btn .cta-subtitle {
 display: block;
 font-size: 0.68rem;
 color: rgba(210, 180, 140, 0.78);
 margin-left: 1.55rem;
 line-height: 1.25;
}

.sailing-cta-btn .cta-subtitle.hidden {
 display: none;
}

.sailing-cta-btn:hover,
.sailing-cta-btn.hover {
 transform: translateY(-1px) scale(1.02);
 border-color: rgba(241, 196, 15, 0.85);
 box-shadow: 0 0 22px rgba(241, 196, 15, 0.3);
}

.sailing-cta-btn:active {
 transform: scale(0.98);
}

@keyframes cta-breathe {
 0%, 100% { transform: scale(1); }
 50% { transform: scale(1.012); }
}

@keyframes cta-glow {
 0%, 100% { box-shadow: 0 0 12px rgba(241, 196, 15, 0.15); border-color: rgba(241, 196, 15, 0.45); }
 50% { box-shadow: 0 0 22px rgba(241, 196, 15, 0.32); border-color: rgba(241, 196, 15, 0.72); }
}

@keyframes cta-anchor-sway {
 0%, 100% { transform: rotate(-4deg); }
 50% { transform: rotate(4deg); }
}

.expedition-objective {
 margin: 0 12px 6px;
 padding: 8px 10px;
 border-radius: 8px;
 background: rgba(241, 196, 15, 0.08);
 border: 1px solid rgba(241, 196, 15, 0.25);
 font-size: 0.82rem;
 color: #ffe082;
 line-height: 1.35;
}

#expedition-panel.minimized .expedition-objective {
 display: none !important;
}

/* --- Treasure map library polish --- */
.current-expedition-banner {
 margin-bottom: 16px;
 padding: 16px;
 border-radius: 12px;
 background: linear-gradient(135deg, rgba(30, 20, 10, 0.95), rgba(45, 32, 16, 0.92));
 border: 1px solid rgba(241, 196, 15, 0.45);
 box-shadow: 0 0 24px rgba(241, 196, 15, 0.12);
}

.current-expedition-banner .ceb-label {
 font-size: 0.72rem;
 letter-spacing: 0.12em;
 color: rgba(241, 196, 15, 0.85);
 margin-bottom: 6px;
}

.current-expedition-banner .ceb-title {
 font-family: 'Palatino Linotype', Georgia, serif;
 font-size: 1.2rem;
 color: #ffe082;
 margin-bottom: 8px;
}

.current-expedition-banner .ceb-island {
 font-size: 0.85rem;
 color: rgba(210, 180, 140, 0.8);
 margin-bottom: 12px;
}

.map-primary-btn {
 width: 100%;
 padding: 14px 16px !important;
 font-size: 0.95rem !important;
 letter-spacing: 0.03em;
}

.library-shelf .library-lead {
 font-size: 0.85rem;
 color: rgba(210, 180, 140, 0.65);
 margin: -4px 0 12px;
}

/* --- Mobile nav map tab badges --- */
.mobile-nav-item[data-tab="island_map"] .mobile-nav-icon {
 transform: scale(1.08);
}

.mobile-nav-item.nav-has-expedition .mobile-nav-icon {
 filter: drop-shadow(0 0 8px rgba(241, 196, 15, 0.75));
}

.mobile-nav-item.nav-has-expedition.active .mobile-nav-icon {
 filter: drop-shadow(0 0 12px rgba(241, 196, 15, 0.95));
}

.mobile-nav-item .nav-badge-dot {
 position: absolute;
 top: 6px;
 right: 10px;
 width: 8px;
 height: 8px;
 border-radius: 50%;
 background: #e74c3c;
 box-shadow: 0 0 6px rgba(231, 76, 60, 0.8);
 pointer-events: none;
}

.mobile-nav-item {
  position: relative;
}

/* Stone steps investigation overlay */
#expedition-investigation {
  position: fixed;
  top: var(--vv-top, 0px);
  left: var(--vv-left, 0px);
  width: var(--vv-width, 100%);
  height: var(--vv-height, 100%);
  right: auto;
  bottom: auto;
  z-index: 80;
  pointer-events: none;
  opacity: 0;
  transition: opacity 420ms ease;
}

#expedition-investigation.visible {
  pointer-events: auto;
  z-index: 12040;
}

#expedition-investigation.fade-in {
  opacity: 1;
}

#expedition-investigation.fade-out {
  opacity: 0;
  pointer-events: none;
}

.exp-investigation-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 10, 22, 0.55);
}

.exp-investigation-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.exp-investigation-pan-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
}

.exp-investigation-pan-viewport:active {
  cursor: grabbing;
}

.exp-investigation-pan-inner {
  width: 100%;
  height: 100%;
  transform-origin: 50% 46%;
  will-change: transform;
  transition: transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

.exp-investigation-stage.pan-zoomed .exp-investigation-pan-inner {
  transition: transform 680ms cubic-bezier(0.22, 1, 0.36, 1);
}

.exp-investigation-symbol-ring {
  position: absolute;
  transform: translate(-50%, -50%);
  border: none;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at center,
    rgba(241, 196, 15, 0.14) 0%,
    rgba(241, 196, 15, 0.05) 52%,
    transparent 74%
  );
  pointer-events: auto;
  cursor: pointer;
  opacity: 0.9;
  transition: opacity 180ms ease, transform 180ms ease;
  animation: exp-symbol-ring-breathe 2.4s ease-in-out infinite;
}

.exp-investigation-symbol-ring.hover {
  opacity: 1;
  background: radial-gradient(
    ellipse at center,
    rgba(241, 196, 15, 0.38) 0%,
    rgba(241, 196, 15, 0.16) 48%,
    transparent 76%
  );
  box-shadow: 0 0 28px 12px rgba(241, 196, 15, 0.3);
  animation: none;
}

.exp-investigation-symbol-ring.found {
  opacity: 0;
  pointer-events: none;
  animation: none;
}

@keyframes exp-symbol-ring-breathe {
  0%, 100% { box-shadow: 0 0 10px 3px rgba(241, 196, 15, 0.12); }
  50% { box-shadow: 0 0 24px 11px rgba(241, 196, 15, 0.26); }
}

.exp-investigation-hint {
  position: absolute;
  left: 50%;
  bottom: calc(18% + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 3;
  margin: 0;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(8, 16, 32, 0.62);
  color: rgba(241, 228, 188, 0.92);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  pointer-events: none;
  white-space: nowrap;
}

.exp-investigation-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 56%;
  display: block;
  transition: transform 480ms ease;
}

.exp-investigation-stage.zoom-symbol .exp-investigation-bg {
  transform: scale(1.05);
}

.exp-investigation-close {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  z-index: 9;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 50%;
  background: rgba(8, 16, 32, 0.72);
  color: #e8d5a3;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.exp-investigation-stage.beach-revisit .exp-investigation-close {
  top: auto;
  bottom: calc(var(--bottom-nav-measured) + 16px);
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  width: auto;
  min-width: 132px;
  height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
}

.exp-investigation-stage.beach-revisit .exp-investigation-hint {
  bottom: calc(var(--bottom-nav-measured) + 72px);
}

.exp-investigation-hotspot {
  position: absolute;
  left: 50%;
  top: 60%;
  transform: translate(-50%, -50%);
  width: clamp(72px, 18vw, 110px);
  height: clamp(72px, 18vw, 110px);
  min-width: 72px;
  min-height: 72px;
  border: none;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.22) 0%, rgba(212, 175, 55, 0) 70%);
  box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.25);
  cursor: pointer;
  animation: exp-symbol-pulse 1.8s ease-in-out infinite;
}

@keyframes exp-symbol-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.18); opacity: 0.55; }
  50% { box-shadow: 0 0 18px 6px rgba(212, 175, 55, 0.12); opacity: 0.85; }
}

.exp-investigation-discovery {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: max(12px, env(safe-area-inset-top)) 16px
    calc(var(--bottom-nav-measured, 82px) + env(safe-area-inset-bottom, 0px) + 12px);
  pointer-events: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.exp-investigation-discovery:not([hidden]) {
  pointer-events: auto;
}

.exp-investigation-flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 58%, rgba(241, 196, 15, 0.28), transparent 55%);
  opacity: 0;
  pointer-events: none;
}

.exp-investigation-flash.active {
  animation: exp-discovery-flash 320ms ease-out;
}

@keyframes exp-discovery-flash {
  0% { opacity: 0.55; }
  100% { opacity: 0; }
}

.exp-investigation-symbol {
  width: min(42vw, 220px);
  height: min(52vh, 320px);
  object-fit: contain;
  opacity: 0;
  transform: scale(0.75);
  transition: opacity 400ms ease, transform 400ms ease;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.45));
}

.exp-investigation-stage.discovered .exp-investigation-symbol {
  opacity: 1;
  transform: scale(1);
}

.exp-investigation-card {
  margin-top: 1.2rem;
  max-width: min(92vw, 360px);
  text-align: center;
  color: #e8d5a3;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 350ms ease 200ms, transform 350ms ease 200ms;
}

.exp-investigation-stage.discovered .exp-investigation-card {
  opacity: 1;
  transform: translateY(0);
}

.exp-investigation-kicker {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: rgba(212, 175, 55, 0.85);
  margin-bottom: 0.35rem;
}

.exp-investigation-kicker.kicker-observation,
.exp-investigation-kicker.kicker-discovery {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: linear-gradient(
    105deg,
    #a67c00 0%,
    #f1c40f 22%,
    #fff8dc 45%,
    #ffe082 55%,
    #f1c40f 78%,
    #a67c00 100%
  );
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: exp-kicker-shimmer 2.8s ease-in-out infinite;
  filter: drop-shadow(0 0 10px rgba(241, 196, 15, 0.55));
}

@keyframes exp-kicker-shimmer {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 100% center; }
}

@media (prefers-reduced-motion: reduce) {
  .exp-investigation-kicker.kicker-observation,
  .exp-investigation-kicker.kicker-discovery {
    animation: none;
    -webkit-text-fill-color: #f1c40f;
    color: #f1c40f;
    background: none;
  }
}

.exp-investigation-title {
  display: block;
  font-size: clamp(1.4rem, 5vw, 2rem);
  font-weight: normal;
  margin-bottom: 0.65rem;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

.exp-investigation-body {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: rgba(232, 213, 163, 0.9);
  white-space: pre-line;
}

.exp-investigation-stage.mode-journal .exp-investigation-card {
  max-width: min(88vw, 320px);
}

.exp-journal-observations li {
  margin-bottom: 10px;
}

.exp-j-observation {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.exp-investigation-continue {
  padding: 0.65rem 1.6rem;
  border: 1px solid rgba(212, 175, 55, 0.5);
  border-radius: 999px;
  background: rgba(18, 32, 52, 0.85);
  color: #f1e4bc;
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .exp-investigation-hotspot {
    animation: none;
    opacity: 0.65;
  }
  .exp-investigation-bg,
  .exp-investigation-symbol,
  .exp-investigation-card {
    transition: none;
  }
}

/* Beach sand brush investigation */
.exp-investigation-stage.beach-mode .exp-investigation-pan-viewport {
  touch-action: pan-y;
}

.beach-search-scene {
  position: absolute;
  inset: 0;
  z-index: 6;
  overflow: hidden;
  pointer-events: auto;
}

.beach-coin-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  opacity: 0;
}

.beach-sand-mask {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
  pointer-events: auto;
  mix-blend-mode: multiply;
  opacity: 0.88;
  filter: contrast(1.04) saturate(0.92);
}

.beach-coin-tap {
  position: absolute;
  z-index: 8;
  transform: translate(-50%, -50%);
  border: none;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
  min-width: 96px;
  min-height: 96px;
}

.beach-coin-tap.pulse {
  box-shadow: 0 0 0 0 rgba(241, 196, 15, 0.55);
  animation: beachCoinPulse 1.6s ease-out infinite;
}

.beach-coin-tap.collecting {
  transition: transform 220ms ease, opacity 220ms ease;
}

@keyframes beachCoinPulse {
  0% { box-shadow: 0 0 0 0 rgba(241, 196, 15, 0.5); }
  70% { box-shadow: 0 0 0 18px rgba(241, 196, 15, 0); }
  100% { box-shadow: 0 0 0 0 rgba(241, 196, 15, 0); }
}

.beach-gold-flash {
  position: absolute;
  inset: -8%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 220, 120, 0.45) 0%, rgba(255, 220, 120, 0) 68%);
  opacity: 0;
  transition: opacity 320ms ease;
}

.beach-gold-flash.active {
  opacity: 1;
}

.beach-reward-popup {
  position: absolute;
  left: 50%;
  bottom: 18%;
  transform: translateX(-50%);
  z-index: 12;
  width: min(340px, 88vw);
  pointer-events: auto;
}

.beach-reward-popup.visible {
  animation: beachRewardIn 360ms ease-out;
}

@keyframes beachRewardIn {
  from { opacity: 0; transform: translateX(-50%) translateY(16px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.beach-reward-card {
  padding: 16px 18px 14px;
  border-radius: 12px;
  border: 1px solid rgba(180, 140, 60, 0.55);
  background: linear-gradient(165deg, rgba(24, 18, 10, 0.94), rgba(42, 28, 12, 0.92));
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.45);
  text-align: center;
  color: #f1e4bc;
}

.beach-reward-kicker {
  margin: 0 0 6px;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: rgba(241, 196, 15, 0.85);
}

.beach-reward-title {
  margin: 0 0 8px;
  font-family: "Palatino Linotype", Palatino, serif;
  font-size: 1.35rem;
  color: #f1c40f;
}

.beach-reward-body {
  margin: 0 0 8px;
  font-size: 0.92rem;
  line-height: 1.45;
  color: rgba(241, 228, 188, 0.88);
}

.beach-reward-gold {
  margin: 0 0 12px;
  font-weight: 700;
  color: #f1c40f;
}

.beach-reward-continue {
  padding: 0.55rem 1.4rem;
  border: 1px solid rgba(212, 175, 55, 0.5);
  border-radius: 999px;
  background: rgba(18, 32, 52, 0.85);
  color: #f1e4bc;
  font-family: inherit;
  cursor: pointer;
}

/* Explorer's Tent — camera zoom journal */
#tent-journal-overlay {
  position: fixed;
  top: var(--vv-top, 0px);
  left: var(--vv-left, 0px);
  width: var(--vv-width, 100%);
  height: var(--vv-height, 100%);
  right: auto;
  bottom: auto;
  z-index: 62;
  pointer-events: none;
  opacity: 0;
  transition: opacity 420ms ease;
}

#tent-journal-overlay.visible {
  pointer-events: auto;
  z-index: 200;
}

#tent-journal-overlay.discovery-mode {
  z-index: 500;
  pointer-events: auto;
}

#tent-journal-overlay.discovery-mode .tent-journal-backdrop {
  background: rgba(4, 10, 22, 0.72);
  pointer-events: auto;
}

#tent-journal-overlay.discovery-mode .tent-journal-stage {
  pointer-events: none;
}

#tent-journal-overlay.discovery-mode .tent-journal-discovery {
  pointer-events: auto;
}

#tent-journal-overlay.fade-in {
  opacity: 1;
}

#tent-journal-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

.tent-journal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 10, 22, 0.42);
}

.tent-journal-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  --zoom-t: 0;
}

.tent-journal-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.tent-journal-wide,
.tent-journal-close {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  will-change: transform, opacity;
}

.tent-journal-wide {
  object-position: 50% 58%;
  opacity: calc(1 - var(--zoom-t) * 0.92);
  transform: scale(calc(1 + var(--zoom-t) * 0.06));
}

.tent-journal-close {
  object-position: 50% 54%;
  opacity: var(--zoom-t);
  transform: scale(calc(0.88 + var(--zoom-t) * 0.22));
}

.tent-journal-stage.zoomed .tent-journal-close {
  object-position: 50% 50%;
}

.tent-journal-close-x {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  z-index: 5;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: rgba(8, 16, 32, 0.55);
  color: rgba(241, 228, 188, 0.92);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.tent-journal-hint {
  position: absolute;
  left: 50%;
  bottom: calc(22% + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 4;
  margin: 0;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(8, 16, 32, 0.62);
  color: rgba(241, 228, 188, 0.92);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  pointer-events: none;
  white-space: nowrap;
}

.tent-journal-open-btn {
  position: absolute;
  left: 50%;
  bottom: calc(14% + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 4;
  padding: 0.65rem 1.6rem;
  border: 1px solid rgba(212, 175, 55, 0.55);
  border-radius: 999px;
  background: rgba(18, 32, 52, 0.88);
  color: #f1e4bc;
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

.tent-journal-read-panel {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom, 0px));
  background: rgba(4, 10, 22, 0.38);
}

.tent-journal-page {
  width: min(92vw, 340px);
  max-height: min(72vh, 520px);
  overflow: auto;
  padding: 1.25rem 1.35rem 1.1rem;
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 12px;
  background: linear-gradient(165deg, rgba(38, 28, 18, 0.96), rgba(22, 16, 10, 0.98));
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.tent-journal-author {
  margin: 0 0 0.15rem;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(212, 175, 55, 0.85);
}

.tent-journal-day {
  margin: 0 0 0.85rem;
  font-size: 0.92rem;
  color: rgba(232, 213, 163, 0.75);
}

.tent-journal-text {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: rgba(241, 228, 188, 0.92);
  white-space: pre-line;
}

.tent-journal-read-continue {
  display: block;
  margin: 0 auto;
  padding: 0.55rem 1.4rem;
  border: 1px solid rgba(212, 175, 55, 0.5);
  border-radius: 999px;
  background: rgba(18, 32, 52, 0.85);
  color: #f1e4bc;
  font-family: inherit;
  cursor: pointer;
}

.tent-journal-stage.phase-discovery {
  pointer-events: none;
}

.tent-journal-stage.phase-discovery .tent-journal-discovery {
  pointer-events: auto;
}

.tent-journal-stage.phase-discovery .tent-journal-hint,
.tent-journal-stage.phase-discovery .tent-journal-open-btn,
.tent-journal-stage.phase-discovery .tent-journal-close-x,
.tent-journal-stage.phase-discovery .tent-journal-read-panel,
.tent-journal-stage.phase-discovery .tent-journal-viewport {
  display: none !important;
  pointer-events: none !important;
}

.tent-journal-discovery-scrim {
  position: absolute;
  inset: 0;
  background: rgba(4, 10, 22, 0.72);
  pointer-events: auto;
}

.tent-journal-discovery {
  position: absolute;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(4, 10, 22, 0.5);
}

.tent-journal-discovery-card {
  position: relative;
  z-index: 401;
  width: min(90vw, 320px);
  padding: 1.35rem 1.25rem 1.1rem;
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 14px;
  background: linear-gradient(165deg, rgba(18, 32, 52, 0.96), rgba(10, 18, 34, 0.98));
  text-align: center;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.42);
}

.tent-journal-discovery-kicker {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: rgba(212, 175, 55, 0.8);
}

.tent-journal-discovery-img {
  display: block;
  width: 88px;
  height: 88px;
  margin: 0 auto 0.65rem;
  object-fit: contain;
}

.tent-journal-discovery-img[hidden] {
  display: none !important;
}

.tent-journal-discovery.is-visible {
  display: flex !important;
}

.tent-journal-discovery-title {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.25;
  color: #f1e4bc !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.tent-journal-discovery-body {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: rgba(232, 213, 163, 0.92) !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.tent-journal-discovery-footer {
  margin: 0 0 0.85rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(212, 175, 55, 0.75) !important;
}

.tent-journal-discovery-continue {
  padding: 0.55rem 1.4rem;
  border: 1px solid rgba(212, 175, 55, 0.5);
  border-radius: 999px;
  background: rgba(18, 32, 52, 0.85);
  color: #f1e4bc;
  font-family: inherit;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .tent-journal-wide,
  .tent-journal-close {
    transition: none;
  }
}

/* Camp activity — journal read & crate opening */
#camp-activity-overlay {
  position: fixed;
  inset: 0;
  z-index: 12050;
  display: none;
  align-items: flex-end;
  justify-content: center;
  min-height: 100dvh;
  pointer-events: none;
}

#camp-activity-overlay.visible {
  display: flex;
  pointer-events: auto;
}

.camp-activity-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 10, 18, 0.62);
  backdrop-filter: brightness(0.55);
  -webkit-backdrop-filter: brightness(0.55);
}

.camp-activity-focus {
  pointer-events: none;
}

.camp-activity-card {
  position: relative;
  z-index: 2;
  width: min(100%, 520px);
  max-height: min(78dvh, calc(100dvh - env(safe-area-inset-top, 0px) - 48px));
  margin:
    0
    max(12px, env(safe-area-inset-right, 0px))
    calc(12px + env(safe-area-inset-bottom, 0px))
    max(12px, env(safe-area-inset-left, 0px));
  padding: 20px 18px 16px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: linear-gradient(180deg, rgba(22, 34, 52, 0.97), rgba(12, 20, 34, 0.98));
  border: 1px solid rgba(212, 175, 90, 0.35);
  border-radius: 14px 14px 10px 10px;
  color: #f3ead4;
  font-family: 'Crimson Pro', Georgia, serif;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.45);
}

.camp-activity-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: rgba(243, 234, 212, 0.85);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.camp-activity-kicker {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #d4af5a;
}

.camp-activity-title {
  margin: 0;
  padding-right: 28px;
  font-size: 1.35rem;
  color: #e8c96a;
  font-weight: 600;
}

.camp-activity-body {
  margin: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  font-size: 1.05rem;
  line-height: 1.55;
  white-space: pre-line;
  color: rgba(243, 234, 212, 0.92);
}

.camp-activity-scrap {
  margin-top: 12px;
  font-size: 0.95rem;
  opacity: 0.88;
}

.camp-activity-footer {
  margin: 0;
  font-size: 0.92rem;
  color: #c9b87a;
}

.camp-activity-action {
  flex: 0 0 auto;
  min-height: 48px;
  margin-top: 4px;
  border: 1px solid rgba(212, 175, 90, 0.45);
  border-radius: 8px;
  background: rgba(18, 32, 52, 0.9);
  color: #f1e4bc;
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
}

body.camp-activity-open #mobile-bottom-nav,
body.camp-activity-open .mobile-bottom-nav {
  opacity: 0.25;
  pointer-events: none;
}

body.camp-activity-open #expedition-panel {
  opacity: 0.35;
  pointer-events: none;
}

#camp-crate-scene-prop {
  position: fixed;
  z-index: 58;
  transform: translate(-50%, -58%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.45));
}

#camp-crate-scene-prop.visible {
  opacity: 1;
}

#camp-crate-scene-prop .camp-crate-scene-img {
  display: block;
  width: 100%;
  height: auto;
}

#camp-crate-cinematic {
  position: fixed;
  inset: 0;
  z-index: 12055;
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  pointer-events: none;
}

#camp-crate-cinematic.visible {
  display: flex;
  pointer-events: auto;
}

.camp-crate-cinematic-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 10, 18, 0.78);
  backdrop-filter: brightness(0.45);
  -webkit-backdrop-filter: brightness(0.45);
}

.camp-crate-cinematic-stage {
  position: relative;
  z-index: 1;
  width: min(88vw, 420px);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.camp-crate-cinematic-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
}

.camp-crate-cinematic-glow {
  position: absolute;
  inset: 10% 5% 20%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 40%, rgba(255, 200, 100, 0.45), transparent 70%);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.camp-crate-cinematic-glow.visible {
  opacity: 1;
}

#camp-crate-cinematic.is-shaking .camp-crate-cinematic-stage {
  animation: camp-crate-shake 0.75s ease-in-out;
}

.camp-activity-crate-preview {
  display: block;
  width: min(100%, 220px);
  margin: 0 auto 12px;
  object-fit: contain;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.35));
}

.camp-activity-item-img {
  display: block;
  width: min(100%, 180px);
  margin: 0 auto 12px;
  object-fit: contain;
  border-radius: 8px;
}

body.camp-crate-cinematic-open #mobile-bottom-nav,
body.camp-crate-cinematic-open .mobile-bottom-nav,
body.camp-crate-cinematic-open #expedition-panel {
  opacity: 0.2;
  pointer-events: none;
}

body.camp-crate-cinematic-open #expedition-bug-btn,
body.camp-crate-cinematic-open .expedition-back-float {
  display: none !important;
}

#expedition-canvas.camp-crate-shake {
  animation: camp-crate-shake 0.85s ease-in-out;
}

@keyframes camp-crate-shake {
  0%, 100% { transform: translate(0, 0); }
  15% { transform: translate(-2px, 1px) rotate(-0.3deg); }
  30% { transform: translate(3px, -1px) rotate(0.4deg); }
  45% { transform: translate(-3px, 2px); }
  60% { transform: translate(2px, -2px) rotate(-0.2deg); }
  75% { transform: translate(-1px, 1px); }
}

.exp-j-clue-found-at {
  display: block;
  margin-top: 4px;
  font-size: 0.88rem;
  color: #8fd4a0;
}

.exp-j-clue-row.is-rereadable {
  cursor: pointer;
}

.exp-j-clue-row.is-rereadable:active {
  opacity: 0.85;
}

/* World chart / minimap modal */
.minimap-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding:
    calc(env(safe-area-inset-top, 0px) + 12px)
    max(10px, env(safe-area-inset-right, 0px))
    calc(env(safe-area-inset-bottom, 0px) + 12px)
    max(10px, env(safe-area-inset-left, 0px));
  box-sizing: border-box;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.55);
  pointer-events: auto;
}

.minimap-overlay.hidden {
  display: none;
  pointer-events: none;
}

.minimap-close {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  right: max(10px, env(safe-area-inset-right, 0px));
  z-index: 20;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: rgba(8, 16, 32, 0.72);
  color: rgba(241, 228, 188, 0.95);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
}

.minimap-backdrop-close {
  position: absolute;
  inset: 0;
  z-index: 0;
  border: none;
  background: transparent;
  cursor: default;
  pointer-events: auto;
}

.minimap-modal {
  position: relative;
  z-index: 2;
  width: min(100%, 440px);
  max-width: 100%;
  height: min(72dvh, 620px);
  margin: 0 auto;
  box-sizing: border-box;
  overflow: hidden;
  transform: none;
  border: 2.5px solid #6b4a28;
  border-radius: 10px;
  background: linear-gradient(160deg, #f0ddb8 0%, #e6cfa0 45%, #d4b880 100%);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.minimap-map-content {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform-origin: 0 0;
  transform: none;
  will-change: auto;
}

.minimap-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: none;
}

.minimap-world-layer {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

body.map-open {
  overflow: hidden;
}

body.map-open #game-canvas {
  transform: none !important;
}

/* World chart island info panel */
.world-chart-panel {
  position: fixed;
  inset: 0;
  z-index: 9200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  background: rgba(0, 0, 0, 0.35);
  pointer-events: auto;
}

.world-chart-panel.hidden {
  display: none;
}

.world-chart-panel-card {
  position: relative;
  width: min(420px, 100%);
  padding: 18px 18px 16px;
  border-radius: 12px;
  border: 1px solid rgba(180, 140, 60, 0.55);
  background: linear-gradient(165deg, #f0ddb8 0%, #e6cfa0 55%, #d4b880 100%);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  color: #2a1808;
}

.world-chart-panel-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(42, 24, 8, 0.12);
  color: #4a3018;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.world-chart-panel-status {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.world-chart-panel-name {
  margin: 0 0 12px;
  font-family: "Palatino Linotype", Palatino, serif;
  font-size: 1.35rem;
  color: #1a1008;
}

.world-chart-panel-stats {
  margin: 0 0 14px;
  display: grid;
  gap: 8px;
}

.world-chart-panel-stats div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.92rem;
}

.world-chart-panel-stats dt {
  margin: 0;
  opacity: 0.75;
}

.world-chart-panel-stats dd {
  margin: 0;
  font-weight: 700;
}

.world-chart-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.world-chart-panel-actions button {
  flex: 1 1 140px;
  padding: 10px 12px;
  border: 1px solid rgba(107, 74, 40, 0.45);
  border-radius: 8px;
  background: rgba(42, 24, 8, 0.88);
  color: #f1c40f;
  font-family: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}

.world-chart-panel-actions button:active {
  transform: scale(0.98);
}

/* Whispering Falls sanctuary closeups */
#wf-sanctuary-overlay {
  position: fixed;
  inset: 0;
  z-index: 12040;
  display: none;
  pointer-events: none;
}

#wf-sanctuary-overlay.visible {
  display: block;
  pointer-events: auto;
}

body.wf-sanctuary-open {
  overflow: hidden;
}

.wf-sanctuary-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 8, 16, 0.72);
}

.wf-sanctuary-stage {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
}

.wf-sanctuary-close {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
  z-index: 3;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(241, 196, 15, 0.45);
  background: rgba(8, 16, 32, 0.88);
  color: #f1c40f;
  font-size: 1.4rem;
  cursor: pointer;
}

.wf-sanctuary-viewport {
  position: relative;
  width: min(100%, 420px);
  height: min(72vh, 760px);
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

.wf-sanctuary-pan {
  position: absolute;
  inset: 0;
}

.wf-sanctuary-bg,
.wf-sanctuary-door-layer,
.wf-door-slots,
.wf-door-symbol {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.wf-sanctuary-door-layer {
  display: block;
}

.wf-door-symbol {
  left: 50%;
  width: 34%;
  height: auto;
  inset: auto;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 420ms ease, transform 520ms ease;
}

.wf-door-symbol:not([hidden]) {
  opacity: 1;
}

.wf-door-symbol.wf-symbol-insert {
  animation: wfSymbolInsert 680ms ease-out;
}

@keyframes wfSymbolInsert {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.82); }
  60% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.wf-sanctuary-hotspot {
  position: absolute;
  border: none;
  background: radial-gradient(circle, rgba(255, 236, 160, 0.28) 0%, rgba(255, 236, 160, 0) 72%);
  cursor: pointer;
  z-index: 2;
}

.wf-sanctuary-hotspot.pulse {
  animation: wfHotspotPulse 1.8s ease-in-out infinite;
}

@keyframes wfHotspotPulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

.wf-pickup-fly {
  position: absolute;
  left: 45%;
  top: 72%;
  width: 28%;
  z-index: 4;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: transform 720ms ease-in, opacity 720ms ease-in;
}

.wf-pickup-fly.wf-fly-active {
  transform: translate(calc(50vw - 45%), calc(-42vh)) scale(0.35);
  opacity: 0;
}

.wf-sanctuary-caption {
  margin-top: 10px;
  color: rgba(245, 236, 215, 0.88);
  font-size: 0.92rem;
  text-align: center;
  max-width: min(420px, 92vw);
}

.wf-sanctuary-card {
  position: absolute;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(92vw, 400px);
  padding: 16px 18px;
  border-radius: 12px;
  background: rgba(12, 18, 32, 0.94);
  border: 1px solid rgba(212, 168, 75, 0.45);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
  z-index: 5;
}

.wf-sanctuary-kicker {
  margin: 0 0 6px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: #f1c40f;
}

.wf-sanctuary-title {
  margin: 0 0 8px;
  font-size: 1.05rem;
  color: #f5ecd7;
}

.wf-sanctuary-body {
  margin: 0 0 12px;
  color: rgba(245, 236, 215, 0.88);
  line-height: 1.45;
  font-size: 0.92rem;
}

.wf-sanctuary-continue {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid rgba(241, 196, 15, 0.5);
  background: rgba(241, 196, 15, 0.14);
  color: #f1c40f;
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}

/* Mobile — readable overlays that fit small screens */
@media (max-width: 768px), (pointer: coarse) {
  #camp-activity-overlay {
    align-items: center;
    justify-content: center;
    padding:
      max(8px, env(safe-area-inset-top))
      max(10px, env(safe-area-inset-right))
      max(8px, env(safe-area-inset-bottom))
      max(10px, env(safe-area-inset-left));
  }

  .camp-activity-card {
    width: min(100%, calc(100vw - 20px));
    max-height: min(82dvh, calc(100dvh - env(safe-area-inset-top, 0px) - 16px));
    margin: 0;
    padding: 14px 14px 12px;
    border-radius: 12px;
    min-height: 0;
  }

  .camp-activity-title {
    font-size: 1.08rem;
  }

  .camp-activity-body {
    font-size: 0.92rem;
    line-height: 1.48;
    max-height: min(48dvh, 320px);
  }

  .camp-activity-kicker {
    font-size: 0.68rem;
  }

  .camp-activity-action {
    min-height: 44px;
    font-size: 0.92rem;
  }

  .exp-investigation-discovery {
    justify-content: flex-start;
    padding:
      max(8px, env(safe-area-inset-top))
      12px
      calc(var(--bottom-nav-measured, 82px) + env(safe-area-inset-bottom, 0px) + 8px);
  }

  .exp-investigation-symbol {
    width: min(36vw, 150px);
    height: min(24vh, 160px);
    flex-shrink: 0;
  }

  .exp-investigation-card {
    margin-top: 0.65rem;
    max-width: min(94vw, 340px);
    max-height: min(44dvh, 280px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex-shrink: 1;
  }

  .exp-investigation-title {
    font-size: clamp(1rem, 4.2vw, 1.25rem);
    margin-bottom: 0.45rem;
  }

  .exp-investigation-body {
    font-size: 0.82rem;
    line-height: 1.42;
    margin-bottom: 0.75rem;
  }

  .exp-investigation-continue {
    padding: 0.55rem 1.2rem;
    font-size: 0.9rem;
  }

  .exp-investigation-stage.mode-journal .exp-investigation-card {
    max-width: min(94vw, 340px);
  }

  #expedition-confirm-overlay {
    padding:
      max(10px, env(safe-area-inset-top))
      12px
      max(10px, env(safe-area-inset-bottom));
    align-items: center;
  }

  .expedition-confirm-card {
    width: min(100%, calc(100vw - 24px));
    max-height: min(78dvh, calc(100dvh - env(safe-area-inset-top, 0px) - 24px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 14px 14px;
  }

  .exp-confirm-title {
    font-size: 1rem;
  }

  .exp-confirm-body {
    font-size: 0.84rem;
  }

  .wf-sanctuary-viewport {
    width: min(100%, calc(100vw - 24px));
    height: min(58dvh, 520px);
  }

  .wf-sanctuary-card {
    width: min(calc(100vw - 24px), 360px);
    max-height: min(42dvh, 260px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 14px;
  }

  .wf-sanctuary-title {
    font-size: 0.95rem;
  }

  .wf-sanctuary-body {
    font-size: 0.84rem;
    line-height: 1.42;
  }

  .wf-sanctuary-caption {
    font-size: 0.84rem;
  }
}
