:root {
  color-scheme: dark;
  font-family: Inter, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body,
#app,
canvas {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: #08090b;
}

canvas {
  display: block;
  cursor: grab;
  touch-action: none;
}

canvas.dragging {
  cursor: grabbing;
}

.help {
  display: grid;
  gap: 4px;
  padding: 11px 14px;
  color: #e8e8e8;
  background: rgb(10 11 14 / 72%);
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 8px;
  box-shadow: 0 8px 30px rgb(0 0 0 / 25%);
  font-size: 13px;
  line-height: 1.35;
  pointer-events: none;
  user-select: none;
  backdrop-filter: blur(8px);
}

.touch-only {
  display: none;
}

.help strong {
  margin-bottom: 2px;
  font-size: 14px;
}

#status {
  margin-top: 3px;
  color: #b9d8ff;
}

#status.error {
  color: #ff9b9b;
}

button {
  color: inherit;
  font: inherit;
}

.top-right-mini-controls {
  position: fixed;
  z-index: 12;
  top: 18px;
  right: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-visibility-control,
.sound-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 8px;
  color: #d6d9de;
  background: rgb(10 11 14 / 78%);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
  user-select: none;
  backdrop-filter: blur(8px);
}

.sound-toggle {
  border: 1px solid rgb(255 255 255 / 12%);
}

.panel-visibility-control input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #ffc77d;
}

.right-stack {
  position: fixed;
  z-index: 5;
  top: 66px;
  right: 18px;
  bottom: 18px;
  width: min(340px, calc(100% - 36px));
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  overflow-x: hidden;
  pointer-events: none;
  scrollbar-width: thin;
  scrollbar-color: rgb(255 199 125 / 40%) transparent;
}

.right-stack > * {
  flex-shrink: 0;
  width: 100%;
}

body.panels-hidden .right-stack,
body.panels-hidden #art-info,
body.panels-hidden .top-right-mini-controls,
body.panels-hidden .movement-joystick {
  display: none;
}

#start-screen {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 70% 20%, rgb(255 188 105 / 16%), transparent 34%),
    linear-gradient(135deg, rgb(6 8 11 / 97%), rgb(22 27 34 / 94%));
  transition: opacity 300ms ease, visibility 300ms ease;
}

#start-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.start-card {
  width: min(560px, 100%);
  padding: 42px;
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: 18px;
  background: rgb(9 11 15 / 72%);
  box-shadow: 0 30px 90px rgb(0 0 0 / 45%);
  backdrop-filter: blur(14px);
}

.start-card h1 {
  margin: 6px 0 14px;
  font-size: clamp(36px, 7vw, 70px);
  line-height: 0.95;
}

.start-card p:not(.eyebrow) {
  max-width: 45ch;
  color: #c9cdd4;
  line-height: 1.6;
}

.exhibition-credit {
  color: #ffc77d !important;
  font-size: 13px;
}

.start-card button {
  margin-top: 18px;
  padding: 12px 20px;
  border: 0;
  border-radius: 999px;
  color: #17120c;
  background: #ffc77d;
  cursor: pointer;
  font-weight: 750;
  transition: opacity 200ms ease;
}

.start-card button:disabled {
  opacity: 0.45;
  cursor: progress;
}

.start-progress {
  margin-top: 22px;
}

.start-progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgb(255 255 255 / 10%);
}

.start-progress-fill {
  width: 0%;
  height: 100%;
  background: #ffc77d;
  border-radius: 999px;
  transition: width 250ms ease;
}

#start-progress-label {
  display: block;
  margin-top: 8px;
  color: #bfc4cc;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.eyebrow {
  margin: 0;
  color: #ffc77d;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.tour-controls {
  display: grid;
  gap: 6px;
  padding: 12px 15px;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 10px;
  background: rgb(10 11 14 / 82%);
  backdrop-filter: blur(8px);
  pointer-events: auto;
}

.tour-controls-buttons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.tour-controls button {
  min-width: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: rgb(255 255 255 / 10%);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.tour-controls button:not(:disabled):hover {
  background: #ffc77d;
  color: #20160c;
}

.tour-controls button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.tour-controls label {
  display: flex;
  justify-content: space-between;
  margin-top: 2px;
  color: #d6d9de;
  font-size: 12px;
}

.tour-controls output {
  color: #ffc77d;
  font-variant-numeric: tabular-nums;
}

.tour-controls input[type="range"] {
  width: 100%;
  height: 5px;
  margin: 0;
  accent-color: #ffc77d;
  cursor: pointer;
}

.tour-status {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  color: #aeb5c0;
  font-size: 11px;
}

.lighting-controls {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 10px;
  background: rgb(10 11 14 / 76%);
  backdrop-filter: blur(8px);
  pointer-events: auto;
}

.lighting-controls span {
  padding: 0 7px;
  color: #aeb5c0;
  font-size: 12px;
}

.lighting-controls button {
  padding: 7px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
}

.lighting-controls button:hover,
.lighting-controls button.active {
  color: #20160c;
  background: #ffc77d;
}

.tuning-controls,
.quality-controls {
  padding: 13px 15px;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 10px;
  background: rgb(10 11 14 / 82%);
  backdrop-filter: blur(8px);
  pointer-events: auto;
}

.tuning-controls label,
.quality-controls label,
.quality-heading {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  color: #d6d9de;
  font-size: 12px;
}

.tuning-controls label:not(:first-child),
.quality-controls label:not(:first-child) {
  margin-top: 11px;
}

.tuning-controls output,
.quality-controls output {
  color: #ffc77d;
  font-variant-numeric: tabular-nums;
}

.tuning-controls input,
.quality-controls input {
  width: 100%;
  height: 5px;
  margin: 0;
  accent-color: #ffc77d;
  cursor: pointer;
}

.tuning-controls .toggle-row,
.quality-controls .toggle-row {
  align-items: center;
  margin-top: 13px;
  margin-bottom: 0;
}

.tuning-controls .toggle-row input,
.quality-controls .toggle-row input {
  width: 17px;
  height: 17px;
  accent-color: #ffc77d;
}

.quality-heading {
  margin-bottom: 8px;
  font-weight: 700;
}

.quality-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 13px;
}

.quality-buttons button {
  padding: 7px 8px;
  border: 0;
  border-radius: 6px;
  background: rgb(255 255 255 / 9%);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.quality-buttons button:hover,
.quality-buttons button.active {
  color: #20160c;
  background: #ffc77d;
}

.curator-card {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  border-left: 2px solid #ffc77d;
  background: rgb(10 11 14 / 68%);
  pointer-events: none;
  backdrop-filter: blur(7px);
}

.curator-card strong {
  margin-top: 3px;
  font-size: 14px;
}

.curator-card span,
.curator-card small {
  color: #bfc4cc;
  font-size: 11px;
}

#art-info {
  position: fixed;
  z-index: 10;
  right: 24px;
  bottom: 24px;
  width: min(390px, calc(100% - 48px));
  padding: 26px;
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: 14px;
  background: rgb(10 12 16 / 91%);
  box-shadow: 0 24px 70px rgb(0 0 0 / 45%);
  backdrop-filter: blur(14px);
}

#art-info h2 {
  margin: 7px 35px 4px 0;
}

#info-meta {
  margin: 0 0 14px;
  color: #ffc77d;
  font-size: 13px;
}

#info-description {
  margin-bottom: 0;
  color: #d4d7dd;
  line-height: 1.55;
}

#close-info {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / 8%);
  cursor: pointer;
  font-size: 23px;
}

@media (max-width: 700px) {
  .top-right-mini-controls {
    top: 12px;
    right: 12px;
  }

  .right-stack {
    top: 58px;
    right: 12px;
    bottom: 156px;
    width: calc(100% - 24px);
  }

  .lighting-controls span {
    display: none;
  }

  .curator-card {
    display: none;
  }

  #art-info {
    right: 12px;
    bottom: 12px;
    width: calc(100% - 24px);
  }
}

@media (pointer: coarse), (max-width: 700px) {
  .movement-joystick {
    display: block;
  }

  .desktop-only {
    display: none;
  }

  .touch-only {
    display: inline;
  }
}

.movement-joystick {
  display: none;
  position: fixed;
  z-index: 8;
  right: 24px;
  bottom: 24px;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  border: 1px solid rgb(255 255 255 / 16%);
  background: rgb(10 11 14 / 55%);
  backdrop-filter: blur(6px);
  touch-action: none;
  user-select: none;
}

.movement-joystick-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 54px;
  height: 54px;
  margin: -27px 0 0 -27px;
  border-radius: 50%;
  background: rgb(255 199 125 / 85%);
  box-shadow: 0 4px 14px rgb(0 0 0 / 35%);
  transition: transform 60ms ease-out;
  pointer-events: none;
}
