* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --ochre: #B8860B;
  --cream: #FFFDD0;
  --slate: #708090;
  --midnight: #191970;
  --gold: #FFD700;
  --bg-dark: #0a0a1a;
  --bg-mid: #12122a;
  --hud-bg: rgba(10, 10, 30, 0.85);
  --hud-border: rgba(255, 215, 0, 0.15);
  --font-mono: 'JetBrains Mono', monospace;
  --font-serif: 'Newsreader', serif;
}

body {
  background: linear-gradient(135deg, #050510 0%, #0a0a2e 40%, #0f0f1a 100%);
  color: var(--cream);
  font-family: var(--font-mono);
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  cursor: crosshair;
}

#scene-container {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 1;
}

#scene-container canvas {
  display: block;
}

/* HUD */
#hud {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 100;
  background: var(--hud-bg);
  border: 1px solid var(--hud-border);
  border-radius: 6px;
  padding: 14px 18px;
  min-width: 280px;
  backdrop-filter: blur(12px);
  font-size: 11px;
  line-height: 1.6;
}

.hud-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 2px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--hud-border);
  padding-bottom: 6px;
}

.hud-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.hud-label {
  color: var(--slate);
  font-size: 9px;
  font-weight: 200;
  letter-spacing: 1.5px;
  min-width: 60px;
  text-transform: uppercase;
}

.hud-value {
  color: var(--cream);
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 6px;
}

.scent-value {
  font-style: italic;
  color: #a8d8a8;
  font-family: var(--font-serif);
  font-size: 11px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.dot.quiescent {
  background: var(--slate);
  animation: pulse-dim 3s ease-in-out infinite;
}

.dot.active {
  background: #50fa7b;
  animation: pulse-bright 1s ease-in-out infinite;
}

@keyframes pulse-dim {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

@keyframes pulse-bright {
  0%, 100% { opacity: 0.7; box-shadow: 0 0 4px #50fa7b; }
  50% { opacity: 1; box-shadow: 0 0 12px #50fa7b; }
}

.energy-bar-container {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
}

.energy-bar {
  height: 100%;
  width: 10%;
  background: linear-gradient(90deg, var(--ochre), var(--gold));
  border-radius: 3px;
  transition: width 0.3s ease;
}

.mood-container {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.mood-label-text {
  font-size: 8px;
  color: var(--slate);
  font-weight: 200;
}

.mood-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  outline: none;
}

.mood-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gold);
  cursor: pointer;
}

#quantum-canvas {
  display: block;
}

/* Sidebar */
#sidebar {
  position: fixed;
  top: 16px;
  right: 0;
  z-index: 100;
  background: var(--hud-bg);
  border: 1px solid var(--hud-border);
  border-right: none;
  border-radius: 6px 0 0 6px;
  backdrop-filter: blur(12px);
  transition: transform 0.3s ease;
  width: 240px;
}

#sidebar.collapsed {
  transform: translateX(200px);
}

#sidebar-toggle {
  position: absolute;
  left: 0;
  top: 12px;
  width: 32px;
  height: 32px;
  background: var(--hud-bg);
  border: 1px solid var(--hud-border);
  border-right: none;
  border-radius: 6px 0 0 6px;
  color: var(--gold);
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.sidebar-content {
  padding: 14px 18px;
  padding-left: 40px;
  font-size: 10px;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
}

.sidebar-section {
  margin-bottom: 16px;
}

.sidebar-label {
  color: var(--slate);
  font-size: 8px;
  font-weight: 200;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.scale-buttons {
  display: flex;
  gap: 6px;
}

.scale-btn {
  flex: 1;
  padding: 5px 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--hud-border);
  border-radius: 4px;
  color: var(--cream);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 200;
  transition: all 0.2s;
}

.scale-btn.active {
  background: rgba(255, 215, 0, 0.15);
  border-color: var(--gold);
  color: var(--gold);
  font-weight: 700;
}

.scale-btn:hover {
  background: rgba(255,215,0,0.1);
}

#spectrum-canvas {
  width: 100%;
  height: 60px;
  border-radius: 4px;
  background: rgba(0,0,0,0.3);
}

.ultrasonic-label {
  font-size: 7px;
  color: var(--slate);
  text-align: center;
  margin-top: 4px;
  cursor: help;
  opacity: 0.6;
}

.entanglement-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  color: var(--cream);
}

.entanglement-bar-container {
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}

.entanglement-bar {
  height: 100%;
  width: 73%;
  background: linear-gradient(90deg, var(--midnight), #6a5acd, var(--gold));
  border-radius: 2px;
  transition: width 1s ease;
}

.pad-map {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 3px;
}

.pad-map-item {
  background: rgba(255,255,255,0.05);
  border-radius: 3px;
  padding: 3px 2px;
  text-align: center;
  font-size: 8px;
  color: var(--cream);
  line-height: 1.3;
}

.pad-map-item .note-name {
  color: var(--gold);
  font-weight: 700;
  display: block;
}

/* Pad Labels */
#pad-labels {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 50;
  pointer-events: none;
}

/* Zoomies Banner */
#zoomies-banner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 200;
  background: linear-gradient(90deg, #ff6b6b, var(--gold), #50fa7b, #6a5acd, #ff6b6b);
  background-size: 400% 100%;
  animation: zoomies-bg 0.5s linear infinite;
  color: #000;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 3px;
  padding: 16px 32px;
  border-radius: 12px;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

#zoomies-banner.visible {
  opacity: 1;
}

#zoomies-banner.hidden {
  opacity: 0;
}

@keyframes zoomies-bg {
  0% { background-position: 0% 0%; }
  100% { background-position: 400% 0%; }
}

/* Footer */
#footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(5, 5, 16, 0.8);
  border-top: 1px solid var(--hud-border);
  padding: 8px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 9px;
  color: var(--slate);
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 300;
}

.dog-icon {
  flex-shrink: 0;
}

.footer-sep {
  opacity: 0.3;
}

#footer a {
  color: var(--gold);
  text-decoration: none;
  font-family: var(--font-mono);
  font-style: normal;
  font-weight: 400;
}

#footer a:hover {
  text-decoration: underline;
}

/* Mobile */
@media (max-width: 768px) {
  #hud {
    top: 8px;
    left: 8px;
    right: 8px;
    min-width: unset;
    padding: 10px 12px;
    font-size: 9px;
  }

  .hud-title {
    font-size: 11px;
  }

  #sidebar {
    top: auto;
    bottom: 40px;
    right: 0;
    left: 0;
    width: 100%;
    border-radius: 6px 6px 0 0;
    border: 1px solid var(--hud-border);
    border-bottom: none;
    transform: translateY(100%);
    transition: transform 0.3s ease;
  }

  #sidebar.collapsed {
    transform: translateY(calc(100% - 40px));
  }

  #sidebar:not(.collapsed) {
    transform: translateY(0);
  }

  #sidebar-toggle {
    position: relative;
    width: 100%;
    height: 36px;
    border-radius: 6px 6px 0 0;
    border: none;
    left: auto;
    top: auto;
  }

  .sidebar-content {
    padding-left: 18px;
    max-height: 40vh;
  }

  .pad-map {
    grid-template-columns: repeat(6, 1fr);
  }
}