* { box-sizing: border-box; }

html, body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: #060b16;
  color: #f5f7ff;
  font-family: Arial, Helvetica, sans-serif;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

button { font: inherit; }

#game-shell {
  width: 100%;
  display: flex;
  justify-content: center;
}

#stage {
  position: relative;
  width: 100%;
  max-width: 960px;
  height: 56.25vw;
  max-height: 540px;
  overflow: hidden;
  background: #0b1220;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  touch-action: none;
  cursor: crosshair;
}

#game-canvas:focus-visible { outline: 3px solid #8ef3d5; outline-offset: -5px; }

#hud {
  position: absolute;
  z-index: 2;
  top: 16px;
  left: 16px;
  display: flex;
  gap: 8px;
  pointer-events: none;
}

#hud div {
  min-width: 74px;
  padding: 7px 9px;
  border: 1px solid rgba(142, 243, 213, .38);
  background: rgba(6, 11, 22, .78);
}

#hud span, #hud strong { display: block; }
#hud span { color: #a4b6d2; font-size: 10px; font-weight: 700; }
#hud strong { margin-top: 3px; color: #f5f7ff; font-size: 14px; }

#pause-button {
  position: absolute;
  z-index: 3;
  top: 16px;
  right: 16px;
  width: 38px;
  height: 34px;
  border: 1px solid rgba(142, 243, 213, .5);
  border-radius: 4px;
  background: rgba(6, 11, 22, .84);
  color: #f5f7ff;
  cursor: pointer;
}

#pause-button:focus-visible, .primary:focus-visible { outline: 3px solid #ffd56e; outline-offset: 2px; }

.panel {
  position: absolute;
  z-index: 4;
  top: 50%;
  left: 50%;
  width: min(430px, calc(100% - 32px));
  transform: translate(-50%, -50%);
  padding: 26px;
  border: 1px solid rgba(142, 243, 213, .58);
  border-radius: 6px;
  background: rgba(9, 17, 34, .94);
  box-shadow: 0 16px 46px rgba(0, 0, 0, .42);
  text-align: center;
}

.panel.compact { width: min(300px, calc(100% - 32px)); }
.panel h1, .panel h2 { margin: 6px 0 12px; font-size: 30px; }
.panel p { margin: 8px 0; color: #cfdaeb; line-height: 1.5; }
.kicker { color: #8ef3d5 !important; font-size: 12px; font-weight: 800; }
.controls-copy, .best-copy { font-size: 13px; }

.primary {
  min-height: 42px;
  margin-top: 14px;
  padding: 9px 18px;
  border: 0;
  border-radius: 4px;
  background: #8ef3d5;
  color: #07111a;
  font-weight: 800;
  cursor: pointer;
}

.primary:hover { background: #c4ffe9; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 560px) {
  #hud { top: 8px; left: 8px; gap: 4px; }
  #hud div { min-width: 55px; padding: 4px 6px; }
  #hud span { font-size: 8px; }
  #hud strong { font-size: 11px; }
  #pause-button { top: 8px; right: 8px; width: 32px; height: 28px; font-size: 12px; }
  .panel { padding: 17px; }
  .panel h1, .panel h2 { font-size: 24px; }
  .panel p { font-size: 13px; }
}
