/* Živé skóre – obrazovka rozhodčího (tablet) a informační obrazovka (televize). Barvy jsou z style.css. */

/* ------------------------------------------------------------ rozhodčí */
body.ref { margin: 0; background: var(--bg); color: var(--text); min-height: 100vh; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
#ref { min-height: 100vh; display: flex; flex-direction: column; }
.ref-bar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--accent); color: var(--accent-ink); font-size: 18px; }
.ref-bar b { font-size: 22px; font-weight: 800; }
.ref-bar .ref-title { flex: 1; opacity: .9; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ref-net { font-size: 14px; font-weight: 800; padding: 4px 12px; border-radius: 99px; background: rgba(255,255,255,.22); }
.ref-net.bad { background: var(--warn-soft); color: var(--warn); }
.ref-bar .menu { background: transparent; border: 2px solid currentColor; color: inherit; font-size: 26px; line-height: 1; width: 48px; height: 44px; padding: 0; border-radius: 12px; }
.ref-main { padding: 18px 16px 40px; max-width: 900px; width: 100%; margin: 0 auto; }
.ref-main h1 { font-size: 26px; margin: 4px 0 14px; }
.ref-flash { background: var(--accent-soft); color: var(--accent); font-weight: 800; padding: 10px 14px; border-radius: 12px; }
.ref-empty { color: var(--muted); font-size: 20px; padding: 30px 6px; }
.ref-hint { color: var(--muted); }
.ref-list { display: grid; gap: 12px; }
.ref-match { display: block; width: 100%; text-align: left; min-height: 92px; padding: 14px 18px; border-radius: 20px; border: 2px solid var(--line); background: var(--surface); color: var(--text); font: inherit; }
.ref-match.next { border-color: var(--live-bar); background: var(--live-soft); }
.ref-match .ref-meta { display: block; font-size: 15px; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.ref-match .tag { background: var(--live-bar); color: #fff; padding: 2px 10px; border-radius: 99px; margin-right: 8px; font-size: 13px; }
.ref-names { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 26px; font-weight: 800; }
.ref-names i { font-style: normal; font-size: 16px; color: var(--muted); font-weight: 700; }

.ref-info { text-align: center; color: var(--muted); font-weight: 700; padding: 8px 12px 2px; }
.ref-play { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 10px 12px; min-height: 55vh; }
@media (orientation: portrait) { .ref-play { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; } }
.ref-side { display: grid; grid-template-rows: auto auto 1fr; align-items: center; justify-items: center; gap: 4px; padding: 14px; border-radius: 28px; border: 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow); font: inherit; text-align: center; }
.ref-side.s0 { border-top: 12px solid var(--avatar-a); }
.ref-side.s1 { border-top: 12px solid var(--avatar-b); }
.ref-side:active:not(:disabled) { background: var(--accent-soft); }
.ref-side:disabled { opacity: .75; }
.ref-side .nm { font-size: 28px; font-weight: 800; line-height: 1.15; }
.ref-side .sets { display: flex; gap: 8px; align-items: center; color: var(--muted); font-weight: 700; font-size: 20px; min-height: 28px; }
.ref-side .sets i { font-style: normal; background: var(--surface-2); border-radius: 10px; padding: 0 10px; }
.ref-side .pts { font-size: clamp(96px, 22vmin, 220px); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.ref-tools { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; padding: 4px 12px 18px; }
.ref-tools button { min-height: 60px; font-size: 18px; font-weight: 800; border-radius: 16px; }
.ref-end { padding: 6px 12px 20px; text-align: center; }
.ref-end p { font-size: 20px; margin: 4px 0 10px; }
button.big { display: block; width: 100%; min-height: 64px; font-size: 20px; font-weight: 800; border-radius: 18px; margin-top: 10px; }
.ref-sheet { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: flex-end; justify-content: center; z-index: 20; }
.ref-sheet .box { background: var(--surface); width: 100%; max-width: 620px; border-radius: 28px 28px 0 0; padding: 20px 18px 28px; }
.ref-sheet h2 { margin: 0 0 6px; font-size: 28px; line-height: 1.25; }
.ref-sheet .vs { font-size: 16px; color: var(--muted); font-weight: 700; }
button.danger { border-color: var(--warn); color: var(--warn); }
.live-on { border-color: var(--live-bar); color: var(--live); }

/* ------------------------------------------------------------ okno pro pořadatele */
.live-dlg { max-width: 760px; }
.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.live-card { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 16px; padding: 10px; background: var(--surface); }
.live-card .qr svg { display: block; border-radius: 8px; }
.live-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.live-tv { margin-bottom: 8px; }

/* ------------------------------------------------------------ informační obrazovka */
body.tv { margin: 0; background: var(--bg); color: var(--text); overflow: hidden; width: 100vw; height: 100vh; }
#stage { position: absolute; left: 50%; top: 50%; width: 1920px; height: 1080px; transform-origin: 0 0; font-family: 'Nunito', system-ui, sans-serif; }
.tv-in { box-sizing: border-box; width: 100%; height: 100%; padding: 28px 36px 32px; display: flex; flex-direction: column; gap: 20px; }
.tv-head { display: flex; align-items: center; gap: 20px; height: 64px; flex: none; }
.tv-head .t { flex: 1; } .tv-head h1 { margin: 0; font-size: 40px; line-height: 1.1; font-weight: 800; }
.tv-head .s { font-size: 20px; font-weight: 600; color: var(--muted); }
.tv-pill { font-size: 20px; font-weight: 700; background: var(--live-soft); color: var(--live); padding: 8px 22px; border-radius: 99px; }
.tv-head.has-sp .tv-pill { font-size: 18px; padding: 6px 16px; white-space: nowrap; }
.tv-pill.ok { background: var(--accent-soft); color: var(--accent); }
.tv-clock { font-size: 48px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tv-grid { display: grid; grid-template-columns: minmax(0, 1fr) 384px; gap: 24px; flex: 1; min-height: 0; }
.tv-card { background: var(--surface); border-radius: 24px; box-shadow: var(--shadow); }
.tv-left { display: flex; flex-direction: column; gap: 20px; min-height: 0; }
.tv-courts { padding: 6px 28px 8px; flex: 1; min-height: 0; }
.tv-courts.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 36px; }
.tv-ch, .tv-cr { display: grid; grid-template-columns: 70px minmax(0, 1fr) repeat(var(--sc), var(--cw, 96px)) var(--cw, 96px); align-items: center; gap: 0 8px; }
.tv-ch { padding: 10px 0 8px; font-size: 15px; font-weight: 800; letter-spacing: .1em; color: var(--muted); border-bottom: 2px solid var(--surface-2); }
.tv-ch span:not(:first-child):not(:nth-child(2)) { text-align: center; }
.tv-cr { grid-template-rows: var(--rh) var(--rh); border-bottom: 1px solid var(--surface-2); font-weight: 800; }
.tv-cr .no { grid-row: 1 / span 2; font-size: calc(var(--fs) * 1.5); color: var(--accent); line-height: 1; }
.tv-cr .nm { font-size: var(--fs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-cr .nm.lo { color: var(--muted); }
.tv-cr .c { text-align: center; font-size: calc(var(--fs) * .95); font-variant-numeric: tabular-nums; color: var(--muted); }
.tv-cr .c.cur { background: var(--live-soft); color: var(--text); border-radius: 12px; font-size: calc(var(--fs) * 1.2); }
.tv-cr .c.w { color: var(--text); }
.tv-cr .c.t { color: var(--text); }
.tv-cr .c.lo { color: var(--muted); }
.tv-cr.alt, .tv-free.alt { background: color-mix(in srgb, var(--muted) 6%, transparent); border-radius: 14px; padding-left: 12px; padding-right: 12px; margin: 0 -12px; }
.tv-courts.two > div:first-child .alt { margin-right: -18px; padding-right: 18px; border-radius: 14px 0 0 14px; }
.tv-courts.two > div:last-child .alt { margin-left: -18px; padding-left: 18px; border-radius: 0 14px 14px 0; }
.tv-free { display: flex; align-items: center; gap: 18px; height: calc(var(--rh) * 1.3); color: var(--muted); border-bottom: 1px solid var(--surface-2); }
.tv-free .no { width: 70px; font-size: calc(var(--fs) * 1.5); font-weight: 800; color: var(--muted); opacity: .7; }
.tv-free b { font-size: calc(var(--fs) * .85); }
.tv-bottom { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; flex: none; }
.tv-list { height: 368px; box-sizing: border-box; padding: 16px 26px 10px; display: flex; flex-direction: column; overflow: hidden; }
.tv-h { font-size: 18px; font-weight: 800; letter-spacing: .1em; color: var(--muted); margin-bottom: 6px; }
.tv-li { flex: 0 0 var(--lrh, 62px); height: var(--lrh, 62px); display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--surface-2); font-size: var(--lfs, 25px); font-weight: 700; min-height: 0; }
.tv-li:last-child { border-bottom: 0; }
.tv-li .n { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-li .n .w { font-weight: 800; }
.tv-li .sc { color: var(--muted); font-size: calc(var(--lfs, 25px) * .72); margin-right: 8px; white-space: nowrap; }
.tv-li b { min-width: 60px; text-align: right; font-variant-numeric: tabular-nums; }
.tv-tag { background: var(--live-soft); color: var(--live); font-size: calc(var(--lfs, 25px) * .74); font-weight: 800; padding: 2px 12px; border-radius: 99px; white-space: nowrap; }
.tv-tag.soft { background: transparent; color: var(--muted); font-weight: 700; font-size: calc(var(--lfs, 25px) * .68); padding: 0; }
.tv-side { padding: 22px 20px; display: flex; flex-direction: column; gap: 4px; min-height: 0; overflow: hidden; }
.tv-row { display: flex; gap: 10px; padding: 7px 8px; font-weight: 700; font-size: var(--tf); border-radius: 12px; }
.tv-row .r { width: 28px; color: var(--muted); } .tv-row .n { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-row.adv { background: var(--accent-soft); font-weight: 800; } .tv-row.adv .r { color: var(--accent); }
.tv-side .tv-h { margin-top: 14px; } .tv-side .tv-h:first-child { margin-top: 0; }
.tv-foot { font-size: 16px; font-weight: 700; color: var(--muted); margin-top: auto; padding-top: 8px; }

/* rozlosování přes celých 80 % */
.tv-draw { display: grid; gap: 24px; min-height: 0; }
.tv-dg { padding: 22px 28px; display: flex; flex-direction: column; gap: 6px; min-height: 0; overflow: hidden; }
.tv-dg h2 { margin: 0 0 4px; font-size: 30px; font-weight: 800; color: var(--accent); }
.tv-dg .cols { display: block; column-gap: 24px; }
.tv-dr { font-size: 20px; font-weight: 800; letter-spacing: .1em; color: var(--muted); margin: 8px 0 2px; break-after: avoid; }
.tv-dm { display: flex; align-items: center; gap: 14px; padding: 0 22px; height: var(--mh); border-radius: 20px; background: var(--bg); font-size: var(--mf); font-weight: 800; margin-bottom: 8px; break-inside: avoid; }
.tv-dm .a, .tv-dm .b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tv-dm i { font-style: normal; font-size: .65em; color: var(--muted); font-weight: 700; }
.tv-dm .bye { color: var(--muted); font-weight: 700; }
.tv-page { margin-left: auto; font-size: 18px; color: var(--muted); font-weight: 700; }
.tv-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; text-align: center; }
.tv-center h2 { font-size: 64px; margin: 0; }
.tv-podium { display: flex; align-items: flex-end; gap: 36px; margin-top: 30px; }
.tv-podium div { box-sizing: border-box; overflow: hidden; width: 360px; text-align: center; border-radius: 28px 28px 0 0; padding: 26px 12px; font-weight: 800; }
.tv-podium .p1 { background: #f2b705; color: #3a2a00; height: 400px; font-size: 44px; }
.tv-podium .p2 { background: #c3ccd6; color: #1b2733; height: 320px; font-size: 38px; }
.tv-podium .p3 { background: #d9915a; color: #35190a; height: 270px; font-size: 34px; }
.tv-podium small { display: block; font-size: 72px; line-height: 1; margin-bottom: 6px; }
.tv-off { position: fixed; left: 12px; top: 10px; background: var(--warn-soft); color: var(--warn); padding: 4px 14px; border-radius: 99px; font: 700 14px system-ui; z-index: 5; }
.tv-fs { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); background: rgba(10, 20, 15, .82); color: #fff; font: 800 22px 'Nunito', system-ui, sans-serif; z-index: 10; padding: 12px 28px; border-radius: 99px; pointer-events: none; }

/* vyvolání zápasu na informační obrazovce */
.tv-call{position:fixed;left:0;right:0;bottom:0;z-index:50;display:flex;align-items:center;justify-content:center;gap:1.6vw;
  padding:.9vw 3vw;background:var(--live-bar,#ff8a5b);color:#fff;font-weight:800;box-shadow:0 -.4vw 2vw rgba(0,0,0,.3);
  transform:translateY(110%);transition:transform .35s ease;pointer-events:none}
.tv-call.show{transform:none}
.tv-call .k{font-size:2.4vw;background:#fff;color:#c24a1a;border-radius:99px;padding:.2vw 1.4vw}
.tv-call .w{font-size:2.2vw;line-height:1.15}
.tv-call i{font-style:normal;font-weight:700;font-size:1.4vw;opacity:.85;margin:0 1vw}

/* veřejná stránka pro hráče */
body.pub{background:var(--bg);color:var(--text)}
.pub-head{padding:16px 16px 4px;max-width:640px;margin:0 auto}
.pub-head h1{margin:0;font-size:1.5rem}
.pub-main{max-width:640px;margin:0 auto;padding:8px 16px 40px;display:flex;flex-direction:column;gap:12px}
.pub-main input[type=search]{width:100%;font-size:1.1rem;padding:12px;box-sizing:border-box;margin-bottom:8px}
.pub-m{padding:8px 0;border-top:1px solid var(--line,rgba(0,0,0,.1))}
.pub-m:first-child{border-top:0}
.pub-meta{font-size:.8rem;color:var(--muted)}
.pub-names{font-size:1.05rem}.pub-names i{font-style:normal;color:var(--muted);margin:0 4px}
.pub-sc{display:block;font-variant-numeric:tabular-nums;font-weight:800;color:var(--accent)}
.pub-now{border-left:5px solid var(--accent);padding-left:10px;margin:6px 0}.pub-court{font-weight:800;color:var(--accent)}
.pub-next{border-left:5px solid #f2b705;padding-left:10px;margin:6px 0}.pub-wait{font-weight:700}
.pub-later{opacity:.75;padding-left:15px}
.pub-done{padding:6px 0;border-top:1px solid var(--line,rgba(0,0,0,.1))}
.pub-row{display:flex;gap:10px;padding:5px 6px;border-radius:8px}.pub-row .n{flex:1}.pub-row .r{width:1.5em;font-weight:800}
.pub-row.adv{background:rgba(11,110,79,.14)}

/* tisk / uložení do PDF na stránce pro hráče */
#print{display:none}
.pr-t{width:100%;border-collapse:collapse;margin:6px 0 14px;font-size:12pt}
.pr-t th,.pr-t td{border-bottom:1px solid #999;padding:4px 6px;text-align:left}
.pr-t td.w{font-weight:800}
@media print{
  body.pub{background:#fff;color:#000}
  body.pub #pub{display:none}
  body.pub #print{display:block;padding:0 6mm;color:#000}
  #print h1{font-size:20pt;margin:0}#print h2{font-size:14pt;margin:14px 0 4px}
  .pr-t tr{break-inside:avoid}
}

.tv-podium em.pl{display:block;font-style:normal;font-size:.5em;font-weight:700;opacity:.8;margin-top:.15em}

.pub-alert{position:fixed;left:0;right:0;top:0;z-index:50;display:flex;gap:12px;align-items:center;justify-content:space-between;padding:14px 16px;background:#f2b705;color:#222;box-shadow:0 4px 18px rgba(0,0,0,.35);font-size:1.05rem}
.pub-alert.go{background:#1f9d55;color:#fff;font-size:1.25rem;animation:pubflash 1s ease-in-out 4}
@keyframes pubflash{50%{filter:brightness(1.35)}}
.ref-flip{text-align:center;padding:2px 10px 6px}.ref-flip button{background:transparent;border:1px dashed currentColor;border-radius:8px;padding:6px 12px;font-size:.9rem;color:inherit;opacity:.85}
.tv-ch.nos, .tv-cr.nos { grid-template-columns: 70px minmax(0, 1fr); }
.tv-promo{position:absolute;right:36px;bottom:6px;font-size:18px;font-weight:700;letter-spacing:.04em;color:var(--muted);opacity:.7;pointer-events:none}

/* sponzoři v záhlaví obrazovky v hale */
#tvc { box-sizing: border-box; position: absolute; inset: 0; }
.tv-head .t { min-width: 0; overflow: hidden; }
.tv-head .t h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-spons { flex: 0 1 auto; min-width: 0; display: flex; flex-direction: row; align-items: center; gap: 16px; max-width: 1000px; }
.tv-spons small { flex: none; font-size: 17px; line-height: 1.2; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); text-align: right; }
.tv-spons div { display: flex; align-items: center; justify-content: flex-end; gap: 14px; height: 84px; min-width: 0; }
.tv-spons img { height: 84px; max-width: 190px; min-width: 0; flex: 0 1 auto; object-fit: contain; border-radius: 10px; }
/* 5 a více sponzorů: pruh přes celou šířku pod názvem, loga v jedné řadě co největší */
.tv-head.has-sp.sp2 { height: auto; flex-wrap: wrap; align-items: flex-start; gap: 4px 20px; }
.tv-head.sp2 .t { order: 1; flex: 1 1 0; }
.tv-head.sp2 .tv-clock, .tv-head.sp2 .tv-pill { order: 2; align-self: center; }
.tv-head.sp2 .tv-spons { order: 3; margin-bottom: 14px; flex: 0 0 100%; max-width: none; flex-direction: column; align-items: stretch; gap: 5px; }
.tv-head.sp2 .tv-spons small { text-align: center; font-size: 17px; line-height: 1.1; letter-spacing: .16em; }
.tv-head.sp2 .tv-spons small br { display: none; }
.tv-head.sp2 .tv-spons small::before { content: none; }
.tv-head.sp2 .tv-spons div { display: flex; justify-content: space-between; align-items: center; gap: 12px; height: 92px; }
.tv-head.sp-few .tv-spons div { justify-content: center; gap: 28px; }
.tv-head.sp2 .tv-spons img { height: 92px; max-width: 290px; flex: 0 1 auto; }
/* když turnaj sponzory má, jsou vidět: hlavička je vyšší a název s údaji menší */
.tv-head.has-sp { height: 96px; }
.tv-head.has-sp .t h1 { font-size: 32px; line-height: 1.06; white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }   /* dlouhý název pokračuje na druhém řádku */
.tv-head.has-sp .s { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tv-free-note { position: absolute; left: 36px; bottom: 8px; font-size: 18px; font-weight: 800; color: var(--muted); background: var(--surface, #fff); padding: 4px 18px; border-radius: 999px; border: 1px solid var(--line, #dfe8e2); white-space: nowrap; }

/* zpětná vazba hráčů (zpetna-vazba.html) */
.fb { max-width: 520px; margin: 0 auto; padding: 16px; }
.fb-card { background: var(--surface, #fff); border-radius: 20px; padding: 22px 20px; display: grid; gap: 16px; box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.fb-card h1 { margin: 0; font-size: 1.5rem; }
.fb-sub { margin: 0; color: var(--muted); }
.fb-q { display: grid; gap: 6px; font-weight: 700; }
.fb-opt { font-weight: 500; color: var(--muted); font-size: .85rem; }
.fb-stars { display: flex; gap: 4px; }
.fb-stars button { font-size: 2.2rem; line-height: 1; padding: 2px 4px; background: none; border: 0; color: var(--line, #cfd8d2); cursor: pointer; }
.fb-stars button.on { color: #f5a300; }
.fb textarea { width: 100%; box-sizing: border-box; font: inherit; padding: 10px; border-radius: 12px; border: 1px solid var(--line, #cfd8d2); }
.fb-err { color: var(--warn, #b3261e); margin: 0; font-weight: 700; }
.fb-send { padding: 14px; font-size: 1.1rem; }

/* oznámení do telefonu a hodinek (stránka pro hráče) */
.push-list{display:flex;flex-direction:column;gap:10px;margin:10px 0}
.push-opt{align-items:flex-start;line-height:1.3}
.push-opt input{margin-top:2px;flex:none}
.push-btns{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0}
.push-warn{padding:8px 10px;border-radius:10px;background:rgba(242,183,5,.18)}

/* kód pro chytrou televizi v okně živého skóre */
.tv-code{margin:10px 0;padding:12px 14px;border-radius:14px;background:rgba(11,110,79,.09);text-align:center}
.tv-code-url{font-weight:700;font-size:1.25rem;word-break:break-all}
.tv-code-num{font-weight:800;font-size:2.4rem;letter-spacing:.12em;font-variant-numeric:tabular-nums;color:var(--accent,#0b6e4f)}

.tv-row .sc{width:66px;text-align:center;color:var(--muted);font-variant-numeric:tabular-nums}
.tv-row .v{width:46px;text-align:right;font-variant-numeric:tabular-nums}
.tv-rh{display:flex;gap:10px;padding:0 8px 2px;font-size:14px;font-weight:800;letter-spacing:.08em;color:var(--muted)}
.tv-rh span:nth-child(1){width:28px}.tv-rh span:nth-child(2){flex:1}.tv-rh span:nth-child(3){width:66px;text-align:center}.tv-rh span:nth-child(4){width:46px;text-align:right}
.tv-row{align-items:center}
.tv-row .n.two{display:flex;flex-direction:column;line-height:1.15;min-width:0}
.tv-row .n.two>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tv-row.alt{background:color-mix(in srgb,var(--muted) 6%,transparent)}
