/* ============================================================
   ННХЛ — «Night Arena» (v4)
   Единая тёмная тема в духе NHL.com: чёрный лёд, красный акцент,
   крупная типографика, строгая сетка, плоские карточки.
   Подключать последним в <head>.
   ============================================================ */

:root {
    --nhl-red: #c8102e;
    --nhl-red-dark: #a80d26;
    --nhl-ink: #0a0a0b;
    --nhl-surface: #131316;
    --nhl-surface-2: #17171b;
    --nhl-line: rgba(255, 255, 255, 0.085);
    --nhl-line-soft: rgba(255, 255, 255, 0.05);

    --nhl-text: #f5f5f7;
    --nhl-muted: #9ea3ad;
    --nhl-dim: #6f7480;

    --bg-color: var(--nhl-ink);
    --bg-soft: #0f0f11;
    --card-bg: var(--nhl-surface);
    --card-solid: var(--nhl-surface);
    --card-border: var(--nhl-line);
    --header-bg: rgba(8, 8, 9, 0.92);
    --ticker-bg: #08080a;

    --text-main: var(--nhl-text);
    --text-muted: var(--nhl-muted);

    --border: var(--nhl-line);
    --accent: var(--nhl-red);
    --accent-hover: var(--nhl-red-dark);
    --accent-2: #4aa8d8;
    --accent-soft: rgba(200, 16, 46, 0.12);
    --amber-soft: rgba(74, 168, 216, 0.10);
    --gold: #d8a13a;
    --ice: #7fc4e8;

    --hover-soft: rgba(255, 255, 255, 0.04);
    --warn-bg: rgba(200, 16, 46, 0.10);
    --warn-text: #ff8a9c;
    --warn-border: rgba(200, 16, 46, 0.30);

    --shadow: none;
    --radius: 2px;
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
    --nhl-max: 1240px;
}

/* светлая тема — запасная, включается кнопкой */
:root[data-theme='light'] {
    --bg-color: #f5f6f8;
    --bg-soft: #ffffff;
    --card-bg: #ffffff;
    --card-solid: #ffffff;
    --card-border: #e2e5ea;
    --header-bg: #ffffff;
    --ticker-bg: #0a0a0b;
    --text-main: #121212;
    --text-muted: #5b6472;
    --border: #e2e5ea;
    --hover-soft: rgba(0, 0, 0, 0.035);
    --accent-soft: rgba(200, 16, 46, 0.07);
}

/* ---------- База ---------- */
body {
    font-family: var(--font);
    background: var(--bg-color);
    color: var(--text-main);
    font-size: 15px;
    line-height: 1.55;
    letter-spacing: -0.003em;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.container {
    width: 100%;
    max-width: var(--nhl-max);
    margin: 0 auto;
    padding: 0 28px;
}

/* ---------- Шапка ---------- */
header {
    position: sticky;
    top: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 28px;
    height: 80px;
    padding: 0 max(28px, calc((100vw - 1240px) / 2 + 28px));
    background: rgba(10, 10, 12, 0.97);
    backdrop-filter: saturate(140%) blur(14px);
    border-bottom: 1px solid var(--nhl-line);
}

header::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: linear-gradient(90deg, var(--nhl-red) 0 96px, transparent 96px);
}

header .logo {
    display: inline-flex;
    align-items: baseline;
    gap: 10px;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-main);
    text-decoration: none;
    white-space: nowrap;
}

header .logo span {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--nhl-dim);
}

header nav { margin-left: auto; }

header nav ul {
    display: flex;
    align-items: center;
    gap: 2px;
    list-style: none;
    margin: 0;
    padding: 0;
}

header nav a {
    display: block;
    padding: 8px 11px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--nhl-muted);
    text-decoration: none;
    border-radius: 2px;
    transition: color .14s ease, background .14s ease;
}

header nav a:hover { color: var(--text-main); background: var(--hover-soft); }

header nav a.active,
header nav a[aria-current='page'] {
    color: var(--text-main);
    box-shadow: inset 0 -2px 0 var(--nhl-red);
}

.header-actions { display: flex; align-items: center; gap: 6px; margin-left: 10px; }

header .theme-toggle,
header .burger {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    background: transparent;
    border: 1px solid var(--nhl-line);
    border-radius: 2px;
    color: var(--nhl-muted);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    transition: color .14s ease, border-color .14s ease, background .14s ease;
}

header .theme-toggle:hover,
header .burger:hover { color: var(--text-main); border-color: var(--nhl-red); background: var(--accent-soft); }

header .burger { display: none; }

/* ---------- Hero ---------- */
.hero {
    position: relative;
    text-align: left !important;
    background:
        radial-gradient(760px 300px at 6% -18%, rgba(200, 16, 46, 0.30), transparent 68%),
        radial-gradient(620px 260px at 78% -12%, rgba(90, 140, 190, 0.10), transparent 70%),
        linear-gradient(180deg, #0c0c0f 0%, #09090b 100%);
    color: var(--text-main);
    padding: 84px 0 58px;
    overflow: hidden;
    border-bottom: 1px solid var(--nhl-line);
}

/* лёгкая «ледяная» сетка вместо случайной полосы */

.hero::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--nhl-red) 0 120px, var(--nhl-line) 120px);
    pointer-events: none;
}

.hero .container { position: relative; z-index: 2; }

.eyebrow {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 22px;
    padding: 0 !important;
    border: 0 !important;
    background: none !important;
    border-radius: 0 !important;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #ff5364;
}

.eyebrow::before {
    content: '';
    width: 28px;
    height: 2px;
    background: var(--nhl-red);
}

.hero h1 {
    margin: 0 0 24px !important;
    max-width: 20ch;
    font-size: clamp(40px, 5.4vw, 72px);
    font-weight: 900;
    line-height: 0.98;
    letter-spacing: -0.012em;
    text-transform: uppercase;
    text-align: left !important;
    color: #ffffff !important;
    background: none !important;
    -webkit-background-clip: border-box !important;
    background-clip: border-box !important;
    -webkit-text-fill-color: #ffffff !important;
}

.hero p {
    max-width: 56ch;
    margin: 0 0 30px;
    font-size: 16.5px;
    line-height: 1.72;
    color: rgba(255, 255, 255, 0.80) !important;
    text-align: left !important;
}

.hero-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 42px;
}

/* ---------- Кнопки ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    min-width: 190px;
    padding: 0 22px;
    background: linear-gradient(180deg, #d2142f 0%, #b60d26 100%);
    color: #fff;
    border: 1px solid #a80d26;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18) !important;
    border-radius: 2px;
    box-shadow: none !important;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.btn:hover { background: linear-gradient(180deg, #e01634 0%, #c61029 100%); border-color: #c61029; transform: translateY(-1px); }

.btn.ghost {
    background: transparent;
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow: none !important;
}

.btn.ghost:hover { background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.55); }

:root[data-theme='light'] .btn.ghost { color: #121212; border-color: rgba(0, 0, 0, 0.22); }
:root[data-theme='light'] .btn.ghost:hover { background: rgba(0, 0, 0, 0.05); }

/* ---------- Статистика в hero ---------- */
.hero-stats {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: flex-start !important;
    gap: 0;
    max-width: 640px;
    padding-top: 30px;
    border-top: 1px solid var(--nhl-line);
    text-align: left !important;
}

.hero-stat {
    flex: 1 1 0;
    min-width: 120px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 26px;
    border-left: 1px solid var(--nhl-line);
    background: none;
    border-radius: 0;
}

.hero-stat:first-child { padding-left: 0; border-left: 0; }

.hero-stat .v {
    font-size: 36px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    color: #ffffff;
}

.hero-stat .l {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.62);
}

.rink-line { display: none; }

/* ---------- Тікер ---------- */
.ticker {
    background: var(--ticker-bg);
    border-bottom: 1px solid var(--nhl-line);
}

.ticker-scroll {
    display: flex;
    overflow-x: auto;
    max-width: var(--nhl-max);
    margin: 0 auto;
    padding: 10px max(28px, calc((100vw - 1240px) / 2 + 28px));
    scrollbar-width: none;
}

.ticker-scroll::-webkit-scrollbar { display: none; }

.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 17px 22px;
    border-right: 1px solid var(--nhl-line-soft);
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    white-space: nowrap;
}

.ticker-item:hover { color: #fff; background: rgba(200, 16, 46, 0.14); }
.ticker-date { color: var(--nhl-dim); }

.ticker-item .score {
    font-size: 13.5px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    color: #ffffff;
    padding: 2px 7px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.08);
}

/* ---------- Основной контент ---------- */
main.container { padding-top: 76px; padding-bottom: 84px; }

.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    align-items: start;
}

.standings-card { grid-column: span 3; }

/* ---------- Карточки ---------- */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 2px;
    padding: 22px 22px 18px;
    box-shadow: none;
    transition: border-color .16s ease, background .16s ease;
}

.card:hover { border-color: rgba(200, 16, 46, 0.55); }

.card h3 {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin: 0 0 14px;
    padding: 0 0 13px;
    border-bottom: 1px solid var(--nhl-line);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--nhl-muted);
}

:root[data-theme='light'] .card h3 { color: #5b6472; border-bottom-color: #e2e5ea; }

.card-link {
    margin-left: auto;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: var(--nhl-red) !important;
    text-decoration: none;
    white-space: nowrap;
}

.card-link:hover { text-decoration: underline; }

/* ---------- Строки-списки ---------- */
.list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid var(--nhl-line-soft);
    font-size: 13.5px;
    color: var(--text-main);
    text-decoration: none;
    transition: color .14s ease;
}

.list-item:last-child { border-bottom: 0; }
.list-item:hover { color: var(--nhl-red); }
.list-item .team-name { flex: 1; font-weight: 600; }

.list-item .score {
    flex: 0 0 auto;
    min-width: 62px;
    padding: 3px 9px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.06);
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
    text-align: center;
    color: #ffffff;
}

:root[data-theme='light'] .list-item .score { background: #f1f3f6; color: #121212; }

/* ---------- Лидеры ---------- */
.lead-row { align-items: center; }

.lead-tag {
    flex: 0 0 auto;
    padding: 4px 9px;
    border-radius: 2px;
    background: rgba(200, 16, 46, 0.12);
    border: 1px solid rgba(200, 16, 46, 0.30);
    color: #ff8a9c;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

:root[data-theme='light'] .lead-tag { background: rgba(200, 16, 46, 0.07); color: #a80d26; }

.lead-who { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.lead-name { font-weight: 700; font-size: 13px; }
.lead-team { font-size: 10.5px; color: var(--nhl-dim); text-transform: uppercase; letter-spacing: 0.08em; }

.lead-val {
    font-size: 18px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.lead-note { margin: 14px 0 0; font-size: 11px; line-height: 1.5; color: var(--nhl-dim); }

/* пустое состояние внутри карточки */
.card p {
    margin: 0;
    padding: 14px 0 4px;
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--nhl-dim);
}

/* ---------- Таблицы ---------- */
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }

table thead th {
    padding: 8px;
    border-bottom: 1px solid var(--nhl-line);
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--nhl-dim);
    text-align: right;
    white-space: nowrap;
}

table thead th:nth-child(2), table thead th:nth-child(3) { text-align: left; }

table tbody td {
    padding: 9px 8px;
    border-bottom: 1px solid var(--nhl-line-soft);
    font-size: 13px;
    text-align: right;
}

table tbody td:nth-child(2) { text-align: left; font-weight: 600; }
table tbody tr:hover td { background: var(--hover-soft); }

table tbody td:first-child { width: 32px; font-weight: 800; color: var(--nhl-dim); }

table tbody tr:nth-child(1) td:first-child,
table tbody tr:nth-child(2) td:first-child,
table tbody tr:nth-child(3) td:first-child { color: var(--nhl-red); }

/* мини-таблицы */
.mini-divs { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 22px; }

.mini-group > h4, .mini-group > .mini-title {
    margin: 0 0 6px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--nhl-dim);
}

.mini-table tbody td { padding: 6px 6px; font-size: 12.5px; border-bottom: 1px solid var(--nhl-line-soft); }
.mini-table tbody td:first-child { width: 20px; }
.mini-table .pts { font-weight: 900; }

.mini-team { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Табы ---------- */
.stage-tabs, .status-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 22px; }

.stage-tabs a, .status-tabs a {
    padding: 8px 14px;
    border: 1px solid var(--nhl-line);
    border-radius: 2px;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: var(--nhl-muted);
    text-decoration: none;
    transition: color .14s ease, border-color .14s ease, background .14s ease;
}

.stage-tabs a:hover, .status-tabs a:hover { color: var(--text-main); border-color: rgba(255,255,255,.3); }

.stage-tabs a.active, .status-tabs a.active {
    background: var(--nhl-red);
    border-color: var(--nhl-red);
    color: #ffffff;
}

/* ---------- Подвал ---------- */
footer {
    margin-top: 0;
    padding: 36px 28px;
    background: #08080a;
    border-top: 1px solid var(--nhl-line);
    color: var(--nhl-dim);
    text-align: center;
    font-size: 10.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

footer p { margin: 0; }
footer::before {
    content: '';
    display: block;
    width: 120px;
    height: 2px;
    margin: 0 auto 22px;
    background: var(--nhl-red);
}

/* ---------- Адаптив ---------- */
@media (max-width: 1060px) {
    .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .standings-card { grid-column: span 2; }
}

@media (max-width: 820px) {
    header { height: 64px; padding: 0 18px; gap: 12px; }
    header nav {
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        display: block;
        background: #0a0a0b;
        border-bottom: 1px solid var(--nhl-line);
        padding: 8px 14px 14px;
        box-shadow: 0 24px 40px rgba(0, 0, 0, 0.55);
    }
    header nav ul { display: none; flex-direction: column; align-items: stretch; gap: 2px; }
    header nav ul.active { display: flex; }
    header nav a { padding: 13px 12px; font-size: 12px; }
    header .burger { display: grid; }

    .container { padding: 0 18px; }
    .hero { padding: 52px 0 40px; }
    .hero h1 { font-size: clamp(30px, 9vw, 42px); max-width: none; }
    .hero p { font-size: 14.5px; }
    .hero-btns { margin-bottom: 32px; }
    .btn { width: 100%; min-width: 0; }
    .hero-stats { flex-direction: column; gap: 18px; border-top: 0; padding-top: 0; }
    .hero-stat { padding: 0; border-left: 0; }
    .hero-stat .v { font-size: 30px; }

    main.container { padding-top: 32px; padding-bottom: 44px; }
    .grid { grid-template-columns: 1fr; gap: 14px; }
    .standings-card { grid-column: span 1; }
    .card { padding: 18px 16px 14px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ============================================================
   Скорборд как на NHL.com: карточки матчей в один ряд
   ============================================================ */
.scoreboard {
    background: #060608;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.scoreboard-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    max-width: var(--nhl-max);
    margin: 0 auto;
    padding: 0 max(28px, calc((100vw - 1240px) / 2 + 28px));
}

.scoreboard-track {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    justify-content: flex-start;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 0;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
}

.scoreboard-track::-webkit-scrollbar { display: none; }

.sb-arrow {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    padding: 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 2px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, opacity .15s ease;
}

.sb-arrow:hover:not(:disabled) { background: var(--nhl-red); border-color: var(--nhl-red); color: #fff; }
.sb-arrow:disabled { opacity: 0.22; cursor: default; }

.game-card {
    scroll-snap-align: start;
    flex: 0 0 200px;
    width: 200px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 9px 12px 10px;
    border-right: 1px solid rgba(255, 255, 255, 0.035);
    background: rgba(255, 255, 255, 0.022);
    text-decoration: none;
    color: var(--text-main);
    transition: background .15s ease;
}

.game-card:first-child { border-left: 1px solid rgba(255, 255, 255, 0.035); }
.game-card:hover { background: rgba(255, 255, 255, 0.045); }

.game-status {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.42);
}

.game-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ff3b52;
    box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.18);
    flex: 0 0 auto;
}

.game-team {
    display: grid;
    grid-template-columns: 22px 1fr auto;
    align-items: center;
    gap: 8px;
}

.game-badge {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.05);
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.82);
}

.game-name {
    font-size: 12.5px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.88);
}

.game-goals {
    font-size: 15px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    color: rgba(255, 255, 255, 0.55);
    min-width: 18px;
    text-align: right;
}

.game-team.is-winner .game-name { color: #ffffff; font-weight: 700; }
.game-team.is-winner .game-goals { color: #ffffff; }
.game-team.is-winner .game-badge { border-color: rgba(200, 16, 46, 0.55); background: rgba(200, 16, 46, 0.14); }

:root[data-theme='light'] .scoreboard { background: #0a0a0b; }

@media (max-width: 820px) {
    .scoreboard-inner { padding: 0 18px; }
    .scoreboard-track { padding: 8px 0; }
    .game-card { min-width: 214px; padding: 12px 14px 14px; }
    .game-name { font-size: 13px; }
}
