:root {
  --panel: rgba(12, 18, 28, 0.62);
  --line: rgba(255, 255, 255, 0.12);
  --text: #eef3f8;
  --muted: #9fb0c3;
  --up: #4ade80;
  --down: #f87171;
  --yellow: #ffd23f;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #9fc3e3; color: var(--text);
  font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
#app canvas { display: block; }
#vignette { position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(10, 20, 35, 0.28) 100%); }
kbd { display: inline-block; min-width: 1.6em; padding: 0 0.35em; border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 4px; background: rgba(255, 255, 255, 0.08); font: 600 12px/1.6 ui-monospace, Consolas, monospace; text-align: center; }

#hud { position: fixed; inset: 0; pointer-events: none; }
.panel { position: absolute; background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  backdrop-filter: blur(8px); padding: 12px 14px; }
.lbl { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.instruments { top: 16px; left: 16px; min-width: 230px; }
.row { display: grid; grid-template-columns: 1fr auto 42px; align-items: baseline; gap: 8px; padding: 2px 0; }
.row b { font: 600 16px ui-monospace, Consolas, monospace; text-align: right; }
.row.big b { font-size: 24px; }
.row .unit { color: var(--muted); font-size: 11px; }
#vario.up { color: var(--up); }
#vario.down { color: var(--down); }

.vario-meter { position: absolute; top: 16px; left: 262px; width: 10px; height: 190px; border-radius: 6px;
  background: var(--panel); border: 1px solid var(--line); overflow: hidden; }
.vario-meter::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(255,255,255,0.5); }
#vario-bar { position: absolute; left: 0; right: 0; height: 50%; transition: transform 0.15s; }
#vario-bar.up { bottom: 50%; background: var(--up); transform-origin: bottom; }
#vario-bar.down { top: 50%; background: var(--down); transform-origin: top; }

.nav { top: 16px; right: 16px; min-width: 170px; }
.lz { display: flex; align-items: center; gap: 10px; margin: 4px 0 10px; }
.lz b { font: 600 20px ui-monospace, Consolas, monospace; }
#lz-arrow { display: inline-block; color: var(--yellow); font-size: 22px; transition: transform 0.1s linear; }
#wind { font-weight: 600; }

#pilots { max-width: 200px; margin-top: 2px; color: var(--muted); font-size: 11px; line-height: 1.35; }
#pilots:empty { display: none; }
#overlay { cursor: default; }
#start { display: grid; gap: 8px; margin: 6px 0 14px; }
#start input { font: 600 17px system-ui, sans-serif; color: var(--text); background: rgba(255,255,255,0.08);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; outline: none; }
#start input:focus { border-color: rgba(255,255,255,0.45); }
#start input.need { border-color: var(--down); animation: shake 0.3s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.maps { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.map-choice { display: grid; gap: 3px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(255,255,255,0.05); color: var(--text); text-decoration: none; }
.map-choice small { color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.map-choice.active { border-color: var(--yellow); background: rgba(255, 210, 63, 0.12); }
#play { margin-top: 4px; padding: 12px; border: 0; border-radius: 12px; background: var(--yellow); color: #1b1b1d;
  font: 800 17px system-ui, sans-serif; cursor: pointer; }
#play:hover { filter: brightness(1.07); }
@media (max-width: 480px) { .maps { grid-template-columns: 1fr; } }
#stall.warn { background: rgba(234, 140, 30, 0.9); }
.fun-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: 6px; }
.fun-row b { font: 600 13px ui-monospace, Consolas, monospace; }
#popup { z-index: 50; position: absolute; top: 30%; left: 50%; transform: translate(-50%, 0); opacity: 0; pointer-events: none;
  font-size: 26px; font-weight: 800; color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,0.55); white-space: nowrap; }
#popup.show { animation: popup 2.2s ease-out forwards; }
@keyframes popup {
  0% { opacity: 0; transform: translate(-50%, 12px) scale(0.85); }
  12% { opacity: 1; transform: translate(-50%, 0) scale(1.05); }
  25% { transform: translate(-50%, 0) scale(1); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -24px); }
}
#stall { position: absolute; top: 22%; left: 50%; transform: translateX(-50%); padding: 8px 16px; border-radius: 8px;
  background: rgba(220, 38, 38, 0.85); font-weight: 700; letter-spacing: 0.04em; }
.help { bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; flex-wrap: wrap; justify-content: center;
  gap: 6px 18px; color: var(--muted); font-size: 12px; width: max-content; max-width: calc(100% - 32px); }

#toast { bottom: 70px; left: 50%; transform: translateX(-50%); text-align: center; width: max-content;
  max-width: min(460px, calc(100% - 32px)); }
#toast[hidden] { display: none; }
#toast > b { display: block; font-size: 18px; margin-bottom: 6px; }
#toast .good { color: var(--up); } #toast .ok { color: var(--yellow); } #toast .bad { color: var(--down); }
#toast .stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; color: var(--muted); font-size: 12px; margin-bottom: 8px; }
#toast .stats b { color: var(--text); }
#toast .keys { color: var(--muted); font-size: 12px; }
#toast a { pointer-events: auto; color: #ff7ab8; }

/* Show only what matters in each mode. */
.walk-only, .ground-only { display: none; }
#hud[data-mode="walking"] .walk-only, #hud[data-mode="walking"] .ground-only,
#hud[data-mode="ground"] .ground-only, #hud[data-mode="ground"] .run-only { display: inline; }
#hud[data-mode="walking"] .fly-only, #hud[data-mode="ground"] .fly-only { display: none; }
.run-only { display: none; }
.fall-only { display: none; }
#hud[data-mode="falling"] .fall-only { display: inline; }
#hud[data-mode="falling"] .fly-only, #hud[data-mode="crashed"] .fly-only, #hud[data-mode="splashed"] .fly-only { display: none; }
#tbtns .fly-btn, #tbtns .fall-btn { display: none; }
#hud[data-mode="flying"] #tbtns .fly-btn { display: block; }
#hud[data-mode="falling"] #tbtns .fall-btn { display: block; background: rgba(255, 210, 63, 0.85); color: #1b1b1d; }
#hud[data-mode="walking"] .instruments, #hud[data-mode="walking"] .vario-meter { display: none; }

#overlay { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(ellipse at center, rgba(8, 14, 24, 0.35), rgba(8, 14, 24, 0.7)); cursor: pointer; }
#overlay[hidden] { display: none; }
.card { max-width: 520px; width: 100%; max-height: calc(100dvh - 32px); overflow-y: auto; touch-action: pan-y;
  background: rgba(12, 18, 28, 0.82); border: 1px solid var(--line);
  border-radius: 16px; padding: 24px 26px; backdrop-filter: blur(10px); }
.card h1 { margin: 0 0 10px; font-size: 34px; letter-spacing: -0.02em; }
.card h2 { margin: 0 0 14px; font-size: 24px; }
.card h2.good { color: var(--up); } .card h2.ok { color: var(--yellow); } .card h2.bad { color: var(--down); }
.card p { color: #d3dde8; }
.card ul { padding-left: 18px; color: #d3dde8; } .card li { margin: 6px 0; }
.eyebrow { margin: 0 0 4px; color: var(--muted) !important; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
.yellow { color: var(--yellow); }
.hint { margin-bottom: 0; color: var(--muted) !important; text-align: center; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; }
.stats div { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 4px 0; }
.stats span { color: var(--muted); }

/* ---------- walking hub (LA) ---------- */
body:not(.hub) .hub-only { display: none !important; }
body.hub .flight-only, body.hub .instruments, body.hub .vario-meter, body.hub .nav, body.hub .help,
body.hub #tbtns, body.hub #stall, body.hub .stick-label { display: none !important; }
.hub-panel { top: 16px; right: 16px; min-width: 190px; pointer-events: auto; }
#hub-place { font-weight: 700; font-size: 15px; }
.hub-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
#hub-toggle { font: 700 15px system-ui, sans-serif; color: var(--text); background: rgba(255,255,255,0.1); border: 1px solid var(--line);
  border-radius: 8px; padding: 2px 9px; cursor: pointer; }
.hub-panel.collapsed { min-width: 0; }
.hub-panel.collapsed > :not(.hub-head):not(#acct) { display: none !important; }
.hub-panel.collapsed .hub-head { margin-bottom: 0; }
#hub-people { max-width: 210px; color: var(--muted); font-size: 11px; }
.hub-travel { display: grid; gap: 6px; margin-top: 4px; }
.hub-travel.two { grid-template-columns: 1fr 1fr; }
.hub-travel.two button { padding: 6px 8px; font-size: 12px; }
.hub-travel button, #hub-dialog button { font: 600 13px system-ui, sans-serif; color: var(--text); text-align: left;
  background: rgba(255,255,255,0.08); border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; cursor: pointer; }
.hub-travel button:hover, #hub-dialog button:hover { background: rgba(255,255,255,0.18); }
#hub-prompt { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%); pointer-events: auto; cursor: pointer;
  font: 700 16px system-ui, sans-serif; color: #1b1b1d; background: var(--yellow); border: 0; border-radius: 12px;
  padding: 10px 18px; box-shadow: 0 4px 18px rgba(0,0,0,0.3); }
#hub-prompt kbd { color: #1b1b1d; border-color: rgba(0,0,0,0.3); }
#hub-prompt[hidden], #hub-dialog[hidden] { display: none !important; }
#hub-dialog { top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(460px, calc(100% - 32px)); pointer-events: auto; }
#hub-dialog > b { display: block; font-size: 19px; margin-bottom: 4px; }
#hub-dialog p { color: #d3dde8; margin: 4px 0 12px; }
/* Project task board (kanban). */
#hub-dialog.wide { width: min(860px, calc(100% - 32px)); max-height: calc(100% - 40px); overflow-y: auto; }
.kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0; }
.kb-col { background: rgba(255,255,255,0.05); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 6px; min-height: 80px; }
.kb-col > b { font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; }
.kb-col:nth-child(1) > b { color: #ff7ab8; } .kb-col:nth-child(2) > b { color: #ffd23f; } .kb-col:nth-child(3) > b { color: #3ddc84; }
.kb-card { background: rgba(255,255,255,0.09); border-radius: 8px; padding: 7px 8px; display: grid; gap: 4px; font-size: 13px; }
.kb-card.mine { box-shadow: inset 3px 0 0 #ffd23f; }
.kb-card > span { overflow-wrap: anywhere; }
.kb-card small, .kb-empty { color: var(--muted); }
.kb-actions { display: flex; gap: 4px; align-items: center; }
#hub-dialog .kb-actions button { padding: 2px 7px; font-size: 12px; }
.kb-actions select, #tk-who { font: 12px system-ui, sans-serif; color: var(--text); background: #1d1a26; border: 1px solid var(--line); border-radius: 7px; padding: 3px 4px; min-width: 0; flex: 1; }
#tk-who { flex: 0 0 auto; padding: 7px 6px; }
@media (max-width: 600px) { .kanban { grid-template-columns: 1fr; } }
.todo-assigned { margin-top: 10px; padding: 8px 10px; border-radius: 10px; background: rgba(255,210,63,0.1); }
.todo-assigned > b { font-size: 13px; color: var(--yellow); }
.todo-assigned .todo-item small { color: var(--muted); }
#hub-dialog .todo-assigned .todo-item button { padding: 2px 8px; }
/* Project rooms dialog. */
.proj-list { display: grid; gap: 6px; margin-bottom: 8px; }
.proj-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; background: rgba(255,255,255,0.06); }
.proj-row b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-row small { color: var(--muted); }
.proj-row.free small { flex: 1; }
.proj-row .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; background: rgba(255,255,255,0.2); }
#hub-dialog .proj-row button { padding: 4px 10px; font-size: 12px; }
#proj-form { flex-wrap: wrap; }
.proj-colors { display: flex; gap: 5px; align-items: center; }
.proj-colors input { display: none; }
.proj-colors span { display: block; width: 20px; height: 20px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; }
.proj-colors input:checked + span { border-color: #fff; box-shadow: 0 0 0 2px rgba(0,0,0,0.4); }
/* Private to-do pad: yellow legal-pad look. */
.todo-list { background: #fff6c4; color: #2a2620; border-radius: 10px; padding: 8px 10px; max-height: 46vh; overflow: auto;
  background-image: repeating-linear-gradient(#fff6c4 0 27px, #e9d98f 27px 28px); box-shadow: inset 4px 0 0 #f08aa6; }
.todo-item { display: flex; align-items: center; gap: 8px; min-height: 28px; font: 500 14px system-ui, sans-serif; cursor: pointer; }
.todo-item span { flex: 1; overflow-wrap: anywhere; }
.todo-item.done span { text-decoration: line-through; opacity: 0.5; }
#hub-dialog .todo-item button { background: none; border: 0; color: #a0544f; padding: 2px 6px; }
.todo-empty { color: #6b6250 !important; margin: 4px 0 !important; }
.todo-add { display: flex; gap: 6px; margin: 10px 0; }
.todo-add input { flex: 1; font: 14px system-ui, sans-serif; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line);
  background: rgba(255,255,255,0.1); color: var(--text); }
.hub-worlds { display: grid; gap: 8px; }
.hub-worlds button { display: grid; gap: 3px; padding: 10px 12px !important; }
.hub-worlds small { color: var(--muted); font-weight: 400; }
.hub-close { margin-top: 10px; width: 100%; text-align: center !important; }
#note-text { width: 100%; min-height: 90px; resize: vertical; font: 600 16px "Red Hat Display", system-ui, sans-serif; color: #1b1726;
  background: #fff8d6; border: 0; border-radius: 6px; padding: 10px 12px; margin: 8px 0; outline: none; }
.note-colors { display: flex; gap: 8px; margin-bottom: 6px; }
.note-colors button { width: 30px; height: 30px; border-radius: 6px !important; padding: 0 !important; border: 2px solid transparent !important; }
.note-colors button.on { border-color: #fff !important; box-shadow: 0 0 0 2px #e0218a; }
.note-actions { display: flex; gap: 8px; margin-top: 8px; }
.note-actions button { flex: 1; text-align: center !important; margin-top: 0 !important; }
.note-view { color: #1b1726 !important; padding: 16px; border-radius: 6px; font: 600 17px "Red Hat Display", system-ui, sans-serif; }
#hub-fade { position: fixed; inset: 0; background: #0b1220; opacity: 0; pointer-events: none; }
#to-hub { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); pointer-events: auto; text-decoration: none;
  font: 700 13px system-ui, sans-serif; color: var(--text); background: var(--panel); border: 1px solid var(--line);
  border-radius: 999px; padding: 7px 14px; backdrop-filter: blur(8px); }
#to-hub:hover { background: rgba(255,255,255,0.2); }
/* Chat: bottom-left; recent lines fade unless you're chatting. Docked into the PC when seated. */
#chat { left: 16px; bottom: 16px; width: min(340px, calc(100% - 32px)); padding: 8px; pointer-events: auto;
  background: rgba(12, 18, 28, 0.35); transition: background 0.3s; }
#chat.active, #chat:focus-within { background: var(--panel); }
#chat-log { max-height: 150px; overflow-y: auto; font-size: 13px; line-height: 1.35; margin-bottom: 6px; }
#chat:not(.active):not(:focus-within) #chat-log { opacity: 0.55; }
#chat-log div { padding: 1px 2px; word-wrap: break-word; }
#chat-log b { color: #ff7ab8; }
#chat-log .mine b { color: var(--yellow); }
#chat-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
#chat-tabs button, #hub-people button { font: 600 11.5px system-ui, sans-serif; color: var(--text); cursor: pointer;
  background: rgba(255,255,255,0.08); border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; }
#chat-tabs button.on { background: #e0218a; border-color: #e0218a; }
#chat-tabs button.unread::after { content: " •"; color: var(--yellow); }
#chat-log .room b { color: #00b4ff; }
#chat-log .sys { color: var(--muted); font-style: italic; }
#chat-form { display: flex; gap: 6px; align-items: center; }
#chat-form #chat-input { flex: 1; min-width: 0; }
#chat-attach { flex: none; font-size: 15px; line-height: 1; cursor: pointer; color: var(--text);
  background: rgba(255,255,255,0.08); border: 1px solid var(--line); border-radius: 9px; padding: 7px 8px; }
#chat-attach:hover { background: rgba(255,255,255,0.18); }
#chat-tabs button.newdm { border-style: dashed; }
#chat-tabs button.min { margin-left: auto; }
#share, #mytodo { margin-top: 6px; width: 100%; font: 700 13px system-ui, sans-serif; color: var(--text); cursor: pointer;
  background: rgba(255,255,255,0.08); border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; }
.share-btn.on { background: rgba(0, 180, 255, 0.35) !important; border-color: #00b4ff !important; }
body.touch #share, body.touch .share-btn { display: none; } /* phones can't share their screen from a browser */
#screen-view { top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(1100px, calc(100% - 32px)); padding: 8px; pointer-events: auto; z-index: 30; }
#screen-view[hidden] { display: none; }
#screen-view .sv-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; gap: 8px; }
#screen-view .sv-bar button { font: 600 12px system-ui, sans-serif; color: var(--text); cursor: pointer; background: rgba(255,255,255,0.1); border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; }
#screen-view video { width: 100%; max-height: calc(100vh - 120px); background: #000; border-radius: 8px; display: block; }
#chat.collapsed { width: auto; }
#chat.collapsed #chat-log, #chat.collapsed #chat-form, #chat.collapsed #chat-pick, #chat.collapsed #chat-tabs button:not(.min) { display: none !important; }
#chat.collapsed #chat-tabs { margin-bottom: 0; }
#chat.collapsed #chat-tabs button.min { margin-left: 0; }
#chat-pick { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 6px; padding: 6px; border-radius: 10px; background: rgba(255,255,255,0.06); }
#chat-pick[hidden] { display: none; }
#chat-pick small { width: 100%; color: var(--muted); }
#chat-pick button { font: 600 11.5px system-ui, sans-serif; color: var(--text); cursor: pointer;
  background: rgba(255,255,255,0.08); border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; }
#chat-pick button.on::before { content: "● "; color: #3ddc84; }
#chat-log a.file { display: inline-flex; align-items: center; gap: 6px; color: var(--yellow); text-decoration: none;
  background: rgba(255,255,255,0.08); border-radius: 8px; padding: 3px 8px; margin-top: 2px; }
#chat-log a.file:hover { background: rgba(255,255,255,0.16); }
#chat-log img.thumb { display: block; max-width: 180px; max-height: 120px; border-radius: 8px; margin-top: 3px; }
#chat-log .file.gone { color: var(--muted); }
#hub-people { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; pointer-events: auto; }
#mic { margin-top: 8px; width: 100%; font: 700 13px system-ui, sans-serif; color: var(--text); cursor: pointer;
  background: rgba(255,255,255,0.08); border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; }
#mic.on { background: rgba(224, 33, 138, 0.35); border-color: #e0218a; }
#dnd { margin-top: 6px; width: 100%; font: 700 13px system-ui, sans-serif; color: var(--text); cursor: pointer;
  background: rgba(255,255,255,0.08); border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; }
#dnd.on { background: rgba(120, 120, 140, 0.45); border-color: #9e97b3; }
#status { margin-top: 6px; width: 100%; font: 700 13px system-ui, sans-serif; color: var(--text); cursor: pointer;
  background: rgba(255,255,255,0.08); border: 1px solid var(--line); border-radius: 9px; padding: 7px 8px; }
#status option { color: #1b1b1d; }
#hub-people .person { display: inline-flex; gap: 2px; }
#hub-people .callbtn { padding: 3px 6px; }
#call { top: 90px; left: 50%; transform: translateX(-50%); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px;
  pointer-events: auto; max-width: calc(100% - 32px); border-color: #e0218a; box-shadow: 0 0 30px rgba(224, 33, 138, 0.35); }
#call[hidden] { display: none !important; }
#call b { font-size: 15px; }
#call small { width: 100%; color: var(--muted); }
#call button { font: 700 13px system-ui, sans-serif; border: 0; border-radius: 9px; padding: 7px 14px; cursor: pointer; color: #fff; background: rgba(255,255,255,0.15); }
#call button.yes { background: #22a35a; }
#call button.no { background: #d62839; }
#chat-input { width: 100%; font: 14px system-ui, sans-serif; color: var(--text); background: rgba(255,255,255,0.08);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; outline: none; }
#chat-input:focus { border-color: #e0218a; }
body.touch #chat { bottom: auto; top: 16px; left: 16px; width: min(280px, calc(100% - 230px)); }
/* Phones in portrait: the chat becomes a full-width strip under the location pill. */
@media (max-width: 600px) {
  body.touch #chat { top: calc(68px + env(safe-area-inset-top)); left: 10px; right: 10px; width: auto; padding: 6px; }
  body.touch #chat-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-bottom: 4px; }
  body.touch #chat-tabs::-webkit-scrollbar { display: none; }
  body.touch #chat-tabs button { flex: none; }
  body.touch #chat-log { max-height: 96px; }
  body.touch #chat:not(.active):not(:focus-within) #chat-log { max-height: 40px; }
  body.touch #chat-input { font-size: 16px; } /* 16px stops iOS zooming into the field */
  #hub-dialog { max-height: calc(100% - 40px); overflow-y: auto; }
}
#pc { position: fixed; inset: 0; display: grid; place-items: center; padding: 18px; pointer-events: auto;
  background: radial-gradient(ellipse at center, rgba(10, 6, 20, 0.25), rgba(10, 6, 20, 0.7)); }
#pc[hidden] { display: none !important; }
.pc-screen { width: min(1560px, 100%); height: min(940px, 100%); display: flex; flex-direction: column;
  background: #0b0b0f; border: 10px solid #15131c; border-radius: 14px; overflow: hidden;
  box-shadow: 0 0 0 1px #2b2638, 0 30px 80px rgba(0,0,0,0.6), 0 0 60px rgba(224, 33, 138, 0.25); }
.pc-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 12px;
  background: linear-gradient(90deg, #5b2bd6, #e0218a 55%, #ff8a00); font: 700 14px "Red Hat Display", system-ui, sans-serif; }
.pc-bar span { display: flex; align-items: center; gap: 8px; }
.pc-bar img { width: 22px; height: 22px; border-radius: 4px; }
.pc-bar button { font: 700 13px system-ui, sans-serif; border: 0; border-radius: 8px; padding: 6px 12px; cursor: pointer;
  background: rgba(0,0,0,0.35); color: #fff; }
.pc-body { flex: 1; display: flex; min-height: 0; }
#pc-web { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; }
#pc-web[hidden], #pc-notes[hidden] { display: none; }
#pc-nav { display: flex; gap: 6px; padding: 6px 8px; background: #17141f; border-bottom: 1px solid #2b2638; }
#pc-nav button { font: 700 13px system-ui, sans-serif; color: #e9e4f2; background: rgba(255,255,255,0.07); border: 0; border-radius: 7px; padding: 5px 10px; cursor: pointer; }
#pc-nav button:hover { background: rgba(255,255,255,0.16); }
#pc-url { flex: 1; min-width: 0; font: 14px system-ui, sans-serif; color: #f2eef8; background: #0b0b0f; border: 1px solid #2b2638; border-radius: 999px; padding: 6px 14px; }
#pc-url:focus { outline: none; border-color: #e0218a; }
#pc-site { flex: 1; border: 0; background: #fff; min-width: 0; }
#pc-hint { position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%); font: 11px system-ui, sans-serif; color: #a79fb8;
  background: rgba(11,11,15,0.85); padding: 3px 10px; border-radius: 999px; pointer-events: none; opacity: 0.9; transition: opacity 0.6s; }
#hub-dialog { z-index: 40; }
#pc-notes { flex: 1; min-width: 0; resize: none; border: 0; outline: none; padding: 28px 34px; background: #0f0d16; color: #f1eef8;
  font: 500 17px/1.6 "Red Hat Display", system-ui, sans-serif; caret-color: #e0218a; }
#pc-lock { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: #0f0d16; }
#pc-lock[hidden] { display: none; }
#pc-lock .lock-icon { font-size: 40px; }
#pc-lock b { font: 800 20px "Red Hat Display", system-ui, sans-serif; }
#pc-lock p { color: var(--muted); margin: 0; }
#pc-lock input { width: 140px; text-align: center; letter-spacing: 0.5em; font: 700 26px ui-monospace, monospace; color: #fff;
  background: rgba(255,255,255,0.08); border: 1px solid #2b2638; border-radius: 10px; padding: 8px; outline: none; }
#pc-lock input:focus { border-color: #e0218a; }
#pc-lock button { font: 700 14px system-ui, sans-serif; color: #fff; background: #e0218a; border: 0; border-radius: 10px; padding: 9px 22px; cursor: pointer; }
#pc-lock small { color: #ff7a8a; min-height: 1em; }
#pc.full { padding: 0; }
#pc.full .pc-screen { width: 100%; height: 100%; border-width: 0; border-radius: 0; }
.pc-modes { display: flex; gap: 6px; margin-left: auto; }
.pc-modes button.on { background: rgba(255,255,255,0.9) !important; color: #1b1b1d !important; }
#pc-chat-slot { width: 300px; display: flex; border-left: 1px solid #2b2638; }
#pc-chat-slot:empty { display: none; }
#chat.docked { position: static; width: 100%; display: flex; flex-direction: column; border: 0; border-radius: 0;
  background: #121019; backdrop-filter: none; }
#chat.docked #chat-log { flex: 1; max-height: none; opacity: 1 !important; }
@media (max-width: 700px) { .pc-body { flex-direction: column; } #pc-chat-slot { width: auto; height: 38%; border-left: 0; border-top: 1px solid #2b2638; } }
.maps { grid-template-columns: repeat(3, 1fr) !important; }
@media (max-width: 560px) { .maps { grid-template-columns: 1fr !important; } }

/* Whiteboard editor */
#wb { position: fixed; inset: 0; display: grid; place-items: center; padding: 14px; pointer-events: auto; background: rgba(8, 6, 16, 0.55); z-index: 30; }
#wb[hidden] { display: none !important; }
.wb-panel { width: min(1500px, 100%); max-height: 100%; display: flex; flex-direction: column; background: #121019;
  border: 1px solid #2b2638; border-radius: 14px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,0.6); }
.wb-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 12px;
  background: linear-gradient(90deg, #5b2bd6, #e0218a 55%, #ff8a00); font: 700 14px "Red Hat Display", system-ui, sans-serif; }
.wb-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-left: auto; }
.wb-tools button { font: 700 13px system-ui, sans-serif; color: #fff; background: rgba(0,0,0,0.3); border: 2px solid transparent;
  border-radius: 8px; padding: 5px 9px; cursor: pointer; }
.wb-tools button.on { border-color: #fff; background: rgba(0,0,0,0.5); }
.wb-tools .sw { width: 26px; height: 26px; padding: 0; }
.wb-sep { width: 1px; height: 22px; background: rgba(255,255,255,0.35); }
#wb-pick { width: 30px; height: 28px; padding: 0; border: 0; border-radius: 6px; background: none; cursor: pointer; }
#wb-text { font: 600 14px system-ui, sans-serif; padding: 6px 9px; border-radius: 8px; border: 0; min-width: 230px; outline: none; }
.wb-stage { overflow: auto; background: #2b2638; }
/* A pen cursor that shows on a white board: dark ring with a white dot. */
.wb-stage canvas { display: block; width: 100%; height: auto; touch-action: none;
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24'><circle cx='12' cy='12' r='8' fill='none' stroke='%2316131f' stroke-width='3'/><circle cx='12' cy='12' r='8' fill='none' stroke='%23e0218a' stroke-width='1.2'/><circle cx='12' cy='12' r='2' fill='%2316131f'/></svg>") 12 12, crosshair; }

/* ---------- touch controls ---------- */
.touch-hint, .tc { display: none; }
body.touch .kb { display: none; }
body.touch .tc { display: inline; }
body.touch { touch-action: none; -webkit-user-select: none; user-select: none; }
body.touch .touch-hint { display: block; font-size: 13px; }
body.touch .help, body.touch .card ul { display: none; }
body.touch #toast { bottom: calc(244px + env(safe-area-inset-bottom)); }
#touch[hidden] { display: none; }
#touch { position: absolute; inset: 0; pointer-events: none; }
#stick { position: absolute; left: calc(20px + env(safe-area-inset-left)); bottom: calc(24px + env(safe-area-inset-bottom));
  width: 150px; height: 150px; border-radius: 50%; pointer-events: auto; touch-action: none;
  background: radial-gradient(circle, rgba(255,255,255,0.08), rgba(12,18,28,0.45)); border: 1px solid rgba(255,255,255,0.25);
  backdrop-filter: blur(6px); }
#knob { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%;
  background: rgba(255,255,255,0.85); box-shadow: 0 2px 10px rgba(0,0,0,0.35); pointer-events: none; }
.stick-label { position: absolute; left: 0; right: 0; bottom: -20px; text-align: center; font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em; }
#hud .stick-label.fly-only { display: block; }
#hud[data-mode="ground"] .stick-label.fly-only, #hud[data-mode="walking"] .stick-label.fly-only { display: none; }
#hud[data-mode="ground"] .stick-label.run-only, #hud[data-mode="walking"] .stick-label.walk-only { display: block; }
#tbtns { position: absolute; right: calc(16px + env(safe-area-inset-right)); bottom: calc(24px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 10px; pointer-events: auto; }
#tbtns button { min-width: 76px; min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); font: 600 14px system-ui, sans-serif; backdrop-filter: blur(8px); touch-action: manipulation; }
#tbtns button:active { background: rgba(255,255,255,0.25); }
#hud[data-mode="ground"] #tbtns .ground-only, #hud[data-mode="walking"] #tbtns .ground-only { display: block;
  background: rgba(255, 210, 63, 0.85); color: #1b1b1d; }

/* Short screens (phones in landscape): keep only the key instruments. */
@media (max-height: 520px) {
  .instruments .row.minor { display: none; }
  .instruments, .nav { padding: 6px 10px; }
  .vario-meter { height: 110px; }
  #stick { width: 130px; height: 130px; }
  body.touch #toast { bottom: calc(20px + env(safe-area-inset-bottom)); max-width: calc(100% - 360px); padding: 8px 12px; }
  body.touch #toast > b { font-size: 15px; margin-bottom: 2px; }
}

@media (max-width: 640px) {
  .instruments { min-width: 0; padding: 8px 10px; }
  .row { grid-template-columns: auto auto 30px; }
  .row.big b { font-size: 18px; }
  .vario-meter { display: none; }
  .nav { min-width: 0; padding: 8px 10px; }
}

/* ---------- avatar creator ---------- */
#avatar-ed { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 12px; background: rgba(8, 6, 14, 0.72); backdrop-filter: blur(6px); }
#avatar-ed .ae-card { width: min(860px, 100%); max-height: calc(100dvh - 24px); display: flex; flex-direction: column; gap: 10px; padding: 16px;
  background: #15121d; color: #f2eef8; border: 1px solid rgba(255,255,255,0.12); border-radius: 18px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); font-family: system-ui, sans-serif; }
#avatar-ed .ae-head b { display: block; font: 800 22px "Red Hat Display", system-ui, sans-serif; }
#avatar-ed .ae-head small { color: #a79fb8; }
#avatar-ed .ae-body { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 14px; min-height: 0; flex: 1; }
#avatar-ed .ae-stage { position: relative; border-radius: 14px; overflow: hidden; background: radial-gradient(circle at 50% 35%, #3a2a55, #15121d 70%); min-height: 360px; }
#avatar-ed .ae-stage canvas { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
#avatar-ed .ae-stage small { position: absolute; bottom: 8px; left: 0; right: 0; text-align: center; color: #a79fb8; font-size: 11px; pointer-events: none; }
#avatar-ed .ae-side { display: flex; flex-direction: column; min-height: 0; }
#avatar-ed .ae-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
#avatar-ed button { font: 600 13px system-ui, sans-serif; color: #f2eef8; cursor: pointer; background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.14); border-radius: 999px; padding: 6px 12px; }
#avatar-ed button:hover { background: rgba(255,255,255,0.14); }
#avatar-ed .ae-tabs button.on { background: #e0218a; border-color: #e0218a; }
#avatar-ed .ae-opts { overflow-y: auto; display: grid; gap: 12px; padding-right: 4px; }
#avatar-ed .ae-row label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: #a79fb8; margin-bottom: 6px; }
#avatar-ed .ae-row > div { display: flex; flex-wrap: wrap; gap: 6px; }
#avatar-ed .ae-row button.ch.on { background: #f2eef8; color: #15121d; }
#avatar-ed .ae-row button.sw { width: 30px; height: 30px; padding: 0; border-radius: 50%; border: 2px solid rgba(255,255,255,0.2); }
#avatar-ed .ae-row button.sw.on { border-color: #fff; box-shadow: 0 0 0 3px #e0218a; }
#avatar-ed .ae-foot { display: flex; gap: 8px; align-items: center; }
#avatar-ed .ae-foot span { flex: 1; }
#avatar-ed .ae-foot .primary { background: #ffd23f; color: #15121d; border-color: #ffd23f; font-weight: 800; }
@media (max-width: 640px) {
  #avatar-ed .ae-body { grid-template-columns: 1fr; grid-template-rows: 240px 1fr; }
  #avatar-ed .ae-stage { min-height: 0; }
  #avatar-ed .ae-card { padding: 12px; }
  #avatar-ed .ae-foot button[data-act="random"] { padding: 6px 10px; }
}

/* ---------- sign in / guest on the start card ---------- */
.auth { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 4px 0 10px; }
.auth button { font: 700 14px system-ui, sans-serif; padding: 10px; border-radius: 12px; cursor: pointer; color: var(--text);
  background: rgba(255,255,255,0.06); border: 1px solid var(--line); }
.auth button.on { background: rgba(224,33,138,0.25); border-color: #e0218a; }
.auth-pin { display: flex; gap: 6px; margin-top: 6px; }
.auth-pin input { flex: 1; min-width: 0; }
.auth-note { color: var(--muted); font-size: 12px; margin: 4px 0 8px; }
.avatar-row { display: flex; align-items: center; gap: 8px; margin: 8px 0 10px; }
.avatar-row button { font: 700 13px system-ui, sans-serif; padding: 8px 12px; border-radius: 10px; cursor: pointer; color: var(--text);
  background: rgba(255,255,255,0.08); border: 1px solid var(--line); }
.avatar-row small { color: var(--muted); }
#hub-avatar { margin-top: 6px; width: 100%; font: 700 13px system-ui, sans-serif; color: var(--text); cursor: pointer;
  background: rgba(255,255,255,0.08); border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; }
#google-row { display: grid; justify-items: center; gap: 6px; margin: 4px 0 10px; }
#google-row[hidden] { display: none; }
.linkish { background: none; border: 0; color: var(--muted); font: 12px system-ui, sans-serif; text-decoration: underline; cursor: pointer; }
.verified { color: #3ddc84; }

/* ---------- menu: a slim column on the right ---------- */
.hub-panel { width: 236px; min-width: 0; max-height: calc(100dvh - 32px); overflow-y: auto; overflow-x: hidden; padding: 10px; scrollbar-width: thin; }
.hub-panel.collapsed { width: auto; }
.hub-panel .lbl { font-size: 10.5px; }
#hub-people { max-width: none; display: grid; gap: 3px; }
#hub-people .person { display: flex; gap: 3px; min-width: 0; }
#hub-people .person > button:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
#hub-people .callbtn { flex: none; padding: 3px 6px; }
.hub-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 8px; }
.hub-actions > button, .hub-panel #mic, .hub-panel #share, .hub-panel #mytodo, .hub-panel #hub-avatar, .hub-panel #dnd {
  margin: 0; width: 100%; min-width: 0; font: 650 12px system-ui, sans-serif; padding: 6px 7px; border-radius: 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.hub-panel #status { margin-top: 5px; font-size: 12px; padding: 5px 7px; }
.hub-panel .hub-travel { gap: 4px; }
.hub-panel .hub-travel, .hub-panel .hub-travel.two { grid-template-columns: 1fr 1fr; }
.hub-panel .hub-travel button { font-size: 11.5px; padding: 5px 7px; border-radius: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 600px) { .hub-panel { width: min(236px, calc(100% - 20px)); right: 10px; } }

/* Sign-in card (opens over the world; the world keeps running behind it) */
#auth { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px; background: rgba(8, 14, 24, 0.45); }
#auth[hidden] { display: none; }
.auth-card { position: relative; width: 100%; max-width: 380px; padding: 26px 24px 20px; border-radius: 18px;
  background: rgba(12, 18, 28, 0.92); border: 1px solid var(--line); backdrop-filter: blur(10px); box-shadow: 0 20px 60px rgba(0,0,0,0.35); }
.auth-card h2 { margin: 0 0 6px; font: 800 24px/1.15 "Red Hat Display", system-ui, sans-serif; letter-spacing: -0.01em; }
.auth-sub { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
#auth-form { display: grid; gap: 10px; }
#auth-form input { width: 100%; font: 16px system-ui, sans-serif; padding: 12px 14px; border-radius: 10px; color: var(--text);
  background: rgba(255,255,255,0.06); border: 1px solid var(--line); outline: none; }
#auth-form input:focus { border-color: #e0218a; }
#auth-form input[hidden] { display: none; }
#auth-go { font: 700 16px system-ui, sans-serif; padding: 12px; border: 0; border-radius: 10px; cursor: pointer; background: #e0218a; color: #fff; }
#auth-go:disabled { opacity: 0.6; cursor: progress; }
.auth-msg { margin: 0; min-height: 1.2em; font-size: 13px; color: var(--yellow); }
.auth-switch { margin: 10px 0 14px; text-align: center; color: var(--muted); font-size: 13px; }
.auth-switch .linkish { font-size: 13px; color: var(--text); }
.auth-guest { width: 100%; font: 600 14px system-ui, sans-serif; padding: 11px; border-radius: 10px; cursor: pointer;
  color: var(--text); background: transparent; border: 1px solid var(--line); }
.auth-x { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 50%; border: 0; cursor: pointer;
  color: var(--muted); background: rgba(255,255,255,0.06); font-size: 14px; }
#acct { pointer-events: auto; width: 100%; margin: 2px 0 8px; font: 600 13px system-ui, sans-serif; padding: 8px 10px; border-radius: 10px;
  cursor: pointer; color: var(--text); background: rgba(224,33,138,0.22); border: 1px solid rgba(224,33,138,0.6); text-align: left;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.team #acct { background: rgba(255,255,255,0.08); border-color: var(--line); }
/* Team-only tools are hidden for guests and visitors. */
body:not(.team) #mytodo, body:not(.team) #share, body:not(.team) .share-btn { display: none; }

/* ---------- Phones and tablets: a tidy, thumb-friendly layout ----------
   Joystick bottom-right (right thumb), the action button bottom-left (left thumb),
   chat and menu folded into small pills at the top. */
body.touch #stick { left: auto; right: calc(18px + env(safe-area-inset-right)); bottom: calc(22px + env(safe-area-inset-bottom));
  width: 128px; height: 128px; }
body.touch #knob { width: 54px; height: 54px; margin: -27px 0 0 -27px; }
body.touch #hub-prompt { left: calc(14px + env(safe-area-inset-left)); right: calc(170px + env(safe-area-inset-right)); bottom: calc(40px + env(safe-area-inset-bottom));
  transform: none; max-width: 260px; min-height: 56px; padding: 12px 16px; font-size: 15px; text-align: left; border-radius: 16px; }
body.touch #toast { left: 12px; right: 12px; transform: none; width: auto; max-width: none; bottom: auto; top: calc(108px + env(safe-area-inset-top));
  padding: 8px 12px; font-size: 13px; }
body.touch #toast > b { font-size: 14px; }
body.touch #chat { top: calc(12px + env(safe-area-inset-top)); left: calc(10px + env(safe-area-inset-left)); right: auto; width: auto; max-width: calc(100% - 200px); padding: 4px; }
body.touch #chat:not(.collapsed) { right: 10px; max-width: none; padding: 6px; z-index: 5; }
body.touch #chat.collapsed #chat-tabs button.min { min-height: 36px; padding: 0 12px; font-size: 13px; }
body.touch .hub-panel { top: calc(12px + env(safe-area-inset-top)); right: calc(10px + env(safe-area-inset-right)); width: min(220px, calc(100% - 20px)); padding: 6px 8px; }
body.touch .hub-panel.collapsed { width: auto; max-width: 180px; }
body.touch .hub-panel.collapsed #acct { margin: 4px 0 0; padding: 6px 10px; font-size: 12px; }
body.touch #hub-place { font-size: 13px; }
body.touch #hub-dialog { width: calc(100% - 24px); max-height: calc(100dvh - 120px); overflow-y: auto; }

/* Menu: tabs (Explore / Places / People), the office section only inside an office, team tools only for the team */
.hub-tabs { display: grid; grid-template-columns: 1fr 1fr auto; gap: 4px; margin: 2px 0 8px; }
.hub-tabs button { font: 600 12.5px system-ui, sans-serif; padding: 7px 8px; border-radius: 9px; cursor: pointer; color: var(--text);
  background: rgba(255,255,255,0.06); border: 1px solid var(--line); white-space: nowrap; }
.hub-tabs button.on { background: rgba(224,33,138,0.25); border-color: #e0218a; }
.hub-sec[hidden] { display: none; }
.hub-list { display: grid; gap: 4px; max-height: 38vh; overflow-y: auto; }
.hub-list button { display: grid; text-align: left; gap: 1px; padding: 8px 10px; border-radius: 9px; cursor: pointer; color: var(--text);
  background: rgba(255,255,255,0.06); border: 1px solid var(--line); font: 13px system-ui, sans-serif; }
.hub-list button:hover { background: rgba(255,255,255,0.14); }
.hub-list button small { color: var(--muted); font-size: 11.5px; }
.hub-list button:disabled { opacity: 0.5; cursor: default; }
.hub-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.hub-chips button { font: 600 11.5px system-ui, sans-serif; padding: 4px 9px; border-radius: 999px; cursor: pointer; color: var(--text);
  background: rgba(255,255,255,0.06); border: 1px solid var(--line); }
.hub-chips button.on { background: #e0218a; border-color: #e0218a; }
.hub-empty { margin: 4px 2px; color: var(--muted); font-size: 12.5px; }
.hub-office { display: none; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
body.in-office .hub-office { display: block; }
body:not(.team) .team-only { display: none !important; }
.hub-me { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.hub-me button { font: 600 11.5px system-ui, sans-serif; padding: 7px 4px; border-radius: 9px; cursor: pointer; color: var(--text);
  background: rgba(255,255,255,0.06); border: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hub-me button.on { background: rgba(224,33,138,0.25); border-color: #e0218a; }
