:root{--orange:#ff6600;--orange-hot:#ff8533;--black:#0a0a0a;--panel:#161616;--white:#f5f5f5;--muted:#9a9a9a;
  --font:"Segoe UI",system-ui,-apple-system,Roboto,Ubuntu,sans-serif}
*{box-sizing:border-box;margin:0;padding:0}
html,body{position:fixed;inset:0;width:100%;height:100%;overflow:hidden;background:var(--black);color:var(--white);
  font-family:var(--font);touch-action:none;overscroll-behavior:none;-webkit-tap-highlight-color:transparent;
  user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
#game{position:fixed;inset:0;width:100vw;height:100vh;height:100dvh;display:block;touch-action:none}
.icon-btn{position:fixed;top:calc(env(safe-area-inset-top) + 8px);right:calc(env(safe-area-inset-right) + 8px);z-index:50;
  width:40px;height:40px;border-radius:10px;border:1px solid rgba(255,102,0,.45);background:rgba(22,22,22,.85);color:var(--white);
  font-size:1.05rem;cursor:pointer;display:grid;place-items:center}
.icon-btn.muted{opacity:.55}
.touch{position:fixed;left:0;right:0;bottom:0;z-index:10;display:none;justify-content:space-between;align-items:flex-end;
  padding:10px calc(env(safe-area-inset-right) + 10px) calc(env(safe-area-inset-bottom) + 12px) calc(env(safe-area-inset-left) + 10px);
  pointer-events:none}
body.is-touch .touch{display:flex}
body.is-touch.no-touch-ui .touch{display:none}
.pad{display:flex;gap:10px;pointer-events:auto;align-items:flex-end}
.tbtn{width:74px;height:74px;border-radius:50%;border:2px solid rgba(255,102,0,.6);background:rgba(20,20,20,.72);
  color:var(--white);font:800 1.4rem var(--font);touch-action:none;display:grid;place-items:center;letter-spacing:.02em}
.pad.right .tbtn{font-size:.78rem}
.tbtn.small{width:58px;height:58px;margin-bottom:46px}
.tbtn.attack{width:86px;height:86px;background:rgba(255,102,0,.82);color:#111;border-color:#ffb27a;font-size:.9rem}
.tbtn.on{transform:scale(.93);background:rgba(255,102,0,.55)}
.tbtn.attack.on{background:#ff8533}
@media (orientation:landscape) and (max-height:500px){
  .tbtn{width:62px;height:62px}.tbtn.attack{width:74px;height:74px}.tbtn.small{width:50px;height:50px;margin-bottom:34px}
}
.overlay{position:fixed;inset:0;z-index:40;display:flex;align-items:center;justify-content:center;padding:14px;
  background:radial-gradient(ellipse 80% 55% at 50% 0%,rgba(255,102,0,.22),transparent 65%),rgba(8,8,8,.9);
  touch-action:pan-y}
.overlay.hidden{display:none}
.card{width:100%;max-width:420px;max-height:100%;overflow-y:auto;touch-action:pan-y;
  background:var(--panel);border:1px solid rgba(255,102,0,.4);border-radius:18px;padding:18px 18px 14px;text-align:center;
  box-shadow:0 10px 40px rgba(0,0,0,.6)}
.card.small{max-width:360px}
.logo-hero{width:120px;height:auto;display:block;margin:0 auto 6px;filter:drop-shadow(0 0 18px rgba(255,102,0,.35))}
.logo-hero.sm{width:76px}
h1{font-size:2rem;font-weight:900;letter-spacing:.01em;line-height:1.05;display:flex;flex-direction:column;align-items:center}
h1 .dollar{font-size:.8rem;color:var(--orange);letter-spacing:.18em;margin-bottom:2px}
h2{font-size:1.4rem;font-weight:900;color:var(--orange)}
.tag{color:#cfcfcf;margin:6px 0 12px;font-size:.95rem}
.how{color:var(--muted);font-size:.74rem;margin-top:8px;line-height:1.4}
body.is-touch #howKeys{display:none}
body:not(.is-touch) #howTouch{display:none}
.btn{appearance:none;border:1px solid rgba(255,102,0,.6);background:#222;color:var(--white);font:800 1rem var(--font);
  border-radius:12px;padding:10px 16px;cursor:pointer}
.btn.primary{background:var(--orange);color:#111;border-color:#ffb27a;font-size:1.2rem;padding:12px 40px;letter-spacing:.04em}
.btn:active{transform:scale(.97)}
.btn:disabled{opacity:.5}
.board{margin:12px 0 10px;text-align:left;background:#0e0e0e;border:1px solid rgba(255,102,0,.2);border-radius:12px;padding:8px 10px}
.board h3{font-size:.78rem;color:var(--orange);text-transform:uppercase;letter-spacing:.12em;margin-bottom:4px}
.lb{list-style:none;font-size:.88rem;max-height:30vh;overflow-y:auto;touch-action:pan-y}
#startBoard{max-height:17vh}
.lb li{display:flex;gap:8px;padding:3px 2px;border-bottom:1px solid #1d1d1d}
.lb li:last-child{border-bottom:0}
.lb .rk{color:var(--muted);width:2em;flex-shrink:0;text-align:right}
.lb .nm{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.lb .sc{color:var(--orange);font-weight:800}
.lb li.me .nm{color:var(--orange-hot)}
.lb li.empty{color:var(--muted);justify-content:center;font-style:italic}
.fine{font-size:.72rem;color:var(--muted);margin-top:6px}
.fine a{color:var(--orange-hot);text-decoration:none}
.ca{appearance:none;background:none;border:0;color:var(--muted);font:600 .68rem ui-monospace,Menlo,monospace;cursor:pointer;
  word-break:break-all;padding:2px;text-decoration:underline dotted}
.streak{font-size:1rem;color:#ddd;margin:4px 0}
.streak strong{color:var(--orange);font-size:1.6rem;margin-left:4px}
.over-line{color:#cfcfcf;font-style:italic;margin-top:4px}
.vs{color:var(--muted);font-size:.75rem;text-transform:uppercase;letter-spacing:.14em;margin-top:10px}
.opp{font-size:1.3rem;font-weight:900;margin-top:2px}
.opp-sub{color:#bbb;font-style:italic;font-size:.9rem;margin:2px 0 14px}
.name-row{display:flex;gap:8px;margin-top:10px}
.name-row input{flex:1;min-width:0;background:#0d0d0d;border:1px solid rgba(255,102,0,.45);border-radius:10px;color:var(--white);
  font:600 16px var(--font);padding:10px 12px;user-select:text;-webkit-user-select:text;touch-action:manipulation}
.status{font-size:.8rem;margin-top:6px;color:#ddd}
.status.err{color:#ff8a7a}
.toast{position:fixed;left:50%;top:calc(env(safe-area-inset-top) + 14px);transform:translateX(-50%);z-index:60;background:#111;
  border:1px solid var(--orange);color:var(--white);padding:8px 14px;border-radius:10px;font-size:.85rem}
@media (max-height:700px){.logo-hero{width:84px}h1{font-size:1.6rem}.tag{margin:4px 0 8px}#startBoard{max-height:12vh}}
@media (max-width:430px){
  .pad{gap:8px}
  .tbtn{width:64px;height:64px;font-size:1.2rem}
  .tbtn.attack{width:78px;height:78px}
  .tbtn.small{width:52px;height:52px;margin-bottom:40px}
}
@media (max-width:350px){
  .tbtn{width:56px;height:56px}.tbtn.attack{width:68px;height:68px}.tbtn.small{width:46px;height:46px}
}
.credits{margin-top:6px;font-size:.62rem;color:#777;text-align:center}
.credits summary{cursor:pointer;list-style:none;display:inline-block;padding:2px 6px;text-decoration:underline dotted}
.credits summary::-webkit-details-marker{display:none}
.credits p{margin-top:4px;line-height:1.35;text-align:left;user-select:text;-webkit-user-select:text;word-break:break-word}
.credits a{color:#b88a66}
/* right pad: two columns (JUMP over BLOCK, THRUST over SLAP) */
.pad.right{gap:10px;align-items:flex-end}
.pad.right .col{display:flex;flex-direction:column;align-items:center;gap:8px}
.tbtn.small{margin-bottom:0}
.tbtn.thrust{width:64px;height:64px;font-size:.66rem;border-color:#ffb27a;background:rgba(60,30,10,.8)}
.tbtn.thrust.on{background:rgba(255,102,0,.55)}
@media (max-width:430px){
  .tbtn.small{margin-bottom:0}
  .tbtn.thrust{width:58px;height:58px;font-size:.62rem}
}
@media (orientation:landscape) and (max-height:500px){
  .tbtn.small{margin-bottom:0;width:46px;height:46px}
  .tbtn.thrust{width:52px;height:52px}
  .pad.right .col{gap:6px}
}
/* LONG THRUST: wide pill above ◀ ▶ ; bar fill (--p), countdown, glow when ready/active, grey while recharging */
.pad.left{flex-direction:column;align-items:stretch;gap:8px}
.pad.left .row{display:flex;gap:10px}
.tbtn.long{position:relative;overflow:hidden;width:auto;height:44px;border-radius:22px;padding:0 10px;
  font:900 .72rem var(--font);letter-spacing:.06em;color:#fff;border:2px solid #ffb27a;background:rgba(40,18,4,.85);--p:1;
  display:flex;align-items:center;justify-content:center;gap:6px;white-space:nowrap}
.tbtn.long .fill{position:absolute;left:0;top:0;bottom:0;width:100%;transform-origin:left center;transform:scaleX(var(--p));
  background:linear-gradient(90deg,rgba(255,102,0,.55),rgba(255,160,60,.75));pointer-events:none}
.tbtn.long .lbl,.tbtn.long .cd{position:relative;pointer-events:none}
.tbtn.long .cd{font-size:.95rem;min-width:0}
.tbtn.long .cd:empty{display:none}
.tbtn.long.ready{box-shadow:0 0 12px 2px rgba(255,102,0,.75),inset 0 0 8px rgba(255,180,90,.5);text-shadow:0 1px 2px #000}
.tbtn.long.active{box-shadow:0 0 18px 4px rgba(255,120,0,.9);border-color:#fff;animation:ltActive .35s ease-in-out infinite alternate}
.tbtn.long.recharge{filter:grayscale(1);opacity:.6;border-color:#777;box-shadow:none;color:#ddd}
.tbtn.long.recharge .fill{background:rgba(160,160,160,.45)}
.tbtn.long.active,.tbtn.long.recharge{pointer-events:auto}
.tbtn.long.pulse{animation:ltPulse .45s ease-out 2}
.tbtn.long.on{transform:scale(.96)}
@keyframes ltPulse{0%{transform:scale(1);box-shadow:0 0 0 0 rgba(255,102,0,.9)}50%{transform:scale(1.08);box-shadow:0 0 22px 8px rgba(255,140,30,.9)}100%{transform:scale(1);box-shadow:0 0 12px 2px rgba(255,102,0,.75)}}
@keyframes ltActive{from{box-shadow:0 0 10px 2px rgba(255,120,0,.7)}to{box-shadow:0 0 22px 6px rgba(255,150,40,1)}}
@media (max-width:430px){.pad.left .row{gap:8px}.tbtn.long{height:42px;font-size:.68rem}}
@media (max-width:350px){.tbtn.long{font-size:.58rem;padding:0 6px}}
@media (orientation:landscape) and (max-height:500px){.tbtn.long{height:36px}.pad.left{gap:6px}}
/* ===== v10: controls always visible; keyboard labels for laptop/desktop ("kbd") ===== */
.touch{display:flex}
#game:focus{outline:none}
.key,.kh{display:none}
body:not(.kbd) .keys-panel{display:none}
body.kbd #howTouch{display:none}
body:not(.kbd) #howKeys{display:none}
body.kbd #howKeys{display:block}
.icon-btn .ico{line-height:1}
body.kbd .icon-btn{width:46px;height:50px;flex-direction:column;gap:1px;display:flex;align-items:center;justify-content:center}
body.kbd .icon-btn .key{display:block;font:800 10px var(--font);color:#111;background:#f5f5f5;border-radius:4px;padding:0 4px;line-height:14px}
body.kbd .kh{display:inline-block;font:800 .7rem var(--font);vertical-align:middle;margin-left:8px;padding:1px 6px;border-radius:5px;
  background:rgba(0,0,0,.25);border:1px solid rgba(0,0,0,.4);color:#111}
/* start-screen keyboard panel */
.keys-panel{margin:12px 0 4px;text-align:left;background:#0e0e0e;border:1px solid rgba(255,102,0,.35);border-radius:12px;padding:8px 12px}
.keys-panel h3{font-size:.78rem;color:var(--orange);text-transform:uppercase;letter-spacing:.12em;margin-bottom:6px}
.keys-panel dl{display:grid;grid-template-columns:auto 1fr;gap:5px 12px;align-items:center;font-size:.85rem}
.keys-panel dt{white-space:nowrap;color:#bbb;font-size:.78rem}
.keys-panel dd{color:#eee}
.keys-panel .hold{font-size:.7rem;color:#999}
.keys-panel .alt{font-size:.72rem;color:var(--muted);margin-top:6px}
kbd{display:inline-block;min-width:22px;padding:1px 6px;margin:0 1px;border-radius:5px;background:#f5f5f5;color:#111;
  font:800 .78rem ui-monospace,Menlo,Consolas,monospace;text-align:center;border-bottom:3px solid #b8b8b8;line-height:1.35}
/* labeled control strip on laptops/desktops: two rows of pills along the bottom, keycap under each label */
body.kbd .tbtn{cursor:pointer}
body.kbd .tbtn .key{display:block;margin-top:3px;font:800 12px ui-monospace,Menlo,Consolas,monospace;color:#111;background:#f5f5f5;
  border-radius:5px;padding:1px 6px;line-height:16px;border-bottom:2px solid #b8b8b8;white-space:nowrap;pointer-events:none}
body.kbd .tbtn .lbl{pointer-events:none}
@media (min-width:700px) and (min-height:450px){
  body.kbd .touch{padding:8px 16px calc(env(safe-area-inset-bottom) + 10px);align-items:flex-end}
  body.kbd .pad{gap:10px}
  body.kbd .pad.left{flex-direction:row;align-items:flex-end;gap:10px}
  body.kbd .pad.left .row{gap:10px}
  body.kbd .pad.right .col{flex-direction:row;gap:10px;align-items:flex-end}
  body.kbd .tbtn,body.kbd .tbtn.small,body.kbd .tbtn.thrust,body.kbd .tbtn.attack{width:auto;min-width:92px;height:64px;border-radius:14px;
    padding:4px 12px;display:flex;flex-direction:column;align-items:center;justify-content:center;font:900 1rem var(--font);letter-spacing:.04em}
  body.kbd .pad.left .row .tbtn{min-width:84px;font-size:1.3rem}
  body.kbd .tbtn.attack{min-width:110px;font-size:1.1rem}
  body.kbd .tbtn.small{min-width:132px}
  body.kbd .tbtn.long{min-width:150px;height:64px;border-radius:14px;flex-direction:column;gap:0;font-size:.85rem}
  body.kbd .tbtn.long .lbl{display:flex;align-items:center;gap:6px}
  body.kbd .tbtn.long .cd{position:absolute;right:8px;top:4px;font-size:.95rem}
  body.kbd .tbtn.long .key{position:relative}
  body.kbd .tbtn .key{font-size:13px}
}
/* touch-detected kbd devices in small viewports (e.g. phone-sized window with a mouse): keep the compact layout, tiny keys */
@media (max-width:699px),(max-height:449px){
  body.kbd .tbtn .key{font-size:9px;line-height:11px;padding:0 3px;margin-top:1px}
  body.kbd .tbtn.long .key{margin-left:2px}
}
/* ===== v11: BOOMERANG button (shares the LONG THRUST pill styling; cooler white-hot "ready" glow) ===== */
.tbtn.boom.ready{box-shadow:0 0 10px 1px rgba(255,236,210,.55),inset 0 0 8px rgba(255,180,90,.4)}
.tbtn.boom .fill{background:linear-gradient(90deg,rgba(255,102,0,.4),rgba(255,214,170,.6))}
.tbtn.boom.recharge .fill{background:rgba(160,160,160,.45)}
.tbtn.boom.away .cd{font-size:1.05rem}
@media (max-width:430px){.tbtn.long,.tbtn.boom{height:38px}}
@media (orientation:landscape) and (max-height:500px){.tbtn.long,.tbtn.boom{height:32px}}
@media (min-width:700px) and (min-height:450px){
  body.kbd .tbtn.boom{min-width:140px}
}
/* ===== v16: ROLL + SUPER buttons (extra column on the right pad) ===== */
.tbtn.roll{border-color:#9ad0ff;background:rgba(14,26,36,.8);font-size:.66rem}
.tbtn.roll.on{background:rgba(120,190,255,.45)}
.tbtn.roll.cool{opacity:.45;filter:grayscale(.7)}
.tbtn.super{--p:0;font-size:.62rem;border-color:#ffd23f;color:#fff;text-shadow:0 1px 2px #000;
  background:linear-gradient(to top,rgba(255,190,30,.8) calc(var(--p)*100%),rgba(28,22,6,.85) calc(var(--p)*100%))}
.tbtn.super[aria-disabled="true"]{border-color:rgba(255,210,63,.45)}
.tbtn.super.ready{animation:supReady .5s ease-in-out infinite alternate;color:#111;text-shadow:none;border-color:#fff}
@keyframes supReady{from{box-shadow:0 0 6px 1px rgba(255,210,63,.6)}to{box-shadow:0 0 20px 6px rgba(255,220,90,1)}}
@media (max-width:430px){.pad.right{gap:8px}.tbtn.super,.tbtn.roll{font-size:.58rem}}
@media (max-width:370px){.tbtn.small{width:46px;height:46px}.pad.right{gap:6px}.pad.left .row{gap:6px}}
@media (min-width:700px) and (min-height:450px){
  body.kbd .tbtn,body.kbd .tbtn.small,body.kbd .tbtn.thrust,body.kbd .tbtn.attack{min-width:78px}
  body.kbd .tbtn.small{min-width:96px}
  body.kbd .tbtn.attack{min-width:100px}
  body.kbd .tbtn.long{min-width:132px}
  body.kbd .tbtn.boom{min-width:124px}
  body.kbd .pad.left .row .tbtn{min-width:70px}
  body.kbd .pad.right{gap:8px}
  body.kbd .pad.right .col{gap:8px}
  body.kbd .tbtn.super,body.kbd .tbtn.roll{font-size:.9rem}
}
@media (min-width:700px) and (max-width:1100px) and (min-height:450px){
  body.kbd .tbtn,body.kbd .tbtn.small,body.kbd .tbtn.thrust,body.kbd .tbtn.attack{min-width:64px;padding:4px 8px;font-size:.82rem}
  body.kbd .tbtn.long,body.kbd .tbtn.boom{min-width:104px;font-size:.7rem}
  body.kbd .pad.left .row .tbtn{min-width:56px}
  body.kbd .tbtn .key{font-size:11px}
}
