:root {
  color-scheme: dark;
  --ink: #eef3f2;
  --muted: #c2cecf;
  --paper: #203039;
  --glass: rgba(27, 43, 51, 0.91);
  --line: rgba(214, 228, 229, 0.19);
  --soft: rgba(206, 223, 226, 0.09);
  --accent: #d8e1e2;
  --on-accent: #203039;
  font: 400 13px/1.65 var(--font-ui);
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  color: var(--ink);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  overflow: hidden;
}
body[data-ui="light"] {
  color-scheme: light;
  --ink: #203039;
  --muted: #50636a;
  --glass: rgba(236, 243, 241, 0.93);
  --line: rgba(36, 58, 65, 0.18);
  --soft: rgba(40, 65, 74, 0.07);
  --accent: #263d47;
  --on-accent: #f0f4f2;
}
button,
a,
input {
  touch-action: manipulation;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 0;
  background: none;
}
button:disabled {
  cursor: default;
  opacity: 0.65;
}
a {
  color: inherit;
  text-decoration: none;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 5px;
}
[hidden] {
  display: none !important;
}
#world {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  outline: 0;
  touch-action: none;
  cursor: grab;
}
#world.ray-clickable {
  cursor: pointer;
}
#world.dragging {
  cursor: grabbing;
}
#vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, #10252b50, transparent 19%, transparent 72%, #10252b60);
}
body[data-ui="light"] #vignette {
  opacity: 0.15;
}
.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 27px 36px;
  pointer-events: none;
}
.topbar > * {
  pointer-events: auto;
}
.session {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}
.role-badge {
  font-size: 10px;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 0 5px;
  border-radius: 3px;
}
.peer-status {
  font-size: 11px;
  color: var(--muted);
  margin-left: 10px;
}
.peer-status.online:before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  background: currentColor;
  border-radius: 50%;
  margin: 0 6px 2px 0;
}
.toolbar {
  margin-left: auto;
  display: flex;
  gap: 7px;
}
.quiet {
  font-size: 12px;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--ink);
  transition: background 0.2s;
}
.quiet:hover {
  opacity: 0.7;
}
.quiet[aria-expanded="true"] {
  background: var(--soft);
}
.play-hud {
  position: fixed;
  inset: auto 36px 30px;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 28px;
  pointer-events: none;
}
#instruction {
  font-size: 12px;
  line-height: 1.8;
  max-width: 240px;
  margin: 0;
  color: var(--muted);
}
.journey-controls {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 17px;
}
.mirror-nav {
  display: flex;
  gap: 24px;
}
.mirror-nav button {
  font-size: 12px;
  color: var(--muted);
  padding: 4px 1px;
  border-bottom: 1px solid transparent;
}
.mirror-nav button:hover,
.mirror-nav button.active {
  color: var(--ink);
  border-color: currentColor;
}
.action-row {
  display: flex;
  align-items: center;
  gap: 24px;
}
.back-button {
  font-size: 11px;
  color: var(--muted);
  padding: 11px 0;
}
.back-button:hover {
  color: var(--ink);
}
.cross-button,
.primary {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  min-width: 164px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(20px);
  border-radius: 8px;
  box-shadow:
    inset 0 1px 0 #ffffff15,
    0 8px 30px #10202a15;
  transition:
    background 0.2s,
    border-color 0.2s;
}
.cross-button:hover {
  border-color: var(--accent);
}
.cross-button svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
}
.horizon-meter {
  justify-self: end;
  color: var(--muted);
  font-size: 11px;
  padding-bottom: 13px;
}
.angle-control {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--muted);
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--glass);
}
.angle-control input {
  width: 110px;
  accent-color: #a4bdc5;
  height: 2px;
}
.angle-control output {
  width: 32px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.inspector {
  position: fixed;
  right: 32px;
  top: 86px;
  z-index: 8;
  width: 344px;
  padding: 24px;
  background: var(--glass);
  backdrop-filter: blur(26px) saturate(0.8);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow:
    inset 0 1px 0 #ffffff15,
    0 24px 70px #10242b30;
  max-height: calc(100dvh - 116px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.inspector-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}
.inspector-heading h2 {
  font: 400 32px/1.1 var(--font-display);
  letter-spacing: -0.025em;
  margin: 0;
}
.close {
  font-size: 23px;
  line-height: 1;
  width: 29px;
  height: 29px;
  border-radius: 50%;
  color: var(--muted);
}
.close:hover {
  background: var(--soft);
  color: var(--ink);
}
.panel-intro {
  color: var(--muted);
  font-size: 12px;
  margin: 10px 0 22px;
}
.panel-foot {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  color: var(--muted);
  font-size: 11px;
}
.reset-button {
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.guide-action {
  display: flex;
  align-items: flex-start;
  gap: 19px;
  margin: 24px 0;
}
.guide-action h3 {
  font-weight: 500;
  font-size: 14px;
  margin: 0 0 4px;
}
.guide-action p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
}
.guide-icon {
  width: 25px;
  flex: 0 0 25px;
  font-size: 28px;
  line-height: 1;
}
.mirror-icon {
  height: 27px;
  border: 1px solid var(--muted);
  transform: skewY(-14deg);
  margin-top: 5px;
}
.door-icon {
  height: 30px;
  border: 1px solid var(--muted);
  border-bottom: 0;
  margin-top: 5px;
}
.extra-controls {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  font-size: 12px;
  color: var(--muted);
}
.extra-controls summary {
  cursor: pointer;
  list-style: none;
}
.extra-controls summary:after {
  content: "+";
  float: right;
}
.extra-controls[open] summary:after {
  content: "−";
}
.extra-controls dl {
  display: grid;
  grid-template-columns: 1fr 1.7fr;
  gap: 10px;
  margin: 20px 0;
}
.extra-controls dd {
  margin: 0;
}
.extra-controls kbd {
  font: 10px/1.6 inherit;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 2px 4px;
}
.text-control {
  font-size: 12px;
  padding: 8px 0;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.guide-note {
  font-size: 11px;
  line-height: 1.85;
  color: var(--muted);
  margin: 22px 0 0;
}
.settings {
  --tp-base-background-color: transparent;
  --tp-base-shadow-color: transparent;
  --tp-base-border-radius: 6px;
  --tp-base-font-family: var(--font-ui);
  --tp-base-font-size: 12px;
  --tp-base-line-height: 32px;
  --tp-container-background-color: transparent;
  --tp-container-foreground-color: var(--ink);
  --tp-label-foreground-color: var(--muted);
  --tp-input-background-color: var(--soft);
  --tp-input-foreground-color: var(--ink);
  --tp-button-background-color: var(--soft);
  --tp-button-foreground-color: var(--ink);
  --tp-monitor-background-color: var(--soft);
  --tp-monitor-foreground-color: var(--ink);
  --tp-container-unit-size: 30px;
  --tp-container-unit-spacing: 9px;
}
.settings .tp-lblv {
  margin-bottom: 9px;
}
.settings .tp-fldv {
  margin-top: 16px;
}
.settings .tp-lblv_l {
  width: 44%;
  font-size: 12px;
}
.settings .tp-lblv_v {
  width: 56%;
}
.settings input {
  font-variant-numeric: tabular-nums;
}
.settings .tp-dfwv {
  min-width: 0;
}
.feedback {
  position: fixed;
  left: 50%;
  top: 89px;
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
  padding: 9px 16px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-size: 12px;
  max-width: 80vw;
  text-align: center;
  transition: opacity 0.3s;
  z-index: 9;
}
.feedback.visible {
  opacity: 1;
}
.lobby {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  background: rgba(25, 43, 52, 0.83);
  backdrop-filter: blur(8px);
  z-index: 10;
  color: #eef3f2;
}
.lobby-copy {
  margin-left: 12vw;
  max-width: 550px;
  padding: 32px;
}
.lobby h1 {
  font: italic 400 clamp(90px, 14vw, 164px) / 0.9 var(--font-display);
  letter-spacing: -0.065em;
  font-weight: 400;
  margin: 0 0 35px;
}
.intro {
  font-size: 17px;
  line-height: 1.8;
  color: #ced9db;
  margin-bottom: 32px;
}
.single-links {
  display: flex;
  gap: 24px;
  font-size: 12px;
  margin-top: 27px;
}
.single-links a {
  border-bottom: 1px solid #cad7d544;
  padding-bottom: 3px;
}
.lobby-note {
  font-size: 13px;
  line-height: 1.9;
  color: #bbcace;
  margin-top: 42px;
}
.error {
  position: fixed;
  inset: 20%;
  z-index: 20;
  padding: 40px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.topbar,
.play-hud {
  text-shadow: 0 1px 10px #0a1e2640;
}
body[data-ui="light"] .topbar,
body[data-ui="light"] .play-hud {
  text-shadow: 0 1px 8px #ffffff55;
}
@media (max-width: 1000px) {
  .topbar {
    padding: 24px;
    gap: 20px;
  }
  .peer-status {
    display: none;
  }
  .play-hud {
    inset: auto 24px 24px;
    gap: 15px;
    grid-template-columns: 1fr auto;
  }
  .horizon-meter {
    display: none;
  }
  .inspector {
    right: 24px;
    top: 80px;
  }
}
@media (max-width: 600px) {
  .topbar {
    padding: 20px;
    gap: 12px;
  }
  .wordmark {
    font-size: 40px;
  }
  .documentation-link {
    display: none;
  }
  .session {
    font-size: 11px;
    gap: 5px;
  }
  .toolbar {
    gap: 0;
  }
  .quiet {
    font-size: 11px;
    padding: 8px;
  }
  .role-badge {
    display: none;
  }
  .play-hud {
    inset: auto 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
  #instruction {
    font-size: 11px;
    text-align: center;
    max-width: 320px;
  }
  .journey-controls {
    gap: 12px;
  }
  .cross-button {
    padding: 10px 13px;
    min-width: 164px;
  }
  .inspector {
    right: 16px;
    top: 74px;
    width: min(344px, calc(100vw - 32px));
    padding: 22px;
    max-height: calc(100dvh - 98px);
  }
  .lobby-copy {
    margin: 0;
    padding: 32px;
  }
  .intro {
    font-size: 15px;
  }
  .feedback {
    top: 75px;
    width: max-content;
    font-size: 11px;
  }
  .mirror-nav {
    gap: 30px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    transition: none !important;
  }
}

.panel-hint {
  font-size: 11px;
  color: var(--muted);
  margin: 16px 0 0;
  line-height: 1.7;
}

.guidance {
  max-width: 260px;
}
.hover-hint {
  height: 25px;
  margin: 0 0 7px;
  opacity: 0;
  font: italic 400 23px/1 var(--font-display);
  transition: opacity 160ms ease;
}
.hover-hint.visible {
  opacity: 0.86;
}
.inspector {
  border-radius: 12px;
}
.toolbar a {
  display: inline-flex;
  align-items: center;
}
.guide-action p,
.panel-intro {
  font-size: 13px;
}
.guide-action h3 {
  font-weight: 500;
  letter-spacing: -0.01em;
}
@media (max-width: 600px) {
  .toolbar .documentation-link {
    display: none;
  }
  .hover-hint {
    display: none;
  }
}
@media (hover: none) {
  .hover-hint {
    display: none;
  }
}

body.presentation :is(.topbar, .inspector, .play-hud, .feedback) {
  visibility: hidden;
  pointer-events: none;
}
