/* ── ზოგადი: ნავიგაცია */
.tabs { display: flex; gap: 4px; background: var(--s1); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.tabs a { padding: 7px 14px; border-radius: 9px; color: var(--muted); text-decoration: none; font-size: 13.5px; font-weight: 500; }
.tabs a.on { background: linear-gradient(135deg, #38bdf8, #2563eb); color: #fff; font-weight: 700; }

.sport-page { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.sport { max-width: 1040px; margin: 0 auto; padding: 8px 16px 24px; display: flex; flex-direction: column; gap: 14px; }
.sport h1 { font-size: 22px; margin: 6px 0 0; }
.sport h1 small { display: block; color: var(--muted); font-size: 13px; font-weight: 400; margin-top: 2px; }
.card { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.card h3 { margin: 0 0 10px; font-size: 15px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card h3 small { color: var(--muted); font-weight: 400; font-size: 12px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.row > label, .f { flex: 1; min-width: 120px; display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 12px; }
.row input, .row select, .f input, .f select, .f textarea {
  width: 100%; height: 42px; padding: 0 12px; border-radius: 11px; background: var(--bg); border: 1px solid var(--line2); outline: none; color: var(--text);
}
.f textarea { height: 84px; padding: 10px 12px; resize: vertical; font-family: var(--mono); }
.row input:focus, .row select:focus, .f input:focus, .f textarea:focus { border-color: var(--acc); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 820px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }
.empty { text-align: center; color: var(--muted); padding: 28px 10px; font-size: 14px; }
.empty b { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }
.btn.primary { background: linear-gradient(135deg, #38bdf8, #2563eb); border: 0; color: #fff; }
.btn.danger { color: #fca5a5; border-color: rgba(252,165,165,.35); background: transparent; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; background: rgba(56,189,248,.12); color: #7dd3fc; border: 1px solid rgba(56,189,248,.25); }
.chip.warn { background: rgba(251,146,60,.12); color: #fdba74; border-color: rgba(251,146,60,.35); }
.chip.ok { background: rgba(98,211,148,.12); color: #86efac; border-color: rgba(98,211,148,.3); }
.chip.dim { background: var(--s2); color: var(--muted); border-color: var(--line2); }

/* ── ქვედა ნავიგაცია */
.bnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(6, 11, 22, .92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); padding: 6px 6px max(6px, env(safe-area-inset-bottom));
}
.bnav button { background: none; border: 0; color: var(--dim); display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; padding: 4px 0; border-radius: 10px; }
.bnav button svg { width: 22px; height: 22px; }
.bnav button.on { color: var(--acc); }
@media (min-width: 900px) { .bnav { max-width: 640px; margin: 0 auto 12px; border: 1px solid var(--line); border-radius: 18px; } }

/* ── სამიზნე / რედაქტორი */
.src-seg { margin-top: 12px; }
.ed-wrap { position: relative; }
#edCv { width: 100%; height: min(70vh, 560px); display: block; border-radius: 14px; touch-action: none; cursor: crosshair; background: var(--bg); }
.ed-tools { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.ed-tools .btn { height: 36px; padding: 0 12px; font-size: 13px; }
.ed-tools .btn.on { border-color: var(--acc); color: var(--acc); }
.ed-hint { color: var(--muted); font-size: 12.5px; margin: 8px 0 0; }
.ed-hint b { color: var(--text); }
.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center;
  height: 280px; border: 2px dashed var(--line2); border-radius: 16px; color: var(--muted); cursor: pointer;
}
.drop svg { width: 48px; height: 48px; color: var(--acc); }
.drop b { color: var(--text); font-size: 16px; }
.selbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--s2); border: 1px solid var(--line2); }
.selbar b { font-family: var(--mono); margin-right: auto; }

.score-big { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.score-big .tot { font-family: var(--mono); font-size: 48px; font-weight: 700; line-height: 1; background: linear-gradient(135deg, #7dd3fc, #38bdf8 50%, #2563eb); -webkit-background-clip: text; background-clip: text; color: transparent; }
.score-big .sub { color: var(--muted); font-size: 13px; }
.score-big .sub b { color: var(--text); font-family: var(--mono); }
.shots { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.shots button { font-family: var(--mono); font-size: 13px; padding: 6px 9px; border-radius: 9px; background: var(--bg); border: 1px solid var(--line2); color: var(--text); }
.shots button i { font-style: normal; color: var(--dim); font-size: 10.5px; margin-right: 4px; }
.shots button.sel { border-color: #fff; }
.shots button.disputed { border-color: #fb923c; color: #fdba74; }
.shots button.verify { border-style: dashed; border-color: #facc15; }
.gstats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.gstats div { background: var(--bg); border: 1px solid var(--line); border-radius: 11px; padding: 8px 10px; }
.gstats span { display: block; color: var(--muted); font-size: 11px; }
.gstats b { font-family: var(--mono); font-size: 16px; }
@media (max-width: 520px) { .gstats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.linkbar { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(56,189,248,.08); border: 1px solid rgba(56,189,248,.3); font-size: 13px; }
.linkbar span { flex: 1; }
.save-row { position: sticky; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 5; }
.save-row .btn { width: 100%; height: 52px; font-size: 16px; box-shadow: 0 10px 30px rgba(37,99,235,.35); }

/* ── სიები */
.list-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.lc { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 16px; background: var(--s1); border: 1px solid var(--line); cursor: pointer; text-align: left; color: var(--text); width: 100%; }
.lc:hover { border-color: var(--line2); }
.lc canvas, .lc img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; flex: none; background: var(--bg); }
.lc .meta { flex: 1; min-width: 0; }
.lc .meta b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc .meta small { color: var(--muted); font-size: 12px; display: block; }
.lc .val { font-family: var(--mono); font-size: 22px; font-weight: 700; color: var(--acc); }
.avatar { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 17px; color: #fff; flex: none; background: linear-gradient(135deg, #38bdf8, #2563eb); }
.medals { font-size: 13px; letter-spacing: 1px; }

/* ── ლიდერბორდი */
.lb { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.lb th { text-align: left; color: var(--muted); font-weight: 500; font-size: 11.5px; padding: 8px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; position: static; background: none; font-family: var(--font); }
.lb td { padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; font-family: var(--font); text-align: left; }
.lb td.n { font-family: var(--mono); text-align: right; }
.lb th.n { text-align: right; }
.lb tr.fin td { background: rgba(56,189,248,.05); }
.lb .rk { font-family: var(--mono); font-weight: 700; color: var(--muted); width: 34px; }
.lb tr:nth-child(1) .rk { color: #fcd34d; } .lb tr:nth-child(2) .rk { color: #cbd5e1; } .lb tr:nth-child(3) .rk { color: #fdba74; }
.lb .cell { cursor: pointer; color: var(--dim); }
.lb .cell.has { color: var(--text); }
.lb .tot { font-weight: 700; color: var(--acc); }
.tbl-wrap { overflow-x: auto; }
.h2h { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; text-align: center; padding: 6px 0 12px; }
.h2h .nm { font-weight: 700; font-size: 16px; }
.h2h .pts { font-family: var(--mono); font-size: 40px; font-weight: 700; color: var(--acc); }
.h2h .vs { color: var(--muted); font-size: 13px; }

.spark { width: 100%; height: 70px; display: block; }
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat-grid div { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-align: center; }
.stat-grid span { display: block; color: var(--muted); font-size: 11.5px; }
.stat-grid b { font-family: var(--mono); font-size: 20px; color: var(--acc); }
.log { font-size: 12.5px; color: var(--muted); margin: 0; padding-left: 18px; }
.log li { margin: 3px 0; }
.check-list { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; }
.check-list label { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; font-size: 14px; }
.check-list input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--acc); flex: none; }
.check-list input[type=text], .check-list select { height: 32px; width: 110px; padding: 0 8px; border-radius: 8px; background: var(--s1); border: 1px solid var(--line2); color: var(--text); margin-left: auto; }
.m-title { font-size: 17px; }
.m-body { padding: 4px 18px 14px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 12px; }
#detCv { width: 100%; height: 360px; border-radius: 14px; display: block; touch-action: none; }

/* ── მაყურებლის რეჟიმი */
.spec {
  position: fixed; inset: 0; z-index: 90; overflow-y: auto; padding: 28px 4vw;
  background: radial-gradient(1200px 700px at 80% -10%, rgba(56,189,248,.25), transparent 60%), radial-gradient(900px 600px at 0% 100%, rgba(37,99,235,.25), transparent 60%), #040812;
}
.spec-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 3vh; }
.spec-head h2 { font-size: clamp(24px, 3.4vw, 54px); margin: 0; line-height: 1.1; }
.spec-head p { color: var(--muted); font-size: clamp(14px, 1.4vw, 22px); margin: 6px 0 0; }
.live { display: inline-flex; align-items: center; gap: 8px; color: #fca5a5; font-weight: 700; letter-spacing: 1px; font-size: clamp(12px, 1.1vw, 18px); }
.live i { width: 10px; height: 10px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 12px #ef4444; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.spec-row { display: grid; grid-template-columns: 70px 1fr repeat(var(--cols), minmax(50px, 90px)) 120px; align-items: center; gap: 10px; padding: 1.2vh 1.4vw; border-radius: 16px; margin-bottom: 1vh; background: rgba(15,27,49,.75); border: 1px solid var(--line); font-size: clamp(15px, 1.7vw, 28px); transition: transform .4s; }
.spec-row.hd { background: none; border: 0; color: var(--muted); font-size: clamp(11px, 1vw, 16px); padding-top: 0; padding-bottom: 0; }
.spec-row .r { font-family: var(--mono); font-weight: 700; color: var(--muted); }
.spec-row:nth-child(2) .r { color: #fcd34d; } .spec-row:nth-child(3) .r { color: #cbd5e1; } .spec-row:nth-child(4) .r { color: #fdba74; }
.spec-row .s { font-family: var(--mono); text-align: right; color: var(--muted); }
.spec-row .t { font-family: var(--mono); text-align: right; font-weight: 700; color: var(--acc); font-size: 1.15em; }
.spec-row .nm small { display: block; color: var(--muted); font-size: .55em; }
.spec-exit { position: fixed; top: 14px; right: 14px; z-index: 91; opacity: .5; }
.spec-exit:hover { opacity: 1; }
.spec .h2h .pts { font-size: clamp(60px, 9vw, 160px); }
.spec .h2h .nm { font-size: clamp(22px, 3vw, 48px); }
