:root {
  --bg: #071b2c;
  --bg-soft: #0b3550;
  --surface: rgba(8, 27, 44, 0.84);
  --surface-soft: rgba(255, 255, 255, 0.08);
  --ink: #f2fbff;
  --muted: rgba(231, 247, 255, 0.76);
  --line: rgba(173, 226, 255, 0.14);
  --accent: #1cc0d8;
  --accent-2: #7df0ff;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(29, 192, 216, 0.18), transparent 28%),
    radial-gradient(circle at right 12%, rgba(23, 111, 196, 0.2), transparent 26%),
    linear-gradient(180deg, #041421 0%, #07263c 48%, #0a3655 100%);
}

.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  padding: 24px;
  max-width: 1640px;
  margin: 0 auto;
}

.game-card,
.info-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.game-card {
  padding: 22px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.eyebrow,
.version {
  margin: 0;
  color: var(--accent-2);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  margin-bottom: 6px;
}

.brand h1,
.info-card h2 {
  margin: 0;
}

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

button {
  border: 0;
  border-radius: 999px;
  padding: 13px 20px;
  font: inherit;
  cursor: pointer;
}

button:disabled {
  opacity: 0.55;
  cursor: default;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), #32dbd9);
  color: #042032;
  font-weight: 800;
}

.secondary-button {
  background: rgba(255, 255, 255, 0.12);
  color: var(--ink);
  font-weight: 700;
}

.small-button {
  padding: 10px 14px;
  font-size: 14px;
}

.hud {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.hud-item {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px 16px;
}

.hud-item .label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.hud-item strong {
  font-size: 22px;
}

.stage-wrap {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(133, 218, 255, 0.16);
  background: #071c31;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: auto;
}

.message-banner {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(90%, 560px);
  padding: 12px 20px;
  border-radius: 999px;
  background: rgba(6, 46, 74, 0.9);
  color: white;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
}

.info-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.info-card {
  padding: 20px;
}

.info-card p {
  margin: 12px 0 0;
  line-height: 1.55;
  color: var(--muted);
}

.camera-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  margin-top: 14px;
  background: linear-gradient(180deg, #0b2740 0%, #103a58 100%);
  border: 1px solid rgba(173, 226, 255, 0.14);
}

.camera-video {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transform: scaleX(-1);
  background: #0d2e45;
}

.gesture-badge {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(2, 24, 40, 0.84);
  color: white;
  font-weight: 700;
  font-size: 14px;
}

.gesture-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.gesture-readout {
  font-size: 17px;
}

.legend-grid {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.legend-item {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
}

.legend-photo {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  object-fit: cover;
}

.legend-item strong {
  display: block;
}

.legend-item span {
  color: var(--muted);
}

@media (max-width: 1200px) {
  .shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 800px) {
  .shell {
    padding: 16px;
  }

  .game-card {
    padding: 16px;
  }

  .hud {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    flex-direction: column;
  }
}
