*{box-sizing:border-box;margin:0;padding:0}
  :root{
    --bg:#0b1120; --panel:#141d33; --panel2:#1c2947;
    --ink:#eaf1ff; --dim:#7f8db0; --accent:#38bdf8; --gold:#f5c542; --hot:#ec2a86;
  }
  html,body{height:100%}
  body{
    background:var(--bg); color:var(--ink); overflow:hidden;
    font-family:"Segoe UI",system-ui,-apple-system,Roboto,Arial,sans-serif;
    font-weight:800; display:flex; align-items:center; justify-content:center;
    touch-action:none; -webkit-user-select:none; user-select:none;
    -webkit-tap-highlight-color:transparent;
  }
  #app{position:relative; width:100%; max-width:430px; height:100dvh; max-height:880px;
       display:flex; flex-direction:column; gap:7px; padding:10px}
  .row{display:flex; gap:7px; align-items:stretch}
  .stat{flex:1; background:var(--panel); border-radius:11px; padding:5px 10px;
        display:flex; flex-direction:column; justify-content:center;
        box-shadow:inset 0 1px 0 rgba(255,255,255,.06)}
  .stat .k{font-size:9px; letter-spacing:.15em; color:var(--dim)}
  .stat .v{font-size:19px; line-height:1.15; font-variant-numeric:tabular-nums}
  .stat.best .v{color:var(--gold)}
  .btn{width:44px; background:var(--panel); border:0; border-radius:11px; color:var(--ink);
       font-size:16px; font-weight:800; cursor:pointer; transition:background .15s, transform .1s;
       display:flex; align-items:center; justify-content:center}
  .btn:hover{background:var(--panel2)}
  .btn:active{transform:scale(.94)}
  .btn.off{color:#4a5878}
  #speedWrap{flex:1; background:var(--panel); border-radius:11px; padding:6px 10px; position:relative}
  #speedWrap .k{font-size:9px; letter-spacing:.15em; color:var(--dim); margin-bottom:5px}
  #speedTrack{height:7px; border-radius:99px; background:#0a1225; overflow:hidden}
  #speedFill{height:100%; width:0%; border-radius:99px;
             background:linear-gradient(90deg,#22d3ee,#38bdf8,#f5c542,#ef4444);
             background-size:340% 100%; transition:width .3s linear}
  #slower{position:absolute; right:8px; top:5px; font-size:9px; letter-spacing:.1em;
          background:var(--hot); color:#fff; padding:2px 7px; border-radius:99px;
          opacity:0; transform:translateX(6px); transition:opacity .2s, transform .2s}
  #slower.on{opacity:1; transform:none}
  #nextBox{background:var(--panel); border-radius:11px; padding:5px 9px; display:flex;
           align-items:center; gap:7px}
  #nextBox .k{font-size:9px; letter-spacing:.15em; color:var(--dim)}
  #nextCv{width:32px; height:32px; display:block}
  #boardWrap{flex:1 1 auto; position:relative; min-height:0; max-height:80dvh}
  #board{position:absolute; inset:0; width:100%; height:100%; display:block; border-radius:14px}
  #overlay{position:absolute; inset:0; display:none; align-items:center; justify-content:center;
           background:rgba(6,11,22,.84); backdrop-filter:blur(6px); border-radius:14px; z-index:5}
  #overlay.on{display:flex}
  .card{width:88%; max-width:330px; text-align:center; padding:24px 20px;
        background:linear-gradient(180deg,#1a2440,#131c31); border-radius:20px;
        box-shadow:0 20px 60px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.08)}
  .card h1{font-size:29px; line-height:1.1; letter-spacing:-.02em}
  .card h1 em{font-style:normal; color:var(--gold)}
  .card h2{font-size:22px; margin-bottom:10px; letter-spacing:.02em}
  .card p{font-size:13px; font-weight:600; color:var(--dim); margin:10px 0 16px; line-height:1.55}
  .lbl{font-size:10px; letter-spacing:.16em; color:var(--accent); margin-top:12px}
  .big{font-size:34px; color:var(--gold); font-variant-numeric:tabular-nums; line-height:1.2}
  .mid{font-size:17px; font-variant-numeric:tabular-nums}
  #bmRow{display:flex; gap:8px; justify-content:center; margin-top:8px}
  #bmRow .bm{text-align:center}
  #bmRow canvas{display:block; width:42px; height:42px}
  #bmRow span{font-size:10px; color:var(--dim)}
  .cta{margin-top:18px; width:100%; padding:13px; border:0; border-radius:13px; cursor:pointer;
       font-size:15px; font-weight:800; color:#04121f; letter-spacing:.05em;
       background:linear-gradient(180deg,#5ad2ff,#22a7e0);
       box-shadow:0 5px 0 #14719c, 0 10px 22px rgba(34,167,224,.4);
       transition:transform .08s, box-shadow .08s}
  .cta:active{transform:translateY(3px); box-shadow:0 2px 0 #14719c}
  .keys{margin-top:14px; font-size:11px; font-weight:600; color:#5b6987; line-height:1.7}
  .keys b{color:#93a3c4}

/* ---------- wersja ---------- */
#foot{flex:none; display:flex; align-items:baseline; gap:8px; padding:1px 2px 0}
#ver{margin-left:auto; flex:none; font-size:9px; letter-spacing:.1em; color:#3c4763; font-weight:700}

/* ---------- ekran końcowy: oba wyniki obok siebie ---------- */
.scoreRow{display:flex; gap:10px; margin-top:10px}
.scoreBox{flex:1; position:relative; background:rgba(255,255,255,.04);
          border-radius:12px; padding:8px 6px}
.scoreBox .lbl{margin-top:0}
.scoreBox .big{font-size:27px}
.scoreBox .big.alt{color:var(--accent)}
.tagNew{position:absolute; top:-7px; right:-4px; font-size:8px; letter-spacing:.1em;
        background:var(--hot); color:#fff; padding:2px 6px; border-radius:99px}

/* ---------- ranking ---------- */
#lbSlot{margin-top:14px}
.lbBanner{font-size:12px; letter-spacing:.12em; color:#04121f; font-weight:800;
          background:linear-gradient(90deg,var(--gold),#ffe89a);
          border-radius:99px; padding:5px 10px; margin-bottom:9px}
.lbForm{display:flex; gap:6px}
.lbForm input{flex:1; min-width:0; background:#0b1224; border:1px solid #2a3654;
              border-radius:10px; color:var(--ink); font:inherit; font-size:14px; padding:9px 11px}
.lbForm input:focus{outline:none; border-color:var(--accent)}
.lbForm button{border:0; border-radius:10px; padding:0 14px; cursor:pointer;
               font:inherit; font-size:12px; letter-spacing:.06em; color:#04121f;
               background:linear-gradient(180deg,#5ad2ff,#22a7e0)}
.lbForm button:disabled{opacity:.5; cursor:default}
.lbList{list-style:none; margin:9px 0 0; padding:0; text-align:left}
.lbRow{display:flex; align-items:center; gap:8px; padding:5px 8px; border-radius:8px;
       font-size:13px; font-variant-numeric:tabular-nums}
.lbRow:nth-child(odd){background:rgba(255,255,255,.035)}
.lbRow.me{background:rgba(245,197,66,.16); box-shadow:inset 0 0 0 1px rgba(245,197,66,.45)}
.lbPos{width:20px; text-align:right; color:var(--dim); font-size:11px; flex:none}
.lbName{flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.lbScore{color:var(--gold); flex:none}
.lbRow.me .lbName{color:var(--gold)}
.lbNote{font-size:11px; font-weight:600; color:var(--dim); margin-top:8px; line-height:1.5}
.lbEmpty{font-size:12px; font-weight:600; color:var(--dim); padding:10px 0}

#legal{flex:1; min-width:0; font-size:8px; letter-spacing:.04em; color:#333c54;
       font-weight:600; line-height:1.3; white-space:nowrap; overflow:hidden;
       text-overflow:ellipsis}

/* ---------- przycisk drugorzędny (Najlepsze wyniki) ---------- */
.cta.alt{margin-top:9px; color:var(--ink);
         background:linear-gradient(180deg,#2b3a5e,#1e2a45);
         box-shadow:0 4px 0 #131c30, 0 8px 18px rgba(0,0,0,.35);
         display:flex; align-items:center; justify-content:center; gap:8px}
.cta.alt:active{transform:translateY(3px); box-shadow:0 1px 0 #131c30}
.cta.alt svg{width:17px; height:17px; flex:none; fill:var(--gold)}
/* ---------- ikona głośnika ---------- */
#bSound svg{width:19px; height:19px; fill:currentColor; display:block}
#bSound.off{color:#4a5878}

/* przycisk dźwięku w menu - ikona dziedziczy kolor tekstu, nie złoto pucharu */
#msound svg{fill:currentColor}
#msound.muted{color:#78879f}

/* ---------- ekran zasad ---------- */
.card:has(.rules){max-width:360px}
.rules{text-align:left; max-height:52dvh; overflow-y:auto; margin:12px 0 4px;
       padding-right:6px; -webkit-overflow-scrolling:touch}
.rules h3{font-size:10px; letter-spacing:.16em; color:var(--accent);
          margin:14px 0 5px; font-weight:800}
.rules h3:first-child{margin-top:0}
.rules p{font-size:12.5px; font-weight:600; color:#9fadc9; line-height:1.55; margin:0 0 6px}
.rules ul{margin:0 0 6px; padding-left:16px}
.rules li{font-size:12.5px; font-weight:600; color:#9fadc9; line-height:1.55; margin-bottom:5px}
.rules b{color:var(--ink); font-weight:800}
.rules .keysline{font-size:11px; color:#7f8db0}
.rules::-webkit-scrollbar{width:5px}
.rules::-webkit-scrollbar-thumb{background:#2c3956; border-radius:99px}
#rules svg{fill:var(--accent)}
