:root { --bg: #140d24; --ink: #efeaff; --dim: #a99cc9; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
main { min-height: 100%; display: flex; flex-direction: column; align-items: center; padding: max(12px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); user-select: none; }
header { display: flex; align-items: baseline; justify-content: space-between; width: min(100%, 560px, calc(100dvh - 250px)); min-width: 280px; margin-bottom: 10px; }
h1 { margin: 0; font-size: 22px; letter-spacing: 5px; font-weight: 800; }
.gen { margin: 0; color: var(--dim); font-size: 13px; }
/* the screen is the whole game: one big square */
.screen { width: min(100%, 560px, calc(100dvh - 250px)); min-width: 280px; aspect-ratio: 1; border-radius: 18px; overflow: hidden;
  background: #f7f2ff; padding: 0; box-shadow: 0 0 0 4px #2a1f45, 0 18px 40px rgba(0,0,0,.45); }
#lcd { display: block; width: 100%; height: auto; aspect-ratio: 1; }
.status { margin: 14px 0 8px; min-height: 22px; font-weight: 600; text-align: center; }
.buttons { display: flex; gap: 28px; justify-content: center; margin: 4px 0 10px; }
.btn { width: 74px; height: 74px; border-radius: 50%; border: 0; cursor: pointer; font: 800 18px system-ui; color: rgba(60,20,90,.6);
  background: radial-gradient(60% 60% at 35% 30%, #fff7d6, #facc15 55%, #ca8a04); box-shadow: 0 5px 0 #92400e, 0 8px 14px rgba(0,0,0,.35); touch-action: manipulation; }
.btn.down { transform: translateY(4px); box-shadow: 0 1px 0 #92400e, 0 3px 6px rgba(0,0,0,.35); }
.help { margin: 0; color: var(--dim); font-size: 13px; text-align: center; }
.help b { color: #facc15; }
.row { display: flex; gap: 18px; margin-top: 8px; }
.link { background: none; border: 0; color: var(--dim); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; padding: 6px; }
