* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background: #78bff4;
  color: #ffffff;
  font-family: "DM Sans", Arial, Helvetica, sans-serif;
}

button {
  font: inherit;
}

input,
textarea {
  font: inherit;
}

#app {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

#scene {
  display: block;
  width: 100vw;
  height: 100vh;
  cursor: grab;
  outline: none;
  touch-action: none;
}

.tuning-panel {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 3;
  display: grid;
  width: min(280px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  background: rgba(20, 32, 22, 0.72);
  color: #ffffff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(10px);
}

.tuning-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 22px;
}

.tuning-panel__header strong {
  font-size: 14px;
}

#export-status {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  white-space: nowrap;
}

.tuning-panel label {
  display: grid;
  grid-template-columns: 92px 1fr;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.tuning-panel input[type="range"] {
  width: 100%;
  accent-color: #b2d83d;
}

.tuning-panel input[type="checkbox"] {
  accent-color: #b2d83d;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.tuning-panel__hint {
  margin: -6px 0 2px 102px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 10px;
  line-height: 1.25;
}

.tuning-panel__range-with-output {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: center;
  gap: 7px;
}

.tuning-panel__range-with-output input[type="range"] {
  min-width: 0;
}

.tuning-panel__range-with-output output {
  color: rgba(255, 255, 255, 0.78);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.tuning-panel input[type="color"] {
  width: 100%;
  min-width: 0;
  height: 28px;
  padding: 2px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
}

.tuning-panel button {
  min-height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  cursor: pointer;
}

.tuning-panel button:hover,
.tuning-panel button:focus-visible {
  background: rgba(255, 255, 255, 0.26);
}

#settings-output {
  display: none;
  width: 100%;
  min-height: 94px;
  resize: vertical;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.32);
  color: #ffffff;
  font-family: Consolas, "Courier New", monospace;
  font-size: 11px;
}

#spawn-output {
  display: none;
  width: 100%;
  min-height: 94px;
  resize: vertical;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.32);
  color: #ffffff;
  font-family: Consolas, "Courier New", monospace;
  font-size: 11px;
}

#settings-output.has-settings {
  display: block;
}

#spawn-output.has-spawn {
  display: block;
}

.fps-meter {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 4;
  display: none;
  width: 128px;
  gap: 6px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  background: rgba(17, 25, 18, 0.7);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-align: right;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(10px);
  pointer-events: none;
}

.fps-meter__track {
  display: block;
  width: 100%;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}

body.show-fps .fps-meter {
  display: grid;
}

.fps-meter__bar {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #e85f4a, #f0b44b 46%, #bfff00);
  transition: width 120ms linear;
}

body.ui-hidden .tuning-panel,
body.ui-hidden .fps-meter,
body.ui-hidden .quality-control {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.quality-control {
  position: absolute;
  left: 0;
  bottom: 44px;
  z-index: 4;
  width: 216px;
  padding: 13px 14px 11px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 21px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0.1) 45%, rgba(157, 210, 255, 0.2)),
    rgba(18, 35, 40, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.52),
    inset 0 -12px 24px rgba(40, 100, 128, 0.1),
    0 16px 38px rgba(0, 22, 30, 0.25);
  color: #ffffff;
  backdrop-filter: blur(22px) saturate(175%);
  -webkit-backdrop-filter: blur(22px) saturate(175%);
  /* hidden by default — toggled by the cog button */
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transform: translateY(6px) scale(0.98);
  transform-origin: left bottom;
  transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s linear 0.25s;
}

.quality-control.is-visible {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transform: translateY(0) scale(1);
  transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.quality-control::before {
  position: absolute;
  top: -52px;
  left: -24px;
  width: 150px;
  height: 86px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  content: "";
  filter: blur(14px);
  opacity: 0.78;
  pointer-events: none;
}

.quality-control.is-dragging {
  transform: translateY(-4px) scale(1.025);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 -12px 24px rgba(40, 100, 128, 0.14),
    0 23px 48px rgba(0, 22, 30, 0.3);
}

.quality-control__header,
.quality-slider,
.quality-steps {
  position: relative;
  z-index: 2;
}

/* XP Welcome Screen Styles */
.xp-welcome-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 50%, rgba(12, 67, 107, 0.4) 0%, rgba(3, 21, 38, 0.6) 100%);
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.xp-banner {
  height: 15vh;
  width: 100%;
  background: linear-gradient(to bottom, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0.05) 49%, rgba(0,0,0,0.2) 50%, rgba(0,0,0,0.5) 100%);
  backdrop-filter: blur(15px);
  border-top: 1px solid rgba(255,255,255,0.6);
  border-bottom: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 4px 20px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.8);
}

.xp-banner-top {
}

.xp-banner-bottom {
  margin-top: auto;
}

.xp-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.xp-welcome-text {
  font-family: "DM Sans", sans-serif;
  font-size: clamp(3rem, 6vw, 60px);
  font-weight: 300;
  color: #ffffff;
  text-shadow: 0 0 15px rgba(255, 255, 255, 0.6), 0 0 30px rgba(120, 200, 255, 0.4);
  margin: 0;
  letter-spacing: 2px;
  text-align: right;
  flex: 1;
}

.xp-login-area {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
}

.xp-divider {
  width: 1px;
  height: 120px;
  border-right: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 1px 0 0 rgba(0, 0, 0, 0.3);
}

.xp-login-box {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 30px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.05) 100%);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.6);
  backdrop-filter: blur(8px);
  flex: 1;
  transition: box-shadow 0.3s ease, border-color 0.3s ease, background 0.3s ease;
  cursor: pointer;
}

.xp-login-box:hover {
  background: linear-gradient(to bottom, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0.1) 100%);
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 8px 32px rgba(120, 200, 255, 0.4), inset 0 1px 0 rgba(255,255,255,0.8), 0 0 15px rgba(255, 255, 255, 0.3);
}

.xp-avatar {
  width: 56px;
  height: 56px;
  box-sizing: border-box;
  padding: 4px;
  border: 2px solid rgba(255,255,255,0.6);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.8);
  object-fit: contain;
  background: rgba(255,255,255,0.1);
}

.xp-user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.xp-username {
  font-family: "DM Sans", sans-serif;
  font-weight: normal;
  font-size: 28px;
  color: white;
  margin-bottom: 4px;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.xp-status {
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
  color: #aaddff;
  font-weight: normal;
}

.quality-control__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.quality-control__header-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.quality-control output {
  color: rgba(255, 255, 255, 0.78);
  font-size: 11px;
  font-weight: 600;
}

.quality-control__tuning-toggle {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 2px 6px rgba(0, 27, 38, 0.16);
  cursor: pointer;
}

.quality-control__tuning-toggle span {
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-right: 1.5px solid rgba(255, 255, 255, 0.92);
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.92);
  transform: rotate(45deg);
  transition: transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1), margin 180ms ease;
}

.quality-control__tuning-toggle[aria-expanded="true"] span {
  margin-top: 3px;
  transform: rotate(225deg);
}

.quality-control__tuning-toggle:hover,
.quality-control__tuning-toggle:focus-visible {
  background: rgba(255, 255, 255, 0.28);
  outline: none;
}

.quality-slider {
  height: 26px;
  margin: 0 11px;
  --quality-thumb-size: 22px;
}

.quality-slider__track {
  position: absolute;
  top: 7px;
  right: 0;
  left: 0;
  height: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(4, 27, 34, 0.25);
  box-shadow: inset 0 1px 3px rgba(0, 17, 22, 0.24), 0 1px 0 rgba(255, 255, 255, 0.24);
}

.quality-slider__fill {
  display: block;
  width: var(--quality-progress);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(154, 222, 255, 0.92), rgba(219, 255, 244, 0.95));
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.75), 0 0 12px rgba(168, 236, 255, 0.45);
  transition: width 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.quality-slider input {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 26px;
  margin: 0;
  cursor: grab;
  opacity: 0;
}

.quality-slider input:active {
  cursor: grabbing;
}

.quality-slider:has(input:focus-visible) .quality-slider__thumb {
  outline: 2px solid rgba(255, 255, 255, 0.96);
  outline-offset: 3px;
}

.quality-slider__thumb {
  position: absolute;
  top: 2px;
  left: var(--quality-progress);
  width: var(--quality-thumb-size);
  height: var(--quality-thumb-size);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(170, 229, 245, 0.74));
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.9), 0 4px 11px rgba(0, 40, 55, 0.34);
  transform: translateX(-50%);
  transition: left 180ms cubic-bezier(0.2, 0.8, 0.2, 1), transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.quality-slider__thumb::after {
  position: absolute;
  top: 3px;
  left: 5px;
  width: 7px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  content: "";
  filter: blur(1px);
}

.quality-control.is-dragging .quality-slider__fill,
.quality-control.is-dragging .quality-slider__thumb {
  transition-duration: 0ms;
}

.quality-control.is-dragging .quality-slider__thumb {
  transform: translateX(-50%) scale(1.16);
}

.quality-steps {
  display: flex;
  justify-content: space-between;
  padding: 2px 7px 0;
}

.quality-steps span {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.36);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
  transition: background 160ms ease, transform 160ms ease;
}

.quality-steps span.is-active {
  background: rgba(239, 255, 255, 0.96);
  transform: scale(1.45);
}

/* Scene tuning is intentionally tucked behind the quality card until asked for. */
.tuning-panel {
  top: auto;
  right: 18px;
  bottom: 117px;
  left: auto;
  z-index: 5;
  max-height: calc(100vh - 136px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(0.97);
  transform-origin: right bottom;
  transition: opacity 180ms ease, transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s linear 220ms;
  visibility: hidden;
}

.tuning-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  transition: opacity 180ms ease, transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
  visibility: visible;
}

body.ui-hidden .tuning-panel {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

@media (max-width: 700px) {
  .quality-control {
    /* Leave the full cog hit target exposed while the card is open. */
    right: auto;
    bottom: 44px;
    width: 198px;
  }

  .tuning-panel {
    right: 12px;
    /* Stack above the open quality card, including a small touch gap. */
    bottom: 165px;
    max-height: calc(100vh - 181px);
  }
}

body.is-locked #scene {
  cursor: none;
}

.wallpaper-screen {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  opacity: 1;
  padding: 0;
  transition: opacity 900ms ease, visibility 0s linear 0s;
  visibility: visible;
}



.wallpaper-screen:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.86);
  outline-offset: -10px;
}

body.scene-started .wallpaper-screen {
  opacity: 0;
  pointer-events: none;
  transition: opacity 900ms ease, visibility 0s linear 900ms;
  visibility: hidden;
}

/* Shared glassmorphism popup style */
.attribution-popup,
.volume-popup {
  position: absolute;
  bottom: 44px;
  left: 0;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0.1) 45%, rgba(157, 210, 255, 0.2)),
    rgba(18, 35, 40, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.52),
    inset 0 -12px 24px rgba(40, 100, 128, 0.1),
    0 16px 38px rgba(0, 22, 30, 0.35);
  color: #ffffff;
  backdrop-filter: blur(22px) saturate(175%);
  -webkit-backdrop-filter: blur(22px) saturate(175%);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.attribution-popup {
  width: 280px;
  padding: 14px;
  font-size: 12px;
  line-height: 1.5;
}

.volume-popup {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 52px;
  padding: 14px 10px;
  font-size: 11px;
  font-weight: 600;
}

.attribution-container:hover .attribution-popup,
.attribution-btn:focus + .attribution-popup,
.attribution-popup:focus-within {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.volume-popup.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.bottom-left-controls {
  position: absolute;
  bottom: 18px;
  left: 18px;
  z-index: 10;
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 8px;
}

.bottom-right-controls {
  position: absolute;
  bottom: 18px;
  right: 18px;
  z-index: 10;
  display: flex;
  align-items: flex-end;
}

.bottom-left-controls,
.bottom-right-controls,
.fps-meter,
.mobile-controls {
  transition: opacity 420ms ease;
}

body.auto-drive-ui-idle .bottom-left-controls,
body.auto-drive-ui-idle .bottom-right-controls,
body.auto-drive-ui-idle .tuning-panel,
body.auto-drive-ui-idle .fps-meter,
body.auto-drive-ui-idle .mobile-controls {
  opacity: 0;
  pointer-events: none;
}

.footer-text {
  color: rgba(255, 255, 255, 0.48);
  font-size: 12px;
  text-decoration: none;
  letter-spacing: 0.5px;
  transition: color 0.2s ease;
  line-height: 32px;
}

.footer-text:hover {
  color: rgba(255, 255, 255, 0.8);
}

.attribution-container,
.volume-container,
.settings-container {
  position: relative;
}

.attribution-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.48);
  background: rgba(18, 35, 40, 0.28);
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.52),
    0 2px 8px rgba(0, 22, 30, 0.25);
  backdrop-filter: blur(22px) saturate(175%);
  -webkit-backdrop-filter: blur(22px) saturate(175%);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-family: inherit;
  font-size: 16px;
  font-weight: bold;
  transition: background 0.2s, transform 0.2s;
}

.attribution-btn:hover,
.attribution-btn:focus-visible {
  background: rgba(255, 255, 255, 0.35);
  transform: scale(1.05);
}

.auto-drive-btn {
  position: relative;
}

.auto-drive-btn[aria-pressed="true"] {
  border-color: rgba(212, 255, 138, 0.82);
  background: rgba(123, 184, 45, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    0 0 0 3px rgba(191, 255, 0, 0.12),
    0 2px 8px rgba(0, 22, 30, 0.25);
}

.auto-drive-btn[aria-pressed="true"]:hover,
.auto-drive-btn[aria-pressed="true"]:focus-visible {
  background: rgba(138, 198, 54, 0.68);
}

.auto-drive-icon {
  position: relative;
  display: block;
  width: 12px;
  height: 14px;
}

.auto-drive-icon::before {
  position: absolute;
  top: 1px;
  left: 2px;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid currentColor;
  content: "";
}

.auto-drive-icon::after {
  content: none;
}

.auto-drive-btn[aria-pressed="true"] .auto-drive-icon::before,
.auto-drive-btn[aria-pressed="true"] .auto-drive-icon::after {
  position: absolute;
  top: 1px;
  width: 3px;
  height: 12px;
  border: 0;
  border-radius: 1px;
  background: currentColor;
  content: "";
}

.auto-drive-btn[aria-pressed="true"] .auto-drive-icon::before {
  left: 2px;
}

.auto-drive-btn[aria-pressed="true"] .auto-drive-icon::after {
  right: 2px;
}

.fullscreen-icon {
  display: block;
  width: 16px;
  height: 16px;
  background:
    linear-gradient(currentColor 0 0) left top / 6px 1.5px no-repeat,
    linear-gradient(currentColor 0 0) left top / 1.5px 6px no-repeat,
    linear-gradient(currentColor 0 0) right top / 6px 1.5px no-repeat,
    linear-gradient(currentColor 0 0) right top / 1.5px 6px no-repeat,
    linear-gradient(currentColor 0 0) right bottom / 6px 1.5px no-repeat,
    linear-gradient(currentColor 0 0) right bottom / 1.5px 6px no-repeat,
    linear-gradient(currentColor 0 0) left bottom / 6px 1.5px no-repeat,
    linear-gradient(currentColor 0 0) left bottom / 1.5px 6px no-repeat;
}

.fullscreen-btn[aria-pressed="true"] .fullscreen-icon {
  background:
    linear-gradient(currentColor 0 0) left 1px top 6px / 6px 1.5px no-repeat,
    linear-gradient(currentColor 0 0) left 6px top 1px / 1.5px 6px no-repeat,
    linear-gradient(currentColor 0 0) right 1px top 6px / 6px 1.5px no-repeat,
    linear-gradient(currentColor 0 0) right 6px top 1px / 1.5px 6px no-repeat,
    linear-gradient(currentColor 0 0) right 1px bottom 6px / 6px 1.5px no-repeat,
    linear-gradient(currentColor 0 0) right 6px bottom 1px / 1.5px 6px no-repeat,
    linear-gradient(currentColor 0 0) left 1px bottom 6px / 6px 1.5px no-repeat,
    linear-gradient(currentColor 0 0) left 6px bottom 1px / 1.5px 6px no-repeat;
}

.attribution-popup a {
  color: #9adeff;
  text-decoration: none;
}

.attribution-popup a:hover,
.attribution-popup a:focus-visible {
  text-decoration: underline;
}

/* Volume slider — vertical */
.volume-slider {
  writing-mode: vertical-lr;
  direction: rtl;
  -webkit-appearance: slider-vertical;
  appearance: slider-vertical;
  width: 6px;
  height: 100px;
  accent-color: #9adeff;
  cursor: pointer;
  flex-shrink: 0;
}


/* Mobile Controls */
.mobile-controls {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  touch-action: none;
}

body.scene-started .mobile-controls {
  display: flex;
}

.mobile-joystick-zone {
  flex: 1;
  height: 100%;
  position: relative;
}

.mobile-look-zone {
  flex: 1;
  height: 100%;
}

.mobile-joystick-base {
  position: absolute;
  bottom: 80px;
  left: 80px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(4px);
  transform: translate(-50%, -50%);
  display: none;
  pointer-events: none;
}

.mobile-joystick-thumb {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  transform: translate(-50%, -50%);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

@media (pointer: fine) {
  .mobile-controls {
    display: none !important;
  }
}

.xp-prompt-text {
  position: absolute;
  bottom: 80px;
  font-family: "DM Sans", sans-serif;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.8);
  text-shadow: 0 0 10px rgba(0,0,0,0.5);
  animation: pulseOpacity 2.5s infinite ease-in-out;
  pointer-events: none;
  display: none;
}

@keyframes pulseOpacity {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

.mobile-text {
  display: none;
}

@media (pointer: coarse) {
  .desktop-text { display: none; }
  .mobile-text { display: none; }
}

@media (max-width: 768px) {
  .xp-login-area {
    flex-direction: column;
    gap: 20px;
  }
  .xp-divider {
    width: 200px;
    height: 1px;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
  }
  .xp-welcome-text {
    text-align: center;
  }
}
