* { box-sizing: border-box; }

:root {
  font-family: "Courier New", monospace;
  color: #fff;
  background: #07182b;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow-x: hidden;
  background: radial-gradient(circle at 50% 0, #164a70, #071323 70%);
}

.cabinet {
  width: min(100%, 1020px);
  text-align: center;
}

header h1 {
  margin: 0;
  color: #ffc928;
  font-size: clamp(2rem, 7vw, 4.5rem);
  letter-spacing: .08em;
  text-shadow: 4px 4px #9e341d;
}

header p {
  margin: 0 0 12px;
  color: #8bd8f5;
  font-size: .75rem;
  letter-spacing: .15em;
}

.screen {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 3px solid #e9b83e;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 0 5px #102d48, 0 14px 35px #0008;
  background: #24668b;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  touch-action: none;
}

.controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 14px;
  color: #a8d3df;
  font-size: .7rem;
}

button {
  border: 2px solid #ffd34e;
  background: #c83d27;
  color: white;
  padding: 10px 18px;
  font: bold .8rem monospace;
  cursor: pointer;
  box-shadow: 3px 3px #571e25;
}

button:focus-visible {
  outline: 3px solid #8deaff;
  outline-offset: 3px;
}

button:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px #571e25;
}

.altitude {
  display: none;
  position: absolute;
  right: 14px;
  bottom: 14px;
  background: #1978aacc;
  border-color: #8deaff;
  border-radius: 50%;
  width: 88px;
  height: 88px;
  padding: 4px;
  font-size: .65rem;
  touch-action: none;
  user-select: none;
}

@media (max-width: 600px) {
  body { padding: 8px; }
  header h1 { font-size: 2.2rem; }
  header p { font-size: .6rem; }
  .altitude { display: block; }
  .controls { margin-top: 12px; gap: 9px; }
  .controls span { width: 100%; font-size: .6rem; line-height: 1.4; }
}

@media (max-width: 380px) {
  .screen { border-width: 2px; }
  button { padding: 9px 12px; }
}
