:root {
  --bg: #050915;
  --bg-alt: #0b1024;
  --accent: #4ef0ff;
  --accent-soft: rgba(78, 240, 255, 0.4);
  --accent-secondary: #ff6ec7;
  --text: #f5f7ff;
  --muted: #8b9bc7;
  --danger: #ff4b81;
  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.5);
}

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

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top, #151b3b 0, #050915 55%, #02030a 100%);
  overflow: hidden;
}

.background {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 10% 20%, rgba(78, 240, 255, 0.16), transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(255, 110, 199, 0.16), transparent 55%);
  filter: blur(2px);
  opacity: 0.9;
  z-index: -2;
}

.app {
  position: relative;
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 20px 28px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(22px);
}

.header {
  text-align: center;
  margin-bottom: 18px;
}

.title {
  margin: 0;
  font-size: 2.4rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: linear-gradient(120deg, #4ef0ff, #ff6ec7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 18px rgba(78, 240, 255, 0.7);
}

.subtitle {
  margin: 6px 0 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.main {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 22px;
  align-items: stretch;
}

.panel {
  background: linear-gradient(145deg, rgba(16, 20, 50, 0.96), rgba(4, 8, 25, 0.98));
  border-radius: var(--radius-lg);
  border: 1px solid rgba(118, 142, 255, 0.2);
  box-shadow: var(--shadow-soft);
  padding: 18px 18px 16px;
  position: relative;
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: radial-gradient(circle at top left, rgba(78, 240, 255, 0.22), transparent 55%);
  mix-blend-mode: screen;
  opacity: 0.8;
  pointer-events: none;
}

.panel-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.panel-right {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

canvas#tetris {
  border-radius: 10px;
  background: radial-gradient(circle at top, #181f3f 0, #050814 70%);
  box-shadow:
    0 0 0 1px rgba(78, 240, 255, 0.12),
    0 26px 60px rgba(0, 0, 0, 0.78);
}

.status-bar {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: radial-gradient(circle at left, rgba(78, 240, 255, 0.14), transparent 70%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
}

#status-text {
  font-size: 0.9rem;
  color: var(--muted);
}

.info-card {
  position: relative;
  background: radial-gradient(circle at top, #181f3f, #050814);
  border-radius: var(--radius-md);
  border: 1px solid rgba(78, 240, 255, 0.2);
  padding: 12px 14px 14px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
}

.info-card h2 {
  margin: 0 0 8px;
  font-size: 1rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.95rem;
  padding: 4px 0;
}

.stat-row span:last-child {
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  text-shadow: 0 0 8px rgba(78, 240, 255, 0.7);
}

canvas#next {
  display: block;
  margin: 4px auto 0;
  border-radius: 10px;
  background: radial-gradient(circle at top, #181f3f, #050814);
  box-shadow: 0 0 0 1px rgba(78, 240, 255, 0.12);
}

.controls-card ul {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.controls-card li + li {
  margin-top: 4px;
}

.controls-card strong {
  color: var(--accent-secondary);
}

.footer {
  margin-top: 14px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}

@media (max-width: 900px) {
  .app {
    padding-inline: 14px;
  }

  .main {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  body {
    overflow-y: auto;
  }

  .app {
    padding-top: 20px;
    padding-bottom: 20px;
  }

  .main {
    grid-template-columns: minmax(0, 1fr);
  }

  .panel {
    padding: 14px;
  }
}

