/* ==================== Title / Team Header ==================== */

.titleSection {
    margin-bottom: 40px;
    padding: 35px;
    border-radius: 20px;
    background: radial-gradient(circle at top left, #2a3a7a, #141733);
    box-shadow: 0 22px 55px rgba(0, 0, 0, 0.55);
    text-align: center;
}

.titleTitle {
    font-size: 28px;
    font-weight: 650;
    margin-bottom: 20px;
    text-align: center;
}

/* Grid-based layout for match_coupons */
.titleTeams {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
    column-gap: 20px;
    margin-bottom: 25px;
    align-items: end;
    justify-content: center;
    justify-items: center;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.titleTeams .vsBlock {
    margin: 0;
}

.teamBlock {
    display: flex;
    flex-direction: column;
}

.teamName {
    font-size: 32px;
    font-weight: 600;
}

.teamSide {
    font-size: 18px;
    font-weight: 600;
    margin-top: 6px;
    letter-spacing: 0.5px;
    opacity: 0.95;
}

.radiantSide {
    color: var(--color-radiant);
}

.direSide {
    color: var(--color-dire);
}

/* Text-shadow applied only to winning team */
.radiantSide.winner {
    text-shadow:
        0 0 8px rgba(99,255,156,0.45),
        0 0 14px rgba(99,255,156,0.25);
}

.direSide.winner {
    text-shadow:
        0 0 15px rgba(255,92,92,0.7),
        0 0 25px rgba(255,92,92,0.4);
}

.vsBlock {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    font-size: 24px;
    font-weight: 600;
    opacity: 0.8;
    margin: 0 16px;
}

/* Grid-based layout variant for match_details */
.titleSection--grid {
    display: grid;
    grid-template-columns: minmax(0, 340px) auto minmax(0, 340px);
    grid-template-rows: auto auto;
    column-gap: 15px;
    row-gap: 10px;
    align-items: end;
    justify-content: center;
    justify-items: center;
}

.titleSection--grid .teamBlock {
    width: auto;
    min-width: 0;
}

.titleSection--grid .teamName {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.titleSection--grid .vsBlock {
    grid-column: 2;
    margin: 0;
}

.titleSection--grid .heroStatBox {
    width: 100%;
    max-width: 220px;
}

.green {
    color: var(--color-radiant);
}

.red {
    color: var(--color-dire);
}

@media (max-width: 900px) {
    .titleSection--grid {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(6, auto);
        gap: 15px;
    }

    .titleSection--grid .vsBlock {
        grid-column: 1;
    }

    .titleSection--grid .teamBlock,
    .titleSection--grid .heroStatBox {
        max-width: 100%;
    }

    .titleTeams {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .titleTitle {
        font-size: 26px;
    }

    .teamName {
        font-size: 26px;
    }
}

/* ==================== Statistic Boxes ==================== */

.heroStatsRow {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    margin-top: 10px;
    justify-content: center;
}

.heroStatBox {
    background: rgba(255,255,255,0.06);
    padding: 14px 20px;
    border-radius: 12px;
    min-width: 180px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.3);
}

.heroStatBox--oddsHighlight {
    border: 2px solid var(--color-gold);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.25), 0 4px 14px rgba(0,0,0,0.3);
}

.heroStatBox--action {
    display: flex;
    align-items: center;
    justify-content: center;
}

.statLabel {
    font-size: 13px;
    opacity: 0.65;
    margin-bottom: 4px;
}

.statValue {
    font-size: 18px;
    font-weight: 600;
}

.winnerValue {
    color: #ffd966;
}

.winnerLine {
    color: #ffd966;
    font-weight: 500;
}

/* ==================== Plot / Card Shell ==================== */

.plotSection {
    margin-bottom: 12px;
    padding-top: 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.plotCard {
    width: 100%;
    padding: 20px 22px 18px 22px;
    border-radius: 16px;
    background: rgba(10, 12, 32, 0.96);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.plotTitle {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.plotDescription {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 16px;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.plotCurrentValues + .plotWrapper {
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    padding-top: 16px;
}

.plotWrapper + .plotDescription {
    margin-top: 12px;
    margin-bottom: 0;
}

.plotWrapper {
    display: flex;
    justify-content: center;
    width: 100%;
    overflow-x: auto;
}

.plotWrapper--scroll {
    justify-content: flex-start;
}

.plotWrapper .bk-root,
.plotWrapper .bk-root canvas {
    max-width: 100% !important;
}

.sectionDivider {
    border: none;
    height: 1px;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.08) 70%, transparent);
    margin: 24px 0 20px;
}

/* ==================== Chart Current Values ==================== */

.plotCurrentValues {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.plotCurrentLabel {
    font-size: 11px;
    font-weight: 600;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    white-space: nowrap;
}

.analyticsModelLabel {
    min-width: 160px;
}

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

.analyticsModelRow {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ==================== Card Header / Body ==================== */

.cardHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.cardHeader .plotTitle {
    margin-bottom: 0;
}

.cardHeader__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.cardBody {
    flex: 0 0 auto;
    overflow: visible;
    padding-right: 0;
}

.cardBody--scrollable {
    flex: 1;
    overflow-y: auto;
    padding-right: 8px;
    min-height: 0;
    mask-image: linear-gradient(
        to bottom,
        black 90%,
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(
        to bottom,
        black 90%,
        transparent 100%
    );
}

.cardBody--scrollable::-webkit-scrollbar {
    width: 6px;
}

.cardBody--scrollable::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 3px;
}

.cardBody--scrollable::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.cardBody--scrollable::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ==================== Loading & Error States ==================== */

.loading {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
}

.error {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.2);
    padding: 12px 16px;
    border-radius: 8px;
    margin: 8px 0;
    font-size: 13px;
}

.resultLine {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 20px;
    margin-top: 6px;
}

.resultLine strong {
    color: rgba(255, 255, 255, 0.9);
}

.matchId {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 10px;
    margin-bottom: 4px;
}

/* ==================== Metrics Sections ==================== */

.metric-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 14px;
}

.metric-section-title {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px dotted rgba(255, 255, 255, 0.06);
}

.metric-row:last-child {
    border-bottom: none;
}

.metric-label-clean {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.metric-value-clean {
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

/* ==================== Model Cards ==================== */

.strategyVersion {
    font-size: 13px;
    font-weight: 400;
    color: rgba(255, 215, 0, 0.7);
    margin-left: 8px;
    letter-spacing: 0.5px;
}

.model-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-left: 2px solid var(--color-accent-purple);
    border-radius: 8px;
    padding: 12px;
    margin: 8px 0;
    box-shadow: inset 2px 0 8px -3px rgba(139, 92, 246, 0.25);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.model-card:hover {
    border-left-color: rgba(139, 92, 246, 0.5);
    box-shadow: inset 2px 0 6px -3px rgba(139, 92, 246, 0.1);
}

.model-header {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.model-type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.model-type-badge.draft {
    background: rgba(99, 255, 156, 0.15);
    color: var(--color-radiant);
}

.model-type-badge.full {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
}

.model-type-badge.prematch {
    background: rgba(255, 92, 92, 0.15);
    color: var(--color-dire);
}

.model-type-badge.archive {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
}

/* ==================== Strategy Team Cards ==================== */

.strategyTeamCards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 8px;
}

.strategyTeamCard {
    background: linear-gradient(145deg, rgba(18, 20, 45, 0.95), rgba(10, 12, 32, 0.98));
    border: 1px solid rgba(255, 215, 0, 0.35);
    border-left: 4px solid var(--color-gold);
    border-radius: 14px;
    padding: 10px 10px;
    box-shadow:
        0 0 20px rgba(255, 215, 0, 0.08),
        0 8px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.strategyTeamCard__header {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
}

.strategyTeamCard__oddsBlock {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

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

.oddsChange {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    animation: oddsChangeFade 0.4s ease;
}

.oddsChange__arrow {
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.oddsChange__prev {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.3px;
    opacity: 0.85;
    white-space: nowrap;
}

.oddsChange--up .oddsChange__arrow,
.oddsChange--up .oddsChange__prev {
    color: #4caf50;
}

.oddsChange--down .oddsChange__arrow,
.oddsChange--down .oddsChange__prev {
    color: #ef5350;
}

@keyframes oddsChangeFade {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.strategyTeamCard__oddsLabel {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 215, 0, 0.6);
}

.strategyTeamCard__oddsValue {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-gold);
    line-height: 1;
    letter-spacing: -0.5px;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.4);
}

.strategyTeamCard__divider {
    height: 1px;
    background: linear-gradient(to right, rgba(255, 215, 0, 0.3), transparent);
}

.strategyTeamCard__stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.strategyTeamCard__stat {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

.strategyTeamCard__statLabel {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.strategyTeamCard__statValue {
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
}

.strategyTeamCard__statValue--ratio {
    color: var(--color-gold);
    font-size: 12px;
}

@media (max-width: 700px) {
    .strategyTeamCards {
        grid-template-columns: 1fr;
    }
}

/* ==================== Section Titles ==================== */

.sectionTitle {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    margin-top: 40px;
    color: #ffffff;
}

/* ==================== Grid Layouts ==================== */

.chartsGrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 32px;
}

.chartsGrid .plotSection {
    margin-bottom: 0;
    padding-top: 0;
    border-top: none;
}

/* Grid children need min-width: 0 to prevent overflow */
.chartsGrid > * {
    min-width: 0;
}

@media (max-width: 1200px) {
    .chartsGrid {
        grid-template-columns: 1fr;
    }
}

/* ==================== Light Surface (Dashboard) ==================== */

.surfaceLight {
    color: #212529;
}

.surfaceLight a {
    color: #007bff;
    text-decoration: none;
}

.surfaceLight a:hover {
    color: #0056b3;
    text-decoration: underline;
}

.surfaceLight p,
.surfaceLight span,
.surfaceLight div {
    color: inherit;
}
