html,
body {
  height: 100%;
  margin: 0;
  background: #000;
}
#pano {
  width: 100vw;
  height: 100vh;
}

/* Pannellumのロード背景（格子）を黒に */
.pnlm-container {
  background: #000 !important;
}
.pnlm-load-box {
  background: rgba(0, 0, 0, 0.7) !important;
}
.pnlm-load-button {
  display: none !important;
}

/* ロード隠し用の黒フェード */
#fade {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #000;
  opacity: 1;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
#fade.hide {
  opacity: 0;
}

.ui {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  padding: 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: linear-gradient(
    145deg,
    rgba(16, 26, 42, 0.82),
    rgba(8, 14, 26, 0.58)
  );
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}
.btn {
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(
    145deg,
    rgba(62, 170, 255, 0.92),
    rgba(28, 127, 221, 0.92)
  );
  color: #f8fbff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 3px 10px rgba(4, 31, 61, 0.35);
  transition:
    transform 0.15s ease,
    filter 0.15s ease;
}
.btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}
.btn.active {
  border-color: rgba(255, 255, 255, 0.82);
  background: linear-gradient(
    145deg,
    rgba(255, 214, 92, 0.98),
    rgba(255, 166, 43, 0.96)
  );
  color: #172032;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 0 0 2px rgba(255, 214, 92, 0.24),
    0 8px 18px rgba(85, 48, 0, 0.34);
}
.btn.sub {
  background: linear-gradient(
    145deg,
    rgba(85, 95, 115, 0.9),
    rgba(60, 68, 84, 0.9)
  );
}

.pose-panel {
  position: fixed;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 10001;
  min-width: 220px;
  max-width: min(320px, calc(100vw - 28px));
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(10, 16, 30, 0.88);
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  color: #e8f1ff;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
}
.pose-panel[hidden] {
  display: none;
}
.pose-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.pose-close {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  cursor: pointer;
}
.pose-value {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pose-minmax-section {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}
.pose-minmax-header {
  font-size: 11px;
  color: rgba(232, 241, 255, 0.7);
  margin-bottom: 6px;
  font-weight: 600;
}
.pose-minmax-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 8px;
}
.pose-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(62, 170, 255, 0.3);
  color: #b8d5ff;
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 10px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease;
}
.pose-btn:hover {
  background: rgba(62, 170, 255, 0.5);
}
.pose-btn:active {
  background: rgba(62, 170, 255, 0.7);
}
.pose-minmax-display {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(100, 150, 200, 0.2);
  border-radius: 4px;
  padding: 6px;
  font-size: 10px;
  max-height: 80px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  color: #a0d8ff;
  font-family: inherit;
  line-height: 1.4;
}
.pose-copy-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 166, 43, 0.4);
  color: #ffe8c0;
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 10px;
  cursor: pointer;
  font-family: inherit;
  width: 100%;
  transition: background 0.15s ease;
}
.pose-copy-btn:hover {
  background: rgba(255, 166, 43, 0.6);
}
.pose-copy-btn:active {
  background: rgba(255, 166, 43, 0.8);
}

@media (max-width: 600px) {
  .ui {
    width: calc(100vw - 20px);
  }
  .btn {
    flex: 1 1 120px;
  }
}
