:root {
  --ink: #f4efe6;
  --ink-2: rgba(244, 239, 230, 0.68);
  --glass: rgba(20, 19, 15, 0.62);
  --glass-2: rgba(20, 19, 15, 0.82);
  --line: rgba(244, 239, 230, 0.14);
  --accent: #c8a06a;
  --gold-2: #e8cc94;
  --serif: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;
  --sans: "Manrope", "Helvetica Neue", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  font-family: var(--sans);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #14130f; overscroll-behavior: none; }
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#scene { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; touch-action: none; outline: none; cursor: grab; }
#scene:active { cursor: grabbing; }
body.locked #scene { cursor: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.touch-only { display: none; }
body.touch .touch-only { display: block; }
body.touch .desk-only { display: none; }

/* ---------- Pantalla de carga ---------- */
#loader {
  --p: 0;
  position: fixed; inset: 0; z-index: 50; overflow: hidden; color: var(--ink);
  transition: opacity 1.4s cubic-bezier(.7, 0, .2, 1), transform 1.6s cubic-bezier(.7, 0, .2, 1), filter 1.4s ease, visibility 1.4s;
}
#loader.hide { opacity: 0; visibility: hidden; transform: scale(1.06); filter: blur(10px); pointer-events: none; }
.ld-veil { position: absolute; inset: 0; transition: background 1.2s;
  background: radial-gradient(70% 60% at 50% 46%, rgba(16, 14, 11, .80) 0%, rgba(11, 10, 8, .93) 60%, rgba(8, 7, 6, .98) 100%); }
#loader.ready .ld-veil { background: radial-gradient(60% 55% at 50% 50%, rgba(10, 9, 7, .78) 0%, rgba(10, 9, 7, .74) 45%, rgba(8, 7, 6, .9) 100%); }
.ld-plan { transition: opacity 1.6s ease; }
#loader.ready .ld-plan { opacity: 0; }
.ld-plan { position: absolute; left: 50%; top: 50%; width: min(118vmin, 1180px); aspect-ratio: 2092 / 1937; transform: translate(-50%, -50%) rotate(-1.5deg); animation: ldDrift 40s ease-in-out infinite alternate; }
.ld-plan img { position: absolute; inset: 0; width: 100%; height: 100%; }
.ld-plan-base { opacity: .07; }
.ld-plan-reveal { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--p) * 100%) 0 0); transition: clip-path .5s ease-out; opacity: .22; filter: drop-shadow(0 0 6px rgba(232, 196, 130, .35)); }
.ld-scan { position: absolute; top: -4%; bottom: -4%; left: calc(var(--p) * 100%); width: 2px; transition: left .5s ease-out, opacity .8s;
  background: linear-gradient(transparent, #f3d9a0 20%, #fff2cf 50%, #f3d9a0 80%, transparent); box-shadow: 0 0 18px 4px rgba(243, 217, 160, .45), 0 0 60px 12px rgba(243, 217, 160, .14); }
#loader.ready .ld-scan { opacity: 0; }
@keyframes ldDrift { from { transform: translate(-50%, -50%) rotate(-1.5deg) scale(1); } to { transform: translate(-50%, -51.5%) rotate(-.5deg) scale(1.06); } }
.ld-grain { position: absolute; inset: -50%; opacity: .05; pointer-events: none; animation: ldGrain 1.2s steps(6) infinite;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
@keyframes ldGrain { 0% { transform: translate(0, 0); } 33% { transform: translate(-3%, 2%); } 66% { transform: translate(2%, -3%); } 100% { transform: translate(0, 0); } }

.ld-top { position: absolute; top: calc(26px + var(--safe-t)); left: calc(36px + var(--safe-l)); right: calc(36px + var(--safe-r)); display: flex; justify-content: space-between; align-items: center; animation: ldFade 1.2s .2s both; }
.ld-brand { height: 20px; width: auto; }
.ld-meta { margin: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font: 400 10px/1.2 var(--sans); letter-spacing: .22em; text-transform: uppercase; color: rgba(244, 239, 230, .5); }
.ld-meta span:first-child { color: var(--gold-2); }

.ld-center { position: absolute; left: 50%; top: 47%; transform: translate(-50%, -50%); width: min(560px, calc(100vw - 32px)); display: flex; flex-direction: column; align-items: center; text-align: center; }
.ld-emblem { position: relative; width: clamp(150px, 22vmin, 210px); aspect-ratio: 1; margin-bottom: clamp(18px, 3.4vh, 34px); animation: ldRise 1.4s cubic-bezier(.2, .7, .1, 1) both; }
.ld-ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ld-ring circle { fill: none; transform-origin: 120px 120px; }
.ld-ticks { stroke: rgba(232, 200, 140, .32); stroke-width: 6; stroke-dasharray: .7 6.47; animation: ldSpin 90s linear infinite; }
.ld-track { stroke: rgba(244, 239, 230, .08); stroke-width: 1; }
.ld-bar { stroke: url(#ldGold); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 653.45; stroke-dashoffset: calc(653.45 * (1 - var(--p))); transform: rotate(-90deg); transition: stroke-dashoffset .5s ease-out; filter: drop-shadow(0 0 4px rgba(243, 217, 160, .6)); }
.ld-orbit { stroke: rgba(248, 227, 168, .7); stroke-width: 1; stroke-dasharray: 26 564.6; stroke-linecap: round; animation: ldSpin 2.6s cubic-bezier(.5, .1, .5, .9) infinite; transition: opacity .6s; }
#loader.ready .ld-orbit { opacity: 0; }
#loader.ready .ld-ring { animation: ldGlow 2.8s ease-in-out infinite; }
@keyframes ldSpin { to { transform: rotate(360deg); } }
@keyframes ldGlow { 50% { filter: drop-shadow(0 0 14px rgba(243, 217, 160, .45)); } }
.ld-iso { position: absolute; inset: 27%; }
.ld-iso img { width: 100%; height: 100%; object-fit: contain; animation: ldBreath 4.5s ease-in-out infinite; }
.ld-shine { position: absolute; inset: 0; -webkit-mask: url(../brand/lum360-isotipo.png) center / contain no-repeat; mask: url(../brand/lum360-isotipo.png) center / contain no-repeat;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 246, 220, .95) 50%, transparent 62%) 0 0 / 260% 100% no-repeat; animation: ldShine 3.6s 1s ease-in-out infinite; mix-blend-mode: screen; }
@keyframes ldShine { 0% { background-position: 130% 0; } 55%, 100% { background-position: -40% 0; } }
@keyframes ldBreath { 50% { transform: scale(1.025); filter: brightness(1.08); } }

.ld-eyebrow { margin: 0; font: 500 10.5px/1.4 var(--sans); letter-spacing: .32em; text-transform: uppercase; color: var(--gold-2); animation: ldFade 1.2s .5s both; }
.ld-title { margin: 12px 0 6px; font: 300 clamp(44px, 8.4vw, 86px)/1.05 var(--serif); letter-spacing: .06em; white-space: nowrap; color: #f3e6cb; }
.ld-title span { display: inline-block; background: linear-gradient(180deg, #fbf3e3 10%, #e2c891 95%); -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: ldLetter 1.3s cubic-bezier(.2, .7, .1, 1) both; animation-delay: calc(.55s + var(--i, 0) * 70ms); }
.ld-title .sp { width: .28em; }
@keyframes ldLetter { from { opacity: 0; transform: translateY(.35em); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }
.ld-lead { margin: 0; font: italic 300 clamp(16px, 2.2vw, 21px)/1.4 var(--serif); letter-spacing: .04em; color: rgba(244, 239, 230, .72); animation: ldFade 1.2s 1.2s both; }
.ld-cta { margin-top: clamp(22px, 4.2vh, 40px); min-height: 110px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.ld-status { margin: 0; min-height: 16px; font: 400 11px/1.4 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: rgba(244, 239, 230, .55); transition: color .6s; }
.ld-status.flash { animation: ldStatus .5s ease; }
@keyframes ldStatus { from { opacity: 0; transform: translateY(4px); } }
#loader.ready .ld-status { color: var(--gold-2); }
#start {
  position: relative; display: inline-flex; align-items: center; gap: 14px; padding: 16px 30px 16px 34px; border-radius: 999px; overflow: hidden;
  font: 600 11.5px/1 var(--sans); letter-spacing: .26em; text-transform: uppercase; color: #17140f;
  background: linear-gradient(120deg, #b98d52, #f1d9a1 45%, #c99d5f 70%, #e8c98c, #b98d52); background-size: 200% 100%;
  box-shadow: 0 10px 40px rgba(200, 160, 106, .28), inset 0 1px 0 rgba(255, 255, 255, .5);
  opacity: 0; transform: translateY(14px) scale(.96); pointer-events: none; transition: opacity .9s cubic-bezier(.2, .7, .1, 1), transform .9s cubic-bezier(.2, .7, .1, 1), box-shadow .4s;
}
#start span, #start svg { position: relative; z-index: 1; }
#start svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; transition: transform .4s; }
#start::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .55) 50%, transparent 65%) 0 0 / 250% 100% no-repeat; animation: ldShine 3.2s ease-in-out infinite; }
#loader.ready #start { opacity: 1; transform: none; pointer-events: auto; animation: ldGoldMove 6s linear infinite; }
.ld-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
#start-vr { display: none; align-items: center; gap: 12px; padding: 15px 26px; border-radius: 999px; border: 1px solid rgba(232, 204, 148, .55); color: var(--gold-2);
  font: 600 11.5px/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; background: rgba(20, 17, 12, .35); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; transform: translateY(14px); pointer-events: none; transition: opacity .9s .15s, transform .9s .15s, background .3s; }
#start-vr svg { width: 20px; height: 20px; fill: currentColor; }
#start-vr:hover { background: rgba(232, 204, 148, .12); }
body.xr-ok #start-vr { display: inline-flex !important; }
#loader.ready #start-vr { opacity: 1; transform: none; pointer-events: auto; }
.xr-only { display: none !important; }
body.xr-ok #btn-vr { display: flex !important; }
body.xr-ok .ld-howto.xr-only, body.xr-ok dl.xr-only { display: grid !important; }
body.xr-ok .ld-howto.xr-only { display: block !important; }
body.quest .ld-howto.desk-only { display: none; }
#start:hover { box-shadow: 0 14px 50px rgba(200, 160, 106, .42), inset 0 1px 0 rgba(255, 255, 255, .6); }
#start:hover svg { transform: translateX(4px); }
@keyframes ldGoldMove { to { background-position: 200% 0; } }
.ld-howto { margin: 0; max-width: 420px; font: 400 11px/1.5 var(--sans); letter-spacing: .06em; color: rgba(244, 239, 230, .42); opacity: 0; transition: opacity .8s .3s; }
#loader.ready .ld-howto { opacity: 1; }
body:not(.touch) .ld-howto.touch-only, body.touch .ld-howto.desk-only { display: none; }

.ld-steps { position: absolute; left: calc(36px + var(--safe-l)); bottom: calc(34px + var(--safe-b)); width: 340px; animation: ldFade 1.2s .9s both; }
.ld-steps ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.ld-steps li { position: relative; display: grid; grid-template-columns: 14px 1fr auto; align-items: center; gap: 12px; padding-bottom: 6px; white-space: nowrap; font: 400 11.5px/1.3 var(--sans); letter-spacing: .03em; color: rgba(244, 239, 230, .32);
  opacity: 0; transform: translateX(-18px); filter: blur(4px); transition: color .5s, opacity .7s cubic-bezier(.2, .7, .1, 1), transform .7s cubic-bezier(.2, .7, .1, 1), filter .7s; }
.ld-steps li::before { content: ""; position: absolute; left: 26px; right: 0; bottom: 0; height: 1px; background: rgba(244, 239, 230, .08); }
.ld-steps li::after { content: ""; position: absolute; left: 26px; bottom: 0; height: 1px; width: calc((100% - 26px) * var(--f, 0)); background: linear-gradient(90deg, rgba(232, 204, 148, .2), #f3d9a0); box-shadow: 0 0 6px rgba(243, 217, 160, .6); transition: width .45s ease-out, opacity .8s; }
.ld-steps li.active, .ld-steps li.done { opacity: 1; transform: none; filter: none; }
.ld-steps li.done::after { opacity: .35; box-shadow: none; }
.ld-steps li span { overflow: hidden; text-overflow: ellipsis; }
.ld-steps li i { position: relative; width: 9px; height: 9px; border-radius: 50%; border: 1px solid rgba(244, 239, 230, .25); transition: .4s; }
.ld-steps li b { font: 500 10.5px/1 var(--sans); letter-spacing: .08em; color: rgba(244, 239, 230, .3); font-variant-numeric: tabular-nums; }
.ld-steps li.active { color: rgba(244, 239, 230, .88); }
.ld-steps li.active i { border-color: var(--gold-2); animation: ldPing 1.4s ease-out infinite; }
.ld-steps li.active b { color: var(--gold-2); }
.ld-steps li.done { color: rgba(244, 239, 230, .6); }
.ld-steps li.done i { background: var(--gold-2); border-color: var(--gold-2); }
.ld-steps li.done i::after { content: ""; position: absolute; left: 2.4px; top: .6px; width: 2.4px; height: 4.6px; border: solid #17140f; border-width: 0 1.3px 1.3px 0; transform: rotate(45deg); }
.ld-steps li.done b { color: rgba(243, 217, 160, .75); }
@keyframes ldPing { 0% { box-shadow: 0 0 0 0 rgba(243, 217, 160, .6); } 70% { box-shadow: 0 0 0 7px rgba(243, 217, 160, 0); } 100% { box-shadow: 0 0 0 0 rgba(243, 217, 160, 0); } }
.ld-specs { opacity: 0; transform: translateY(6px); transition: opacity 1s .3s, transform 1s .3s; }
#loader.ready .ld-specs { opacity: 1; transform: none; }
.ld-specs { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid rgba(244, 239, 230, .1); display: flex; flex-wrap: wrap; gap: 6px 16px; font: 400 10px/1.4 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: rgba(244, 239, 230, .38); }

.ld-pct { position: absolute; right: calc(36px + var(--safe-r)); bottom: calc(22px + var(--safe-b)); display: flex; align-items: flex-start; font: 300 clamp(70px, 11vw, 132px)/.85 var(--serif); letter-spacing: -.02em; font-variant-numeric: lining-nums tabular-nums; color: #e7cf9e; animation: ldFade 1.2s .9s both; }
.ld-pct small { font-size: .3em; margin: .2em 0 0 .08em; color: var(--gold-2); }
.ld-foot { position: absolute; left: 50%; bottom: calc(30px + var(--safe-b)); transform: translateX(-50%); display: flex; align-items: center; gap: 12px; white-space: nowrap; font: 400 10.5px/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: rgba(244, 239, 230, .5); animation: ldFade 1.2s 1.4s both; }
.ld-foot img { height: 15px; width: auto; }
@keyframes ldFade { from { opacity: 0; transform: translateY(8px); } }
@keyframes ldRise { from { opacity: 0; transform: scale(.86); filter: blur(10px); } }

@media (min-width: 761px) and (max-width: 1280px) {
  .ld-center { width: 480px; }
  .ld-steps { width: 262px; }
  .ld-steps li { font-size: 10.5px; gap: 9px; }
  .ld-specs { display: none; }
}
@media (min-width: 761px) and (max-height: 820px) {
  .ld-center { top: 45%; }
  .ld-emblem { width: clamp(120px, 19vmin, 180px); }
}
@media (max-width: 1100px) {
  .ld-top .ld-brand { visibility: hidden; }
  .ld-foot { left: calc(36px + var(--safe-l)); transform: none; bottom: auto; top: calc(58px + var(--safe-t)); animation-name: ldFadeNoMove; }
}
@keyframes ldFadeNoMove { from { opacity: 0; } }
@media (max-width: 760px), (max-height: 560px) {
  .ld-top { top: calc(18px + var(--safe-t)); left: 18px; right: 18px; }
  .ld-brand { height: 15px; }
  .ld-meta span:last-child { display: none; }
  .ld-center { top: 45%; }
  .ld-steps { left: 18px; right: 18px; width: auto; bottom: calc(18px + var(--safe-b)); }
  .ld-steps ol { gap: 6px; }
  .ld-steps li { font-size: 10.5px; }
  .ld-specs { display: none; }
  .ld-pct { right: 18px; bottom: auto; top: calc(44px + var(--safe-t)); font-size: 46px; }
  .ld-foot { left: 18px; top: calc(46px + var(--safe-t)); font-size: 9px; gap: 7px; letter-spacing: .12em; flex-wrap: wrap; white-space: normal; max-width: 64vw; }
  .ld-foot img { height: 11px; }
  .ld-cta { min-height: 96px; }
}
@media (max-height: 560px) and (orientation: landscape) {
  .ld-steps { display: none; }
  .ld-center { top: 55%; }
  .ld-emblem { width: 104px; margin-bottom: 8px; }
  .ld-title { font-size: 40px; margin: 6px 0 2px; }
  .ld-cta { margin-top: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  #loader *, #loader *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* HUD oculto durante la carga y la introducción */
#topbar, #mapbox, #crosshair, #label, #credit, .joy, #aerialbar { transition: opacity .9s ease; }
body[data-mode="loading"] :is(#topbar, #mapbox, #crosshair, #label, #credit, .joy),
body[data-mode="intro"] :is(#topbar, #mapbox, #crosshair, #label, #credit, .joy) { opacity: 0; pointer-events: none; }
#skip { position: fixed; z-index: 30; right: calc(18px + var(--safe-r)); bottom: calc(18px + var(--safe-b)); padding: 11px 18px; border-radius: 999px; border: 1px solid rgba(244, 239, 230, .25); background: rgba(14, 13, 10, .45); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); font: 500 10.5px/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--ink); opacity: 0; pointer-events: none; transition: opacity .6s; }
body[data-mode="intro"] #skip { opacity: 1; pointer-events: auto; }
#intro-title { position: fixed; z-index: 25; left: 50%; bottom: 13vh; transform: translateX(-50%); text-align: center; pointer-events: none; opacity: 0; transition: opacity 1.2s; text-shadow: 0 2px 30px rgba(0, 0, 0, .55); }
#intro-title p { margin: 0 0 8px; font: 500 10.5px/1 var(--sans); letter-spacing: .34em; text-transform: uppercase; color: var(--gold-2); }
#intro-title h2 { margin: 0; font: 300 clamp(34px, 6vw, 64px)/1 var(--serif); letter-spacing: .08em; color: #fbf3e3; }
body[data-mode="intro"] #intro-title.show { opacity: 1; }
body::before, body::after { content: ""; position: fixed; left: 0; right: 0; height: 0; z-index: 24; pointer-events: none; background: #050504; transition: height 1.1s cubic-bezier(.7, 0, .2, 1); }
body::before { top: 0; }
body::after { bottom: 0; }
body[data-mode="intro"]::before, body[data-mode="intro"]::after { height: 8vh; }
body[data-mode="intro"] #skip { bottom: calc(8vh + 14px); }
#intro-title { bottom: calc(8vh + 70px); }

/* Créditos LUM360 en el recorrido */
#credit { position: fixed; z-index: 6; right: calc(12px + var(--safe-r)); bottom: calc(12px + var(--safe-b)); display: flex; align-items: center; gap: 9px; padding: 8px 14px; border-radius: 999px; background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: var(--ink-2); text-decoration: none; font: 400 9.5px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; }
#credit img { height: 11px; width: auto; }
#credit:hover { color: var(--ink); }
@media (max-width: 980px) { #credit .for { display: none; } }
body.touch #credit { right: 50%; transform: translateX(50%); bottom: auto; top: calc(58px + var(--safe-t)); padding: 6px 11px; }
body.touch #credit .for, body.touch #credit span:first-child { display: none; }
.panel-credit { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.panel-credit img { height: 13px; width: auto; }
.panel-credit p { margin: 0; font-size: 11px; color: var(--ink-2); line-height: 1.4; }

/* ---------- Barra superior ---------- */
#topbar {
  position: fixed; z-index: 10; top: calc(10px + var(--safe-t)); left: calc(12px + var(--safe-l)); right: calc(12px + var(--safe-r));
  display: flex; justify-content: space-between; align-items: center; gap: 8px; pointer-events: none;
}
.brand { display: flex; flex-direction: column; padding: 8px 14px; border-radius: 12px; background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); pointer-events: auto; }
.brand b { font: 400 19px/1.05 var(--serif); letter-spacing: .06em; }
.brand span { font-size: 11px; color: var(--ink-2); letter-spacing: .08em; }
#topbar nav { display: flex; gap: 6px; pointer-events: auto; }
#topbar nav button {
  display: flex; align-items: center; gap: 7px; height: 40px; padding: 0 13px; border-radius: 12px;
  background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-size: 13px;
}
#topbar nav button:hover { background: var(--glass-2); }
#topbar svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
.lbl-walk { display: none; }
body[data-mode="aerial"] .lbl-aerial { display: none; }
body[data-mode="aerial"] .lbl-walk { display: inline; }

/* ---------- Paneles ---------- */
.panel {
  position: fixed; z-index: 20; top: calc(62px + var(--safe-t)); right: calc(12px + var(--safe-r)); width: min(300px, calc(100vw - 24px));
  max-height: calc(100dvh - 90px); overflow: auto; padding: 14px; border-radius: 16px; background: var(--glass-2);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line);
  opacity: 0; transform: translateY(-6px); visibility: hidden; transition: .18s ease;
}
.panel.open { opacity: 1; transform: none; visibility: visible; }
.panel header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.panel h2 { margin: 0; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; font-weight: 500; color: var(--accent); }
.panel .close { font-size: 22px; line-height: 1; width: 30px; height: 30px; border-radius: 8px; }
.panel ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.panel li button { width: 100%; text-align: left; padding: 10px 12px; border-radius: 10px; font-size: 14px; }
.panel li button:hover, .panel li button.on { background: rgba(200, 160, 106, .18); }
.panel li button.on { color: var(--accent); }
.panel .note { font-size: 12px; color: var(--ink-2); line-height: 1.5; margin: 10px 2px 0; }
.panel .sub { font-size: 12px; color: var(--ink-2); margin: 12px 2px 6px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 3px; border-radius: 10px; background: rgba(255, 255, 255, .06); }
.seg button { padding: 8px; border-radius: 8px; font-size: 13px; }
.seg button.on { background: var(--accent); color: #14130f; }
.panel input[type=range] { width: 100%; accent-color: var(--accent); }
.panel .wide { width: 100%; margin-top: 14px; padding: 10px; border-radius: 10px; border: 1px solid var(--line); font-size: 13px; }
.panel dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 4px 2px; font-size: 13px; }
.panel dt { color: var(--accent); }
.panel dd { margin: 0; color: var(--ink-2); }

/* ---------- HUD ---------- */
#crosshair { position: fixed; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: rgba(255, 255, 255, .8); box-shadow: 0 0 0 1.5px rgba(0, 0, 0, .25); pointer-events: none; z-index: 5; }
#label {
  position: fixed; left: 50%; top: calc(50% + 18px); transform: translateX(-50%); z-index: 5; max-width: min(520px, 86vw);
  padding: 6px 12px; border-radius: 999px; background: var(--glass); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-size: 12px; letter-spacing: .02em; text-align: center; opacity: 0; transition: opacity .25s; pointer-events: none;
}
#label.show { opacity: 1; }
body[data-mode="aerial"] #crosshair, body[data-mode="aerial"] #label { display: none; }

#mapbox {
  position: fixed; z-index: 8; left: calc(12px + var(--safe-l)); bottom: calc(12px + var(--safe-b)); width: 210px; aspect-ratio: 300 / 277;
  border-radius: 14px; overflow: hidden; background: rgba(250, 248, 244, .92); box-shadow: 0 8px 30px rgba(0, 0, 0, .35); transition: width .25s;
}
#minimap { width: 100%; height: 100%; display: block; cursor: crosshair; }
#btn-map { position: absolute; right: 6px; top: 6px; width: 26px; height: 26px; border-radius: 8px; background: rgba(20, 19, 15, .7) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 10V4h6M20 14v6h-6' fill='none' stroke='%23f4efe6' stroke-width='2'/%3E%3C/svg%3E") center/16px no-repeat; }
#mapbox .north { position: absolute; left: 8px; top: 6px; font-size: 11px; font-weight: 700; color: #14130f; }
body.map-big #mapbox { width: min(560px, 80vw, 70dvh); }

#aerialbar { position: fixed; z-index: 9; bottom: calc(18px + var(--safe-b)); left: 50%; transform: translateX(-50%); display: none; gap: 8px; }
body[data-mode="aerial"] #aerialbar { display: flex; }
#aerialbar button { padding: 11px 18px; border-radius: 999px; background: var(--glass-2); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-size: 13px; border: 1px solid var(--line); }
#aerialbar button.on { background: var(--accent); color: #14130f; }

#disclaimer { position: fixed; z-index: 4; right: calc(12px + var(--safe-r)); bottom: calc(8px + var(--safe-b)); margin: 0; font-size: 10px; letter-spacing: .06em; color: rgba(255, 255, 255, .55); text-shadow: 0 1px 2px rgba(0, 0, 0, .5); pointer-events: none; }
#fps { position: fixed; z-index: 30; left: 50%; top: calc(10px + var(--safe-t)); transform: translateX(-50%); font: 11px ui-monospace, monospace; color: #fff; text-shadow: 0 1px 2px #000; }

/* ---------- Joysticks ---------- */
.joy { display: none; position: fixed; z-index: 7; bottom: calc(24px + var(--safe-b)); width: 132px; height: 132px; border-radius: 50%; background: rgba(20, 19, 15, .28); border: 1.5px solid rgba(255, 255, 255, .35); touch-action: none; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.joy .knob { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; border-radius: 50%; transform: translate(-50%, -50%); background: rgba(244, 239, 230, .85); box-shadow: 0 4px 14px rgba(0, 0, 0, .3); }
.joy.active { background: rgba(20, 19, 15, .42); }
#joy-move { left: calc(28px + var(--safe-l)); }
#joy-look { right: calc(28px + var(--safe-r)); }
body.touch[data-mode="walk"] .joy { display: block; }
body.touch #mapbox { width: 128px; bottom: auto; top: calc(66px + var(--safe-t)); }
body.touch.map-big #mapbox { width: min(420px, 86vw, 60dvh); }

@media (max-width: 760px) {
  #topbar nav button span { display: none; }
  #topbar nav button { width: 40px; padding: 0; justify-content: center; }
  .brand { padding: 6px 10px; }
  .brand b { font-size: 13px; }
}
@media (max-width: 520px) {
  .brand span { display: none; }
  .brand { padding: 0 10px; height: 36px; justify-content: center; }
  .brand b { font-size: 12px; white-space: nowrap; }
  #topbar { gap: 6px; }
  #topbar nav { gap: 4px; }
  #topbar nav button { width: 36px; height: 36px; border-radius: 10px; }
  body.touch #mapbox { top: calc(56px + var(--safe-t)); width: 112px; }
}
@media (max-height: 460px) {
  .joy { width: 112px; height: 112px; bottom: calc(14px + var(--safe-b)); }
  .joy .knob { width: 48px; height: 48px; }
}
