/* ==========================================================================
   Merry Christmas — Fullscreen 3D Luminous Tree & Music Box
   Night (default) & Frost Daylight themes · Zero external dependencies
   ========================================================================== */

:root {
  --bg: #040812;
  --glass-bg: rgba(10, 17, 32, 0.56);
  --glass-border: rgba(255, 255, 255, 0.13);
  --glass-hover: rgba(255, 255, 255, 0.09);
  --fg: rgba(247, 243, 234, 0.90);
  --fg-muted: rgba(214, 222, 238, 0.54);
  --active-bg: rgba(251, 211, 124, 0.22);
  --active-fg: #ffe8ad;
  --greeting-color: rgba(255, 241, 206, 0.86);
  --greeting-shadow: 0 2px 24px rgba(251, 191, 36, 0.28);
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.48);
}

html[data-theme="frost"] {
  --bg: #edf2f7;
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(22, 34, 52, 0.12);
  --glass-hover: rgba(22, 34, 52, 0.06);
  --fg: rgba(20, 32, 46, 0.88);
  --fg-muted: rgba(20, 32, 46, 0.46);
  --active-bg: rgba(22, 46, 38, 0.90);
  --active-fg: #f8f5ec;
  --greeting-color: rgba(22, 42, 38, 0.82);
  --greeting-shadow: 0 2px 18px rgba(255, 255, 255, 0.85);
  --shadow: 0 10px 28px rgba(20, 32, 46, 0.09);
}

*, *::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: grab;
}

#stage.is-dragging {
  cursor: grabbing;
}

/* Whisper editorial greeting */
.greeting {
  position: fixed;
  left: 50%;
  bottom: 92px;
  transform: translateX(-50%);
  z-index: 5;
  pointer-events: none;
  text-align: center;
  transition: opacity 0.6s ease;
}

.greeting-text {
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, "Songti SC", serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.25rem, 2.8vw, 1.85rem);
  letter-spacing: 0.14em;
  color: var(--greeting-color);
  text-shadow: var(--greeting-shadow);
  white-space: nowrap;
}

body.is-hidden-hud .greeting {
  bottom: 42px;
}

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

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

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: 22px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
}

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

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

.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;
}

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

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

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

#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="frost"] #btn-theme .icon-sun { display: none; }

#btn-music[aria-pressed="false"] .icon-pause { display: none; }
#btn-music[aria-pressed="true"] .icon-play { display: none; }
#btn-music[aria-pressed="true"] {
  background: var(--active-bg);
  color: var(--active-fg);
}

.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.05em;
  padding: 7px 13px;
  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.94);
}

.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;
}

.icon-pill {
  padding: 7px 10px;
}

.icon-pill svg {
  width: 14px;
  height: 14px;
}

@media (max-width: 520px) {
  .hud-tr { top: 14px; right: 14px; }
  .hud-bc { bottom: 16px; }
  .greeting { bottom: 84px; }
  .mode-btn { padding: 7px 10px; font-size: 11.5px; }
  .whisper { font-size: 10px; letter-spacing: 0.14em; }
}

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