:root {
  color-scheme: dark;
  --text: #f7f5f0;
  --quiet: #b6b8bd;
  --faint: #878d98;
  --panel: #161923;
  --line: #ffffff22;
  --red: #f44f4d;
  --amber: #ffc46e;
  --display: "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-family: var(--body);
}

@font-face {
  font-family: "Barlow Condensed";
  src: url("./assets/fonts/barlow-condensed-800.woff2") format("woff2");
  font-style: normal;
  font-weight: 800;
  font-display: swap;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: #10131a; color: var(--text); }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, canvas:focus-visible { outline: 2px solid var(--amber); outline-offset: 4px; }
button:disabled { cursor: wait; }
a { color: #ebd4ad; text-underline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.game { height: 100dvh; min-height: 350px; overflow: hidden; position: relative; isolation: isolate; background: #131823 url("./assets/shop/shop/shopfront.jpg") center / cover; }
.view { display: block; width: 100%; height: 100%; position: absolute; inset: 0; outline: 0; touch-action: none; }
.is-playing .view { cursor: grab; }
.is-playing .view:active { cursor: grabbing; }
.is-locked .view { cursor: none; }
.scene-shade { pointer-events: none; position: absolute; inset: 0; background: linear-gradient(180deg, #0b0d14a0 0, transparent 20%, transparent 85%, #0b0d14ce 100%); transition: background .2s ease; }
.is-intro .scene-shade {
  background:
    linear-gradient(90deg, #0b0c14f5 0%, #0b0c14e8 14%, #10101ad6 28%, #10101a63 48%, transparent 74%),
    linear-gradient(180deg, #0b0d1499 0, transparent 22%, transparent 69%, #0b0d14d9 100%);
}
.topbar { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.3rem 2.2rem; z-index: 3; }
.brand { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.brand img { display: block; border-radius: 12px; border: 1px solid #ff716b50; }
.brand strong { display: block; font-size: .88rem; line-height: 1.3; letter-spacing: .1em; }
.brand span { display: block; color: #d2d2d5; margin-top: .17rem; font-size: .78rem; }
.top-actions { display: flex; align-items: center; gap: .42rem; }
.top-actions button, .secondary-button, .gallery-filters button {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  background: #10131be8; border: 1px solid var(--line); border-radius: 7px;
  padding: .65rem .9rem; font-size: .86rem; min-height: 2.55rem;
}
.top-actions button:hover, .secondary-button:hover, .gallery-filters button:hover { background: #282c38; border-color: #ffffff45; }
.nav-icon { display: inline-block; flex: 0 0 .85rem; height: .78rem; color: #ffc46e; position: relative; }
.map-icon { border: 1px solid; border-radius: 2px; transform: skewY(-11deg); }
.map-icon::before { content: ""; position: absolute; inset: -1px 32%; border-inline: 1px solid; }
.photo-icon { border: 1px solid; border-radius: 2px; }
.photo-icon::before { content: ""; position: absolute; width: 5px; height: 5px; border: 1px solid; border-bottom: 0; border-right: 0; left: 3px; bottom: 0; transform: rotate(45deg); }
.time-icon { border: 1px solid; border-radius: 50%; height: .85rem; background: linear-gradient(90deg, currentColor 50%, transparent 50%); }
.intro { position: absolute; left: clamp(1.55rem, 5.5vw, 6rem); top: 49%; transform: translateY(-44%); width: min(29rem, 47vw); z-index: 2; }
.place-line, .eyebrow { font: 700 .76rem/1.5 var(--body); letter-spacing: .2em; color: var(--amber); margin: 0; }
.place-line { display: flex; gap: .7rem; align-items: center; }
.place-line span { width: 1.7rem; height: 2px; background: var(--red); }
.intro h1 { font: 800 clamp(4.25rem, 8.5vw, 8.8rem)/.8 var(--display); letter-spacing: -.025em; margin: .65rem 0 1.3rem -.04em; text-shadow: 0 6px 32px #0007; white-space: nowrap; }
.intro > p:not(.intro-controls) { font-size: clamp(1rem, 1.25vw, 1.12rem); line-height: 1.56; color: #dbd9d7; max-width: 24rem; margin: 0 0 1.45rem; }
.play-button { border: 1px solid #ff7873; background: #e23a3c; color: #fff; font-size: 1rem; font-weight: 750; padding: .82rem 1.25rem; border-radius: 7px; display: inline-flex; gap: .72rem; align-items: center; min-height: 3rem; box-shadow: 0 5px 30px #d43a3c29; }
.play-button:hover:not(:disabled) { background: #f04c49; }
.play-button:disabled { opacity: .72; }
.play-icon { width: 0; height: 0; border-block: .37rem solid transparent; border-left: .57rem solid white; }
.intro-controls { margin: .8rem 0 0; color: var(--quiet); font-size: .76rem; }

.hud-map { position: absolute; right: 2.2rem; bottom: 4rem; width: clamp(192px, 17vw, 246px); font-size: .68rem; z-index: 2; }
.hud-map button { width: 100%; border: 1px solid #ffffff32; background: #151821ee; border-radius: 10px; padding: 0; display: block; overflow: hidden; text-align: left; box-shadow: 0 10px 38px #0005; }
.hud-map button:hover { border-color: #ffc46e74; }
.hud-map-header, .hud-map-caption { display: flex; align-items: center; justify-content: space-between; padding: .62rem .69rem; }
.hud-map-header { color: #dbd8d3; font-size: .69rem; font-weight: 700; letter-spacing: .14em; }
.expand-icon { display: inline-block; width: .65rem; height: .65rem; border: 1px solid #a8a9a5; opacity: .75; }
.hud-map-caption { justify-content: flex-start; gap: .44rem; font-size: .78rem; font-weight: 630; border-top: 1px solid #ffffff13; }
.location-dot, .footer-place > span:first-child { display: block; width: .42rem; height: .42rem; border-radius: 50%; background: var(--red); box-shadow: 0 0 8px #f44f4d8a; }
.hud-map canvas { display: block; width: 100%; aspect-ratio: 440 / 346; background: #191d27; }
.hud-map > a { color: #cbcbd0; display: inline-block; margin-top: .42rem; font-size: .66rem; }
.game-footer { position: absolute; inset: auto 0 0; padding: .72rem 2.2rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; pointer-events: none; color: #d0d2d9; font-size: .77rem; }
.footer-place, .keyboard-controls, .compass { display: flex; align-items: center; gap: .6rem; }
.footer-place { letter-spacing: .11em; font-weight: 650; font-size: .68rem; }
.keyboard-controls { gap: .3rem; }
.keyboard-controls > span { margin-right: .6rem; }
.compass { font-weight: 650; font-variant-numeric: tabular-nums; }
.compass span:first-child { color: var(--amber); }
kbd { font: 650 .75rem var(--body); border: 1px solid #ffffff45; background: #0d111ad1; border-radius: 4px; padding: .2rem .38rem; min-width: 1.38rem; text-align: center; color: #fff; }
.crosshair { position: absolute; top: 50%; left: 50%; width: 5px; height: 5px; margin: -2.5px; border-radius: 50%; border: 1px solid #fff; background: #fff7; box-shadow: 0 0 3px #000; pointer-events: none; opacity: 0; }
.is-playing .crosshair { opacity: .85; }
.world-label { position: absolute; transform: translate(-50%, -100%); background: #11141deb; border: 1px solid #ffffff30; pointer-events: none; border-radius: 5px; padding: .35rem .55rem; color: #ffdfa9; font-size: .76rem; white-space: nowrap; }
.interact-prompt { position: absolute; bottom: 5rem; left: 50%; transform: translateX(-50%); background: #121521ed; border: 1px solid var(--line); border-radius: 7px; padding: .55rem .78rem; display: flex; align-items: center; gap: .55rem; font-size: .91rem; z-index: 3; white-space: nowrap; }
.interact-prompt:hover { border-color: var(--amber); }
.pause { z-index: 5; position: absolute; inset: 0; display: grid; place-items: center; background: #0e1017a6; backdrop-filter: blur(5px); }
.pause-card { width: min(90vw, 28rem); background: #171a24; border: 1px solid var(--line); border-radius: 14px; padding: 1.5rem; box-shadow: 0 24px 70px #0008; }
.pause-card h2, .panel h2 { font: 800 clamp(2.35rem, 4.2vw, 3.6rem)/.95 var(--display); margin: 0; }
.pause-card p { color: var(--quiet); line-height: 1.5; margin: .8rem 0 1.2rem; }
.pause-card .secondary-button { margin-top: .65rem; display: flex; }
.toast { position: absolute; left: 50%; top: 5.6rem; transform: translateX(-50%); padding: .6rem .85rem; border: 1px solid var(--line); background: #101521f0; border-radius: 7px; z-index: 6; font-size: .88rem; width: max-content; max-width: 86vw; text-align: center; }
.touch-controls { display: none; }

.panel { width: min(92vw, 950px); max-height: 90dvh; margin: auto; border: 1px solid #ffffff29; border-radius: 14px; background: var(--panel); color: var(--text); padding: 1.2rem 1.4rem; box-shadow: 0 20px 90px #0008; }
.panel::backdrop { background: #080b12ab; backdrop-filter: blur(6px); }
.panel-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.1rem; }
.panel h2 { margin-top: .25rem; }
.close-button { display: grid; place-items: center; flex-shrink: 0; width: 2.4rem; height: 2.4rem; font-size: 1.55rem; line-height: 1; background: #ffffff10; border: 1px solid var(--line); border-radius: 6px; }
.close-button:hover { background: #ffffff24; }
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(13rem, 16rem); gap: 1.05rem; }
#full-map { width: 100%; display: block; border-radius: 8px; background: #1d212b; border: 1px solid var(--line); }
.map-details h3 { margin: .18rem 0 .65rem; font-size: 1rem; }
.location-button { width: 100%; padding: .58rem .72rem; display: flex; align-items: center; gap: .65rem; text-align: left; margin-bottom: .4rem; background: #202430; border: 1px solid #ffffff14; border-radius: 6px; }
.location-button:hover { background: #2b2f3d; border-color: #ffffff38; }
.location-button strong, .location-button small { display: block; }
.location-button strong { font-size: .92rem; }
.location-button small { color: var(--quiet); margin-top: .11rem; font-size: .76rem; }
.marker-symbol { flex: 0 0 .68rem; width: .68rem; height: .68rem; border-radius: 50%; background: var(--red); }
.indoor-marker { background: #94a7ff; border-radius: 2px; }
.gate-marker { background: var(--amber); transform: rotate(45deg); border-radius: 2px; }
#route-button { width: 100%; margin-top: .32rem; }
#route-button[aria-pressed="true"], .gallery-filters button[aria-pressed="true"] { border-color: #ffc46e80; color: var(--amber); background: #34291f; }
.map-legend { display: flex; flex-wrap: wrap; gap: .6rem .85rem; margin-top: .85rem; color: var(--quiet); font-size: .76rem; }
.map-legend span { display: flex; align-items: center; gap: .35rem; }
.map-legend i { width: .64rem; height: .64rem; display: inline-block; }
.legend-player { border-radius: 50%; background: #fff; }
.legend-area { border: 1px dashed #f66b66; }
.legend-rail { border-bottom: 2px dashed #ffc46e; }
.source-note { margin: .88rem 0 0; font-size: .77rem; line-height: 1.55; color: var(--quiet); }
.gallery-filters { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: .9rem; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(134px, 1fr)); gap: .65rem; }
.photo-card { padding: 0; min-width: 0; display: flex; flex-direction: column; text-align: left; overflow: hidden; border: 1px solid var(--line); background: #222633; border-radius: 7px; }
.photo-card:hover { border-color: var(--amber); }
.photo-card img { width: 100%; height: 7.3rem; display: block; object-fit: contain; background: #10131b; }
.photo-card span { font-size: .78rem; padding: .5rem .56rem; }
.photo-detail { margin: 0; display: grid; justify-items: start; gap: .75rem; }
.photo-detail img { width: 100%; max-height: 56dvh; object-fit: contain; background: #0e111a; border-radius: 7px; }
.photo-detail figcaption { color: var(--quiet); font-size: .91rem; }

@media (pointer: coarse) {
  .keyboard-controls { display: none; }
  .is-playing .touch-controls { display: contents; }
  .move-pad { position: absolute; left: 1.3rem; bottom: 3.5rem; width: 7.4rem; height: 7.4rem; border-radius: 50%; border: 1px solid #ffffff66; background: #14182255; touch-action: none; z-index: 3; display: grid; place-items: center; }
  .move-pad span { pointer-events: none; width: 2.7rem; height: 2.7rem; border: 1px solid #ffffffb3; border-radius: 50%; background: #222634aa; }
  #touch-pause { position: absolute; right: 1.3rem; bottom: 3.55rem; width: 2.65rem; height: 2.65rem; border: 1px solid var(--line); background: #141823da; border-radius: 7px; z-index: 3; }
  .is-playing .hud-map { top: 4.5rem; bottom: auto; width: min(34vw, 160px); }
  .interact-prompt { bottom: 11.2rem; }
  .interact-prompt kbd { display: none; }
}

@media (max-width: 760px) {
  .topbar { padding: .9rem 1rem; }
  .brand { gap: .45rem; }
  .brand img { width: 35px; height: 35px; border-radius: 8px; }
  .brand strong { font-size: .67rem; letter-spacing: .075em; }
  .brand span { font-size: .7rem; }
  .top-actions { gap: .25rem; }
  .top-actions button { padding: .45rem .55rem; font-size: .76rem; min-height: 2.23rem; }
  .top-actions .nav-icon { display: none; }
  .intro { left: 1.3rem; width: min(25rem, 84vw); top: auto; bottom: 12%; transform: none; }
  .intro h1 { font-size: clamp(3.8rem, 12vw, 5.75rem); margin-bottom: .85rem; }
  .intro > p:not(.intro-controls) { max-width: 18.5rem; }
  .is-intro .hud-map { display: none; }
  .is-intro .scene-shade { background: linear-gradient(0deg, #0b0d14 0%, #0b0d14db 32%, #0b0d1426 75%), linear-gradient(180deg, #0b0d14b5, transparent 23%); }
  .hud-map { right: 1rem; width: min(34vw, 160px); }
  .hud-map-header { font-size: .56rem; padding: .46rem .51rem; }
  .hud-map-caption { font-size: .66rem; padding: .45rem .51rem; }
  .hud-map > a { font-size: .57rem; }
  .game-footer { padding: .65rem 1rem; }
  .keyboard-controls { display: none; }
  .panel { padding: 1rem; }
  .map-layout { grid-template-columns: 1fr; gap: .75rem; }
  #full-map { max-height: 43dvh; object-fit: contain; }
  .map-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: .4rem; }
  .map-details h3, .map-legend { grid-column: 1 / -1; }
  .map-details h3 { margin: .1rem 0; }
  .location-button, #route-button { height: 100%; margin: 0; }
  .map-legend { margin: .25rem 0; }
}

@media (max-height: 580px) and (min-width: 761px) {
  .intro { transform: translateY(-44%); }
  .intro h1 { font-size: clamp(3.5rem, 12vh, 5.5rem); }
  .hud-map { width: 165px; bottom: 2.9rem; }
  .topbar { padding-block: .8rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
}
