* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  padding: 30px 16px;
  font-family: Arial, Helvetica, sans-serif;
  color: white;
  background:
    radial-gradient(circle at top, #213c71, #080e1c 55%);
}

button,
a {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.game-container {
  width: min(720px, 100%);
  margin: auto;
}

.back-button {
  display: inline-block;
  margin-bottom: 18px;
  color: #b9c8ff;
}

.back-button:hover {
  color: white;
}

.game-panel {
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
}

.game-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.small-heading {
  margin-bottom: 6px;
  color: #63f1ff;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1.8px;
}

.game-heading h1 {
  font-size: clamp(2rem, 8vw, 3.4rem);
}

.icon-button {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: white;
  background: rgba(255, 255, 255, 0.1);
  font-size: 1.3rem;
}

.score-board {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.score-board div {
  padding: 16px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.08);
  text-align: center;
}

.score-board span {
  display: block;
  margin-bottom: 5px;
  color: #b9c7ef;
}

.score-board strong {
  font-size: 1.7rem;
}

.canvas-wrapper {
  position: relative;
  width: min(400px, 100%);
  margin: auto;
}

canvas {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border: 4px solid rgba(99, 241, 255, 0.25);
  border-radius: 18px;
  background: #07101d;
  box-shadow: 0 0 35px rgba(99, 241, 255, 0.14);
}

.game-message {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  padding: 24px;
  border-radius: 18px;
  background: rgba(4, 10, 21, 0.82);
  text-align: center;
}

.game-message h2 {
  margin-bottom: 8px;
  font-size: 2rem;
}

.game-message p {
  margin-bottom: 18px;
  color: #c7d1f2;
}

.game-message button,
.restart-button {
  padding: 13px 20px;
  border-radius: 12px;
  color: #06101d;
  background: linear-gradient(135deg, #62efff, #7dff9e);
  font-weight: bold;
}

.status {
  margin: 18px 0;
  color: #cbd5f5;
  text-align: center;
}

.controls {
  display: none;
  text-align: center;
}

.controls > button {
  display: block;
  margin: 0 auto 8px;
}

.controls div {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.controls button {
  width: 62px;
  height: 52px;
  border-radius: 12px;
  color: white;
  background: rgba(255, 255, 255, 0.1);
  font-size: 1.25rem;
}

.restart-button {
  display: block;
  margin: 18px auto 0;
}

.hidden {
  display: none;
}

@media (max-width: 700px) {
  .game-panel {
    padding: 20px;
  }

  .controls {
    display: block;
  }
}