/* ============================================================
   MB tenis — design systém
   Identita: antuka (#C0532B) · kurtová zeleň (#2E5C46) · tenisák (#D8E14C)
   ============================================================ */

:root {
  --bg:        #F6F3EC;
  --surface:   #FFFFFF;
  --surface-2: #EFEAE0;
  --ink:       #20261F;
  --ink-soft:  #5C6258;
  --line:      #E2DCCE;
  --clay:      #C0532B;
  --clay-soft: #F4E2D8;
  --court:     #2E5C46;
  --court-deep:#1F4232;
  --ball:      #D8E14C;
  --win:       #2E7D4F;
  --loss:      #B3452F;
  --shadow:    0 14px 40px -18px rgba(32, 38, 31, .25);
  --radius:    14px;
  --header-h:  64px;
  --font-disp: "Archivo", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}

[data-theme="dark"] {
  --bg:        #141A15;
  --surface:   #1C241D;
  --surface-2: #232D24;
  --ink:       #E8E7DD;
  --ink-soft:  #9BA396;
  --line:      #2D372E;
  --clay:      #E06A3B;
  --clay-soft: #3A2A21;
  --court:     #2E5C46;
  --court-deep:#16241C;
  --ball:      #D8E14C;
  --win:       #5BBF8A;
  --loss:      #E08066;
  --shadow:    0 14px 40px -18px rgba(0, 0, 0, .5);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-disp);
  line-height: 1.15;
  margin: 0 0 .5em;
  letter-spacing: -.01em;
}
h1 { font-size: clamp(1.9rem, 4.5vw, 2.9rem); font-weight: 900; }
h2 { font-size: clamp(1.3rem, 2.6vw, 1.7rem); font-weight: 700; }
h3 { font-size: 1.08rem; font-weight: 700; }

a { color: var(--court); text-decoration-color: color-mix(in srgb, var(--court) 40%, transparent); }
[data-theme="dark"] a { color: #7FC9A2; }
a:hover { color: var(--clay); }

.container { width: min(1120px, 100% - 2rem); margin-inline: auto; }
.narrow .page-head, .container.narrow { max-width: 760px; }
.section { padding: 2.2rem 0 3rem; }
.center { text-align: center; }
.muted { color: var(--ink-soft); }
.accent { color: var(--clay); }
.strong { font-weight: 700; }

/* ============ Header ============ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--court-deep);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,.06), 0 8px 24px -16px rgba(0,0,0,.5);
}
.header-row { display: flex; align-items: center; gap: 1.2rem; height: var(--header-h); }

.brand { display: flex; align-items: center; gap: .55rem; text-decoration: none; color: #fff; }
.brand .ball { width: 26px; height: 26px; }
.brand-name { font-family: var(--font-disp); font-weight: 900; font-size: 1.25rem; letter-spacing: .01em; }

.main-nav { display: flex; gap: .2rem; margin-left: auto; }
.main-nav a {
  color: rgba(255,255,255,.85);
  text-decoration: none;
  font-size: .92rem;
  font-weight: 600;
  padding: .45rem .7rem;
  border-radius: 8px;
}
.main-nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.main-nav a.on { color: var(--ball); }

.header-tools { display: flex; align-items: center; gap: .3rem; }
.theme-toggle, .nav-burger {
  background: none; border: 0; cursor: pointer; color: rgba(255,255,255,.85);
  width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center;
}
.theme-toggle:hover, .nav-burger:hover { background: rgba(255,255,255,.1); color: #fff; }
.theme-toggle svg { width: 20px; height: 20px; }
[data-theme="light"] .ico-moon { display: none; }
[data-theme="dark"] .ico-sun { display: none; }

.nav-burger { display: none; flex-direction: column; gap: 4px; }
.nav-burger span { width: 20px; height: 2px; background: currentColor; display: block; transition: transform .25s, opacity .25s; }
body.nav-open .nav-burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
body.nav-open .nav-burger span:nth-child(2) { opacity: 0; }
body.nav-open .nav-burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 920px) {
  .nav-burger { display: flex; }
  .main-nav {
    position: fixed; top: var(--header-h); right: 0;
    width: min(300px, 84vw); height: calc(100dvh - var(--header-h));
    flex-direction: column; gap: .3rem; padding: 1.2rem;
    background: var(--court-deep);
    transform: translateX(105%);
    transition: transform .3s cubic-bezier(.22,.61,.36,1);
  }
  body.nav-open .main-nav { transform: none; }
  .main-nav a { font-size: 1.05rem; padding: .7rem .8rem; }
}

/* ============ Hero ============ */
.hero {
  position: relative;
  background:
    radial-gradient(90rem 30rem at 110% -20%, color-mix(in srgb, var(--ball) 14%, transparent), transparent 60%),
    linear-gradient(150deg, var(--court) 0%, var(--court-deep) 70%);
  color: #fff;
  padding: clamp(3rem, 8vw, 5.5rem) 0 clamp(3.4rem, 8vw, 6rem);
  overflow: hidden;
}
.hero-eyebrow {
  font-size: .8rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase;
  color: var(--ball); margin: 0 0 1rem;
}
.hero h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); font-weight: 900; margin-bottom: .4em; }
.hero h1 em { font-style: normal; color: var(--ball); }
.hero-sub { font-size: clamp(1rem, 2vw, 1.18rem); color: rgba(255,255,255,.85); max-width: 36rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }

/* dekor: lajny kurtu */
.hero-lines {
  position: absolute; inset: auto -4% -42% auto; width: 56%; aspect-ratio: 2/1;
  border: 3px solid rgba(255,255,255,.14); border-radius: 6px;
  transform: rotate(-6deg);
  pointer-events: none;
}
.hero-lines::before {
  content: ""; position: absolute; inset: 0 50% 0 0; border-right: 3px solid rgba(255,255,255,.14);
}
.hero-lines::after {
  content: ""; position: absolute; inset: 25% 25%; border: 3px solid rgba(255,255,255,.12); border-radius: 4px;
}

/* ============ Tlačítka, pilulky, taby ============ */
.btn {
  display: inline-block; padding: .7rem 1.4rem; border-radius: 999px;
  font-weight: 700; font-size: .95rem; text-decoration: none; border: 0; cursor: pointer;
  transition: transform .2s, box-shadow .2s, background .2s;
  font-family: var(--font-body);
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--clay); color: #fff; box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--clay) 70%, transparent); }
.btn-primary:hover { background: color-mix(in srgb, var(--clay) 85%, black); color: #fff; }
.btn-ghost { color: #fff; border: 1.5px solid rgba(255,255,255,.5); }
.btn-ghost:hover { background: rgba(255,255,255,.12); color: #fff; }

.year-strip { display: flex; flex-wrap: wrap; gap: .35rem; margin: .8rem 0 0; }
.year-pill, .tab {
  display: inline-block; padding: .32rem .7rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--ink-soft); font-size: .85rem; font-weight: 600; text-decoration: none;
}
.year-pill:hover, .tab:hover { border-color: var(--clay); color: var(--clay); }
.year-pill.on, .tab.on { background: var(--court); border-color: var(--court); color: #fff; }

.tabs { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: 1rem; }
.history-pills { display: flex; flex-wrap: wrap; gap: .35rem; }

/* ============ Page head, drobky ============ */
.page-head { margin-bottom: 1.6rem; }
.crumbs { font-size: .85rem; color: var(--ink-soft); margin-bottom: .8rem; }
.crumbs a { color: inherit; }
.section-title { margin-top: 2rem; }
.league-title {
  margin: 2.2rem 0 .9rem; padding-left: .75rem;
  border-left: 4px solid var(--clay);
}

/* ============ Tabulky dat ============ */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
  box-shadow: var(--shadow);
}
table.data { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.data th, table.data td { padding: .6rem .8rem; text-align: left; }
table.data thead th {
  font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-soft); background: var(--surface-2);
  position: sticky; top: 0;
}
table.data tbody tr { border-top: 1px solid var(--line); }
table.data tbody tr:hover { background: color-mix(in srgb, var(--ball) 7%, transparent); }
.num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.pos { color: var(--ink-soft); font-weight: 600; }
.row-first { background: color-mix(in srgb, var(--win) 9%, transparent); }
.row-first td.pos { color: var(--win); }
.row-last { background: color-mix(in srgb, var(--loss) 7%, transparent); }
.row-last td.pos { color: var(--loss); }
.medal { margin-left: .3rem; }
.team-link { font-weight: 600; text-decoration: none; }
.table-note { font-size: .82rem; margin: .5rem .2rem 0; }

/* ============ Utkání (fixture řádky) ============ */
.fixture-list { display: grid; gap: .45rem; }
.fixture {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  gap: .4rem .8rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .55rem .9rem;
  text-decoration: none;
  color: var(--ink);
  transition: border-color .2s, transform .2s;
}
.fixture:hover { border-color: var(--clay); transform: translateX(2px); color: var(--ink); }
.fixture .fx-round { grid-column: 1 / -1; font-size: .75rem; }
.fixture .fx-team { font-weight: 600; font-size: .95rem; }
.fixture .fx-team.t1 { text-align: right; }
.fixture .fx-team.win { color: var(--win); }
.fixture .fx-score {
  font-family: var(--font-disp); font-weight: 900; font-size: 1rem;
  background: var(--surface-2); border-radius: 8px; padding: .15rem .55rem;
  min-width: 3.2rem; text-align: center;
}
.fixture.pending .fx-score { color: var(--ink-soft); }
.fixture .fx-date { grid-column: 1 / -1; font-size: .78rem; }
.fixture .sets-inline { font-family: var(--font-body); font-weight: 600; font-size: .85rem; background: none; }
.fixture .badge { justify-self: center; width: max-content; }
@media (min-width: 700px) {
  .fixture { grid-template-columns: minmax(4.2rem, auto) 1fr auto 1fr minmax(6rem, auto); }
  .fixture .fx-round { grid-column: auto; }
  .fixture .fx-date { grid-column: auto; text-align: right; }
  .fixture:not(:has(.fx-round)) { grid-template-columns: 1fr auto 1fr minmax(6rem, auto); }
  .fixture:not(:has(.fx-date)):not(:has(.fx-round)) { grid-template-columns: 1fr auto 1fr; }
}

.round { margin: 1.1rem 0; }
.round-title { margin: 0 0 .5rem; font-size: .95rem; }

/* ============ Detail utkání ============ */
.match-head {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center;
  background: linear-gradient(150deg, var(--court), var(--court-deep));
  color: #fff; border-radius: var(--radius); padding: 1.6rem 1.4rem; box-shadow: var(--shadow);
}
.mh-team { font-family: var(--font-disp); font-weight: 700; font-size: clamp(1rem, 2.6vw, 1.5rem); }
.mh-team:first-child { text-align: right; }
.mh-team a { color: #fff; text-decoration: none; }
.mh-team a:hover { color: var(--ball); }
.mh-score { font-family: var(--font-disp); font-weight: 900; font-size: clamp(1.8rem, 5vw, 3rem); color: var(--ball); white-space: nowrap; }
.match-meta { margin: .8rem .2rem 1.6rem; }

.games { display: grid; gap: .8rem; max-width: 760px; }
.game {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .9rem 1.1rem; box-shadow: var(--shadow);
}
.game-head { margin-bottom: .4rem; }
.game-row { display: flex; align-items: center; gap: .6rem; padding: .25rem 0; font-weight: 600; }
.game-row.winner .side::after { content: "✓"; color: var(--win); margin-left: .45rem; font-weight: 900; }
.game-sets { display: flex; gap: .4rem; flex-wrap: wrap; margin: .3rem 0; }
.set {
  font-variant-numeric: tabular-nums; font-weight: 700; font-size: .9rem;
  background: var(--surface-2); border-radius: 7px; padding: .18rem .5rem;
}

/* ============ Badge ============ */
.badge {
  display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; padding: .14rem .5rem; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-soft);
}
.badge-typ { background: var(--clay-soft); color: var(--clay); }
.badge-win { background: color-mix(in srgb, var(--win) 16%, transparent); color: var(--win); }
.badge-loss { background: color-mix(in srgb, var(--loss) 14%, transparent); color: var(--loss); }

/* ============ Karty ============ */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.2rem 1.3rem; box-shadow: var(--shadow);
}
.card + .card { margin-top: 1rem; }
.card-grid .card, .hall-grid .card { margin-top: 0; } /* v mřížce řídí rozestupy gap */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .9rem; }
.team-card { text-decoration: none; color: var(--ink); transition: transform .2s, border-color .2s; }
.team-card:hover { transform: translateY(-3px); border-color: var(--clay); color: var(--ink); }
.team-card h3 { margin-bottom: .5rem; }
.los-num {
  display: inline-grid; place-items: center;
  width: 1.5rem; height: 1.5rem; border-radius: 50%;
  background: var(--court); color: #fff;
  font-size: .8rem; font-weight: 700; vertical-align: 2px; margin-right: .2rem;
}
.meta { margin: 0; font-size: .85rem; }
.meta div { display: flex; gap: .5rem; padding: .12rem 0; }
.meta dt { color: var(--ink-soft); min-width: 5.2rem; }
.meta dd { margin: 0; }

/* ============ Statistické karty hráče ============ */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .8rem; margin: 1.4rem 0 2rem; }
.stat-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem; text-align: center; box-shadow: var(--shadow);
}
.stat-num { display: block; font-family: var(--font-disp); font-weight: 900; font-size: 1.7rem; color: var(--clay); }
.stat-label { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }

/* ============ Domovská ============ */
.home-grid { display: grid; grid-template-columns: 1fr; gap: 2.4rem; }
@media (min-width: 880px) { .home-grid { grid-template-columns: 7fr 4fr; } }
.news-item { border-bottom: 1px solid var(--line); padding: 1.1rem 0 1.3rem; }
.news-item:first-of-type { padding-top: .4rem; }
.news-date { font-size: .8rem; color: var(--clay); font-weight: 700; letter-spacing: .05em; }
.news-item h3 { margin: .25rem 0 .4rem; }
.news-body { color: var(--ink-soft); font-size: .95rem; }
.news-item .more { font-weight: 600; font-size: .9rem; text-decoration: none; }
.side-links { display: grid; gap: .5rem; }
.side-link {
  display: flex; justify-content: space-between; gap: 1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: .75rem 1rem; text-decoration: none; color: var(--ink); font-weight: 600;
  transition: border-color .2s, transform .2s;
}
.side-link:hover { border-color: var(--clay); transform: translateX(3px); color: var(--ink); }

/* ============ Síň slávy ============ */
.hall-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .9rem; }
.hall-year { color: var(--clay); font-size: 1.5rem; margin-bottom: .5rem; }
.hall-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.hall-list li { display: flex; gap: .7rem; align-items: baseline; }
.hall-liga { font-size: .75rem; font-weight: 700; color: var(--ink-soft); min-width: 3.6rem; }
.hall-team { font-weight: 600; text-decoration: none; }

/* ============ Pravidla, formuláře, vyhledávání ============ */
dl.rules { margin: 0; }
dl.rules > div { display: grid; grid-template-columns: 1fr; gap: .2rem 1.4rem; padding: .8rem 0; border-bottom: 1px solid var(--line); }
@media (min-width: 640px) { dl.rules > div { grid-template-columns: 220px 1fr; } }
dl.rules dt { font-weight: 700; }
dl.rules dd { margin: 0; color: var(--ink-soft); }

.search-form { display: flex; gap: .6rem; max-width: 480px; margin-top: 1rem; }
.search-form input {
  flex: 1; padding: .65rem 1rem; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--ink); font-size: 1rem; font-family: var(--font-body);
}
.search-form input:focus { outline: none; border-color: var(--clay); }

.two-col { display: grid; grid-template-columns: 1fr; gap: 2.2rem; }
@media (min-width: 920px) { .two-col { grid-template-columns: 1fr 1fr; } }

.err-code { font-size: clamp(4rem, 14vw, 8rem); margin: 1rem 0 0; }

/* ============ Galerie ============ */
.gal-card { padding: 0; overflow: hidden; text-decoration: none; color: var(--ink); transition: transform .2s, border-color .2s; }
.gal-card:hover { transform: translateY(-3px); border-color: var(--clay); }
.gal-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.gal-card-label { display: flex; justify-content: space-between; padding: .7rem 1rem; font-family: var(--font-disp); }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .6rem; }
.g-item { padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; cursor: zoom-in; background: var(--surface); }
.g-item img { width: 100%; height: 100%; aspect-ratio: 1; object-fit: cover; display: block; transition: transform .35s; }
.g-item:hover img { transform: scale(1.05); }

.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(15, 20, 16, .93); display: grid; place-items: center; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: min(94vw, 1300px); max-height: 88vh; border-radius: 8px; }
.lightbox button { position: absolute; background: none; border: 0; color: rgba(255,255,255,.85); font-size: 2.4rem; cursor: pointer; padding: .5rem 1rem; }
.lightbox button:hover { color: #fff; }
.lb-close { top: .6rem; right: .8rem; }
.lb-prev { left: .4rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: .4rem; top: 50%; transform: translateY(-50%); }

.ical-link { font-size: .8rem; font-weight: 600; margin-left: .8rem; text-decoration: none; white-space: nowrap; }

/* ============ Patička ============ */
.site-footer { border-top: 1px solid var(--line); margin-top: 2rem; padding: 1.8rem 0; font-size: .9rem; }
.footer-row { display: flex; flex-wrap: wrap; gap: 1.2rem 2.5rem; align-items: center; justify-content: space-between; }
.footer-links { display: flex; gap: 1.2rem; flex-wrap: wrap; }

/* ============ Administrace ============ */
.admin-login { max-width: 380px; margin: 0 auto; display: grid; gap: 1rem; }
.admin-login input { width: 100%; padding: .6rem .8rem; border-radius: 8px; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); font-size: 1rem; }
.form-err { color: var(--loss); font-weight: 600; }
.form-ok { color: var(--win); font-weight: 600; }
.admin-form { display: block; }
.admin-form fieldset.card { border: 1px solid var(--line); margin-bottom: 1rem; }
.admin-form legend { font-weight: 700; padding: 0 .5rem; }
.form-row { display: flex; flex-wrap: wrap; gap: .8rem 1.4rem; align-items: end; margin: .6rem 0; }
.form-label { display: block; font-size: .8rem; font-weight: 700; color: var(--ink-soft); margin-bottom: .25rem; }
.admin-form input[type=text], .admin-form input[type=date], .admin-form input[type=number],
.admin-form select, .admin-form textarea {
  padding: .45rem .6rem; border-radius: 8px; border: 1.5px solid var(--line);
  background: var(--bg); color: var(--ink); font-size: .95rem; font-family: var(--font-body);
}
.admin-form label { font-size: .85rem; font-weight: 600; color: var(--ink-soft); }
.sets-row input { width: 6rem; }
.btn-danger { background: var(--loss); color: #fff; border: 0; border-radius: 999px; padding: .35rem .9rem; font-weight: 700; cursor: pointer; }
.btn-link { background: none; border: 0; color: var(--loss); cursor: pointer; font-weight: 600; padding: 0; }
.admin-news-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem 1.1rem; }

/* ============ Přístupnost ============ */
:focus-visible { outline: 3px solid var(--ball); outline-offset: 2px; border-radius: 4px; }
