:root {
  --bg: #020412;
  --bg-alt: #05081c;
  --accent: #4b7cf5;
  --accent-soft: rgba(75, 124, 245, 0.35);
  --accent-pink: #ff4b9a;
  --accent-cyan: #44f1ff;
  --text-main: #e3e8ff;
  --text-soft: #a1a8d9;
  --danger: #ff6b81;
  --warning: #ffc857;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: radial-gradient(circle at top, #080c2a, #020412);
  color: var(--text-main);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

/* Background layers */

.bg-outer {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.bg-grid {
  position: absolute;
  inset: -50px;
  background-image: linear-gradient(
      rgba(255, 255, 255, 0.04) 1px,
      transparent 1px
    ),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.4;
  transform: perspective(500px) rotateX(60deg) translateY(80px);
  transform-origin: center top;
  filter: blur(0.2px);
}

.bg-glow {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.4;
  mix-blend-mode: screen;
}

.bg-glow-1 {
  background: radial-gradient(circle, #4b7cf5, transparent 70%);
  top: 10%;
  left: 10%;
}

.bg-glow-2 {
  background: radial-gradient(circle, #ff4b9a, transparent 70%);
  bottom: 5%;
  right: 5%;
}

/* Layout */

.game-shell {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 24px auto;
  padding: 24px;
  background: radial-gradient(circle at top left, #0b1033, #020412);
  border-radius: 16px;
  border: 1px solid rgba(131, 146, 255, 0.35);
  box-shadow: 0 0 0 1px rgba(19, 31, 83, 0.6),
    0 32px 80px rgba(0, 0, 0, 0.75);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}

.game-title-kicker {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-cyan);
}

.game-title h1 {
  font-size: 26px;
  margin: 4px 0 0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f5f7ff;
  text-shadow: 0 0 18px rgba(68, 241, 255, 0.55);
}

.game-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pill {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(141, 164, 255, 0.7);
  background: linear-gradient(120deg, rgba(11, 16, 54, 0.9), rgba(4, 7, 25, 0.9));
  color: var(--text-soft);
}

.pill-live {
  border-color: rgba(68, 241, 255, 0.9);
  color: var(--accent-cyan);
}

.pill-genre {
  border-style: dashed;
}

.game-main {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
  gap: 24px;
  align-items: stretch;
}

/* Canvas & overlay */

.canvas-wrap {
  position: relative;
  padding: 14px;
  border-radius: 14px;
  background: radial-gradient(circle at top, #05081d, #02030b);
  box-shadow: 0 0 0 1px rgba(59, 95, 255, 0.5),
    0 0 30px rgba(75, 124, 245, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
}

#tetris {
  display: block;
  background: radial-gradient(circle at center, #05071b, #010109);
  border-radius: 6px;
  border: 1px solid rgba(157, 173, 255, 0.4);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.8);
}

.canvas-overlay {
  position: absolute;
  inset: 14px;
  border-radius: 6px;
  background: radial-gradient(circle at top, rgba(6, 11, 48, 0.96), rgba(2, 3, 16, 0.97));
  display: flex;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(120, 150, 255, 0.5);
}

.canvas-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease-out;
}

.overlay-inner {
  text-align: center;
  max-width: 260px;
}

.overlay-title {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent-cyan);
  margin-bottom: 6px;
}

.overlay-sub {
  font-size: 20px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-bottom: 10px;
}

.overlay-hint {
  font-size: 12px;
  color: var(--text-soft);
}

/* Side panel */

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel-block {
  padding: 10px 12px;
  border-radius: 10px;
  background: radial-gradient(circle at top left, #11163e, #050919);
  border: 1px solid rgba(117, 135, 255, 0.6);
  box-shadow: 0 0 18px rgba(40, 71, 220, 0.35);
}

.panel-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-soft);
  margin-bottom: 4px;
}

.panel-value {
  font-size: 24px;
  font-weight: 600;
  color: var(--accent-cyan);
  text-shadow: 0 0 14px rgba(68, 241, 255, 0.7);
}

.panel-status {
  border-style: dashed;
}

.panel-status-text {
  font-size: 13px;
  color: var(--warning);
}

.panel-status-text.game-over {
  color: var(--danger);
}

.panel-keys .panel-label {
  margin-bottom: 6px;
}

.key-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 12px;
  color: var(--text-soft);
}

.key-list li {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.key-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(140, 159, 255, 0.7);
  background: linear-gradient(135deg, rgba(10, 14, 50, 0.8), rgba(3, 6, 22, 0.8));
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #c5cbff;
}

/* Footer */

.game-footer {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid rgba(71, 94, 192, 0.6);
}

.footer-text {
  font-size: 11px;
  color: var(--text-soft);
}

.footer-text span {
  color: var(--accent-pink);
}

/* Responsive */

@media (max-width: 900px) {
  .game-main {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .game-shell {
    margin: 12px;
    padding: 16px;
  }

  .game-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .game-title h1 {
    font-size: 22px;
  }
}

