/* Publisko lapu attēlošanas iestatījumi un pieejamība. */
.skip-link { position: fixed; z-index: 150; left: 12px; top: -100px; padding: 12px 18px; border-radius: 8px; background: #fff; color: #163572; font-weight: 700; }
.skip-link:focus { top: 12px; }
.initial-content { max-width: 1132px; margin: 24px auto; padding: 24px; background: var(--paper); border-radius: 14px; }
body.pub, body.stats-page { --f-d: Inter, system-ui, sans-serif; }
body.stats-page > .pfoot-s { padding: 16px 20px 28px; text-align: center; color: var(--mute); font-size: 12px; line-height: 1.8; }
body.stats-page > .pfoot-s a { color: var(--blue); }
.display-settings { display: grid; place-items: center; flex-shrink: 0; width: 44px; height: 44px; border: 1px solid #6986bd; border-radius: 8px; color: #fff; }
.display-settings:hover { background: #173572; }
.display-dialog { width: min(420px, calc(100% - 24px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); color: var(--ink); }
.display-dialog::backdrop { background: #101b3099; }
.display-dialog > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; background: #1e408a; color: #fff; }
.display-dialog h2 { font-size: 18px; }
.display-dialog header button { width: 44px; height: 44px; color: #fff; font-size: 28px; border-radius: 7px; }
.display-controls { display: grid; gap: 10px; padding: 20px; }
.display-controls label { font-size: 14px; font-weight: 600; }
.display-controls select { width: 100%; }
.display-controls p { font-size: 13px; color: var(--mute); line-height: 1.6; }
.display-controls .btn { white-space: normal; }
.network-banner, .site-update { position: fixed; z-index: 70; left: 12px; right: 12px; bottom: calc(82px + env(safe-area-inset-bottom, 0px)); width: fit-content; max-width: calc(100% - 24px); margin: 0 auto; border: 1px solid #b28734; border-radius: 9px; padding: 10px 14px; background: #fff1d6; color: #694100; font: 600 12px/1.5 Inter, system-ui, sans-serif; box-shadow: 0 4px 18px #101b3020; }
.network-banner[hidden] { display: none; }
.site-update { bottom: calc(132px + env(safe-area-inset-bottom, 0px)); min-height: 44px; background: #e8effd; color: #1e408a; border-color: #6986bd; }
body.pub :focus-visible, body.stats-page :focus-visible { outline: 3px solid #2860d8; outline-offset: 3px; scroll-margin: 100px 16px; }
body.pub .pub-header :focus-visible, .analysis-header :focus-visible, .participants-header :focus-visible, .display-dialog header :focus-visible { outline-color: #dce7ff; }
#stats .tb th button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 6px; color: inherit; border: 0; background: transparent; font: inherit; font-weight: 600; cursor: pointer; }
#stats .tb th[aria-sort] button:focus-visible { outline-color: #fff; outline-offset: -2px; }
.xwrap:focus-visible, #stats .xw:focus-visible { outline-offset: -3px; }
html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }
html[data-theme="dark"], html[data-theme="dark"] #stats {
  --bg: #101827; --paper: #182438; --ink: #eef3fb; --mute: #b2c0d4; --line: #3a4b64;
  --sky: #243859; --surface-blue: #1e2e48; --surface-selected: #2e4467;
  --navy: #b1c9ff; --blue: #9bbcff; --on-navy: #dce7ff;
  --ok: #a5e9c4; --okbg: #173e31; --bad: #ffb4c2; --badbg: #492738; --warn: #ffda91; --warnbg: #493b21;
}
html[data-theme="dark"] body.pub, html[data-theme="dark"] body.stats-page { background: var(--bg); color: var(--ink); }
html[data-theme="dark"] :is(.pub-header, .pub-t > div, .analysis-header, .participants-header, .display-dialog > header),
html[data-theme="dark"] #stats .st-head,
html[data-theme="dark"] body.pub :is(.me-card .now, .minibar, .tournament-current),
html[data-theme="dark"] .match-table-players { background: #182d50; color: #fff; border-color: #5275b5; }
html[data-theme="dark"] body.pub :is(.card, .tbl, .queue, .xwrap),
html[data-theme="dark"] #stats :is(.card, .tile, .pd, .xw),
html[data-theme="dark"] :is(.match-table, .participants-dialog, .match-dialog, .evening-dialog, .display-dialog) { background: var(--paper); border-color: var(--line); color: var(--ink); }
html[data-theme="dark"] body.pub :is(.participant-launcher, .gsum),
html[data-theme="dark"] #stats :is(.tile, .pd1, .hero),
html[data-theme="dark"] :is(.match-table.is-mine, .analysis-players, .evening-route-stage > summary, .evening-summary) { background: var(--sky); border-color: var(--line); }
html[data-theme="dark"] body.pub .tournament-current { background: #182d50; color: #fff; border-color: #5275b5; }
html[data-theme="dark"] body.pub .tournament-personal { background: var(--sky); }
html[data-theme="dark"] :is(.participant-detail-grid, .analysis-method, .analysis-forecast, .evening-route-note, .evening-points > div, .match-table-idle) { background: var(--surface-blue); border-color: var(--line); }
html[data-theme="dark"] .match-table-players { background: #182d50; }
html[data-theme="dark"] body.pub :is(.btn, .match-table-state),
html[data-theme="dark"] #stats .btn,
html[data-theme="dark"] :is(.analysis-tabs button[aria-pressed="true"], .pubtabs button[aria-pressed="true"]),
html[data-theme="dark"] #stats .st-tabs a[aria-current="page"] { background: var(--blue); color: #102343; }
html[data-theme="dark"] body.pub .btn.ghost, html[data-theme="dark"] #stats .btn.ghost { background: var(--sky); color: var(--navy); border-color: var(--line); }
html[data-theme="dark"] body.pub .pubtabs button[aria-pressed="true"],
html[data-theme="dark"] #stats .st-tabs a[aria-current="page"]:hover { background: var(--blue); color: #102343; }
html[data-theme="dark"] .pub-header .appsw a[aria-current="page"] { background: var(--blue); color: #102343; }
html[data-theme="dark"] body.pub .tag.live { background: #9f2440; color: #fff; }
html[data-theme="dark"] body.pub :is(input:not([type="checkbox"]), select),
html[data-theme="dark"] #stats :is(input[type="search"], select) { background: #121e31; color: var(--ink); border-color: #6b809f; }
html[data-theme="dark"] :is(input, select)::placeholder { color: var(--mute); opacity: 1; }
html[data-theme="dark"] body.pub :is(.rt td.xn, .rt td:first-child, .xt td.xn),
html[data-theme="dark"] #stats #st-rt :is(td:first-child, td.l) { background: var(--paper); color: var(--ink); }
html[data-theme="dark"] body.pub :is(.xt thead th, .rt thead th, .rt th.xn, .rt thead th:first-child),
html[data-theme="dark"] #stats :is(.tb thead th, #st-rt thead th:first-child, #st-rt thead th.l) { background: #182d50; color: #fff; border-color: #5275b5; }
html[data-theme="dark"] body.pub .rt tbody tr:nth-child(-n+3) td:first-child,
html[data-theme="dark"] #stats #st-rt tbody tr:nth-child(-n+3) td:first-child { background: var(--surface-selected); color: var(--ink); }
html[data-theme="dark"] body.pub .xt tr.me td, html[data-theme="dark"] body.pub .rt tr.me td { background: var(--surface-selected) !important; }
html[data-theme="dark"] #stats :is(.kom .w, .xw1) { background: var(--okbg); color: var(--ok); }
html[data-theme="dark"] #stats .xl1 { background: var(--badbg); color: var(--bad); }
html[data-theme="dark"] #stats .xd { background: #243149; }
html[data-theme="dark"] #stats .lv { background: var(--sky); color: var(--ink); }
html[data-theme="dark"] #stats .rk { background: var(--sky); color: var(--ink); }
html[data-theme="dark"] #stats .chart .grid { stroke: var(--line); }
html[data-theme="dark"] #stats .chart :is(.ax, .val) { fill: var(--mute); }
html[data-theme="dark"] #stats .chart .area { fill: #9bbcff20; }
html[data-theme="dark"] .analysis-probability-bar { background: #314765; }
html[data-theme="dark"] .match-table-open { background: var(--sky); border-color: var(--line); }
html[data-theme="dark"] :is(.match-table.is-idle .match-table-state, .participant-row > summary:hover) { background: var(--sky); color: var(--ink); }
html[data-theme="dark"] .consent { background: var(--paper); color: var(--ink); border-color: var(--line); }
html[data-theme="dark"] .consent p { color: var(--mute); }
html[data-theme="dark"] .consent a { color: var(--blue); }
html[data-theme="dark"] body.pub :focus-visible, html[data-theme="dark"] body.stats-page :focus-visible { outline-color: #a9c7ff; }

/* Lielais teksts saglabā divas galdu kolonnas, bet dod vairāk vietas saturam. */
html[data-text="large"] body.pub, html[data-text="large"] body.stats-page, html[data-text="large"] #stats { font-size: 18px; line-height: 1.6; }
html[data-text="large"] :is(.card p, .muted, .scroll-hint, .pfoot, .pfoot-s, .participant-name small, .participant-metric small, .participant-detail p, .participants-footer, .analysis-content p, .analysis-data-date, .evening-content p, .evening-match small, .tournament-row-info > small) { font-size: 15px !important; }
html[data-text="large"] :is(.btn, .chip, .pubtabs button, .analysis-tabs button), html[data-text="large"] #stats .st-tabs a { font-size: 15px !important; min-height: 48px; white-space: normal; }
html[data-text="large"] body.pub :is(.xt, .rt), html[data-text="large"] #stats :is(.tb td, .tb th), html[data-text="large"] .analysis-comparison-row { font-size: 17px; }
html[data-text="large"] .match-table-players > div > span { font-size: 18px; }
html[data-text="large"] .match-table-players small { font-size: 14px; }
html[data-text="large"] .match-table-players > div > b { font-size: 16px; }
html[data-text="large"] :is(.participant-name > b, .participant-metric > b, .evening-match > div > b) { font-size: 17px; }
html[data-text="large"] #stats :is(.tile span, .tile em, h2 small) { font-size: 15px; }
html[data-text="large"] #stats .chart .ax { font-size: 14px; }
html[data-text="large"] :is(.match-table-state, .match-table-meta, .match-table-probability small, .match-table-open, .evening-opponent-metrics small) { font-size: 13px; }
html[data-text="large"] :is(.participant-row > summary, .analysis-comparison-row, .evening-match) { row-gap: 14px; }
html[data-text="large"] body.pub { padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px)); }
html[data-text="large"] body.pub .match-table-meta .tm { font-size: 13px; }
html[data-text="large"] .network-banner { bottom: calc(112px + env(safe-area-inset-bottom, 0px)); }
html[data-text="large"] .site-update { bottom: calc(162px + env(safe-area-inset-bottom, 0px)); }
@media (max-width: 440px) {
  .pub-header .top-in { padding-inline: 10px; gap: 6px; }
  .pub-header .logo-img { width: 28px; height: 28px; }
  .display-settings { width: 40px; }
  .pub-header .appsw a { padding-inline: 6px; font-size: 12px; }
  .pub-header .appsw .ic { width: 16px; height: 16px; }
  .pub-header [data-language-control] { max-width: 62px; padding-inline: 4px; font-size: 12px; }
  html[data-text="large"] .match-table-players > div { flex-wrap: wrap; }
  html[data-text="large"] .match-table-players > div > b { display: flex; gap: 5px; align-items: baseline; }
  html[data-text="large"] .match-table-players > div > b small { margin: 0; }
  html[data-text="large"] .participant-row > summary { grid-template-columns: 1fr 1fr 1fr 16px; }
}
@media (max-width: 360px) {
  .pub-header .appsw .ic { display: none; }
}
@media (forced-colors: active) {
  :focus-visible { outline: 3px solid Highlight !important; }
  .match-table-open:focus-visible::after { outline-color: Highlight; }
  .analysis-probability-bar, .bar { border: 1px solid CanvasText; }
}

.display-controls select { min-height: 48px; padding: 0 12px; font: inherit; font-size: 16px; background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; }
.display-controls > button { min-height: 44px; padding: 10px 12px; background: var(--sky); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; font: inherit; cursor: pointer; }
.display-dialog header button { background: transparent; border: 0; cursor: pointer; }
