/* Vzhled podle aplikace B7ID (Material UI): Roboto, tmavá horní lišta, B7 červená, karty se stínem. */
:root {
  --bg: #f5f5f5; --panel: #ffffff; --ink: rgba(0, 0, 0, .87); --muted: rgba(0, 0, 0, .6); --line: rgba(0, 0, 0, .12);
  --accent: #c4120c; --accent-dark: #a00e09; --accent-ink: #ffffff; --appbar: #262626;
  --st-F: #2e7d32; --st-Z: #9ccc65; --st-D: #d32f2f; --st-Q: #7b1fa2; --st-X: #9e9e9e; --st-N: transparent; --st-none: #eeeeee;
  --st-ink: #ffffff; --st-Z-ink: #1b3a07; --warn-bg: #fff4e5; --warn-ink: #663c00;
  --shadow-1: 0 2px 1px -1px rgba(0, 0, 0, .2), 0 1px 1px 0 rgba(0, 0, 0, .14), 0 1px 3px 0 rgba(0, 0, 0, .12);
  --shadow-4: 0 2px 4px -1px rgba(0, 0, 0, .2), 0 4px 5px 0 rgba(0, 0, 0, .14), 0 1px 10px 0 rgba(0, 0, 0, .12);
  --cell: 20px; --gap: 2px;
  color-scheme: light;
}
/* Roboto (OFL) hostované u nás – žádné požadavky na Google Fonts (GDPR). Proměnné písmo: jeden soubor = všechny řezy. */
@font-face { font-family: Roboto; font-style: normal; font-weight: 100 900; font-display: swap; src: url(fonts/roboto-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Roboto; font-style: normal; font-weight: 100 900; font-display: swap; src: url(fonts/roboto-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.5 Roboto, "Helvetica Neue", Arial, sans-serif; letter-spacing: .01em; }
a { color: var(--accent); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* horní lišta (AppBar) */
.top { background: var(--appbar); color: #fff; padding: 14px 0; box-shadow: var(--shadow-4); }
.bar { display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; color: #fff; text-decoration: none; font-weight: 500; font-size: 20px; letter-spacing: .0075em; }
.logo { display: block; flex: 0 0 auto; padding-right: 24px; border-right: 1px solid rgba(255, 255, 255, .25); }
.logo img { display: block; height: 44px; width: auto; }
.sub { margin: 2px 0 0; color: rgba(255, 255, 255, .7); font-size: 13px; }
.loading, .empty { color: var(--muted); padding: 32px 0; }
.empty.pad { padding: 16px; }

/* poznámka (Alert – warning) */
.note { background: var(--warn-bg); color: var(--warn-ink); border-radius: 4px; padding: 14px 20px; margin: 20px 0 0; font-size: 17px; line-height: 1.55; }
.note a { color: inherit; font-weight: 500; }

/* filtry (outlined TextField / Select) */
.filters { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: end; margin: 20px 0 12px; }
.filters label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 4px; }
.filters input, .filters select { font: inherit; font-size: 15px; height: 40px; padding: 0 12px; border: 1px solid rgba(0, 0, 0, .23); border-radius: 4px; background: var(--panel); color: var(--ink); outline: none; }
.filters input:hover, .filters select:hover { border-color: var(--ink); }
.filters input:focus, .filters select:focus { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.filters .q input { width: 260px; }

/* tlačítka (outlined / contained) */
.btn { font: inherit; font-size: 13px; font-weight: 500; letter-spacing: .03em; text-transform: uppercase; height: 40px; padding: 0 16px; border-radius: 4px;
       border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent); background: var(--panel); color: var(--accent); cursor: pointer;
       text-decoration: none; display: inline-flex; align-items: center; justify-content: center; transition: background-color .15s, border-color .15s; }
.btn:hover { background: color-mix(in srgb, var(--accent) 5%, var(--panel)); border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-1); }
.btn.primary:hover { background: var(--accent-dark); }
.btn:disabled { opacity: .38; cursor: default; background: var(--panel); border-color: var(--line); color: var(--muted); }

/* legenda */
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--muted); margin: 4px 0 16px; }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }

/* buňka ročníku */
.c { width: var(--cell); height: var(--cell); border-radius: 4px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700;
     color: var(--st-ink); background: var(--st-none); flex: 0 0 auto; line-height: 1; }
.c.F { background: var(--st-F); } .c.Z { background: var(--st-Z); color: var(--st-Z-ink); } .c.D { background: var(--st-D); }
.c.Q { background: var(--st-Q); } .c.X { background: var(--st-X); } .c.N { background: transparent; border: 1.5px dashed var(--st-X); color: var(--muted); }
.strip { display: flex; gap: var(--gap); }

/* štítek spárovaného B7ID (MUI Chip – small, outlined) */
.b7 { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; margin-left: 8px; border-radius: 9px; border: 1px solid var(--accent);
      color: var(--accent); font-size: 10px; font-weight: 700; letter-spacing: .04em; vertical-align: middle; line-height: 1; }
h1 .b7 { height: 22px; padding: 0 9px; border-radius: 11px; font-size: 12px; margin-left: 12px; position: relative; top: -3px; }
.legend .b7 { margin-left: 0; }

/* seznam */
.list { background: var(--panel); border-radius: 4px; box-shadow: var(--shadow-1); overflow: hidden; }
.row { display: grid; grid-template-columns: minmax(170px, 1fr) 52px 64px 72px auto; gap: 12px; align-items: center; padding: 8px 16px; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row.head { font-size: 12px; font-weight: 500; color: var(--muted); background: #fafafa; position: sticky; top: 0; z-index: 1; }
.row.head .strip span { width: var(--cell); text-align: center; }
.row:not(.head):hover { background: rgba(0, 0, 0, .04); }
.row .nm a { color: var(--ink); text-decoration: none; font-weight: 500; }
.row .nm a:hover { color: var(--accent); }
.row .by { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; }
.row .na { color: var(--muted); font-size: 14px; }
/* Master: zlatá korunka (sloupec v seznamu, štítek v detailu, legenda) */
.koruna { width: 20px; height: 20px; fill: #f9a825; flex: 0 0 auto; vertical-align: middle; }
.row .ms { display: flex; justify-content: center; }
.row.head .ms { justify-content: center; }
.legend .koruna { width: 18px; height: 18px; }
.master { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 9px 0 6px; margin-left: 12px; border-radius: 11px;
  background: #fff8e1; border: 1px solid #f9a825; color: #8d5f00; font-size: 12px; font-weight: 500; letter-spacing: .03em;
  position: relative; top: -3px; vertical-align: middle; }
.master .koruna { width: 16px; height: 16px; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 20px 0 32px; font-size: 14px; color: var(--muted); }

/* detail */
.back { display: inline-flex; align-items: center; margin: 20px 0 8px; font-size: 14px; font-weight: 500; text-decoration: none; }
.back:hover { text-decoration: underline; }
h1 { margin: 4px 0 2px; font-size: 28px; font-weight: 500; color: var(--accent); }
/* detail: karta osobních údajů (pohlaví · národnost · ročník) a karta statistik – popisek nahoře, hodnota pod ním; chybějící údaj = pomlčka */
.karty { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 0 20px; align-items: stretch; }
.info { display: flex; flex-wrap: wrap; margin: 0; background: var(--panel); border-radius: 4px; box-shadow: var(--shadow-1); width: fit-content; max-width: 100%; }
.info > div { padding: 10px 24px 10px 16px; border-left: 1px solid var(--line); }
.info > div:first-child { border-left: 0; }
.info dt { font-size: 12px; color: var(--muted); letter-spacing: .03em; }
.info dd { margin: 0; font-size: 18px; font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.info dd.nic { color: var(--muted); font-weight: 400; }
.info.stat dd { font-size: 22px; line-height: 1.3; }
.info.stat .kod { font-size: 11px; vertical-align: 4px; }
.info .kod { display: inline-block; margin-left: 6px; padding: 0 6px; border: 1px solid var(--line); border-radius: 4px; font-size: 12px;
  font-weight: 500; color: var(--muted); vertical-align: 3px; line-height: 18px; }
.bigstrip { --cell: 30px; flex-wrap: wrap; gap: 4px; margin: 6px 0 4px; }
.bigstrip .y { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; color: var(--muted); }
.bigstrip .ys { display: none; }
table.res { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: 4px; box-shadow: var(--shadow-1); overflow: hidden; margin: 16px 0; font-size: 14px; }
.res th { text-align: left; font-size: 13px; font-weight: 500; color: var(--ink); background: #fafafa; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.res td { padding: 12px 16px; border-top: 1px solid var(--line); vertical-align: top; }
.res tbody tr:first-child td { border-top: 0; }
.res tbody tr:hover { background: rgba(0, 0, 0, .04); }
.res .t { font-variant-numeric: tabular-nums; white-space: nowrap; }
.res .small { display: block; font-size: 12px; color: var(--muted); }
.badge { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; white-space: nowrap; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 16px 0 32px; font-size: 13px; color: var(--muted); }
.foot { color: var(--muted); font-size: 12px; padding: 8px 16px 28px; }

@media (max-width: 720px) {
  :root { --cell: calc((100vw - 32px - 32px - 16 * var(--gap)) / 17); }
  .row { grid-template-columns: 1fr auto auto auto; gap: 8px 10px; padding: 12px 16px; align-items: baseline; }
  .row .nm a { font-size: 17px; font-weight: 600; }
  .row .by { color: var(--ink); font-size: 15px; font-weight: 500; }
  .row:not(.head) .by::before { content: "nar. "; color: var(--muted); font-weight: 400; font-size: 13px; }
  .row:not(.head) .strip .c { height: calc(var(--cell) * .72); border-radius: 3px; }
  .row .strip { grid-column: 1 / -1; grid-row: 2; }
  .row.head .nm, .row.head .ms, .row.head .by, .row.head .na { display: none; }
  .row .ms { align-self: center; }
  .row .na { font-size: 13px; }
  .row.head .strip { grid-row: 1; }
  .c { font-size: 9px; }
  .filters .q input { width: 100%; }
  .filters .q { flex: 1 1 100%; }
  table.res thead { display: none; }
  table.res, .res tbody { display: block; width: 100%; }
  /* výsledek jako karta: ročník · závod · kategorie / výsledek · čas / tým */
  .res tr { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "rok zav kat" "vys vys cas" "tym tym tym";
            align-items: center; gap: 6px 10px; border-top: 1px solid var(--line); padding: 14px 16px; }
  .res tr:first-child { border-top: 0; }
  .res td { display: block; border: 0; padding: 0; width: auto; }
  .res td:empty { display: none; }
  .res td[data-l="Ročník"] { grid-area: rok; font-size: 17px; }
  .res td[data-l="Závod"] { grid-area: zav; color: var(--muted); }
  .res td[data-l="Kategorie"] { grid-area: kat; color: var(--muted); font-size: 13px; }
  .res td[data-l="Výsledek"] { grid-area: vys; }
  .res td[data-l="Čas"] { grid-area: cas; font-weight: 500; font-size: 15px; }
  .res td[data-l="Tým"] { grid-area: tym; padding-top: 6px; border-top: 1px dashed var(--line); }
  /* souhrn 2×2 */
  .karty { gap: 10px; margin-bottom: 16px; }
  .info { display: grid; grid-template-columns: auto auto auto; width: 100%; }
  .info.stat { grid-template-columns: 1fr 1fr; }
  .info.stat > div:nth-child(3) { border-left: 0; }
  .info.stat > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .info.stat dd { font-size: 20px; }
  .info > div { padding: 8px 10px; }
  .info dt { font-size: 11px; }
  .info dd { font-size: 16px; white-space: normal; }
  /* pás ročníků přes celou šířku v jednom řádku */
  .bigstrip { display: grid; grid-template-columns: repeat(17, 1fr); gap: 3px; }
  .bigstrip .y { gap: 3px; font-size: 9px; }
  .bigstrip .c { width: 100%; height: auto; aspect-ratio: 1; }
  .bigstrip .yf { display: none; }
  .bigstrip .ys { display: inline; }
  .note { font-size: 14px; line-height: 1.5; padding: 10px 14px; margin-top: 14px; }
  .bar { gap: 14px; }
  .logo { padding-right: 14px; }
  .logo img { height: 34px; }
  .brand { font-size: 17px; }
}
