:root {
  --neon-cyan: #00ffcc;
  --neon-purple: #bd00ff;
  --neon-amber: #ffaa00;
  --neon-red: #ff0055;
  --bg-dark: #020205;
  --panel-bg: rgba(10, 10, 20, 0.6);
  --border-glow: rgba(255, 255, 255, 0.05);
}

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

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-dark);
  font-family: 'Outfit', sans-serif;
  color: #f0f0f5;
}

.quantum-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* --- HUD Header --- */
.hud-header {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  padding: 1.5rem 2rem;
  background: linear-gradient(to bottom, rgba(2, 2, 5, 0.8), transparent);
  backdrop-filter: blur(4px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.hud-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.hud-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.4);
}

.hud-value {
  font-family: 'Share Tech Mono', monospace;
  font-size: 1.1rem;
  font-weight: bold;
  color: #fff;
}

.active-pulse {
  color: var(--neon-cyan);
  text-shadow: 0 0 8px rgba(0, 255, 204, 0.4);
  animation: pulse 2s infinite alternate;
}

.score-glow {
  color: var(--neon-cyan);
  text-shadow: 0 0 10px rgba(0, 255, 204, 0.5);
  font-size: 1.3rem;
}

.energy-bar-container {
  width: 100%;
  max-width: 250px;
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin: 0.25rem auto 0;
}

.energy-bar {
  width: 100%;
  height: 100%;
  background: linear-gradient(to right, var(--neon-red), var(--neon-cyan));
  border-radius: 3px;
  transition: width 0.3s ease;
  box-shadow: 0 0 8px rgba(0, 255, 204, 0.4);
}

/* --- HUD Footer --- */
.hud-footer {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.5rem 2rem;
  background: linear-gradient(to top, rgba(2, 2, 5, 0.8), transparent);
  backdrop-filter: blur(4px);
  border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.brush-selector-panel {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--panel-bg);
  border: 1px solid var(--border-glow);
  padding: 0.5rem 1rem;
  border-radius: 12px;
  backdrop-filter: blur(12px);
}

.panel-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.5);
}

.brush-buttons {
  display: flex;
  gap: 0.5rem;
}

.brush-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.6);
  padding: 0.5rem 1rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.brush-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.15);
}

.brush-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.brush-btn.active[data-ink="reflector"] {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0, 255, 204, 0.2);
}

.brush-btn.active[data-ink="gravity"] {
  border-color: var(--neon-purple);
  box-shadow: 0 0 10px rgba(189, 0, 255, 0.2);
}

.brush-btn.active[data-ink="friction"] {
  border-color: var(--neon-amber);
  box-shadow: 0 0 10px rgba(255, 170, 0, 0.2);
}

.ink-color {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.ref-cyan { background-color: var(--neon-cyan); box-shadow: 0 0 6px var(--neon-cyan); }
.grav-purple { background-color: var(--neon-purple); box-shadow: 0 0 6px var(--neon-purple); }
.fric-amber { background-color: var(--neon-amber); box-shadow: 0 0 6px var(--neon-amber); }

.actions-panel {
  display: flex;
  gap: 0.75rem;
}

.action-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: #fff;
  padding: 0.6rem 1.2rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

#btnClear:hover {
  color: var(--neon-red);
  border-color: var(--neon-red);
  box-shadow: 0 0 8px rgba(255, 0, 85, 0.15);
}

/* --- Modal Screens --- */
.modal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(2, 2, 5, 0.85);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  justify-content: center;
  align-items: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: rgba(10, 10, 20, 0.75);
  border: 1px solid rgba(255, 0, 85, 0.2);
  padding: 3rem;
  border-radius: 20px;
  max-width: 480px;
  text-align: center;
  backdrop-filter: blur(20px);
  box-shadow: 0 0 30px rgba(255, 0, 85, 0.1);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.modal-title {
  font-family: 'Share Tech Mono', monospace;
  color: var(--neon-red);
  font-size: 1.4rem;
  letter-spacing: 0.05em;
  text-shadow: 0 0 10px rgba(255, 0, 85, 0.3);
}

.modal-text {
  color: rgba(255, 255, 255, 0.6);
  font-weight: 300;
  font-size: 0.95rem;
  line-height: 1.6;
}

.stats-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 1rem;
  border-radius: 8px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 1.2rem;
  color: var(--neon-cyan);
}

.modal-btn {
  background: linear-gradient(to right, var(--neon-red), var(--neon-purple));
  color: #fff;
  border: none;
  padding: 0.8rem 1.5rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  box-shadow: 0 4px 15px rgba(189, 0, 255, 0.3);
  transition: all 0.3s ease;
}

.modal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(189, 0, 255, 0.5);
}

@keyframes pulse {
  0% { opacity: 0.7; }
  100% { opacity: 1; }
}
