/* ─────────────────────────────────────────────────────────────
   Totalizatorius — frontend

   Struktūrinės spalvos imamos iš vip.iqkovos.lt bendrinio dizaino
   (tos pačios, kurias naudoja wc-user-points „IQ Taškai" skiltis):
     tekstas #38373d · antrinis #7a7880 · rėmelis #e5e5e5
     kreminis fonas #FCF2DC · apvalinimas 12px / 8px

   --tz-accent ir --tz-soft ateina INLINE pagal sportą (wct_sport_style):
     Krepšinis #E2711D · IQ Kovos #618264 · Futbolas #018749 · Gyvenimiški #6B5B95
   ───────────────────────────────────────────────────────────── */

.wct,
.wct-top,
.wct-busena {
    --tz-accent: #38373d;          /* perrašoma inline pagal sportą */
    --tz-soft:   #f4f4f4;
    --tz-cream:  #FCF2DC;
    --tz-text:   #38373d;
    --tz-muted:  #7a7880;
    --tz-border: #e5e5e5;
    --tz-line:   #efefef;
    --tz-r:      12px;
    --tz-r-sm:   8px;
    font-family: inherit;
    color: var(--tz-text);
}

/* ── Konteineris ─────────────────────────────────────────── */
.wct {
    max-width: 640px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid var(--tz-border);
    border-radius: var(--tz-r);
    padding: 24px;
}
.wct--msg  { text-align: center; }
.wct--bare { border: none; padding: 0; background: none; }

.wct__head {
    display: flex; align-items: baseline; gap: 10px;
    padding-bottom: 14px; margin-bottom: 18px;
    border-bottom: 1px solid var(--tz-line);
}
.wct__sport {
    font-size: .72rem; font-weight: 700; letter-spacing: .08em;
    text-transform: uppercase; color: var(--tz-accent);
}
.wct__season { font-size: .82rem; color: var(--tz-muted); }

/* ── Sezono aprašymas ────────────────────────────────────── */
.wct__desc,
.wct-top__desc {
    background: var(--tz-cream);
    border-radius: var(--tz-r);
    padding: 16px 18px;
    margin-bottom: 20px;
    font-size: .92rem;
    line-height: 1.65;
}
/* Redaktoriaus formatavimas — tema ar Elementor gali būti nunulinę atstumus ir ženkliukus. */
.wct__desc p, .wct-top__desc p { margin: 0 0 .75em; }
.wct__desc ul, .wct-top__desc ul { list-style: disc; margin: 0 0 .75em; padding-left: 1.4em; }
.wct__desc ol, .wct-top__desc ol { list-style: decimal; margin: 0 0 .75em; padding-left: 1.4em; }
.wct__desc li, .wct-top__desc li { margin: .2em 0; }
.wct__desc h1, .wct__desc h2, .wct__desc h3, .wct__desc h4,
.wct-top__desc h1, .wct-top__desc h2, .wct-top__desc h3, .wct-top__desc h4 { margin: .9em 0 .4em; line-height: 1.3; }
.wct__desc a, .wct-top__desc a { color: var(--tz-accent); text-decoration: underline; }
.wct__desc :first-child, .wct-top__desc :first-child { margin-top: 0; }
.wct__desc :last-child,  .wct-top__desc :last-child  { margin-bottom: 0; }

/* ── Etapas ───────────────────────────────────────────────── */
.wct__event { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.wct__enum {
    font-weight: 700; font-size: .72rem; letter-spacing: .05em;
    color: #fff; background: var(--tz-accent);
    border-radius: var(--tz-r-sm); padding: 3px 9px;
}
.wct__etitle { font-weight: 700; font-size: 1.05rem; }
.wct__deadline {
    margin: -8px 0 20px; font-size: .85rem; color: var(--tz-muted);
}
.wct__deadline strong { color: var(--tz-text); }

/* ── Klausimai ───────────────────────────────────────────── */
.wct-q { margin-bottom: 24px; }
.wct-q__text {
    display: flex; gap: 10px; align-items: baseline;
    font-weight: 600; font-size: .97rem; line-height: 1.5; margin-bottom: 10px;
}
.wct-q__n { flex-shrink: 0; font-size: .8rem; font-weight: 700; color: var(--tz-accent); }
.wct-q__hint { font-size: .78rem; color: var(--tz-muted); margin: 6px 0 0; }
.wct-q__err  { font-size: .8rem; color: #b32d2e; margin-top: 6px; }
.wct-q.has-error .wct-input { border-color: #b32d2e; }

.wct .wct-input {
    width: 100%; box-sizing: border-box;
    padding: 11px 13px; font-size: .95rem; font-family: inherit;
    color: var(--tz-text); background: #fff;
    border: 1px solid var(--tz-border); border-radius: var(--tz-r-sm);
}
.wct .wct-input:focus { border-color: var(--tz-accent); outline: none; }

.wct-opts { display: flex; flex-direction: column; gap: 6px; }
.wct-opt {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 13px; cursor: pointer;
    border: 1px solid var(--tz-border); border-radius: var(--tz-r-sm);
    font-size: .93rem; transition: border-color .12s, background .12s;
}
.wct-opt:hover { background: var(--tz-soft); }
.wct-opt input { margin: 0; flex-shrink: 0; accent-color: var(--tz-accent); }
.wct-opt:has(input:checked) { border-color: var(--tz-accent); background: var(--tz-soft); }

/* ── Mygtukas ──────────────────────────────────────────────
   Elementor „Site Settings → Theme Style → Buttons" išleidžia
   `.elementor-kit-N button {...}` (specifiškumas 0,1,1). Mūsų
   `.wct .wct__btn` yra 0,2,0, tad laimim — BET tik tas savybes,
   kurias patys deklaruojame. Todėl čia išvardytos VISOS, kurias
   Elementor gali nustatyti (ypač text-transform ir letter-spacing),
   kitaip jos prasiskverbtų. `!important` — kaip ir kituose šio
   projekto žaidimuose, dėl temos/Elementor perrašymų. */
.wct .wct__btn {
    display: block; width: 100%;
    background: var(--tz-accent) !important;
    color: #fff !important;
    border: none !important;
    border-radius: var(--tz-r-sm) !important;
    padding: 14px 26px !important;
    font-family: inherit !important;
    font-size: .95rem !important;
    font-weight: 600 !important;
    font-style: normal !important;
    line-height: 1.4 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    text-decoration: none !important;
    text-shadow: none !important;
    box-shadow: none !important;
    min-height: 0 !important;
    cursor: pointer;
    transition: opacity .15s;
}
.wct .wct__btn:hover:not(:disabled) { opacity: .88; background: var(--tz-accent) !important; color: #fff !important; }
.wct .wct__btn:disabled { opacity: .5; cursor: default; }
.wct__warn { text-align: center; font-size: .8rem; color: var(--tz-muted); margin: 10px 0 0; }
.wct__error {
    border: 1px solid #e6c9c9; background: #fdf4f4;
    border-radius: var(--tz-r-sm); padding: 11px 14px; margin-bottom: 16px;
    font-size: .88rem; color: #b32d2e;
}

/* ── Pateikta ────────────────────────────────────────────── */
.wct__done {
    display: flex; align-items: center; gap: 12px;
    background: var(--tz-soft);
    border-radius: var(--tz-r); padding: 14px 18px; margin-bottom: 20px;
}
.wct__done-ico { color: var(--tz-accent); font-weight: 700; font-size: 1.1rem; }
.wct__done-time { display: block; font-size: .78rem; color: var(--tz-muted); }
.wct__done-pts { margin-left: auto; font-weight: 700; font-size: 1.05rem; color: var(--tz-accent); }

.wct__answers { display: flex; flex-direction: column; gap: 14px; }
.wct-a__q { font-size: .84rem; color: var(--tz-muted); margin-bottom: 2px; }
.wct-a__v { font-weight: 600; font-size: .97rem; }
.wct-a__pts { margin-left: 8px; font-size: .78rem; font-weight: 700; color: var(--tz-accent); }
.wct__note { font-size: .84rem; color: var(--tz-muted); margin-top: 18px; }

.wct__panel { padding: 22px 0; }
.wct__panel h3 { margin: 0 0 6px; font-size: 1.05rem; }
.wct__panel p { margin: 0; font-size: .9rem; color: var(--tz-muted); }

/* ─────────────────────────────────────────────────────────────
   MANO REZULTATAI
   ───────────────────────────────────────────────────────────── */
.wct-hist { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--tz-line); }
.wct--bare .wct-hist { margin-top: 0; padding-top: 0; border-top: none; }

.wct-hist__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.wct-hist__title { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--tz-muted); }
.wct-hist__season { font-size: .8rem; color: var(--tz-muted); }
.wct-hist__form { margin: 0; }
.wct-hist__form select {
    font-family: inherit; font-size: .8rem; color: var(--tz-text);
    background: #fff; border: 1px solid var(--tz-border);
    border-radius: var(--tz-r-sm); padding: 4px 8px; cursor: pointer;
}
.wct-hist__sum { font-size: .85rem; color: var(--tz-muted); margin: 0 0 12px; }
.wct-hist__sum strong { color: var(--tz-text); }
.wct-hist__empty { font-size: .88rem; color: var(--tz-muted); margin: 8px 0 0; }

.wct-hist__item { border-bottom: 1px solid var(--tz-line); }
.wct-hist__item:last-child { border-bottom: none; }
.wct-hist__item > summary {
    display: flex; align-items: baseline; gap: 10px;
    padding: 12px 0; cursor: pointer; list-style: none;
    font-size: .92rem;
}
.wct-hist__item > summary::-webkit-details-marker { display: none; }
.wct-hist__item > summary::before {
    content: "›"; color: var(--tz-muted); font-size: 1.1rem; line-height: 1;
    transition: transform .15s; display: inline-block;
}
.wct-hist__item[open] > summary::before { transform: rotate(90deg); }
.wct-hist__e { font-weight: 700; color: var(--tz-accent); min-width: 26px; }
.wct-hist__t { flex: 1; color: var(--tz-text); }
.wct-hist__p { font-weight: 700; font-variant-numeric: tabular-nums; }
.wct-hist__p--wait { font-weight: 400; font-size: .8rem; color: var(--tz-muted); }

.wct-hist__body { padding: 2px 0 16px 22px; }
.wct-hist__a { margin-bottom: 12px; }
.wct-hist__q { font-size: .82rem; color: var(--tz-muted); margin-bottom: 2px; }
.wct-hist__v { font-size: .92rem; font-weight: 600; display: flex; gap: 10px; align-items: baseline; }
.wct-hist__v .is-right { color: var(--tz-accent); }
.wct-hist__pts { margin-left: auto; font-size: .8rem; color: var(--tz-muted); font-variant-numeric: tabular-nums; }
.wct-hist__c { font-size: .8rem; color: var(--tz-muted); margin-top: 2px; }
.wct-hist__when { font-size: .76rem; color: var(--tz-muted); margin: 10px 0 0; }

/* ─────────────────────────────────────────────────────────────
   LENTELĖS
   ───────────────────────────────────────────────────────────── */
.wct-top {
    max-width: 900px; margin: 0 auto;
    border: 1px solid var(--tz-border); border-radius: var(--tz-r); overflow: hidden;
    background: #fff;
}
.wct-top__head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 16px 18px; border-bottom: 1px solid var(--tz-border);
}
.wct-top__title { font-weight: 700; font-size: 1rem; }
.wct-top__form { margin: 0; }
.wct-top__select {
    font-family: inherit; font-size: .8rem; color: var(--tz-text);
    background: #fff; border: 1px solid var(--tz-border);
    border-radius: var(--tz-r-sm); padding: 5px 10px; cursor: pointer;
}
.wct-top__desc { margin: 16px 18px; }
.wct-top__empty { padding: 30px 18px; text-align: center; color: var(--tz-muted); font-size: .9rem; }
.wct-top__legend { padding: 12px 18px; margin: 0; font-size: .76rem; color: var(--tz-muted); border-top: 1px solid var(--tz-line); }

/* Horizontalus slinkimas — puslapio kūnas neslenka */
.wct-top__scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Lentelės stilius perimtas iš svetainės [wcp_topas] lyderių lentelės
   (wc-user-points): kreminė antraštė, jokių vertikalių rėmelių, plati
   vidinė paraštė, eilutės paryškinimas užvedus. */
.wct-top__table { width: 100%; border-collapse: collapse !important; margin: 0 !important; }
.wct-top__table thead th,
.wct-top__table tbody td {
    border: none !important;
    vertical-align: middle !important;
    line-height: 1.4 !important;
}
.wct-top__table thead th {
    font-size: .66rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
    color: var(--tz-muted); padding: 11px 8px !important; text-align: left;
    border-bottom: 1px solid var(--tz-border) !important; white-space: nowrap;
}
.wct-top__table tbody tr:not(:last-child) td {
    border-bottom: 1px solid var(--tz-border) !important;
}
.wct-top__table tbody td {
    padding: 12px 8px; font-size: .9rem; color: var(--tz-text);
    font-variant-numeric: tabular-nums; transition: background .12s;
}

/* Fonai — BŪTINAI neperšviečiami (prilipę stulpeliai) */
.wct-top .wct-top__table tbody td { background-color: #fff !important; }
.wct-top .wct-top__table thead th { background-color: #FDF5E3 !important; }

/* Nario stulpelis laikomas siauras — pagrindinė vieta skirta etapų
   rezultatams. Ilgi nikai ir komandų pavadinimai trumpinami daugtaškiu,
   pilnas tekstas matomas užvedus (title). */
.wct-c-rank { width: 40px; text-align: center !important; padding: 12px 4px !important; }
.wct-c-name {
    text-align: left !important;
    width: 132px; max-width: 132px;
    padding-left: 6px !important; padding-right: 10px !important;
}
/* Nikas ir ženkliukai — vienoje eilutėje, komanda — antroje.
   `inline-block` su max-width leidžia trumpinti daugtaškiu ir palieka
   vietos narystės ikonoms greta, o ne kitoje eilutėje. */
.wct-name {
    display: inline-block; max-width: calc(100% - 24px); vertical-align: middle;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wct-team {
    display: block; max-width: 100%;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wct-c-num  { width: 66px; text-align: right !important; color: var(--tz-muted); }
.wct-c-e    { min-width: 38px; text-align: center !important; padding-left: 4px !important; padding-right: 4px !important; }
.wct-c-total { width: 66px; text-align: right !important; font-weight: 700; color: var(--tz-accent); padding-right: 14px !important; }
.wct-top__table thead th.wct-c-e,
.wct-top__table thead th.wct-c-rank { text-align: center; }
.wct-top__table thead th.wct-c-total,
.wct-top__table thead th.wct-c-num { text-align: right; }

.wct-top .wct-top__table td.wct-c-e.is-played { background-color: var(--tz-soft) !important; font-weight: 600; }
.wct-top .wct-top__table td.wct-c-e.is-empty  { background-color: #fff !important; }

/* Eilutės paryškinimas — po `is-played`, kad laimėtų ir ant jo */
.wct-top .wct-top__table tbody tr:hover td { background-color: #FFFAF0 !important; }

/* Vietos ženkliukas — kaip svetainės [wcp_topas]: skaičius apskritime */
.wct-medal {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 50%;
    font-size: .78rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.wct-medal--gold   { background: #fff3cd; color: #b8860b; border: 1.5px solid #f0c040; }
.wct-medal--silver { background: #f0f0f0; color: #777;    border: 1.5px solid #ccc; }
.wct-medal--bronze { background: #fce8de; color: #a0522d; border: 1.5px solid #e8a080; }
.wct-medal--plain  { background: transparent; color: var(--tz-muted); border: 1.5px solid var(--tz-border); }

.wct-name { font-weight: 600; font-size: .88rem; }
.wct-team { font-size: .72rem; color: var(--tz-muted); }
.wct-micons { display: inline-flex; align-items: center; gap: 2px; margin-left: 4px; vertical-align: middle; }
.wct-mico { width: 15px; height: 15px; object-fit: contain; vertical-align: middle; }

/* Prilipę stulpeliai — narys kairėje, taškai dešinėje */
.wct-top__table th.wct-c-rank,
.wct-top__table td.wct-c-rank { position: sticky; left: 0;  z-index: 2; }
.wct-top__table th.wct-c-name,
.wct-top__table td.wct-c-name { position: sticky; left: 40px; z-index: 2; box-shadow: 1px 0 0 var(--tz-line); }
.wct-top__table th.wct-c-total,
.wct-top__table td.wct-c-total { position: sticky; right: 0; z-index: 2; box-shadow: -1px 0 0 var(--tz-line); }
.wct-top__table th.wct-c-rank,
.wct-top__table th.wct-c-name,
.wct-top__table th.wct-c-total { z-index: 3; }

/* Paprastoje (visų laikų) lentelėje slinkimo nėra */
.wct-top__table--simple th, .wct-top__table--simple td { position: static !important; box-shadow: none !important; }

@media (max-width: 600px) {
    .wct { padding: 18px; }
    .wct-top__table th, .wct-top__table td { padding: 10px 5px; font-size: .86rem; }
    .wct-c-rank { width: 32px; padding: 10px 2px !important; }
    .wct-c-name { width: 96px; max-width: 96px; }
    .wct-top__table th.wct-c-name,
    .wct-top__table td.wct-c-name { left: 32px; }
    .wct-c-e { min-width: 32px; }
    .wct-c-total { width: 52px; padding-right: 10px !important; }
    .wct-medal { width: 24px; height: 24px; font-size: .72rem; }
    .wct-name { font-size: .84rem; }
    .wct-team { font-size: .68rem; }
}

/* ── Būsenos kortelė ─────────────────────────────────────── */
.wct-busena {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    max-width: 600px; padding: 14px 18px; border-radius: var(--tz-r);
    border: 1px solid var(--tz-border); background: #fff; font-size: .95rem;
}
.wct-busena.is-done { background: var(--tz-soft); }
.wct-busena__ico { color: var(--tz-accent); font-weight: 700; }
.wct-busena__txt small { display: block; font-size: .76rem; color: var(--tz-muted); }
/* Būsenos kortelės mygtukas — ta pati apsauga nuo temos ir Elementor.
   Tema pabraukia visas nuorodas, Elementor gali nustatyti didžiąsias raides. */
.wct-busena a.wct-busena__btn,
.wct-busena .wct-busena__btn,
.wct-busena .wct-busena__btn:hover,
.wct-busena .wct-busena__btn:focus,
.wct-busena .wct-busena__btn:active {
    margin-left: auto;
    background: var(--tz-accent) !important;
    color: #fff !important;
    border: none !important;
    border-radius: var(--tz-r-sm) !important;
    padding: 9px 16px !important;
    font-family: inherit !important;
    font-size: .85rem !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    text-decoration: none !important;
    box-shadow: none !important;
}
.wct-busena .wct-busena__btn:hover { opacity: .88; }
