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

html {
  color-scheme: dark;
}

:root {
  --bg: #121110;
  --surface: #1c1a17;
  --border: #2a2724;
  --text: #e8e5e0;
  --text-dim: #6e6a63;
  --accent: #e8654a;
  --accent-dim: #a04030;
  --life: #d44030;
}

body {
  background: var(--bg);
  cursor: none;
  font-family: 'Poppins', sans-serif;
  height: 100vh;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
}

#game {
  height: 100%;
  inset: 0;
  position: fixed;
  width: 100%;
}

.cam-pip {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 14px;
  bottom: 24px;
  height: 210px;
  left: 24px;
  overflow: hidden;
  position: fixed;
  width: 280px;
  z-index: 100;
}

#webcam,
#hand-canvas {
  height: 100%;
  inset: 0;
  position: absolute;
  width: 100%;
}

#webcam {
  object-fit: cover;
  transform: scaleX(-1);
}

.hud {
  display: flex;
  gap: 32px;
  left: 32px;
  pointer-events: none;
  position: fixed;
  top: 28px;
  z-index: 100;
}

.hud-left,
.hud-right {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hud-label {
  color: var(--text-dim);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.hud-score {
  color: var(--text);
  font-family: 'Bangers', sans-serif;
  font-size: 2.6rem;
  letter-spacing: 1px;
  line-height: 1;
}

.hud-best {
  color: var(--text-dim);
  font-family: 'Bangers', sans-serif;
  font-size: 1.4rem;
  letter-spacing: 1px;
  line-height: 1;
}

#hud-score.bump {
  animation: val-bump 0.15s cubic-bezier(0.33, 1, 0.68, 1);
}

@keyframes val-bump {
  0% { transform: scale(1) translateZ(0); }
  50% { transform: scale(1.12) translateZ(0); }
  100% { transform: scale(1) translateZ(0); }
}

.hud-combo {
  color: var(--text);
  font-family: 'Bangers', sans-serif;
  font-size: 3.2rem;
  left: 50%;
  letter-spacing: 3px;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  top: 45%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  z-index: 200;
}

.hud-combo.show {
  animation: combo-pop 0.8s cubic-bezier(0.33, 1, 0.68, 1) forwards;
}

@keyframes combo-pop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.85) translateZ(0); }
  10% { opacity: 1; transform: translate(-50%, -50%) scale(1.04) translateZ(0); }
  25% { opacity: 1; transform: translate(-50%, -50%) scale(1) translateZ(0); }
  65% { opacity: 1; transform: translate(-50%, -50%) scale(1) translateZ(0); }
  100% { opacity: 0; transform: translate(-50%, -58%) scale(0.97) translateZ(0); }
}

.status-overlay {
  align-items: center;
  background: rgba(18, 17, 16, 0.88);
  display: flex;
  flex-direction: column;
  inset: 0;
  justify-content: center;
  position: fixed;
  transition: opacity 0.35s cubic-bezier(0.33, 1, 0.68, 1);
  z-index: 300;
}

.status-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.status-title {
  color: var(--text);
  font-family: 'Bangers', sans-serif;
  font-size: 4.5rem;
  letter-spacing: 4px;
  line-height: 1;
}

.status-sub {
  color: var(--text-dim);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  margin-top: 16px;
}

.privacy-note {
  color: var(--text-dim);
  font-size: 0.7rem;
  font-weight: 500;
  margin-top: 20px;
  opacity: 0.7;
  max-width: 320px;
  text-align: center;
  margin-inline: auto;
  line-height: 1.5;
}

.lives {
  display: flex;
  gap: 10px;
  position: fixed;
  right: 32px;
  top: 34px;
  z-index: 100;
}

.sound-toggle {
  background: rgba(28, 26, 23, 0.88);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 1.8px;
  padding: 7px 12px;
  position: fixed;
  right: 24px;
  top: 58px;
  transition:
    transform 0.15s ease,
    border-color 0.2s ease,
    opacity 0.2s ease,
    color 0.2s ease;
  z-index: 120;
}

.sound-toggle:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.sound-toggle:active {
  transform: translateY(0);
}

.sound-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sound-toggle.off {
  color: var(--text-dim);
  opacity: 0.72;
}

.life {
  background: var(--life);
  border-radius: 50%;
  height: 12px;
  transition:
    transform 0.25s cubic-bezier(0.33, 1, 0.68, 1),
    opacity 0.2s ease;
  width: 12px;
  will-change: transform, opacity;
}

.life.lost {
  opacity: 0.08;
  transform: scale(0.3);
}

@media (max-width: 768px) {
  .cam-pip {
    border-radius: 10px;
    bottom: 12px;
    height: 105px;
    left: 12px;
    width: 140px;
  }

  .hud {
    gap: 20px;
    left: 16px;
    top: 16px;
  }

  .hud-score {
    font-size: 1.8rem;
  }

  .hud-best {
    font-size: 1rem;
  }

  .hud-label {
    font-size: 0.5rem;
    letter-spacing: 2px;
  }

  .hud-combo {
    font-size: 2.2rem;
  }

  .lives {
    gap: 7px;
    right: 16px;
    top: 20px;
  }

  .sound-toggle {
    font-size: 0.54rem;
    letter-spacing: 1.5px;
    padding: 6px 10px;
    right: 12px;
    top: 44px;
  }

  .life {
    height: 10px;
    width: 10px;
  }

  .status-title {
    font-size: 2.8rem;
    letter-spacing: 2px;
  }

  .status-sub {
    font-size: 0.8rem;
    padding: 0 24px;
    text-align: center;
  }

  body {
    cursor: auto;
  }
}
