/* ============================================================
   ČBF Basketball (HTML5) – vlastní motiv
   Tmavé hřiště + oranžový akcent, kondenzované nadpisy, mobil first.
   ============================================================ */

:root {
  --bg: #0d1119;
  --bg-2: #121826;
  --card: #161d2c;
  --card-2: #1b2434;
  --line: #253044;
  --ink: #eef2f8;
  --ink-2: #a4b1c6;
  --ink-3: #6f7f99;
  --accent: #ff7a1a;
  --accent-2: #ffb066;
  --win: #3ecf8e;
  --loss: #ff5d5d;
  --live: #ff3b5c;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --tab-h: 62px;
  --head-h: 56px;
  font-size: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Oswald", "Roboto Condensed", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: contain;
}

body {
  min-height: 100dvh;
  padding-top: var(--head-h);
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px));
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

/* --- dekorativní čáry hřiště na pozadí ------------------------------- */
.court-lines {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .5;
  background:
    radial-gradient(120% 60% at 50% -12%, rgba(255, 122, 26, .16), transparent 60%),
    repeating-linear-gradient(0deg, transparent 0 92px, rgba(255, 255, 255, .022) 92px 93px),
    radial-gradient(circle at 50% 116%, rgba(255, 122, 26, .10), transparent 42%);
}
.court-lines::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: min(560px, 92vw);
  height: 100%;
  transform: translateX(-50%);
  border-left: 1px solid rgba(255, 255, 255, .035);
  border-right: 1px solid rgba(255, 255, 255, .035);
}

/* --- horní lišta ------------------------------------------------------ */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--head-h);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 max(12px, env(safe-area-inset-left, 0px));
  background: rgba(13, 17, 25, .88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, #ffa254, #f26a0b 62%, #b64300);
  box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, .35), 0 2px 10px rgba(255, 122, 26, .35);
  position: relative;
  flex: none;
}
.brand-mark::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  background:
    linear-gradient(to right, transparent 48.5%, rgba(0, 0, 0, .45) 48.5% 51.5%, transparent 51.5%),
    linear-gradient(to bottom, transparent 48.5%, rgba(0, 0, 0, .45) 48.5% 51.5%, transparent 51.5%);
}
.brand-text { display: flex; flex-direction: column; line-height: 1; min-width: 0; }
.brand-text b {
  font-size: 18px; letter-spacing: .1em; text-transform: uppercase;
  background: linear-gradient(90deg, #fff, #ffd0ac);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-text i {
  font-style: normal; font-size: 10px; letter-spacing: .28em;
  text-transform: uppercase; color: var(--accent);
}

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.iconbtn {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  cursor: pointer;
  transition: .15s ease;
}
.iconbtn svg { width: 20px; height: 20px; }
.iconbtn:active { transform: scale(.94); }
.iconbtn:hover { border-color: var(--accent); color: var(--accent-2); }

.pill {
  font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  padding: 5px 9px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--ink-3); background: var(--card);
  white-space: nowrap;
}
.pill[data-state="live"] { color: var(--win); border-color: rgba(62, 207, 142, .4); }
.pill[data-state="cache"] { color: var(--accent-2); border-color: rgba(255, 176, 102, .4); }
.pill[data-state="offline"] { color: var(--loss); border-color: rgba(255, 93, 93, .45); }

/* --- indikátor načítání ------------------------------------------------ */
.progressbar {
  position: fixed; top: var(--head-h); left: 0; height: 2px; width: 100%;
  z-index: 29; overflow: hidden; background: transparent;
}
.progressbar::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: slide 1.05s linear infinite;
}
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* --- osnovy obsahu ----------------------------------------------------- */
.view { position: relative; z-index: 1; max-width: 620px; margin: 0 auto; padding: 14px 14px 28px; }
.view:focus { outline: none; }

.section { margin: 0 0 22px; }
.section > h2 {
  margin: 4px 2px 10px;
  font-size: 12px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-3);
  display: flex; align-items: center; gap: 8px;
}
.section > h2::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.screen-title {
  margin: 6px 2px 14px;
  font-size: 25px; line-height: 1.1; letter-spacing: .01em; text-transform: uppercase;
}
.screen-title small {
  display: block; margin-top: 5px;
  font-size: 11px; letter-spacing: .16em; color: var(--accent); font-weight: 500;
}

/* --- karty ------------------------------------------------------------- */
.card {
  display: block;
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 14px;
  margin-bottom: 9px;
  box-shadow: var(--shadow);
  transition: .16s ease;
}
a.card:hover, button.card:hover { border-color: #33415c; transform: translateY(-1px); }
.card:active { transform: scale(.995); }

.row { display: flex; align-items: center; gap: 11px; }
.row + .row { margin-top: 8px; }
.grow { flex: 1 1 auto; min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-title { font-size: 16px; font-weight: 600; }
.t-sub { font-size: 12.5px; color: var(--ink-2); }
.t-meta { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }

.chev { color: var(--ink-3); flex: none; }
.chev svg { width: 18px; height: 18px; display: block; }

/* monogram týmu/hráče – generovaný placeholder bez externích assetů */
.badge {
  width: 42px; height: 42px; flex: none;
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 14px; font-weight: 700; letter-spacing: .04em;
  color: #0b0f16;
  box-shadow: inset 0 -6px 12px rgba(0, 0, 0, .25);
}
.badge.sm { width: 32px; height: 32px; border-radius: 9px; font-size: 11.5px; }
.badge.lg { width: 62px; height: 62px; border-radius: 18px; font-size: 20px; }

/* --- zápas ------------------------------------------------------------- */
.game { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
.team-line { display: flex; align-items: center; gap: 9px; min-width: 0; }
.team-line .t-title { font-size: 15.5px; }
.score {
  min-width: 62px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.score b { display: block; font-size: 21px; line-height: 1.05; letter-spacing: .02em; }
.score span { font-size: 12px; color: var(--ink-2); }
.score--time b { font-size: 16px; color: var(--accent-2); }
.score--live b { color: var(--live); }
.winner { color: #fff; }
.loser { color: var(--ink-2); }

.datehead {
  display: flex; align-items: baseline; gap: 9px;
  margin: 18px 2px 9px;
}
.datehead b { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; }
.datehead i { font-style: normal; font-size: 11px; color: var(--ink-3); letter-spacing: .1em; text-transform: uppercase; }
.datehead::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.tag {
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 7px; border-radius: 6px;
  background: rgba(255, 122, 26, .12); color: var(--accent-2);
  border: 1px solid rgba(255, 122, 26, .28);
}
.tag--live { background: rgba(255, 59, 92, .14); color: #ff8a9c; border-color: rgba(255, 59, 92, .4); }
.tag--link { background: rgba(88, 148, 255, .12); color: #9dc0ff; border-color: rgba(88, 148, 255, .3); }
.tag--fav { background: rgba(255, 214, 102, .13); color: #ffd666; border-color: rgba(255, 214, 102, .35); }

/* --- tabulka ----------------------------------------------------------- */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 12px 10px; text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: center; width: 30px; color: var(--ink-3); }
th:nth-child(2), td:nth-child(2) { text-align: left; }
thead th {
  position: sticky; top: 0;
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-3); background: var(--bg-2);
  border-bottom: 1px solid var(--line);
}
tbody tr { border-top: 1px solid rgba(37, 48, 68, .6); }
tbody tr:hover { background: rgba(255, 255, 255, .02); }
td.num { font-variant-numeric: tabular-nums; }
.delta-pos { color: var(--win); }
.delta-neg { color: var(--loss); }

/* --- přepínače ---------------------------------------------------------- */
.segmented {
  display: flex; gap: 4px; padding: 4px; margin: 0 0 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 13px;
}
.segmented button {
  flex: 1; padding: 9px 6px; border: 0; border-radius: 9px; background: transparent;
  font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2);
  cursor: pointer; transition: .15s ease;
}
.segmented button[aria-selected="true"] { background: var(--accent); color: #14100a; font-weight: 700; }

.stepper { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.stepper .day { flex: 1; text-align: center; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; }
.stepper .day small { display: block; font-size: 10px; color: var(--ink-3); letter-spacing: .14em; margin-top: 2px; }

.search {
  width: 100%; padding: 12px 14px; margin-bottom: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 13px;
  color: var(--ink); font: inherit; font-size: 14.5px;
}
.search:focus { outline: none; border-color: var(--accent); }

/* --- detail ------------------------------------------------------------ */
.hero {
  background:
    linear-gradient(180deg, rgba(255, 122, 26, .14), transparent 62%),
    linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--line); border-radius: 20px;
  padding: 18px 16px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.hero .vs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.hero .side { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.hero .side span { font-size: 13px; font-weight: 600; line-height: 1.2; }
.hero .big { font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.hero .mid { text-align: center; }
.hero .mid em { display: block; font-style: normal; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); margin-top: 4px; }
.hero .side a { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; }

.kv { display: grid; grid-template-columns: 1fr; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--card); }
.kv > div { display: flex; justify-content: space-between; gap: 14px; padding: 11px 14px; border-top: 1px solid rgba(37, 48, 68, .55); font-size: 14px; }
.kv > div:first-child { border-top: 0; }
.kv dt { color: var(--ink-3); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.kv dd { margin: 0; text-align: right; word-break: break-word; }
.kv dd a { display: inline-flex; align-items: center; min-height: 34px; }

.quarters { display: flex; gap: 6px; flex-wrap: wrap; }
.q {
  flex: 1 1 70px; text-align: center; padding: 9px 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 11px;
}
.q small { display: block; font-size: 10.5px; letter-spacing: .12em; color: var(--ink-3); text-transform: uppercase; }
.q b { font-size: 14px; font-variant-numeric: tabular-nums; }

.links { display: flex; flex-wrap: wrap; gap: 8px; }
.linkbtn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 12px 14px; border-radius: 12px; font-size: 13px; letter-spacing: .06em;
  background: var(--card); border: 1px solid var(--line); transition: .15s ease; cursor: pointer;
}
.linkbtn:hover { border-color: var(--accent); color: var(--accent-2); }
.linkbtn--primary { background: var(--accent); border-color: var(--accent); color: #14100a; font-weight: 700; }
.linkbtn svg { width: 17px; height: 17px; flex: none; }

/* --- soupiska, realizační tým, statistiky ------------------------------- */
.section > h2 .count { margin-left: 8px; }
.count {
  display: inline-block; min-width: 22px; padding: 2px 7px; border-radius: 999px;
  background: rgba(255, 176, 102, .12); border: 1px solid rgba(255, 176, 102, .3);
  color: var(--accent-2); font-size: 11px; font-weight: 700; letter-spacing: .08em;
  font-variant-numeric: tabular-nums;
}
.subhead {
  display: flex; align-items: center; gap: 10px; margin: 18px 0 9px;
  font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); font-weight: 600;
}
.subhead:first-child { margin-top: 0; }
.subhead::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.dress {
  flex: none; width: 30px; height: 30px; display: grid; place-items: center;
  border-radius: 9px; background: rgba(255, 176, 102, .1); border: 1px solid rgba(255, 176, 102, .28);
  color: var(--accent-2); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.pstat { flex: none; text-align: right; font-variant-numeric: tabular-nums; }
.pstat b { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.pstat i { display: block; font-style: normal; margin-top: 2px; font-size: 11px; letter-spacing: .05em; color: var(--ink-3); }
.statgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat {
  text-align: center; padding: 11px 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
}
.stat b { display: block; font-size: 18px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { display: block; margin-top: 4px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.tablewrap a { display: inline-flex; align-items: center; min-height: 34px; }

.star {
  width: 34px; height: 34px; flex: none; border: 0; background: transparent; cursor: pointer;
  color: var(--ink-3); display: grid; place-items: center; border-radius: 10px;
}
.star svg { width: 20px; height: 20px; }
.star[aria-pressed="true"] { color: #ffd666; }
.star[aria-pressed="true"] svg path { fill: currentColor; }

/* --- stavové stavy ------------------------------------------------------ */
.empty, .error {
  text-align: center; padding: 34px 18px; color: var(--ink-2);
  border: 1px dashed var(--line); border-radius: var(--radius); background: rgba(22, 29, 44, .55);
}
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .08em; }
.error { border-color: rgba(255, 93, 93, .4); border-style: solid; }
.note { font-size: 12px; color: var(--ink-3); line-height: 1.55; padding: 2px 2px 0; }
.note--bad { color: var(--loss); }

.skeleton { height: 68px; border-radius: var(--radius); margin-bottom: 9px;
  background: linear-gradient(90deg, #161d2c, #1e2739, #161d2c); background-size: 300% 100%;
  animation: shimmer 1.3s ease-in-out infinite; }
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -20% 0; } }

/* --- článek ------------------------------------------------------------- */
.article { font-size: 16px; line-height: 1.72; color: #dfe6f1; }
.article p { margin: 0 0 1.05em; }
.article h3 { font-size: 17px; letter-spacing: .04em; text-transform: uppercase; margin: 1.6em 0 .6em; color: var(--accent-2); }

/* --- spodní lišta ------------------------------------------------------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(13, 17, 25, .93); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3);
  position: relative; transition: .15s ease;
}
.tabbar a svg { width: 21px; height: 21px; }
.tabbar a[aria-current="page"] { color: var(--accent); }
.tabbar a[aria-current="page"]::before {
  content: ""; position: absolute; top: -1px; left: 50%; transform: translateX(-50%);
  width: 30px; height: 2px; border-radius: 2px; background: var(--accent);
}

@media (min-width: 680px) {
  :root { --head-h: 62px; }
  .view { padding-top: 22px; }
  .kv { grid-template-columns: 1fr 1fr; }
  .kv > div:nth-child(2) { border-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
