:root { --bg: #0d2116; --ink: #f2efe8; --muted: #a9bdb0; --gold: #8cc8ef; --line: #2b4a37; --card: #143222; }
[hidden] { display: none !important; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 15px/1.5 Roboto, system-ui, sans-serif; overflow: hidden; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: #000; padding: 6px 10px; z-index: 50; }
.skip:focus { left: 8px; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--gold); }

.top { position: fixed; top: 0; left: 0; right: 0; height: 52px; display: flex; align-items: center; gap: 14px; padding: 0 16px; z-index: 20;
  background: linear-gradient(#0d2116cc, #0d211600); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: Gelasio, serif; font-size: 18px; letter-spacing: .04em; }
.status { color: var(--muted); font-size: 13px; margin-left: auto; }
.pill { background: #1b1b20; border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px; font-size: 13px; }
.pill:hover, .pill:focus-visible { border-color: var(--gold); outline: none; }

#scene { position: fixed; inset: 0; right: 380px; }
#scene canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.loading { position: fixed; inset: 0; right: 380px; display: grid; place-content: center; text-align: center; color: var(--muted); z-index: 5; pointer-events: none; }
.loading.off { display: none; }
.loading .bar { width: 240px; height: 4px; background: #222; border-radius: 4px; overflow: hidden; margin: 0 auto 10px; }
#loadBar { height: 100%; width: 0; background: var(--gold); transition: width .3s; }

.panel { position: fixed; top: 0; right: 0; bottom: 0; width: 380px; background: var(--card); border-left: 1px solid var(--line); display: flex; flex-direction: column; z-index: 10; padding-top: 52px; }
.tabs { display: flex; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { flex: 1; background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--gold); }
.tab { flex: 1; overflow-y: auto; padding: 8px 14px 24px; }
ul, ol { list-style: none; margin: 0; padding: 0; }

.feed li { padding: 9px 0; border-bottom: 1px solid #1a3c2a; font-size: 14px; }
.feed time { display: block; color: var(--muted); font-size: 11px; letter-spacing: .03em; }
.feed .line { margin: 4px 0 0 10px; padding-left: 10px; border-left: 2px solid #333; color: #d8d4ca; font-size: 13.5px; }
.feed .line b { color: var(--ink); font-weight: 500; }
.who { font-weight: 500; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }

.people li, .writings li, .groups li, .built li { padding: 10px 0; border-bottom: 1px solid #1a3c2a; }
.people button, .writings button { background: none; border: 0; padding: 0; text-align: left; width: 100%; }
.people small, .writings small, .groups small, .built small { display: block; color: var(--muted); font-size: 12.5px; }
.writings b, .groups b, .built b { font-family: Gelasio, serif; font-weight: 600; font-size: 15.5px; }

.modal { position: fixed; inset: 0; background: #000a; display: grid; place-items: center; z-index: 40; padding: 16px; }
.modal .card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 14px; max-width: 560px; width: 100%; max-height: 86vh; overflow-y: auto; padding: 22px 24px; }
.modal h2 { font-family: Gelasio, serif; margin: 0 0 10px; font-size: 24px; }
.modal h3 { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); margin: 18px 0 6px; }
.modal p { margin: 0 0 10px; }
.modal .mem li { font-size: 14px; color: #d8d4ca; padding: 3px 0; }
.modal .writing { white-space: pre-wrap; font-family: Gelasio, serif; font-size: 16px; line-height: 1.65; }
.close { position: absolute; top: 12px; right: 12px; background: none; border: 0; font-size: 18px; color: var(--muted); }

@media (max-width: 800px) {
  #scene, .loading { right: 0; bottom: 42vh; }
  .panel { top: auto; left: 0; width: auto; height: 42vh; padding-top: 0; border-left: 0; border-top: 1px solid var(--line); }
  .status { display: none; }
}
@media (prefers-reduced-motion: reduce) { #loadBar { transition: none; } }
.camPad { position: absolute; left: 14px; bottom: 14px; display: grid; grid-template-columns: repeat(7, 38px); gap: 6px; z-index: 6; }
.camPad button { height: 38px; border-radius: 10px; border: 1px solid #ffffff33; background: #0d2116cc; color: #f2efe8; font-size: 17px; }
.camPad button:hover, .camPad button:focus-visible { border-color: var(--gold); outline: none; }
.camHint { position: absolute; left: 50%; bottom: 64px; transform: translateX(-50%); background: #0d2116cc; color: #f2efe8; font-size: 13px; padding: 7px 14px; border-radius: 999px; z-index: 6; transition: opacity .6s; pointer-events: none; white-space: nowrap; }
.camHint.off { opacity: 0; }
@media (max-width: 800px) { .camPad { grid-template-columns: repeat(7, 34px); gap: 4px; left: 8px; bottom: 8px; } .camPad button { height: 34px; } .camHint { bottom: 52px; font-size: 12px; } }
.cnote { color: var(--muted); font-size: 13px; margin: 6px 0 10px; }
.charter { padding-left: 0; }
.charter li { padding: 10px 0; border-bottom: 1px solid #1a3c2a; font-family: Gelasio, serif; font-size: 15.5px; line-height: 1.5; }
.charter li b { color: var(--gold); margin-right: 4px; }
.charter small { display: block; font-family: Roboto, sans-serif; color: var(--muted); font-size: 12px; margin-top: 3px; }
/* status next to the title, not straddling the sky and the panel (Ry 09-29); Sound + About stay on the right */
.status { margin-left: 4px; padding-left: 12px; border-left: 1px solid #ffffff40; color: #f2efe8; text-shadow: 0 1px 3px #000c; font-size: 12.5px; }
#soundBtn { margin-left: auto; }
/* six tabs fit the 380px panel */
.tabs button { font-size: 12.5px; padding: 10px 3px; }
/* Sound / About / panel toggle at the bottom right of the world view (Ry 09-29) */
.sceneBtns { position: absolute; right: 14px; bottom: 14px; display: flex; gap: 8px; z-index: 6; }
.sceneBtns .pill { background: #0d2116cc; border-color: #ffffff33; }
#soundBtn { margin-left: 0; }
body.panelHidden .panel { display: none; }
body.panelHidden #scene, body.panelHidden .loading { right: 0; bottom: 0; }
@media (max-width: 800px) { .sceneBtns { right: 8px; bottom: 50px; gap: 6px; } .sceneBtns .pill { padding: 5px 10px; font-size: 12px; } }
/* no empty band above the tabs now that Sound/About live in the world view (Ry 09-29); the title bar stops at the panel */
.panel { padding-top: 0; }
.top { right: 380px; }
body.panelHidden .top { right: 0; }
@media (max-width: 800px) { .top { right: 0; } }
/* small round icon buttons in the world view (Ry 09-29) */
.iconBtn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid #ffffff40; background: #0d2116cc; color: #f2efe8; display: grid; place-items: center; padding: 0;
  font: 600 16px Gelasio, serif; cursor: pointer; }
.iconBtn:hover, .iconBtn:focus-visible { border-color: var(--gold); outline: none; }
.iconBtn[aria-pressed="true"] { color: var(--gold); }
.iconBtn.nudge { box-shadow: 0 0 0 3px #8cc8ef55; }
/* the feed's own show/hide handle: a slim tab on the panel's left edge; at the screen edge when the feed is hidden */
.panelHandle { position: fixed; top: 50%; right: 380px; transform: translateY(-50%); z-index: 12; border: 1px solid var(--line); border-right: 0;
  background: var(--card); color: var(--ink); border-radius: 10px 0 0 10px; padding: 14px 7px; font: 500 13px Roboto, sans-serif; cursor: pointer; }
.panelHandle span { font-size: 18px; line-height: 1; }
.panelHandle:hover, .panelHandle:focus-visible { color: var(--gold); outline: none; }
body.panelHidden .panelHandle { right: 0; }
@media (max-width: 800px) {
  .panelHandle { top: auto; bottom: 42vh; right: 12px; transform: none; border: 1px solid var(--line); border-bottom: 0; border-radius: 10px 10px 0 0; padding: 4px 14px; }
  body.panelHidden .panelHandle { bottom: 0; }
  .sceneBtns { bottom: 50px; }
}
/* v8 (09-29): captions + stream mode for OBS (?stream=1) */
.caption { position: absolute; left: 50%; bottom: 70px; transform: translateX(-50%); max-width: min(900px, 86%); background: #0d2116d0; color: #f2efe8; font: 500 17px/1.45 Roboto, sans-serif; padding: 10px 18px; border-radius: 12px; border-left: 3px solid var(--gold); z-index: 7; opacity: 0; transition: opacity .6s; pointer-events: none; text-align: left; }
.caption.on { opacity: 1; }
.caption b { color: var(--gold); font-weight: 700; margin-right: 6px; }
.streamTitle { display: none; }
body.stream .top, body.stream .panel, body.stream .panelHandle, body.stream .camPad, body.stream .camHint, body.stream .sceneBtns, body.stream .skip { display: none !important; }
body.stream #scene, body.stream .loading { inset: 0 !important; right: 0 !important; bottom: 0 !important; }
body.stream .caption { bottom: 7%; font-size: 24px; padding: 14px 24px; }
body.stream .streamTitle { display: flex; align-items: center; gap: 10px; position: fixed; left: 28px; top: 24px; z-index: 8; color: #f2efe8; font: 600 22px Gelasio, serif; text-shadow: 0 2px 10px #000a; }
body.stream .streamTitle img { width: 34px; height: 34px; }
body.stream .streamTitle small { font: 400 15px Roboto, sans-serif; opacity: .95; background: #0d211699; padding: 3px 10px; border-radius: 999px; text-shadow: none; margin-left: 6px; }
body.stream .streamTitle small.live { background: #d62828; color: #fff; font: 700 13px Roboto, sans-serif; letter-spacing: .08em; padding: 3px 9px; border-radius: 5px; opacity: 1; margin-left: 4px; }

/* stream mode on a phone: the small "tap for sound" speaker, only shown while the browser blocks audio (Ry 10-01) */
body.stream .streamSnd { position: fixed; right: 14px; bottom: 14px; z-index: 9; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; border: 1px solid rgba(255,255,255,.35); background: rgba(10,12,16,.55); color: #f2efe8;
  cursor: pointer; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); padding: 0; }
body.stream .streamSnd[hidden] { display: none; }
body.stream .streamSnd:focus-visible { outline: 2px solid #f5c542; outline-offset: 2px; }
.modal .portrait,#modalBody .portrait{width:120px;height:120px;border-radius:14px;object-fit:cover;border:1px solid rgba(255,255,255,.12)}
.aboutlinks{display:grid;gap:8px;margin:14px 0}
.aboutlinks a{display:block;padding:10px 14px;border-radius:12px;border:1px solid rgba(140,200,239,.35);background:rgba(140,200,239,.07);color:#8cc8ef;text-decoration:none;font-weight:600}
.aboutlinks a:hover,.aboutlinks a:focus-visible{background:rgba(140,200,239,.14)}
.aboutlinks small{display:block;font-weight:400;opacity:.8;color:inherit;font-size:.82rem;margin-top:2px}
.fineprint{font-size:.82rem;opacity:.75;border-left:3px solid #8cc8ef;padding-left:10px}
.aboutlinks a{display:flex;align-items:center;gap:12px}
.aboutlinks .ico{flex:none;width:22px;height:22px;color:#8cc8ef}
#aboutTitle{color:#8cc8ef}
