/* Kulečník DK – styl */
:root {
    --felt: #0d3b2e;
    --felt-2: #145a43;
    --felt-3: #1d7a5b;
    --brass: #c9a227;
    --red: #b8372b;
    --bg: #f4f2ec;
    --surface: #ffffff;
    --surface-2: #f8f7f3;
    --ink: #1b2420;
    --ink-2: #4c5a54;
    --muted: #7b8782;
    --line: #e3e0d7;
    --win: #146c4c;
    --win-bg: #e3f2ea;
    --draw-bg: #f1ecd9;
    --loss-bg: #f6e2df;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(20, 30, 25, .06), 0 4px 16px rgba(20, 30, 25, .05);
    --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f1513;
        --surface: #17201c;
        --surface-2: #1c2722;
        --ink: #e7ece9;
        --ink-2: #b6c2bc;
        --muted: #84928b;
        --line: #2a3631;
        --win: #5fd1a0;
        --win-bg: #173a2c;
        --draw-bg: #3a3420;
        --loss-bg: #3d2320;
        --felt-3: #3fae84;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3);
        color-scheme: dark;
    }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font: 16px/1.55 var(--font);
    background: var(--bg);
    color: var(--ink);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
a { color: var(--felt-3); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.main { flex: 1; padding-top: 28px; padding-bottom: 48px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.strong { font-weight: 600; }

/* ---------- hlavička ---------- */
.site-header {
    background:
        radial-gradient(ellipse at 20% 0%, rgba(255, 255, 255, .09), transparent 60%),
        linear-gradient(180deg, var(--felt-2), var(--felt));
    color: #fff;
    border-bottom: 4px solid #5a3a1e;
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .08);
}
.header-inner { display: flex; align-items: center; gap: 24px; min-height: 76px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand-ball { width: 40px; height: 40px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1.3rem; letter-spacing: .01em; }
.brand-text small { font-size: .78rem; opacity: .75; }
.site-nav { display: flex; gap: 4px; margin-left: auto; }
.site-nav a {
    color: rgba(255, 255, 255, .85);
    padding: 8px 14px;
    border-radius: 999px;
    font-weight: 500;
}
.site-nav a:hover { background: rgba(255, 255, 255, .1); text-decoration: none; color: #fff; }
.site-nav a.active { background: rgba(255, 255, 255, .16); color: #fff; box-shadow: inset 0 -2px 0 var(--brass); }
.nav-toggle, .nav-button { display: none; }

@media (max-width: 760px) {
    .header-inner { min-height: 64px; gap: 0; }
    .brand-ball { width: 34px; height: 34px; }
    .brand-text strong { font-size: 1.15rem; }
    .nav-button {
        display: block; margin-left: auto; width: 44px; height: 44px; cursor: pointer; position: relative;
    }
    .nav-button span, .nav-button span::before, .nav-button span::after {
        position: absolute; left: 11px; width: 22px; height: 2px; background: #fff; content: ""; transition: .2s;
    }
    .nav-button span { top: 21px; }
    .nav-button span::before { left: 0; top: -7px; }
    .nav-button span::after { left: 0; top: 7px; }
    .nav-toggle:checked + .nav-button span { background: transparent; }
    .nav-toggle:checked + .nav-button span::before { top: 0; transform: rotate(45deg); }
    .nav-toggle:checked + .nav-button span::after { top: 0; transform: rotate(-45deg); }
    .site-nav { display: none; width: 100%; flex-direction: column; padding: 8px 0 14px; }
    .nav-toggle:checked ~ .site-nav { display: flex; }
    .site-nav a { border-radius: 10px; }
}

/* ---------- admin lišta ---------- */
.admin-bar { background: #1b2420; color: #fff; font-size: .9rem; }
.admin-bar .wrap { display: flex; gap: 4px; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; }
.admin-bar a { color: #cfd8d3; padding: 6px 12px; border-radius: 8px; }
.admin-bar a.active, .admin-bar a:hover { background: rgba(255, 255, 255, .1); color: #fff; text-decoration: none; }
.admin-bar .logout { margin-left: auto; }

/* ---------- patička ---------- */
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.footer-inner { display: flex; gap: 8px 24px; flex-wrap: wrap; padding-top: 20px; padding-bottom: 24px; }
.footer-admin { margin-left: auto; color: var(--muted); }

/* ---------- obecné prvky ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
}
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.card-head h2 { font-size: 1.05rem; margin: 0; }
.card-head a { font-size: .85rem; }
.empty { text-align: center; color: var(--ink-2); padding: 32px 20px; }
.empty.big { padding: 56px 20px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 20px; }
.page-title { font-size: 1.75rem; margin: 0; letter-spacing: -.01em; }
.page-title span { color: var(--muted); font-weight: 500; }
.section-title { font-size: 1.15rem; margin: 28px 0 12px; }
.note { color: var(--muted); font-size: .85rem; margin-top: 12px; }
.crumbs { margin: 0 0 14px; font-size: .9rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; margin: -6px 0 14px; font-size: .9rem; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--felt-2); }

/* přepínač sezón */
.season-nav { display: flex; align-items: center; gap: 6px; }
.season-nav form { margin: 0; }
.season-nav select, input, select, textarea, button { font: inherit; }
.season-nav select {
    padding: 8px 34px 8px 14px; border: 1px solid var(--line); border-radius: 999px;
    background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%237b8782' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 14px center;
    color: var(--ink); appearance: none; cursor: pointer; font-weight: 500;
}
.sn-prev, .sn-next {
    display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
    border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 1.3rem; line-height: 1;
}
.sn-prev:hover, .sn-next:hover { text-decoration: none; border-color: var(--felt-3); color: var(--felt-3); }
.disabled { opacity: .35; pointer-events: none; }

/* ---------- tabulky ---------- */
.table-card { padding: 0; overflow: hidden; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.data th {
    text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em;
    color: var(--muted); font-weight: 600; padding: 12px 14px; border-bottom: 1px solid var(--line);
    background: var(--surface-2); white-space: nowrap;
}
table.data td { padding: 11px 14px; border-bottom: 1px solid var(--line); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: var(--surface-2); }
table.data tr.current td { background: var(--win-bg); }
table.data .r { text-align: right; }
table.data .c { text-align: center; }
table.data td.win, table.data tr.win td { font-weight: 700; }
table.data td.win a, table.data tr.win td a { color: var(--win); }
table.compact th { padding: 8px 10px; }
table.compact td { padding: 8px 10px; font-size: .92rem; }
.card > table.compact { margin: 0 -20px -20px; width: calc(100% + 40px); }
.card > table.compact th:first-child, .card > table.compact td:first-child { padding-left: 20px; }
.card > table.compact th:last-child, .card > table.compact td:last-child { padding-right: 20px; }
.sortable th[data-sort] { cursor: pointer; user-select: none; }
.sortable th[data-sort]:hover { color: var(--ink); }
.sortable th.sorted-asc::after { content: " ▲"; font-size: .65rem; }
.sortable th.sorted-desc::after { content: " ▼"; font-size: .65rem; }
tr.filtered { display: none; }
@media (max-width: 640px) {
    .hide-sm { display: none; }
    table.data th, table.data td { padding: 9px 8px; }
    table.data th { font-size: .68rem; letter-spacing: .03em; }
    .page-title { font-size: 1.45rem; }
}
@media (max-width: 480px) { .hide-xs { display: none; } }

.rank {
    display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 50%;
    font-size: .8rem; font-weight: 700; color: var(--ink-2); background: var(--surface-2);
}
.rank-1 { background: #e9c84a; color: #4a3a00; }
.rank-2 { background: #cfd4d8; color: #2f3a42; }
.rank-3 { background: #d9a06b; color: #4a2a0e; }
.points { display: inline-block; min-width: 34px; padding: 2px 8px; border-radius: 8px; background: var(--felt-2); color: #fff; font-weight: 700; text-align: center; }
.score-pill {
    display: inline-block; padding: 3px 12px; border-radius: 999px; background: var(--surface-2);
    border: 1px solid var(--line); color: var(--ink); font-weight: 700; letter-spacing: .03em;
}
.score-pill:hover { border-color: var(--felt-3); text-decoration: none; }
.res { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; font-weight: 700; font-size: .8rem; }
.res-2 { background: var(--win-bg); color: var(--win); }
.res-1 { background: var(--draw-bg); color: #8a6d12; }
.res-0 { background: var(--loss-bg); color: var(--red); }
.hl { background: var(--brass); color: #2b2100; padding: 1px 7px; border-radius: 6px; font-weight: 700; }

/* ---------- úvod ---------- */
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
.home-grid .page-title { margin-bottom: 16px; }
@media (max-width: 900px) { .home-grid { grid-template-columns: 1fr; } }
.news-item time, .prose-card time { color: var(--muted); font-size: .85rem; }
.news-item h2 { font-size: 1.25rem; margin: 4px 0 8px; }
.news-item h2 a { color: var(--ink); }
.news-item p { margin: 0 0 10px; color: var(--ink-2); }
.news-thumb { display: block; width: 100%; max-height: 260px; object-fit: cover; border-radius: 10px; margin: 10px 0 12px; }
.more { font-weight: 600; font-size: .9rem; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; }
.sidebar { position: sticky; top: 16px; }
@media (max-width: 900px) { .sidebar { position: static; } }
.match-list { list-style: none; margin: 0 -20px -20px; padding: 0; }
.match-list li { border-top: 1px solid var(--line); }
.match-list li.muted { padding: 12px 20px; }
.match-list a {
    display: grid; grid-template-columns: 1fr auto 1fr; grid-template-rows: auto auto;
    gap: 0 10px; padding: 10px 20px; color: var(--ink); align-items: center;
}
.match-list a:hover { background: var(--surface-2); text-decoration: none; }
.ml-date { grid-column: 1 / -1; font-size: .75rem; color: var(--muted); }
.ml-team { text-align: right; font-size: .92rem; }
.ml-team.away { text-align: left; }
.ml-team.win { font-weight: 700; color: var(--win); }
.ml-score { font-weight: 700; padding: 1px 10px; background: var(--surface-2); border-radius: 999px; font-variant-numeric: tabular-nums; }

/* ---------- dlaždice ---------- */
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.tile span { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.tile strong { display: block; font-size: 1.6rem; font-variant-numeric: tabular-nums; margin-top: 2px; }
.tile strong.small { font-size: 1.15rem; padding-top: 6px; }
.tile.accent { background: linear-gradient(160deg, var(--felt-2), var(--felt)); border-color: transparent; color: #fff; }
.tile.accent span { color: rgba(255, 255, 255, .7); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
@media (max-width: 820px) { .two-col { grid-template-columns: 1fr; } }

/* ---------- detail zápasu ---------- */
.scoreboard {
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; text-align: center;
    background: linear-gradient(170deg, var(--felt-2), var(--felt)); color: #fff; border: 0; padding: 28px 20px;
}
.scoreboard a { color: #fff; }
.sb-team h2 { font-size: 1.35rem; margin: 0 0 4px; }
.sb-team span { font-size: .85rem; opacity: .75; }
.sb-team.win h2 a { color: #f4d667; }
.sb-score strong { display: block; font-size: 3rem; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.sb-score i { font-style: normal; opacity: .5; padding: 0 4px; }
.sb-score time { display: block; margin-top: 6px; font-size: .85rem; opacity: .75; }
@media (max-width: 560px) {
    .scoreboard { grid-template-columns: 1fr 1fr; }
    .sb-score { grid-column: 1 / -1; order: -1; }
    .sb-team h2 { font-size: 1.1rem; }
}
.games { display: flex; flex-direction: column; gap: 14px; }
.games .card + .card { margin-top: 0; }
.game header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.game header h3 { margin: 0; font-size: 1.05rem; }
.runs {
    display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 14px; border-radius: 999px;
    background: var(--felt-2); color: #fff; font-size: .85rem;
}
.runs strong { font-size: 1.3rem; line-height: 1; font-variant-numeric: tabular-nums; }
.game-table th:first-child { width: 46%; }

/* ---------- text ---------- */
.prose-card { max-width: 820px; }
.prose-card h1 { font-size: 1.8rem; margin-top: 4px; }
.prose { color: var(--ink); }
.prose h2 { font-size: 1.3rem; margin-top: 1.6em; }
.prose h3 { font-size: 1.1rem; margin-top: 1.3em; }
.prose img { max-width: 100%; height: auto; border-radius: 10px; display: block; margin: 1em 0; }
.prose figure { margin: 1.2em 0; }
.prose figcaption { font-size: .85rem; color: var(--muted); margin-top: -.5em; }
.prose table { border-collapse: collapse; width: 100%; }
.prose td, .prose th { border: 1px solid var(--line); padding: 6px 10px; }
.prose li { margin: .25em 0; }

/* ---------- formuláře (admin) ---------- */
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-weight: 500; }
.flash-ok { background: var(--win-bg); color: var(--win); }
.flash-err { background: var(--loss-bg); color: var(--red); }
.flash-warn { background: var(--draw-bg); color: #7a5f0a; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px 16px; }
.field label { display: block; font-size: .8rem; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.field input, .field select, .field textarea {
    width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px;
    background: var(--surface); color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--felt-3); outline-offset: -1px; border-color: transparent; }
.field textarea { min-height: 360px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9rem; line-height: 1.5; }
.field .hint { font-size: .78rem; color: var(--muted); margin-top: 4px; }
.btn {
    display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 10px; border: 1px solid transparent;
    background: var(--felt-2); color: #fff; font-weight: 600; cursor: pointer;
}
.btn:hover { background: var(--felt); text-decoration: none; }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.secondary:hover { border-color: var(--felt-3); }
.btn.danger { background: transparent; color: var(--red); border-color: var(--loss-bg); }
.btn.danger:hover { background: var(--loss-bg); }
.btn.small { padding: 5px 10px; font-size: .85rem; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 20px; }
.inline { display: inline; }
.game-input { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-top: 14px; }
.game-input legend { font-weight: 700; padding: 0 6px; }
.game-grid { display: grid; grid-template-columns: 110px 1fr 1fr; gap: 12px; align-items: start; }
.player-box { display: grid; grid-template-columns: 1fr 90px 90px; gap: 8px; background: var(--surface-2); border-radius: 10px; padding: 10px; }
.player-box .field:first-child { grid-column: 1 / -1; }
.player-box .avg { grid-column: 1 / -1; font-size: .8rem; color: var(--muted); }
@media (max-width: 760px) { .game-grid { grid-template-columns: 1fr; } }
.summary-bar {
    position: sticky; bottom: 0; margin-top: 20px; background: var(--surface); border: 1px solid var(--line);
    border-radius: 12px; padding: 12px 16px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; box-shadow: 0 -4px 20px rgba(0, 0, 0, .06);
}
.summary-bar .big { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.dash-grid .card + .card { margin-top: 0; }
.dash-grid .card h2 { font-size: 1.05rem; }
.dash-grid .card p { color: var(--ink-2); margin: 0 0 14px; font-size: .92rem; }
.login-card { max-width: 400px; margin: 40px auto; }
.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.roster .card + .card { margin-top: 0; }
.roster ul { list-style: none; margin: 0; padding: 0; }
.roster li { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.roster li:last-child { border-bottom: 0; }
.roster li button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1.1rem; padding: 0 4px; }
.roster li button:hover { color: var(--red); }
code { background: var(--surface-2); padding: 2px 6px; border-radius: 5px; font-size: .88em; word-break: break-all; }

/* nahrávání obrázků */
.editor-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.image-list { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.image-list img { width: 84px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; }
.badge-warn { display: inline-block; padding: 2px 10px; border-radius: 7px; background: var(--loss-bg); color: var(--red); font-weight: 700; font-size: .85rem; }

/* ---------- kontrola SQL ---------- */
.admin-bar .sql-toggle { margin: 0 0 0 auto; }
.admin-bar .sql-toggle + .logout { margin-left: 0; }
.sql-toggle button {
    display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; color: #cfd8d3;
    padding: 6px 12px; border-radius: 8px; cursor: pointer; font: inherit;
}
.sql-toggle button:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.sql-toggle .switch { width: 30px; height: 17px; border-radius: 999px; background: #4a5551; position: relative; transition: .2s; }
.sql-toggle .switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: #fff; transition: .2s; }
.sql-toggle button.on { color: #fff; }
.sql-toggle button.on .switch { background: var(--brass); }
.sql-toggle button.on .switch::after { left: 15px; }
.sql-panel { border-top: 4px solid var(--brass); }
.sql-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.sql-head h1 { font-size: 1.4rem; margin: 0 0 4px; }
.sql-head p { margin: 0; }
.sql-badge { background: var(--draw-bg); color: #7a5f0a; font-weight: 700; font-size: .8rem; padding: 4px 10px; border-radius: 999px; }
.sql-list { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.sql-meta { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); margin-bottom: 3px; }
pre.sql {
    margin: 0; padding: 12px 14px; border-radius: 10px; background: #111916; color: #d7e2dc;
    font: .85rem/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-word;
}
pre.sql b { color: #f0c85a; font-weight: 600; }
pre.sql i { color: #8fd6ae; font-style: normal; }
.sql-done { margin-top: 8px; font-weight: 400; }
.sql-done summary { cursor: pointer; font-size: .85rem; }
.sql-done pre.sql { margin-top: 6px; }
@media (max-width: 760px) { .admin-bar .sql-toggle { margin-left: 0; } }
.sql-failed pre.sql { outline: 2px solid var(--red); }
.sql-failed .sql-meta span:last-child { color: var(--red); font-weight: 700; }

/* ---------- LIVE: veřejný panel ---------- */
.live-panel { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--red); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 20px; margin-bottom: 28px; }
.live-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.live-head strong { color: var(--red); letter-spacing: .12em; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.live-dot.on { background: var(--red); box-shadow: 0 0 0 0 rgba(184, 55, 43, .6); animation: livepulse 1.6s infinite; }
@keyframes livepulse { 0% { box-shadow: 0 0 0 0 rgba(184, 55, 43, .55); } 70% { box-shadow: 0 0 0 10px rgba(184, 55, 43, 0); } 100% { box-shadow: 0 0 0 0 rgba(184, 55, 43, 0); } }
@media (prefers-reduced-motion: reduce) { .live-dot.on { animation: none; } }
.live-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 14px; }
.live-game { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface-2); }
.lg-match { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: .9rem; margin-bottom: 8px; }
.lg-player { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; align-items: center; column-gap: 12px; padding: 8px 10px; border-radius: 10px; border-left: 4px solid transparent; }
.lg-player + .lg-player { margin-top: 4px; }
.lg-player.at-table { background: var(--surface); border-left-color: var(--brass); }
.lg-player.winner .lg-name { color: var(--win); font-weight: 700; }
.lg-name { font-weight: 600; }
.lg-name small { color: var(--muted); font-weight: 400; margin-left: 4px; }
.lg-meta { grid-row: 2; font-size: .78rem; color: var(--muted); }
.lg-points { grid-row: 1 / span 2; grid-column: 2; font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.lg-foot { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: .85rem; color: var(--ink-2); margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.lg-innings { margin-top: 8px; font-size: .85rem; }
.lg-innings summary { cursor: pointer; color: var(--muted); }
table.innings th, table.innings td { padding: 4px 6px; font-size: .8rem; }
table.innings td:first-child { font-weight: 600; }

/* ---------- LIVE: ovládání ve správě ---------- */
.live-control { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; transition: opacity .15s; }
#live-control.busy .live-control { opacity: .85; }
.lc-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.lc-inning { font-size: 1.1rem; background: var(--felt-2); color: #fff; padding: 4px 14px; border-radius: 999px; }
.lc-inning strong { font-size: 1.4rem; }
.lc-players { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lc-player { border: 2px solid var(--line); border-radius: 14px; padding: 14px; text-align: center; position: relative; }
.lc-player.at-table { border-color: var(--brass); background: linear-gradient(180deg, rgba(201, 162, 39, .12), transparent 70%); }
.lc-name { font-weight: 700; font-size: 1.05rem; }
.lc-name small { display: block; font-weight: 400; color: var(--muted); font-size: .75rem; }
.lc-points { font-size: 3.4rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.lc-points small { font-size: 1rem; color: var(--muted); font-weight: 500; }
.lc-meta { font-size: .8rem; color: var(--muted); }
.lc-series { display: block; font-size: 1rem; color: var(--ink); font-weight: 700; margin-bottom: 2px; }
.lc-at { display: inline-block; margin-top: 8px; font-size: .72rem; color: #6b5409; background: rgba(201, 162, 39, .25); padding: 2px 10px; border-radius: 999px; font-weight: 700; }
.lc-buttons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 16px; }
.lc-buttons form, .lc-buttons button { width: 100%; }
.lc-add, .lc-end {
    font: inherit; font-weight: 800; border: 0; border-radius: 14px; cursor: pointer; padding: 18px 0;
    background: var(--felt-2); color: #fff; font-size: 1.6rem; touch-action: manipulation;
}
.lc-add:active, .lc-end:active { transform: scale(.97); }
.lc-add:disabled { background: var(--line); color: var(--muted); cursor: not-allowed; }
.lc-second { grid-template-columns: 1fr; }
.lc-end { background: var(--brass); color: #2b2100; font-size: 1.15rem; padding: 16px 0; }
.lc-tools { margin-top: 12px; display: flex; justify-content: flex-end; }
.lc-finished { margin-top: 16px; }
.lc-save { margin-top: 10px; }
.live-control .innings { margin-top: 16px; }
.live-card { display: flex; flex-direction: column; gap: 4px; color: var(--ink); }
.live-card:hover { text-decoration: none; border-color: var(--felt-3); }
.lc-mini { font-size: 1.05rem; margin-top: 4px; }
.live-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1b2420; color: #fff; padding: 10px 18px; border-radius: 10px; z-index: 50; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
@media (max-width: 560px) {
    .admin-bar .wrap { gap: 0; padding-top: 4px; padding-bottom: 4px; }
    .admin-bar a, .sql-toggle button { padding: 5px 8px; font-size: .85rem; }
    .lc-points { font-size: 2.6rem; }
    .lc-players { gap: 8px; }
    .lc-player { padding: 10px 6px; }
    .lc-buttons { gap: 8px; }
    .lc-add { font-size: 1.35rem; padding: 16px 0; }
}

/* LIVE – dohrané partie sbalené na jeden řádek */
.live-done-list { display: flex; flex-direction: column; gap: 6px; }
.live-games + .live-done-list { margin-top: 14px; }
.live-done { border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.live-done > summary {
    display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer;
    list-style: none; font-size: .9rem; white-space: nowrap; min-width: 0;
}
.live-done > summary::-webkit-details-marker { display: none; }
.live-done > summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform .15s; flex: none; }
.live-done[open] > summary::after { transform: rotate(180deg); }
.ld-state { color: var(--win); font-weight: 700; flex: none; }
.ld-game { font-weight: 600; flex: none; }
.ld-match { color: var(--muted); flex: none; }
.ld-score { display: flex; gap: 6px; align-items: baseline; min-width: 0; }
.ld-score > span { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ld-score b { font-variant-numeric: tabular-nums; padding: 0 6px; background: var(--surface); border-radius: 6px; flex: none; }
.ld-score .win { font-weight: 700; color: var(--win); }
.ld-runs { flex: none; }
@media (max-width: 760px) { .ld-match { display: none; } }
@media (max-width: 420px) { .ld-runs { display: none; } .ld-game { font-weight: 700; } .live-done > summary { gap: 8px; padding: 8px 10px; } }
.live-done .live-game { border: 0; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; }
@media (max-width: 560px) { .ld-long { display: none; } }

/* LIVE – zřetelné oddělení hrané a odehraných partií */
.live-game.status-live { position: relative; border: 2px solid rgba(184, 55, 43, .45); background: var(--surface); box-shadow: 0 2px 10px rgba(184, 55, 43, .08); padding-top: 26px; }
.lg-badge {
    position: absolute; top: -1px; left: 14px; transform: translateY(-50%);
    background: var(--red); color: #fff; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    padding: 3px 10px; border-radius: 999px;
}
.live-games { padding-top: 8px; }
.live-games + .live-done-list { margin-top: 22px; padding-top: 16px; border-top: 1px dashed var(--line); }
.ld-title {
    display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: .78rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
}
.ld-title span { background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; font-size: .75rem; color: var(--ink-2); }
.live-done { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--win); border-radius: 10px; }
.live-done > summary:hover { background: var(--surface-2); border-radius: 0 10px 10px 0; }
.live-done[open] { box-shadow: var(--shadow); }
.live-done .live-game { background: var(--surface-2); }
.live-done .ld-score b { background: var(--surface-2); border: 1px solid var(--line); }

/* LIVE – stav utkání v hlavičce (datum nad týmy, výrazně) */
.lh-match {
    display: grid; grid-template-columns: 1fr auto 1fr; grid-template-areas: "date date date" "teams teams teams" "kind kind kind";
    justify-items: center; gap: 6px; margin: 0 0 18px; padding: 14px 16px 16px; border-radius: 14px; color: #fff;
    background: radial-gradient(ellipse at 30% 0%, rgba(255, 255, 255, .1), transparent 60%), linear-gradient(170deg, var(--felt-2), var(--felt));
}
.lh-date { grid-area: date; font-size: 1rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #f4d667; }
.lh-teams { grid-area: teams; display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; text-align: center; }
.lh-team { font-size: 1.6rem; font-weight: 800; line-height: 1.15; }
.lh-score {
    font-size: 1.9rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; padding: 6px 16px; border-radius: 12px;
    background: #fff; color: var(--felt);
}
.lh-kind {
    grid-area: kind; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
    padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, .16); color: #fff;
}
.lh-kind.final { background: #f4d667; color: #3a2d00; }
@media (max-width: 560px) {
    .lh-team { font-size: 1.25rem; }
    .lh-score { font-size: 1.5rem; padding: 5px 12px; }
    .lh-teams { gap: 10px; }
    .lh-date { font-size: .9rem; }
}

/* ---------- úprava zápasu ---------- */
.static { padding: 9px 0; }
.big-score { font-size: 1.4rem; font-weight: 800; font-variant-numeric: tabular-nums; padding: 4px 0; }
.manual-score summary, .gs-edit summary { cursor: pointer; color: var(--felt-3); font-weight: 600; font-size: .9rem; }
.game-slot { border-left: 4px solid var(--win); }
.game-slot.missing { border-left-color: var(--brass); background: linear-gradient(180deg, rgba(201, 162, 39, .07), transparent 120px), var(--surface); }
.gs-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.gs-head h3 { margin: 0; font-size: 1.05rem; }
.gs-missing { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 2px 8px; border-radius: 999px; background: var(--draw-bg); color: #7a5f0a; }
.game-slot .lh-kind { background: var(--loss-bg); color: var(--red); }
.gs-edit { margin-top: 12px; }
.gs-edit .game-edit { margin-top: 10px; }
.gs-delete { margin-top: 10px; text-align: right; }
.card > table.data.compact + .gs-edit { margin-top: 30px; }
