/* =========================================================================
   CS2WIKI — единый файл стилей
   Тёмная киберспортивная тема в духе Liquipedia.
   Шрифты: моноширинный акцент на цифрах (счёт, ID) — подчёркивает
   "статистическую" природу контента, как на табло турнира.
   ========================================================================= */

/* ---------------------------- CSS-переменные ---------------------------- */
:root {
    /* Базовая палитра */
    --bg-main: #1c1e22;
    --bg-surface: #24272c;
    --bg-surface-alt: #2b2f35;
    --border-color: #383c42;

    /* Текст */
    --text-primary: #eceff1;
    --text-secondary: #9aa3ab;
    --text-muted: #6b7280;

    /* Акценты */
    --accent: #00bcd4;
    --accent-hover: #33d1e8;
    --accent-soft: rgba(0, 188, 212, 0.12);

    /* Статусы матчей/турниров */
    --status-live: #ff3b5c;
    --status-upcoming: #ffb020;
    --status-completed: #4caf7d;

    /* Типографика */
    --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

    /* Радиусы и тени */
    --radius-sm: 4px;
    --radius-md: 8px;
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.35);

    --header-height: 64px;
    --max-width: 1180px;
}

/* ------------------------------- Reset ---------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s ease;
}
a:hover { color: var(--accent-hover); }

h1, h2, h3 { margin: 0 0 0.5em; font-weight: 700; letter-spacing: -0.01em; }

table { border-collapse: collapse; width: 100%; }

/* Видимый фокус для доступности с клавиатуры */
a:focus-visible, button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ------------------------------- Шапка ----------------------------------- */
.site-header {
    height: var(--header-height);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: var(--max-width);
    height: 100%;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-family: var(--font-mono);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.02em;
}
.logo-accent { color: var(--accent); }
.logo:hover { color: var(--text-primary); }

.main-nav { display: flex; gap: 28px; }
.main-nav a {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.main-nav a:hover { color: var(--accent); }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}
.nav-toggle span {
    width: 22px;
    height: 2px;
    background: var(--text-primary);
}

/* ------------------------------ Контейнер -------------------------------- */
.page-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 32px 20px 64px;
    min-height: calc(100vh - var(--header-height) - 90px);
}

.section { margin-bottom: 40px; }

.section-title {
    font-size: 22px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent);
    margin-bottom: 18px;
}

.section-title-sm {
    font-size: 18px;
    color: var(--text-primary);
    border-left: 3px solid var(--accent);
    padding-left: 10px;
    margin-bottom: 16px;
}

/* -------------------------------- Карточки -------------------------------- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow-card);
    transition: border-color 0.15s ease, transform 0.15s ease;
    position: relative;
}
.card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}
.card h3 { font-size: 16px; margin-bottom: 6px; color: var(--text-primary); }
.card:hover h3 { color: var(--accent); }

.card-meta { font-size: 13px; color: var(--text-secondary); margin: 2px 0; }

.player-card-photo {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    background: var(--bg-surface-alt);
}

.team-tag { color: var(--text-muted); font-family: var(--font-mono); font-size: 14px; }

/* ------------------------------ Статус-бейджи ------------------------------ */
.status-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    vertical-align: middle;
}
.status-live { background: rgba(255, 59, 92, 0.15); color: var(--status-live); animation: pulse 1.6s infinite; }
.status-upcoming { background: rgba(255, 176, 32, 0.15); color: var(--status-upcoming); }
.status-completed { background: rgba(76, 175, 125, 0.15); color: var(--status-completed); }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* -------------------------------- Таблицы --------------------------------- */
.data-table {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.data-table th {
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    background: var(--bg-surface-alt);
    padding: 10px 14px;
}

.data-table td {
    padding: 12px 14px;
    border-top: 1px solid var(--border-color);
    font-size: 14px;
}

.data-table tbody tr { cursor: pointer; transition: background 0.15s ease; }
.data-table tbody tr:hover { background: var(--accent-soft); }

.score-cell { font-family: var(--font-mono); font-weight: 700; color: var(--text-primary); }
.score-final { color: var(--accent); }

.empty-cell { text-align: center; color: var(--text-muted); padding: 24px; }

/* ------------------------- Профиль (игрок / команда) ----------------------- */
.profile-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 28px;
    align-items: start;
}

.profile-title { font-size: 28px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.profile-subtitle { font-size: 15px; color: var(--text-secondary); font-weight: 400; }

/* --------------------------------- Infobox --------------------------------- */
.infobox {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    position: sticky;
    top: calc(var(--header-height) + 20px);
    box-shadow: var(--shadow-card);
}

.infobox-photo {
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 12px;
    background: var(--bg-surface-alt);
    aspect-ratio: 4 / 3;
}
.infobox-photo img { width: 100%; height: 100%; object-fit: cover; }

.infobox-name {
    font-size: 18px;
    text-align: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 4px;
}

.infobox-table th, .infobox-table td {
    padding: 8px 4px;
    font-size: 13px;
    text-align: left;
    vertical-align: top;
    border-top: 1px solid var(--border-color);
}
.infobox-table th {
    width: 42%;
    color: var(--text-muted);
    font-weight: 600;
}
.infobox-table td { color: var(--text-primary); }

.infobox-section-row th {
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.05em;
    color: var(--accent);
    padding-top: 16px;
}

.crosshair-code {
    font-family: var(--font-mono);
    font-size: 11px;
    word-break: break-all;
    color: var(--text-secondary);
}

/* --------------------------------- Матч ------------------------------------ */
.match-page { max-width: 640px; margin: 0 auto; text-align: center; }

.match-scoreboard {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 32px 20px;
    margin: 20px 0;
}

.match-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    width: 140px;
}
.match-team img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    background: var(--bg-surface-alt);
    border-radius: var(--radius-sm);
}
.match-team span { font-weight: 600; font-size: 14px; }

.match-score {
    font-family: var(--font-mono);
    font-size: 36px;
    font-weight: 700;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--accent);
}

/* ------------------------------- Пустое состояние --------------------------- */
.empty-state { text-align: center; padding: 80px 20px; }
.empty-code { font-family: var(--font-mono); font-size: 72px; color: var(--accent); margin-bottom: 8px; }
.btn-accent {
    display: inline-block;
    margin-top: 16px;
    padding: 10px 24px;
    background: var(--accent);
    color: #0a0e10;
    font-weight: 700;
    border-radius: var(--radius-sm);
}
.btn-accent:hover { background: var(--accent-hover); color: #0a0e10; }

/* --------------------------------- Подвал ---------------------------------- */
.site-footer {
    border-top: 1px solid var(--border-color);
    background: var(--bg-surface);
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}
.footer-sub { margin-top: 4px; font-size: 12px; }

/* -------------------------------- Адаптив ----------------------------------- */
@media (max-width: 860px) {
    .profile-layout { grid-template-columns: 1fr; }
    .infobox { position: static; order: -1; }
}

@media (max-width: 640px) {
    .main-nav { display: none; }
    .nav-toggle { display: flex; }
    .main-nav.nav-open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--bg-surface);
        border-bottom: 1px solid var(--border-color);
        padding: 12px 20px;
        gap: 14px;
    }
    .match-scoreboard { flex-direction: column; gap: 16px; }
    .data-table th:nth-child(4), .data-table td:nth-child(4) { display: none; }
}
