﻿/* --- BASE STYLES --- */
.cricket-board-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    padding: 10px;
}

.player-label-ls, .score-box-ls, .header-spacer-ls, .points-header-ls {
    display: none;
}

/* --- PORTRAIT MODE (Default) --- */
@media (min-height: 401px) {
    .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;
    }
    
    .main-bar-cell, .player-cell {
        height: 55px;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 1px solid #333;
        font-size: 1.2rem;
    }

    .main-bar-cell {
        background-color: #222;
        color: #ffc107;
        font-weight: 900;
    }

    .player-cell {
        background-color: #0c0c0c;
    }

    .player-header {
        text-align: center;
        color: #aaa;
        font-size: 0.8rem;
        padding-bottom: 5px;
        text-transform: uppercase;
        font-weight: bold;
    }

    .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 MODE (Max-height: 400px) --- */
@media (orientation: landscape) and (max-height: 400px) {
    .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;
    }

    .player-label-ls, .header-spacer-ls {
        display: flex;
        flex: 0 0 35px !important;
        font-size: 0.7rem;
        color: #888;
        font-weight: bold;
        justify-content: center;
    }

    .main-bar-cell, .player-cell {
        flex: 1 1 0;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 1px solid #333;
        min-width: 0;
        min-height: 50px;
    }

    .main-bar-cell {
        background-color: #222;
        color: #ffc107;
        font-weight: bold;
        font-size: 1.5rem;
    }

    .player-cell {
        background-color: #0c0c0c;
    }

    .score-box-ls, .points-header-ls {
        display: flex;
        flex: 0 0 60px;
        height: 32px;
        align-items: center;
        justify-content: center;
        font-weight: 900;
        font-size: 1rem;
        background: #111;
        border: 1px solid #333;
    }

    .points-header-ls {
        background: transparent;
        border: none;
        font-size: 1.5rem;
        color: #666;
    }
}

/* --- 4K AND ULTRA-WIDE OPTIMIZATION (min-width: 2500px) --- */
@media (min-width: 2500px) {
    /* Fixed to top */
    .cricket-board-wrapper {
        max-width: 1200px;
    }

    .main-bar-cell, .player-cell {
        height: 90px;
        font-size: 2rem;
        border-width: 2px;
    }

    .main-bar-container, .points-label {
        flex: 0 0 140px !important;
    }

    .player-header {
        font-size: 1.5rem;
        padding-bottom: 15px;
    }

    .score-display {
        font-size: 4rem;
    }

    .points-label {
        font-size: 1.2rem;
    }

    .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;
    }
}