:root {
  --bg: #06070c;
  --panel: rgba(12, 18, 32, 0.88);
  --panel-border: rgba(123, 167, 255, 0.18);
  --text: #f5f7ff;
  --muted: #9aa8cf;
  --accent: #ffd55a;
  --cyan: #50e2ff;
  --pink: #ff5ca8;
  --lime: #98ff85;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top, rgba(56, 92, 186, 0.28), transparent 38%),
    radial-gradient(circle at bottom left, rgba(255, 92, 168, 0.16), transparent 32%),
    linear-gradient(180deg, #0a0f1c 0%, #05070d 100%);
  color: var(--text);
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
}

body {
  padding: 24px;
}

.app-shell {
  display: grid;
  grid-template-columns: 320px minmax(320px, 1fr);
  gap: 24px;
  align-items: start;
}

.hud-card,
.table-wrap {
  border: 1px solid var(--panel-border);
  background: var(--panel);
  border-radius: 28px;
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.hud-card {
  padding: 28px;
  position: sticky;
  top: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
}

h1 {
  margin: 0;
  font-size: 2.2rem;
  line-height: 1;
}

.intro {
  margin: 14px 0 28px;
  color: var(--muted);
  line-height: 1.5;
}

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

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

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

.stat strong {
  font-size: 1.4rem;
}

.controls {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.controls p {
  margin: 0 0 12px;
  font-weight: 700;
}

.controls ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.8;
}

kbd {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.table-wrap {
  padding: 18px;
  display: flex;
  justify-content: center;
  position: relative;
}

canvas {
  width: min(100%, 620px);
  height: auto;
  display: block;
  border-radius: 24px;
  background: linear-gradient(180deg, #071120 0%, #081321 16%, #0c1522 100%);
}

.score-proof {
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(198px);
  width: 92px;
  padding: 6px 6px 4px;
  border-radius: 10px;
  border: 1px solid rgba(120, 200, 255, 0.32);
  background: rgba(8, 14, 28, 0.74);
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  z-index: 3;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.score-proof.visible {
  opacity: 1;
  pointer-events: auto;
}

.score-proof.game-over {
  width: 192px;
  padding: 10px 10px 8px;
  border-radius: 16px;
  border-color: rgba(198, 246, 255, 0.64);
  background: rgba(8, 14, 28, 0.86);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.42),
    0 0 24px rgba(80, 226, 255, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

#score-proof-qr {
  display: block;
  width: 78px;
  height: 78px;
  margin: 0 auto;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.95);
  image-rendering: pixelated;
}

.score-proof.game-over #score-proof-qr {
  width: 168px;
  height: 168px;
  border-radius: 8px;
}

#score-proof-text {
  margin-top: 4px;
  display: block;
  text-align: center;
  font: 700 0.58rem "Segoe UI", sans-serif;
  letter-spacing: 0.04em;
  color: rgba(245, 247, 255, 0.84);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.score-proof.game-over #score-proof-text {
  margin-top: 8px;
  font-size: 0.86rem;
}

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

  .hud-card {
    position: static;
  }

  .score-proof {
    top: 16px;
    right: 16px;
    left: auto;
    transform: none;
    width: 80px;
    padding: 5px 5px 3px;
  }

  #score-proof-qr {
    width: 66px;
    height: 66px;
  }

  #score-proof-text {
    font-size: 0.5rem;
  }

  .score-proof.game-over {
    width: 154px;
    padding: 8px 8px 6px;
  }

  .score-proof.game-over #score-proof-qr {
    width: 136px;
    height: 136px;
  }

  .score-proof.game-over #score-proof-text {
    font-size: 0.72rem;
  }
}
