/* ============================================================================
   WEASEL NEON — Stylized Storybook Arcade Glass HUD
   ============================================================================ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #141928;
  font-family: ui-rounded, 'SF Pro Rounded', 'Quicksand', 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #fffaf2;
}

#gl-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  cursor: grab;
  touch-action: none;
}

#gl-canvas:active {
  cursor: grabbing;
}

/* Shared warm frosted-glass card aesthetic */
.glass-pill {
  background: rgba(24, 21, 36, 0.56);
  backdrop-filter: blur(14px) saturate(145%);
  -webkit-backdrop-filter: blur(14px) saturate(145%);
  border: 1.5px solid rgba(255, 245, 224, 0.22);
  box-shadow:
    0 10px 30px rgba(10, 8, 22, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.20);
  border-radius: 18px;
}

/* Top-left title & live weasel status */
.top-left {
  position: fixed;
  top: 16px;
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  z-index: 10;
}

.title-card {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 11px;
  pointer-events: auto;
}

.title-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ff6d94 0%, #ffbe5c 52%, #67e6cb 100%);
  display: grid;
  place-items: center;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(255, 109, 148, 0.42);
  flex-shrink: 0;
}

.title-text h1 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.15;
  background: linear-gradient(90deg, #fffaf0 0%, #ffe0a8 55%, #8ef6e0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.title-text p {
  font-size: 11.5px;
  color: rgba(255, 245, 228, 0.78);
  margin-top: 2px;
  font-weight: 600;
}

.status-pill {
  align-self: flex-start;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #ffe89c;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Top-right Chiptune Music Widget */
.top-right {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.music-card {
  padding: 9px 13px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.eq-meter {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 24px;
  padding: 2px 3px;
}

.eq-bar {
  width: 4px;
  height: 18%;
  border-radius: 2px;
  background: linear-gradient(to top, #67e6cb, #ffe066, #ff6d94);
  transition: height 75ms ease-out;
}

.music-controls {
  display: flex;
  align-items: center;
  gap: 7px;
}

.vol-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  padding-left: 4px;
}

.vol-slider {
  width: 58px;
  accent-color: #67e6cb;
  cursor: pointer;
}

.track-meta {
  font-size: 11px;
  color: rgba(255, 245, 228, 0.78);
  padding: 4px 11px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.track-meta strong {
  color: #88f3dc;
  font-weight: 700;
}

/* Inviting Click-for-Chiptune Prompt (flows cleanly above dock; auto-hides once playing) */
.audio-banner {
  position: relative;
  padding: 9px 18px;
  border-radius: 999px;
  border: 2px solid rgba(255, 232, 156, 0.78);
  background: linear-gradient(135deg, rgba(255, 99, 136, 0.92), rgba(255, 168, 76, 0.92));
  color: #fffdf8;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 8px 26px rgba(255, 99, 136, 0.45);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  animation: gentleFloat 2.4s ease-in-out infinite;
  transition: opacity 0.25s ease, transform 0.25s ease;
  margin-bottom: 2px;
}

.audio-banner:hover {
  transform: scale(1.05);
}

.audio-banner.hidden {
  display: none;
}

@keyframes gentleFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-4px); }
}

/* Bottom Interactive Control Dock */
.bottom-dock {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  max-width: calc(100vw - 24px);
}

.hud-toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hint-chip {
  font-size: 11px;
  color: rgba(255, 248, 235, 0.72);
  background: rgba(20, 18, 32, 0.44);
  backdrop-filter: blur(8px);
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.hud-panel {
  padding: 9px 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.hud-panel.collapsed {
  display: none;
}

.ctrl-group {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 4px;
}

.ctrl-group + .ctrl-group {
  border-left: 1px solid rgba(255, 245, 224, 0.16);
  padding-left: 10px;
}

.group-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 245, 224, 0.56);
  font-weight: 800;
  margin-right: 2px;
}

/* Tactile Arcade Buttons */
.btn {
  appearance: none;
  border: 1px solid rgba(255, 248, 232, 0.20);
  background: rgba(255, 255, 255, 0.09);
  color: #fffaf2;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: 11px;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 248, 232, 0.42);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(1px) scale(0.97);
}

.btn.active {
  background: linear-gradient(135deg, rgba(103, 230, 203, 0.34), rgba(108, 182, 235, 0.34));
  border-color: rgba(126, 242, 216, 0.85);
  color: #ffffff;
  box-shadow: 0 0 14px rgba(103, 230, 203, 0.32);
}

.btn-toy-pink {
  background: linear-gradient(135deg, rgba(255, 99, 136, 0.48), rgba(255, 135, 110, 0.45));
  border-color: rgba(255, 155, 178, 0.65);
}

.btn-toy-mint {
  background: linear-gradient(135deg, rgba(72, 219, 188, 0.42), rgba(108, 190, 238, 0.40));
  border-color: rgba(126, 242, 216, 0.65);
}

.btn-toy-gold {
  background: linear-gradient(135deg, rgba(255, 194, 66, 0.46), rgba(242, 118, 56, 0.46));
  border-color: rgba(255, 222, 122, 0.72);
}

.btn-mini {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 999px;
}

.btn.pop {
  animation: btnPop 0.28s cubic-bezier(0.22, 1.5, 0.36, 1);
}

@keyframes btnPop {
  0% { transform: scale(1); }
  45% { transform: scale(1.13); }
  100% { transform: scale(1); }
}

@media (max-width: 860px) {
  .hint-chip { display: none; }
  .group-label { display: none; }
  .ctrl-group + .ctrl-group { border-left: none; padding-left: 4px; }
  .title-text p { display: none; }
}
