@font-face { font-family: 'Barlow Condensed'; font-weight: 600; font-display: swap; src: url('/fonts/BarlowCondensed_600SemiBold.ttf') format('truetype'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 700; font-display: swap; src: url('/fonts/BarlowCondensed_700Bold.ttf') format('truetype'); }
@font-face { font-family: 'Barlow'; font-weight: 400; font-display: swap; src: url('/fonts/Barlow_400Regular.ttf') format('truetype'); }
@font-face { font-family: 'Barlow'; font-weight: 500; font-display: swap; src: url('/fonts/Barlow_500Medium.ttf') format('truetype'); }
@font-face { font-family: 'Barlow'; font-weight: 600; font-display: swap; src: url('/fonts/Barlow_600SemiBold.ttf') format('truetype'); }

:root {
  --night: #0E1A26; --panel: #14273A; --panel-2: #1A3046; --line: #22405A; --line-soft: #1B3349;
  --text: #E7EEF3; --muted: #8DA3B5; --blue: #3D8BFF; --red: #F2554A; --gold: #D9B45A; --good: #57C78A; --bad: #F2554A;
  --blue-dim: rgba(61, 139, 255, .16); --red-dim: rgba(242, 85, 74, .16);
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: 'Barlow', system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--night); color: var(--text); font: 400 16px/1.5 var(--body); font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.05; margin: 0; }
h1 { font-size: clamp(2.4rem, 5vw, 3.4rem); }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.25rem; }
p { margin: 0; }
ul { list-style: none; margin: 0; padding: 0; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 3px; }
.mk-mid, .mk-blue, .mk-red { fill: none; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.mk-mid { stroke: var(--text); } .mk-blue { stroke: var(--blue); } .mk-red { stroke: var(--red); }

.btn { font: 600 1rem/1 var(--body); border: 1px solid var(--line); background: var(--panel); color: var(--text); padding: .75em 1.15em;
  border-radius: 8px; cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .5em; text-decoration: none; }
.btn:hover { border-color: var(--muted); }
.btn-primary { background: var(--text); color: var(--night); border-color: var(--text); }
.btn-primary:hover { background: #fff; }
.btn-quiet { background: transparent; border-color: transparent; color: var(--muted); }
.btn-quiet:hover { color: var(--text); border-color: var(--line); }
.btn-small { min-height: 34px; padding: .45em .8em; font-size: .9rem; }
select { font: inherit; color: var(--text); background: var(--night); border: 1px solid var(--line); border-radius: 6px; padding: .55em .7em; min-height: 44px; max-width: 100%; }
.error { color: var(--bad); min-height: 1.5em; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: var(--gutter); }
.login-box { width: min(400px, 100%); display: grid; gap: 1rem; justify-items: start; }
.login-box h1 { font-size: 3.6rem; }
.mark { width: 60px; height: 60px; }

/* shell */
.topbar { display: flex; align-items: center; gap: 1.5rem; padding: .7rem var(--gutter); border-bottom: 1px solid var(--line-soft);
  position: sticky; top: 0; z-index: 5; background: rgba(14, 26, 38, .94); backdrop-filter: blur(8px); }
.brand { display: flex; align-items: center; gap: .55rem; text-decoration: none; font: 700 1.55rem/1 var(--display); }
.brand svg { width: 28px; height: 28px; }
.tabs { display: flex; gap: .2rem; overflow-x: auto; scrollbar-width: none; }
.tabs a { text-decoration: none; color: var(--muted); font-weight: 500; padding: .55rem .8rem; border-radius: 8px; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current=page] { color: var(--text); background: var(--panel); }
.me { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.me-link { display: flex; align-items: center; gap: .5rem; text-decoration: none; font-weight: 600; }
main { max-width: 1240px; margin: 0 auto; padding: clamp(20px, 4vw, 40px) var(--gutter) 60px; outline: none; }
main:focus, main:focus-visible { outline: none; }
.foot { max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter) 32px; color: var(--muted); font-size: .75rem; opacity: .7; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem 2rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head p { margin-top: .4rem; }
.panel { background: var(--panel); border: 1px solid var(--line-soft); border-radius: 14px; padding: clamp(16px, 2.5vw, 24px); }
.section { margin-top: 2rem; }
.section > h2 { margin-bottom: .9rem; }
.empty { padding: 3rem 1rem; text-align: center; display: grid; gap: .75rem; justify-items: center; }
.empty p { max-width: 48ch; }

/* avatar, ikony */
.av { width: 36px; height: 36px; border-radius: 50%; flex: none; object-fit: cover; background: var(--panel-2);
  display: inline-grid; place-items: center; font: 700 .95rem/1 var(--display); color: var(--text); }
.av.lg { width: 96px; height: 96px; font-size: 2.4rem; border: 3px solid var(--line); }
.av.sm { width: 28px; height: 28px; font-size: .8rem; }
.ci { width: 32px; height: 32px; border-radius: 7px; flex: none; object-fit: cover; background: var(--panel-2); border: 1px solid var(--line); }
.ci.sm { width: 26px; height: 26px; border-radius: 6px; }
.glyph { width: 22px; height: 22px; flex: none; }
.g-frame { fill: none; stroke: var(--line); stroke-width: 2; }
.g-lane { fill: none; stroke: var(--text); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.g-fill { fill: var(--text); }
.who { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; min-width: 0; }
.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.who:hover span { text-decoration: underline; text-underline-offset: 3px; }

/* přehledová lišta */
.strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 1.75rem; }
.stat { background: var(--panel); border-radius: 12px; padding: 1rem 1.2rem; }
.stat b { display: block; font: 700 2.1rem/1.05 var(--display); }
.stat span { color: var(--muted); font-size: .9rem; }

/* poslední večer */
.evening { display: grid; grid-template-columns: 1.2fr 1fr; gap: 1.25rem 2rem; align-items: start; margin-bottom: 2rem; }
.evening h2 { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.evening h2 a { font: 500 .95rem var(--body); color: var(--muted); }
.series { display: grid; gap: 8px; }
.serie { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; padding: .7rem 1rem; border-radius: 10px;
  background: var(--night); border-left: 4px solid var(--blue); border-right: 4px solid var(--red); }
.serie .score { font: 700 2rem/1 var(--display); }
.serie .t { font-size: .85rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.serie .t b { display: block; font: 700 1.05rem var(--display); }
.serie .t.b b { color: var(--blue); } .serie .t.r { text-align: right; } .serie .t.r b { color: var(--red); }
.highlights { display: grid; gap: .6rem; }
.hl { display: flex; align-items: center; gap: .75rem; }
.hl .lbl { color: var(--muted); font-size: .85rem; width: 7.5rem; flex: none; }
.hl .val { margin-left: auto; font: 700 1.2rem var(--display); }

/* tabulka */
.table-wrap { overflow-x: auto; border: 1px solid var(--line-soft); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; min-width: 820px; }
th, td { padding: .7rem .8rem; text-align: left; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
th { font-weight: 500; color: var(--muted); font-size: .85rem; background: var(--panel); }
th button { all: unset; cursor: pointer; }
th button:focus-visible { outline: 2px solid var(--text); }
th[aria-sort] button { color: var(--text); }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--panel); }
tbody tr:last-child td { border-bottom: 0; }
tr.unranked td { opacity: .5; }
.num { text-align: right; }
.pos { width: 2.5rem; color: var(--muted); font: 700 1.3rem var(--display); }
.pos.p1 { color: var(--gold); } .pos.p2 { color: #C9D3DC; } .pos.p3 { color: #C98E5A; }
.big { font: 700 1.35rem var(--display); }
.wr { display: inline-grid; grid-template-columns: 3.3em 72px; gap: .5rem; align-items: center; }
.bar { height: 7px; background: var(--line-soft); border-radius: 4px; overflow: hidden; display: block; }
.bar i { display: block; height: 100%; width: 0; background: var(--text); border-radius: 4px; }
.bar i.good { background: var(--good); } .bar i.bad { background: var(--bad); }
.form { display: inline-flex; gap: 3px; }
.form i { width: 9px; height: 16px; border-radius: 2px; }
.form i.W { background: var(--good); } .form i.L { background: var(--bad); opacity: .8; }
.spark { width: 110px; height: 30px; display: block; }
.spark path { fill: none; stroke: var(--text); stroke-width: 2; vector-effect: non-scaling-stroke; }
.mvp { color: var(--gold); font: 700 1.05rem var(--display); }
.note { margin-top: .75rem; color: var(--muted); font-size: .875rem; }

/* profil */
.prof-head { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.prof-head .who-txt { min-width: 0; }
.prof-head .rating { margin-left: auto; text-align: right; }
.prof-head .rating b { display: block; font: 700 clamp(3.2rem, 7vw, 4.8rem)/.9 var(--display); }
.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 1.5rem; }
.chart-box { position: relative; }
.chart { width: 100%; height: 280px; display: block; touch-action: pan-y; }
.chart:focus-visible { outline: 2px solid var(--text); }
.c-grid { stroke: var(--line-soft); stroke-width: 1; }
.c-lbl { fill: var(--muted); font: 500 12px var(--body); }
.c-line { fill: none; stroke: var(--text); stroke-width: 2.5; stroke-linejoin: round; }
.c-area { fill: url(#area); }
.c-dot.W { fill: var(--good); } .c-dot.L { fill: var(--bad); }
.c-cursor { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.c-hit { fill: var(--text); }
.tip { position: fixed; z-index: 20; background: var(--text); color: var(--night); padding: .5rem .7rem; border-radius: 8px; font-size: .875rem;
  pointer-events: none; max-width: 260px; line-height: 1.35; box-shadow: 0 6px 24px rgba(0,0,0,.35); }
.tip b { font-weight: 600; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.25rem; }
.rows { display: grid; gap: .55rem; }
.rrow { display: grid; grid-template-columns: 22px 70px 1fr auto; gap: .6rem; align-items: center; }
.rrow .pref { font-size: .8rem; color: var(--muted); }
.rrow .pref.main { color: var(--gold); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; padding: 3px; gap: 3px; background: var(--night); }
.seg button { font: 500 .85rem/1 var(--body); color: var(--muted); background: none; border: 0; padding: .45em .65em; border-radius: 5px; cursor: pointer; min-height: 32px; }
.seg button[aria-pressed=true] { background: var(--panel-2); color: var(--text); }
.prow { display: grid; grid-template-columns: minmax(0, 1fr) 4.5rem 80px 3.2rem; gap: .7rem; align-items: center; padding: .35rem 0; }
.crow { display: grid; grid-template-columns: minmax(0, 1fr) 3rem 4rem 3.2rem 3rem; gap: .7rem; align-items: center; padding: .3rem 0; }
.crow.head, .prow.head { color: var(--muted); font-size: .8rem; padding-bottom: 0; }
.pair { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: .9rem; }
.pair > div { flex: 1 1 200px; background: var(--night); border-radius: 10px; padding: .7rem .9rem; }
.pair .lbl { color: var(--muted); font-size: .8rem; display: block; margin-bottom: .35rem; }

/* zápasy */
.evening-group { margin-bottom: 2.25rem; }
.evening-group > h2 { display: flex; gap: .75rem; align-items: baseline; margin-bottom: .8rem; }
.evening-group > h2 span { font: 500 1rem var(--body); color: var(--muted); }
.match { border: 1px solid var(--line-soft); border-radius: 14px; background: var(--panel); overflow: hidden; margin-bottom: 10px; scroll-margin-top: 90px; }
.match.hl-on { border-color: var(--text); }
.m-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .65rem 1rem; flex-wrap: wrap; }
.m-top .t { font: 600 1.1rem var(--display); }
.m-top .t span { color: var(--muted); font: 400 .9rem var(--body); margin-left: .4rem; }
.tag { font: 600 .95rem/1 var(--display); padding: .35rem .6rem; border-radius: 5px; }
.tag.blue { color: var(--blue); background: var(--blue-dim); } .tag.red { color: var(--red); background: var(--red-dim); }
.tag.pending { color: var(--muted); border: 1px dashed var(--line); }
.m-teams { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line-soft); }
.m-team { padding: .6rem 1rem .8rem; display: grid; gap: .35rem; }
.m-team.blue { border-right: 1px solid var(--line-soft); }
.m-team h3 { font-size: 1.05rem; display: flex; justify-content: space-between; }
.m-team.blue h3 { color: var(--blue); } .m-team.red h3 { color: var(--red); }
.m-team h3 .won { color: var(--gold); }
.mp { display: grid; grid-template-columns: 22px 26px minmax(0, 1fr) auto 3rem; gap: .55rem; align-items: center; font-size: .95rem; }
a.mp, .mp a { text-decoration: none; }
a.mp:hover b, .mp a:hover span { text-decoration: underline; text-underline-offset: 3px; }
a.mp { border-radius: 6px; }
.strip.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mp .kda { color: var(--muted); font-size: .875rem; }
.mp .d { text-align: right; font: 600 .95rem var(--display); }
.up { color: var(--good); } .down { color: var(--bad); }
.mvp-tag { color: var(--night); background: var(--gold); font: 700 .7rem/1 var(--display); padding: .2rem .35rem; border-radius: 4px; margin-left: .35rem; letter-spacing: .02em; }
.more { display: flex; justify-content: center; margin-top: 1rem; }

/* graf */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 1rem; }
.chip { font: 500 .9rem/1 var(--body); border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 999px;
  padding: .5em .85em; cursor: pointer; display: inline-flex; align-items: center; gap: .45rem; min-height: 36px; }
.chip i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.chip[aria-pressed=true] { color: var(--text); border-color: var(--muted); }
.race { width: 100%; height: 440px; display: block; }
.race .ln { fill: none; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.race .end { font: 700 15px var(--display); }

/* srovnání */
.vs-pick { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; margin-bottom: 1.5rem; }
.vs-pick .x { font: 600 1.4rem var(--display); color: var(--muted); }
.vs-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.vs-head .side { display: flex; align-items: center; gap: .9rem; min-width: 0; }
.vs-head .side.r { justify-content: flex-end; text-align: right; }
.vs-head .side h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); overflow: hidden; text-overflow: ellipsis; }
.vs-head .side.l h2 { color: var(--blue); } .vs-head .side.r h2 { color: var(--red); }
.vs-rows { display: grid; gap: 4px; }
.vs-row { display: grid; grid-template-columns: 1fr 5rem 8rem 5rem 1fr; gap: .8rem; align-items: center; padding: .55rem .8rem; border-radius: 8px; }
.vs-row:nth-child(odd) { background: var(--panel); }
.vs-row .lbl { text-align: center; color: var(--muted); font-size: .9rem; }
.vs-row .v { font: 700 1.5rem var(--display); }
.vs-row .v.a { text-align: right; } .vs-row .v.lead-a { color: var(--blue); } .vs-row .v.lead-b { color: var(--red); }
.vs-row .bar.a { display: flex; justify-content: flex-end; } .vs-row .bar.a i { background: var(--blue); } .vs-row .bar.b i { background: var(--red); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--text); color: var(--night);
  padding: .7rem 1.1rem; border-radius: 8px; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--bad); color: #fff; }

@media (max-width: 900px) {
  .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .evening { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; gap: .4rem 1rem; }
  .tabs { order: 3; width: 100%; }
  .me-name { display: none; }
  .m-teams { grid-template-columns: 1fr; }
  .m-team.blue { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .prof-head .rating { margin-left: 0; text-align: left; width: 100%; }
  .chart { height: 220px; }
  .race { height: 320px; }
  .vs-row { grid-template-columns: 1fr 6rem 1fr; }
  .vs-row .bar { display: none; }
  .vs-head .side h2 { font-size: 1.4rem; }
  .crow { grid-template-columns: minmax(0, 1fr) 3rem 3.2rem 3rem; }
  .crow > :nth-child(3) { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
