/* finesse: Lumen glass panorama · cool mineral · SOUL 7 SPECTACLE 6 DENSITY 3 */
:root {
  --bg: #0b0d12;
  --ink: #f2f4f8;
  --ink-soft: rgba(242, 244, 248, 0.72);
  --ink-mute: rgba(242, 244, 248, 0.48);
  --glass: rgba(255, 255, 255, 0.1);
  --glass-strong: rgba(255, 255, 255, 0.16);
  --glass-press: rgba(255, 255, 255, 0.22);
  --stroke: rgba(255, 255, 255, 0.22);
  --stroke-soft: rgba(255, 255, 255, 0.1);
  --accent: #8ec8ff;
  --accent-ink: #061018;
  --shadow: 0 18px 48px rgba(4, 8, 16, 0.45);
  --radius: 22px;
  --radius-sm: 14px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: "Instrument Sans", "SF Pro Display", "PingFang SC", "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --press-ms: 120ms;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#pano {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(120% 80% at 50% 20%, #1a2233 0%, transparent 55%),
    linear-gradient(160deg, #0b0d12, #121826 55%, #0a1018);
}

.chrome {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.chrome > * { pointer-events: auto; }
.hud-center { pointer-events: none; }

.glass-panel {
  background: linear-gradient(165deg, var(--glass-strong), var(--glass));
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
}

.glass-chip {
  background: rgba(12, 16, 24, 0.35);
  border: 1px solid var(--stroke-soft);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.top-bar {
  position: absolute;
  top: calc(14px + var(--safe-t));
  left: 14px;
  right: 14px;
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 10px 14px;
  border-radius: var(--radius);
  animation: rise 0.7s var(--ease) both;
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background:
    radial-gradient(circle at 30% 28%, #fff 0%, transparent 35%),
    linear-gradient(145deg, #b9dcff, #5aa0e8 55%, #2a4f7a);
  box-shadow: 0 6px 16px rgba(90, 160, 232, 0.35);
  flex: 0 0 auto;
}

.brand-name {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.brand-sub {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 42vw;
  transition: opacity 0.25s var(--ease);
}

.hud-center {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

.hud-center.is-gone {
  opacity: 0;
  transform: translate(-50%, calc(-50% - 8px));
  pointer-events: none;
}

.hint-pill {
  margin: 0;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

.bottom-dock {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: calc(14px + var(--safe-b));
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: calc(var(--radius) + 4px);
  animation: rise 0.8s var(--ease) 0.08s both;
}

.scene-rail {
  display: flex;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.scene-rail::-webkit-scrollbar { display: none; }

/* R2 / R14 / R35–R42 button states */
.scene-chip,
.icon-btn,
.text-btn {
  appearance: none;
  border: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition:
    transform var(--press-ms) var(--ease),
    background 160ms var(--ease),
    opacity 160ms var(--ease),
    box-shadow 160ms var(--ease),
    border-color 160ms var(--ease);
}

.scene-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid transparent;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 500;
}

.scene-chip .chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.35;
}

.scene-chip:hover { background: rgba(255, 255, 255, 0.12); color: var(--ink); }
.scene-chip:active { transform: scale(0.96); }
.scene-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.scene-chip.is-active {
  background: rgba(142, 200, 255, 0.22);
  border-color: rgba(142, 200, 255, 0.45);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.scene-chip.is-active .chip-dot { background: var(--accent); opacity: 1; }
.scene-chip:disabled,
.icon-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.ctrl-cluster {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}

.icon-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--stroke-soft);
  color: var(--ink);
}

.icon-btn:hover { background: rgba(255, 255, 255, 0.14); }
.icon-btn:active { transform: scale(0.94); background: var(--glass-press); }
.icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon-btn.primary {
  background: linear-gradient(160deg, #c7e4ff, var(--accent));
  color: var(--accent-ink);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 8px 20px rgba(90, 160, 232, 0.35);
}
.icon-btn.primary[aria-pressed="true"] {
  background: linear-gradient(160deg, #ffe8b8, #ffc46a);
  box-shadow: 0 8px 20px rgba(255, 180, 80, 0.35);
}
.icon-btn.is-loading {
  pointer-events: none;
  opacity: 0.55;
}

.info-sheet {
  position: absolute;
  left: 14px;
  right: 14px;
  top: calc(78px + var(--safe-t));
  max-width: 360px;
  margin: 0 auto;
  padding: 18px 18px 14px;
  border-radius: var(--radius);
  transform-origin: top center;
  animation: sheet-in 0.35s var(--ease) both;
}

.info-sheet[hidden] { display: none; }

.info-sheet h2 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.info-sheet p {
  margin: 0 0 14px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.text-btn {
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 0;
}
.text-btn:active { opacity: 0.7; }
.text-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.load-veil {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(8, 10, 14, 0.35);
  transition: opacity 0.45s var(--ease);
  pointer-events: none;
}

.load-veil.is-done {
  opacity: 0;
  visibility: hidden;
}

.load-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
}

.load-card p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

.toast {
  position: absolute;
  left: 50%;
  bottom: calc(110px + var(--safe-b));
  transform: translateX(-50%) translateY(8px);
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(12, 16, 24, 0.72);
  border: 1px solid var(--stroke-soft);
  backdrop-filter: blur(16px);
  font-size: 12.5px;
  color: var(--ink-soft);
  opacity: 0;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  pointer-events: none;
  white-space: nowrap;
}

.toast.is-on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast[hidden] { display: none; }

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes sheet-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 560px) {
  .bottom-dock { flex-direction: column; align-items: stretch; }
  .ctrl-cluster { justify-content: space-between; }
  .ctrl-cluster .icon-btn { flex: 1; }
  .brand-sub { max-width: 48vw; }
}

@media (hover: none) {
  .scene-chip:hover,
  .icon-btn:hover { background: rgba(255, 255, 255, 0.08); }
  .icon-btn.primary:hover {
    background: linear-gradient(160deg, #c7e4ff, var(--accent));
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
