* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #202838 0, #050711 55%, #000 100%);
  color: #f5f7ff;
}

body {
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.header {
  text-align: center;
}

.header h1 {
  margin: 0;
  font-size: 2.4rem;
  letter-spacing: 0.08em;
}

.subtitle {
  margin: 4px 0 0;
  font-size: 0.9rem;
  opacity: 0.7;
}

.game-layout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: center;
}

.board-wrapper {
  background: #050711;
  padding: 8px;
  border-radius: 12px;
  box-shadow: 0 0 32px rgba(0, 0, 0, 0.8);
}

#game {
  display: block;
  background: #050711;
  border-radius: 4px;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 200px;
}

.panel {
  background: rgba(5, 7, 17, 0.92);
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.panel h2 {
  margin: 0 0 8px;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.85;
}

.stats {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-variant-numeric: tabular-nums;
}

.stat {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
}

.controls {
  margin: 0;
  padding-left: 18px;
  font-size: 0.9rem;
  opacity: 0.85;
}

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

.note {
  font-size: 0.9rem;
  opacity: 0.85;
  min-height: 2em;
}

@media (max-width: 800px) {
  .game-layout {
    flex-direction: column;
    align-items: center;
  }

  .sidebar {
    width: 100%;
    max-width: 320px;
  }

  .page {
    padding: 12px;
  }
}
