* {
  box-sizing: border-box;
}
html,
body {
  width: 100%;
  height: 100%;
}
body {
  margin: 0;
  overflow: hidden;
  background: #000;
  color: #fff;
  font-family: Arial, sans-serif;
  -webkit-user-select: none;
  user-select: none;
}
button {
  font: inherit;
}
.pixel {
  font-family: "Press Start 2P", monospace;
}
.hidden {
  display: none !important;
}
.app-shell {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}
.camera-panel,
.game-panel {
  position: relative;
  width: 50%;
  height: 100%;
  overflow: hidden;
}
.camera-panel {
  background: #101827;
  border-right: 1px solid #253040;
}
#video,
#poseCanvas {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}
#video {
  opacity: 0;
}
.camera-offline,
.loading-overlay,
.camera-error {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  place-items: center;
  text-align: center;
}
.camera-offline {
  color: #4b5563;
  font-size: 12px;
}
.loading-overlay {
  z-index: 6;
  background: #000000c7;
}
.loading-text {
  margin: 0;
  color: #22d3ee;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  animation: pulse 1.6s ease-in-out infinite;
}
.camera-error {
  z-index: 7;
  padding: 28px;
  background: #7f1d1deb;
  font-weight: 800;
}
.pose-hint {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 4;
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 9px 12px;
  border-left: 4px solid #06b6d4;
  background: #0000009e;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-size: 11px;
}
.pose-hint span {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}
.dot-cyan {
  background: #22d3ee;
}
.dot-red {
  background: #ef4444;
}
.game-panel {
  background: #000;
}
#gameContainer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}
#gameContainer canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}
.hud {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
}
.project-link {
  position: absolute;
  right: 18px;
  top: 18px;
  z-index: 3;
  color: #ffffffb8;
  font-size: 13px;
  letter-spacing: .02em;
  text-decoration: underline;
  text-underline-offset: 3px;
  pointer-events: auto;
}
.score {
  position: absolute;
  top: 26px;
  left: 50%;
  z-index: 3;
  transform: translate(-50%);
  color: #fff;
  font-size: clamp(36px, 7vw, 76px);
  text-shadow: 0 5px 0 rgb(0 0 0 / 32%);
}
.screen {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 32px;
  text-align: center;
  background: linear-gradient(#0000002e, #00000057);
}
.start-stack {
  display: grid;
  justify-items: center;
  gap: 20px;
  width: min(92%, 650px);
}
.title {
  margin: 0;
  color: #fff;
  font-size: clamp(28px, 4vw, 54px);
  line-height: 1.15;
  text-shadow: 0 6px 0 #111827, 0 0 22px rgb(34 211 238 / 55%);
}
.subtitle,
.instruction,
.takeoff,
.restart-hint {
  margin: 0;
  font-size: clamp(10px, 1.6vw, 15px);
  line-height: 1.8;
}
.subtitle {
  color: #bff8ff;
}
.init-section,
.ready-section,
.restart-ready {
  display: grid;
  justify-items: center;
  gap: 22px;
}
.instruction {
  max-width: 560px;
  color: #f8fafc;
}
.takeoff,
.restart-hint {
  color: #22d3ee;
  animation: pulse 1.2s ease-in-out infinite;
}
.arcade-button {
  min-width: 190px;
  min-height: 58px;
  padding: 17px 24px;
  border: 3px solid #fff;
  background: #fff;
  color: #101827;
  box-shadow: 0 8px #0e7490, 0 0 20px #22d3ee73;
  cursor: pointer;
  pointer-events: auto;
  transition: transform .12s ease, box-shadow .12s ease;
}
.arcade-button:hover {
  transform: translateY(2px);
  box-shadow: 0 5px #0e7490, 0 0 26px #22d3eeb3;
}
.game-over-screen {
  gap: 18px;
  align-content: center;
  background: #00000094;
}
.game-over-title {
  margin: 0 0 10px;
  color: #f05;
  font-size: clamp(28px, 5vw, 58px);
  line-height: 1.2;
  text-shadow: 0 0 20px rgb(255 0 85 / 74%);
}
.final-label {
  margin: 0;
  color: #e5e7eb;
  font-size: 11px;
}
.final-score {
  margin: 0 0 12px;
  font-size: clamp(44px, 9vw, 94px);
}
.recharging,
.restart-ready {
  align-items: center;
  color: #22d3ee;
  font-size: 11px;
}
.recharging {
  display: flex;
  gap: 14px;
}
.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid rgb(34 211 238 / 25%);
  border-top-color: #22d3ee;
  border-radius: 50%;
  animation: spin .9s linear infinite;
}
@keyframes pulse {
  0%,
  to {
    opacity: 1;
  }
  50% {
    opacity: 0.48;
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (max-width: 768px) {
  .app-shell {
    flex-direction: column;
  }
  .camera-panel,
  .game-panel {
    width: 100%;
    height: 50%;
  }
  .camera-panel {
    border-right: 0;
    border-bottom: 1px solid #253040;
  }
  .project-link {
    right: 12px;
    top: 12px;
    font-size: 11px;
  }
  .screen {
    padding: 18px;
  }
  .start-stack {
    gap: 14px;
  }
  .arcade-button {
    min-width: 152px;
    min-height: 48px;
    padding: 13px 18px;
  }
}
