* { box-sizing: border-box; }
html, body { margin: 0; background: #0A0A12; color: #FFFFFF; font-family: Urbanist, system-ui, sans-serif; }
.bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 4px solid #E00000; flex-wrap: wrap; }
.back { color: #FFC400; text-decoration: none; font-weight: 800; min-height: 40px; display: inline-flex; align-items: center; }
.brand { font-family: 'Press Start 2P', monospace; font-size: 12px; }
.brand small { color: #9A9AB0; font-size: 9px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 16px; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; }
.stage { position: relative; height: min(78vh, 760px); border: 4px solid #FFFFFF; box-shadow: 8px 8px 0 #E00000; overflow: hidden; }
#game { width: 100%; height: 100%; display: block; touch-action: none; }
.hud { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; gap: 8px; padding: 10px 12px; font-family: 'Press Start 2P', monospace; font-size: 11px; pointer-events: none; text-shadow: 2px 2px 0 #0A0A12; }
.hud .lives { color: #E00000; letter-spacing: 2px; font-family: system-ui, sans-serif; font-size: 20px; line-height: 1; }
.menu { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; background: rgba(10, 10, 18, .88); text-align: center; overflow-y: auto; }
.menu[hidden], .hud[hidden], .last[hidden] { display: none; }
.menu h1 { margin: 0; font-family: 'Press Start 2P', monospace; font-size: clamp(28px, 6vw, 52px); color: #FFFFFF; text-shadow: 5px 5px 0 #E00000; }
.sub { margin: 0; font-size: 18px; font-weight: 700; }
.best, .last { font-family: 'Press Start 2P', monospace; font-size: 11px; color: #FFC400; }
.last b { font-size: 20px; color: #FFFFFF; }
.form { display: flex; flex-direction: column; gap: 10px; width: min(340px, 100%); text-align: left; }
.form label { display: flex; flex-direction: column; gap: 4px; font-weight: 700; font-size: 14px; }
.form input, .form select { min-height: 46px; font: 600 16px Urbanist, sans-serif; padding: 0 10px; border: 4px solid #FFFFFF; background: #0A0A12; color: #FFFFFF; }
.play { min-height: 54px; font-family: 'Press Start 2P', monospace; font-size: 14px; background: #E00000; color: #FFFFFF; border: 4px solid #FFFFFF; box-shadow: 6px 6px 0 #5A0000; cursor: pointer; }
.play:active { transform: translate(3px, 3px); box-shadow: 3px 3px 0 #5A0000; }
.msg { min-height: 1.2em; margin: 0; color: #FFC400; font-weight: 700; }
.how { margin: 0; color: #B8B8CC; font-size: 14px; max-width: 360px; }
.boards { display: flex; flex-direction: column; gap: 16px; }
.board { border: 4px solid #FFFFFF; padding: 14px; background: #12121C; }
.board h2 { margin: 0 0 10px; font-family: 'Press Start 2P', monospace; font-size: 11px; color: #FFC400; }
.board ol { list-style: none; margin: 0; padding: 0; font-size: 15px; }
.board li { display: grid; grid-template-columns: 38px 1fr auto; gap: 8px; padding: 6px 0; border-bottom: 1px solid #2A2A3A; align-items: center; }
.board .rk { font-family: 'Press Start 2P', monospace; font-size: 10px; color: #E00000; }
.board .nm { font-weight: 700; overflow-wrap: anywhere; }
.board .nm small { display: block; color: #9A9AB0; font-weight: 500; font-size: 12px; }
.board .sc { font-weight: 800; }
.board li.me { background: #2A1010; outline: 2px solid #E00000; }
.sync, .pending { margin: 0; font-size: 14px; color: #FFC400; min-height: 0; }
.sync:empty, .pending:empty { display: none; }
@media (max-width: 860px) {
  .wrap { grid-template-columns: 1fr; padding: 10px; }
  .stage { height: 72vh; }
  body.playing .bar { display: none; }
  body.playing .stage { height: 100svh; margin: -10px; border: 0; box-shadow: none; }
}
