/* ===== Turnaj házené – styly (tablet first) ===== */
:root {
  --bg: #f3f5f9;
  --card: #fff;
  --ink: #14213d;
  --ink2: #4a5672;
  --muted: #7d879c;
  --line: #e2e6ee;
  --brand: #f77f00;
  --brand-d: #d96d00;
  --primary: #1d5fd1;
  --primary-d: #164aa6;
  --green: #1f9d55;
  --green-l: #e4f6ec;
  --yellow: #f5c400;
  --red: #d62828;
  --blue: #1d6fe0;
  --orange: #f08c00;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 33, 61, .06), 0 4px 14px rgba(20, 33, 61, .06);
  --tap: 48px;
  font-size: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
}
body.has-modal { overflow: hidden; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .6em; line-height: 1.2; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; color: var(--ink2); margin-top: 1.2em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea {
  width: 100%; min-height: var(--tap); padding: .55rem .8rem; border: 1.5px solid var(--line);
  border-radius: 10px; background: #fff; outline: none; transition: border-color .15s;
}
textarea { min-height: auto; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(29, 95, 209, .12); }
input[type=checkbox] { width: 22px; min-height: 22px; height: 22px; accent-color: var(--primary); }
.muted { color: var(--muted); }
.center { text-align: center; }
.pad { padding: 1rem; }
.hint { color: var(--muted); font-size: .88rem; margin: .6rem 0 0; }
.warn { color: #a55a00; }
.nowrap { white-space: nowrap; }
.placeholder { color: var(--muted); font-style: italic; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 1rem;
  padding: .5rem 1rem; padding-top: max(.5rem, env(safe-area-inset-top));
  background: var(--ink); color: #fff;
}
.brand { display: flex; align-items: center; gap: .55rem; color: #fff; font-weight: 700; font-size: 1.1rem; }
.brand:hover { text-decoration: none; }
#sync { flex: 1; display: flex; justify-content: center; }
#userbox { display: flex; align-items: center; gap: .6rem; }
.user-name { opacity: .85; font-size: .92rem; }
.sync { font-size: .85rem; padding: .25rem .7rem; border-radius: 99px; background: rgba(255, 255, 255, .1); }
.sync-ok { color: #9be7b8; }
.sync-busy { color: #ffe08a; }
.sync-warn { background: #f08c00; color: #fff; font-weight: 600; }
.sync-err { background: var(--red); color: #fff; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: var(--tap); padding: .5rem 1.1rem; border-radius: 12px; border: 1.5px solid var(--line);
  background: #fff; color: var(--ink); font-weight: 600; cursor: pointer; user-select: none;
  transition: background .12s, transform .05s, border-color .12s; text-decoration: none !important; white-space: nowrap;
}
.btn:hover { background: #f6f8fb; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: default; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-d); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #b51f1f; }
.btn-danger-ghost { color: var(--red); border-color: #f3c7c7; }
.btn-danger-ghost:hover { background: #fdf0f0; }
.btn-ghost { background: transparent; }
.btn-ghost-light { background: transparent; border-color: rgba(255, 255, 255, .3); color: #fff; }
.btn-ghost-light:hover { background: rgba(255, 255, 255, .1); }
.btn-small { min-height: 40px; padding: .35rem .85rem; font-size: .92rem; border-radius: 10px; }
.btn-big { min-height: 56px; font-size: 1.08rem; padding: .6rem 1.5rem; }
.btn-block { width: 100%; }
.btn-icon {
  width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; color: var(--ink2); font-size: 1rem; flex: none;
}
.btn-icon:hover:not(:disabled) { background: #eef1f6; }
.btn-icon:disabled { opacity: .25; cursor: default; }
.btn-col { display: flex; flex-direction: column; gap: .6rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: .6rem; margin: .8rem 0; align-items: center; }
.toolbar select { width: auto; }

/* ---------- layout ---------- */
.page { max-width: 1280px; margin: 0 auto; padding: 1.2rem 1rem 4rem; }
.page-wide { max-width: 1560px; }
.page-narrow { max-width: 520px; }
.loading { padding: 4rem 1rem; text-align: center; color: var(--muted); }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.2rem; margin-bottom: 1rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; margin-bottom: .6rem; }
.card-head h2 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 0 1rem; align-items: start; }
.field { display: block; margin-bottom: .85rem; }
.field > span { display: block; font-size: .85rem; font-weight: 600; color: var(--ink2); margin-bottom: .3rem; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
.form-error { background: #fdecec; color: var(--red); padding: .6rem .8rem; border-radius: 10px; margin-bottom: .8rem; }
.empty-state { text-align: center; padding: 3rem 1rem; }
.empty-card { padding: 1.4rem; border: 2px dashed var(--line); border-radius: var(--radius); color: var(--muted); text-align: center; }
.scroll-x { overflow-x: auto; }
.more { display: inline-block; margin-top: .6rem; font-weight: 600; font-size: .92rem; }
.back { display: inline-block; margin-bottom: .8rem; font-weight: 600; }
.steps { display: inline-flex; flex-direction: column; gap: .6rem; text-align: left; font-size: 1.1rem; padding-left: 1.5rem; }
.steps li.done { color: var(--green); }
.steps li.done::marker { content: '✓  '; }

/* ---------- pills, tags, badges ---------- */
.pill { display: inline-block; padding: .15rem .6rem; border-radius: 99px; font-size: .78rem; font-weight: 700; background: #eef1f6; color: var(--ink2); white-space: nowrap; }
.pill-live { background: #ffe5e5; color: var(--red); animation: pulse 1.6s infinite; }
.pill-done { background: var(--green-l); color: var(--green); }
.pill-running { background: #fff1de; color: #b45309; }
.t-card-top { align-items: center; flex-wrap: wrap; }
.t-card-top .live-badge, .t-head-meta .live-badge { font-size: .72rem; }
.pill-muted { background: #f1f1f1; color: var(--muted); }
.pill-public { background: #e5efff; color: var(--primary); }
.pill-private { background: #f3eee5; color: #8a6a2f; }
@keyframes pulse { 50% { opacity: .6; } }
.tag { display: inline-block; min-width: 1.7rem; text-align: center; padding: .1rem .45rem; border-radius: 6px; background: #eef1f6; font-size: .78rem; font-weight: 700; color: var(--ink2); }
.tag-playoff { background: #fff1de; color: #a55a00; }
.badge { display: inline-block; padding: .15rem .55rem; border-radius: 6px; font-size: .82rem; font-weight: 700; }
.badge-red { background: var(--red); color: #fff; }
.badge-yellow { background: var(--yellow); color: #3b2f00; }
.badge-2min { background: #ffe8cc; color: #9a4f00; }
.badge-warn { background: #fff0f0; color: var(--red); border: 1px solid #f3c7c7; }
.dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; margin-right: .45rem; flex: none; vertical-align: baseline; }
.dot-empty { border: 1.5px dashed var(--muted); }
.jersey { display: inline-block; min-width: 1.8rem; text-align: center; font-weight: 700; color: var(--ink2); }

/* ---------- home ---------- */
.hero {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
  background: linear-gradient(120deg, var(--ink), #23396b); color: #fff; border-radius: 20px; padding: 1.8rem 2rem; margin-bottom: 1.2rem;
}
.hero h1 { font-size: 2rem; }
.hero p { margin: 0; opacity: .85; }
.hero-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.hero .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .35); }
.filters { display: flex; gap: .7rem; margin-bottom: 1rem; }
.filters input { flex: 2; }
.filters select { flex: 1; max-width: 260px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-top: 1.2rem; }
.year-head { color: var(--muted); font-size: .95rem; margin: 1rem 0 .5rem; letter-spacing: .04em; }
.t-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1rem; }
.t-card {
  display: flex; flex-direction: column; gap: .3rem; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1rem 1.1rem .9rem; color: var(--ink); position: relative; overflow: hidden; transition: transform .12s, box-shadow .12s;
}
.t-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 6px 24px rgba(20, 33, 61, .12); }
.t-card h3 { margin: .2rem 0; color: var(--ink); font-size: 1.12rem; }
.t-card-top { display: flex; gap: .4rem; }
.t-card-meta { color: var(--ink2); font-size: .9rem; min-height: 1.2em; }
.t-card-foot { display: flex; justify-content: space-between; font-size: .82rem; color: var(--ink2); margin-top: .4rem; }
.progress { height: 4px; background: #eef1f6; border-radius: 4px; overflow: hidden; margin-top: .4rem; }
.progress div { height: 100%; background: var(--green); }
.auth-card { margin-top: 2rem; padding: 1.8rem; }

/* ---------- tournament head & tabs ---------- */
.t-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: .6rem; }
.t-head h1 { margin-bottom: .3rem; }
.t-head-meta { display: flex; flex-wrap: wrap; gap: .4rem 1rem; color: var(--ink2); align-items: center; }
.tabs {
  display: flex; gap: .3rem; overflow-x: auto; margin: 0 -1rem 1rem; padding: 0 1rem; border-bottom: 1.5px solid var(--line);
  position: sticky; top: 52px; background: var(--bg); z-index: 20; scrollbar-width: none;
}
.tabs a {
  padding: .85rem 1.1rem; font-weight: 600; color: var(--ink2); border-bottom: 3px solid transparent; white-space: nowrap; margin-bottom: -1.5px;
}
.tabs a:hover { text-decoration: none; color: var(--ink); }
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ---------- overview grid ---------- */
.overview { display: grid; gap: 1rem; grid-template-columns: minmax(250px, 310px) minmax(0, 1fr) minmax(250px, 310px); grid-template-areas: "left center right"; align-items: start; }
.overview .m-st { display: none; }
.overview .m-row.m-live { box-shadow: inset 4px 0 0 var(--red); }
.overview .m-row.m-finished { box-shadow: inset 4px 0 0 #9bd8b3; }
.card-final { background: linear-gradient(140deg, #fff, #fff6e6); }
.ov-center { grid-area: center; min-width: 0; }
.ov-left { grid-area: left; min-width: 0; }
.ov-right { grid-area: right; min-width: 0; }
@media (max-width: 1180px) {
  .overview { grid-template-columns: 1fr 1fr; grid-template-areas: "center center" "left right"; }
}
@media (max-width: 760px) {
  .overview { grid-template-columns: 1fr; grid-template-areas: "center" "left" "right"; }
}

.chips { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.chip { min-height: 40px; padding: .3rem .9rem; border-radius: 99px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; font-weight: 600; font-size: .9rem; }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip-select { width: auto; min-height: 40px; padding: .3rem .7rem; border-radius: 99px; font-size: .9rem; }

/* ---------- match rows ---------- */
.m-list { display: flex; flex-direction: column; }
.day-head { font-weight: 700; color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; padding: .8rem .4rem .3rem; }
.m-row {
  display: grid; grid-template-columns: 1.8rem 3.8rem minmax(0, 1fr) auto minmax(0, 1fr) auto; align-items: center; gap: .5rem;
  min-height: 58px; padding: .4rem .5rem; border-radius: 10px; color: var(--ink); border-bottom: 1px solid var(--line);
}
a.m-row:hover { background: #f6f8fb; text-decoration: none; }
.m-row.m-live { background: #fff6f6; }
.m-row.m-finished { color: var(--ink2); }
.m-num { font-weight: 700; color: var(--muted); font-size: .85rem; text-align: center; }
.m-time { font-weight: 600; font-variant-numeric: tabular-nums; display: flex; flex-direction: column; font-size: .95rem; }
.m-time small { font-weight: 400; color: var(--muted); font-size: .72rem; }
.m-time .tag { font-size: .66rem; margin-top: .15rem; align-self: flex-start; white-space: normal; line-height: 1.15; padding: .05rem .3rem; }
.m-tagcell { overflow: hidden; }
.m-tagcell .tag-playoff { font-size: .68rem; white-space: normal; line-height: 1.1; }
.scorers.compact td { padding: .4rem .3rem; }
.sc-who b { display: block; font-weight: 600; }
.sc-who small { display: flex; align-items: center; color: var(--muted); font-size: .8rem; }
.sc-who .dot { width: .55rem; height: .55rem; margin-right: .3rem; }
.sc-goals { font-size: 1.2rem; width: 2.5rem; }
.m-team { display: flex; align-items: center; min-width: 0; font-weight: 600; }
.m-team span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-home { justify-content: flex-end; text-align: right; }
.m-home .dot { order: 2; margin: 0 0 0 .45rem; }
.m-team.win { color: var(--ink); font-weight: 800; }
.m-score { font-weight: 800; font-size: 1.2rem; font-variant-numeric: tabular-nums; min-width: 4.6rem; text-align: center; display: flex; flex-direction: column; line-height: 1.1; }
.m-score small { font-weight: 500; font-size: .72rem; color: var(--muted); }
.m-score-empty { color: #c4cad6; }
.m-st { text-align: right; }
.now-cards { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1rem; }
.now-card { display: block; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: .6rem .7rem .3rem; border-left: 5px solid var(--primary); color: var(--ink); }
.now-card.live { border-left-color: var(--red); }
.now-card:hover { text-decoration: none; box-shadow: 0 6px 22px rgba(20, 33, 61, .14); }
.now-card .m-row { border: 0; }
.now-label { font-size: .8rem; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: .04em; padding-left: .5rem; }
.now-card.live .now-label { color: var(--red); }

@media (max-width: 600px) {
  .m-row { grid-template-columns: 1.4rem 3rem minmax(0, 1fr) auto minmax(0, 1fr); gap: .35rem; }
  .m-st { display: none; }
  .m-score { min-width: 3.6rem; }
}

/* ---------- tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th { font-size: .78rem; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: .45rem .4rem; border-bottom: 1.5px solid var(--line); }
.table td { padding: .5rem .4rem; border-bottom: 1px solid var(--line); text-align: center; font-variant-numeric: tabular-nums; }
.table th, .table td { text-align: center; }
.table .left { text-align: left; }
.table .num { width: 2.2rem; color: var(--muted); font-weight: 700; }
.table .pts { font-weight: 800; }
.table tr:last-child td { border-bottom: 0; }
.table a { color: inherit; font-weight: 600; }
.standings tbody tr:first-child td { background: #fffaf0; }
.standings.compact { font-size: .9rem; }
.standings.compact th, .standings.compact td { padding-left: .2rem; padding-right: .2rem; }
.standings.compact td.left { white-space: normal; }
.now-card .m-score .live-badge { display: none; }
.tied { color: var(--orange); cursor: help; }
.cross td { min-width: 3.5rem; font-size: .88rem; }
.cross th { font-size: .72rem; text-transform: none; }
.cross-self { background: #eef1f6; }
.ranking { list-style: none; margin: 0; padding: 0; }
.ranking li { display: flex; align-items: center; gap: .3rem; padding: .5rem .2rem; border-bottom: 1px solid var(--line); font-weight: 600; }
.ranking li:last-child { border: 0; }
.rk-pos { width: 2rem; color: var(--muted); }
.rk-name { flex: 1; }
.rk-medal { font-size: 1.3rem; }
.records { display: grid; grid-template-columns: auto 1fr; gap: .5rem 1rem; margin: 0; }
.records dt { color: var(--muted); font-size: .9rem; }
.records dd { margin: 0; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.tiles-big { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 1rem; }
.tile { background: #f6f8fb; border-radius: 12px; padding: .7rem .8rem; display: flex; flex-direction: column; }
.tiles-big .tile { background: #fff; box-shadow: var(--shadow); padding: 1rem; }
.tile b { font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.tile span { color: var(--muted); font-size: .82rem; }
.tile-yellow { border-left: 5px solid var(--yellow); }
.tile-2min { border-left: 5px solid var(--orange); }
.tile-red { border-left: 5px solid var(--red); }

/* ---------- settings ---------- */
.seg { display: flex; gap: .4rem; background: #eef1f6; padding: .3rem; border-radius: 14px; margin-bottom: 1rem; }
.seg-btn { flex: 1; border: 0; background: transparent; border-radius: 11px; padding: .6rem .6rem; min-height: var(--tap); font-weight: 700; cursor: pointer; color: var(--ink2); display: flex; flex-direction: column; align-items: center; }
.seg-btn small { font-weight: 400; font-size: .78rem; color: var(--muted); }
.seg-btn.active { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, .1); }
.seg-small { margin: 0; padding: .2rem; }
.seg-small .seg-btn { min-height: 40px; padding: .3rem .8rem; white-space: nowrap; }
.switch-row { display: flex; align-items: center; gap: .7rem; min-height: var(--tap); cursor: pointer; }
.tb-list { list-style: none; padding: 0; margin: 0 0 .8rem; }
.tb-list li { display: flex; align-items: center; gap: .3rem; padding: .2rem .3rem; border: 1.5px solid var(--line); border-radius: 10px; margin-bottom: .4rem; background: #fff; }
.tb-n { width: 1.8rem; font-weight: 700; color: var(--muted); text-align: center; }
.tb-l { flex: 1; font-weight: 600; }
.copy-row { display: flex; gap: .5rem; margin-top: .8rem; }
.plain-list { list-style: none; padding: 0; margin: 0 0 .5rem; }
.plain-list li { display: flex; align-items: center; justify-content: space-between; padding: .2rem 0; }
.card-cta { background: linear-gradient(140deg, #fff, #eef4ff); }

/* ---------- teams ---------- */
.group-head { margin-top: 1.2rem; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.team-card { display: block; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.1rem; border-top: 5px solid var(--tc); color: var(--ink); }
.team-card:hover { text-decoration: none; box-shadow: 0 6px 20px rgba(20, 33, 61, .12); }
.team-card h3 { margin: 0 0 .3rem; color: var(--ink); font-size: 1.1rem; }
.team-card select { margin-top: .6rem; min-height: 40px; }
.team-title { display: flex; align-items: center; font-size: 1.4rem; }
.in-big { font-size: 1.25rem; font-weight: 700; }
.swatches { display: flex; flex-wrap: wrap; gap: .45rem; }
.swatch { width: 40px; height: 40px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--line); cursor: pointer; }
.swatch.active { box-shadow: 0 0 0 3px var(--ink); }
.role { display: inline-flex; width: 2rem; height: 2rem; align-items: center; justify-content: center; border-radius: 8px; background: var(--ink); color: #fff; font-weight: 700; }
.officials td { padding: .3rem .2rem; }
.roster-edit td { padding: .25rem .2rem; }
.roster-edit input { min-height: 44px; padding: .4rem .6rem; }
.in-num { width: 4rem; text-align: center; font-weight: 700; }
.in-year { width: 5rem; text-align: center; }
.invalid { border-color: var(--red) !important; background: #fff4f4; }
.roster tr.inactive td { opacity: .45; }
.roster tr.inactive td:nth-last-child(2) { opacity: 1; }
.toggle { position: relative; display: inline-block; width: 52px; height: 30px; cursor: pointer; }
.toggle input { opacity: 0; width: 0; height: 0; min-height: 0; position: absolute; }
.toggle span { position: absolute; inset: 0; background: #cfd5e0; border-radius: 30px; transition: .2s; }
.toggle span::before { content: ''; position: absolute; width: 24px; height: 24px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.toggle input:checked + span { background: var(--green); }
.toggle input:checked + span::before { transform: translateX(22px); }

/* ---------- schedule editor ---------- */
.sched-info { display: flex; flex-direction: column; gap: .2rem; }
.sched-row { display: grid; grid-template-columns: 2rem 4.4rem 3.4rem 1fr auto auto; align-items: center; gap: .5rem; padding: .3rem .3rem; border-bottom: 1px solid var(--line); min-height: 54px; }
.sched-row.m-live { background: #fff6f6; }
.sched-row.m-finished { background: #f5fbf7; }
.sched-teams { display: flex; align-items: center; flex-wrap: wrap; gap: .2rem; font-weight: 600; }
.vs { color: var(--muted); margin: 0 .4rem; }
.sched-btns { display: flex; }
@media (max-width: 700px) {
  .sched-row { grid-template-columns: 1.6rem 3.6rem 1fr auto; }
  .sched-row .m-tagcell, .sched-row > span:nth-child(5) { display: none; }
}

/* ---------- modal ---------- */
.modal-wrap { position: fixed; inset: 0; background: rgba(15, 22, 40, .5); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 1rem; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: #fff; border-radius: 18px; width: 100%; max-width: 560px; max-height: calc(100vh - 2rem); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); animation: pop .15s; }
@keyframes pop { from { transform: scale(.96); } }
.modal-wide { max-width: 860px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.2rem .4rem; }
.modal-head h2 { margin: 0; font-size: 1.3rem; }
.modal-body { padding: .6rem 1.2rem 1.2rem; overflow-y: auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1rem; }
.confirm-text { font-size: 1.05rem; }

/* ---------- toast ---------- */
#toasts { position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: .5rem; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: .75rem 1.3rem; border-radius: 12px; font-weight: 600; box-shadow: 0 8px 30px rgba(0, 0, 0, .25); opacity: 0; transform: translateY(10px); transition: .2s; max-width: 90vw; }
.toast.show { opacity: 1; transform: none; }
.toast-success { background: var(--green); }
.toast-error { background: var(--red); }
.toast-warn { background: #b86a00; }

/* ================= ZÁPIS ZÁPASU ================= */
.match-page { max-width: 1400px; margin: 0 auto; padding: .6rem .8rem 3rem; }
.match-top { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .6rem; }
.match-title { flex: 1; font-weight: 700; display: flex; align-items: center; gap: .5rem; min-width: 180px; }
.match-top-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

.scoreboard {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem;
  background: var(--ink); color: #fff; border-radius: 18px; padding: .9rem 1.2rem; margin-bottom: .8rem;
  position: sticky; top: 52px; z-index: 10; box-shadow: 0 6px 20px rgba(20, 33, 61, .25);
}
.sb-team { font-size: 1.35rem; font-weight: 800; display: flex; align-items: center; gap: .6rem; min-width: 0; }
.sb-team::before { content: ''; width: 14px; height: 40px; border-radius: 5px; background: var(--tc); flex: none; }
.sb-team:last-child { flex-direction: row-reverse; text-align: right; }
.sb-score { text-align: center; display: flex; flex-direction: column; }
.sb-nums { font-size: 2.8rem; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1; letter-spacing: .02em; }
.sb-score small { opacity: .75; font-size: .8rem; margin-top: .2rem; }
.sb-live .sb-nums { color: #ffd166; }
.tap-hint { text-align: center; color: var(--muted); margin: .2rem 0 .8rem; }

.match-cols { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
@media (max-width: 720px) { .match-cols { grid-template-columns: 1fr; } }
.side { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: .8rem; border-top: 6px solid var(--tc, #999); }
.side-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; }
.side-head h2 { margin: 0; font-size: 1.2rem; }
.side-score { font-size: 1.8rem; font-weight: 900; color: var(--tc); font-variant-numeric: tabular-nums; }
.pl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; }
.off-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; margin-top: .7rem; padding-top: .7rem; border-top: 1px dashed var(--line); }
.pl-btn {
  position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: .55rem;
  align-items: center; text-align: left; min-height: 64px; padding: .5rem .6rem; border-radius: 12px;
  border: 1.5px solid var(--line); background: #fbfcfe; cursor: pointer; transition: background .1s, transform .05s, border-color .1s;
}
.pl-btn:hover:not(:disabled) { border-color: var(--tc, var(--primary)); background: #fff; }
.pl-btn:active:not(:disabled) { transform: scale(.97); background: #eef4ff; }
.pl-btn:disabled { cursor: default; color: inherit; }
.pl-num {
  grid-row: 1 / 3; width: 2.6rem; height: 2.6rem; border-radius: 10px; background: var(--tc, var(--ink)); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 1.2rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .3);
}
.pl-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.pl-name b, .pl-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-name small { color: var(--muted); }
.pl-badges { display: flex; gap: .25rem; align-items: center; min-height: 0; }
.pl-badges:empty { display: none; }
.b-card { display: inline-block; width: 12px; height: 16px; border-radius: 2px; }
.b-yellow { background: var(--yellow); }
.b-red { background: var(--red); }
.b-blue { background: var(--blue); box-shadow: 4px 0 0 var(--red); margin-right: 4px; }
.b-2min { font-style: normal; font-size: .75rem; font-weight: 800; background: #ffe8cc; color: #9a4f00; padding: 0 .3rem; border-radius: 4px; }
.pl-goals {
  position: absolute; top: -8px; right: -6px; min-width: 26px; height: 26px; padding: 0 .35rem; border-radius: 13px;
  background: var(--green); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: .9rem;
  box-shadow: 0 2px 6px rgba(31, 157, 85, .4);
}
.pl-disq { background: #fff1f1; border-color: #f3c7c7; }
.pl-disq .pl-num { background: #b9b9b9; }
.pl-disq .pl-name b { text-decoration: line-through; }
.pl-official .pl-num { background: #4a5672; border-radius: 50%; }
.side-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .8rem; }
.match-bottom { display: grid; grid-template-columns: 2fr 1fr; gap: .8rem; margin-top: .8rem; align-items: start; }
@media (max-width: 900px) { .match-bottom { grid-template-columns: 1fr; } }

.ev-log ul { list-style: none; padding: 0; margin: 0; max-height: 420px; overflow-y: auto; }
.ev-log li { display: grid; grid-template-columns: 3.6rem 3rem 11rem 1fr 40px; align-items: center; gap: .4rem; padding: .3rem .2rem; border-bottom: 1px solid var(--line); font-size: .93rem; }
.ev-half { color: var(--muted); font-size: .8rem; }
.ev-score { font-weight: 800; font-variant-numeric: tabular-nums; }
.ev-type { display: flex; align-items: center; gap: .4rem; font-weight: 600; }
.ev-ico { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.ev-ico.ev-goal { background: var(--green); border-radius: 50%; }
.ev-ico.ev-miss { background: #c4cad6; border-radius: 50%; }
.ev-ico.ev-yellow { background: var(--yellow); }
.ev-ico.ev-2min { background: var(--orange); }
.ev-ico.ev-red { background: var(--red); }
.ev-ico.ev-blue { background: var(--blue); }
.ev-who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 600px) { .ev-log li { grid-template-columns: 3rem 2.6rem 1fr 40px; } .ev-who { grid-column: 1 / 4; } }

/* popup hráčky */
.person-modal .modal-head h2 { font-size: 1.5rem; }
.pm-team { display: inline-block; padding: .2rem .7rem; border-radius: 8px; background: var(--tc); color: #fff; font-weight: 700; margin-bottom: .6rem; }
.pm-summary { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: .8rem; min-height: 1.6rem; }
.act-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
.act {
  min-height: 76px; border-radius: 14px; border: 0; cursor: pointer; font-size: 1.1rem; color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; transition: transform .05s, filter .1s;
}
.act b { font-size: 1.2rem; }
.act small { font-size: .78rem; opacity: .85; }
.act:active:not(:disabled) { transform: scale(.97); filter: brightness(.92); }
.act-wide { grid-column: 1 / -1; min-height: 96px; }
.act-wide b { font-size: 2rem; letter-spacing: .06em; }
.act-goal { background: var(--green); }
.act-goal2 { background: #2fb36a; }
.act-miss { background: #8a93a6; }
.act-yellow { background: var(--yellow); color: #3b2f00; }
.act-2min { background: var(--orange); }
.act-red { background: var(--red); }
.act-blue { background: var(--blue); }
.act-disabled { opacity: .3; cursor: not-allowed; }
.pm-reasons { margin-top: .8rem; background: #fff8e6; border-radius: 10px; padding: .2rem .8rem; color: #7a5600; font-size: .92rem; }
.pm-events { list-style: none; padding: 0; margin: 0; }
.pm-events li { display: grid; grid-template-columns: 4rem 1fr auto; align-items: center; gap: .5rem; padding: .3rem 0; border-bottom: 1px solid var(--line); }
.row-num-name { display: grid; grid-template-columns: 5rem 1fr 6rem; gap: .6rem; }
.close-score { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center; font-weight: 700; font-size: 1.1rem; }
.close-score span:last-child { text-align: right; }
.close-score b { font-size: 2.4rem; }
.shootout { background: #fff8e6; border-radius: 12px; padding: .6rem .9rem; margin: .8rem 0; }

@media (max-width: 600px) {
  .sb-team { font-size: 1rem; }
  .sb-nums { font-size: 2rem; }
  .row2, .row3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .hero { padding: 1.3rem; }
  .filters { flex-direction: column; }
  .filters select { max-width: none; }
}

/* ================= LIVE, oblíbený tým, start, úpravy ================= */
.live-badge {
  display: inline-flex; align-items: center; gap: .35rem; background: var(--red); color: #fff; font-weight: 800;
  font-size: .72rem; letter-spacing: .08em; padding: .18rem .55rem .18rem .45rem; border-radius: 99px; line-height: 1.2;
  box-shadow: 0 0 0 0 rgba(214, 40, 40, .6); animation: livering 1.6s infinite; white-space: nowrap;
}
.live-badge i { width: .5rem; height: .5rem; border-radius: 50%; background: #fff; animation: liveblink 1s infinite; }
@keyframes livering { 0% { box-shadow: 0 0 0 0 rgba(214, 40, 40, .55); } 70% { box-shadow: 0 0 0 9px rgba(214, 40, 40, 0); } 100% { box-shadow: 0 0 0 0 rgba(214, 40, 40, 0); } }
@keyframes liveblink { 50% { opacity: .25; } }
.m-score .live-badge { margin: .25rem auto 0; font-size: .62rem; padding: .1rem .45rem .1rem .35rem; }
.sb-live-badge { margin-bottom: .3rem; }
.sb-live-badge .live-badge { font-size: .85rem; padding: .25rem .8rem .25rem .6rem; }
.sb-live { box-shadow: 0 0 0 3px rgba(214, 40, 40, .55), 0 6px 20px rgba(20, 33, 61, .25); }

/* oblíbený tým */
.fav-select { display: inline-flex; align-items: center; gap: .3rem; border: 1.5px solid var(--line); border-radius: 12px; padding-left: .6rem; background: #fff; }
.fav-select select { border: 0; min-height: 40px; width: auto; max-width: 220px; padding-left: .2rem; background: transparent; box-shadow: none; }
.fav-select.active { border-color: #f5b301; background: #fff8e1; }
.t-head-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.t-note { margin: .5rem 0 0; color: var(--ink2); }
.m-row.fav { background: #fff8e1; }
.m-row.fav .m-team { color: var(--ink); }
.overview .m-row.fav { box-shadow: inset 4px 0 0 #f5b301; }
.overview .m-row.fav.m-live { box-shadow: inset 4px 0 0 var(--red); }
.table tr.fav td { background: #fff3c4 !important; font-weight: 700; }
.ranking li.fav { background: #fff3c4; border-radius: 8px; padding-left: .5rem; }
.team-card.fav { background: #fff8e1; box-shadow: 0 0 0 2px #f5b301, var(--shadow); }
.sb-team.fav::after { content: '⭐'; font-size: 1rem; }

/* karta „další zápas“ / „právě se hraje“ */
.now-card { padding: .8rem 1rem 1rem; border-left-width: 6px; }
.now-card.next { background: linear-gradient(135deg, #fff, #eef4ff); border-left-color: var(--primary); }
.now-card.live { background: linear-gradient(135deg, #fff, #fff0f0); }
.now-card .m-row {
  background: transparent !important; box-shadow: none !important; border: 0;
  grid-template-columns: 1.8rem 3.8rem minmax(0, 1fr) auto minmax(0, 1fr); min-height: 76px;
}
.now-card .m-st { display: none; }
.now-card .m-team { font-size: 1.35rem; font-weight: 800; color: var(--ink); }
.now-card .m-team .dot { width: .95rem; height: .95rem; }
.now-card .m-time { font-size: 1.1rem; }
.now-card .m-score { font-size: 1.8rem; min-width: 6rem; }
.now-label { display: flex; align-items: center; gap: .5rem; font-size: .85rem; }
.now-cta {
  display: flex; align-items: center; justify-content: center; margin-top: .3rem; min-height: 44px; border-radius: 10px;
  border: 1.5px solid currentColor; color: var(--primary); font-weight: 700; font-size: 1rem; transition: background .12s;
}
.now-card.live .now-cta { color: var(--red); }
.now-card:hover .now-cta { background: rgba(29, 95, 209, .07); }
.now-card.live:hover .now-cta { background: rgba(214, 40, 40, .07); }
@media (max-width: 600px) {
  .now-card .m-row { grid-template-columns: 1.4rem 3rem minmax(0, 1fr) auto minmax(0, 1fr); }
  .now-card .m-team { font-size: 1.05rem; }
}

/* zahájit zápas */
.start-box { display: flex; align-items: center; justify-content: center; gap: .8rem; flex-wrap: wrap; margin: 0 0 .8rem; }
.start-box span { font-size: .88rem; }
.btn-start { background: var(--green); border-color: var(--green); color: #fff; font-size: 1.05rem; padding: .5rem 1.6rem; }
.btn-start:hover { background: #18834a; }

/* průběh zápasu – úpravy */
.ev-hint { margin: -.3rem 0 .5rem; }
.ev-log li.ev-edit { cursor: pointer; border-radius: 8px; }
.ev-log li.ev-edit:hover { background: #f3f6fb; }
.ev-log li.ev-edit:active { background: #e8eef8; }
.ev-pen { color: var(--muted); text-align: center; }
.ev-team { display: inline-flex; align-items: center; gap: .4rem; }
.ev-team::before { content: ''; width: 6px; height: 1em; border-radius: 3px; background: var(--tc); }
.ee-row { display: flex; align-items: center; gap: .8rem; margin-bottom: .8rem; flex-wrap: wrap; }
.ee-label { font-size: .85rem; font-weight: 700; color: var(--ink2); min-width: 5.5rem; display: block; margin-bottom: .4rem; }
.ee-row .ee-label { margin: 0; }
.ee-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .4rem; max-height: 320px; overflow-y: auto; padding: 2px; }
.ee-p { display: flex; align-items: center; gap: .5rem; min-height: 48px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; text-align: left; padding: .3rem .5rem; }
.ee-p b { min-width: 2rem; height: 2rem; border-radius: 8px; background: var(--tc); color: #fff; display: flex; align-items: center; justify-content: center; }
.ee-p span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.ee-p.ee-off b { border-radius: 50%; background: #4a5672; }
.ee-p.active { border-color: var(--primary); background: #eaf1ff; box-shadow: 0 0 0 2px var(--primary); }
.ee-actions { align-items: center; }
.ee-actions .spacer { flex: 1; }
.ee-modal { max-width: 680px; }

/* nastavení viditelnosti */
.switch-row span { display: flex; flex-direction: column; }
.sw-sub { color: var(--muted); font-size: .8rem; }
.radio-list { display: flex; flex-direction: column; gap: .4rem; }
.radio-row { display: flex; align-items: center; gap: .7rem; padding: .55rem .8rem; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; }
.radio-row input { width: 20px; min-height: 20px; height: 20px; flex: none; accent-color: var(--primary); }
.radio-row span { display: flex; flex-direction: column; }
.radio-row small { color: var(--muted); }
.radio-row.active { border-color: var(--primary); background: #f2f7ff; }

/* náhled pro veřejnost a skupiny nastavení */
.preview-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  background: #fff3c4; border: 1.5px solid #f5b301; border-radius: 12px; padding: .6rem 1rem; margin-bottom: 1rem;
}
.pb-warn { color: var(--red); }
.vis-group { border: 1.5px solid var(--line); border-radius: 12px; padding: .2rem .9rem .6rem; margin-bottom: .8rem; }
.vis-group h3 { margin: .7rem 0 .2rem; color: var(--ink); }
.vis-q { margin: .6rem 0 .4rem; }
.vis-example { background: #f6f8fb; border-radius: 12px; padding: .2rem .9rem .8rem; margin-bottom: .8rem; }
.vis-example h3 { margin: .7rem 0 .5rem; color: var(--ink); }
.vis-cols { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
@media (max-width: 600px) { .vis-cols { grid-template-columns: 1fr; } }
.vis-tag { display: inline-block; font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--green); margin-bottom: .3rem; }
.vis-tag.vis-live { color: var(--red); }
.vis-log { list-style: none; margin: 0; padding: 0; background: #fff; border-radius: 8px; }
.vis-log li { display: grid; grid-template-columns: 2.4rem 6.5rem 1fr; gap: .3rem; align-items: center; padding: .35rem .5rem; border-bottom: 1px solid var(--line); font-size: .85rem; }
.vis-log li:last-child { border: 0; }

/* ================= PRŮBĚH ZÁPASU: domácí vlevo, hosté vpravo ================= */
.tl-head { display: grid; grid-template-columns: 1fr 5.5rem 1fr; gap: .4rem; padding: 0 0 .4rem; border-bottom: 2px solid var(--line); margin-bottom: .2rem; }
.tl-head .tl-team { display: flex; align-items: center; gap: .4rem; font-weight: 800; font-size: .95rem; }
.tl-head .tl-team::before { content: ''; width: 10px; height: 18px; border-radius: 3px; background: var(--tc); flex: none; }
.tl-head .tl-team:first-child { justify-content: flex-start; flex-direction: row-reverse; text-align: right; }
.tl ul { list-style: none; margin: 0; padding: 0; max-height: 460px; overflow-y: auto; }
.tl .tl-row { display: grid; grid-template-columns: minmax(0, 1fr) 5.5rem minmax(0, 1fr); gap: .4rem; align-items: center; min-height: 44px; padding: 0; border-bottom: 1px solid var(--line); font-size: .93rem; }
.tl-row:last-child { border-bottom: 0; }
.tl-cell { display: flex; align-items: center; min-width: 0; padding: .3rem .5rem; border-radius: 8px; }
.tl-home { justify-content: flex-end; text-align: right; }
.tl-home:not(:empty) { background: linear-gradient(270deg, color-mix(in srgb, var(--tc) 13%, #fff), #fff 85%); box-shadow: inset -4px 0 0 var(--tc); }
.tl-away:not(:empty) { background: linear-gradient(90deg, color-mix(in srgb, var(--tc) 13%, #fff), #fff 85%); box-shadow: inset 4px 0 0 var(--tc); }
.tl-ev { display: inline-flex; align-items: center; gap: .45rem; min-width: 0; max-width: 100%; flex-wrap: nowrap; }
.tl-home .tl-ev { flex-direction: row-reverse; }
.tl-ev .ev-ico { flex: none; }
.tl-type { font-weight: 700; white-space: nowrap; flex: none; }
.tl-who { color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tl-mid { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.tl-score { font-size: 1.15rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.tl-mid small { color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; }
.tl-goalrow .tl-type { color: var(--green); }
.tl-row.ev-edit { cursor: pointer; }
.tl-row.ev-edit:hover { background: #f6f8fb; }
.tl-row.ev-edit:active { background: #eaf0f9; }
.tl-mini ul { max-height: none; }
.tl-mini .tl-row { min-height: 38px; font-size: .85rem; }
.switch-row input { flex: none; }
@media (max-width: 1300px) { .tl .tl-ev { flex-wrap: wrap; } .tl-home .tl-ev { justify-content: flex-end; } }
.ev-log { min-width: 0; }
@media (max-width: 600px) {
  .tl-head, .tl-row { grid-template-columns: 1fr 3.8rem 1fr; }
  .tl-who { font-size: .82rem; }
}

/* ================= ČASOMÍRA ================= */
.sb-clock { display: flex; align-items: center; justify-content: center; gap: .4rem; margin-top: .35rem; }
.sb-time {
  font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .04em;
  background: rgba(255, 255, 255, .1); border-radius: 8px; padding: .05rem .6rem; color: #fff;
}
.sb-clock.running .sb-time { color: #7dffb0; }
.clk-btn { border: 0; border-radius: 8px; min-height: 36px; padding: 0 .8rem; font-weight: 800; cursor: pointer; color: #fff; }
.clk-btn.go { background: var(--green); }
.clk-btn.stop { background: var(--orange); }
.clk-btn.clk-edit { background: rgba(255, 255, 255, .15); padding: 0 .6rem; }
.live-min { font-variant-numeric: tabular-nums; margin-left: .15rem; }
.susp { display: inline-flex; align-items: center; gap: .15rem; font-size: .72rem; font-weight: 800; color: #fff; background: var(--orange); border-radius: 4px; padding: 0 .3rem; font-variant-numeric: tabular-nums; animation: liveblink 1s infinite; }
.susp[hidden] { display: none; }
.ee-time-label { min-width: 0; margin: 0 0 0 1rem !important; }
.ee-time { width: 6rem; min-height: 40px; text-align: center; font-weight: 700; }

/* ================= NASTAVENÍ – svislé, široké sekce ================= */
.settings-v { max-width: 1180px; margin: 0 auto; }
.set-nav {
  display: flex; gap: .3rem; flex-wrap: wrap; position: sticky; top: 104px; z-index: 15; background: var(--bg);
  padding: .4rem 0 .6rem; margin-bottom: .4rem;
}
.set-nav a { padding: .35rem .8rem; border-radius: 99px; background: #fff; border: 1.5px solid var(--line); font-size: .85rem; font-weight: 600; color: var(--ink2); }
.set-nav a:hover { text-decoration: none; border-color: var(--primary); color: var(--primary); }
.set-sec {
  display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 1.5rem; background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.4rem 1.5rem; margin-bottom: 1.2rem; scroll-margin-top: 160px;
}
.set-head { display: flex; gap: .8rem; align-items: flex-start; }
.set-head h2 { margin: .15rem 0 .4rem; font-size: 1.2rem; }
.set-head p { margin: 0; color: var(--muted); font-size: .9rem; }
.set-num { flex: none; width: 2rem; height: 2rem; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.set-body { min-width: 0; }
.set-body > .seg { max-width: 620px; }
.row4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; }
.row-inline { display: grid; grid-template-columns: 220px 1fr; gap: 1rem; align-items: center; }
.row-inline .hint { margin: 0; }
.btn-row { display: flex; gap: .6rem; flex-wrap: wrap; }
.option-card { display: flex; gap: .8rem; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 12px; padding: .8rem 1rem; cursor: pointer; margin-top: .4rem; }
.option-card input { margin-top: .2rem; flex: none; }
.option-card span { display: flex; flex-direction: column; gap: .2rem; }
.option-card small { color: var(--muted); }
.option-card.active { border-color: var(--green); background: #f0fbf4; }
.vis-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; margin-top: .4rem; }
.vis-grid .vis-group { margin: 0; }
.vis-names { margin: 1rem 0; }
.vis-names h3 { margin: 0 0 .5rem; color: var(--ink); }
.radio-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.radio-cols .radio-row { align-items: flex-start; }
.vis-example { background: #f3f6fb; border: 1.5px dashed #c9d4e6; padding: .4rem 1rem 1rem; }
.vis-cols > div { background: #fff; border-radius: 10px; padding: .6rem .8rem; }
.vis-empty { padding: .8rem 0; margin: 0; }
.vis-actions { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-top: .4rem; }
.vis-actions .copy-row { margin: 0; flex: 1; min-width: 280px; }
.set-cta { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.set-cta h2 { margin-bottom: .2rem; }
.set-cta p { margin: 0; }
@media (max-width: 980px) {
  .set-sec { grid-template-columns: 1fr; gap: .8rem; }
  .vis-grid, .radio-cols { grid-template-columns: 1fr; }
  .row4 { grid-template-columns: 1fr 1fr; }
  .row-inline { grid-template-columns: 1fr; }
}

/* hrací dny */
.days { margin: .6rem 0 .4rem; }
.days-head, .day-row { display: grid; grid-template-columns: 7.5rem 4.5rem 8.5rem 8.5rem 1fr; gap: .7rem; align-items: center; }
.days-head { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; padding: 0 .6rem .3rem; }
.day-row { padding: .45rem .6rem; border: 1.5px solid var(--line); border-radius: 12px; margin-bottom: .4rem; background: #fff; }
.day-row input[type=time] { min-height: 44px; }
.day-row.off { background: #f6f7f9; color: var(--muted); }
.day-info { font-size: .88rem; color: var(--ink2); }
.day-info.warn, .m-time.warn { color: #b45309; font-weight: 700; }
@media (max-width: 700px) {
  .days-head { display: none; }
  .day-row { grid-template-columns: 1fr auto; }
  .day-row .day-info { grid-column: 1 / -1; }
}

/* evidované události */
.ev-toggles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .6rem; }
.ev-toggle { display: flex; align-items: flex-start; gap: .6rem; padding: .7rem .9rem; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; }
.ev-toggle input { flex: none; margin-top: .1rem; }
.ev-toggle .ev-ico { margin-top: .35rem; }
.ev-toggle span { display: flex; flex-direction: column; }
.ev-toggle small { color: var(--muted); font-size: .8rem; }
.ev-toggle.on { border-color: #b9d3f7; background: #f5f9ff; }
.ev-toggle:not(.on) { opacity: .65; }

/* ================= PRŮVODCE PŘÍPRAVOU ================= */
.wizard {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow); padding: .7rem 1rem; margin-bottom: 1rem; border-left: 5px solid var(--primary);
}
.wiz-title { display: flex; flex-direction: column; min-width: 150px; }
.wiz-title span { font-size: .82rem; color: var(--primary); font-weight: 600; }
.wiz-steps { list-style: none; display: flex; gap: .4rem; margin: 0; padding: 0; flex: 1; flex-wrap: wrap; }
.wiz-steps li { flex: 1; min-width: 160px; }
.wiz-steps a {
  display: flex; align-items: center; gap: .55rem; padding: .45rem .7rem; border-radius: 12px; border: 1.5px solid var(--line);
  color: var(--ink); height: 100%;
}
.wiz-steps a:hover { text-decoration: none; border-color: var(--primary); }
.wiz-n { flex: none; width: 1.9rem; height: 1.9rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; background: #eef1f6; color: var(--ink2); }
.wiz-l { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.wiz-l b { font-size: .9rem; }
.wiz-l small { color: var(--muted); font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wiz-steps li.done .wiz-n { background: var(--green); color: #fff; }
.wiz-steps li.next a { border-color: var(--primary); background: #f2f7ff; }
.wiz-steps li.next .wiz-n { background: var(--primary); color: #fff; }
.wiz-steps li.current a { box-shadow: 0 0 0 2px var(--primary); }
.next-step {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: linear-gradient(135deg, #eef4ff, #fff);
  border: 1.5px solid #b9d3f7; border-radius: var(--radius); padding: 1rem 1.2rem; margin: 1rem 0; color: var(--ink);
}
.next-step:hover { text-decoration: none; border-color: var(--primary); }
.next-step span:first-child { display: flex; flex-direction: column; gap: .2rem; }
.next-step b { color: var(--primary); font-size: 1.05rem; }
.next-step small { color: var(--ink2); }
.ns-arrow { font-size: 1.8rem; color: var(--primary); font-weight: 800; }
.format-grid { display: grid; grid-template-columns: minmax(300px, 1.3fr) auto 1.3fr auto; gap: 1rem; align-items: end; }
.format-grid .seg { margin: 0; }
.format-grid .field, .format-grid .switch-row { margin: 0; }
@media (max-width: 1000px) { .format-grid { grid-template-columns: 1fr 1fr; } .format-grid .seg { grid-column: 1 / -1; } }
.confirm-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin: .4rem 0 .8rem; }
.set-sec.flash { animation: flash 1.6s; }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 3px var(--primary), var(--shadow); } 100% { box-shadow: var(--shadow); } }

/* ================= TISK ================= */
.print-area { background: #fff; padding: 1rem; border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
.sheet { margin-bottom: 2rem; }
.pr-head { font-size: 1.15rem; margin-bottom: .5rem; }
.pr-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.pr-table th, .pr-table td { border: 1px solid #333; padding: .2rem .3rem; text-align: center; }
.pr-table th { font-weight: 600; background: #f3f3f3; }
.pr-table .left { text-align: left; }
.pr-table .top { vertical-align: top; }
.pr-team { font-size: 1rem; font-weight: 800; margin: .2rem 0 .2rem 1rem; }
.pr-opp { font-weight: 800; font-size: .9rem; min-height: 1.2em; }
.pr-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.pr-match-score { font-size: 1.4rem; text-align: center; margin: 1rem 0; }
.pr-match-score b { font-size: 2rem; margin: 0 1rem; }
.pr-match-score small { display: block; font-size: .9rem; color: #555; }
.pr-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem 2rem; margin-top: 2rem; }
.pr-sign div { display: flex; flex-direction: column; gap: 1.6rem; }
.pr-sign span { border-bottom: 1px solid #333; }

@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body { background: #fff; }
  .topbar, .tabs, .t-head, .no-print, #toasts { display: none !important; }
  .page { padding: 0; max-width: none; }
  .print-area { box-shadow: none; padding: 0; overflow: visible; }
  .sheet { page-break-after: always; break-after: page; }
  .sheet:last-child { page-break-after: auto; }
  .pr-table th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .table th, .table td { padding: .2rem .3rem; }
}

/* ================= průvodce, výběr času, správa turnajů ================= */

/* nadcházející zápas – lehce modře (probíhající je červeně) */
.m-row.m-next, .sched-row.m-next { background: #eef5ff; }
.overview .m-row.m-next { box-shadow: inset 4px 0 0 var(--primary); }
.overview .m-row.fav.m-next { box-shadow: inset 4px 0 0 var(--primary); }
a.m-row.m-next:hover { background: #e2eeff; }

/* mezera mezi hracími dny v seznamu zápasů */
.m-list .day-head:not(:first-child), .sched-list .day-head:not(:first-child) {
  margin-top: 1.4rem; border-top: 2px solid var(--line); padding-top: 1rem;
}
.day-head { color: var(--ink2); }

/* výběr času */
.tp { display: inline-flex; }
.tp-btn {
  display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; padding: .35rem .9rem; border-radius: 10px;
  border: 1.5px solid var(--line); background: #fff; cursor: pointer; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.tp-btn b { font-size: 1.05rem; }
.tp-btn:hover:not(:disabled) { border-color: var(--primary); }
.tp-btn:disabled { opacity: .5; cursor: default; }
.tp-empty .tp-btn b { font-weight: 500; color: var(--muted); font-size: .9rem; }
.tp-ico { font-size: .95rem; }
.field > .tp, .field > .tp .tp-btn { width: 100%; }
.tp-modal { max-width: 460px; }
.tp-big { text-align: center; font-size: 2.6rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--primary); margin: .2rem 0 .6rem; letter-spacing: .02em; }
.tp-label { font-size: .78rem; font-weight: 700; text-transform: uppercase; color: var(--muted); margin: .6rem 0 .3rem; }
.tp-grid { display: grid; gap: .35rem; }
.tp-hours { grid-template-columns: repeat(6, 1fr); }
.tp-mins { grid-template-columns: repeat(6, 1fr); }
.tp-cell {
  min-height: 44px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; cursor: pointer;
  font-weight: 700; font-variant-numeric: tabular-nums;
}
.tp-cell:hover { border-color: var(--primary); }
.tp-cell.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.tp-fine { display: flex; gap: .5rem; justify-content: center; margin-top: .7rem; }
.tp-clear { margin-right: auto; }
@media (min-width: 701px) { .days-head, .day-row { grid-template-columns: 7.5rem 4.5rem 9.5rem 10.5rem 1fr; } }
.field > .tp, .field > .cat-pick { font-size: inherit; font-weight: inherit; color: inherit; margin-bottom: 0; }
.field > .tp { display: flex; }
.field > .cat-pick { display: flex; }

/* hezčí rozbalovací seznam */
.cat-pick { display: flex; flex-direction: column; gap: .5rem; }
.nice-select { position: relative; display: block; }
.nice-select select { appearance: none; -webkit-appearance: none; padding-right: 2.6rem; cursor: pointer; font-weight: 600; background: #fff; }
.nice-select::after {
  content: ''; position: absolute; right: 1rem; top: 50%; width: .55rem; height: .55rem; margin-top: -.4rem;
  border-right: 2.5px solid var(--ink2); border-bottom: 2.5px solid var(--ink2); transform: rotate(45deg); pointer-events: none;
}
.nice-select select:hover { border-color: #b9c3d6; }

/* průvodce – samostatný krok a navigace mezi kroky */
.wiz-step-head { margin: 0 0 1rem; }
.wiz-step-head h2 { font-size: 1.4rem; margin: .1rem 0 0; }
.wiz-step-n { font-size: .8rem; font-weight: 700; text-transform: uppercase; color: var(--primary); letter-spacing: .04em; }
.wiz-nav {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.2rem; margin: 1rem 0;
}
.wiz-nav .btn-primary { margin-left: auto; }

/* HOTOVO u soupisky */
.done-bar { display: flex; justify-content: flex-end; margin: 1rem 0; }
.done-bar .btn { min-width: 260px; }

/* správa turnajů */
.manage { padding: 0; overflow: hidden; }
.manage-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem 1.1rem; border-bottom: 1.5px solid var(--line); background: #f8fafc; }
.manage-bar .switch-row { margin: 0; }
.manage-list { list-style: none; margin: 0; padding: 0; }
.manage-list li {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; gap: .9rem; align-items: center;
  padding: .7rem 1.1rem; border-bottom: 1px solid var(--line);
}
.manage-list li:last-child { border-bottom: 0; }
.manage-list li.picked { background: #fff4f4; }
.manage-main { display: flex; flex-direction: column; min-width: 0; }
.manage-main small { color: var(--muted); }
.manage-state { display: flex; gap: .3rem; }
@media (max-width: 700px) {
  .manage-list li { grid-template-columns: auto minmax(0, 1fr) auto; }
  .manage-state { display: none; }
  .manage-list li > a.btn { display: none; }
}

/* ================= odkazy na týmy a hráče ================= */
.tlink, .plink { color: inherit; display: inline-flex; align-items: center; min-width: 0; max-width: 100%; }
.tlink span { overflow: hidden; text-overflow: ellipsis; }
.tlink:hover, .plink:hover { color: var(--primary); }
.sc-who small .tlink { font-weight: 400; }

/* ================= řádek zápasu – souměrný, skóre uprostřed ================= */
.m-row, .now-card .m-row { --mside: 4.4rem; grid-template-columns: var(--mside) minmax(0, 1fr) auto minmax(0, 1fr) var(--mside); }
.m-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.m-meta .m-time { font-size: .98rem; font-weight: 700; }
.m-meta .m-num { text-align: left; font-size: .72rem; font-weight: 600; }
.m-meta small { font-size: .72rem; color: var(--muted); }
.m-side { display: flex; justify-content: flex-end; min-width: 0; }
.m-side .tag { font-size: .7rem; white-space: normal; line-height: 1.15; padding: .1rem .35rem; max-width: 100%; overflow-wrap: anywhere; }
.now-card .m-row { min-height: 76px; }
@media (max-width: 600px) {
  .m-row, .now-card .m-row { --mside: 2.8rem; gap: .3rem; padding: .4rem .3rem; }
  .m-meta .m-time { font-size: .85rem; }
  .m-team { font-size: .9rem; }
  .m-score { min-width: 3.2rem; font-size: 1.05rem; }
  .m-side .tag { font-size: .6rem; padding: .05rem .2rem; }
  .now-card .m-team { font-size: 1rem; }
  .now-card .m-score { font-size: 1.4rem; min-width: 4rem; }
  .m-home .dot, .m-away .dot { width: .55rem; height: .55rem; }
}

/* ================= tabulka vzájemných zápasů ================= */
.grid-2 > .card-full { grid-column: 1 / -1; }
.cross { font-size: .9rem; }
.cross th, .cross td { padding: .35rem .25rem; }
.cross td { min-width: 2.8rem; white-space: nowrap; }
.cross tbody th { font-size: .92rem; text-transform: none; color: var(--ink); font-weight: 600; border-bottom: 1px solid var(--line); }
.cross-name { position: sticky; left: 0; z-index: 1; background: #fff; white-space: nowrap; text-align: left; }
.cross tr.fav .cross-name { background: #fff3c4; }
.cross-n {
  display: inline-flex; align-items: center; justify-content: center; width: 1.6rem; height: 1.6rem; border-radius: 6px;
  background: var(--tc); color: #fff; font-weight: 800; font-size: .78rem; margin-right: .45rem; flex: none;
}
thead .cross-n { margin: 0; }
.cross-name .tlink { vertical-align: middle; max-width: 15rem; }
.cr { display: block; font-weight: 700; }
.cr-w { color: var(--green); }
.cr-l { color: var(--red); }
.cr-d { color: var(--ink2); }
@media (max-width: 600px) { .cross-name .tlink { max-width: 8.5rem; } }

/* ================= zápis zápasu – veřejný pohled ================= */
.match-bottom-public { grid-template-columns: minmax(0, 900px); justify-content: center; }
a.sb-team { color: #fff; }
a.sb-team:hover { text-decoration: none; }
a.sb-team:hover span { text-decoration: underline; }
.sb-team span { min-width: 0; overflow-wrap: break-word; line-height: 1.15; }
a.pl-btn { color: inherit; text-decoration: none; }
.tl-team a { color: inherit; }

/* ================= profil hráče, detail týmu ================= */
.player-head, .team-head { display: flex; align-items: center; gap: 1rem; border-top: 6px solid var(--tc); }
.player-num {
  width: 4.2rem; height: 4.2rem; border-radius: 14px; background: var(--tc); color: #fff; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 1.9rem; font-weight: 900; text-shadow: 0 1px 2px rgba(0, 0, 0, .3);
}
.player-id { flex: 1; min-width: 0; }
.player-id h1, .team-head h1 { margin: 0 0 .15rem; font-size: 1.6rem; overflow-wrap: anywhere; }
.team-head h1 { flex: 1; margin: 0; }
.player-rank { display: flex; flex-direction: column; align-items: center; flex: none; }
.player-rank b { font-size: 1.9rem; line-height: 1; }
.player-rank span { font-size: .78rem; color: var(--muted); }
.tile b small { font-size: .95rem; color: var(--muted); font-weight: 600; }
.res { display: inline-block; min-width: 3.2rem; padding: .15rem .45rem; border-radius: 6px; font-weight: 800; }
.res-w { background: var(--green-l); color: var(--green); }
.res-l { background: #fdecec; color: var(--red); }
.res-d { background: #eef1f6; color: var(--ink2); }
.res-live { background: #ffe5e5; color: var(--red); font-size: .75rem; }
.pm-when { display: block; font-size: .75rem; font-weight: 400; }
.gbar { position: relative; display: flex; align-items: center; gap: .35rem; min-width: 6.5rem; min-height: 1.5rem; }
.gbar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; background: color-mix(in srgb, var(--green) 20%, #fff); }
.gbar b, .gbar small { position: relative; }
.gbar b { padding-left: .45rem; }
.gbar small { color: var(--muted); }
.team-view { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; align-items: start; }
@media (max-width: 900px) { .team-view { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) {
  .player-head { gap: .7rem; padding: .9rem; }
  .player-num { width: 3.2rem; height: 3.2rem; font-size: 1.4rem; }
  .player-id h1, .team-head h1 { font-size: 1.3rem; }
  .player-rank b { font-size: 1.4rem; }
}

/* obsah pro vyhledávače, než se načte aplikace */
.seo-content { max-width: 900px; margin: 0 auto; padding: 1.2rem 1rem; color: var(--ink2); }
.seo-content + .loading { display: none; }

/* ================= telefony – drobnosti ================= */
.user-name { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


@media (max-width: 600px) {
  .topbar { gap: .5rem; padding-left: .7rem; padding-right: .7rem; }
  .brand { font-size: 1rem; }
  .user-name { max-width: 6.5rem; font-size: .82rem; }
  #sync .sync { font-size: .75rem; padding: .2rem .5rem; }
  .t-head { flex-direction: column; align-items: stretch; }
  .t-head h1 { font-size: 1.35rem; }
  .t-head-actions { justify-content: flex-start; }
  .fav-select { max-width: 100%; min-width: 0; flex: 1 1 10rem; }
  .fav-select select { max-width: none; width: 100%; min-width: 0; }
  .table .opt { display: none; }
  .table th, .table td { padding-left: .25rem; padding-right: .25rem; }
}
/* položky mřížky se smí zúžit (jinak je roztáhne široká tabulka uvnitř) */
.grid-2 > *, .team-view > *, .overview > *, .match-cols > *, .match-bottom > * { min-width: 0; }
.sched-teams { min-width: 0; overflow-wrap: anywhere; }
#sync { min-width: 0; overflow: hidden; }
#sync .sync { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 900px) {
  .cross td { min-width: 2.3rem; font-size: .82rem; }
  .cross-name .tlink { max-width: 10rem; }
}
@media (max-width: 600px) {
  .tl-head, .tl-row, .tl .tl-row { grid-template-columns: minmax(0, 1fr) 3.6rem minmax(0, 1fr); }
  .sched-row { grid-template-columns: 1.6rem 3.4rem minmax(0, 1fr) auto; gap: .3rem; }
  .sched-btns .btn-icon { width: 34px; height: 38px; }
  .btn-row .btn { white-space: normal; text-align: left; justify-content: flex-start; }
  .player-matches .pm-link { display: none; }
  .gbar { min-width: 2.6rem; }
  .gbar small { display: none; }
  .standings td.left, .standings td.nowrap.left { white-space: normal; }
  .standings .tlink span { white-space: normal; overflow-wrap: anywhere; }
  .player-matches th, .player-matches td { padding-left: .2rem; padding-right: .2rem; }
  .player-matches td.nowrap { white-space: normal; }
}
@media (max-width: 420px) {
  .user-name { display: none; }
}

/* přehled bez jednoho z bočních sloupců – zbytek se vycentruje */
.overview.ov-no-right { grid-template-columns: minmax(260px, 330px) minmax(0, 860px); grid-template-areas: "left center"; justify-content: center; }
.overview.ov-no-left { grid-template-columns: minmax(0, 860px) minmax(260px, 330px); grid-template-areas: "center right"; justify-content: center; }
.overview.ov-center-only { grid-template-columns: minmax(0, 900px); grid-template-areas: "center"; justify-content: center; }
@media (max-width: 900px) {
  .overview.ov-no-right, .overview.ov-no-left { grid-template-columns: minmax(0, 1fr); grid-template-areas: "center" "left" "right"; }
}

/* stránka Tabulky: karty vedle sebe jen když se vejdou, vzájemné zápasy přes celou šířku */
.tables-page { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 500px), 1fr)); gap: 0 1rem; align-items: start; }
.tables-page > * { min-width: 0; }
.tables-page > .card-full { grid-column: 1 / -1; }

/* skóre: čísla jsou samostatné prvky, na telefonu jdou pod sebe k týmům */
.sc-main { display: inline-flex; justify-content: center; gap: .3rem; }
.sc-main b { font-weight: inherit; }
.sc-main i { font-style: normal; }
.m-score-empty { letter-spacing: .05em; }

/* telefon: domácí a hosté pod sebou, skóre vpravo – názvy týmů se nemusí zkracovat */
@media (max-width: 600px) {
  .m-row, .now-card .m-row {
    grid-template-columns: 3rem minmax(0, 1fr) auto;
    grid-template-areas: "meta home score" "side away score";
    row-gap: .1rem; column-gap: .6rem; min-height: 0; padding: .5rem .4rem;
  }
  .m-meta { grid-area: meta; align-self: start; }
  .m-side { grid-area: side; justify-content: flex-start; align-self: start; }
  .m-home { grid-area: home; }
  .m-away { grid-area: away; }
  .m-score { grid-area: score; align-self: center; min-width: 2.6rem; }
  .m-home, .m-home.m-team { justify-content: flex-start; text-align: left; }
  .m-home .dot { order: 0; margin: 0 .45rem 0 0; }
  .m-team { font-size: .95rem; }
  .m-team span { white-space: normal; overflow-wrap: anywhere; line-height: 1.2; }
  .m-score .sc-main { flex-direction: column; gap: .1rem; line-height: 1.2; }
  .m-score .sc-main i, .m-score > small { display: none; }
  .m-score-empty { font-size: .9rem; }
  .now-card .m-team { font-size: 1.05rem; }
  .now-card .m-score { font-size: 1.3rem; min-width: 3rem; }
}

/* zápas na telefonu: tabule s názvy pod barevným proužkem, průběh v jednom sloupci */
@media (max-width: 600px) {
  .scoreboard { gap: .5rem; padding: .7rem .6rem; }
  .sb-team, .sb-team:last-child { flex-direction: column; justify-content: center; text-align: center; gap: .35rem; font-size: .95rem; }
  .sb-team::before { width: 2rem; height: 5px; }
  .tl-head { display: flex; justify-content: space-between; gap: .5rem; }
  .tl-head > span:nth-child(2) { display: none; }
  .tl-head .tl-team:first-child { flex-direction: row; text-align: left; }
  .tl .tl-row { grid-template-columns: 3.2rem minmax(0, 1fr); }
  .tl-mid { order: -1; }
  .tl-cell:empty { display: none; }
  .tl-home { justify-content: flex-start; text-align: left; }
  .tl-home:not(:empty) { background: linear-gradient(90deg, color-mix(in srgb, var(--tc) 13%, #fff), #fff 85%); box-shadow: inset 4px 0 0 var(--tc); }
  .tl .tl-ev, .tl-home .tl-ev { flex-direction: row; flex-wrap: wrap; justify-content: flex-start; column-gap: .45rem; row-gap: 0; }
  .tl-who { white-space: normal; }
}

/* ================= pavouk play-off ================= */
.bracket-wrap { overflow-x: auto; padding: .4rem 0 .6rem; }
.bracket { display: flex; align-items: center; gap: 1.5rem; width: max-content; margin: 0 auto; }
.br-node { display: flex; align-items: center; }
.br-kids { display: flex; flex-direction: column; justify-content: center; position: relative; margin-right: 2.4rem; }
.br-kids > .br-node { position: relative; padding: .45rem 0; }
/* spojnice: od zápasu doprava, svisle mezi dvojicí, a dál k dalšímu kolu */
.br-kids > .br-node::after { content: ''; position: absolute; right: -1.2rem; top: 50%; width: 1.2rem; border-top: 2px solid #c9d1de; }
.br-kids > .br-node::before { content: ''; position: absolute; right: -1.2rem; border-right: 2px solid #c9d1de; }
.br-kids > .br-node:first-child::before { top: 50%; bottom: 0; }
.br-kids > .br-node:last-child::before { top: 0; bottom: 50%; }
.br-kids.one > .br-node::before { display: none; }
.br-kids::after { content: ''; position: absolute; right: -2.4rem; top: 50%; width: 1.2rem; border-top: 2px solid #c9d1de; }
.br-match {
  display: flex; flex-direction: column; width: 13.5rem; background: #fff; border: 1.5px solid var(--line); border-radius: 12px;
  overflow: hidden; color: var(--ink); box-shadow: 0 1px 3px rgba(20, 33, 61, .06);
}
.br-match:hover { text-decoration: none; border-color: var(--primary); }
.br-match.m-live { border-color: var(--red); box-shadow: 0 0 0 2px rgba(214, 40, 40, .15); }
.br-head { display: flex; justify-content: space-between; gap: .4rem; padding: .3rem .6rem; background: #f6f8fb; font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.br-head .live-badge { font-size: .6rem; }
.br-team { display: flex; align-items: center; gap: .1rem; padding: .4rem .6rem; min-height: 2.3rem; border-top: 1px solid var(--line); font-weight: 600; }
.br-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.br-score { font-variant-numeric: tabular-nums; min-width: 1.6rem; text-align: right; font-size: 1.05rem; }
.br-team.win { font-weight: 800; }
.br-team.win .br-score { color: var(--green); }
.br-team.lose { color: var(--muted); }
.br-team.fav { background: #fff8e1; }
.br-so { font-size: .72rem; color: var(--muted); padding: .2rem .6rem .35rem; border-top: 1px dashed var(--line); }
.br-champ { display: flex; flex-direction: column; align-items: center; gap: .2rem; font-size: 2rem; padding: 0 .5rem; }
.br-champ b { display: flex; align-items: center; font-size: 1.05rem; }
.br-champ small { font-size: .75rem; color: var(--muted); }
.br-rest-head { margin: 1.2rem 0 .6rem; color: var(--ink); text-align: center; }
.br-rest { display: grid; grid-template-columns: repeat(auto-fit, 13.5rem); justify-content: center; gap: .7rem; }
.br-rest .br-match { width: auto; }
@media (max-width: 600px) {
  .br-match { width: 11rem; }
  .br-kids { margin-right: 1.6rem; }
  .br-kids > .br-node::after, .br-kids > .br-node::before { right: -.8rem; width: .8rem; }
  .br-kids > .br-node::before { width: 0; }
  .br-kids::after { right: -1.6rem; width: .8rem; }
  .bracket { gap: .8rem; margin: 0; }
  .br-champ { font-size: 1.5rem; }
}
@media (max-width: 600px) { .br-rest { grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); } }
.br-head > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.br-head > span:last-child { flex: none; }
@media (max-width: 600px) {
  .bracket-wrap { margin: 0 -1rem; padding: .4rem .5rem .6rem; }
  .bracket { flex-wrap: wrap; justify-content: center; margin: 0 auto; }
  .br-match { width: 9rem; }
  .br-kids { margin-right: 1rem; }
  .br-kids > .br-node::after { right: -.5rem; width: .5rem; }
  .br-kids > .br-node::before { right: -.5rem; }
  .br-kids::after { right: -1rem; width: .5rem; }
  .br-no { display: none; }
  .br-team { padding: .35rem .45rem; font-size: .9rem; }
  .br-head { padding: .3rem .45rem; }
  .br-champ { flex-basis: 100%; padding-top: .4rem; }
}

/* ================= loga oddílů a výběr oddílu ================= */
img.dot.tlogo {
  width: var(--logo, 1.35rem) !important; height: var(--logo, 1.35rem) !important; border-radius: 5px; background: #fff;
  object-fit: contain; box-shadow: 0 0 0 1px var(--line); vertical-align: middle;
}
.now-card img.tlogo, .sb-team img.tlogo { --logo: 1.8rem; }
.team-head img.tlogo, .team-title img.tlogo { --logo: 2.6rem; }
.br-team img.tlogo { --logo: 1.2rem; margin-right: .4rem; }
.team-card-name { display: flex; align-items: center; gap: .5rem; }
.team-card-name img.tlogo { --logo: 2rem; margin: 0; }
.club-modal { max-width: 520px; }
.club-list { list-style: none; margin: 0; padding: 0; max-height: 46vh; overflow-y: auto; }
.club-opt {
  display: flex; align-items: center; gap: .7rem; width: 100%; min-height: 52px; padding: .4rem .6rem; border: 0; border-radius: 10px;
  background: transparent; cursor: pointer; text-align: left;
}
.club-opt:hover, .club-opt:focus { background: #f2f7ff; outline: none; }
.club-opt img, .club-nologo { width: 2.4rem; height: 2.4rem; flex: none; border-radius: 8px; object-fit: contain; background: #fff; box-shadow: 0 0 0 1px var(--line); }
.club-nologo { display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--muted); background: #eef1f6; }
.club-opt span { display: flex; flex-direction: column; min-width: 0; }
.club-opt small { color: var(--muted); }
.club-empty { padding: .6rem; }
.club-link { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.club-link img.tlogo { --logo: 2rem; margin: 0; }
.suggest-list { list-style: none; margin: .4rem 0; padding: 0; max-height: 52vh; overflow-y: auto; }
.suggest-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1.3fr); align-items: center; gap: .5rem; padding: .4rem 0; border-bottom: 1px solid var(--line); }
.suggest-list select { min-height: 40px; padding: .3rem .5rem; }
.sg-arrow { color: var(--muted); }
@media (max-width: 600px) { .suggest-list li { grid-template-columns: auto minmax(0, 1fr); } .sg-arrow { display: none; } .suggest-list select { grid-column: 2; } }

/* ================= detail týmu (úpravy): bloky pod sebou, široká soupiska ================= */
.team-editor { display: flex; flex-direction: column; gap: 0; max-width: 1100px; margin: 0 auto; }
.team-editor > .card { width: 100%; }
.roster-edit { min-width: 0; }
.roster-edit td:nth-child(2) { width: 100%; min-width: 14rem; }
.roster-edit td:nth-child(2) input { width: 100%; font-size: 1.02rem; }
.team-editor .officials input { min-width: 10rem; }
.team-editor + .done-bar { max-width: 1100px; margin-left: auto; margin-right: auto; }
@media (max-width: 700px) {
  /* na telefonu každý hráč na dva řádky: číslo | jméno / ročník, hraje, smazat */
  .roster-edit thead { display: none; }
  .roster-edit tr {
    display: grid; grid-template-columns: 4rem minmax(0, 1fr) auto auto; grid-template-areas: "num name name name" "num year act btn";
    gap: .35rem .5rem; padding: .55rem 0; border-bottom: 1px solid var(--line); align-items: center;
  }
  .roster-edit td { padding: 0; border: 0; min-width: 0 !important; }
  .roster-edit td:nth-child(1) { grid-area: num; align-self: start; }
  .roster-edit td:nth-child(2) { grid-area: name; }
  .roster-edit td:nth-child(3) { grid-area: year; justify-self: start; }
  .roster-edit td:nth-child(4), .roster-edit td:nth-child(5), .roster-edit td:nth-child(6), .roster-edit td:nth-child(7) { display: none; }
  .roster-edit td:nth-child(8) { grid-area: act; }
  .roster-edit td:nth-child(9) { grid-area: btn; }
  .roster-edit .in-num { width: 100%; height: 100%; min-height: 92px; font-size: 1.4rem; }
  .roster-edit .in-year::placeholder { color: var(--muted); }
  .team-editor .officials tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .3rem; padding: .3rem 0; }
  .team-editor .officials td:nth-child(3) { grid-column: 2; }
  .team-editor .officials td:nth-child(4) { grid-row: 1; grid-column: 3; }
  .team-editor .officials input { min-width: 0; }
}

/* našeptávač pod polem */
.suggest {
  position: fixed; z-index: 300; list-style: none; margin: 0; padding: .3rem; background: #fff; border: 1.5px solid var(--line);
  border-radius: 12px; box-shadow: 0 12px 30px rgba(20, 33, 61, .18); max-height: 50vh; overflow-y: auto;
}
.suggest li { display: flex; flex-direction: column; padding: .5rem .7rem; border-radius: 8px; cursor: pointer; min-height: 44px; justify-content: center; }
.suggest li:hover, .suggest li.active { background: #eef4ff; }
.suggest small { color: var(--muted); }

/* přetahování týmů mezi skupinami */
.team-card { position: relative; }
.drag-handle {
  position: absolute; top: .35rem; right: .35rem; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; color: var(--muted); font-size: 1.3rem; cursor: grab; touch-action: none; user-select: none;
}
.drag-handle:hover { background: #eef1f6; color: var(--ink); }
.team-card:has(.drag-handle) h3 { padding-right: 2.4rem; }
.team-card.dragging { opacity: .35; }
.drag-ghost { position: fixed; z-index: 400; pointer-events: none; transform: rotate(2deg) scale(1.03); box-shadow: 0 18px 40px rgba(20, 33, 61, .3); cursor: grabbing; }
.team-grid[data-drop] { border-radius: var(--radius); transition: background .12s, box-shadow .12s; min-height: 4rem; }
.team-grid.drop-over { background: #eaf2ff; box-shadow: 0 0 0 3px var(--primary); }

/* nový turnaj – týmy jako štítky */
.team-builder {
  display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; min-height: var(--tap); padding: .35rem;
  border: 1.5px solid var(--line); border-radius: 10px; background: #fff; cursor: text;
}
.team-builder:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(29, 95, 209, .12); }
.team-builder input { flex: 1 1 12rem; min-width: 10rem; border: 0; box-shadow: none !important; min-height: 40px; padding: .3rem .4rem; }
.tb-chips { display: contents; list-style: none; }
.tb-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .3rem .25rem .45rem; border-radius: 99px; background: #eef4ff; border: 1px solid #c9dafb; font-weight: 600; font-size: .92rem; max-width: 100%; }
.tb-chip img { width: 1.5rem; height: 1.5rem; object-fit: contain; border-radius: 4px; background: #fff; }
.tb-chip .dot { margin: 0 .1rem; }
.tb-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-chip button { border: 0; background: transparent; width: 28px; height: 28px; border-radius: 50%; cursor: pointer; color: var(--muted); }
.tb-chip button:hover { background: #dbe6fb; color: var(--ink); }
.tb-foot { display: flex; justify-content: space-between; align-items: center; gap: .6rem; margin-top: .35rem; flex-wrap: wrap; }
.suggest li.has-img { flex-direction: row; align-items: center; justify-content: flex-start; gap: .6rem; }
.suggest li.has-img img, .suggest li.has-img > i { width: 2rem; height: 2rem; flex: none; object-fit: contain; border-radius: 6px; background: #fff; box-shadow: 0 0 0 1px var(--line); }
.suggest li.has-img > i { background: #eef1f6; }
.suggest li > span { display: flex; flex-direction: column; min-width: 0; }
.logo-pick { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.logo-prev { width: 3.2rem; height: 3.2rem; border-radius: 10px; background: #eef1f6; display: flex; align-items: center; justify-content: center; color: var(--muted); font-weight: 800; overflow: hidden; }
.logo-prev img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.club-new { margin-right: auto; }

/* ================= tablet: žádná nechtěná gesta ================= */
/* vypne gesto zpět/vpřed tažením do strany a „stáhnout pro obnovení“ (Chrome, Edge, Android) */
html, body { overscroll-behavior: none; }
/* bez zpoždění a přiblížení při dvojitém klepnutí */
body { touch-action: manipulation; }
.pl-btn, .act, .btn, .chip, .seg-btn { -webkit-user-select: none; user-select: none; }

/* ================= sdílení, QR, plakát ================= */
.share-modal { max-width: 440px; }
.share-qr { width: min(260px, 70vw); margin: .2rem auto .4rem; }
.share-qr svg, .coach-qr svg, .poster-qr svg, .rc-qr svg { display: block; width: 100%; height: auto; }
.share-actions { flex-wrap: wrap; }
.copy-row input { min-width: 0; }

/* odkaz pro trenéra */
.coach-link .card-head { margin-bottom: .3rem; }
.coach-row { display: flex; gap: 1rem; align-items: center; }
.coach-qr { width: 132px; flex: none; }
.coach-main { flex: 1; min-width: 0; }
.coach-main .copy-row { margin: .4rem 0 .6rem; }
@media (max-width: 600px) { .coach-row { flex-direction: column; align-items: stretch; } .coach-qr { width: 160px; margin: 0 auto; } }
.rs { font-size: .8rem; font-weight: 700; color: var(--muted); background: #eef1f6; padding: .15rem .55rem; border-radius: 99px; white-space: nowrap; }
.rs-done { color: var(--green); background: var(--green-l); }
.rs-wait { color: #a55a00; background: #fff1de; }
.tc-roster { margin: .1rem 0 .3rem; }
.rl-list { list-style: none; margin: .4rem 0; padding: 0; }
.rl-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: .6rem; align-items: center; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.rl-team { display: flex; align-items: center; min-width: 0; }
.rl-team b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rl-btns { display: flex; gap: .4rem; }
@media (max-width: 600px) { .rl-list li { grid-template-columns: minmax(0, 1fr) auto; } .rl-btns { grid-column: 1 / -1; } }

/* stránka trenéra */
.roster-page { max-width: 760px; }
.roster-head { display: flex; gap: 1rem; align-items: center; border-top: 6px solid var(--tc); }
.roster-head h1 { margin: .1rem 0; font-size: 1.5rem; overflow-wrap: anywhere; }
.roster-logo { width: 4rem; height: 4rem; object-fit: contain; border-radius: 10px; flex: none; background: #fff; box-shadow: 0 0 0 1px var(--line); }
.roster-note { margin: 0 0 1rem; line-height: 1.5; }
.rf-list { list-style: none; margin: 0; padding: 0; counter-reset: rf; }
.rf-row { display: grid; grid-template-columns: 4.2rem minmax(0, 1fr) 6rem 40px; gap: .5rem; align-items: center; padding: .35rem 0; border-bottom: 1px solid var(--line); }
.rf-row.inactive { opacity: .5; }
.rf-num, .rf-year { text-align: center; }
.rf-num { font-weight: 800; font-size: 1.1rem; }
.rf-add { width: 100%; margin-top: .8rem; border-style: dashed; }
.rf-off { display: flex; flex-direction: column; gap: .5rem; }
.rf-off-row { display: grid; grid-template-columns: auto minmax(0, 1.3fr) minmax(0, 1fr); gap: .5rem; align-items: center; }
.rf-save { position: sticky; bottom: 0; padding: .8rem 0 1rem; background: linear-gradient(transparent, var(--bg) 35%); }
.rf-save .btn { width: 100%; }
@media (max-width: 600px) {
  .rf-row { grid-template-columns: 3.6rem minmax(0, 1fr) 40px; grid-template-areas: "num name del" "num year del"; }
  .rf-num { grid-area: num; height: 100%; }
  .rf-name { grid-area: name; }
  .rf-year { grid-area: year; width: 7rem; }
  .rf-row .btn-icon { grid-area: del; }
  .rf-off-row { grid-template-columns: auto minmax(0, 1fr); }
  .rf-off-row input:last-child { grid-column: 2; }
}

/* tisk samostatného listu */
.print-only { display: none; }
@media print {
  @page sheet { size: A4 portrait; margin: 12mm; }
  body.printing-sheet > *:not(.print-only) { display: none !important; }
  body.printing-sheet .print-only { display: block; page: sheet; }
  body.printing-sheet { background: #fff; }
}
.poster { text-align: center; color: #14213d; font-family: inherit; padding-top: 6mm; }
.poster-brand { display: flex; align-items: center; justify-content: center; gap: 3mm; font-weight: 800; font-size: 14pt; color: #4a5672; }
.poster-brand img { width: 10mm; height: 10mm; }
.poster-kicker { margin-top: 10mm; color: #d62828; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: 14pt; }
.poster h1 { font-size: 34pt; line-height: 1.1; margin: 4mm 0 3mm; }
.poster-when { font-size: 15pt; color: #4a5672; margin: 0; }
.poster-qr { width: 120mm; margin: 12mm auto 6mm; }
.poster-cta { font-size: 22pt; font-weight: 800; margin: 0; }
.poster-what { font-size: 13pt; color: #4a5672; margin: 2mm 0 6mm; }
.poster-url { font-size: 13pt; font-weight: 700; color: #1d5fd1; margin: 0; word-break: break-all; }
.rc-sheet { display: grid; grid-template-columns: 1fr 1fr; gap: 5mm; }
.rc-card { border: 1px dashed #999; border-radius: 3mm; padding: 4mm; break-inside: avoid; color: #14213d; }
.rc-head { display: flex; align-items: center; gap: 3mm; margin-bottom: 3mm; }
.rc-head img { width: 11mm; height: 11mm; object-fit: contain; }
.rc-head b { display: block; font-size: 13pt; }
.rc-head small { color: #4a5672; font-size: 9pt; }
.rc-body { display: flex; gap: 4mm; align-items: center; }
.rc-qr { width: 32mm; flex: none; }
.rc-body p { margin: 0; font-size: 9.5pt; line-height: 1.35; }
.rc-body small { color: #1d5fd1; word-break: break-all; }

/* vzájemné zápasy: názvy soupeřů svisle v záhlaví */
.cross thead th.cross-col { vertical-align: bottom; padding-bottom: .3rem; }
.cross-col { display: table-cell; }
.cross-vname {
  display: block; margin: 0 auto .35rem; writing-mode: vertical-rl; transform: rotate(180deg);
  max-height: 10rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: .82rem; font-weight: 700; text-transform: none; color: var(--ink); letter-spacing: 0; line-height: 1.1;
}
.cross-col img.tlogo { --logo: 1.2rem; display: block; margin: 0 auto .3rem; }
@media (max-width: 600px) { .cross-vname { max-height: 7rem; font-size: .74rem; } }

/* loga v detailu zápasu */
.sb-team.has-logo::before { display: none; }
.sb-team img.tlogo { --logo: 2.6rem; margin: 0; border-radius: 8px; box-shadow: none; flex: none; }
.side-head h2 { display: flex; align-items: center; gap: .5rem; }
.side-head img.tlogo { --logo: 1.9rem; margin: 0; }
.tl-head .tl-team img.tlogo { --logo: 1.3rem; margin: 0; }
.tl-head .tl-team:has(img.tlogo)::before { display: none; }
@media (max-width: 600px) { .sb-team img.tlogo { --logo: 2.2rem; } }

/* kalendář (týden od pondělí, zvýraznění dnů turnaje) */
.dp-modal { max-width: 400px; }
.dp-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: .4rem; }
.dp-top b { font-size: 1.1rem; text-transform: capitalize; }
.dp-top .btn-icon { font-size: 1.6rem; width: 44px; height: 44px; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px 0; }
.dp-dn { text-align: center; font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; padding: .2rem 0 .4rem; }
.dp-day {
  height: 44px; border: 0; background: transparent; font-weight: 600; font-size: 1rem; cursor: pointer; border-radius: 10px;
  font-variant-numeric: tabular-nums; color: var(--ink); position: relative;
}
.dp-day.we { color: #b04a4a; }
.dp-day:hover:not(:disabled) { background: #eef4ff; }
.dp-day:disabled { color: #c9ced8; cursor: default; }
.dp-day.today::after { content: ''; position: absolute; left: 50%; bottom: 5px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--primary); }
.dp-day.hl { background: #fff3c4; border-radius: 0; }
.dp-day.in { background: #dbe8ff; border-radius: 0; }
.dp-day.start, .dp-day.end, .dp-day.sel { background: var(--primary); color: #fff; }
.dp-day.start { border-radius: 10px 0 0 10px; }
.dp-day.end { border-radius: 0 10px 10px 0; }
.dp-day.start.end { border-radius: 10px; }
.dp-day.sel.today::after, .dp-day.start.today::after, .dp-day.end.today::after { background: #fff; }
.dp-range { text-align: center; margin: .6rem 0 0; font-weight: 600; color: var(--primary); }
.field > .dp { display: flex; }

/* více hřišť */
.court-tag {
  display: inline-flex; align-items: center; justify-content: center; min-width: 1.3rem; height: 1.15rem; padding: 0 .3rem; margin-left: .3rem;
  border-radius: 5px; background: #e5efff; color: var(--primary); font-size: .68rem; font-weight: 800; vertical-align: middle; white-space: nowrap;
}
.m-time .court-tag { margin-left: .25rem; }
.courts { margin: .4rem 0 .2rem; }
.courts-seg { max-width: 420px; }
.courts-names { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .8rem; margin-top: .6rem; }
.now-cards.now-multi { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
@media (max-width: 600px) { .m-meta .court-tag { margin: .1rem 0 0; } .m-meta .m-time { display: flex; flex-wrap: wrap; align-items: center; } }
.m-meta .m-time { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 0; }
.m-time .court-tag, .sched-row .court-tag { flex: none; align-self: center; }
.sched-row .m-time { display: flex; align-items: center; flex-wrap: wrap; }
.dp-range:empty { display: none; }

/* vzájemné zápasy: názvy soupeřů v záhlaví vodorovně, delší se zalomí */
.cross-vname {
  writing-mode: horizontal-tb; transform: none; max-height: none; white-space: normal; overflow: visible;
  min-width: 3.6rem; max-width: 7rem; margin: 0 auto .3rem; font-size: .76rem; line-height: 1.15; text-align: center;
  hyphens: auto; overflow-wrap: break-word;
}
@media (max-width: 600px) { .cross-vname { max-width: 5rem; min-width: 3rem; font-size: .7rem; max-height: none; } }

/* soupiska: jméno vlevo, ročník a číslo vpravo (po výběru z nabídky se doplní samy) */
.roster-edit td:nth-child(2) { width: auto; min-width: 0; }
.roster-edit td:nth-child(2) input { width: 5rem; font-size: inherit; }
.roster-edit td:nth-child(1) { width: 100%; min-width: 14rem; }
.roster-edit td:nth-child(1) input { width: 100%; font-size: 1.02rem; }
.roster-edit .td-num .in-num { width: 4rem; }
@media (max-width: 700px) {
  .roster-edit tr { grid-template-columns: 5.5rem 4.5rem minmax(0, 1fr) auto; grid-template-areas: "name name name name" "year num act btn"; }
  .roster-edit td:nth-child(1) { grid-area: name; min-width: 0 !important; width: auto; align-self: auto; }
  .roster-edit td:nth-child(2) { grid-area: year; justify-self: stretch; }
  .roster-edit td:nth-child(2) input { width: 100%; }
  .roster-edit td:nth-child(3) { grid-area: num; }
  .roster-edit td:nth-child(8) { grid-area: act; justify-self: end; }
  .roster-edit .in-num { min-height: 44px; height: auto; font-size: 1.1rem; width: 100%; }
}
/* formulář trenéra: jméno, ročník, číslo */
.rf-row { grid-template-columns: minmax(0, 1fr) 6rem 4.2rem 40px; }
@media (max-width: 600px) {
  .rf-row { grid-template-columns: minmax(0, 1fr) 4.2rem 40px; grid-template-areas: "name name del" "year num del"; }
  .rf-num { height: auto; }
  .rf-year { width: auto; }
}

/* společný odkaz pro trenéry – výběr týmu */
.rc-teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: .6rem; }
.rc-team {
  display: flex; align-items: center; gap: .8rem; min-height: 64px; padding: .6rem .9rem; background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow); border-left: 5px solid var(--tc); color: var(--ink);
}
.rc-team:hover { text-decoration: none; box-shadow: 0 0 0 2px var(--primary), var(--shadow); }
.rc-team.last { box-shadow: 0 0 0 2px #b9d3f7, var(--shadow); }
.rc-team img { width: 2.6rem; height: 2.6rem; object-fit: contain; flex: none; }
.rc-dot { width: 1rem; height: 1rem; border-radius: 50%; background: var(--tc); flex: none; margin: 0 .8rem; }
.rc-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rc-name b { font-size: 1.05rem; overflow-wrap: anywhere; }
.rc-name small { color: var(--muted); }
.rc-go { font-size: 1.6rem; color: var(--muted); }
.rl-modal .rl-list li { grid-template-columns: minmax(0, 1fr) auto; }
.rl-head { margin: 1rem 0 .2rem; color: var(--ink); }
.rl-danger { display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; margin-top: .8rem; padding-top: .8rem; border-top: 1px solid var(--line); }

/* začátek turnaje: úvodní zápasy a týmy z dálky */
.op-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 1rem 2rem; }
.op-grid h3 { margin: 0 0 .2rem; color: var(--ink); }
.op-grid .hint { margin: 0 0 .6rem; }
.op-row { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr) auto minmax(0, 1fr) 40px; gap: .4rem; align-items: center; margin-bottom: .4rem; }
.op-n { color: var(--muted); font-weight: 700; }
.op-row select { min-height: 44px; }
.op-late { display: flex; flex-wrap: wrap; gap: .4rem; }
.op-chip { display: inline-flex; align-items: center; gap: .1rem; cursor: pointer; }
.op-chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.op-chip.active { background: #fff1de; border-color: #f0b46b; color: #8a4b00; }
@media (max-width: 600px) { .op-row { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) 36px; } .op-n { display: none; } }

/* patička */
.site-foot {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .4rem 1.4rem;
  padding: 1.2rem 1rem calc(1.4rem + env(safe-area-inset-bottom)); color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line);
}
.site-foot a { color: var(--ink2); font-weight: 600; }
.on-tournament .login-link { display: none; }
.site-copy a, .site-copy a:hover { color: var(--primary); text-decoration: none; }
@media print { .site-foot { display: none; } }

/* účet, správa */
a.user-name { color: #fff; }
.small { font-size: .85rem; }
.notice { background: #eef4ff; color: var(--ink); padding: .7rem .9rem; border-radius: 10px; margin: .6rem 0; }
.notice .field { margin-bottom: .6rem; }
.admin-note { display: inline-block; margin: .4rem 0 0; padding: .3rem .7rem; border-radius: 8px; background: #fff1de; color: #8a4b00; font-size: .9rem; }
.page-text { max-width: 760px; }
.prose h2 { margin-top: 1.4em; }
.prose p, .prose li { line-height: 1.55; }
.prose ul { padding-left: 1.2rem; }
.card-flush { padding: 0; overflow-x: auto; }
.admin-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin-bottom: 1rem; }
.admin-bar input[type=search] { flex: 1 1 260px; max-width: 420px; }
.seg { display: flex; flex-wrap: wrap; gap: .3rem; }
.admin-table td, .admin-table th { padding: .55rem .7rem; vertical-align: middle; }
.admin-table td.actions { white-space: nowrap; text-align: right; }
.admin-table td.actions > * { margin-left: .3rem; }
.admin-table tr.off td { opacity: .55; }
.admin .card > .admin-table { margin: 0 -.4rem; width: calc(100% + .8rem); }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 1rem; align-items: start; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.kpi { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .15rem; }
.kpi span { font-size: .85rem; font-weight: 600; color: var(--ink2); }
.kpi b { font-size: 1.9rem; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--muted); }
.totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .8rem; }
.totals div { display: flex; flex-direction: column; }
.totals b { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.totals span { color: var(--muted); font-size: .85rem; }
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart text { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .bar { fill: var(--primary); }
.chart .bar.on { fill: var(--primary-d); }
.chart .hit { fill: transparent; }
.chart-tip {
  position: absolute; top: 0; transform: translateX(-50%); pointer-events: none; white-space: nowrap;
  background: var(--ink); color: #fff; padding: .4rem .6rem; border-radius: 8px; font-size: .85rem;
}
.chart-table { margin-top: .8rem; }
.chart-table summary { cursor: pointer; color: var(--primary); font-weight: 600; }
@media (max-width: 640px) {
  .admin-table .hide-s { display: none; }
  .kpi b { font-size: 1.5rem; }
}

/* telefon: průběh zápasu ve dvou stranách – událost je na straně týmu, který ji má (domácí vlevo, hosté vpravo) */
@media (max-width: 600px) {
  .tl-head { display: grid; grid-template-columns: minmax(0, 1fr) 2.9rem minmax(0, 1fr); gap: .2rem; }
  .tl-head > span:nth-child(2) { display: block; }
  .tl-head .tl-team { font-size: .85rem; min-width: 0; overflow-wrap: anywhere; }
  .tl-head .tl-team:first-child { flex-direction: row-reverse; text-align: right; }
  .tl .tl-row { grid-template-columns: minmax(0, 1fr) 2.9rem minmax(0, 1fr); gap: .2rem; }
  .tl-mid { order: 0; }
  .tl-cell:empty { display: flex; }
  .tl-cell { padding: .3rem .35rem; }
  .tl-home { justify-content: flex-end; text-align: right; }
  .tl-home:not(:empty) { background: linear-gradient(270deg, color-mix(in srgb, var(--tc) 13%, #fff), #fff 85%); box-shadow: inset -4px 0 0 var(--tc); }
  .tl .tl-ev { flex-wrap: wrap; column-gap: .3rem; row-gap: 0; }
  .tl .tl-home .tl-ev { flex-direction: row-reverse; justify-content: flex-start; }
  .tl .tl-away .tl-ev { flex-direction: row; justify-content: flex-start; }
  .tl-type { font-size: .82rem; }
  .tl-who { flex-basis: 100%; white-space: normal; font-size: .8rem; line-height: 1.2; }
  .tl-score { font-size: 1rem; }
  .tl-mid small { font-size: .7rem; }
}

/* telefon: vzájemné zápasy co nejhustěji – soupeři jen čísly, kratší názvy v řádcích */
@media (max-width: 600px) {
  .cross { font-size: .78rem; }
  .cross th, .cross td { padding: .3rem .12rem; }
  .cross td { min-width: 2.15rem; text-align: center; font-size: .78rem; }
  .cross thead th.cross-col { padding-bottom: .25rem; }
  .cross-col .cross-vname, .cross-col img.tlogo { display: none; }
  .cross-n { width: 1.35rem; height: 1.35rem; font-size: .7rem; margin-right: .25rem; border-radius: 5px; }
  .cross tbody th { font-size: .8rem; }
  .cross-name { padding-left: .15rem !important; padding-right: .3rem !important; }
  .cross-name .tlink { max-width: 5.6rem; }
  .cross-name img.tlogo { display: none; }
}

/* tabulka skupiny: výhry, remízy a prohry i na telefonu (schová se jen +/−), sloupce co nejužší */
.table.standings .opt.wdl { display: table-cell; }
@media (max-width: 600px) {
  .table.standings:not(.compact) { font-size: .85rem; }
  .table.standings:not(.compact) th, .table.standings:not(.compact) td { padding-left: .15rem; padding-right: .15rem; }
  .table.standings .wdl { min-width: 1.4rem; text-align: center; color: var(--ink2); }
  .table.standings td.num { width: 1.6rem; }
}

/* veřejný detail zápasu: soupisky až pod průběhem */
.match-cols-public { margin-top: .8rem; }

/* štítek BRZY u zápasu, který jde na řadu (modře zvýrazněný řádek) */
.next-badge {
  display: inline-flex; align-items: center; justify-content: center; background: var(--primary); color: #fff; font-weight: 800;
  font-size: .62rem; letter-spacing: .08em; padding: .1rem .5rem; border-radius: 99px; line-height: 1.2; white-space: nowrap;
}
.m-score .next-badge { margin: .25rem auto 0; }
.now-card .m-score .next-badge { display: none; }

/* záložky turnaje: posouvají se jen do stran, svisle se uvnitř nehýbou (podtržení je stínem, ne přesahem) */
.tabs {
  overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch;
  border-bottom: 0; box-shadow: inset 0 -1.5px 0 var(--line);
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a { margin-bottom: 0; }

/* záložky a tabule zápasu se lepí přesně pod horní lištu (výšku měří app.js); −1px proti vlasové mezeře */
.tabs, .scoreboard { top: calc(var(--topbar-h, 52px) - 1px); }

/* průběh zápasu: informační řádky (začátek, 2. poločas, konec) jako oddělovač přes celou šířku */
.tl .tl-info { display: flex; align-items: center; gap: .6rem; min-height: 0; padding: .45rem 0; border-bottom: 0; color: var(--ink2); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.tl .tl-info::before, .tl .tl-info::after { content: ''; flex: 1; height: 1.5px; background: var(--line); }
.tl-info span { white-space: nowrap; }
.tl-info b { color: var(--ink); }
.tl-info small { color: var(--muted); font-weight: 500; text-transform: none; letter-spacing: 0; margin-left: .2rem; }
.tl-info-half::before, .tl-info-half::after { background: var(--primary) !important; opacity: .45; }
.tl-info-half { color: var(--primary); }
.tl-info-end { color: var(--ink); }
.tl-info-end::before, .tl-info-end::after { background: var(--ink) !important; opacity: .5; }
@media (max-width: 600px) { .tl .tl-info { font-size: .72rem; gap: .4rem; } .tl-info span { white-space: normal; text-align: center; } }

/* rozpis: přetahování zápasů za úchyt ⠿ */
.sched-row { grid-template-columns: 3.2rem 4.4rem 3.4rem 1fr auto auto; }
.sched-row .m-num { display: flex; align-items: center; gap: .15rem; }
.drag-handle {
  display: inline-flex; align-items: center; justify-content: center; width: 1.7rem; height: 2.4rem; flex: none;
  font-size: 1.2rem; color: var(--muted); cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; border-radius: 6px;
}
.drag-handle:hover { background: #eef1f6; color: var(--ink); }
.sched-list.drag-on { user-select: none; -webkit-user-select: none; }
.sched-list.drag-on .drag-handle { cursor: grabbing; }
.sched-row.dragging { position: relative; z-index: 5; background: #fff !important; box-shadow: 0 8px 24px rgba(20, 33, 61, .22); border-radius: 10px; }
@media (max-width: 700px) { .sched-row { grid-template-columns: 3rem 3.6rem 1fr auto; } }
@media (max-width: 600px) { .sched-row { grid-template-columns: 2.9rem 3.4rem minmax(0, 1fr) auto; } }
.rosters-title { margin: 1.4rem 0 .5rem; }
.rosters-title + .match-cols-public { margin-top: 0; }

/* statistiky: na počítači tým ve vlastním sloupci, na telefonu pod jménem; krátké popisky sloupců */
.team-under { display: none; }
.lbl-s { display: none; }
.stat-table { width: 100%; }
.stat-table th { white-space: nowrap; }
@media (max-width: 600px) {
  .stat-table { font-size: .88rem; }
  .stat-table th, .stat-table td { padding-left: .2rem; padding-right: .2rem; }
  .stat-table .col-team { display: none; }
  .stat-table .team-under { display: block; font-size: .76rem; color: var(--muted); margin-top: .1rem; }
  .stat-table .team-under .tlink { font-weight: 500; }
  .stat-table .st-who { white-space: normal; overflow-wrap: anywhere; line-height: 1.25; }
  .stat-table .st-who .jersey { min-width: 1.4rem; }
  .stat-table .st-team { white-space: normal; overflow-wrap: anywhere; }
  .stat-table .st-team .tlink span, .stat-table td.left .tlink span { white-space: normal; }
  .stat-table td:not(.left) { white-space: nowrap; width: 1%; }
  .lbl-l { display: none; }
  .lbl-s { display: inline; }
  .records { grid-template-columns: 1fr; gap: .1rem; }
  .records dd { margin-bottom: .5rem; overflow-wrap: anywhere; }
}

/* průběh zápasu na telefonu a pro veřejnost bez vnitřního posuvníku – stránka se posouvá dál až k soupiskám */
.match-bottom-public .tl ul { max-height: none; overflow: visible; }
@media (max-width: 720px) { .tl ul { max-height: none; overflow: visible; } }
