@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

:root { color-scheme: dark; --blue: #245cff; --yellow: #ffe33b; --cream: #ffdca8; }
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: #050510; }
body {
  min-height: 100vh; min-height: 100dvh;
  color: #fff; font-family: "Press Start 2P", ui-monospace, monospace;
  overflow-x: hidden; touch-action: pan-y;
  background: radial-gradient(circle at 50% 35%, #11113a 0, #050510 55%);
}
button { font: inherit; }
.shell { width: min(94vw, 560px); margin: 0 auto; padding: 18px 0 24px; }
.topbar, .statusbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 12px; }
.topbar { padding: 0 8px 14px; text-align: center; }
.topbar > div:first-child { text-align: left; }
.topbar > div:last-child { text-align: right; }
.label { display: block; color: #7f89b4; font-size: clamp(7px, 1.8vw, 10px); margin-bottom: 7px; }
.topbar strong { font-size: clamp(12px, 3vw, 17px); color: var(--cream); }
.brand { font-size: clamp(9px, 2.4vw, 14px); letter-spacing: 1px; white-space: nowrap; }
.brand span { color: var(--yellow); }
.daily-card { display: flex; justify-content: space-between; gap: 12px; padding: 0 8px 10px; color: #68729c; font-size: 7px; }
.daily-card strong { color: #57d7ff; }
.game-frame { position: relative; border: 3px solid #111846; box-shadow: 0 0 0 2px #050510, 0 0 28px #1537aa88; background: #02020a; }
canvas { display: block; width: 100%; height: auto; image-rendering: pixelated; outline: none; touch-action: none; }
.overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; text-align: center; background: #02020ad9; backdrop-filter: blur(3px); z-index: 2;
}
.overlay.hidden { display: none; }
.overlay h1 { margin: 8px 0 18px; color: var(--yellow); font-size: clamp(20px, 6vw, 36px); line-height: 1.4; text-shadow: 4px 4px #e04b30; }
.overlay p { max-width: 430px; color: #aab1d0; font-size: clamp(8px, 2vw, 11px); line-height: 2; }
.overlay .eyebrow { color: #57d7ff; letter-spacing: 2px; }
.overlay button { margin: 16px 0 8px; padding: 15px 20px; border: 0; color: #050510; background: var(--yellow); box-shadow: 5px 5px #df4c32; cursor: pointer; }
.overlay button:hover, .overlay button:focus-visible { transform: translate(-2px, -2px); box-shadow: 7px 7px #df4c32; }
.overlay .key-hint { color: #656d91; font-size: 7px; }
.statusbar { padding: 14px 6px 0; min-height: 46px; }
.lives { display: flex; gap: 7px; }
.life { width: 17px; height: 17px; border-radius: 50%; background: conic-gradient(from 45deg, transparent 0 25%, var(--yellow) 0); transform: rotate(-22deg); }
.controls { display: flex; gap: 8px; }
.controls button { width: 34px; height: 30px; padding: 0; border: 1px solid #28316d; background: #0d1231; color: #b5bce0; cursor: pointer; }
.level { justify-self: end; font-size: 8px; color: #737da6; }
.level strong { color: var(--cream); }
.dpad { display: none; margin: 12px auto 0; text-align: center; }
.dpad button { width: 58px; height: 48px; border: 1px solid #2e397b; border-radius: 7px; color: #c8d0ff; background: #11183bcc; }
.dpad > div { display: flex; gap: 5px; justify-content: center; margin-top: 5px; }
.dpad button:active { background: #26348a; color: #fff; }
.leaderboard { margin-top: 18px; padding: 14px; border: 2px solid #111846; background: #090a20; }
.leaderboard-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.leaderboard h2 { margin: 0; color: var(--yellow); font-size: 10px; }
.leaderboard input { width: 160px; padding: 8px; border: 1px solid #28316d; color: #fff; background: #050510; font: inherit; font-size: 7px; }
.leaderboard-tabs { display: flex; gap: 6px; margin: 12px 0 8px; }
.leaderboard-tabs button { flex: 1; padding: 8px 4px; border: 1px solid #28316d; color: #7f89b4; background: #0d1231; font-size: 7px; cursor: pointer; }
.leaderboard-tabs button.active { color: #050510; background: #57d7ff; }
#leaderboard-status { margin: 10px 0; color: #68729c; font-size: 7px; }
#leaderboard-rows { margin: 0; padding: 0; list-style: none; font-size: 8px; }
#leaderboard-rows li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 2px; border-top: 1px solid #171b42; color: #c8d0ff; }
#leaderboard-rows strong { color: var(--cream); }
#leaderboard-rows .empty { justify-content: center; color: #68729c; }
@media (pointer: coarse), (max-height: 760px) {
  .shell { width: min(92vw, 480px); padding-top: 8px; }
  .topbar { padding-bottom: 8px; }
  .dpad { display: block; }
  .statusbar { padding-top: 8px; }
}
@media (max-height: 690px) and (orientation: landscape) {
  body { display: block; }
  .shell { width: min(52vh, 460px); margin: 0 auto; }
  .dpad { position: fixed; right: 18px; bottom: 18px; }
}
