:root {
  color-scheme: dark;
  --bg: #050816;
  --panel: rgba(7, 15, 35, 0.82);
  --line: rgba(128, 180, 255, 0.3);
  --accent: #66d9ff;
  --accent-2: #8a7dff;
  --warn: #ffcf5c;
  --danger: #ff6584;
  --text: #eff6ff;
  --muted: #9fb1d1;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top, rgba(116, 97, 255, 0.25), transparent 30%),
    radial-gradient(circle at bottom, rgba(33, 224, 255, 0.18), transparent 25%),
    linear-gradient(180deg, #04050c 0%, #081022 55%, #03050b 100%);
  color: var(--text);
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

.app-shell {
  width: min(1100px, 100vw);
  min-height: 100vh;
  margin: 0 auto;
  padding: 16px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
}

.hud-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.hud-panel > div {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  backdrop-filter: blur(12px);
  box-shadow: inset 0 0 24px rgba(113, 170, 255, 0.08), 0 10px 30px rgba(0, 0, 0, 0.25);
}

.label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.game-frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

canvas {
  width: 100%;
  height: auto;
  max-height: calc(100vh - 180px);
  border-radius: 24px;
  border: 1px solid rgba(145, 188, 255, 0.28);
  background: #020611;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45), inset 0 0 40px rgba(72, 136, 255, 0.15);
  touch-action: none;
}

.overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  border-radius: 24px;
  background: rgba(2, 8, 21, 0.58);
  backdrop-filter: blur(10px);
}

.overlay.visible {
  display: flex;
}

.card {
  width: min(560px, 100%);
  padding: 28px;
  border: 1px solid rgba(132, 176, 255, 0.35);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(9, 18, 39, 0.95), rgba(6, 11, 24, 0.92));
  box-shadow: 0 16px 60px rgba(0, 0, 0, 0.35);
  text-align: center;
}

.card h1 {
  margin: 0 0 12px;
  font-size: clamp(28px, 4vw, 42px);
}

.card p {
  color: var(--muted);
  line-height: 1.6;
}

button {
  margin-top: 12px;
  padding: 12px 24px;
  border: 0;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  color: #041019;
  background: linear-gradient(90deg, #6cf4ff, #7f8dff);
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
  box-shadow: 0 12px 28px rgba(79, 178, 255, 0.35);
}

button:hover {
  transform: translateY(-1px);
}

@media (max-width: 860px) {
  .app-shell {
    padding: 10px;
  }

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

  canvas {
    max-height: calc(100vh - 240px);
  }
}

@media (max-width: 560px) {
  .hud-panel {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 20px;
  }
}
