/* ============================================================
   Турнирный хаб (v468): главная #tourHub и полосы [data-tour-strip].
   Только переменные темы — светлая тема и палитры работают сами.
   ============================================================ */
.tour-hub { padding: 18px 0 6px; }
.tour-hub[hidden] { display: none; }

.th-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
    gap: 16px;
    align-items: stretch;
}

/* ---------- Главная карточка турнира ---------- */
.th-main {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 26px 26px 24px;
    border-radius: 22px;
    border: 1px solid var(--border-soft);
    background:
        radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--game-brawl) 22%, transparent) 0%, transparent 55%),
        linear-gradient(160deg, color-mix(in srgb, var(--accent) 26%, var(--surface)) 0%, var(--surface) 70%);
    box-shadow: var(--shadow-md);
    isolation: isolate;
}
.th-main::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: var(--th-img, none);
    background-size: cover;
    background-position: center;
    opacity: .16;
    mask-image: linear-gradient(90deg, transparent 15%, #000 85%);
    -webkit-mask-image: linear-gradient(90deg, transparent 15%, #000 85%);
}
.th-main.is-live { border-color: color-mix(in srgb, var(--danger) 55%, transparent); }

.th-main-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.th-more { font-size: var(--text-sm); color: var(--text-muted); text-decoration: none; white-space: nowrap; }
.th-next {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 10px;
    align-items: baseline;
    margin-top: 4px;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px dashed var(--border-soft);
    color: var(--text);
    text-decoration: none;
}
.th-next span { grid-row: span 2; font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .1em; color: var(--text-dim); }
.th-next small { color: var(--text-muted); font-size: var(--text-xs); }
.th-next:hover { border-color: var(--accent-ring); }
.th-more:hover { color: var(--text); }

.th-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    background: var(--accent-soft);
    color: var(--text);
    border: 1px solid var(--accent-ring);
    white-space: nowrap;
}
.th-chip.is-open    { background: color-mix(in srgb, var(--success) 16%, transparent); border-color: color-mix(in srgb, var(--success) 45%, transparent); }
.th-chip.is-in      { background: color-mix(in srgb, var(--info) 16%, transparent);    border-color: color-mix(in srgb, var(--info) 45%, transparent); }
.th-chip.is-checkin { background: color-mix(in srgb, var(--warning) 18%, transparent); border-color: color-mix(in srgb, var(--warning) 50%, transparent); }
.th-chip.is-live    { background: color-mix(in srgb, var(--danger) 18%, transparent);  border-color: color-mix(in srgb, var(--danger) 50%, transparent); }
.th-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); animation: th-pulse 1.4s infinite; }
@keyframes th-pulse { 0%,100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--danger) 60%, transparent); } 50% { box-shadow: 0 0 0 6px transparent; } }

.th-kicker {
    font-size: var(--text-xs);
    letter-spacing: .12em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--game-brawl);
}
.th-title {
    margin: 0;
    font-family: var(--font-display, var(--font-head));
    font-weight: 400;
    font-size: clamp(1.5rem, 3.4vw, 2.3rem);
    line-height: 1.1;
}
.th-title a { color: inherit; text-decoration: none; }
.th-title a:hover { text-decoration: underline; text-underline-offset: 4px; }
.th-meta, .th-lead { margin: 0; color: var(--text-muted); }
.th-prize { color: var(--gold); }

.th-count { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.th-count span {
    display: grid;
    justify-items: center;
    min-width: 66px;
    padding: 10px 8px 8px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--bg) 55%, transparent);
    border: 1px solid var(--border-soft);
}
.th-count b {
    font-family: var(--font-display, var(--font-head));
    font-weight: 400;
    font-size: 1.7rem;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.th-count i { font-style: normal; font-size: var(--text-xs); color: var(--text-dim); margin-top: 4px; }
.th-count.is-zero { opacity: .5; }

.th-slots { display: grid; gap: 6px; font-size: var(--text-sm); color: var(--text-muted); }
.th-slots-bar { height: 8px; border-radius: 999px; background: color-mix(in srgb, var(--bg) 60%, transparent); overflow: hidden; }
.th-slots-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--game-brawl)); }

.th-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 6px; }
.th-cta { font-size: 1.02rem; padding-inline: 22px; }

/* ---------- Боковая колонка ---------- */
.th-side { display: grid; gap: 12px; align-content: start; }
.th-card {
    display: grid;
    gap: 6px;
    padding: 16px 18px;
    border-radius: 18px;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    color: var(--text);
    text-decoration: none;
}
a.th-card { transition: border-color var(--transition), transform var(--transition); }
a.th-card:hover { border-color: var(--accent-ring); transform: translateY(-1px); }
.th-card b { font-size: var(--text-lg); }
.th-card b small { font-size: var(--text-sm); color: var(--text-dim); font-weight: 400; }
.th-card small { color: var(--text-muted); font-size: var(--text-sm); }
.th-match { border-color: color-mix(in srgb, var(--info) 45%, transparent); }

.th-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.th-card-head h3, .th-guest h3 { margin: 0; font-size: var(--text-md); }
.th-card-head h3 i, .th-guest h3 i { color: var(--game-brawl); }
.th-charges-n { font-family: var(--font-display, var(--font-head)); font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.th-charges-sum { margin: 2px 0 0; font-size: var(--text-sm); color: var(--text-muted); }
.th-charges-sum b { color: var(--gold); }

.th-cells { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.th-cells i {
    height: 12px;
    border-radius: 4px;
    background: color-mix(in srgb, var(--bg) 65%, transparent);
    border: 1px solid var(--border-soft);
}
.th-cells i.on {
    background: linear-gradient(180deg, var(--game-brawl), color-mix(in srgb, var(--game-brawl) 60%, #ff7a3d));
    border-color: transparent;
    box-shadow: 0 0 10px color-mix(in srgb, var(--game-brawl) 45%, transparent);
}

.th-tasks { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.th-task {
    display: grid;
    grid-template-columns: 22px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--bg) 35%, transparent);
}
.th-task > i { color: var(--accent); text-align: center; }
.th-task span { display: grid; }
.th-task b { font-size: var(--text-sm); }
.th-task small { font-size: var(--text-xs); }
.th-task em { font-style: normal; font-size: var(--text-xs); color: var(--success); font-weight: 700; }
.th-task.is-done > i { color: var(--success); }
.th-task.is-done b { color: var(--text-muted); }
.th-task-go {
    font-size: var(--text-xs);
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--on-accent);
    text-decoration: none;
}
.th-task-go:hover { filter: brightness(1.1); }

.th-steps { margin: 4px 0 8px; padding-left: 20px; display: grid; gap: 8px; }
.th-steps li { display: grid; }

/* ---------- Полоса на других страницах ---------- */
.tstrip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 0 16px;
    padding: 12px 16px;
    border-radius: 16px;
    background: linear-gradient(90deg, color-mix(in srgb, var(--game-brawl) 14%, var(--surface)), var(--surface));
    border: 1px solid var(--border-soft);
}
.tstrip[hidden] { display: none; }
.tstrip-left { display: flex; align-items: center; gap: 12px; flex: 1 1 320px; min-width: 0; }
.tstrip-ico { color: var(--game-brawl); font-size: 1.1rem; }
.tstrip .th-cells { width: 120px; flex: 0 0 auto; gap: 3px; }
.tstrip .th-cells i { height: 9px; }
.tstrip-text { font-size: var(--text-sm); color: var(--text-muted); }
.tstrip-text b { color: var(--text); }
.tstrip-next {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--on-accent);
    font-size: var(--text-sm);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 860px) {
    .th-grid { grid-template-columns: 1fr; }
    .th-main { padding: 20px 18px; }
    .th-count span { min-width: 58px; }
}
@media (max-width: 480px) {
    .tstrip .th-cells { display: none; }
    .tstrip-next { width: 100%; justify-content: center; white-space: normal; text-align: center; }
    .th-count b { font-size: 1.4rem; }
    .th-count span { min-width: 0; flex: 1; }
    .th-count { flex-wrap: nowrap; }
}
@media (prefers-reduced-motion: reduce) { .th-dot { animation: none; } }

/* ---------- v470: карточка ниже, сезон внутри, итоги прошлого ---------- */
.th-grid { align-items: start; }
.th-main { gap: 10px; padding: 22px 24px; }
.th-actions { margin-top: 4px; padding-top: 2px; }
.featured-section[hidden] { display: none !important; }

.th-empty-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.th-empty-main { display: grid; gap: 10px; align-content: start; }
.th-main--empty .th-title { font-size: clamp(1.4rem, 2.8vw, 2rem); }
.th-last { padding: 14px 16px; }
.th-last .next-cup-podium { gap: 6px; margin-top: 4px; }
.th-last .next-cup-podium .nc-ava { width: 34px; height: 34px; }

.th-season-row {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    margin-top: 4px; padding: 12px 14px; border-radius: 14px;
    background: color-mix(in srgb, var(--bg) 45%, transparent);
    border: 1px solid var(--border-soft);
    color: var(--text); text-decoration: none;
    transition: border-color var(--transition);
}
.th-season-row:hover { border-color: var(--accent-ring); }
.th-sr-title { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.th-sr-title i { color: var(--game-brawl); align-self: center; }
.th-sr-title small, .th-sr-me small, .th-sr-me span { color: var(--text-muted); font-size: var(--text-sm); }
.th-sr-me { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.th-sr-me b { font-family: var(--font-display, var(--font-head)); font-weight: 400; font-size: 1.25rem; }
.th-sr-go { margin-left: auto; font-size: var(--text-sm); font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.th-season-row:hover .th-sr-go { color: var(--text); }

@media (max-width: 860px) {
    .th-empty-grid { grid-template-columns: 1fr; }
    .th-sr-go { margin-left: 0; }
}
.th-empty-grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
.th-main--empty .th-title { font-size: clamp(1.3rem, 2.2vw, 1.7rem); }

/* ---------- v473: обе плашки одной высоты (по колонке зарядов) ---------- */
@media (min-width: 861px) {
    .th-grid { align-items: stretch; }
    .th-main.th-fit { contain: size; }
    .th-side { align-content: start; }
}
.th-main--empty { gap: 8px; padding: 20px 22px; }
.th-main--empty .th-empty-main { gap: 8px; }
.th-main--empty .th-lead { margin: 0; font-size: var(--text-sm); line-height: 1.45; }
.th-main--empty .th-actions { margin-top: 2px; }
.th-main--empty .th-last { padding: 12px 14px; }
.th-main--empty .th-season-row { margin-top: auto; padding: 10px 14px; }
.th-main { justify-content: flex-start; }
.th-main.th-fit .th-season-row { margin-top: auto; }

/* ---------- v474: «бесплатно», расписание недели, ссылка на победителей ---------- */
.th-free {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
    font-size: var(--text-xs); font-weight: 700; letter-spacing: .02em; white-space: nowrap;
    color: var(--success); background: color-mix(in srgb, var(--success) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--success) 35%, transparent);
}
.th-main-top { flex-wrap: wrap; }
.th-main-top .th-more { margin-left: auto; }
.th-empty-main > .th-free { justify-self: start; }
.th-win-link { margin-top: 6px; font-size: var(--text-sm); font-weight: 600; color: var(--text-muted); text-decoration: none; }
.th-win-link:hover { color: var(--text); }

.th-week { margin-top: 16px; padding: 18px 20px; border-radius: 22px; border: 1px solid var(--border-soft); background: var(--surface); box-shadow: var(--shadow-md); }
.th-week-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.th-week-title { margin: 0; font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.th-week-title i { color: var(--game-brawl, var(--accent)); }
.th-week-days { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(210px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x proximity; }
.th-day { display: grid; gap: 8px; align-content: start; scroll-snap-align: start; }
.th-day-name { font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); }
.th-day.is-today .th-day-name { color: var(--game-brawl, var(--accent)); }
.th-slot { display: grid; gap: 3px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--border-soft); background: color-mix(in srgb, var(--bg) 40%, transparent); color: var(--text); text-decoration: none; transition: border-color var(--transition), transform var(--transition); }
.th-slot:hover { border-color: var(--accent-ring); transform: translateY(-1px); }
.th-slot.is-live { border-color: color-mix(in srgb, var(--danger) 55%, transparent); }
.th-slot-time { font-family: var(--font-display, var(--font-head)); font-size: 1.05rem; }
.th-slot-time small { font-family: var(--font-head); font-size: .7rem; color: var(--text-dim); }
.th-slot.is-live .th-slot-time { color: var(--danger); }
.th-slot-title { font-size: var(--text-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th-slot-meta { font-size: var(--text-xs); color: var(--text-muted); }
.th-slot-meta em { font-style: normal; color: var(--gold); font-weight: 700; }
@media (max-width: 560px) { .th-week { padding: 14px; } .th-week-days { grid-auto-columns: 78%; } }

/* ---------- v475: обе плашки хаба всегда одной высоты ---------- */
@media (min-width: 861px) {
    .th-grid { align-items: stretch !important; }
    .th-side { display: flex; flex-direction: column; gap: 12px; }
    .th-side > .th-card:last-child { flex: 1 1 auto; }
    .th-side > .th-charges { display: flex; flex-direction: column; }
    .th-side > .th-charges .th-tasks { flex: 1 1 auto; grid-auto-rows: 1fr; align-content: stretch; }
    .th-side > .th-charges .th-task { align-items: center; }
}

.th-grid.has-banner .th-main::before { display: none; }
.th-grid.has-banner .th-slice {
    background-image: linear-gradient(180deg, rgba(8, 8, 28, .45) 0%, rgba(8, 8, 28, .82) 100%), var(--sb-img);
    background-size: 100% 100%, var(--sb-size);
    background-position: 0 0, var(--sb-pos);
    background-repeat: no-repeat;
    border-color: color-mix(in srgb, #fff 16%, transparent);
}
.th-grid.has-banner .th-main.th-slice {
    background-image: linear-gradient(90deg, rgba(8, 8, 28, .9) 0%, rgba(8, 8, 28, .62) 55%, rgba(8, 8, 28, .35) 100%), var(--sb-img);
}
.th-grid.has-banner .th-slice .th-title, .th-grid.has-banner .th-slice h3, .th-grid.has-banner .th-slice b { text-shadow: 0 1px 8px rgba(0, 0, 0, .55); }
.th-grid.has-banner .th-side > .th-card.th-slice { backdrop-filter: none; }
.th-grid.has-banner .th-charges .th-task { background: rgba(8, 8, 28, .55); }
.th-banner-admin { display: flex; justify-content: flex-end; }
.th-banner-admin:empty { display: none; }
.th-banner-admin .btn { margin: 10px 0 -6px; }
.th-grid.has-banner .th-slice { transition: opacity .35s ease; }
.th-grid.has-banner.is-swap .th-slice { opacity: .55; }

@media (min-width: 861px) {
    .th-side > .th-charges, .th-side > .th-card.th-charges:last-child { flex: 0 0 auto; }
    .th-side > .th-charges .th-tasks { flex: 0 0 auto; grid-auto-rows: auto; align-content: start; }
}
