/* ==========================================================================
   Fullscreen Immersive Canvas Styles
   Dark Night (default) & Warm Paper themes · Zero external dependencies
   ========================================================================== */

:root {
  --bg: #06070c;
  --glass-bg: rgba(16, 19, 30, 0.56);
  --glass-border: rgba(255, 255, 255, 0.11);
  --glass-hover: rgba(255, 255, 255, 0.08);
  --fg: rgba(241, 245, 255, 0.88);
  --fg-muted: rgba(203, 213, 235, 0.52);
  --active-bg: rgba(255, 255, 255, 0.14);
  --active-fg: #ffffff;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.42);
}

html[data-theme="paper"] {
  --bg: #f3efe6;
  --glass-bg: rgba(250, 248, 242, 0.72);
  --glass-border: rgba(28, 29, 33, 0.12);
  --glass-hover: rgba(28, 29, 33, 0.06);
  --fg: rgba(24, 25, 28, 0.86);
  --fg-muted: rgba(24, 25, 28, 0.44);
  --active-bg: rgba(24, 25, 28, 0.9);
  --active-fg: #f7f4ec;
  --shadow: 0 10px 30px rgba(24, 25, 28, 0.08);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
  transition: background-color 0.45s ease;
}

#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: crosshair;
}

/* Floating Micro HUD */
.hud {
  position: fixed;
  z-index: 10;
  transition: opacity 0.55s ease, transform 0.35s ease;
}

body.is-idle .hud {
  opacity: 0.28;
}

body.is-hidden-hud .hud {
  opacity: 0;
  pointer-events: none;
}

.hud:hover {
  opacity: 1 !important;
}

.hud-tr {
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-bc {
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.whisper {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-muted);
  pointer-events: none;
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.whisper.is-gone {
  opacity: 0;
  transform: translateY(4px);
}

/* Icon Buttons */
.icon-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.12s ease, border-color 0.2s ease;
}

.icon-btn:hover {
  background: var(--glass-hover);
}

.icon-btn:active {
  transform: scale(0.93);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

/* Toggle icon states */
#btn-sound[aria-pressed="true"] .icon-off { display: none; }
#btn-sound[aria-pressed="false"] .icon-on { display: none; }
#btn-sound[aria-pressed="false"] { color: var(--fg-muted); }

html[data-theme="night"] #btn-theme .icon-moon { display: none; }
html[data-theme="paper"] #btn-theme .icon-sun { display: none; }

/* Bottom Mode Pill Dock */
.dock {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.mode-btn {
  border: none;
  background: transparent;
  color: var(--fg-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.22s ease, color 0.22s ease, transform 0.12s ease;
}

.mode-btn:hover {
  color: var(--fg);
  background: var(--glass-hover);
}

.mode-btn:active {
  transform: scale(0.95);
}

.mode-btn.is-active {
  background: var(--active-bg);
  color: var(--active-fg);
}

.dock-divider {
  width: 1px;
  height: 16px;
  background: var(--glass-border);
  margin: 0 2px;
}

.mode-pulse {
  padding: 7px 10px;
}

.mode-pulse svg {
  width: 15px;
  height: 15px;
}

@media (max-width: 520px) {
  .hud-tr { top: 14px; right: 14px; }
  .hud-bc { bottom: 18px; }
  .mode-btn { padding: 7px 12px; font-size: 11.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .hud, .whisper, html, body { transition-duration: 0.01ms !important; }
}
