#tetrisGame {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  color: var(--accent);
  cursor: pointer;
  animation: tetris-fade 120ms ease-out;
}

@keyframes tetris-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.tetris__hud {
  display: flex;
  gap: 28px;
  align-items: flex-start;
}

.tetris__hud-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 110px;
}

.tetris__hud-col--center { align-items: center; }

.tetris__hud-label {
  color: var(--dim);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: 6px;
}

.tetris__hud-value {
  color: var(--bright);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.tetris__board {
  background: #000;
  border: 1px solid var(--accent);
  box-shadow:
    0 0 0 1px rgba(0, 255, 156, 0.15),
    0 0 28px rgba(0, 255, 156, 0.25),
    inset 0 0 24px rgba(0, 255, 156, 0.04);
  image-rendering: pixelated;
  display: block;
}

.tetris__next {
  background: #000;
  border: 1px solid var(--accent-dim);
  box-shadow: 0 0 12px rgba(0, 255, 156, 0.15);
  image-rendering: pixelated;
  display: block;
}

.tetris__help {
  color: var(--dim);
  font-size: 11px;
  line-height: 1.7;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line-strong);
}

.tetris__help span { color: var(--accent); }

.tetris__overlay,
.tetris__gameover {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  text-align: center;
}

.tetris__overlay.is-visible,
.tetris__gameover.is-visible { display: flex; }

.tetris__overlay-text,
.tetris__gameover-title {
  color: var(--bright);
  font-size: 34px;
  letter-spacing: 0.25em;
  text-shadow: 0 0 14px var(--accent);
  font-weight: 700;
}

.tetris__overlay-text span,
.tetris__gameover-sub {
  display: block;
  color: var(--dim);
  font-size: 12px;
  font-weight: 400;
  margin-top: 14px;
  letter-spacing: 0.15em;
  text-shadow: none;
}

.tetris__gameover-stats {
  color: var(--fg);
  font-size: 14px;
  text-align: center;
  margin-top: 14px;
  letter-spacing: 0.05em;
}

.tetris__gameover-rank {
  color: var(--accent);
  font-size: 13px;
  text-align: center;
  margin-top: 10px;
  letter-spacing: 0.18em;
  text-shadow: 0 0 8px var(--accent);
  font-weight: 600;
}

.tetris__scores-overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.tetris__scores-overlay.is-visible { display: flex; }

.tetris__scores {
  background: rgba(0, 0, 0, 0.95);
  border: 1px solid var(--accent);
  box-shadow:
    0 0 0 1px rgba(0, 255, 156, 0.15),
    0 0 32px rgba(0, 255, 156, 0.3);
  padding: 22px 28px 18px;
  min-width: 380px;
  max-width: 560px;
  font-family: var(--font-mono);
}

.tetris__scores-title {
  color: var(--bright);
  font-size: 22px;
  letter-spacing: 0.25em;
  text-shadow: 0 0 12px var(--accent);
  text-align: center;
  margin-bottom: 16px;
  font-weight: 700;
}

.tetris__scores-empty {
  color: var(--dim);
  text-align: center;
  padding: 18px 0;
  font-size: 13px;
}

.tetris__scores-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  line-height: 1.7;
}

.tetris__scores-table th {
  color: var(--dim);
  font-weight: 400;
  text-align: right;
  padding: 4px 10px;
  border-bottom: 1px dashed var(--line-strong);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.15em;
}

.tetris__scores-table th:first-child { width: 30px; text-align: right; }
.tetris__scores-table th:nth-child(2),
.tetris__scores-table th:nth-child(3),
.tetris__scores-table th:nth-child(4) { text-align: right; }
.tetris__scores-table th:last-child  { text-align: right; }

.tetris__scores-table td {
  padding: 3px 10px;
  text-align: right;
  color: var(--fg);
}

.tetris__scores-table td:first-child { color: var(--dim); }
.tetris__scores-table td:nth-child(2) { color: var(--bright); font-weight: 600; }

.tetris__scores-table tr.is-you td { color: var(--accent); }
.tetris__scores-table tr.is-you td:nth-child(2) { color: var(--accent); }
.tetris__scores-table tr.is-you td:first-child { color: var(--accent); }

.tetris__scores-yours {
  color: var(--dim);
  font-size: 11px;
  text-align: center;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line-strong);
  letter-spacing: 0.05em;
}

.tetris__scores-yours strong {
  color: var(--accent);
  font-weight: 400;
}

.tetris__scores-foot {
  color: var(--dim);
  font-size: 11px;
  text-align: center;
  margin-top: 14px;
  letter-spacing: 0.15em;
}

@media (max-width: 720px) {
  .tetris__hud { gap: 14px; }
  .tetris__hud-col { min-width: 80px; }
  .tetris__board { width: 240px; height: 480px; }
  .tetris__next  { width: 96px;  height: 96px; }
  .tetris__help  { display: none; }
  .tetris__overlay-text,
  .tetris__gameover-title { font-size: 24px; }
  .tetris__scores { min-width: 0; width: 92vw; padding: 16px 18px; }
  .tetris__scores-table { font-size: 11px; }
}