:root {
  --bg: #14171c;
  --panel: rgba(22, 26, 32, 0.95);
  --line: rgba(255, 255, 255, 0.12);
  --ink: #e9ecf1;
  --dim: #9aa3b0;
  --accent: #e2a04a;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink);
  font: 14px/1.45 system-ui, 'Segoe UI', Roboto, sans-serif; }
canvas#view3d, canvas#plan2d { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
canvas#plan2d { background: #f6f3ec; cursor: grab; }
canvas#plan2d.pointing { cursor: pointer; }

#bar { position: fixed; top: 0; left: 0; right: 0; height: 52px; display: flex; align-items: center; gap: 14px;
  padding: 0 14px; background: var(--panel); border-bottom: 1px solid var(--line); z-index: 10; }
/* When the window is too narrow for everything, the grey summary after the name is what gives way (it ends
   in an ellipsis); the buttons are never clipped. */
.brand { font-weight: 650; letter-spacing: 0.02em; white-space: nowrap; flex: 0 1 auto; min-width: 84px; overflow: hidden; text-overflow: ellipsis; }
.brand span { font-weight: 400; color: var(--dim); margin-left: 10px; font-size: 12.5px; }
#modes { display: flex; flex: none; background: rgba(255, 255, 255, 0.06); border-radius: 9px; padding: 3px; }
#modes button, .tog { border: 0; background: transparent; color: var(--dim); font: inherit; padding: 6px 13px;
  border-radius: 7px; cursor: pointer; white-space: nowrap; }
#modes button:hover, .tog:hover { color: var(--ink); }
#modes button.on { background: var(--accent); color: #1b1408; font-weight: 600; }
.tools { margin-left: auto; display: flex; gap: 6px; flex: none; flex-wrap: nowrap; }
.tog { border: 1px solid var(--line); }
.tog.on { color: var(--ink); border-color: var(--accent); background: rgba(226, 160, 74, 0.16); }
.tog[hidden] { display: none; }

#notes { position: fixed; top: 52px; right: 0; bottom: 0; width: min(400px, 92vw); overflow: auto; z-index: 9;
  background: var(--panel); border-left: 1px solid var(--line); padding: 16px 18px 40px; }
#notes h2 { font-size: 15px; margin: 18px 0 8px; color: var(--accent); }
#notes h2:first-child { margin-top: 0; }
#notes ul { margin: 0; padding-left: 18px; }
#notes li { margin: 5px 0; color: #d5dae2; }
#notes li b { color: #fff; font-weight: 600; }
#notes .go { color: var(--accent); cursor: pointer; text-decoration: underline dotted; }
#notes table { width: 100%; border-collapse: collapse; font-size: 13px; }
#notes td { padding: 3px 0; border-bottom: 1px solid var(--line); }
#notes td:last-child { text-align: right; color: var(--dim); white-space: nowrap; }
#notes tr.go td:first-child { color: var(--ink); }
#notes tr.go:hover td { color: var(--accent); cursor: pointer; }

#hud { position: fixed; left: 16px; bottom: 16px; z-index: 8; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 14px; min-width: 190px; pointer-events: none; }
#room { font-size: 17px; font-weight: 650; }
#roomSub { color: var(--dim); font-size: 12.5px; }
#mini { position: fixed; right: 16px; bottom: 16px; z-index: 8; border-radius: 10px; border: 1px solid var(--line);
  background: #f6f3ec; width: 300px; height: 170px; cursor: pointer; }
#hint { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 8; background: var(--panel);
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 16px; color: var(--dim); font-size: 12.5px;
  white-space: nowrap; pointer-events: none; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis; }
#hint b { color: var(--ink); font-weight: 600; }
#cross { position: fixed; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.75); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45); z-index: 7; pointer-events: none; }
#fps { position: fixed; top: 62px; left: 14px; z-index: 8; background: var(--panel); border: 1px solid var(--line); border-radius: 7px;
  padding: 4px 9px; font: 12px/1.3 ui-monospace, Consolas, monospace; color: var(--ink); pointer-events: none; }
#fps[hidden] { display: none; }
#tip { position: fixed; z-index: 11; pointer-events: none; background: #1b1f26; color: var(--ink); border: 1px solid var(--line);
  border-radius: 7px; padding: 5px 9px; font-size: 12.5px; white-space: nowrap; }
#tip small { color: var(--dim); }

#toast { position: fixed; left: 50%; top: 66px; transform: translateX(-50%); z-index: 12; background: #1b1f26; color: var(--ink);
  border: 1px solid var(--accent); border-radius: 9px; padding: 9px 16px; font-size: 13px; max-width: min(560px, 92vw); }
#loading { position: fixed; inset: 0; z-index: 20; background: var(--bg); display: grid; place-items: center; }
#loading div { text-align: center; }
#loading b { display: block; font-size: 26px; letter-spacing: 0.04em; margin-bottom: 8px; }
#loading span { color: var(--dim); }

#stick { position: fixed; left: 22px; bottom: 96px; width: 112px; height: 112px; border-radius: 50%; z-index: 9; display: none;
  background: rgba(20, 23, 28, 0.45); border: 1px solid rgba(255, 255, 255, 0.3); touch-action: none; }
#stick div { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.8); pointer-events: none; }
body[data-mode='walk'] #stick { display: block; }

@media (max-width: 1120px) {
  #bar { gap: 8px; padding: 0 8px; }
  #modes button, .tog { padding: 6px 9px; font-size: 13px; }
}
@media (max-width: 900px) {
  .brand span { display: none; }
  .tools { flex: 0 1 auto; overflow-x: auto; scrollbar-width: none; } /* a phone: swipe along the buttons */
  #mini { width: 180px; height: 102px; }
  #hint { display: none; }
}
