﻿:root {
    --score-color: #00ff9d;
    --cell-bg: #1a1921;
    --border-color: #44434b;
}

.cricket-top-section {
    display: flex;
    width: 100%;
    justify-content: center;
    flex-shrink: 0;
}

.cricket-bottom-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2vh 10px;
    flex-grow: 1;
}

.cricket-board-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    padding: 10px;
}

/* Alapértelmezésben rejtett elemek */
.player-label-ls, .score-box-ls, .header-spacer-ls, .points-header-ls {
    display: none;
}

.player-label-ls {
    background: var(--primary-red) !important;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.4);
    font-weight: 700 !important;
    text-shadow: 2px 3px 2px rgba(0,0,0,0.5) !important;
    color: white;
}

/* --- KÖZÖS CELLA STÍLUSOK --- */
.main-bar-cell, .player-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    font-weight: 700;
    color: white;
}

.main-bar-cell {
    background: linear-gradient(145deg, #23222a, #16151b);
    color: #ffdb00;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.4);
}

.player-cell {
    background-color: #0c0c0c;
}

/* Kiemelt pontszám színek */
.points-header-ls.main-bar-cell,
.score-box-ls {
    color: var(--score-color) !important;
    font-weight: 900;
}

.score-box-ls {
    background: linear-gradient(145deg, #23222a, #16151b);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.4);
}

/* --- PLAYER BAR WRAPPER LOGIKA --- */
.player-bar {
    display: flex;
    flex: 1;
}

.player-cell svg {
    fill: #ff182e;
    width: 80%; /* Rugalmas szélesség a cellán belül */
    height: 80%; /* Rugalmas magasság */
    display: block;
    transition: transform 0.2s ease-in-out; /* Egy kis animációhoz, ha később kellene */
}

/* --- PORTRAIT (FÜGGŐLEGES) MÓD --- */
@media (min-height: 601px) {
    .cricket-board-wrapper {
        max-width: 750px;
    }

    .main-game-area {
        display: flex;
        flex-direction: row;
        width: 100%;
    }

    .main-bar-container {
        order: 3;
        flex: 0 0 80px;
        display: flex;
        flex-direction: column;
    }

    .player-col {
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .player-bar {
        flex-direction: column;
    }
    /* Függőlegesen egymás alá rakja a cellákat */

    .main-bar-cell, .player-cell {
        height: 55px;
        font-size: 1.2rem;
    }

    .player-header {
        text-align: center;
        color: #aaa;
        font-size: 0.8rem;
        padding-bottom: 5px;
        text-transform: uppercase;
    }

    .footer-row {
        display: flex;
        margin-top: 15px;
        width: 100%;
    }

    .score-display {
        font-size: 2rem;
        text-align: center;
        font-weight: 900;
        flex: 1;
    }

    .points-label {
        order: 3;
        flex: 0 0 80px;
        color: #ffc107;
        font-weight: bold;
        text-align: center;
        padding-top: 15px;
        font-size: 0.8rem;
    }
}

/* --- LANDSCAPE (FEKVŐ) MÓD --- */
@media (orientation: landscape) and (max-height: 600px),
       (max-width: 500px) and (max-height: 600px) {
    .player-header-row, .footer-row {
        display: none !important;
    }

    .cricket-board-wrapper {
        max-width: 100vw;
    }

    .main-game-area {
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    .main-bar-container, .player-row-ls {
        display: flex !important;
        flex-direction: row !important;
        width: 100%;
        align-items: center;
        order: 0 !important;
    }

    .player-label-ls, .header-spacer-ls {
        display: flex;
        flex: 0 0 35px !important;
        font-size: 0.7rem;
        justify-content: center;
    }

    .player-bar {
        flex-direction: row;
    }
    /* Vízszintesen egymás mellé rakja a cellákat */

    .main-bar-cell, .player-cell {
        flex: 1;
        height: 32px;
        min-height: 50px;
    }

    .main-bar-cell {
        font-size: 1.5rem;
    }

    .score-box-ls, .points-header-ls {
        display: flex;
        flex: 0 0 60px;
        height: 32px;
        min-height: 50px;
    }

    .points-header-ls {
        background: transparent;
        border: none;
        color: #666;
    }
}

/* --- 4K OPTIMALIZÁLÁS --- */
@media (min-width: 1921px) and (min-height: 1001px) {
    .cricket-board-wrapper {
        max-width: 1200px;
    }

    .main-bar-cell, .player-cell {
        height: 90px;
        font-size: 2rem;
        border-width: 1.5px;
    }

    .main-bar-container, .points-label {
        flex: 0 0 140px !important;
    }

    .player-header {
        font-size: 1.5rem;
    }

    .score-display {
        font-size: 4rem;
    }

    .score-box-ls, .points-header-ls {
        flex: 0 0 100px;
        height: 70px;
        font-size: 2rem;
    }

    .player-label-ls, .header-spacer-ls {
        flex: 0 0 70px;
        font-size: 1.2rem;
    }
}


/* --- ACTIVE PLAYER EFFECT (Most már pofonegyszerű) --- */
.active-player .player-bar {
    outline: 2px solid rgba(80, 255, 0, 0.8);
    box-shadow: 0px 0px 20px rgb(80, 255, 0);
    position: relative;
    z-index: 10;
}

.active-player .player-header {
    color: var(--score-color) !important;
}
