
:root{
  --bg:#F2EEEF; --surface:#FFFFFF; --surface-2:#F8F5F6; --ink:#1B1113; --muted:#6E5F63; --line:#E4DADD;
  --red:#D1102C; --red-deep:#980A20; --red-ink:#FFFFFF; --red-soft:#FCE8EB;
  --ok:#1E8449; --ok-soft:#E3F4EA; --warn:#A96A06; --warn-soft:#FBF0DC; --gold:#B8862B;
  --shadow:0 1px 2px rgba(60,10,20,.06),0 8px 24px -12px rgba(60,10,20,.18);
  --display:"Big Shoulders Display","Arial Narrow",Impact,sans-serif;
  --body:"Onest",system-ui,-apple-system,"Segoe UI",sans-serif;
  color-scheme:light;
}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){
  --bg:#120A0C; --surface:#1D1315; --surface-2:#251A1C; --ink:#F6EEF0; --muted:#B39FA4; --line:#38272B;
  --red:#E8203D; --red-deep:#A50E26; --red-soft:#3A1219; --ok:#4CC37F; --ok-soft:#133222; --warn:#E3A43A; --warn-soft:#3A2A10; --gold:#E0B25A;
  --shadow:0 1px 2px rgba(0,0,0,.4),0 10px 28px -14px rgba(0,0,0,.7); color-scheme:dark;}}
:root[data-theme="dark"]{
  --bg:#120A0C; --surface:#1D1315; --surface-2:#251A1C; --ink:#F6EEF0; --muted:#B39FA4; --line:#38272B;
  --red:#E8203D; --red-deep:#A50E26; --red-soft:#3A1219; --ok:#4CC37F; --ok-soft:#133222; --warn:#E3A43A; --warn-soft:#3A2A10; --gold:#E0B25A;
  --shadow:0 1px 2px rgba(0,0,0,.4),0 10px 28px -14px rgba(0,0,0,.7); color-scheme:dark;}
*{box-sizing:border-box}
html,body{height:100%}
body{background:var(--bg);color:var(--ink);font:15px/1.45 var(--body);-webkit-font-smoothing:antialiased}
button,input,select{font:inherit;color:inherit}
button{cursor:pointer}
:focus-visible{outline:3px solid var(--red);outline-offset:2px;border-radius:6px}
.app{max-width:480px;margin:0 auto;min-height:100%;display:flex;flex-direction:column;background:var(--bg)}
/* top bar */
.top{position:sticky;top:env(safe-area-inset-top,0px);z-index:20;display:flex;align-items:center;gap:12px;padding:10px 16px;background:var(--surface);border-bottom:1px solid var(--line)}
.crest{width:40px;height:44px;flex:none;display:grid;place-items:center}
.crest img{width:100%;height:100%;object-fit:contain}
.crest .ph{width:36px;height:42px;border:2px dashed var(--red);border-radius:6px 6px 18px 18px;display:grid;place-items:center;font:800 10px/1 var(--display);letter-spacing:.06em;color:var(--red);text-transform:uppercase;text-align:center}
.brand{line-height:1}
.brand b{display:block;font:900 24px/.9 var(--display);letter-spacing:.02em;text-transform:uppercase}
.brand b span{color:var(--red)}
.brand small{font-size:11px;color:var(--muted);letter-spacing:.08em;text-transform:uppercase}
.mypts{margin-left:auto;text-align:right;line-height:1}
.mypts b{font:800 26px/1 var(--display);font-variant-numeric:tabular-nums;color:var(--red)}
.mypts small{display:block;font-size:10px;color:var(--muted);letter-spacing:.08em;text-transform:uppercase}
main{flex:1;padding:16px 16px 96px;display:flex;flex-direction:column;gap:16px}
/* tabs */
.tabs{position:fixed;left:0;right:0;bottom:0;z-index:30;padding-bottom:env(safe-area-inset-bottom,0px);background:var(--surface);border-top:1px solid var(--line)}
.tabs-in{max-width:480px;margin:0 auto;display:flex}
.tab{flex:1;border:0;background:none;padding:9px 2px 10px;display:flex;flex-direction:column;align-items:center;gap:3px;font-size:11px;font-weight:600;color:var(--muted)}
.tab svg{width:22px;height:22px}
.tab[aria-current="page"]{color:var(--red)}
/* hero match */
.hero{position:relative;overflow:hidden;border-radius:20px;background:var(--red);color:#fff;padding:18px 18px 16px;box-shadow:var(--shadow);isolation:isolate}
.hero::before{content:"";position:absolute;inset:0;z-index:-1;background:repeating-linear-gradient(115deg,transparent 0 38px,rgba(255,255,255,.07) 38px 76px)}
.hero::after{content:"";position:absolute;right:-60px;top:-40px;width:220px;height:260px;z-index:-1;background:#fff;opacity:.08;transform:rotate(24deg)}
.hero-meta{display:flex;flex-wrap:wrap;gap:6px 10px;align-items:center;font-size:12px;letter-spacing:.06em;text-transform:uppercase;font-weight:600;opacity:.95}
.pill{display:inline-flex;align-items:center;gap:5px;border-radius:999px;padding:3px 9px;font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;white-space:nowrap}
.pill.white{background:#fff;color:var(--red-deep)}
.pill.ghost{border:1px solid rgba(255,255,255,.55);color:#fff}
.pill.red{background:var(--red);color:#fff}
.pill.soft{background:var(--red-soft);color:var(--red)}
.pill.ok{background:var(--ok-soft);color:var(--ok)}
.pill.warn{background:var(--warn-soft);color:var(--warn)}
.pill.mute{background:var(--surface-2);color:var(--muted);border:1px solid var(--line)}
.live-dot{width:7px;height:7px;border-radius:50%;background:currentColor;animation:pulse 1.2s infinite}
@keyframes pulse{50%{opacity:.25}}
.teams{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:8px;margin-top:14px}
.team{display:flex;flex-direction:column;align-items:center;gap:6px;text-align:center;font-weight:700;font-size:13px;line-height:1.15}
.badge{width:52px;height:52px;border-radius:50%;display:grid;place-items:center;font:900 18px/1 var(--display);letter-spacing:.02em}
.hero .badge{background:rgba(255,255,255,.14);border:2px solid rgba(255,255,255,.5)}
.hero .badge.res{background:#fff;color:var(--red);border-color:#fff;overflow:hidden}
.badge img{width:78%;height:78%;object-fit:contain}
.vs{font:900 20px/1 var(--display);opacity:.7}
.countdown{margin-top:14px;display:flex;justify-content:center;gap:6px;font-variant-numeric:tabular-nums}
.cd{background:rgba(0,0,0,.18);border-radius:10px;padding:6px 8px;min-width:54px;text-align:center}
.cd b{display:block;font:800 24px/1 var(--display)}
.cd small{font-size:10px;letter-spacing:.08em;text-transform:uppercase;opacity:.85}
.hero .cta{margin-top:14px;width:100%}
/* cards */
.card{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:16px}
.card h2,.sec-h{font:800 20px/1.05 var(--display);letter-spacing:.03em;text-transform:uppercase;margin:0}
.sec-h{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:8px}
.sec-h small{font:600 12px/1 var(--body);color:var(--muted);letter-spacing:0;text-transform:none}
.muted{color:var(--muted)}
.small{font-size:12.5px}
.btn{border:0;border-radius:12px;padding:12px 16px;font-weight:700;display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px}
.btn.primary{background:var(--red);color:#fff}
.btn.white{background:#fff;color:var(--red-deep)}
.btn.line{background:var(--surface);border:1px solid var(--line)}
.btn.block{width:100%}
.btn:disabled{opacity:.45;cursor:not-allowed}
.row{display:flex;gap:10px;align-items:center}
.stack{display:flex;flex-direction:column;gap:10px}
/* match list */
.mlist{display:flex;flex-direction:column;background:var(--surface);border:1px solid var(--line);border-radius:16px;overflow:hidden}
.mrow{display:grid;grid-template-columns:40px 1fr auto;gap:10px;align-items:center;padding:11px 14px;border:0;border-top:1px solid var(--line);background:none;text-align:left;width:100%}
.mrow:first-child{border-top:0}
.mrow .rd{font:800 18px/1 var(--display);color:var(--muted);text-align:center}
.mrow .rd small{display:block;font:600 9px/1.2 var(--body);letter-spacing:.08em}
.mrow .nm{font-weight:600;font-size:14px;line-height:1.2}
.mrow .dt{font-size:12px;color:var(--muted)}
.mrow .rs{text-align:right;display:flex;flex-direction:column;align-items:flex-end;gap:4px}
.score{font:800 22px/1 var(--display);font-variant-numeric:tabular-nums;letter-spacing:.02em}
.ptsbadge{font:800 13px/1 var(--display);padding:4px 7px;border-radius:7px;background:var(--red-soft);color:var(--red);font-variant-numeric:tabular-nums}
.ptsbadge.zero{background:var(--surface-2);color:var(--muted)}
.seg{display:flex;background:var(--surface-2);border:1px solid var(--line);border-radius:12px;padding:3px;gap:3px;overflow-x:auto}
.seg button{flex:1;border:0;background:none;border-radius:9px;padding:8px 10px;font-weight:600;font-size:13px;color:var(--muted);white-space:nowrap}
.seg button[aria-pressed="true"]{background:var(--surface);color:var(--ink);box-shadow:var(--shadow)}
/* sheet */
.sheet-bg{position:fixed;inset:0;z-index:50;background:rgba(20,5,8,.55);display:flex;align-items:flex-end;justify-content:center}
.sheet{width:100%;max-width:480px;max-height:92%;overflow:auto;background:var(--bg);border-radius:22px 22px 0 0;padding:0 0 calc(18px + env(safe-area-inset-bottom,0px));animation:up .22s ease-out}
@keyframes up{from{transform:translateY(40px)}}
@media (prefers-reduced-motion:reduce){.sheet,.live-dot{animation:none}}
.sheet-head{position:sticky;top:0;z-index:2;background:var(--red);color:#fff;padding:14px 16px 16px;border-radius:22px 22px 0 0}
.sheet-head .x{position:absolute;right:10px;top:10px;width:36px;height:36px;border-radius:50%;border:0;background:rgba(0,0,0,.2);color:#fff;font-size:20px;line-height:1}
.sheet-body{padding:16px;display:flex;flex-direction:column;gap:14px}
.grab{width:40px;height:4px;border-radius:2px;background:rgba(255,255,255,.55);margin:0 auto 10px}
/* stepper scoreboard */
.board{display:grid;grid-template-columns:1fr auto 1fr;gap:6px;align-items:center}
.board .lbl{grid-column:1/-1;font-size:11px;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);font-weight:700;display:flex;justify-content:space-between}
.stp{display:flex;align-items:center;justify-content:center;gap:6px;background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:6px}
.stp button{width:36px;height:36px;border-radius:10px;border:0;background:var(--surface-2);font-size:20px;font-weight:700;color:var(--red)}
.stp output{min-width:44px;text-align:center;font:900 44px/1 var(--display);font-variant-numeric:tabular-nums}
.board.sm .stp output{font-size:30px;min-width:34px}
.board.sm .stp button{width:30px;height:30px;font-size:17px}
.colon{font:900 34px/1 var(--display);color:var(--muted)}
.tnames{display:grid;grid-template-columns:1fr auto 1fr;gap:6px;font-size:12px;font-weight:700;text-align:center}
.tnames span:nth-child(2){width:14px}
.outcome{display:flex;gap:6px}
.outcome span{flex:1;text-align:center;padding:7px 4px;border-radius:10px;border:1px solid var(--line);font-size:12px;font-weight:700;color:var(--muted);background:var(--surface)}
.outcome span.on{background:var(--red);border-color:var(--red);color:#fff}
.slot{display:grid;grid-template-columns:28px 1fr;gap:8px;align-items:center}
.slot b{font:800 18px/1 var(--display);color:var(--red);text-align:center}
select,input[type=text],input[type=datetime-local],input[type=number]{width:100%;min-height:44px;border-radius:12px;border:1px solid var(--line);background:var(--surface);padding:10px 12px}
.note{font-size:12.5px;color:var(--muted);background:var(--surface-2);border:1px dashed var(--line);border-radius:12px;padding:10px 12px}
/* breakdown */
.bd{display:flex;flex-direction:column;gap:0;border:1px solid var(--line);border-radius:14px;overflow:hidden;background:var(--surface)}
.bd div{display:flex;justify-content:space-between;gap:10px;padding:9px 12px;border-top:1px solid var(--line);font-size:14px}
.bd div:first-child{border-top:0}
.bd b{font:800 17px/1 var(--display);font-variant-numeric:tabular-nums}
.bd .hit b{color:var(--ok)} .bd .miss{color:var(--muted)}
.bd .tot{background:var(--red);color:#fff}
.bd .tot b{color:#fff;font-size:20px}
/* ranking */
.rank{display:flex;flex-direction:column;background:var(--surface);border:1px solid var(--line);border-radius:16px;overflow:hidden}
.rk{display:grid;grid-template-columns:34px 36px 1fr auto;gap:10px;align-items:center;padding:10px 14px;border-top:1px solid var(--line)}
.rk:first-child{border-top:0}
.rk .pos{font:900 20px/1 var(--display);text-align:center;color:var(--muted);font-variant-numeric:tabular-nums}
.rk.p1 .pos{color:var(--gold)} .rk.p2 .pos,.rk.p3 .pos{color:var(--ink)}
.rk.me{background:var(--red-soft)}
.av.big{width:56px!important;height:56px!important;font-size:22px}
.av{width:36px;height:36px;border-radius:50%;object-fit:cover;background:var(--surface-2);display:grid;place-items:center;font:800 14px/1 var(--display);color:#fff}
.rk .nm{font-weight:600;line-height:1.2;overflow-wrap:anywhere}
.rk .nm small{display:block;font-weight:500;color:var(--muted);font-size:12px}
.rk .pt{font:900 24px/1 var(--display);font-variant-numeric:tabular-nums}
.podium{display:grid;grid-template-columns:1fr 1.15fr 1fr;gap:8px;align-items:end}
.pod{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:10px 8px;text-align:center;display:flex;flex-direction:column;align-items:center;gap:6px;min-width:0}
.pod.first{background:var(--red);color:#fff;border-color:var(--red);padding-block:16px}
.pod .av{width:44px;height:44px}
.pod .n{font-size:12.5px;font-weight:600;line-height:1.2;overflow-wrap:anywhere}
.pod .p{font:900 26px/1 var(--display)}
.pod .pl{font:900 14px/1 var(--display);opacity:.8}
/* stats & badges */
.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.stat{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:12px 10px}
.stat b{display:block;font:900 28px/1 var(--display);font-variant-numeric:tabular-nums}
.stat small{font-size:11.5px;color:var(--muted);line-height:1.2;display:block;margin-top:4px}
.badges{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}
.bdg{display:grid;grid-template-columns:42px 1fr;gap:10px;align-items:center;background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:10px}
.bdg .ic{width:42px;height:42px;border-radius:12px;display:grid;place-items:center;background:var(--surface-2);color:var(--muted)}
.bdg.on .ic{background:var(--red);color:#fff}
.bdg.off{opacity:.62}
.bdg b{font-size:13.5px;display:block;line-height:1.2}
.bdg small{font-size:11.5px;color:var(--muted);line-height:1.25;display:block}
.bar{height:6px;border-radius:3px;background:var(--surface-2);overflow:hidden;margin-top:6px}
.bar i{display:block;height:100%;background:var(--red)}
/* ad slot */
.ad{border:1px dashed var(--line);border-radius:14px;padding:12px 14px;display:flex;gap:12px;align-items:center;background:var(--surface-2)}
.ad .adl{font-size:10px;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);font-weight:700}
.ad b{font-size:14px}
/* distribution */
.dist{display:flex;height:30px;border-radius:9px;overflow:hidden;font-size:11.5px;font-weight:700}
.dist span{display:grid;place-items:center;color:#fff;min-width:0;overflow:hidden;white-space:nowrap}
.toast{position:fixed;left:50%;bottom:calc(84px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);z-index:80;background:var(--ink);color:var(--bg);padding:10px 16px;border-radius:12px;font-weight:600;font-size:14px;box-shadow:var(--shadow);max-width:calc(100% - 32px)}
.switch{display:flex;justify-content:space-between;align-items:center;gap:12px}
.switch input{width:46px;height:28px;accent-color:var(--red)}
.code{font:900 30px/1 var(--display);letter-spacing:.14em;color:var(--red)}
.empty{text-align:center;padding:26px 16px;color:var(--muted)}
.ptsgrid{display:grid;grid-template-columns:1fr auto;gap:0;font-size:13.5px}
.ptsgrid span{padding:7px 0;border-top:1px solid var(--line)}
.ptsgrid span:nth-child(-n+2){border-top:0}
.ptsgrid span:nth-child(even){font:800 16px/1.3 var(--display);text-align:right;color:var(--red)}
.chips{display:flex;flex-wrap:wrap;gap:6px}
.hr{height:1px;background:var(--line)}
.join-hero{border-radius:20px;background:var(--red);color:#fff;padding:22px 18px;display:flex;flex-direction:column;gap:12px;position:relative;overflow:hidden;isolation:isolate}
.join-hero::before{content:"";position:absolute;inset:0;z-index:-1;background:repeating-linear-gradient(115deg,transparent 0 38px,rgba(255,255,255,.07) 38px 76px)}
.join-hero h1{margin:0;font:900 44px/.88 var(--display);text-transform:uppercase}
.join-hero input{background:#fff;color:#1B1113;border:0}

/* --- strona produkcyjna --- */
body{margin:0}
.auth{display:flex;flex-direction:column;gap:12px}
.auth .seg{background:rgba(255,255,255,.15);border-color:rgba(255,255,255,.3)}
.auth .seg button{color:#fff}
.auth .seg button[aria-pressed="true"]{background:#fff;color:var(--red-deep)}
.auth label{font-size:12px;font-weight:700;letter-spacing:.04em}
.auth input{background:#fff;color:#1B1113;border:0}
.err{background:#fff;color:var(--red-deep);border-radius:10px;padding:8px 12px;font-weight:600;font-size:13px}
.skeleton{height:220px;border-radius:20px;background:var(--surface-2);border:1px solid var(--line)}
.linkbtn{background:none;border:0;color:var(--red);font-weight:700;padding:8px 0}
.footer{font-size:11.5px;color:var(--muted);text-align:center;padding:8px 0 0}
.footer a{color:var(--muted)}
