:root {
  color-scheme: dark;
  --gold: #e1c692;
  --ivory: #f4eee0;
  --serif: "Noto Serif CJK TC", "Songti TC", "PMingLiU", Georgia, serif;
  --sans: "Noto Sans CJK TC", "Microsoft JhengHei", Arial, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --gutter: clamp(20px, 3.35vw, 80px);
  --edge-l: max(var(--gutter), calc(var(--safe-l) + 8px));
  --edge-r: max(var(--gutter), calc(var(--safe-r) + 8px));
  --mast-top: max(22px, calc(var(--safe-t) + 5px));
  --mast-height: 44px;
  --rail: 78px;
  --dock-height: calc(var(--rail) + var(--safe-b));
  --plan-top: calc(var(--mast-top) + var(--mast-height) + 12px);
  font-family: var(--sans);
  color: var(--ivory);
  background: #25231f;
}
* { box-sizing: border-box; }
html, body, #atlas { width: 100%; height: 100%; margin: 0; overflow: hidden; }
html, body { overscroll-behavior: none; }
#atlas { position: relative; height: 100dvh; isolation: isolate; background: #302e2a; }
button, select { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:focus-visible, select:focus-visible, .guideScroll:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
#world { width: 100%; height: 100%; display: block; outline: 0; touch-action: none; }
.shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, #13141394, transparent 14%, transparent 61%, #10121126 72%, #101210bd); }
.mast { position: absolute; top: var(--mast-top); left: var(--edge-l); right: var(--edge-r); display: flex; align-items: center; justify-content: space-between; gap: 10px; pointer-events: none; }
.imprint { display: flex; align-items: center; gap: 12px; text-shadow: 0 1px 5px #17151088; white-space: nowrap; }
.imprint .seal { width: 44px; height: 44px; stroke-width: 1.45; color: var(--gold); }
.imprint strong { display: block; font: 500 18px Georgia, serif; letter-spacing: 4.1px; }
.imprint span { display: block; font-size: 10px; margin-top: 2px; letter-spacing: 1.9px; color: #f2e6cc; }
.tools { pointer-events: auto; display: flex; align-items: center; gap: 7px; }
.tools button, .square { display: inline-flex; gap: 8px; align-items: center; justify-content: center; background: #20221eb8; border: 1px solid #ddcfb630; border-radius: 4px; height: 36px; padding: 0 12px; font-size: 13px; backdrop-filter: blur(8px); }
.tools .square, .square { width: 36px; padding: 0; }
.tools svg, .square svg { width: 17px; height: 17px; }
@media (hover: hover) { .tools button:hover, .square:hover { background: #393b32; } }
.caption { position: absolute; left: var(--edge-l); right: var(--edge-r); bottom: calc(var(--dock-height) + clamp(22px, 4vh, 55px)); pointer-events: none; text-shadow: 0 2px 14px #161410a0; }
.eyebrow { display: flex; align-items: center; gap: 10px; color: #eed8aa; font: 600 10px/1.5 Arial, sans-serif; letter-spacing: 2.4px; }
.eyebrow i { width: 32px; height: 1px; background: #dcc28c; }
.caption h1 { font: 500 clamp(38px, 3.85vw, 72px)/1.36 var(--serif); margin: 8px 0 3px; letter-spacing: .07em; }
.caption [lang=en] { font: italic clamp(18px, 1.62vw, 30px)/1.4 Georgia, "Times New Roman", serif; letter-spacing: .015em; color: #f0dfc2; }
.locator { position: absolute; right: var(--edge-r); bottom: calc(var(--dock-height) + clamp(22px, 4vh, 52px)); display: flex; align-items: center; gap: 7px; font-size: 12px; letter-spacing: .07em; text-shadow: 0 1px 5px #181915; pointer-events: none; }
.locator svg { width: 15px; height: 15px; color: var(--gold); }
.locator i { width: 1px; height: 12px; background: #d7c5a580; margin: 0 4px; }
#atlas:not([data-mode=orbit]) .caption h1 { font-size: clamp(24px, 2.25vw, 42px); }
#atlas:not([data-mode=orbit]) .caption [lang=en] { font-size: 16px; }
#atlas:not([data-mode=orbit]) .shade { background: linear-gradient(180deg,#17191673, transparent 12%, transparent 77%, #17191670); }
.dock { position: absolute; inset: auto 0 0; height: var(--dock-height); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 var(--edge-r) var(--safe-b) var(--edge-l); background: #1b1d19f2; border-top: 1px solid #d6c4a43d; }
.modeSet { display: flex; gap: 6px; }
.modeSet button { display: flex; align-items: center; justify-content: center; gap: 10px; height: 42px; padding: 0 18px; border: 1px solid transparent; border-radius: 3px; background: transparent; color: #dedbd1; white-space: nowrap; font-size: 14px; letter-spacing: .075em; }
.modeSet svg { flex: none; width: 19px; height: 19px; }
.modeSet button[aria-pressed=true] { background: #e1c99e; border-color: #eddbb8; color: #292921; }
@media (hover: hover) { .modeSet button[aria-pressed=false]:hover { background: #ffffff0e; } }
.hint { display: flex; flex-shrink: 0; align-items: center; justify-content: center; gap: 8px; color: #c6c4b8; font-size: 12px; line-height: 1.3; letter-spacing: .04em; }
.hint svg { width: 16px; height: 16px; }
.touchHint { display: none; }
#joystick { position: absolute; z-index: 2; left: var(--edge-l); bottom: calc(var(--dock-height) + clamp(12px, 2.6vh, 26px)); width: 92px; height: 92px; border: 1px solid #e4cea282; border-radius: 50%; background: radial-gradient(circle, #161b1777 0 53%, #cbb08b29 54% 55%, #161b176e 56%); box-shadow: 0 2px 9px #14150f40; backdrop-filter: blur(3px); touch-action: none; user-select: none; -webkit-user-select: none; }
.joystick-lever { position: absolute; top: 50%; left: 50%; width: 34px; height: 34px; border: 1px solid #f2dec0b8; border-radius: 50%; background: #d3b68bac; pointer-events: none; transform: translate(calc(-50% + var(--stick-x, 0px)), calc(-50% + var(--stick-y, 0px))); }
.load { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; padding: var(--safe-t) var(--edge-r) var(--safe-b) var(--edge-l); z-index: 9; background: linear-gradient(180deg,#171a1652,#151812a8 60%,#111410d9), url('../assets/plaza-loading.webp') center/cover no-repeat; background-color: #282921; font: 24px var(--serif); letter-spacing: .14em; }
.load>svg { width: 60px; height: 60px; color: var(--gold); stroke-width: 1.2; }
.load small { max-width: min(50ch, 100%); color: #d7cbb4; font: 12px/1.6 var(--sans); letter-spacing: .09em; text-align: center; overflow-wrap: anywhere; }
.load .meter { width: min(200px, 65vw); height: 2px; background: #726956; }
.meter i { display: block; height: 100%; width: 2%; background: #ebcb96; transition: width .15s; }
.load.error .meter { display: none; }
dialog, #plan { color: var(--ivory); background: #20231ff5; border: 1px solid #b2996c66; border-radius: 5px; box-shadow: 0 14px 64px #0005; }
#plan { z-index: 3; position: absolute; display: flex; flex-direction: column; gap: 5px; top: var(--plan-top); right: var(--edge-r); width: 190px; max-height: calc(100% - var(--plan-top) - var(--dock-height) - 10px); padding: 14px 16px; overflow: auto; overscroll-behavior: contain; }
.planHead strong { display: block; font: 17px var(--serif); }
.planHead span, .dialogHead span { color: var(--gold); font: 10px/1.4 Arial,sans-serif; letter-spacing: .18em; }
.planHead span { font-size: 9px; }
#plan>svg { display: block; flex: 1 1 auto; width: 100%; height: 170px; min-height: 32px; color: #d5c297; stroke-width: 1.2; }
#you { fill: #efcf83; stroke: #282c23; stroke-width: 1; }
#planLegend { color: #e8d9b6; font-size: 11px; }
#guideDialog { width: min(430px, calc(100% - var(--safe-l) - var(--safe-r) - 28px)); max-height: calc(100% - var(--safe-t) - var(--safe-b) - 24px); max-height: calc(100dvh - var(--safe-t) - var(--safe-b) - 24px); padding: 0; inset: var(--safe-t) var(--safe-r) var(--safe-b) var(--safe-l); margin: auto; overflow: hidden; }
#guideDialog[open] { display: flex; flex-direction: column; }
dialog::backdrop { background: #0d110ea8; backdrop-filter: blur(3px); }
.dialogHead { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 26px 12px; }
.dialogHead h2 { margin: 4px 0 0; font: 28px/1.2 var(--serif); }
.guideScroll { min-height: 0; padding: 0 26px 24px; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #877b63 transparent; }
.guideScroll:focus-visible { outline-offset: -3px; }
dl { margin: 0; }
dt { margin-top: 13px; color: var(--gold); font-size: 14px; }
dd { margin: 3px 0 0; color: #e0e0d6; font-size: 14px; line-height: 1.65; }
kbd { padding: 1px 4px; border: 1px solid #988a6d66; border-radius: 3px; background: #363a33; font: 12px monospace; }
.quality { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding: 14px 0; border-top: 1px solid #c9ba9a38; font-size: 14px; }
.quality label { color: var(--gold); }
.quality select { padding: 6px 10px; border: 1px solid #b0996d6b; border-radius: 3px; background: #30352c; color: #f1e7d2; }
.hideTip { color: #c9c5b9; font-size: 12px; }
[hidden], .tools button[hidden], #plan[hidden], #joystick[hidden] { display: none !important; }
.capture :is(.mast,.dock,.locator,#plan,.shade,.caption,[data-joystick]) { display: none !important; }

@media (max-width: 760px) {
  :root { --gutter: 16px; --mast-top: max(14px, calc(var(--safe-t) + 4px)); --rail: 62px; }
  .imprint { gap: 8px; }
  .imprint .seal { width: 35px; height: 35px; }
  .imprint strong { font-size: 15px; letter-spacing: 3px; }
  .imprint span { margin-top: 1px; font-size: 9px; }
  .tools { gap: 4px; }
  .tools button span { display: none; }
  .tools button, .tools .square { width: 36px; padding: 0; }
  .dock { justify-content: center; }
  .modeSet { gap: 3px; }
  .modeSet button { gap: 6px; padding: 0 11px; font-size: 13px; }
  .modeSet svg { width: 17px; height: 17px; }
  .hint { display: none; }
  .caption h1 { font-size: clamp(27px, 8vw, 39px); margin: 5px 0 1px; }
  .caption [lang=en] { font-size: clamp(16px, 4.3vw, 20px); }
  .eyebrow { font-size: 8px; letter-spacing: 1.5px; }
  .locator { display: none; }
  .shade { background: linear-gradient(180deg,#15171180, transparent 16%, transparent 58%, #12140fbb); }
  #plan { width: 160px; padding: 11px 13px; }
}
@media (any-pointer: coarse) {
  .tools button, .tools .square, .square { min-width: 44px; min-height: 44px; }
  .modeSet button, .quality select { min-height: 44px; }
  .desktopHint { display: none; }
  .touchHint { display: inline; }
  #atlas[data-mode=orbit] .walkHint, #atlas:not([data-mode=orbit]) .orbitHint { display: none; }
  .hint { display: flex; }
  #atlas:not([data-mode=orbit]) .caption { display: none; }
  #atlas:not([data-mode=orbit]) .locator { display: flex; top: var(--plan-top); right: auto; bottom: auto; left: var(--edge-l); padding: 5px 8px; border: 1px solid #dfccaa32; border-radius: 3px; background: #25242399; font-size: 11px; }
  #atlas:not([data-mode=orbit]) .locator i, #atlas:not([data-mode=orbit]) .locator i ~ * { display: none; }
}
@media (any-pointer: coarse) and (max-width: 760px) and (orientation: portrait) {
  :root { --rail: 80px; }
  .dock { flex-direction: column; justify-content: center; gap: 3px; padding-right: max(8px, var(--safe-r)); padding-left: max(8px, var(--safe-l)); }
  .modeSet { width: min(100%, 435px); }
  .modeSet button { flex: 1 1 0; padding: 0 4px; }
  .hint { font-size: 11px; }
  .hint svg { width: 13px; height: 13px; }
}
@media (max-height: 520px) {
  :root { --mast-top: max(8px, calc(var(--safe-t) + 3px)); --rail: 54px; --plan-top: calc(var(--mast-top) + var(--mast-height) + 5px); }
  .imprint .seal { width: 32px; height: 32px; }
  .caption, .locator { bottom: calc(var(--dock-height) + 11px); }
  .caption h1 { font-size: 29px; margin: 3px 0 0; }
  .caption [lang=en] { font-size: 16px; }
  #plan { width: 145px; gap: 2px; padding: 7px 10px; }
  .dialogHead { padding: 12px 18px 8px; border-bottom: 1px solid #c9ba9a2e; }
  .dialogHead h2 { font-size: 23px; }
  .guideScroll { padding: 0 18px 12px; }
  #joystick { width: 80px; height: 80px; }
  .joystick-lever { width: 30px; height: 30px; }
}
@media (any-pointer: coarse) and (orientation: landscape) and (max-height: 520px) {
  .dock { justify-content: space-between; gap: 6px; }
  .modeSet { gap: 2px; }
  .modeSet button { gap: 5px; padding: 0 8px; font-size: 13px; }
  .hint { gap: 3px; font-size: 10px; }
  .hint svg { width: 13px; }
}
@media (max-width: 520px) and (orientation: landscape) { .dock { justify-content: center; } .hint { display: none; } }
@media (max-width: 350px) {
  :root { --gutter: 10px; }
  .imprint .seal { width: 29px; height: 29px; }
  .imprint strong { letter-spacing: 2px; }
  .imprint { gap: 5px; }
  .tools { gap: 2px; }
  .modeSet svg { width: 15px; height: 15px; }
  .modeSet button { gap: 4px; letter-spacing: 0; }
}
@media (prefers-reduced-motion: reduce) { .meter i { transition: none; } }
