:root {
  color-scheme: dark;
  font-family: Arial, Helvetica, sans-serif;
  background: #07070b;
  color: #f7f7fb;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.game-shell {
  width: min(1060px, calc(100% - 24px));
}

.hud {
  position: relative;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hud h1 {
  margin: 0;
  color: #ffd447;
  font-size: 36px;
}

.back-link {
  position: absolute;
  left: 0;
  color: #9bd8ff;
  text-decoration: none;
}

.scoreboard {
  position: absolute;
  right: 0;
  display: flex;
  gap: 8px;
  color: #f7f7fb;
  font-size: 26px;
  font-weight: 700;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 10px 0 14px;
}

.play-area {
  display: grid;
  grid-template-columns: minmax(0, 860px) 160px;
  align-items: start;
  justify-content: center;
  gap: 18px;
}

.court-column {
  width: 100%;
}

.level-panel {
  border: 2px solid #1f5f99;
  border-radius: 8px;
  background: #08111f;
  padding: 14px;
}

.level-panel h2 {
  margin: 0 0 12px;
  color: #ffd447;
  font-size: 18px;
  text-align: center;
}

.difficulty-controls {
  display: grid;
  gap: 10px;
}

.side-panel-section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(47, 156, 255, 0.45);
}

.mode-controls {
  display: grid;
  gap: 10px;
}

button {
  min-width: 112px;
  min-height: 38px;
  border: 2px solid #2f9cff;
  border-radius: 6px;
  background: #111827;
  color: #f7f7fb;
  cursor: pointer;
  font: inherit;
}

button:hover {
  border-color: #ffd447;
}

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

.mode-button--active {
  border-color: #ffd447;
  background: #1d1a0d;
}

.difficulty-button--active {
  border-color: #8dffb0;
  background: #102016;
}

canvas {
  width: 100%;
  aspect-ratio: 800 / 460;
  display: block;
  border: 3px solid #2f9cff;
  background: #02040a;
  image-rendering: pixelated;
}

.status {
  min-height: 24px;
  margin: 12px 0 0;
  color: #c8c8d4;
  text-align: center;
}

.instructions {
  margin-top: 12px;
  padding: 12px;
  border: 2px solid #1f5f99;
  border-radius: 8px;
  background: #08111f;
  text-align: center;
}

.instructions h2,
.instructions p {
  margin: 0;
}

.instructions h2 {
  margin-bottom: 6px;
  color: #ffd447;
  font-size: 18px;
}

.instructions p {
  color: #c8c8d4;
}

@media (max-width: 560px) {
  .hud {
    min-height: 92px;
    align-items: start;
  }

  .hud h1 {
    margin-top: 28px;
    font-size: 30px;
  }

  .scoreboard {
    top: 0;
    font-size: 22px;
  }
}

@media (max-width: 900px) {
  .game-shell {
    width: min(860px, calc(100% - 24px));
  }

  .play-area {
    grid-template-columns: 1fr;
  }

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

  .mode-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
