:root {
  color-scheme: dark;
  --bg-1: #030711;
  --bg-2: #081322;
  --bg-3: #0f1d34;
  --panel: rgba(8, 15, 28, 0.72);
  --panel-strong: rgba(10, 20, 38, 0.9);
  --card: rgba(255, 255, 255, 0.06);
  --card-strong: rgba(255, 255, 255, 0.1);
  --border: rgba(153, 210, 255, 0.14);
  --border-strong: rgba(130, 243, 255, 0.34);
  --text: #f3f7ff;
  --muted: #97aac9;
  --accent: #69f4ff;
  --accent-2: #7a7cff;
  --accent-3: #9df8b1;
  --danger: #ff6f91;
  --shadow: 0 28px 100px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 20%, rgba(105, 244, 255, 0.14), transparent 22%),
    radial-gradient(circle at 85% 18%, rgba(122, 124, 255, 0.18), transparent 24%),
    radial-gradient(circle at 50% 120%, rgba(18, 82, 144, 0.28), transparent 30%),
    linear-gradient(140deg, var(--bg-1), var(--bg-2) 44%, var(--bg-3));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 90px 90px;
  mask-image: radial-gradient(circle at center, black 48%, transparent 100%);
  opacity: 0.45;
}

.page-glow {
  position: fixed;
  border-radius: 999px;
  filter: blur(24px);
  pointer-events: none;
  opacity: 0.55;
}

.page-glow-1 {
  top: 70px;
  left: -90px;
  width: 240px;
  height: 240px;
  background: rgba(105, 244, 255, 0.16);
}

.page-glow-2 {
  right: -80px;
  bottom: 50px;
  width: 280px;
  height: 280px;
  background: rgba(122, 124, 255, 0.18);
}

.app {
  position: relative;
  z-index: 1;
  width: min(1240px, calc(100% - 32px));
  margin: 24px auto;
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 22px;
  align-items: start;
}

.panel,
.game-shell {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(14, 24, 42, 0.76), rgba(6, 12, 24, 0.82));
  border: 1px solid var(--border);
  border-radius: 28px;
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.panel::before,
.game-shell::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.panel::after,
.game-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(105, 244, 255, 0.08), transparent 36%, transparent 66%, rgba(122, 124, 255, 0.1));
}

.panel {
  padding: 28px;
}

.title-wrap {
  position: relative;
  padding-bottom: 18px;
}

.title-wrap::after {
  content: "";
  display: block;
  width: 82px;
  height: 4px;
  border-radius: 999px;
  margin-top: 18px;
  background: linear-gradient(90deg, var(--accent), rgba(122, 124, 255, 0.2));
  box-shadow: 0 0 18px rgba(105, 244, 255, 0.45);
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: 0.34em;
  color: var(--accent);
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 42px;
  line-height: 1.06;
  letter-spacing: 0.04em;
  text-shadow: 0 0 24px rgba(122, 124, 255, 0.2);
}

.subtitle,
.tips p {
  color: var(--muted);
  line-height: 1.7;
}

.subtitle {
  margin: 12px 0 0;
  max-width: 28ch;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 24px;
}

.status-strip span {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(105, 244, 255, 0.08);
  border: 1px solid rgba(105, 244, 255, 0.18);
  color: #dffcff;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.stats {
  display: grid;
  gap: 12px;
  margin: 24px 0;
}

.stat-card {
  position: relative;
  padding: 16px 18px;
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.stat-card::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 4px;
  height: 44%;
  transform: translateY(-50%);
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 16px rgba(105, 244, 255, 0.4);
}

.stat-card span {
  padding-left: 12px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.06em;
}

.stat-card strong {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.controls {
  display: flex;
  gap: 12px;
  margin: 22px 0 18px;
}

button {
  position: relative;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  padding: 13px 20px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  color: #021018;
  background: linear-gradient(135deg, #86fbff, var(--accent), #bff4ff);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 14px 30px rgba(105, 244, 255, 0.22);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, 0.28) 48%, transparent 72%);
  transform: translateX(-120%);
  transition: transform 0.45s ease;
}

button:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 18px 34px rgba(105, 244, 255, 0.28);
  filter: saturate(1.08);
}

button:hover::after {
  transform: translateX(120%);
}

button.secondary {
  color: var(--text);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.tips {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.tips p {
  margin: 0;
}

.tips p + p {
  margin-top: 8px;
}

.tips strong {
  color: #dffcff;
}

.game-shell {
  padding: 18px;
}

.shell-hud {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: #cde7ff;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

canvas {
  position: relative;
  z-index: 1;
  width: 100%;
  display: block;
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 0%, rgba(31, 109, 203, 0.18), transparent 40%),
    linear-gradient(180deg, rgba(5, 11, 22, 0.96), rgba(9, 21, 38, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 0 0 1px rgba(105, 244, 255, 0.05);
}

.overlay {
  position: absolute;
  inset: 58px 18px 18px;
  z-index: 2;
  border-radius: 22px;
  display: none;
  place-items: center;
  background:
    radial-gradient(circle at 50% 30%, rgba(105, 244, 255, 0.12), transparent 44%),
    rgba(2, 7, 14, 0.62);
  backdrop-filter: blur(8px);
}

.overlay.show {
  display: grid;
}

.overlay-card {
  position: relative;
  text-align: center;
  padding: 30px 34px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(12, 24, 44, 0.94), rgba(6, 13, 24, 0.96));
  border: 1px solid var(--border-strong);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 18px 50px rgba(0, 0, 0, 0.35),
    0 0 36px rgba(105, 244, 255, 0.14);
  max-width: 380px;
}

.overlay-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

.overlay-card h2 {
  margin: 0 0 12px;
  font-size: 30px;
  line-height: 1.1;
}

.overlay-card p {
  color: var(--muted);
  line-height: 1.7;
  margin: 0;
}

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

  .panel,
  .game-shell {
    border-radius: 24px;
  }

  h1 {
    font-size: 34px;
  }

  .controls {
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .app {
    width: min(100% - 18px, 1240px);
    margin: 12px auto 20px;
    gap: 16px;
  }

  .panel,
  .game-shell {
    padding: 16px;
  }

  .panel {
    padding: 22px 18px;
  }

  .shell-hud {
    font-size: 11px;
    letter-spacing: 0.12em;
  }

  .overlay {
    inset: 48px 16px 16px;
  }

  .overlay-card {
    padding: 24px 22px;
  }
}
