/* ==========================================================================
   zapis-zapas.cz – design tokens a základ (podle grafického handoffu, high-fidelity)
   ========================================================================== */
/* Public Sans je uložený u nás (variabilní písmo, 400–800): stránka nečeká na cizí server
   a nic o návštěvnících neodchází ven. Písmo je pod licencí SIL OFL. */
@font-face {
    font-family: 'Public Sans'; font-style: normal; font-weight: 400 800; font-display: swap;
    src: url('/fonts/public-sans-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;
}
@font-face {
    font-family: 'Public Sans'; font-style: normal; font-weight: 400 800; font-display: swap;
    src: url('/fonts/public-sans-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    /* Aplikace je světlá; bez tohoto si ji prohlížeč v tmavém režimu telefonu sám přebarví
       a menu pak bývá tmavé na tmavém. */
    color-scheme: light;
    --bg: #f5f5f6;
    --card: #ffffff;
    --soft: #f8f8fa;
    --soft-hover: #fbfbfc;
    --soft-2: #f3f3f5;
    --fg: #1c2027;
    --fg-2: #4a505a;
    --fg-3: #5a606a;
    --muted: #6b7079;
    --muted-2: #8b909a;
    --placeholder: #a5a9b2;
    --placeholder-2: #b8bcc4;
    --border: #e3e4e8;
    --border-inner: #ebecef;
    --border-row: #eff0f2;
    --border-input: #d0d3d9;
    --chip: #eeeff2;
    --red: #e2262c;
    --red-dark: #b91c22;
    --red-soft: #fde9ea;
    --red-cell: #fde3e4;
    /* Modrá odlišuje správu webu: co je jen pro hlavního správce, není červené jako zbytek. */
    --blue: #1d6fd0;
    --blue-dark: #17579f;
    --blue-soft: #e9f1fc;
    --grey-cell: #e6e7eb;
    --grey-cell-fg: #2b3039;
    --dark: #1c2027;
    --dark-hover: #2b3039;
    --shadow-dropdown: 0 8px 24px rgba(28, 32, 39, .12);
    --shadow-dialog: 0 20px 60px rgba(0, 0, 0, .25);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: 'Public Sans', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-dark); text-decoration: underline; }
h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 16px; }
h2 { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
h3 { font-size: 14px; font-weight: 800; margin: 12px 0 8px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { text-align: right; }
.inline { display: inline; }
.narrow { max-width: 520px; }
ul.plain { margin: 0; padding-left: 1.2rem; }
.num { font-variant-numeric: tabular-nums; }

/* --- hlavička ------------------------------------------------------------- */
.topbar {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px;
    padding: 14px 24px; background: var(--card); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 12px; color: var(--fg); flex: 0 0 auto; }
.brand-home { color: var(--fg); }
.brand-home:hover { color: var(--fg); text-decoration: none; }
.brand-logo { height: 38px; width: auto; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-copy { font-size: 10px; font-weight: 500; color: var(--muted); }
.topbar-center { display: flex; flex-direction: column; gap: 2px; text-align: center; flex: 1 1 auto; min-width: 0; }
.topbar-title { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; text-wrap: balance; }
.topbar-sub { font-size: 13px; color: var(--muted); font-weight: 500; }
.topbar-sub b { color: var(--fg); font-weight: 700; }
.topbar-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; flex: 0 0 auto; }
.topbar-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.topbar-nav { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 13px; }
.nav-link, .link-btn { color: var(--fg-3); font: inherit; font-weight: 600; background: none; border: 0; padding: 0; cursor: pointer; }
.nav-link:hover, .link-btn:hover { color: var(--red-dark); text-decoration: underline; }
.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.burger {
    display: flex; flex-direction: column; justify-content: center; gap: 4px; width: 34px; height: 34px; padding: 0 8px;
    border-radius: 8px; border: 1px solid var(--border-input); background: var(--card); cursor: pointer;
}
.burger:hover { background: var(--bg); }
.burger span { display: block; height: 2px; border-radius: 2px; background: var(--fg); }
.menu-list {
    position: absolute; right: 0; top: calc(100% + 6px); min-width: 200px; background: var(--card); border: 1px solid var(--border);
    border-radius: 12px; box-shadow: var(--shadow-dropdown); padding: 6px; display: flex; flex-direction: column; gap: 2px; z-index: 30;
}
.menu-list a, .menu-user { padding: 9px 12px; border-radius: 8px; color: var(--fg); font-weight: 600; font-size: 14px; white-space: nowrap; }
.menu-list a:hover { background: var(--bg); text-decoration: none; }
.menu-user { color: var(--muted-2); font-size: 12px; font-weight: 600; border-bottom: 1px solid var(--border-inner); border-radius: 0; margin-bottom: 4px; }

/* --- obsah, karty ----------------------------------------------------------- */
.container { width: 100%; max-width: 980px; margin: 0 auto; padding: 24px 24px 48px; display: flex; flex-direction: column; gap: 20px; }
.container-wide { max-width: 1240px; }
section, .card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 20px 24px; }
section > h2:first-child { margin-top: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head h1, .page-head h2, .page-head h3 { margin: 0; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.hero { text-align: center; padding: 48px 24px; }
.hero h1 { font-size: 28px; }
.hero p { max-width: 560px; margin: 12px auto; color: var(--fg-2); }

/* --- tlačítka ---------------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 11px; border-radius: 8px;
    border: 1px solid var(--border-input); background: var(--card); color: var(--fg); font: inherit; font-size: 13px; font-weight: 600;
    cursor: pointer; white-space: nowrap; text-decoration: none; line-height: 1.4;
}
.btn:hover { background: var(--bg); color: var(--fg); text-decoration: none; }
.btn-primary { border-color: var(--red); background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); border-color: var(--red-dark); color: #fff; }
.btn-dark { border-color: var(--dark); background: var(--dark); color: #fff; }
.btn-dark:hover { background: var(--dark-hover); color: #fff; }
.btn-sm { padding: 3px 8px; font-size: 12px; }
.btn-danger { color: var(--red-dark); }
.btn-danger:hover { border-color: var(--red-dark); }
.btn-sm { padding: 4px 9px; font-size: 12px; }
.btn-lg { min-width: 240px; padding: 12px 26px; border-radius: 12px; font-size: 15px; font-weight: 700; gap: 10px; }
.btn[disabled] { opacity: .45; cursor: default; }
.btn-secondary { color: var(--muted); }

/* --- formuláře ---------------------------------------------------------------- */
label { display: block; margin-bottom: 12px; font-weight: 600; font-size: 13px; }
label small { display: block; font-weight: 400; color: var(--muted); }
label.check { font-weight: 500; }
/* Seznam e-mailů v nastavení klubu: řádek na adresu s přepínačem „aktivní" a křížkem. */
fieldset.email-list { border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px 14px; margin: 0 0 16px; }
fieldset.email-list legend { font-weight: 700; padding: 0 6px; }
fieldset.email-list legend small { display: block; font-weight: 400; color: var(--muted-2); font-size: 12px; }
.email-rows { display: grid; gap: 6px; }
.email-row { display: flex; align-items: center; gap: 8px; }
.email-row label.check { flex: 1 1 auto; display: flex; align-items: center; gap: 8px; margin: 0; }
.email-row.is-off .addr { color: var(--muted); text-decoration: line-through; }
.email-row .btn-icon { padding: 2px 9px; line-height: 1.2; }
.email-rows input[type=text] { margin-top: 4px; }
label.check input { margin-right: 6px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=search], input[type=number],
input[type=date], input[type=time], select, textarea {
    display: block; width: 100%; margin-top: 4px; padding: 8px 10px; font: inherit; font-size: 13px; font-weight: 600; color: var(--fg);
    border: 1px solid var(--border-input); border-radius: 8px; background: var(--card);
}
textarea { font-weight: 400; font-size: 14px; padding: 10px 12px; border-radius: 10px; min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--red-soft); border-color: var(--red); }
input::placeholder, textarea::placeholder { color: var(--placeholder); font-weight: 500; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
fieldset.opponent-new { border: 1px dashed var(--border-input); border-radius: 10px; padding: 8px 14px; margin: 0 0 12px; }
fieldset.opponent-new legend { font-weight: 700; font-size: 13px; padding: 0 4px; }
#club-filter { margin-bottom: 10px; }

/* --- tabulky (obecné) ----------------------------------------------------------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 8px; border-top: 1px solid var(--border-row); }
thead th { border-top: 0; background: var(--soft); color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
tbody tr:hover td { background: var(--soft-hover); }
.table-wrap { overflow-x: auto; }

/* --- štítky, hlášky ------------------------------------------------------------- */
.badge { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--chip); color: var(--fg-2); font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.badge-ok { background: var(--red-soft); color: var(--red-dark); }
.badge-wait { background: #fff4e5; color: #92400e; }
/* Výsledek z pohledu klubu v přehledu utkání. */
.badge-win { background: #eaf7ee; color: #1c6b33; }
.badge-loss { background: var(--red-soft); color: var(--red-dark); }
.badge-draw { background: var(--chip); color: var(--fg-2); }
.badge-warn { background: #fff4e5; color: #92400e; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; background: var(--red-soft); color: var(--red-dark); font-size: 13px; font-weight: 700; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.pill-grey { background: var(--chip); color: var(--fg-2); }
.pill-grey::before { background: var(--muted-2); }
.flash { padding: 12px 16px; border-radius: 12px; font-weight: 500; }
.flash-success { background: #ecfdf5; color: #065f46; border: 1px solid #bbf7d0; }
.flash-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.flash-info { background: var(--soft); color: var(--fg-2); border: 1px solid var(--border-inner); }
.flash-warn { background: #fff4e5; color: #92400e; }

/* --- hráči, fotky ------------------------------------------------------------------ */
.avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; vertical-align: middle; margin-right: 6px; flex: none; background: var(--chip); display: inline-block; }
.avatar-empty { background: var(--chip) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23a5a9b2'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c0-4 4-6 8-6s8 2 8 6z'/%3E%3C/svg%3E") center/70% no-repeat; }
.pname { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
.photo-mini label { display: inline-flex; padding: 1px 6px; margin: 0 0 0 6px; cursor: pointer; }
.player-head { display: flex; gap: 20px; align-items: flex-start; }
.photo-lg { width: 140px; height: 140px; border-radius: 12px; object-fit: cover; flex: none; }
.photo-empty { background: var(--chip); color: var(--muted); display: flex; align-items: center; justify-content: center; font-size: 13px; }
.photo-form { margin-top: 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.photo-form input[type=file] { font-size: 12px; }
details.team { border: 1px solid var(--border-inner); border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; }
details.team summary { cursor: pointer; display: flex; gap: 12px; flex-wrap: wrap; align-items: baseline; }
table.roster { margin-top: 6px; font-size: 13px; }
table.roster tr.basic td { background: #fff7f7; }

/* --- našeptávač ---------------------------------------------------------------------- */
.combo { display: flex; align-items: center; gap: 4px; flex: 1; }
.combo input[type=text] { margin: 0; }
.combo input.is-new { border-color: #d97706; background: #fffbeb; }
.combo input.flash-swap { transition: background .5s; background: var(--red-soft); }
.lineup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.slot { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.slot .letter { width: 32px; font-weight: 800; font-size: 16px; text-align: center; color: var(--red-dark); flex: none; }
.slot .letter.small { width: 88px; font-size: 12px; text-align: left; color: var(--muted); }
/* Čtyřhra: políčka hráčů mají celou šířku, tlačítka jsou pod nimi na vlastním řádku. */
/* Čtyřhry: bez fotek (jsou nahoře u písmen), jedna dvojice tlačítek pod oběma čtyřhrami. */
.slot-double .avatar { display: none; }
.double-actions { display: flex; gap: 6px; justify-content: flex-end; margin: 2px 0 8px; }
.sub-form { background: var(--soft); border: 1px solid var(--border-inner); border-radius: 12px; padding: 12px 16px; }

/* --- STATUS autosave ---------------------------------------------------------------- */
.autosave { font-size: 13px; font-weight: 600; color: var(--muted); }
.autosave.ok { color: var(--fg-2); }
.autosave.warn { color: #92400e; }
.autosave.err { color: var(--red-dark); }

/* ==========================================================================
   Zápis utkání (match/show)
   ========================================================================== */
.section-label { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.match-card { padding: 24px 28px; display: flex; flex-direction: column; gap: 20px; }
.match-teams { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 16px; }
.match-team { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.match-team.away { text-align: right; }
.match-team-name { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.match-team.away .match-team-name { justify-content: flex-end; }
.match-team-name strong { font-size: clamp(22px, 3vw, 34px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.badge-vitez { height: 44px; width: auto; display: block; }
.badge-remiza { height: 40px; width: auto; display: block; }
.match-score { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.match-score-num { display: flex; align-items: center; gap: 14px; font-size: clamp(40px, 6vw, 64px); font-weight: 800; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.match-score-num .colon { color: var(--placeholder); font-weight: 500; }
.match-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding-top: 18px; border-top: 1px solid var(--border-inner); }
.match-meta .date { font-size: 15px; color: var(--fg-2); font-weight: 500; font-variant-numeric: tabular-nums; }
.match-times { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--fg-2); font-variant-numeric: tabular-nums; flex-wrap: wrap; }
.match-times .k { color: var(--muted-2); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.match-times .sep { color: var(--placeholder); }
.match-times input[type=time] { display: inline-block; width: auto; margin: 0; padding: 3px 6px; font-size: 14px; }
/* Délka utkání je krátké pole v řádku, ne formulářový blok přes celou šířku. */
.match-times input[name=length] { display: inline-block; width: 8.5em; margin: 0; padding: 3px 6px; font-size: 14px; }
.match-meta .readonly-note { font-size: 14px; color: var(--muted); }

.sheet-card { padding: 0; overflow: hidden; }
table.sheet { min-width: 820px; font-size: 15px; }
table.sheet thead th { padding: 12px 8px; }
table.sheet th:first-child, table.sheet td:first-child { padding-left: 20px; }
table.sheet th:last-child, table.sheet td:last-child { padding-right: 20px; }
table.sheet td { height: 52px; padding: 0 8px; border-top: 1px solid var(--border-row); white-space: nowrap; }
table.sheet tbody tr:hover td { background: var(--soft-hover); }
table.sheet td.n { color: var(--muted-2); font-weight: 600; font-variant-numeric: tabular-nums; }
table.sheet td.n a { color: inherit; display: inline-block; min-width: 24px; }
table.sheet td.n a:hover { color: var(--red-dark); }
table.sheet .chip { display: inline-block; padding: 3px 8px; border-radius: 6px; background: var(--chip); color: var(--fg-2); font-size: 12px; font-weight: 700; letter-spacing: .04em; white-space: nowrap; }
table.sheet td.pcell { font-weight: 500; color: var(--fg-3); }
table.sheet td.pcell.won { font-weight: 700; color: var(--fg); }
table.sheet td.pcell .pname a { color: inherit; }
/* Jméno hráče jako tlačítko: klepnutím se otevře střídání od tohoto zápasu. */
table.sheet td.pcell .pname .sub-open { all: unset; cursor: pointer; color: inherit; border-bottom: 1px dashed var(--muted-2); }
table.sheet td.pcell .pname .sub-open:hover { color: var(--red); border-bottom-color: var(--red); }
table.sheet td.pcell .pname .sub-open:focus-visible { outline: 2px solid var(--red); border-radius: 3px; }
.win-badge { height: 11px; width: auto; display: inline-block; margin-left: 6px; vertical-align: middle; }
table.sheet td.set { padding: 0 4px; text-align: center; }
table.sheet .set-input, table.sheet .set-chip {
    display: inline-grid; place-items: center; min-width: 40px; height: 32px; padding: 0 6px; border-radius: 8px; border: 1px solid transparent;
    font: inherit; font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; text-align: center; margin: 0; width: 48px;
    background: var(--bg); color: var(--placeholder-2);
}
/* Set vyhraný domácími je modrý, hosty červený – sytě, ne vybledle. */
.set-input.pos, .set-chip.pos { background: var(--blue-soft); color: var(--blue); border-color: #bcd8f7; font-weight: 700; }
.set-input.neg, .set-chip.neg { background: #fdeaea; color: var(--red-dark); border-color: #f5c9cb; font-weight: 700; }
.set-input:focus { outline: 2px solid var(--red); background: #fff; color: var(--fg); }
.set-input.invalid { outline: 2px solid var(--red); background: #fff; color: var(--red-dark); }
/* Políčko za rozhodujícím setem: zápas je rozhodnutý, nic dalšího se nezapisuje. */
.set-input.dead { background: repeating-linear-gradient(135deg, var(--bg) 0 4px, var(--chip) 4px 6px); color: transparent; cursor: not-allowed; }
.set-input.dead::placeholder { color: transparent; }
.set-input::placeholder { color: var(--placeholder-2); }
table.sheet td.result { text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; border-left: 1px solid var(--border-inner); color: var(--fg); }
/* Výsledek zápasu z pohledu domácích: výhra modře, prohra červeně. */
table.sheet tr.won-home td.result { color: var(--blue); font-weight: 800; }
table.sheet tr.won-away td.result { color: var(--red-dark); font-weight: 800; }
table.sheet td.pts { text-align: center; font-variant-numeric: tabular-nums; color: var(--fg-2); font-weight: 600; }
table.sheet tr.total td { border-top: 2px solid var(--border-input); background: var(--soft); font-weight: 700; }
table.sheet tr.total td.label { text-align: right; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
table.sheet tr.total td.result { color: var(--fg); }
table.sheet tr.total td.pts.grand { color: var(--red-dark); font-size: 17px; }
table.sheet tr.total:hover td { background: var(--soft); }
.sheet-legend { display: flex; flex-wrap: wrap; gap: 18px; padding: 12px 20px; border-top: 1px solid var(--border-inner); font-size: 12px; color: var(--muted); background: var(--soft); }
.sheet-legend span { display: flex; align-items: center; gap: 6px; }
.sheet-legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.sheet-legend .push { margin-left: auto; }
.forfeit-tag { font-size: 11px; color: var(--muted-2); font-weight: 700; }

.subs-line { font-size: 13px; color: var(--fg-2); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* podpisy */
.declaration { padding: 14px 16px; border-radius: 12px; background: var(--soft); border: 1px solid var(--border-inner); font-size: 13px; line-height: 1.5; color: var(--fg-2); text-wrap: pretty; }
.signers { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.signer { display: flex; flex-direction: column; gap: 8px; }
.sig-btn {
    position: relative; height: 110px; border-radius: 12px; border: 1px dashed var(--border-input); background: var(--soft); cursor: pointer;
    padding: 0; overflow: hidden; display: grid; place-items: center; font: inherit; font-size: 13px; color: var(--muted-2); font-weight: 600;
}
.sig-btn:hover { background: var(--soft-2); border-color: var(--placeholder); }
.sig-btn img { position: absolute; inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); object-fit: contain; }
.sig-btn[disabled] { cursor: default; }
.signer-meta { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--border-input); padding-top: 8px; }
.signer-meta .role { font-size: 13px; font-weight: 700; }
.signer-meta select, .signer-meta input { margin: 0; }
.signer-meta .signed { font-size: 12px; color: var(--muted); }
.lock-row { display: flex; justify-content: center; padding-top: 8px; }

.dialog-overlay[hidden] { display: none !important; }
body.modal-open { overflow: hidden; }
.prepis-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 10px; }
#prepis-dialog textarea { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.dialog-overlay { position: fixed; inset: 0; background: rgba(28, 32, 39, .55); z-index: 50; display: grid; place-items: center; padding: 16px; }
.dialog { width: 100%; max-width: 640px; background: var(--card); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow-dialog); }
.dialog-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
/* Okno Maily v rozpisu: náhled zprávy a seznam adresátů k zaškrtnutí. */
.mail-preview { border-collapse: collapse; font-size: 14px; }
.mail-preview td { padding: 2px 12px 2px 0; vertical-align: top; }
.check-list { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: 0; }
.check-list legend { font-weight: 600; padding: 0 4px; }
/* Přebíjí .move-form label (grid), které by řádek rozložilo pod sebe. */
.move-form label.check-row, label.check-row { display: flex; align-items: center; gap: 8px; margin: 0; padding: 3px 0; font-weight: 500; font-size: 14px; }
.move-form label.check-row small, label.check-row small { display: inline; margin: 0; }
.move-form label.check-row input[type=checkbox], label.check-row input[type=checkbox] { width: auto; flex: none; margin: 0; }
.dialog-head strong { font-size: 16px; font-weight: 800; }
.dialog-head span { font-size: 12px; color: var(--muted-2); }
.sig-canvas { width: 100%; height: auto; aspect-ratio: 600 / 220; display: block; border-radius: 12px; border: 1px solid var(--border-input); background: #fff; touch-action: none; cursor: crosshair; }
.sig-who { display: grid; gap: 4px; }
.sig-who label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--fg-2); }
.sig-who select, .sig-who input { margin: 0; font-weight: 500; }
.sig-error { font-size: 13px; font-weight: 600; color: var(--red-dark); }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.dialog-actions .push { margin-right: auto; }

/* statistiky */
.highlights { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.highlight { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 12px; background: var(--soft); border: 1px solid var(--border-inner); }
.highlight .k { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2); }
.highlight .v { font-size: 17px; font-weight: 800; line-height: 1.2; }
.highlight .s { font-size: 12px; color: var(--muted); }
.team-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; margin-top: 18px; }
.team-stats h3 { margin: 0 0 10px; }
.pstat { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; margin-bottom: 10px; }
.pstat .name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pstat .rec { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--fg-2); }
.pstat .bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--chip); overflow: hidden; }
.pstat .bar i { display: block; height: 100%; border-radius: 3px; background: var(--red); }
.pstat.away .bar i { background: var(--fg-2); }

/* dropdown Typ hry */
.dropdown { position: relative; display: inline-flex; }
.dropdown-btn .k { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2); }
.dropdown-btn .caret { font-size: 11px; color: var(--muted-2); }
.dropdown-menu { position: absolute; top: calc(100% + 6px); right: 0; min-width: 200px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-dropdown); padding: 6px; display: flex; flex-direction: column; gap: 2px; z-index: 20; }
.dropdown-menu button { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 12px; border-radius: 8px; border: 0; background: transparent; color: var(--fg); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-align: left; }
.dropdown-menu button:hover { background: var(--bg); }
.dropdown-menu button.active { background: var(--red-soft); color: var(--red-dark); }
.dropdown-menu button span { font-size: 12px; color: var(--muted-2); }

/* klávesnice pro set */
.set-pad { position: absolute; z-index: 40; background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-dropdown); padding: 10px; width: 260px; }
.set-pad-title { font-weight: 700; margin-bottom: 6px; font-size: 13px; }
.set-pad-side { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 6px; }
.set-pad-side .btn { padding: 8px 4px; font-size: 12px; }
.set-pad-value { margin-bottom: 6px; font-size: 12px; color: var(--muted); }
.set-pad-value strong { font-size: 20px; color: var(--fg); }
.set-pad-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.set-pad-keys .btn { padding: 10px 0; font-size: 17px; }

/* ==========================================================================
   Zápis jednoho zápasu (match/game) – mobilní fokus
   ========================================================================== */
.focus { max-width: 520px; }
.focus-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.focus-card { padding: 20px; display: flex; flex-direction: column; gap: 18px; }
.focus-players { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: center; }
.focus-side { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.focus-side.away { text-align: right; }
.focus-side .k { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.focus-side .name { font-size: 18px; font-weight: 800; line-height: 1.15; overflow-wrap: anywhere; }
.focus-side .combo { flex-direction: column; align-items: stretch; }
.focus-side.away .combo input { text-align: right; }
.focus-result { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--grey-cell-fg); }
.focus-result.home { color: var(--red-dark); }
.focus-sets { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--border-inner); padding-top: 16px; }
.focus-set { display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: center; }
.focus-set .k { font-size: 12px; font-weight: 700; color: var(--muted-2); letter-spacing: .08em; }
.focus-set .ctl { display: grid; grid-template-columns: 52px 1fr 52px; gap: 8px; }
.focus-set .ctl .btn { height: 52px; border-radius: 12px; font-size: 22px; font-weight: 700; padding: 0; }
.focus-set .set-input { height: 52px; border-radius: 12px; border: 1px solid var(--border-input); background: var(--soft); color: var(--fg); font-size: 22px; font-weight: 700; text-align: center; margin: 0; width: 100%; min-width: 0; }
.focus-set .set-input.pos { background: var(--blue-soft); color: var(--blue); }
.focus-set .set-input.neg { background: #fdeaea; color: var(--red-dark); }
.focus-hint { font-size: 12px; color: var(--muted-2); padding-top: 4px; }
.focus-extra { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; border-top: 1px solid var(--border-inner); padding-top: 16px; }
.focus-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.focus-nav .btn { height: 42px; border-radius: 10px; }

/* --- responsivita ------------------------------------------------------------ */
@media (max-width: 720px) {
    .container { padding: 16px 12px 40px; }
    .lineup-grid, .row-2, .focus-extra { grid-template-columns: 1fr; }
    .match-teams { grid-template-columns: 1fr; text-align: center; }
    .match-team.away { text-align: center; }
    .match-team-name, .match-team.away .match-team-name { justify-content: center; }
    section, .card { padding: 16px; }
    .match-card { padding: 18px; }
}

/* --- tisk --------------------------------------------------------------------- */
@media print {
    .topbar, .no-print, .flash, .sheet-legend, .lock-row, .dialog-overlay, .set-pad { display: none !important; }
    body { background: #fff; }
    .container { max-width: none; padding: 0; gap: 12px; }
    section, .card { border: 0; padding: 0; break-inside: avoid; }
    table.sheet { min-width: 0; font-size: 12px; }
    table.sheet td { height: auto; padding: 4px 6px; }
    table.sheet .set-input, table.sheet .set-chip { min-width: 30px; height: 24px; width: 34px; border: 1px solid #ccc; }
    .sig-btn { border: 1px solid #ccc; background: #fff; }
}

/* --- úvodní stránka ---------------------------------------------------------- */
.hero { text-align: center; padding: 72px 24px 64px; }
.hero-logo { height: 100px; width: auto; display: block; margin: 0 auto 28px; }
.hero h1 { font-size: clamp(30px, 4.5vw, 46px); letter-spacing: -0.03em; margin-bottom: 14px; }
.hero p { max-width: 640px; margin: 0 auto; font-size: 18px; color: var(--fg-2); }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 32px; }
.hero-actions .btn-lg { min-width: 0; padding: 12px 28px; }
/* Patička: kdo nás podporuje a odkud jsou data. Mimo tisk. */
.site-footer { margin-top: 48px; padding: 18px 0 28px; border-top: 1px solid var(--border); font-size: 13px; color: var(--fg-2); }
.site-footer .container { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px 24px; flex-wrap: wrap; }
.site-footer .sponsors { display: flex; align-items: baseline; gap: 6px 14px; flex-wrap: wrap; }
.site-footer .sponsors ul { display: flex; gap: 4px 18px; flex-wrap: wrap; margin: 0; padding: 0; }
.site-footer .section-label { margin: 0; }
.site-footer a { color: inherit; }

/* --- registrace / přihlášení ---------------------------------------------------- */
.auth { max-width: 740px; }
.auth h1 { font-size: 34px; margin: 8px 0 20px; }
.auth-card { padding: 32px 34px; }
.form-lg label { font-size: 15px; font-weight: 700; margin-bottom: 18px; }
.form-lg label .hint { font-weight: 500; color: var(--muted); }
.form-lg input { margin-top: 8px; padding: 13px 14px; font-size: 15px; font-weight: 500; border-radius: 10px; }
.form-lg label small { margin-top: 6px; font-size: 13px; }
.form-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 26px; font-size: 15px; color: var(--fg-2); }
.form-actions .btn-lg { min-width: 0; padding: 13px 28px; }
@media (max-width: 720px) { .auth-card { padding: 20px 18px; } .auth h1 { font-size: 28px; } }
.picker { margin-top: 8px; }
.picker select[disabled] { color: var(--placeholder); }
.radio-row { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 6px; }
.radio-row label { margin: 0; font-weight: 500; }
[hidden] { display: none !important; }
.row-2 { align-items: end; }
.row-2 label { margin-bottom: 12px; }
input[type=date], input[type=time] { min-width: 0; }
.combo input.is-dup { border-color: var(--red); background: #fef2f2; }

/* --- výběr sestavy ze soupisky ------------------------------------------------ */
.roster-pick { border: 1px solid var(--border-inner); border-radius: 12px; max-height: 330px; overflow: auto; margin-bottom: 14px; background: var(--soft); }
.roster-group { padding: 6px 12px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); background: var(--chip); position: sticky; top: 0; }
.roster-row { display: flex; align-items: center; gap: 8px; padding: 6px 12px; margin: 0; font-weight: 600; font-size: 14px; cursor: pointer; border-top: 1px solid var(--border-row); background: var(--card); }
.roster-row:hover { background: var(--soft-hover); }
.roster-row input { margin: 0 4px 0 0; width: 18px; height: 18px; accent-color: var(--red); }
.roster-row input:disabled + .avatar, .roster-row input:disabled ~ .roster-name { opacity: .4; }
.roster-row .roster-name { flex: 1; }
.roster-row .roster-meta { color: var(--muted-2); font-size: 12px; font-weight: 500; }
.roster-row .roster-letter { min-width: 22px; text-align: center; font-weight: 800; color: var(--red-dark); }
.roster-row:has(input:checked) { background: var(--red-soft); }
.set-pad-value { display: flex; align-items: baseline; gap: 10px; }
.set-pad-value strong { min-width: 44px; padding: 2px 8px; border-radius: 8px; background: var(--red-cell); color: var(--red-dark); text-align: center; }
.set-pad.pad-away .set-pad-value strong { background: var(--grey-cell); color: var(--grey-cell-fg); }

/* ==========================================================================
   Mobil: seznam zápasů místo tabulky (jen na úzkých displejích)
   ========================================================================== */
.games-mobile { display: none; padding: 12px; }
.games-mobile-head { display: flex; justify-content: space-between; align-items: baseline; padding: 4px 6px 10px; }
.gcard { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 8px; border-top: 1px solid var(--border-row); color: var(--fg); text-decoration: none; }
.gcard:hover, .gcard:active { background: var(--soft-hover); text-decoration: none; color: var(--fg); }
.gcard-no { font-weight: 700; color: var(--muted-2); font-variant-numeric: tabular-nums; text-align: center; }
.gcard-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.gcard-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.gcard-line .chip { display: inline-block; padding: 2px 7px; border-radius: 6px; background: var(--chip); color: var(--fg-2); font-size: 11px; font-weight: 700; flex: none; min-width: 26px; text-align: center; }
.gcard-name { font-weight: 500; color: var(--fg-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gcard-name.won { font-weight: 700; color: var(--fg); }
.gcard-sets { display: flex; gap: 4px; margin-top: 2px; }
.gcard-sets .set-chip { min-width: 30px; height: 24px; padding: 0 4px; font-size: 12px; border-radius: 6px; display: inline-grid; place-items: center; background: var(--bg); color: var(--placeholder-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.gcard-result { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.gcard-result strong { font-size: 18px; font-variant-numeric: tabular-nums; color: var(--grey-cell-fg); }
.gcard-result strong.home { color: var(--red-dark); }
.gcard.won-home { background: #fff8f8; }

/* ==========================================================================
   Mobilní úpravy celé aplikace
   ========================================================================== */
@media (max-width: 720px) {
    /* hlavička: logo + menu v prvním řádku, titulek a akce pod nimi */
    .topbar { padding: 10px 12px; gap: 8px 10px; }
    .brand-logo { height: 32px; }
    .brand-copy { display: none; }
    .topbar-right { order: 2; gap: 8px; }
    .topbar-center { order: 3; flex-basis: 100%; }
    .topbar-title { font-size: 15px; }
    .topbar-sub { font-size: 12px; }
    .topbar-actions { order: 4; flex-basis: 100%; justify-content: center; }
    .topbar-actions:empty { display: none; }
    .menu-list { position: fixed; left: 12px; right: 12px; top: 58px; min-width: 0; }
    .dropdown-menu { right: auto; left: 0; }

    /* dotykové cíle a pole bez přiblížení v iOS */
    .btn { min-height: 40px; }
    .btn-sm { min-height: 36px; }
    input[type=text], input[type=email], input[type=password], input[type=url], input[type=search], input[type=number],
    input[type=date], input[type=time], select, textarea { font-size: 16px; padding: 10px 12px; }
    .roster-row { padding: 9px 12px; }
    .roster-row input { width: 22px; height: 22px; }

    /* široké tabulky posouvat, ne rozbít stránku */
    section > table, .table-wrap > table, section > details table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
    table.roster { font-size: 13px; }
    .page-head { gap: 8px; }
    .toolbar { width: 100%; }
    .toolbar .btn, .toolbar form { flex: 1 1 auto; }
    .toolbar form .btn { width: 100%; }

    /* zápis utkání: karta, seznam místo tabulky, klávesnice dole */
    .match-score-num { font-size: 40px; gap: 10px; }
    .match-team-name strong { font-size: 24px; }
    .badge-vitez { height: 34px; }
    .match-meta { gap: 8px 12px; }
    .match-times { width: 100%; }
    .match-meta .toolbar { margin-left: 0 !important; }
    .sheet-card { display: none; }
    .games-mobile { display: block; }
    .subs-line { flex-direction: column; align-items: flex-start; }
    .signers { grid-template-columns: 1fr; }
    .lock-row .btn-lg { width: 100%; }
    .highlights { grid-template-columns: 1fr 1fr; }
    .team-stats { grid-template-columns: 1fr; }
    .set-pad { position: fixed; top: auto !important; left: 0 !important; right: 0; bottom: 0; width: auto; border-radius: 16px 16px 0 0; box-shadow: 0 -8px 24px rgba(28, 32, 39, .18); padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); }
    .set-pad-keys .btn { padding: 13px 0; font-size: 20px; }
    .set-pad-side .btn { padding: 10px 4px; font-size: 13px; }

    /* zápis jednoho zápasu */
    .focus-players { grid-template-columns: 1fr; text-align: left; }
    .focus-side.away { text-align: left; }
    .focus-side.away .combo input { text-align: left; }
    .focus-result { text-align: center; }

    /* sestava */
    .slot { flex-wrap: wrap; }
    .slot .combo { min-width: 160px; }
    .roster-pick { max-height: 260px; }

    /* ostatní stránky */
    .player-head { flex-direction: column; align-items: center; text-align: center; }
    .photo-form { justify-content: center; }
    .hero { padding: 36px 12px 32px; }
    .hero-logo { height: 80px; }
    .hero-actions .btn-lg { width: 100%; }
    .form-actions { flex-direction: column; align-items: stretch; }
    .form-actions .btn-lg { width: 100%; }
    .auth h1 { font-size: 26px; }
    .flash { font-size: 13px; }
}
@media (max-width: 420px) {
    .highlights { grid-template-columns: 1fr; }
    .gcard-sets .set-chip { min-width: 26px; }
    .brand-text { display: none; }
}
/* odznak VÍTĚZ zůstává na řádku vedle názvu, název se zmenší */
.match-team-name { flex-wrap: nowrap; min-width: 0; }
.match-team-name strong { min-width: 0; overflow-wrap: anywhere; }
.badge-vitez { height: 36px; flex: none; }
@media (max-width: 720px) { .match-team-name { flex-wrap: wrap; } }

/* --- rozhodčí a licence v zápise --- */
.ref-grid { display: grid; grid-template-columns: auto minmax(0, 1fr) 110px; gap: 8px 12px; align-items: center; }
.ref-grid .ref-role { font-size: 13px; font-weight: 600; color: var(--fg-2); white-space: nowrap; }
.ref-grid input { margin: 0; }
@media (max-width: 720px) {
    .ref-grid { grid-template-columns: 1fr 90px; }
    .ref-grid .ref-role { grid-column: 1 / -1; margin-top: 4px; }
}

/* --- horní lišta je stále viditelná, vpravo Zpět a menu ------------------------- */
.topbar { position: sticky; top: 0; z-index: 40; }
.btn-back { font-weight: 700; }
.menu-logout { margin: 4px 0 0; border-top: 1px solid var(--border-inner); padding-top: 4px; }
.menu-logout button { display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; border-radius: 8px; background: none; font: inherit; font-weight: 600; font-size: 14px; color: var(--red-dark); cursor: pointer; }
.menu-logout button:hover { background: var(--red-soft); }

/* --- w.o. (skreč / nenastoupení) --------------------------------------------- */
.wo-row { border-top: 1px solid var(--border-inner); padding-top: 12px; margin-top: 4px; display: flex; flex-direction: column; gap: 8px; }
.wo-label { font-size: 13px; font-weight: 700; }
.wo-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wo-btn { min-height: 46px; white-space: normal; line-height: 1.2; }
.wo-btn.active { background: var(--red); border-color: var(--red); color: #fff; }
.wo-btn.active::before { content: "w.o. "; font-weight: 800; }
.wo-hint { font-size: 12px; color: var(--muted-2); }
table.sheet td.result .forfeit-tag { display: block; font-size: 10px; color: var(--red-dark); font-weight: 700; }
.set-pad-wo { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: 6px; }
.set-pad-wo .btn { padding: 8px 4px; font-size: 12px; }
.sub-mark { display: inline-block; margin-left: 4px; min-width: 16px; padding: 0 4px; border-radius: 4px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; text-align: center; }
.set-input.wo-cell, .set-chip.wo-cell { background: var(--red-soft); color: var(--red-dark); border-color: var(--red); }
.set-input.wo-cell::placeholder { color: var(--red-dark); font-weight: 700; opacity: 1; }
.wo-clear { align-self: flex-start; }
.set-pad-wo { grid-template-columns: 1fr 1fr; }
.set-pad-wo .wo-clear { grid-column: 1 / -1; }

/* --- Odeslání zápisu e-mailem: vlastní řádek, adresa a tlačítko pro každého příjemce ---------- */
.mail-summary { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.dialog-wide { max-width: 760px; }
.mail-rows { display: grid; gap: 10px; }
.mail-row {
    display: grid; grid-template-columns: minmax(150px, 210px) minmax(0, 1fr) auto; gap: 4px 14px;
    align-items: center; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--card);
}
.mail-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mail-label { font-size: 14px; font-weight: 700; }
.mail-hint { font-size: 12px; color: var(--muted-2); }
.mail-send { white-space: nowrap; }
.mail-info { grid-column: 1 / -1; margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 12px; }
.mail-sent { color: var(--fg-2); font-weight: 600; }
.mail-error { color: var(--red-dark); font-weight: 600; }
.mail-saved { color: var(--muted-2); }
.mail-saved.err { color: var(--red-dark); font-weight: 600; }

/* Inline editace: pole vypadá jako text, orámuje se až při najetí nebo úpravě. */
input.inline-edit {
    width: 100%; margin: 0; padding: 7px 9px; font: inherit; font-size: 15px; color: var(--fg);
    background: transparent; border: 1px solid transparent; border-bottom: 1px dashed var(--border-input); border-radius: 8px;
}
input.inline-edit:hover { background: var(--soft); }
input.inline-edit:focus { outline: none; background: var(--card); border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
input.inline-edit::placeholder { color: var(--placeholder-2); font-style: italic; }
input.inline-edit.invalid { border-bottom-color: var(--red); color: var(--red-dark); }

@media (max-width: 720px) {
    .mail-row { grid-template-columns: minmax(0, 1fr) auto; }
    .mail-who { grid-column: 1 / -1; }
    .mail-send { min-height: 44px; }
}
@media (max-width: 480px) {
    /* Na úzkém displeji dostane adresa celou šířku, tlačítko jde pod ni. */
    .mail-row { grid-template-columns: minmax(0, 1fr); }
    .mail-send { justify-self: stretch; }
}

/* --- Souhlas se zpracováním údajů v registraci ---------------------------------------------- */
label.check.consent { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; line-height: 1.45; color: var(--fg-2); }
label.check.consent input { margin: 3px 0 0; flex: none; }
label.check.consent span { font-weight: 500; }

/* --- Sbalovací část zápisu (rozhodčí, kontumace) – vyplňuje se zřídka -------------------------- */
details.fold > summary {
    cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 8px; padding: 2px 0 10px;
    font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: "▸"; font-size: 12px; color: var(--red); }
details.fold[open] > summary::before { content: "▾"; }
details.fold > summary:hover { color: var(--fg-2); }

/* Řádek zápasu, který právě zapisuje počítadlo: ručně se měnit nedá, ať si obsluha se
   zapisovatelem nepřepisují sety navzájem. */
tr.board-running .set-input { background: var(--blue-soft); color: var(--blue-dark); cursor: not-allowed; }
.game-len { display: block; font-size: 10px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.board-link.is-running { color: var(--blue); }

/* Nastavení a formuláře patří do okna, ne do stránky: v liště je jen tlačítko, které okno otevře. */
.toolbar-gap { flex: 1 1 auto; }
/* Rozstřel hráčů v kalendáři: zaškrtávátka hráčů ve sloupcích, dvojice vedle sebe. */
.dialog-wide { max-width: 720px; }
.draw-players { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px 12px; }
.move-form fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: 0 0 10px; }
.move-form fieldset legend { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.draw-pair { margin-bottom: 6px; }
.draw-count { color: var(--muted-2); font-size: 12px; font-variant-numeric: tabular-nums; }
/* Obsazenost hráčů pod rozpisem: jméno, proužek podle počtu utkání a číslo. */
.load-head { margin: 18px 0 8px; }
.load-head .small { font-weight: 400; text-transform: none; letter-spacing: 0; }
.player-load { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 18px; }
.player-load li { display: grid; grid-template-columns: minmax(0, 8.5em) 1fr auto; align-items: center; gap: 8px; font-size: 13px; }
.player-load a { color: inherit; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-load a:hover { color: var(--red-dark); }
.load-bar { background: var(--chip); border-radius: 6px; height: 8px; overflow: hidden; }
.load-bar span { display: block; height: 100%; background: var(--blue); border-radius: 6px; }
.player-load strong { font-variant-numeric: tabular-nums; }
table.roster td.num, table.roster th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.fixtures td.nominated { max-width: 260px; }
.move-form { display: grid; gap: 10px; }
.fixture-title, .fixture-note { margin-top: 2px; white-space: normal; max-width: 260px; }
/* Název soupeřova družstva v rozpisu je tlačítko s kontaktem na vedoucího. */
.club-web { font-size: 14px; font-weight: 500; color: var(--red); margin-left: 10px; letter-spacing: 0; text-transform: none; }
.linklike { all: unset; cursor: pointer; color: inherit; border-bottom: 1px dashed var(--muted-2); }
.linklike:hover { color: var(--red); border-bottom-color: var(--red); }
.linklike:focus-visible { outline: 2px solid var(--red); border-radius: 3px; }
table.kv { border-collapse: collapse; font-size: 14px; }
table.kv th { text-align: left; font-weight: 600; color: var(--fg-2); padding: 4px 14px 4px 0; white-space: nowrap; }
table.kv td { padding: 4px 0; }
table.kv a[href] { color: var(--red); }
.move-form label { font-size: 13px; font-weight: 600; color: var(--fg-2); display: grid; gap: 4px; }

/* Správa webu: skupina podpoložek v hamburger menu a přepínač mezi stránkami. */
.menu-group {
    padding: 10px 14px 2px; font-size: 11px; font-weight: 800; letter-spacing: .12em;
    text-transform: uppercase; color: var(--blue); border-top: 1px solid var(--border-inner); margin-top: 6px;
}
.menu-list a.menu-sub { padding-left: 26px; color: var(--blue-dark); }
.menu-list a.menu-sub:hover { background: var(--blue-soft); }
.admin-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; }
.admin-nav a {
    padding: 7px 13px; border: 1px solid var(--blue-soft); border-radius: 999px;
    font-size: 13px; font-weight: 600; text-decoration: none; color: var(--blue-dark); background: var(--blue-soft);
}
.admin-nav a:hover { border-color: var(--blue); }
.admin-nav a.is-current { background: var(--blue); border-color: var(--blue); color: #fff; }

/* Správa webu: skupina podpoložek v hamburger menu a přepínač mezi stránkami. */
.menu-group {
    padding: 10px 14px 2px; font-size: 11px; font-weight: 800; letter-spacing: .12em;
    text-transform: uppercase; color: var(--blue); border-top: 1px solid var(--border-inner); margin-top: 6px;
}
.menu-list a.menu-sub { padding-left: 26px; color: var(--blue-dark); }
.menu-list a.menu-sub:hover { background: var(--blue-soft); }
.admin-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; }
.admin-nav a {
    padding: 7px 13px; border: 1px solid var(--blue-soft); border-radius: 999px;
    font-size: 13px; font-weight: 600; text-decoration: none; color: var(--blue-dark); background: var(--blue-soft);
}
.admin-nav a:hover { border-color: var(--blue); }
.admin-nav a.is-current { background: var(--blue); border-color: var(--blue); color: #fff; }

/* Návod u tlačítka na ověření soupisek: mačká se zřídka, proto je sbalený. */
.club-help { margin: 4px 0 0; }
.club-help > summary { padding-bottom: 4px; }
.club-help-body { max-width: 70ch; font-size: 13px; line-height: 1.5; color: var(--fg-2); }
.club-help-body p { margin: 0 0 8px; }
.club-help-body ul { margin: 0 0 8px; padding-left: 20px; }
.club-help-body li { margin-bottom: 3px; }

/* --- Klub: znak a kontakty družstev ze STISu ------------------------------------------------- */
.club-title { display: flex; align-items: center; gap: 12px; }
.club-crest { width: 44px; height: 44px; object-fit: contain; border-radius: 8px; background: var(--soft); padding: 3px; flex: none; }
.team-contacts {
    display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 14px; margin: 0 0 12px;
    padding: 10px 12px; border-radius: 8px; background: var(--soft); font-size: 13px;
}
.team-contacts dt { color: var(--muted); font-weight: 600; white-space: nowrap; }
.team-contacts dd { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.team-contacts a { color: var(--red-dark); }
@media (max-width: 560px) {
    .team-contacts { grid-template-columns: minmax(0, 1fr); }
    .team-contacts dt { margin-top: 6px; }
}

/* --- Nástěnka klubu: dlaždice a karty rozepsaných zápisů ------------------------------------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.tile { padding: 14px 16px; border: 1px solid var(--border-inner); border-radius: 12px; background: var(--soft); display: flex; flex-direction: column; gap: 2px; }
a.tile-link { color: inherit; text-decoration: none; cursor: pointer; transition: border-color .15s, background .15s; }
a.tile-link:hover { border-color: var(--red); background: #fff; }
/* Dlaždice s pořadím hráčů (nejvíce zápasů, nejvíce bodů): stejně velká jako ostatní, drobné písmo. */
.tile-season { font-weight: 500; font-size: 11px; }
.tile-list { margin: 3px 0 0; padding: 0 0 0 16px; display: grid; gap: 1px; font-size: 12px; line-height: 1.35; }
.tile-list li { display: flex; justify-content: space-between; gap: 8px; }
.tile-list li::marker { font-weight: 700; color: var(--red-dark); }
.tile-player { color: var(--fg); font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-player:hover { color: var(--red); }
.tile-count { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tile-value { font-size: 30px; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; }
.tile-label { font-size: 13px; font-weight: 700; }
.tile-note { font-size: 12px; color: var(--muted); }

.live-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.live-card {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center;
    padding: 12px 14px; border: 1px solid var(--border); border-left: 3px solid var(--red); border-radius: 12px;
    background: var(--card); color: inherit; text-decoration: none;
}
.live-card:hover { background: var(--soft-hover); border-color: var(--red); }
.live-date { font-size: 12px; color: var(--muted); }
.live-score { grid-row: 1 / 3; grid-column: 2; font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--red-dark); white-space: nowrap; }
.live-teams { grid-column: 1; display: flex; flex-wrap: wrap; gap: 5px; font-size: 14px; font-weight: 600; }
.live-teams .us { color: var(--red-dark); }
.live-progress { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; }
.live-progress .bar { flex: 1; height: 6px; border-radius: 999px; background: var(--chip); overflow: hidden; }
.live-progress .bar i { display: block; height: 100%; background: var(--red); }

/* --- Karta utkání: hry, které se právě hrají (u stolu běží dvě naráz) ------------------------ */
.live-now { grid-column: 1 / -1; display: grid; gap: 3px; padding: 7px 9px; border-radius: 8px; background: var(--soft); font-size: 12px; }
.now-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 8px; align-items: baseline; }
.now-no { color: var(--muted); font-variant-numeric: tabular-nums; }
.now-names { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now-sets { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.now-row.playing .now-sets { color: var(--red-dark); }
.now-row.waiting { color: var(--muted); }
.now-row.waiting .now-sets { font-weight: 500; font-style: italic; }
.board-link { display: inline-flex; margin-left: 4px; color: var(--muted-2); vertical-align: middle; }
/* Ukončit utkání: nabídne se po posledním dohraném zápase, ať ho obsluha nepřehlédne. */
.btn-end-match { animation: end-match-pulse 1.6s ease-in-out infinite; }
@keyframes end-match-pulse { 50% { box-shadow: 0 0 0 6px rgba(226, 38, 44, .18); } }
/* Pokyny nad tabulkou zápisu: krátce a lidsky, ať je jasné, že stačí psát sety. */
.sheet-howto { margin: 0 0 10px; padding: 10px 14px; border: 1px solid var(--line); border-left: 4px solid var(--blue);
               border-radius: 10px; background: var(--bg-soft, #f7f9fc); }
.sheet-howto p { margin: 0 0 4px; font-size: 13px; line-height: 1.5; }
.sheet-howto p:last-child { margin-bottom: 0; }
.howto-icon { display: inline-block; padding: 0 4px; border: 1px solid var(--line); border-radius: 5px; background: #fff; font-size: 12px; }
@media print { .sheet-howto { display: none; } }

/* Kontrola utkání po dohrání poslední hry: kroky s ikonou (✓ hotovo, ! zkontrolovat, → další krok). */
.check-steps { margin: 12px 0 0; padding: 12px 16px; border: 1px solid var(--line); border-left: 4px solid var(--red); border-radius: 10px; background: var(--card); }
.check-steps.is-done { border-left-color: #1c6b33; }
.check-steps.is-new { animation: check-pop .6s ease-out; }
@keyframes check-pop { from { box-shadow: 0 0 0 6px var(--red-soft); } to { box-shadow: none; } }
.check-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; font-size: 15px; }
.check-list-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.check-list-steps li { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; border-top: 1px solid var(--border-row); }
.check-list-steps li:first-child { border-top: 0; }
.check-ico { flex: none; width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; background: var(--chip); color: var(--muted); }
.st-ok .check-ico { background: #eaf7ee; color: #1c6b33; }
.st-todo .check-ico { background: var(--red-soft); color: var(--red-dark); }
.st-next .check-ico { background: var(--blue-soft); color: var(--blue-dark); }
.check-body { flex: 1; min-width: 0; display: grid; gap: 2px; font-size: 14px; }
.check-body > span { color: var(--fg-2); }
.st-wait .check-body { color: var(--muted); }
.check-items { margin: 4px 0 0; padding-left: 18px; font-size: 13px; color: var(--red-dark); }
.check-list-steps .btn { flex: none; align-self: center; }
@media print { .check-steps { display: none; } }

/* Adresa pro web klubu / odběr kalendáře: dlouhé pole s tlačítkem Kopírovat. */
.copy-row { display: flex; gap: 8px; align-items: center; }
.copy-row input { flex: 1; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
/* Okno s informacemi o hráči (klepnutí na jméno v zápise). */
.player-card { display: flex; gap: 14px; align-items: flex-start; margin: 4px 0 10px; }
.player-photo { width: 92px; height: 92px; border-radius: 12px; object-fit: cover; background: var(--chip); flex: none; }
.player-photo[hidden] { display: none; }
.player-facts { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 0; flex: 1; }
.player-facts dt { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; align-self: center; }
.player-facts dd { margin: 0; font-weight: 600; }
/* Křížek „zrušit střídání“ v odznaku střídání. */
.badge-x { all: unset; cursor: pointer; margin-left: 6px; padding: 0 5px; border-radius: 6px; font-weight: 700; color: var(--muted-2); }
.badge-x:hover { color: var(--red); background: var(--red-soft); }
/* Čas celého utkání v hlavičce zápisu (od Začátku, běží nepřerušeně). */
.match-clock { font-weight: 700; font-variant-numeric: tabular-nums; }
.match-clock.is-running { color: var(--blue); }
/* Spustit / pozastavit hru a běžící čas v řádku zápisu. */
.game-n-row { display: flex; align-items: center; gap: 3px; white-space: nowrap; }
.game-tools { display: inline-flex; align-items: center; gap: 1px; }
.game-tools .board-link { margin-left: 0; }
.game-clock-btn { all: unset; cursor: pointer; display: inline-flex; padding: 2px; border-radius: 6px; color: var(--blue); vertical-align: middle; }
.game-clock-btn:hover { background: #eaf2ff; }
.game-clock-btn.is-running { color: #92400e; }
.game-clock { display: block; font-size: 11px; font-weight: 700; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.game-clock.is-running { color: var(--blue); }
/* Ukončit a uložit zápas (fajfka) / ukončený zápas (zámek) v zápise. */
.game-close { display: inline-block; vertical-align: middle; margin-left: 2px; }
.game-close-btn { all: unset; cursor: pointer; display: inline-flex; padding: 2px; border-radius: 6px; color: #1c6b33; }
.game-close-btn:hover { background: #eaf7ee; }
.game-close-btn.is-closed { color: var(--muted-2); }
.game-close-btn.is-closed:hover { color: var(--red); background: var(--red-soft); }
table.sheet tr.game-closed td { background: #f7f8fa; }
/* Probíhající zápas: modře zvýrazněný řádek, ať je u stolu na první pohled vidět, co se hraje. */
table.sheet tr.game-live td { background: #eaf2ff; }
table.sheet tr.game-live td:first-child { box-shadow: inset 4px 0 0 var(--blue); }
table.sheet tr.game-live td.n a, table.sheet tr.game-live td.pcell .pname { color: var(--blue); font-weight: 700; }
table.sheet tr.game-closed td.set .set-input { opacity: .75; }
.board-link:hover { color: var(--red); }
table.sheet td.n { white-space: nowrap; }
.club-cell { display: flex; align-items: center; gap: 10px; }
.crest-mini { width: 26px; height: 26px; object-fit: contain; border-radius: 6px; background: var(--soft); flex: none; }
.crest-empty { background: var(--chip); }
.import-progress { margin: 10px 0 0; padding: 9px 12px; border-radius: 8px; background: var(--soft); font-size: 13px; color: var(--fg-2); }
.import-progress.ok { background: #eaf7ee; color: #1c6b33; font-weight: 600; }
.import-progress.warn { background: var(--red-soft); color: var(--red-dark); font-weight: 600; }

/* --- Ukazatel průběhu (záloha dat) ----------------------------------------------------------- */
.progress { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; font-size: 13px; color: var(--fg-2); }
.progress .bar { height: 10px; border-radius: 999px; background: var(--chip); overflow: hidden; }
.progress .bar i { display: block; height: 100%; width: 0; background: var(--red); transition: width .4s ease-out; }
.progress.ok .bar i { background: #1c6b33; }
.progress.ok .progress-text { color: #1c6b33; font-weight: 600; }
.progress.err .bar i { background: var(--red-dark); }
.progress.err .progress-text { color: var(--red-dark); font-weight: 600; }

/* --- Přehled verzí (Co je nového) ------------------------------------------------------------ */
.brand-version { color: var(--muted); font-size: 11px; font-weight: 700; margin-left: 5px; text-decoration: none; }
.brand-version:hover { color: var(--red); text-decoration: underline; }
.changelog { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.changelog-item { padding: 14px 16px; border: 1px solid var(--border-inner); border-left: 3px solid var(--border); border-radius: 10px; }
.changelog-item.current { border-left-color: var(--red); background: var(--soft); }
.changelog-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.changelog-version { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--red-dark); }
.changelog-title { font-weight: 700; }
.changelog-date { color: var(--muted); font-size: 13px; margin-left: auto; }
.changelog-list { margin: 8px 0 0; padding-left: 20px; color: var(--fg-2); font-size: 14px; line-height: 1.5; }
.changelog-list li { margin: 2px 0; }
table td.num, table th.num { width: 46px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* --- Výběr klubu: hledání a hlavička tabulky zůstávají vidět při rolování ---------------------- */
.club-search {
    /* Horní lišta je také ukotvená, proto se hledání zastaví až pod ní (výšku měří skript). */
    position: sticky; top: var(--topbar-h, 64px); z-index: 5; margin: 0 -18px 10px; padding: 10px 18px 8px;
    background: var(--card); border-bottom: 1px solid var(--border-inner);
}
.club-search input[type=search] { margin: 0; }
.club-search p { margin: 6px 0 0; }
#club-table thead th {
    position: sticky; top: calc(var(--topbar-h, 64px) + var(--club-search-h, 56px)); z-index: 4; background: var(--soft-2);
}
.hero-compact { margin-top: 24px; padding: 22px; }
.hero-compact h2 { margin: 10px 0 6px; font-size: 22px; }
.hero-compact p { margin: 0 auto 10px; max-width: 620px; }

/* --- Veřejný náhled zápisu: formulář se na úzkém displeji posouvá do stran, neschovává se ----- */
.protocol-view { padding: 14px; overflow-x: auto; }
.protocol-view > div { min-width: 700px; }
@media (max-width: 700px) {
    .protocol-view { padding: 10px; }
}

/* --- Mobil: jemnější obrysy -------------------------------------------------------------------
   Na malém displeji drží telefon jas výš a tmavé linky kolem polí působí těžkopádně,
   proto se obrys polí, tlačítek a rámečků o kus zesvětlí. */
@media (max-width: 700px) {
    :root {
        --border-input: #e4e6ea;
        --border: #eceef1;
        --border-inner: #f1f2f5;
    }
    input[type=text], input[type=email], input[type=password], input[type=url], input[type=search],
    input[type=number], input[type=date], input[type=time], select, textarea {
        border-color: var(--border-input);
    }
    .btn { border-color: var(--border-input); }
    table th, table td { border-color: var(--border-inner); }
}
.stats-strip .tiles { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stats-strip .tile-value { font-size: 24px; }
.highlight .v.v-sm { font-size: 14px; line-height: 1.3; }
.highlight .v.v-xs { font-size: 13px; font-weight: 700; line-height: 1.35; }

/* --- Kalendář utkání ------------------------------------------------------------------------- */
.calendar-subscribe .ics-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.calendar-subscribe input[type=text] { flex: 1 1 320px; margin: 0; font-size: 12px; font-weight: 500; }
/* Kalendář utkání: karty po měsících (datum | družstva | hráči a herna | výsledek | akce). */
.cal-head { align-items: flex-start; }
.cal-head .toolbar .btn { font-size: 14px; }
.caret { font-size: 11px; margin-left: 4px; }
.menu-list button { all: unset; box-sizing: border-box; cursor: pointer; padding: 9px 12px; border-radius: 8px; color: var(--fg); font-weight: 600; font-size: 14px; white-space: nowrap; text-align: left; }
.menu-list button:hover { background: var(--bg); }
.cal-filter { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.seg { display: inline-flex; gap: 2px; padding: 4px; border-radius: 12px; background: var(--chip); flex-wrap: wrap; }
.seg a { padding: 7px 14px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 14px; }
.seg a:hover { color: var(--fg); text-decoration: none; }
.seg a.is-on { background: var(--card); color: var(--fg); box-shadow: 0 1px 3px rgba(28, 32, 39, .08); }
.seg-n { color: var(--muted-2); font-weight: 600; margin-left: 4px; }
.cal-hide-played { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 600; font-size: 14px; }
.cal-hide-played input { width: auto; margin: 0; }
.cal-list { display: flex; flex-direction: column; gap: 22px; }
h2.cal-month { font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-2); margin: 0 0 8px; display: flex; gap: 10px; align-items: baseline; }
h2.cal-month .small { text-transform: none; letter-spacing: 0; font-weight: 500; }
.cal-cards { background: var(--card); border-radius: 14px; box-shadow: 0 1px 2px rgba(28, 32, 39, .06); padding: 0 28px; }
.cal-card { display: grid; grid-template-columns: 96px minmax(0, 1.5fr) minmax(0, 1.1fr) 96px auto; gap: 32px; align-items: center; padding: 22px 0; border-top: 1px solid var(--border-row); }
.cal-card:first-child { border-top: 0; }
.cal-card.played .cal-teams, .cal-card.played .cal-info { color: var(--muted); }
.cal-date { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1px; }
.cal-dow { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .06em; }
.cal-day { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; white-space: nowrap; }
.cal-time { font-size: 14px; color: var(--muted); font-weight: 600; }
.cal-date .badge { margin-top: 4px; }
.cal-tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.badge-dark { background: var(--dark); color: #fff; }
/* Družstva barevně: A tmavé, B modré, C zelené, D fialové, E oranžové, ostatní šedé. Štítek na kartě i tečka na záložce. */
.badge-team { color: #fff; background: var(--dark); }
.team-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; vertical-align: 0; background: var(--dark); }
.team-a { background: var(--dark); }
.team-b { background: var(--blue); }
.team-c { background: #1c6b33; }
.team-d { background: #6d28d9; }
.team-e { background: #c2410c; }
.badge-team.team-x, .team-dot.team-x { background: var(--muted); }
.badge-next { background: var(--blue-soft); color: var(--blue-dark); }
.cal-team { display: flex; align-items: baseline; gap: 10px; font-size: 17px; font-weight: 500; line-height: 1.5; }
.cal-dh { width: 14px; font-size: 11px; font-weight: 700; color: var(--muted-2); flex: none; }
.cal-team .us { font-weight: 700; color: var(--red-dark); }
.cal-team .linklike { font-size: inherit; }
.cal-info { display: grid; gap: 2px; align-content: center; }
.cal-k { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.cal-v { font-size: 15px; margin-bottom: 8px; overflow-wrap: anywhere; }
.cal-v:last-child { margin-bottom: 0; }
.linklike-red { all: unset; cursor: pointer; color: var(--red-dark); font-weight: 700; }
.linklike-red:hover { text-decoration: underline; }
.cal-result { display: flex; flex-direction: column; align-items: center; text-align: center; }
.cal-score { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.cal-verdict { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.res-win { color: #1c6b33; }
.res-loss { color: var(--red-dark); }
.res-draw { color: var(--fg-2); }
.cal-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: 8px 0 0 8px; margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 8px 8px 0; }
/* Po akci v řádku (spustit/pozastavit čas, ukončit) se stránka vrací na ten řádek; rezerva na lištu. */
table.sheet tr[id^="g"] { scroll-margin-top: 90px; }
/* Historie změn zápisu: dlouhý seznam roluje uvnitř okna. */
.log-scroll { max-height: 60vh; overflow: auto; }
table.match-log td, table.match-log th { font-size: 12px; vertical-align: top; }
/* Tabulka soutěže ze STISu pod utkáními družstva; naše družstvo zvýrazněné. */
.standings { margin: 8px 0 18px; }
.standings-head { margin: 0 0 4px; font-size: 14px; display: flex; gap: 8px; align-items: baseline; }
.picker { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 500; }
.picker select { display: inline-block; width: auto; max-width: 22em; margin: 0; padding: 6px 10px; font-size: 14px; }
.standings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; }
.standings-grid .standings { margin: 0; }
.standings-table { margin-top: 4px; }
.standings-table td, .standings-table th { font-size: 13px; padding: 4px 8px; }
.standings-table tr.is-us td { background: var(--blue-soft); font-weight: 700; }
/* Stránka klubu: tabulka utkání pro každé družstvo. */
.team-matches-head { margin: 14px 0 6px; font-size: 15px; display: flex; gap: 8px; align-items: baseline; }
.team-matches-head:first-of-type { margin-top: 0; }
/* Kontrola proti STISu v hlavičce zápisu: zelené = shoda, červené = rozdíly. */
.btn-ok { border-color: #1c6b33; color: #1c6b33; }
.btn-bad { border-color: var(--red); color: var(--red-dark); }
table.stis-diff td, table.stis-diff th { font-size: 13px; vertical-align: top; }
/* Přehled nastavení: karta na každou sekci; oranžová = něco chybí. */
.settings-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.settings-card { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: 10px; background: var(--card); color: inherit; }
.settings-card:hover { text-decoration: none; border-color: var(--blue); box-shadow: 0 2px 8px rgba(28, 32, 39, .08); }
.settings-card.is-warn { border-left-color: #d97706; }
/* Podmenu Nastavení v hlavním menu. */
.menu-fold summary { list-style: none; cursor: pointer; padding: 9px 12px 9px 26px; border-radius: 8px; color: var(--blue-dark); font-weight: 600; font-size: 14px; }
.menu-fold summary::-webkit-details-marker { display: none; }
.menu-fold summary:hover { background: var(--blue-soft); }
.menu-list a.menu-sub2 { padding-left: 44px; font-weight: 500; }
/* Nastavení upozornění: událost = zapnuto, komu (štítky z nabídky), další adresy. */
.notify-event { border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px 10px; margin: 0 0 10px; opacity: .75; }
.notify-event.is-on { opacity: 1; border-left: 4px solid var(--blue); }
.notify-event legend label.check { margin: 0; font-size: 15px; }
.notify-event legend input { width: auto; margin: 0 6px 0 0; }
.notify-event p { margin: 2px 0 8px; }
.notify-to { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.notify-k { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.notify-to select { display: inline-block; width: auto; max-width: 20em; margin: 0; padding: 4px 8px; font-size: 13px; }
.chips { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; background: var(--blue-soft); color: var(--blue-dark); font-size: 13px; font-weight: 600; }
.chip-x { all: unset; cursor: pointer; padding: 0 3px; font-weight: 800; color: var(--muted); }
.chip-x:hover { color: var(--red); }
.notify-extra { margin: 0; font-size: 13px; }
.notify-extra textarea { min-height: 2.4em; margin-top: 2px; }
/* E-mail hráče v soupisce a v profilu: krátké pole, tlačítka vedle. */
.roster-email { white-space: nowrap; }
.roster-email form.inline input[type=email] { display: inline-block; width: 13em; margin: 0 6px 0 0; padding: 3px 6px; font-size: 12px; font-weight: 500; }
.roster-invite-all { margin: 0 0 8px; }
.email-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0 8px; }
.email-form .inline-label { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; }
.email-form input[type=email] { display: inline-block; width: 16em; margin: 0; padding: 4px 8px; font-size: 13px; }
/* Výběr klubu: vedoucí družstva rozpoznaný podle e-mailu ze STISu. */
.leader-box { border-left: 4px solid var(--blue); }
.leader-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--border-row); }
.invite-list li { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 4px 0; border-bottom: 1px solid var(--border-row); }
.invite-list li form { margin-left: auto; }
.cal-note { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: #fbf6ee; font-size: 14px; color: var(--fg-2); display: grid; gap: 2px; }
.cal-note .linklike-red { margin-left: 4px; }
[data-cal-list].hide-played .cal-card.played { display: none; }
@media (max-width: 900px) {
    .cal-card { grid-template-columns: 70px 1fr; gap: 10px 14px; }
    .cal-info, .cal-result, .cal-actions { grid-column: 2; }
    .cal-result { flex-direction: row; gap: 8px; align-items: baseline; }
    .cal-actions { align-items: flex-start; }
    .cal-cards { padding: 0 14px; }
}
table.fixtures td, table.fixtures th { font-size: 13px; }
table.fixtures .cal-month td { background: var(--soft-2); font-weight: 700; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
table.fixtures tr.played td { color: var(--muted); }
table.fixtures .us { font-weight: 700; color: var(--red-dark); }
table.fixtures .nowrap { white-space: nowrap; }
