:root {
  --shell:   #0F172A;
  --accent:  #2563EB;
  --crystal: #7EEFD6;
  --glow:    #CFFFF7;
  --face:    #F2F5F7;
  --outline: #161B23;
  --bug:     #F25C7E;
  --super:   #FFD86B;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: var(--shell); color: var(--face);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
body {
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 30%, #1B2742 0%, #0A1020 70%, #05080F 100%);
}
.frame {
  border: 2px solid var(--accent);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 0 40px rgba(37,99,235,0.25), inset 0 0 30px rgba(126,239,214,0.06);
  background: rgba(15,23,42,0.6);
  display: flex; flex-direction: column; align-items: center;
  max-width: 98vw; max-height: 98vh;
}
.topbar {
  display: flex; justify-content: space-between; width: 100%;
  align-items: baseline; margin-bottom: 8px; gap: 16px;
}
h1 {
  margin: 0; font-size: 14px; letter-spacing: 4px; color: var(--crystal);
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(126,239,214,0.6);
}
.sub { margin: 0; font-size: 10px; opacity: 0.65; letter-spacing: 2px; }
canvas {
  display: block; image-rendering: pixelated; image-rendering: crisp-edges;
  background: #050A18; border-radius: 8px;
  width: min(96vw, calc((96vh - 200px) * (1024 / 576)));
  height: auto;
  touch-action: none;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.hud {
  display: flex; gap: 20px; margin-top: 10px; font-size: 12px; letter-spacing: 1px;
  flex-wrap: wrap; justify-content: center;
}
.hud span b { color: var(--crystal); font-weight: 700; }
.help {
  margin-top: 6px; font-size: 10px; opacity: 0.55; letter-spacing: 1px;
  text-align: center; max-width: 96vw;
}
.touch {
  display: none; width: 100%; margin-top: 10px; gap: 12px;
  justify-content: space-between; align-items: center;
  touch-action: none; -webkit-user-select: none; user-select: none;
}
.touch .group { display: flex; gap: 10px; }
.btn {
  -webkit-tap-highlight-color: transparent;
  background: rgba(37,99,235,0.18); color: var(--face);
  border: 2px solid var(--accent); border-radius: 14px;
  padding: 16px 22px; font-family: inherit; font-size: 18px;
  letter-spacing: 2px; min-width: 64px; touch-action: none;
  font-weight: 700; cursor: pointer;
}
.btn.active, .btn:active { background: rgba(126,239,214,0.30); border-color: var(--crystal); color: var(--crystal); }
.btn.jump { padding: 18px 26px; min-width: 96px; border-color: var(--crystal);
  background: rgba(126,239,214,0.12); }
@media (hover: none) and (pointer: coarse) {
  .touch { display: flex; }
  .help { display: none; }
  .hud { font-size: 11px; gap: 10px; }
  h1 { font-size: 12px; letter-spacing: 2px; }
  .sub { display: none; }
  .frame { padding: 8px 10px; }
  canvas { width: min(98vw, calc((100vh - 240px) * (1024 / 576))); }
}
@media (hover: none) and (pointer: coarse) and (orientation: portrait) {
  canvas { width: 98vw; }
}
