:root {
  --lcd: #74e3e2;
  --lcd-light: #9af0ec;
  --lcd-dark: #073c43;
  --ink: #032e35;
}
* { box-sizing: border-box; }
body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: #1c4b4d;
  font-family: "Courier New", monospace;
}
.page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 30px 16px;
  background:
    radial-gradient(circle at center, #367b7d 0 20%, transparent 20.5%),
    linear-gradient(90deg, #1a4144 0 33%, #204f51 33% 67%, #1a4144 67%);
}
.back {
  position: fixed;
  top: 20px;
  left: 24px;
  color: #d9ffff;
  font: bold 14px Arial, sans-serif;
  text-decoration: none;
}
.lcd-shell {
  width: min(360px, 100%);
  padding: 14px 13px 19px;
  background: var(--lcd);
  border: 7px solid #062f35;
  box-shadow: 0 0 0 5px #a0f1ea, 0 18px 0 #082e34, 0 27px 35px #071c1e88;
}
.lcd-header {
  display: grid;
  grid-template-columns: 68px 1fr 116px;
  gap: 5px;
  align-items: center;
  margin-bottom: 10px;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 1px;
}
.lives, .score, .brand {
  min-height: 31px;
  display: grid;
  place-items: center;
  border: 3px solid var(--lcd-dark);
  background: var(--lcd-light);
}
.lives { font-family: Arial, sans-serif; font-size: 15px; letter-spacing: -2px; }
.brand { border: 0; font-size: 11px; }
.score { font-size: 16px; }
.game-frame {
  position: relative;
  overflow: hidden;
  border: 5px solid var(--lcd-dark);
  background: var(--lcd-light);
  touch-action: none;
}
canvas { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.message {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  background: #74e3e2a8;
  font-weight: 900;
}
.message[hidden] { display: none; }
.message strong {
  padding: 12px 18px;
  border: 4px double var(--lcd-dark);
  font-size: 30px;
  letter-spacing: 2px;
}
.message span { font-size: 12px; }
.message button, .restart {
  border: 3px solid var(--lcd-dark);
  padding: 10px 14px;
  background: var(--lcd-light);
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--lcd-dark);
  cursor: pointer;
  font: 900 14px "Courier New", monospace;
}
.message button:active, .restart:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--lcd-dark); }
.help { margin: 13px 0 10px; text-align: center; font-size: 11px; font-weight: 700; line-height: 1.5; }
.controls { display: flex; justify-content: space-between; gap: 28px; padding: 0 35px; }
.control {
  width: 88px;
  min-height: 51px;
  border: 4px solid #062f35;
  border-radius: 8px;
  color: #b9ffff;
  background: #15565a;
  box-shadow: inset 0 -5px #082f34, 0 4px #062f35;
  cursor: pointer;
  font: 900 30px Arial, sans-serif;
  touch-action: none;
}
.control:active, .control.pressed { transform: translateY(3px); box-shadow: inset 0 -2px #082f34, 0 1px #062f35; }
.restart { display: block; margin: 15px auto 0; font-size: 12px; }
@media (max-width: 520px) {
  .page { padding: 72px 11px 22px; }
  .back { top: 18px; left: 16px; }
  .lcd-shell { width: min(350px, 100%); }
}
