:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: #020617;
  color: #e2e8f0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top, rgba(56, 189, 248, 0.14), transparent 30%),
    linear-gradient(180deg, #020617 0%, #111827 100%);
}

button {
  border: 0;
  border-radius: 999px;
  padding: 0.75rem 1rem;
  font-weight: 700;
  background: linear-gradient(135deg, #38bdf8, #8b5cf6);
  color: white;
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease;
}

button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(1px);
}

.app-shell {
  width: min(1080px, calc(100vw - 2rem));
  margin: 0 auto;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 300px;
  gap: 1.5rem;
  align-items: center;
  padding: 1.5rem 0;
}

.game-panel,
.stat-card,
.status-card {
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.8);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(14px);
}

.game-panel {
  padding: 1rem;
  border-radius: 28px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.eyebrow {
  margin: 0 0 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #38bdf8;
  font-size: 0.72rem;
}

h1,
h2,
p,
ul {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
}

.button-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

#board {
  width: 100%;
  max-width: 480px;
  aspect-ratio: 1 / 2;
  display: block;
  margin: 0 auto;
  border-radius: 20px;
  border: 1px solid rgba(56, 189, 248, 0.24);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.85));
}

.sidebar {
  display: grid;
  gap: 1rem;
}

.stat-card,
.status-card {
  border-radius: 22px;
  padding: 1rem 1.1rem;
}

.stat-card h2,
.controls-card h2 {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.stat-card p {
  font-size: 2rem;
  font-weight: 800;
}

.next-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.next-piece {
  min-height: 82px;
  border-radius: 16px;
  background: rgba(30, 41, 59, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.15);
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  font-weight: 800;
}

.controls-card ul {
  padding-left: 1rem;
  display: grid;
  gap: 0.4rem;
  color: #cbd5e1;
}

.status-card {
  color: #cbd5e1;
  font-size: 0.98rem;
  line-height: 1.5;
}

.status-card.win {
  border-color: rgba(74, 222, 128, 0.4);
  color: #bbf7d0;
}

.status-card.warn {
  border-color: rgba(248, 113, 113, 0.4);
  color: #fecaca;
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
    width: min(640px, calc(100vw - 1rem));
  }

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

  .button-row {
    justify-content: flex-start;
  }
}
