:root {
  --bg-top: #09203f;
  --bg-bottom: #06101f;
  --panel: rgba(8, 18, 34, 0.82);
  --panel-border: rgba(134, 187, 216, 0.28);
  --text: #eff7ff;
  --muted: #9fc3da;
  --warm: #ffb703;
  --warm-strong: #fb8500;
  --cool: #63c7ff;
  --cool-deep: #1982c4;
  --danger: #ff6b6b;
  --success: #7bd389;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Aptos", "Segoe UI", "Trebuchet MS", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(99, 199, 255, 0.22), transparent 28%),
    radial-gradient(circle at bottom right, rgba(251, 133, 0, 0.18), transparent 24%),
    linear-gradient(160deg, var(--bg-top), var(--bg-bottom));
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  border-radius: 999px;
  filter: blur(18px);
  opacity: 0.6;
  pointer-events: none;
}

body::before {
  width: 280px;
  height: 280px;
  top: 8%;
  right: -60px;
  background: rgba(255, 183, 3, 0.2);
}

body::after {
  width: 220px;
  height: 220px;
  bottom: 5%;
  left: -80px;
  background: rgba(25, 130, 196, 0.22);
}

.page-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 40px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 24px;
}

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

h1,
h2 {
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  letter-spacing: 0.02em;
}

h1 {
  margin: 0;
  font-size: clamp(2.5rem, 5vw, 4.8rem);
  line-height: 0.95;
}

.hero-copy {
  max-width: 58ch;
  color: var(--muted);
  margin: 14px 0 0;
  font-size: 1.02rem;
}

.hero-badge {
  min-width: 240px;
  padding: 16px 18px;
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  background: rgba(4, 15, 30, 0.66);
  box-shadow: var(--shadow);
}

.hero-badge span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 6px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(290px, 1fr);
  gap: 24px;
  align-items: stretch;
}

.playfield-card,
.panel {
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.playfield-card {
  padding: 20px;
}

.canvas-frame {
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(2, 6, 12, 0.85);
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
}

.status-banner {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(6, 15, 28, 0.82);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  line-height: 1.5;
}

.touch-controls {
  display: none;
  gap: 12px;
  margin-top: 16px;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100%;
}

.sidebar .panel:last-child {
  margin-top: auto;
}

.panel {
  padding: 18px;
}

.panel h2 {
  margin: 0 0 14px;
  font-size: 1.5rem;
}

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

.stat-card {
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(10, 28, 54, 0.9), rgba(8, 18, 34, 0.6));
  border: 1px solid rgba(255, 255, 255, 0.08);
}

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

.stat-card strong {
  font-size: 1.5rem;
}

.control-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.6;
}

kbd {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 0.82rem;
}

.action-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

button {
  font: inherit;
  cursor: pointer;
  transition:
    transform 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

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

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

.primary-action,
.secondary-action,
.touch-button {
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
}

.primary-action,
.touch-button.accent {
  background: linear-gradient(135deg, var(--warm), var(--warm-strong));
  color: #101318;
  box-shadow: 0 16px 32px rgba(251, 133, 0, 0.28);
}

.secondary-action,
.touch-button {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

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

@media (max-width: 980px) {
  .hero,
  .layout {
    grid-template-columns: 1fr;
    display: grid;
  }

  .hero-badge {
    min-width: 0;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 1200px);
    padding-top: 20px;
  }

  .playfield-card,
  .panel {
    border-radius: 20px;
  }

  .touch-controls {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
