@keyframes slideIn {
    from {
        opacity: 0 ;
        transform: translateX(-1em) ;
    }
    to {
        opacity: 1 ;
        transform: translateX(0) ;
    }
}

.scorecard {
    display: flex ;
    flex-direction: column ;
    width: 100% ;
    max-width: max-content ;
    font-size: 16px ;
    background-color: var(--card) ;
    border: 1px solid var(--card-border) ;
    box-shadow: 0 1px 3px light-dark(
        rgba(20, 30, 40, 0.07),
        rgba(0, 0, 0, 0.25)
    ), 0 6px 16px rgba(20, 30, 40, 0.07) ;
    border-radius: 12px ;
    padding: 0.9rem ;
}

.scorecard .header {
    display: flex ;
    justify-content: space-between ;
    column-gap: 1rem ;
    padding-bottom: 0.3rem ;
}

.scorecard .title {
    display: flex ;
    flex-direction: column ;
    gap: 0.3rem ;
}

.scorecard .tournament_name {
    font-weight: 600 ;
}

.scorecard .status {
    display: flex ;
    flex-direction: column ;
    gap: 0.2rem ;
    align-items: flex-end ;
    width: 5rem ;
}

.scorecard .status_pill {
    display: flex ;
    width: max-content ;
    white-space: nowrap ;
    align-items: center ;
    padding: 0.3rem 0.5rem ;
    border-radius: 999px ;
    font-size: 0.7rem ;
}

.scorecard .viewers {
    display: flex ;
    align-items: center ;
    gap: 0.2rem ;
}

.scorecard .viewer_icon {
    display: flex ;
    align-items: center ;
}

.scorecard .viewer_icon > svg {
    width: 0.85rem ;
    color: var(--text-dim) ;
}

.scorecard .viewer_count {
    font-size: 0.85rem ;
    color: var(--text-dim) ;
}

.scorecard .current_game {
    width: 100% ;
    display: grid ;
    grid-template-columns: 0.2rem 1fr 3.2rem 3.2rem ;
    grid-template-rows: 1fr 1fr ;
    padding: 0.3rem 0 ;
    border-top: 1px solid var(--border) ;
    border-bottom: 1px solid var(--border) ;
}

.scorecard .turn_indicator {
    grid-row: 1 / -1 ;
}

.scorecard .row {
    width: 100% ;
    grid-column: 2 / -1 ;
    display: grid ;
    grid-template-columns: subgrid ;
    align-items: center ;
    padding: 0.3rem 0 ;
}

.scorecard .player_name {
    display: flex ;
    align-items: center ;
    gap: 0.5rem ;
    min-width: 0 ;
}

.scorecard .flag {
    width: 1rem ;
    height: 0.75rem ;
    opacity: 1 ;
    flex-shrink: 0 ;
}

.scorecard .flag_image {
    width: 100% ;
    height: 100% ;
    display: block ;
}

.scorecard .names {
    display: flex ;
    flex-direction: column ;
    min-width: 0 ;
}

.scorecard .name {
    white-space: nowrap ;
}

.scorecard .hidden {
    display: none ;
}

.scorecard .clips {
    grid-column: 2 / -1 ;
    display: grid ;
    grid-template-columns: subgrid ;
    padding-left: 0.7rem ;
}

.scorecard .ball {
    width: 2rem ;
    height: 2rem ;
    border-radius: 50% ;
    justify-self: center ;
    display: flex ;
    align-items: center ;
    justify-content: center ;
    font-size: 0.9rem ;
    font-weight: 600 ;
    box-shadow:
        inset 0 2px 4px rgba(255,255,255,.20),
        inset 0 -4px 7px rgba(0,0,0,.40),
        0 3px 6px rgba(0,0,0,.20) ;
}

.scorecard .score_window {
    width: 2rem ;
    height: 2rem ;
    border-radius: 50% ;
    overflow: hidden ;
}

.scorecard .score_strip {
    text-align: center ;
    height: 2rem ;
    line-height: 2rem ;
    transition: transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1) ;
}

.scorecard .footer_summary {
    display: flex ;
    justify-content: space-between ;
    align-items: center ;
    padding-top: 0.3rem ;
    font-size: 0.85rem ;
    color: var(--text) ;
    cursor: pointer ;
}

.scorecard .footer_summary.empty .completed_scores::before {
    content: none ;
}

.scorecard .footer_summary.empty {
    cursor: default ;
}

.scorecard .completed_scores::before {
    content: "›" ;
    display: inline-block ;
    margin-right: 0 ;
    font-size: 1.4em ;
    line-height: 0 ;
    transition: transform 150ms ease ;
    transform: translateY(-0.1rem) ;
}

.scorecard .footer[open] .completed_scores::before {
    transform: rotate(90deg) ;
}

.scorecard .completed_scores {
    display: flex ;
    align-items: center ;
    gap: 0.5em ;
    opacity: 1 ;
}

.scorecard .completed_game {
    display: flex ;
    align-items: center ;
    opacity: 1 ;
    transform: translateX(0) ;
}

.scorecard .completed_game.enter {
    animation: slideIn 250ms ease forwards ;
}

.scorecard .completed_game.exit {
    animation: slideIn 250ms ease reverse forwards ;
}

.scorecard .split_circle {
    display: block ;
    width: 1em ;
    height: 1.0em ;
    border-radius: 50% ;
    border: 1px solid #333 ;
}

.scorecard .blueblack {
    background: linear-gradient(135deg, blue 50%, black 50%) ;
}

.scorecard .redyellow {
    background: linear-gradient(135deg, red 50%, yellow 50%) ;
}

.scorecard .greenbrown {
    background: linear-gradient(135deg, green 50%, brown 50%) ;
}
.scorecard .pinkwhite {
    background: linear-gradient(135deg, pink 50%, white 50%) ;
}

.scorecard .clock_container {
    display: flex ;
    column-gap: 0.3rem ;
    align-items: center ;
    opacity: 0 ;
    transition: opacity 250ms ease ;
}

.scorecard .visible {
    opacity: 1 ;
}

.scorecard .clock_icon {
    display: flex ;
    align-items: center ;
    width: 0.85rem ;
}

.scorecard .clock_icon > svg {
    width: 100% ;
}

.scorecard .completed_game_list {
    width: 100% ;
    max-width: max-content ;
    display: grid ;
    grid-template-columns: auto auto auto auto ;
    grid-template-rows: auto ;
    row-gap: 0.5rem ;
    padding: 0.5rem 0 0 0 ;
}

.scorecard .full_game_score {
    grid-column: 1 / -1 ;
    display: grid ;
    grid-template-columns: subgrid ;
    gap: 0.3rem ;
    font-size: 0.85rem ;
    color: var(--text-dim) ;
}

.scorecard .full_game_score .winner_name {
    overflow: hidden ;
    text-overflow: ellipsis ;
    white-space: nowrap ;
    min-width: 0 ;
}

@media (max-width: 380px) {
    .scorecard .status_pill {
        padding: 0.2rem 0.4rem ;
    }

    .scorecard .current_game {
        grid-template-columns: 0.2rem minmax(0,1fr) clamp(2.5rem, 13vw, 3.2rem) clamp(2.5rem, 13vw, 3.2rem) ;
    }

    .scorecard .name {
        min-width: 0 ;
        overflow: hidden ;
        text-overflow: ellipsis ;
        white-space: nowrap ;
    }

    .scorecard .title {
        font-size: 0.95rem ;
    }

    .scorecard .status {
        width: 3.5rem ;
    }

    .scorecard .status_text {
        display: none ;
    }

    .scorecard .status_pill {
        gap: 0.4em ;
    }

    .scorecard .name {
        font-size: 0.95rem ;
    }
}

@media (max-width: 330px) {
    .scorecard .title {
        font-size: 0.9rem ;
    }

    .scorecard .name {
        font-size: 0.9rem ;
    }
}