: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(760px, calc(100% - 24px));
}

.hud {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  min-height: 52px;
  width: 100%;
}

.hud h1,
.stats p,
.status {
  margin: 0;
}

.hud h1 {
  text-align: center;
  color: #8dffb0;
  font-size: 30px;
}

.stats p {
  text-align: right;
  line-height: 1.45;
}

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

.stats {
  position: absolute;
  right: 0;
}

.controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 12px;
}

.controls button {
  min-width: 112px;
  min-height: 38px;
  border: 2px solid #54ff9f;
  border-radius: 6px;
  background: #101b18;
  color: #f7f7fb;
  cursor: pointer;
  font: inherit;
}

.controls button:hover,
.difficulty-item:hover {
  border-color: #ffd447;
}

.controls button:active,
.difficulty-item:active {
  transform: translateY(1px);
}

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

.board-column {
  width: 100%;
}

.side-column {
  display: grid;
  gap: 12px;
}

canvas {
  width: 100%;
  aspect-ratio: 448 / 480;
  display: block;
  border: 3px solid #54ff9f;
  background: #020806;
  image-rendering: pixelated;
}

.difficulty-panel {
  border: 2px solid #1f9f67;
  border-radius: 8px;
  background: #08110f;
  padding: 14px;
}

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

.difficulty-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.difficulty-item {
  width: 100%;
  min-height: 54px;
  display: grid;
  align-content: center;
  gap: 3px;
  border: 1px solid #244f3d;
  border-radius: 6px;
  padding: 9px 10px;
  background: #0d1815;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.difficulty-item--active {
  border-color: #ffd447;
  background: #1b1a0f;
}

.difficulty-name {
  color: #f7f7fb;
  font-weight: 700;
}

.difficulty-label {
  color: #9aa6bd;
  font-size: 13px;
}

.difficulty-item--active .difficulty-label {
  color: #ffd447;
}

.sound-button {
  width: 100%;
  min-height: 42px;
  border: 2px solid #54ff9f;
  border-radius: 6px;
  background: #101b18;
  color: #f7f7fb;
  cursor: pointer;
  font: inherit;
  font-size: 22px;
}

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

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

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

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

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

  .difficulty-panel {
    width: auto;
  }

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

@media (max-width: 480px) {
  .hud {
    font-size: 14px;
    min-height: 82px;
    align-items: start;
  }

  .hud h1 {
    font-size: 24px;
    margin-top: 26px;
  }

  .stats {
    top: 0;
  }

  .difficulty-list {
    grid-template-columns: 1fr;
  }
}
