:root {
  color-scheme: dark;
  background: #020403;
  color: #d8ffe8;
  font: 14px/1.6 ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  height: 100vh;
  height: 100dvh;
  margin: 0;
}

.player {
  display: grid;
  place-items: center;
  min-width: 0;
  overflow: auto;
  background: radial-gradient(ellipse at top, #0c2216, #020403 75%);
}

.launcher {
  width: min(100%, 460px);
  padding: 20px;
}

h1 {
  margin: 0;
  color: #41ff8a;
  font-size: clamp(24px, 6vw, 38px);
}

button, input::file-selector-button {
  min-height: 44px;
  padding: 6px 12px;
  border: 1px solid #33764e;
  border-radius: 3px;
  background: #0e291a;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

button:disabled { opacity: 0.6; cursor: wait; }
button:active, button.held { background: #22633d; }
label { display: block; margin: 12px 0 4px; }
input { max-width: 100%; font: inherit; }
a { color: #71d9e9; }
#status { color: #a0c4ac; }

canvas {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  image-rendering: pixelated;
  outline: none;
  background: #000;
  touch-action: none;
}

.controls {
  display: none;
  gap: 5px;
  padding: 6px;
  border-top: 1px solid #21422e;
  touch-action: none;
  user-select: none;
}

.controls button { padding: 4px; font-size: 12px; }
.keyboard { margin: 0; padding: 6px 12px; text-align: center; color: #a0c4ac; }

@media (pointer: coarse) {
  .controls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .keyboard { display: none; }
}

@media (pointer: coarse) and (orientation: landscape) {
  .controls { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
