﻿.game-layout {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-section {
    height: 35%;
    display: flex;
    width: 100%;
    flex-shrink: 0;
}

.left-panel, .right-panel {
    flex: 1;
    position: relative;
}

.bg-active-panel {
    background-color: var(--primary-red);
}

.bg-inactive-panel {
    background-color: var(--secondary-gray);
}

.score-wrapper {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 40px;
}

.score {
    color: white;
    font-size: clamp(3.5rem, 15vh, 11rem);
    font-weight: 900;
    transform: scale(1, 1.4);
}

.player-footer {
    position: absolute;
    bottom: 8px;
    left: 0;
    width: 100%;
    text-align: center;
    color: white;
}

.player-name {
    font-size: clamp(0.8rem, 3vh, 2.5rem);
    font-weight: 800;
    text-transform: uppercase;
    margin: 0;
    line-height: 1;
}

.avg-display {
    font-size: clamp(0.85rem, 1.8vw, 1.5rem);
    font-weight: 700;
    opacity: 0.9;
}

/* BOTTOM SECTION & THROWS */
.bottom-section {
    height: 65%;
    background-color: #282731;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2vh 10px;
    justify-content: flex-start;
}

.throws-wrapper {
    display: flex;
    flex-direction: row;
    gap: 12px;
    width: 100%;
    max-width: 800px;
    justify-content: center;
    margin-bottom: 2vh;
    flex-shrink: 0;
}

.throw-box {
    flex: 1;
    aspect-ratio: 1/1 !important;
    max-width: 150px;
    border: 3px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--secondary-gray);
    cursor: pointer;
}

.triple-hit {
    border-color: var(--primary-red);
    background: linear-gradient(145deg, #440a18, #282731);
}

.double-hit {
    border-color: #0088ff;
    background: linear-gradient(145deg, #0a2644, #282731);
}

.throw-value {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(2rem, 13vw, 4.5rem);
    font-weight: 900;
    color: white;
}

.throw-sector {
    height: 35%;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1.2rem, 4.5vw, 1.5rem);
    font-weight: 900;
    text-transform: uppercase;
    color: white !important;
}

/* DATA CONTAINER & TABLE - EREDETI STRUKTÚRA */
.game-data-flex-container {
    display: flex;
    flex-direction: row;
    width: 100%;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-top: 5px;
    flex-grow: 1;
    min-height: 0;
    overflow: hidden;
}

.flex-spacer {
    flex: 0;
}

.round-score-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
}

.round-score-label {
    color: rgba(255,255,255,0.4);
    font-size: clamp(0.9rem, 2.3vw, 1.5rem);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.round-score-value {
    color: #00ff9d;
    font-size: clamp(2rem, 20vh, 5rem);
    font-weight: 900;
    line-height: 1;
    transform: scale(1, 1.1);
}

.remove-darts-indicator {
    color: white;
    font-weight: 800;
    font-size: clamp(3rem, 17vw, 9rem);
    text-transform: uppercase;
}

.checkout-indicator {
    margin-top: 20px;
    color: var(--accent-lime);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: clamp(0.6rem, 2.5vw, 2rem);
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    border: 1px solid rgba(212, 255, 0, 0.2);
    display: inline-block;
    white-space: nowrap;
    transform: scale(1, 1.4);
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    padding-left: 0.7rem;
    padding-right: 0.7rem;
}

.match-table-container-wrapper {
    display: flex;
    justify-content: flex-end;
    flex: 1;
    height: 100%;
    min-height: 0;
}

.match-table-container {
    background: rgba(0,0,0,0.4);
    border: 1px solid #444;
    border-radius: 4px;
    width: 100%;
    max-width: 900px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    margin-bottom: 5px;
    max-height: 100%;
    height: auto;
    align-self: start;
}

.match-header {
    background: #1a1921;
    color: var(--accent-lime);
    font-size: clamp(0.6rem, 1.1vh, 1rem);
    font-weight: bold;
    padding: 6px 10px;
    border-bottom: 1px solid #444;
    text-align: center;
}

.table-sub-header, .player-row {
    display: flex;
    align-items: center;
    padding: 0 10px !important;
    width: 100%;
}

.table-sub-header {
    background: rgba(0,0,0,0.5);
    color: rgba(255,255,255,0.4);
    font-size: clamp(0.55rem, 1vh, 0.8rem);
    font-weight: 800;
    border-bottom: 1px solid #444;
    min-height: 30px;
}

.players-grid {
    display: flex;
    flex-direction: column;
    background: #444;
    gap: 1px;
    flex-grow: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-red) transparent;
}

.player-row {
    padding: 0.5vh 10px;
    background: var(--secondary-gray);
    color: white;
    font-size: clamp(0.7rem, 1.5vh, 1.1rem);
    min-height: 30px;
}

.player-row.active-player {
    border-left: 4px solid var(--primary-red);
    background: #3d3c48;
}

.p-info {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.p-name {
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.p-stats {
    display: flex;
    margin-left: auto;
}

.p-indicator {
    color: transparent;
    font-size: 0.7rem;
    margin-left: 5px;
}

.active-player .p-indicator {
    color: var(--primary-red);
}

.stat-box {
    width: 35px;
    min-width: 35px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    font-weight: 800;
}

.stat-box.p-pts {
    width: 35px;
    min-width: 35px;
    color: var(--accent-lime);
}

/* MOBIL LANDSCAPE */
@media (max-height: 480px) and (orientation: landscape) {
    .game-layout {
        flex-direction: row;
    }

    .top-section {
        height: 100%;
        width: 35%;
        flex-direction: column;
    }

    .bottom-section {
        height: 100%;
        width: 65%;
        padding: 0 10px;
    }

    .score {
        font-size: clamp(2rem, 16vh, 5rem);
    }

    .player-footer {
        bottom: 4px;
    }

    .player-name {
        font-size: 0.95rem;
    }

    .throws-wrapper {
        margin-top: 10px;
        height: 35vh;
        max-width: 40vw;
        margin-bottom: 5px;
    }

    .throw-box {
        flex: 0 0 auto;
        height: 100%;
    }

    .throw-sector {
        font-size: clamp(0.7rem, 7vh, 2.5rem) !important;
        height: 32%;
    }

    .throw-value {
        font-size: clamp(2rem, 7vw, 5.5rem);
    }

    .round-score-value {
        font-size: clamp(2rem, 20vh, 5rem);
    }

    .match-table-container {
        height: 55vh;
        max-height: 220px;
        margin-top: 0;
        flex-grow: 0;
    }
}

/* MOBIL PORTRAIT */
@media (max-width: 480px) and (orientation: portrait) {
    .score {
        font-size: clamp(3.5rem, 15vw, 12rem);
        transform: scale(1, 1.4);
    }
}

/* DESKTOP, LAPTOP, TABLET */
@media (min-width: 700px) and (min-height: 700px) {
    .score {
        font-size: clamp(3rem, 17vh, 7rem);
        transform: scale(1, 1.2);
    }

    .flex-spacer {
        flex: 1;
    }

    .match-table-container {
        width: 500px;
        flex-grow: 0;
        align-self: flex-start;
    }

    .player-row {
        padding: 8px 10px !important;
    }

    .stat-box {
        width: 60px;
        min-width: 60px;
    }

    .stat-box.p-pts {
        width: 100px;
        min-width: 100px;
    }
}

/* 2K RESOLUTTION*/
@media (min-width: 1921px) and (min-height: 900px) {
    .score {
        font-size: clamp(3rem, 17vh, 11rem);
        transform: scale(1, 1.4);
    }

    .throw-box {
        max-width: 220px;
    }

    .throw-value {
        font-size: clamp(2rem, 13vw, 5.5rem);
    }

    .throw-sector {
        font-size: clamp(1.2rem, 5vw, 2.5rem);
    }

    .round-score-value {
        font-size: clamp(4rem, 18vw, 9rem);
    }

    .remove-darts-indicator {
        font-size: clamp(0.75rem, 4vh, 11rem);
    }
}