:root {
  color-scheme: dark;
  --ink: #e5e5ef;
  --water: #0d142b;
  --mist: #090e1b;
  --paper: #11182a;
  --wood: #e9bb81;
  --muted: #a0acc2;
  --line: #2a344d;
  --accent: #86d0ce;
  font-family: 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--mist);
}
* { box-sizing: border-box; }
body { margin: 0; }
.friend-row {padding:15px 0;border-bottom:1px solid var(--line);}.friend-row label {display:block;margin:10px 0;}.friend-row button {margin-right:10px;}.friend-key {padding:18px;border:1px solid var(--wood);border-radius:8px;}.friend-key input {width:100%;}.friend-key p {line-height:1.6;}
#friend-update {padding-bottom:28px;margin-bottom:25px;border-bottom:1px solid var(--line);}#friend-update p {white-space:pre-wrap;line-height:1.65;}#friend-update small {color:var(--muted);}
.world-labels { position:absolute; inset:0; pointer-events:none; overflow:hidden; }
.world-labels span { position:absolute; transform:translate(-50%,-100%); padding:5px 9px; color:#f3eedf; background:#0b1224ed; border:1px solid #65778d; border-radius:5px; font:600 14px/1.4 'Segoe UI',sans-serif; white-space:nowrap; }
.about { display:grid; grid-template-columns: minmax(260px,1fr) minmax(320px,1.4fr); gap:9vw; padding:75px max(30px,8vw); border-top:1px solid var(--line); background:#0c1220; }
.about h2 { font:40px/1.2 'Palatino Linotype',serif; margin-top:0; }
.about h3 { font-size:19px; margin:0 0 25px; }
.about h4 { font-size:16px; margin:0; }
.about p { max-width:62ch; line-height:1.7; color:var(--muted); }
.about article { margin-bottom:25px; }.about article p { margin:6px 0; }.about small { color:var(--muted); }
.about nav { gap:20px; margin-top:25px; }.about details { margin-bottom:35px; }.about summary { cursor:pointer; margin-bottom:25px; }
.sound-panel { max-width:540px; }.sound-panel audio { width:100%; margin:15px 0; }.sound-panel label { display:grid; gap:10px; }.sound-panel button { margin:5px; }
.tour-panel { position:absolute; left:24px; top:24px; width:min(410px,calc(100% - 48px)); background:#10182af5; padding:23px; border:1px solid #687488; border-radius:10px; z-index:4; }
.tour-panel h2 { margin:10px 0; font:27px/1.2 'Palatino Linotype',serif; }.tour-panel p { font-size:15px; line-height:1.6; }.tour-panel small { color:var(--muted); }.tour-panel button { margin:4px; }
.tour-active .place-caption,.tour-active .travel,.tour-active .world-hud { display:none; }
header nav { flex-wrap:wrap; justify-content:flex-end; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; border: 1px solid var(--line); background: #18223a; color: var(--ink); border-radius: 8px; padding: 9px 13px; }
button:hover { background: #25334c; border-color: #7087a2; }
button:disabled { opacity: .45; cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, canvas:focus-visible, select:focus-visible { outline: 2px solid var(--wood); outline-offset: 3px; }
a { color: var(--accent); }
[hidden] { display: none !important; }
header { height: 82px; padding: 0 27px; display: flex; align-items: center; justify-content: space-between; background: #0d1323; gap: 20px; border-bottom: 1px solid var(--line); }
.wordmark { font-family: 'Palatino Linotype', Palatino, Georgia, serif; font-size: 26px; color: #f1dfc5; text-decoration: none; display: flex; align-items: center; gap: 12px; }
.brand-symbol { width: 35px; height: 35px; border: 1px solid #967d5d; border-radius: 50%; display: grid; place-items: center; font-size: 22px; color: #e5bc82; }
.brand-copy { display: block; }
.wordmark small { display: block; font-family: 'Segoe UI', sans-serif; font-size: 11px; color: var(--muted); margin-top: 1px; }
nav { display: flex; gap: 7px; }
nav button { background: transparent; border-color: transparent; font-size: 13px; }
nav button:hover { border-color: var(--line); }
main { display: grid; grid-template-columns: minmax(0, 1fr) 350px; height: calc(100dvh - 114px); min-height: 570px; }
.environment { position: relative; overflow: hidden; background: var(--water); }
#world { width: 100%; height: 100%; display: block; touch-action: none; }
.place-caption { position: absolute; top: 29px; left: 30px; pointer-events: none; color: #efdec7; text-shadow: 0 2px 16px #050812; }
.place-caption > span { font-size: 12px; color: #b7c9d9; }
.place-caption h1 { font: normal clamp(29px, 3.3vw, 47px)/1.06 'Palatino Linotype', Palatino, Georgia, serif; letter-spacing: -1.3px; margin: 10px 0; }
.place-caption p { max-width: 250px; font-size: 12px; line-height: 1.6; color: #b5c1d7; }
.travel { position: absolute; top: 22px; right: 18px; display: flex; flex-direction: column; gap: 5px; max-width: 178px; }
.travel button { font-size: 12px; text-align: left; padding: 8px 11px; background: #101a2ee8; border-color: #334363b0; backdrop-filter: blur(12px); }
.travel button[aria-pressed=true] { background: #314947; border-color: #86c9bf; color: #dcf7ec; }
.scene-controls { position: absolute; bottom: 18px; left: 24px; right: 20px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.scene-controls button { background: #111a2ce8; font-size: 12px; }
.scene-controls span { font-size: 11px; color: #becbe0; text-shadow: 0 1px 5px #080c18; }
.world-hud { position: absolute; bottom: 72px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; white-space: nowrap; border: 1px solid #4a5264; background: #0a1021e8; border-radius: 24px; padding: 9px 16px; box-shadow: 0 5px 25px #04071050; }
.world-hud span { font-size: 12px; color: #ece0cc; }
.world-hud button { font-size: 12px; border-radius: 18px; padding: 5px 12px; color: #a8e8dc; }
.inspector { background: linear-gradient(165deg, #161d31, #0e1526 75%); overflow-y: auto; display: flex; flex-direction: column; padding: 25px 24px 18px; border-left: 1px solid var(--line); scrollbar-color: #394663 #111827; }
.inspector-heading > span { font-size: 12px; color: #d1b88e; }
h2 { font: normal 29px/1.15 'Palatino Linotype', Palatino, Georgia, serif; margin: 8px 0 20px; color: #e7e3dd; }
h3 { font-size: 14px; font-weight: 600; margin: 25px 0 10px; color: #d4dced; }
.status-badge { display: inline-block; color: #dac5a4; background: #44372880; border: 1px solid #5b4b3680; padding: 4px 8px; border-radius: 5px; font-size: 11px; }
.inspector p { font-size: 13px; line-height: 1.65; color: #bcc6d7; }
.muted { color: var(--muted); font-size: 12px; }
.source-row { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; border-radius: 0; padding: 12px 0; font-size: 13px; color: #ccd6e8; }
.source-row:hover { background: #1c2940; }
.source-row small { display: block; font-size: 10px; color: #94a1bb; margin-top: 4px; }
.project-row { padding: 13px 0; border-bottom: 1px solid var(--line); }
.project-row strong { display: block; font-size: 14px; color: #9bdbd1; }
.project-row p { margin: 7px 0; }
.project-row button { font-size: 10px; padding: 3px 7px; background: transparent; }
.add-project { width: 100%; margin-top: 12px; color: #eac999; background: #302a2880; border-color: #66543d; font-size: 12px; }
.guide { margin-top: auto; padding-top: 27px; }
.guide-heading { display: flex; gap: 10px; align-items: center; }
.guide-heading strong { font-size: 13px; color: #dbd4ed; }
.guide-heading small { display: block; color: var(--muted); font-size: 10px; margin-top: 2px; }
.portrait { width: 36px; height: 40px; background: #302d49; border: 1px solid #5c527d; display: grid; place-items: center; border-radius: 50%; font-size: 22px; color: #c9baed; }
#guide-answer { font-size: 12px; }
#prompt-form { display: flex; border: 1px solid #495774; border-radius: 8px; overflow: hidden; }
#prompt { min-width: 0; flex: 1; border: 0; padding: 12px; background: #080f20; color: var(--ink); font-size: 12px; }
#prompt::placeholder { color: #8f9db8; }
#prompt-form button { border: 0; border-radius: 0; }
footer { min-height: 32px; display: flex; align-items: center; justify-content: space-between; padding: 0 25px; font-size: 10px; color: #94a1bb; gap: 15px; background: #090f1c; border-top: 1px solid #26304a; }
dialog { border: 1px solid #455271; border-radius: 13px; box-shadow: 0 25px 100px #000a; background: #121b2d; color: var(--ink); width: min(760px, 94vw); max-height: 86dvh; padding: 26px; scrollbar-color: #495570 #121b2d; }
dialog::backdrop { background: #030715b0; backdrop-filter: blur(7px); }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.dialog-heading h2 { margin-top: 0; }
.dialog-heading button { padding: 4px 9px; }
.source-text { white-space: pre-wrap; font: 15px/1.8 'Segoe UI', sans-serif; overflow-wrap: anywhere; max-width: 75ch; color: #c7d0df; }
.module-row, .repo-row { display: flex; justify-content: space-between; align-items: center; gap: 22px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.module-row p, .repo-row p { font-size: 12px; line-height: 1.6; margin: 6px 0; color: var(--muted); overflow-wrap: anywhere; }
.module-row button, .repo-row button { flex-shrink: 0; font-size: 12px; }
.repo-actions { display: flex; gap: 5px; }
.record-form { display: grid; gap: 14px; }
.record-form label { font-size: 13px; display: grid; gap: 7px; }
.record-form input, .record-form textarea, .record-form select { width: 100%; border: 1px solid #495574; border-radius: 6px; background: #0b1222; padding: 10px; color: var(--ink); }
.record-form fieldset { border: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 12px; padding: 13px; }
.record-form fieldset label { display: flex; align-items: center; gap: 5px; }
.record-form input[type=checkbox] { width: auto; accent-color: #79bfb7; }
.record-form button[type=submit] { background: #314f4c; color: #e5f7ee; border-color: #79bfb7; }
.map { position: absolute; inset: 0; background: radial-gradient(ellipse at center, #253b48 0%, #1a293c 48%, #10192c 69%, #090f21 100%); }
.map svg { position: absolute; inset: 18%; width: 64%; height: 64%; overflow: visible; }
.map path { fill: none; stroke: #829991; stroke-width: .5; stroke-dasharray: 1 2; }
.map-place { position: absolute; transform: translate(-50%,-50%); max-width: 160px; background: #16223bea; border-color: #5a6e86; box-shadow: 0 0 28px #b8ba7e12; color: #dce4ed; }
.map-place small { display: block; font-size: 10px; color: #9eabc3; margin-top: 4px; }
.map-place[aria-pressed=true] { background: #314947; color: #e4f0da; border-color: #a1c6b1; }
.environment.is-map .place-caption h1, .environment.is-map .place-caption p, .environment.is-map .travel { display: none; }
.environment.is-map .place-caption { color: var(--ink); text-shadow: none; }
.environment.is-map .scene-controls span { display: none; }
.touch-controls { position: absolute; bottom: 62px; left: 16px; display: flex; gap: 6px; }
.touch-controls button { width: 44px; height: 44px; padding: 5px; background: #18233dea; border-color: #8190a4; touch-action: none; user-select: none; }
.public-main .inspector { min-height: 400px; }
.public-entry { padding: 15px 0; border-bottom: 1px solid var(--line); }
.public-entry h3 { margin: 0 0 8px; }
.public-entry p { white-space: pre-wrap; }
#notice { position: fixed; left: 24px; bottom: 45px; background: #253b43; color: #e6f0e7; border: 1px solid #6a8c8e; max-width: min(540px,90vw); padding: 14px 20px; border-radius: 8px; z-index: 10; font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width:1000px) {
  main { grid-template-columns: minmax(0,1fr) 310px; }
  .inspector { padding: 20px 18px; }
  .place-caption { left: 21px; }
  .place-caption h1 { font-size: 32px; }
  .travel { top: 175px; right: 12px; }
  .travel button { font-size: 11px; }
  .scene-controls span { display: none; }
  .world-hud { left: 22px; transform: none; bottom: 65px; padding: 8px 12px; }
}
@media (max-width:700px) {
  .about { display:block; padding:35px 24px; }.about > div + div { margin-top:40px; }.about h2 { font-size:32px; }
  .world-labels span { font-size:13px; }
  .tour-panel { top:12px;left:12px;width:calc(100% - 24px);padding:14px; }.tour-panel h2 { font-size:23px; }.tour-panel p { font-size:13px; }
  header { height: auto; min-height: 98px; padding: 12px 17px; align-items: flex-start; flex-direction: column; gap: 9px; }
  nav { gap: 0; flex-wrap: wrap; }
  nav button { font-size: 11px; padding: 6px 9px; }
  .wordmark { font-size: 22px; }.brand-symbol { width: 29px; height: 29px; font-size: 18px; }
  .wordmark small { display: none; }
  main { display: flex; flex-direction: column; height: auto; min-height: 0; }
  .environment { height: 65dvh; min-height: 460px; }
  .inspector { overflow: visible; min-height: 500px; border-left: 0; border-top: 1px solid var(--line); padding: 24px; }
  .place-caption { top: 20px; }.place-caption h1 { font-size: 28px; }
  .place-caption p { max-width: 155px; font-size: 11px; }
  .travel { top: 14px; right: 10px; max-width: 136px; gap: 4px; }
  .travel button { font-size: 10px; padding: 7px 9px; }
  .map-place { font-size: 11px; max-width: 103px; padding: 9px; }.map-place small { display: none; }
  .world-hud { left: 16px; bottom: 118px; max-width: calc(100% - 32px); white-space: normal; }
  .world-hud span { font-size: 11px; }.world-hud button { font-size: 11px; }
  .scene-controls { left: 15px; bottom: 13px; }.scene-controls button { font-size: 11px; }
  footer { padding: 12px 17px; flex-wrap: wrap; }
  .module-row, .repo-row { gap: 10px; }.repo-actions { flex-direction: column; }
}
@media (pointer:fine) and (min-width:701px) { .touch-controls { display: none; } }
@media (prefers-reduced-motion:reduce) { * { scroll-behavior: auto !important; } }
.health-ok { color: #86d0ce; background: #1c3a3980; border-color: #2f5c5a80; }
.health-bad { color: #f0a9a0; background: #3d222080; border-color: #6a393480; }
.health-warn { color: #e9bb81; background: #3a2f1e80; border-color: #5b4b3680; }
