:root {
  --ink: #f8fbff;
  --muted: rgba(248, 251, 255, .72);
  --orange: #ff9d2e;
  --lime: #90ff7a;
  --glass: rgba(13, 18, 30, .66);
  --line: rgba(255, 255, 255, .16);
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  background: #05060c;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.game-shell {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 560px;
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 141, 43, .18), transparent 22rem),
    linear-gradient(180deg, #111a2d 0%, #06070d 62%, #030305 100%);
}

#gameCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.top-panel,
.score-panel,
.camera-panel,
.debug-panel,
.hint {
  position: absolute;
  z-index: 2;
  border: 1px solid var(--line);
  background: var(--glass);
  box-shadow: 0 18px 45px rgba(0, 0, 0, .28);
  backdrop-filter: blur(16px);
}

.top-panel {
  top: 22px;
  left: 22px;
  width: min(440px, calc(100vw - 44px));
  padding: 20px;
  border-radius: 18px;
}

.eyebrow {
  margin: 0 0 5px;
  color: #ffd36e;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1;
}

.summary {
  margin: 9px 0 18px;
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

button,
a {
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 10px;
  color: #08101a;
  background: linear-gradient(135deg, #ffdf78, #ff8d2b);
  font: inherit;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

a {
  color: var(--ink);
  background: rgba(255, 255, 255, .1);
}

button:disabled {
  cursor: default;
  opacity: .72;
}

.status {
  margin: 14px 0 0;
  color: #bfffe2;
  font-size: .9rem;
}

.score-panel {
  top: 22px;
  right: 22px;
  display: flex;
  gap: 18px;
  padding: 14px 17px;
  border-radius: 16px;
  font-weight: 800;
}

.score-panel strong {
  color: #fff07c;
  font-size: 1.2rem;
}

.camera-panel {
  right: 22px;
  bottom: 22px;
  width: 270px;
  overflow: hidden;
  border-radius: 18px;
}

#cameraVideo,
#handOverlay {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
}

#cameraVideo {
  transform: scaleX(-1);
  object-fit: cover;
  background: #111;
}

#handOverlay {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}

.camera-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 11px;
  color: var(--muted);
  font-size: .75rem;
}

.debug-panel {
  left: 22px;
  bottom: 22px;
  width: min(330px, calc(100vw - 44px));
  padding: 16px;
  border-radius: 16px;
}

.debug-panel[hidden] { display: none; }

.debug-panel h2 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.debug-panel dl {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 6px 10px;
  margin: 0;
  font-size: .84rem;
}

.debug-panel dt { color: var(--muted); }
.debug-panel dd { margin: 0; color: #d6fff0; }
.debug-panel p { margin: 10px 0 0; color: var(--muted); font-size: .78rem; }
kbd { padding: 2px 6px; border-radius: 5px; background: rgba(255,255,255,.13); }

.hint {
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  max-width: min(560px, calc(100vw - 44px));
  padding: 11px 16px;
  border-radius: 999px;
  color: var(--muted);
  text-align: center;
  font-size: .9rem;
}

@media (max-width: 760px) {
  .score-panel {
    top: auto;
    right: 16px;
    left: 16px;
    bottom: 116px;
    justify-content: center;
  }

  .camera-panel {
    width: 190px;
    right: 16px;
    bottom: 16px;
  }

  .debug-panel {
    display: none;
  }

  .hint {
    left: 16px;
    right: 16px;
    bottom: 16px;
    transform: none;
    border-radius: 14px;
  }
}
