:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #050607;
  color: #f6f3ee;
}

* {
  box-sizing: border-box;
}

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

body {
  background: #050607;
}

.viewer {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-height: 420px;
  overflow: hidden;
  background: #050607;
  touch-action: none;
}

#panoCanvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}

#panoCanvas:active {
  cursor: grabbing;
}

#panoVideo {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: max(18px, env(safe-area-inset-top)) 22px 40px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0));
  pointer-events: none;
}

.topbar h1 {
  margin: 0 0 6px;
  font-size: clamp(22px, 4vw, 44px);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: 0;
}

.topbar p {
  margin: 0;
  color: rgba(246, 243, 238, 0.78);
  font-size: 14px;
}

.status {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  min-width: 168px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(5, 6, 7, 0.78);
  color: #f6f3ee;
  text-align: center;
  backdrop-filter: blur(14px);
}

.status.is-hidden {
  display: none;
}

.controls {
  position: absolute;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 44px 44px minmax(130px, 460px) auto 44px;
  align-items: center;
  gap: 10px;
  width: min(760px, calc(100vw - 28px));
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(8, 10, 11, 0.76);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(18px);
}

button {
  width: 44px;
  height: 38px;
  border: 0;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

button:hover {
  background: rgba(255, 255, 255, 0.2);
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid #e9c46a;
  outline-offset: 2px;
}

input[type="range"] {
  width: 100%;
  accent-color: #e9c46a;
}

#timeLabel {
  min-width: 104px;
  color: rgba(246, 243, 238, 0.82);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

@media (max-width: 620px) {
  .viewer {
    min-height: 100vh;
  }

  .topbar {
    padding-left: 16px;
    padding-right: 16px;
  }

  .controls {
    grid-template-columns: 42px 42px 1fr 42px;
    gap: 8px;
  }

  #timeLabel {
    display: none;
  }
}
