/* ==========================================================
   Dota 2 Theme & Styling (Aegis, Radiant & Dire aesthetic)
   ========================================================== */

.dota-theme {
    --dota-radiant: var(--radiant);
    --dota-dire: var(--dire);
    --dota-gold: var(--gold);
    --dota-ancient: #1e1b4b;
    --dota-stone: #151a23;
}

/* Общая инфо */
.match-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: rgba(15, 20, 28, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.match-winner {
    font-size: 28px;
    font-weight: 900;
    letter-spacing: -0.5px;
    text-shadow: 0 0 20px currentColor;
}

.match-winner.radiant { color: var(--accent-green); }
.match-winner.dire { color: var(--accent-red); }

.match-score {
    font-size: 34px;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-mono);
}

.match-score .radiant { color: #34d399; text-shadow: 0 0 15px rgba(52, 211, 153, 0.5); }
.match-score .dire { color: #f43f5e; text-shadow: 0 0 15px rgba(244, 63, 94, 0.5); }
.match-score .vs { color: var(--text-muted); font-size: 16px; font-weight: normal; }

/* Таблица игроков */
.team-section {
    margin-bottom: 24px;
}

.team-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 700;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.team-header.radiant {
    background: rgba(63, 185, 80, 0.1);
    color: var(--accent-green);
    border: 1px solid rgba(63, 185, 80, 0.2);
    border-bottom: none;
}

.team-header.dire {
    background: rgba(248, 81, 73, 0.1);
    color: var(--accent-red);
    border: 1px solid rgba(248, 81, 73, 0.2);
    border-bottom: none;
}

.player-hero {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hero-icon {
    width: 36px;
    height: 20px;
    border-radius: 4px;
    object-fit: cover;
}

.hero-name {
    font-weight: 600;
    font-size: 13px;
}

.player-name {
    color: var(--text-secondary);
    font-size: 12px;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.items-row {
    display: flex;
    gap: 3px;
}

.item-icon {
    width: 28px;
    height: 20px;
    border-radius: 3px;
    object-fit: cover;
    background: var(--bg-tertiary);
}

.kda {
    font-weight: 700;
    font-size: 13px;
}

.kda .kills { color: var(--accent-green); }
.kda .deaths { color: var(--accent-red); }
.kda .assists { color: var(--text-secondary); }

.perf-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 800;
}

.perf-score.excellent { background: rgba(63, 185, 80, 0.2); color: var(--accent-green); }
.perf-score.good { background: rgba(88, 166, 255, 0.2); color: var(--accent-blue); }
.perf-score.average { background: rgba(210, 153, 34, 0.2); color: var(--accent-orange); }
.perf-score.poor { background: rgba(248, 81, 73, 0.2); color: var(--accent-red); }

/* Графики */
.chart-container {
    position: relative;
    width: 100%;
    max-width: 100%;
}

.chart-container canvas {
    width: 100% !important;
    height: 300px;
    border-radius: var(--radius-md);
    background: var(--bg-primary);
}

.chart-legend {
    display: flex;
    gap: 24px;
    justify-content: center;
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

.chart-legend span::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    margin-right: 6px;
    vertical-align: middle;
}

.chart-legend .gold::before { background: #ffd700; }
.chart-legend .xp::before { background: #58a6ff; }

/* Карта вардов */
.ward-map-container {
    display: flex;
    justify-content: center;
}

.ward-map-container canvas {
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    max-width: 100%;
}

.ward-legend {
    display: flex;
    gap: 24px;
    justify-content: center;
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

.ward-legend span::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

.ward-legend .obs::before { background: #ffd700; }
.ward-legend .sen::before { background: #58a6ff; }

/* AI-анализ */
.ai-section {
    text-align: center;
    margin: 20px 0;
}

.ai-result {
    text-align: left;
    margin-top: 20px;
}

.ai-result h1, .ai-result h2, .ai-result h3 {
    color: var(--accent-blue);
    margin-top: 20px;
    margin-bottom: 8px;
}

.ai-result h2 { font-size: 20px; }
.ai-result h3 { font-size: 16px; }

.ai-result p {
    margin-bottom: 10px;
    line-height: 1.7;
}

.ai-result strong {
    color: var(--accent-blue);
}

/* Секции с табами */
.section-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.section-tab {
    padding: 8px 16px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    font-family: var(--font-sans);
}

.section-tab:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.section-tab.active {
    color: var(--accent-blue);
    background: rgba(88, 166, 255, 0.1);
    border-color: var(--accent-blue);
}

.section-content {
    display: none;
}

.section-content.active {
    display: block;
}

/* Ошибка */
.error-box {
    text-align: center;
    padding: 40px;
    color: var(--accent-red);
}

.error-box__icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.error-box__text {
    font-size: 16px;
}

@media (max-width: 768px) {
    .match-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .match-score {
        font-size: 24px;
    }

    .match-winner {
        font-size: 22px;
    }

    table {
        font-size: 11px;
    }

    table th, table td {
        padding: 6px 8px;
    }

    .hero-icon {
        width: 28px;
        height: 16px;
    }

    .item-icon {
        width: 22px;
        height: 16px;
    }

    .chart-container canvas {
        height: 200px;
    }
}

/* === Дополнительные расширенные стили === */
.parse-notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(210, 153, 34, 0.12);
    border: 1px solid var(--accent-orange);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin-bottom: 20px;
    gap: 16px;
    flex-wrap: wrap;
}

.parse-notice__text {
    font-size: 14px;
    color: var(--text-primary);
}

.sub-header {
    font-size: 12px;
    color: var(--text-muted);
}

/* Драфт / Пики и баны */
.draft-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.draft-team {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.draft-label {
    font-size: 13px;
    font-weight: 700;
}

.draft-heroes {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.draft-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 6px 8px;
    min-width: 80px;
    text-align: center;
}

.draft-card.is-ban {
    opacity: 0.65;
    filter: grayscale(80%);
    border-color: var(--accent-red);
}

.draft-card__badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.draft-card.is-pick .draft-card__badge { color: var(--accent-green); }
.draft-card.is-ban .draft-card__badge { color: var(--accent-red); }

.draft-card img {
    width: 48px;
    height: 27px;
    border-radius: 3px;
    object-fit: cover;
}

.draft-card__name {
    font-size: 11px;
    margin-top: 4px;
    max-width: 75px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Предметы игрока: расширенная раскладка */
.items-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.items-main {
    display: flex;
    gap: 3px;
}

.items-extra {
    display: flex;
    gap: 3px;
    align-items: center;
}

.item-neutral {
    border-radius: 50% !important;
    border: 1px solid var(--accent-purple);
}

.backpack-sep {
    font-size: 10px;
    color: var(--text-muted);
    padding: 0 2px;
}

/* Бенчмарки / Сравнение с средним */
.benchmarks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.benchmark-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
}

.benchmark-hero {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-weight: 700;
}

.benchmark-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    margin-bottom: 6px;
}

.benchmark-bar-bg {
    width: 80px;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.benchmark-bar-fill {
    height: 100%;
    background: var(--accent-blue);
    border-radius: 3px;
}

.benchmark-bar-fill.high { background: var(--accent-green); }
.benchmark-bar-fill.mid { background: var(--accent-blue); }
.benchmark-bar-fill.low { background: var(--accent-orange); }

/* Здания и башни */
.buildings-status {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: space-around;
}

.building-team {
    flex: 1;
    min-width: 250px;
}

