:root {
  color-scheme: dark;
  font-family: Avenir Next, Avenir, "Trebuchet MS", system-ui, sans-serif;
  background: #061c2e;
}

* { box-sizing: border-box; }

body {
  align-items: center;
  background:
    radial-gradient(circle at 50% -20%, #2479a0 0, transparent 38%),
    linear-gradient(145deg, #0b2f48 0%, #061827 80%);
  display: flex;
  justify-content: center;
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
}

.game-frame {
  box-shadow: 0 30px 80px #000a, 0 0 0 1px #ffffff26;
  height: 720px;
  overflow: hidden;
  position: relative;
  width: 1280px;
}

canvas {
  display: block;
  height: 720px;
  image-rendering: auto;
  width: 1280px;
}

.welcome {
  align-items: center;
  background: linear-gradient(#06233add, #0a3659e8);
  display: flex;
  flex-direction: column;
  inset: 0;
  justify-content: center;
  padding: 34px;
  position: absolute;
  text-align: center;
  transition: opacity 260ms ease, visibility 260ms ease;
}

.welcome.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.eyebrow {
  color: #ffe49a;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .24em;
  margin: 0 0 5px;
}

h1 {
  color: #fffef8;
  font-size: 76px;
  font-style: italic;
  font-weight: 900;
  letter-spacing: -.07em;
  line-height: .9;
  margin: 0;
  text-shadow: 0 5px 0 #0d6382, 0 10px 25px #001b2d;
}

h1 span { color: #ffe269; }

.subtitle {
  color: #dceefa;
  font-size: 18px;
  margin: 18px 0 24px;
}

.control-grid {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-bottom: 24px;
}

.control-card {
  align-items: center;
  background: #ffffffeb;
  border-radius: 14px;
  color: #102d40;
  display: flex;
  flex-direction: column;
  min-height: 146px;
  padding: 14px 27px 12px;
  width: 238px;
}

.red-card { border-bottom: 6px solid #e74747; }
.green-card { border-bottom: 6px solid #2fb66b; }

.player-label { font-size: 12px; font-weight: 900; letter-spacing: .09em; margin-bottom: 7px; }
.keys { color: #12384d; font-size: 21px; font-weight: 900; letter-spacing: .2em; line-height: 1.15; }
.keys.arrows { letter-spacing: .15em; }
.keys.wide { background: #e4f0f2; border-radius: 4px; font-size: 12px; letter-spacing: .12em; margin-top: 8px; padding: 3px 12px; }
.control-card small { color: #527282; font-size: 11px; font-weight: 700; margin-top: 2px; }

button {
  background: linear-gradient(180deg, #ffe76e, #ffbf3c);
  border: 0;
  border-bottom: 5px solid #c87818;
  border-radius: 999px;
  box-shadow: 0 7px 18px #001c3199;
  color: #173448;
  cursor: pointer;
  font: 900 17px/1 Avenir Next, Avenir, system-ui, sans-serif;
  letter-spacing: .08em;
  padding: 15px 34px 13px;
}

button:hover { filter: brightness(1.05); transform: translateY(-1px); }
button:active { border-bottom-width: 2px; transform: translateY(3px); }

.tip { color: #b9d6e8; font-size: 12px; font-weight: 600; margin: 17px 0 0; }

@media (max-width: 1300px), (max-height: 760px) {
  .game-frame { transform: scale(min(calc(100vw / 1280), calc(100vh / 720))); transform-origin: center; }
  body { min-width: 1280px; min-height: 720px; }
}
