﻿@import '../Styles/styles.scss';

ScoreBoard {
    position: absolute;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 500ms ease-in-out;
    align-items: center;
    justify-content: center;
    font-family: $font-secondary;
    
    &.show {
        opacity: 1;
    }
    
    .container {
        width: 1200px;
        height: 600px;
        background-color: rgba(0, 0, 0, 0.8);
        backdrop-filter: blur(4px);
        border-bottom: 4px rgba(255, 255, 255, 0.05);
        border-radius: 4px;
        color: #e1e1e1;
        flex-direction: column;
        padding: 16px;
        
        .header {
            justify-content: space-between;
            align-items: flex-end;
            color: linear-gradient(to top, #e1e1e1, #b4b4b4);
            
            .title {
                font-size: 32px;
                font-weight: bold;
            }
            
            .round-count {
                font-size: 28px;
            }
        }
        
        .divider {
            width: 100%;
            height: 0.5px;
            background-color: #b4b4b4;
            margin: 4px 0 16px 0;
        }
        
        .players {
            flex-direction: column;
            width: 100%;
            gap: 16px;
        }

        .score-legend {
            margin-top: auto;
            padding-top: 12px;
            align-items: center;
            justify-content: center;
            gap: 18px;
            color: #b4b4b4;
            font-size: 16px;

            .legend-item {
                align-items: center;
                gap: 6px;
                flex-shrink: 0;
            }

            .legend-swatch {
                width: 24px;
                height: 12px;
                border-radius: 3px;
                border: 1px solid rgba(255, 255, 255, 0.2);
                flex-shrink: 0;
            }
        }
    }

    .score-complete {
        background-color: paleturquoise;
    }

    .score-first {
        background-color: palegoldenrod;
    }

    .score-trap {
        background-color: palevioletred;
    }

    .score-coin {
        background-color: palegreen;
    }
    
    .player-score {
        width: 100%;
        flex-direction: column;
        gap: 2px;
        
        .player-name {
            font-size: 18px;
            margin-left: 8px;
            align-items: center;
            gap: 8px;

            .player-avatar {
                width: 28px;
                height: 28px;
                border-radius: 3px;
                border: 1px solid rgba(black, 0.67);
                flex-shrink: 0;
            }
        }
        
        .score-bars {
            background-color: rgba(255, 255, 255, 0.05);
            border-radius: 8px;
            width: 100%;
            height: 40px;
            overflow: hidden;

            .score-bar {
                height: 100%;
                margin: 0 -1px 0 0;
            }
        }
    }
}

.bar-top {
    position: absolute;
    top: 0;
    width: 100%;
    height: 0;
    background-color: black;
    transition: height 500ms ease-in-out;

    &.show {
        height: 80px;
    }
}

.bar-bottom {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 0;
    background-color: black;
    transition: height 500ms ease-in-out;

    &.show {
        height: 80px;
    }
}
