/* Liga Typera — mobile first. Granat/grafit + sportowa zieleń + jasne karty.
   Bez zewnętrznych zasobów (CSP: style-src 'self'); bez atrybutów style w HTML. */

:root {
  --navy-950: #0a1424;
  --navy-900: #0f1b2d;
  --navy-800: #16263d;
  --navy-700: #213550;
  --navy-600: #31496b;
  --green-700: #15803d;
  --green-600: #16a34a;
  --green-500: #22c55e;
  --green-100: #dcfce7;
  --green-50: #f0fdf4;
  --bg: #eef1f5;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #5b6678;
  --line: #e1e6ee;
  --line-strong: #cbd3df;
  --red-600: #dc2626;
  --red-100: #fee2e2;
  --amber-600: #b45309;
  --amber-500: #f59e0b;
  --amber-100: #fef3c7;
  --gold: #b8860b;
  --gold-bg: #fff6d6;
  --silver: #6b7686;
  --silver-bg: #eef0f4;
  --bronze: #a05a2c;
  --bronze-bg: #f8e9dc;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 27, 45, 0.06), 0 4px 14px rgba(15, 27, 45, 0.05);
  --nav-h: 62px;
  --top-h: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--green-700); }
.icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.2em; }
:focus-visible { outline: 3px solid var(--green-500); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.noscript { padding: 24px; text-align: center; }

.boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--navy-900); color: #cfd8e6; z-index: 100; }
.boot.hidden { display: none; }

/* ---------- układ aplikacji ---------- */
.app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  height: calc(var(--top-h) + var(--safe-t)); padding: var(--safe-t) 14px 0;
  background: var(--navy-900); color: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; color: #fff; }
.brand img { width: 30px; height: 30px; border-radius: 8px; flex: none; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.brand-season { font-size: 12px; color: #9fb0c7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-spacer { flex: 1; }
.bell {
  position: relative; display: grid; place-items: center; width: 44px; height: 44px;
  border: 0; border-radius: 12px; background: transparent; color: #fff; text-decoration: none;
}
.bell:hover { background: var(--navy-800); }
.bell .icon { width: 22px; height: 22px; }
.badge {
  position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px;
  display: grid; place-items: center; border-radius: 9px;
  background: var(--green-500); color: var(--navy-950); font-size: 11px; font-weight: 800;
}
.sidenav { display: none; }

.view { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 16px 14px calc(var(--nav-h) + var(--safe-b) + 28px); outline: none; animation: viewIn 0.18s ease-out; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.view.with-savebar { padding-bottom: calc(var(--nav-h) + var(--safe-b) + 92px); }

.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--navy-900); border-top: 1px solid var(--navy-700);
}
.nav-link {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: #9fb0c7; text-decoration: none; font-size: 11px; font-weight: 600; min-width: 0;
}
.nav-link .icon { width: 22px; height: 22px; }
.nav-link[aria-current="page"] { color: #fff; }
.nav-link[aria-current="page"]::before {
  content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--green-500);
}
.nav-dot { position: absolute; top: 9px; left: calc(50% + 8px); width: 8px; height: 8px; border-radius: 50%; background: var(--green-500); }

/* ---------- karty i podstawy ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; min-width: 0; }
.card + .card, .stack > * + * { margin-top: 14px; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.page-title { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.page-sub { color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: 14px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
b.truncate, div > span.truncate:not(.name) { display: block; }
.link-btn { background: none; border: 0; padding: 0; color: var(--green-700); font-weight: 600; text-decoration: underline; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: #fff; color: var(--ink); font-weight: 700; text-decoration: none;
  transition: background 0.12s, transform 0.06s;
}
.btn:hover { background: #f6f8fb; }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.btn.primary:hover { background: #166f37; }
.btn.dark { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.btn.block { width: 100%; }
.btn.small { min-height: 38px; padding: 0 12px; font-size: 14px; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; }
.icon-btn:hover { background: #eef1f5; }

.chip { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 1.3; background: #eef1f5; color: var(--muted); white-space: nowrap; }
.chip .icon { width: 13px; height: 13px; }
.chip.green { background: var(--green-100); color: #166534; }
.chip.amber { background: var(--amber-100); color: var(--amber-600); }
.chip.red { background: var(--red-100); color: #991b1b; }
.chip.navy { background: var(--navy-900); color: #fff; }
.chip.gold { background: var(--gold-bg); color: var(--gold); }

.banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; }
.banner .icon { width: 22px; height: 22px; margin-top: 1px; }
.banner.info { background: #eff6ff; border-color: #bfdbfe; color: #1e3a8a; }
.banner.warn { background: var(--amber-100); border-color: #fcd34d; color: #78350f; }
.banner.danger { background: var(--red-100); border-color: #fca5a5; color: #7f1d1d; }
.banner.ok { background: var(--green-50); border-color: #86efac; color: #14532d; }
.banner-title { font-weight: 800; margin-bottom: 2px; }

.empty { text-align: center; padding: 28px 16px; color: var(--muted); }
.empty .icon { width: 34px; height: 34px; margin-bottom: 8px; color: var(--line-strong); }
.empty-title { font-weight: 700; color: var(--ink); margin-bottom: 4px; }

.skeleton { background: linear-gradient(90deg, #e6eaf0 25%, #f2f5f9 37%, #e6eaf0 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.sk-line { height: 14px; margin: 8px 0; }
.sk-card { height: 120px; margin-bottom: 14px; border-radius: var(--radius); }

/* ---------- segmenty / zakładki ---------- */
.tabs { display: flex; gap: 4px; padding: 4px; background: #e3e8ef; border-radius: 12px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: 1 0 auto; min-height: 38px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 700; font-size: 14px; white-space: nowrap; }
.tab[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(15, 27, 45, 0.12); }
.select { min-height: 44px; width: 100%; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; }

/* ---------- formularze ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span.label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 700; }
.field .hint { display: block; margin-top: 5px; font-size: 13px; color: var(--muted); }
.field .err { display: block; margin-top: 5px; font-size: 13px; font-weight: 600; color: var(--red-600); }
.input { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; font-size: 16px; }
.input:focus { outline: 3px solid rgba(34, 197, 94, 0.35); border-color: var(--green-600); }
.input.invalid { border-color: var(--red-600); }
.two-cols { display: grid; gap: 0 12px; }

/* ---------- logowanie ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 20px 14px; background: var(--navy-900); }
.auth-box { width: 100%; max-width: 440px; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; color: #fff; }
.auth-brand img { width: 46px; height: 46px; border-radius: 12px; }
.auth-brand h1 { font-size: 21px; font-weight: 800; }
.auth-brand p { color: #9fb0c7; font-size: 13px; }
.auth-card { background: #fff; border-radius: 18px; padding: 20px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); }
.auth-card .tabs { margin-bottom: 18px; }
.auth-foot { margin-top: 14px; text-align: center; color: #7d8fa8; font-size: 12px; }

/* ---------- Start ---------- */
.hero { background: var(--navy-900); color: #fff; border-radius: var(--radius); padding: 18px; position: relative; overflow: hidden; }
.hero .eyebrow { color: #86efac; font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.hero h2 { font-size: 24px; font-weight: 800; margin: 4px 0 2px; }
.hero p { color: #b6c4d8; font-size: 14px; }
.hero .btn { margin-top: 14px; }
.progress { height: 8px; border-radius: 4px; background: var(--navy-700); overflow: hidden; margin-top: 14px; }
.progress > i { display: block; height: 100%; width: 0; border-radius: 4px; background: var(--green-500); transition: width 0.4s ease; }
.progress.light { background: #e3e8ef; }
.confirm-card { border: 2px solid var(--green-600); background: var(--green-50); }
.confirm-card .btn { margin-top: 12px; }
.mini-rank { list-style: none; margin: 0; padding: 0; }
.mini-rank li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.mini-rank li:first-child { border-top: 0; }
.mini-rank .pos { width: 26px; text-align: center; font-weight: 800; }
.mini-rank .name { flex: 1; min-width: 0; font-weight: 600; }
.mini-rank .pts { font-weight: 800; }
.me-row { background: var(--green-50); margin: 0 -8px; padding-left: 8px !important; padding-right: 8px !important; border-radius: 8px; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat { background: #f6f8fb; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; min-width: 0; }
.stat b { display: block; font-size: 24px; font-weight: 800; line-height: 1.1; }
.stat span { font-size: 12px; color: var(--muted); font-weight: 600; }

/* ---------- mecze i typowanie ---------- */
.round-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.round-nav .grow { text-align: center; min-width: 0; }
.round-title { font-size: 20px; font-weight: 800; }
.matches-grid { display: grid; gap: 10px; }
.matches-grid > .match { margin-bottom: 0; }
.day-head { margin: 18px 2px 8px; font-size: 13px; font-weight: 800; color: var(--muted); letter-spacing: 0.03em; }
.day-head::first-letter { text-transform: uppercase; }
.match { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; margin-bottom: 10px; min-width: 0; transition: border-color 0.15s; }
.match.dirty { border-color: var(--green-600); }
.match.err { border-color: var(--red-600); }
.match.off { background: #fafbfc; }
.match-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 8px; margin-bottom: 10px; font-size: 13px; color: var(--muted); }
.match-top > :first-child { min-width: 0; }
.match-top .when { font-weight: 700; color: var(--ink); white-space: nowrap; margin-left: auto; }
.match-main { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; }
.team { font-weight: 700; font-size: 16px; overflow-wrap: anywhere; min-width: 0; }
.stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--line-strong); border-radius: 12px; overflow: hidden; background: #fff; }
.stepper button { width: 42px; min-height: 46px; border: 0; background: #f2f5f9; color: var(--navy-800); display: grid; place-items: center; }
.stepper button:active { background: #e3e8ef; }
.stepper button[disabled] { color: #aab4c3; background: #f7f9fb; cursor: not-allowed; }
.stepper input { width: 46px; border: 0; text-align: center; font-size: 22px; font-weight: 800; background: #fff; padding: 0; -moz-appearance: textfield; }
.stepper input::placeholder { color: #b3bdcb; opacity: 1; }
.stepper input:focus { outline: none; background: var(--green-50); }
.stepper input[disabled] { background: #fafbfc; color: var(--ink); opacity: 1; -webkit-text-fill-color: var(--ink); }
.score-static { display: inline-grid; place-items: center; min-width: 46px; height: 46px; padding: 0 8px; border-radius: 12px; background: #f2f5f9; font-size: 22px; font-weight: 800; }
.score-static.result { background: var(--navy-900); color: #fff; }
.score-static.none { color: #aab4c3; }
.match-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 13px; color: var(--muted); }
.foot-left { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.foot-left .cd { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--ink); }
.match-foot .state { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.state.saved { color: var(--green-700); }
.state.dirty { color: var(--amber-600); }
.state.error { color: var(--red-600); }
.points { display: inline-grid; place-items: center; min-width: 38px; height: 26px; padding: 0 8px; border-radius: 13px; font-weight: 800; font-size: 13px; background: #eef1f5; color: var(--muted); }
.points.p3 { background: var(--green-600); color: #fff; }
.points.p1 { background: var(--amber-100); color: var(--amber-600); }
.postponed-panel { border: 2px solid var(--amber-500); background: #fffbf0; border-radius: var(--radius); padding: 12px; margin-bottom: 14px; }
.postponed-panel .card-title { color: var(--amber-600); margin-bottom: 8px; }
.postponed-panel .match { margin-bottom: 8px; }

.savebar {
  position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-b)); z-index: 25;
  padding: 10px 14px; background: rgba(255, 255, 255, 0.97); border-top: 1px solid var(--line-strong);
  box-shadow: 0 -6px 18px rgba(15, 27, 45, 0.1); transform: translateY(110%); transition: transform 0.2s ease;
}
.savebar.show { transform: none; }
.savebar-in { max-width: 1080px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.savebar-in .grow { font-weight: 700; font-size: 14px; }

/* ---------- ranking ---------- */
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; align-items: end; margin-bottom: 14px; }
.pod { background: #fff; border: 1px solid var(--line); border-top-width: 5px; border-radius: var(--radius); padding: 12px 6px 12px; text-align: center; min-width: 0; box-shadow: var(--shadow); }
.pod .medal { display: grid; place-items: center; width: 34px; height: 34px; margin: 0 auto 8px; border-radius: 50%; font-weight: 800; color: #fff; }
.pod .nm { font-weight: 800; font-size: 14px; overflow-wrap: anywhere; line-height: 1.2; min-height: 2.4em; display: grid; place-items: center; }
.pod .pt { font-size: 24px; font-weight: 800; line-height: 1.1; margin-top: 4px; }
.pod .pl { font-size: 11px; color: var(--muted); font-weight: 600; }
.pod.gold { border-top-color: var(--gold); background: var(--gold-bg); padding-top: 18px; padding-bottom: 18px; }
.pod.gold .medal { background: var(--gold); } .pod.gold .nm { color: #7a5a06; }
.pod.silver { border-top-color: var(--silver); background: var(--silver-bg); }
.pod.silver .medal { background: var(--silver); } .pod.silver .nm { color: #4b5563; }
.pod.bronze { border-top-color: var(--bronze); background: var(--bronze-bg); }
.pod.bronze .medal { background: var(--bronze); } .pod.bronze .nm { color: #7a4220; }
.pod.empty-slot { visibility: hidden; }
.pod.me { outline: 3px solid var(--green-500); }
.rank-wrap { padding: 0; overflow: hidden; }
.rank-wrap .card-title { padding: 14px 16px 0; margin-bottom: 10px; }
table.rank { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 14px; }
.rank th { padding: 10px 4px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); background: #f6f8fb; border-bottom: 1px solid var(--line); text-align: center; }
.rank td { padding: 11px 4px; border-bottom: 1px solid var(--line); text-align: center; }
.rank tr:last-child td { border-bottom: 0; }
.rank .c-pos { width: 38px; font-weight: 800; }
.rank .c-name { text-align: left; font-weight: 700; overflow-wrap: anywhere; padding-left: 6px; }
.rank th.c-name { text-align: left; padding-left: 6px; }
.rank td.c-pts { width: 44px; font-weight: 800; font-size: 16px; }
.rank th.c-pts { width: 44px; }
.rank .c-n { width: 40px; }
.rank .c-pct { width: 52px; }
.rank tr.me td { background: var(--green-50); }
.rank tr.gold td.c-pos, .rank tr.gold td.c-name { color: var(--gold); }
.rank tr.silver td.c-pos, .rank tr.silver td.c-name { color: var(--silver); }
.rank tr.bronze td.c-pos, .rank tr.bronze td.c-name { color: var(--bronze); }
.legend { margin-top: 10px; font-size: 12px; color: var(--muted); }
.honour { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.honour:first-of-type { border-top: 0; padding-top: 0; }
.honour .icon { width: 26px; height: 26px; color: var(--gold); margin-top: 2px; }
.honour b { display: block; }
details.rw summary { cursor: pointer; font-weight: 700; padding: 8px 0; }
.rw-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; }

/* ---------- aktywność ---------- */
.act-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.act-summary .stat { text-align: center; }
.act-summary .stat b { font-size: 22px; }
.act-row { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.act-row:first-child { border-top: 0; }
.dot { width: 14px; height: 14px; border-radius: 50%; background: #cbd3df; }
.dot.red { background: var(--red-600); } .dot.yellow { background: var(--amber-500); } .dot.green { background: var(--green-600); }
.act-count { font-weight: 800; text-align: right; }
.act-sub { font-size: 12px; color: var(--muted); font-weight: 600; text-align: right; }

/* ---------- powiadomienia ---------- */
.notif { display: flex; gap: 12px; width: 100%; text-align: left; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; margin-bottom: 10px; }
.notif.unread { background: var(--green-50); border-color: #86efac; }
.notif .ico { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 50%; background: #eef1f5; color: var(--navy-700); }
.notif.unread .ico { background: var(--green-600); color: #fff; }
.notif-title { font-weight: 800; }
.notif-body { margin-top: 2px; font-size: 14px; color: #334155; overflow-wrap: anywhere; }
.notif-time { margin-top: 4px; font-size: 12px; color: var(--muted); }

/* ---------- okno (sheet) ---------- */
dialog.sheet { border: 0; padding: 0; width: 100%; max-width: none; margin: auto 0 0; border-radius: 18px 18px 0 0; max-height: 88dvh; background: #fff; color: var(--ink); animation: sheetIn 0.2s ease-out; }
dialog.sheet::backdrop { background: rgba(10, 20, 36, 0.6); }
@keyframes sheetIn { from { transform: translateY(40px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px 6px; }
.sheet-title { font-size: 18px; font-weight: 800; }
.sheet-body { padding: 8px 16px calc(20px + var(--safe-b)); overflow-y: auto; max-height: calc(88dvh - 64px); }
.pred-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.pred-row:first-child { border-top: 0; }

/* ---------- toasty ---------- */
.toasts { position: fixed; z-index: 200; top: calc(var(--safe-t) + 10px); left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 12px; pointer-events: none; }
.toast { max-width: 480px; width: 100%; padding: 12px 14px; border-radius: 12px; background: var(--navy-900); color: #fff; font-weight: 600; font-size: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28); opacity: 0; transform: translateY(-8px); transition: opacity 0.2s, transform 0.2s; pointer-events: auto; }
.toast.in { opacity: 1; transform: none; }
.toast-success { background: var(--green-700); }
.toast-error { background: #b91c1c; }

/* ---------- szerszy ekran ---------- */
@media (min-width: 560px) {
  .two-cols { grid-template-columns: 1fr 1fr; }
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 720px) {
  .view { padding-left: 22px; padding-right: 22px; }
  .matches-grid { grid-template-columns: 1fr 1fr; }
  .grid.cols-2 { grid-template-columns: 1fr 1fr; }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .match-main { gap: 10px 24px; }
  dialog.sheet { margin: auto; max-width: 520px; border-radius: 18px; }
}
@media (min-width: 960px) {
  .app { display: grid; grid-template-columns: 236px minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .sidenav { display: flex; flex-direction: column; grid-row: 1 / span 2; position: sticky; top: 0; height: 100vh; background: var(--navy-900); color: #fff; padding: 18px 12px; }
  .sidenav .brand { padding: 4px 8px 18px; }
  .sidenav .nav-link { flex-direction: row; justify-content: flex-start; gap: 12px; height: 46px; padding: 0 12px; border-radius: 10px; font-size: 15px; }
  .sidenav .nav-link:hover { background: var(--navy-800); color: #fff; }
  .sidenav .nav-link[aria-current="page"] { background: var(--navy-700); }
  .sidenav .nav-link[aria-current="page"]::before { left: 0; right: auto; top: 12px; bottom: 12px; width: 4px; height: auto; border-radius: 0 4px 4px 0; }
  .sidenav .nav-dot { position: static; margin-left: auto; }
  .sidenav .side-foot { margin-top: auto; padding: 10px 12px; color: #7d8fa8; font-size: 12px; }
  .topbar { grid-column: 2; background: transparent; color: var(--ink); border-bottom: 1px solid var(--line); background: #fff; justify-content: flex-end; }
  .topbar .brand { display: none; }
  .topbar .bell { color: var(--navy-900); }
  .topbar .bell:hover { background: #eef1f5; }
  .topbar .top-season { display: block; }
  .view { grid-column: 2; padding-bottom: 48px; }
  .view.with-savebar { padding-bottom: 110px; }
  .bottomnav { display: none; }
  .savebar { bottom: 0; left: 236px; }
  .podium { max-width: 640px; margin-left: auto; margin-right: auto; }
}
.top-season { display: none; margin-right: auto; font-weight: 700; color: var(--muted); font-size: 14px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}


/* ================= Panel administratora (Etap 4) ================= */
.btn.danger { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.btn.danger:hover { background: #991b1b; }
.admin-top { margin-bottom: 14px; }
.admin-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--navy-900); color: #86efac; font-size: 12px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
.admin-nav { display: flex; gap: 6px; overflow-x: auto; margin: 10px -14px 12px; padding: 4px 14px; scrollbar-width: none; }
.admin-nav::-webkit-scrollbar { display: none; }
.admin-link { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: #fff; color: var(--ink); font-weight: 700; font-size: 14px; text-decoration: none; white-space: nowrap; }
.admin-link .icon { width: 16px; height: 16px; }
.admin-link[aria-current="page"] { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.admin-head .page-title { margin: 0; }
.admin-head .select { width: auto; min-width: 200px; }
.admin-top-link { color: #86efac; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.admin-match-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.admin-match-main > .grow { min-width: 180px; }
.quick-result .row { gap: 6px; }
.quick-result .input { min-height: 40px; }
.input.num { width: 64px; text-align: center; font-weight: 800; font-size: 18px; padding: 0 4px; }
.season-row, .user-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--line); }
.season-row:first-of-type, .user-row:first-child { border-top: 0; }
.team-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line); }
.team-row .select { width: auto; flex: 1; min-width: 200px; }
.kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.kv { display: flex; flex-direction: column; font-size: 14px; min-width: 0; }
.hist-row { padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.ms-head h3 { font-size: 20px; margin-bottom: 6px; }
.ms-head .row { margin-bottom: 4px; }
.ms-panel { margin-top: 12px; }
.ms-panel h4 { font-size: 15px; margin: 4px 0; }
.af-form > .field:last-of-type { margin-bottom: 10px; }
.ta { min-height: 64px; padding: 10px 14px; line-height: 1.4; font-family: inherit; resize: vertical; }
.field.check { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.field.check input { width: 20px; height: 20px; margin-top: 2px; }
.field.check .hint, .field.check .err { flex-basis: 100%; }
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.scroll-x table { min-width: 560px; }
table.sample, table.imp { font-size: 13px; }
table.sample th, table.sample td { padding: 6px 8px; text-align: left; white-space: nowrap; }
table.sample tr.hdr td { font-weight: 800; background: #f6f8fb; }
table.imp th, table.imp td { padding: 8px 8px; text-align: left; vertical-align: top; }
table.imp tr.st-error td { background: #fff5f5; }
table.imp tr.st-duplicate td { background: #f8fafc; color: var(--muted); }
table.imp tr.st-warning td { background: #fffbeb; }
table.perm td.yes { color: var(--green-700); font-weight: 800; }
table.perm td.no { color: #b3bdcb; }
table.perm th, table.perm td { padding: 9px 8px; }
.file-input { width: 100%; padding: 14px; border: 2px dashed var(--line-strong); border-radius: var(--radius-sm); background: #fafbfc; margin: 8px 0; }
.steps { list-style: none; display: flex; gap: 6px; margin: 0 0 12px; padding: 0; flex-wrap: wrap; }
.steps li { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px; background: #e3e8ef; color: var(--muted); font-weight: 700; font-size: 13px; }
.steps li span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #fff; font-size: 12px; }
.steps li.on { background: var(--navy-900); color: #fff; }
.steps li.done { background: var(--green-100); color: #166534; }
.audit-entry { border-top: 1px solid var(--line); padding: 10px 0; }
.audit-entry:first-child { border-top: 0; }
.audit-entry summary { cursor: pointer; list-style: none; }
.audit-entry summary::-webkit-details-marker { display: none; }
.audit-diff { margin-top: 8px; padding: 10px; background: #f6f8fb; border-radius: 8px; font-size: 13px; overflow-wrap: anywhere; }
.audit-line { padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; }
.audit-line:first-of-type { border-top: 0; }
.temp-pw { font: 700 26px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0.06em; padding: 16px; text-align: center; background: var(--navy-900); color: #86efac; border-radius: 12px; user-select: all; overflow-wrap: anywhere; }
a.stat.linky { text-decoration: none; color: inherit; }
a.stat.linky:hover { border-color: var(--green-600); }
.stat small { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); }
.dash-grid { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) { .dash-grid { grid-template-columns: repeat(4, 1fr); } .admin-nav { margin-left: 0; margin-right: 0; padding-left: 0; } }
button.act-row { width: 100%; text-align: left; background: none; border-left: 0; border-right: 0; border-bottom: 0; color: inherit; cursor: pointer; }
button.act-row:hover { background: #f6f8fb; }
.card.empty p + .row { justify-content: center; margin-top: 10px; }

table.imp { min-width: 860px; }
table.imp .c-name { overflow-wrap: normal; word-break: normal; min-width: 140px; }
table.imp .chip { margin-left: 6px; }
