﻿ScoreBoard {
  position: absolute;
  width: 100%;
  height: 100%;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 10;
  
  .bar-top {
    position: absolute;
    top: 0;
    width: 100%;
    height: 0;
    background-color: black;
    transition: height 0.5s;
    
    &.show {
      height: 80px;
    }
  }
  
  .bar-bottom {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 0;
    background-color: black;
    transition: height 0.5s;

    &.show {
      height: 80px;
    }
  }
  
  .container {
    position: relative;
    width: 55%;
    height: auto;
    background-color: #f8f6f0;
    border-radius: 4px;
    color: black;
    flex-direction: column;
    border: 2px solid black;
    flex: 0 0 auto;
    
    .mask-bg {
      position: absolute;
      width: 100%;
      height: 80px;
      bottom: 0;
      mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.05) 50%, rgba(0, 0, 0, 1));
      mask-mode: alpha;
      background-repeat: repeat-x;
      background-image: url("textures/ui/star_pattern.png");
      background-size: contain;
    }
    
    .red {
      width: 100%;
      height: 4px;
      border-top-left-radius: 4px;
      border-top-right-radius: 4px;
      background-color: #e74b37;
    }
    
    .yellow {
      width: 100%;
      height: 4px;
      background-color: #f5b213;
    }
    
    .green {
      width: 100%;
      height: 4px;
      background-color: #46a147;
    }
    
    .blue {
      width: 100%;
      height: 4px;
      background-color: #4ec1e0;
    }
    
    .title-holder {
      align-items: center;
      margin: 12px;
    }
    
    .title {
      margin: 12px;
      font-size: 24px;
      font-weight: bold;
      flex-shrink: 0;
      text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.4);
    }
    
    .bar {
      width: 100%;
      height: 12px;
      background-color: rgba(0, 0, 0, 0.6);
      transform: skewX(-12deg);
      margin-bottom: 4px;
    }
    
    .players {
      position: relative;
      width: 100%;
      flex-direction: column;
      gap: 8px;
      padding: 12px;
    }
  }

  .round-count {
      position: absolute;
      width: 100%;
      top: 70px;
      justify-content: center;
      align-items: center;
      font-size: 16px;
  }
  
  .players-layout {
    position: relative;
    width: 100%;
  }
  
  .round-indicators {
    width: 99%;
    justify-content: space-between;
    font-size: 12px;
    font-weight: bold;
  }
  
  .winner-bar {
    position: absolute;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    margin: 4px;
    right: 0;
    transform: translateX(-10%);
    
    > label {
      font-size: 16px;
      font-weight: bold;
    }
    
    > i {
      font-size: 32px;
      transform: translateY(-50%);
    }
  }
  
  .player-container {
    width: 100%;
    height: 72px;
    flex-direction: column;
    
    .player-name {
      font-size: 18px;
      flex-direction: column;
    }
    
    .score-bar {
      width: 99%;
      height: 32px;
      border-radius: 4px;
      background-color: rgba(0, 0, 0, 0.2);
      
      .score-bar-border {
        border: 1px black;
      }
      
      .score-filled {
        height: 32px;
        background-color: white;
        align-items: flex-end;
        transition: width 1s;
        border-bottom: 1px solid black;
        border-top: 1px solid black;
        
        &:first-child {
          border-top-left-radius: 4px;
          border-bottom-left-radius: 4px;
          border-left: 1px solid black;
        }
        
        &:last-child {
          border-top-right-radius: 4px;
          border-bottom-right-radius: 4px;
          border-right: 1px solid black;
        }
        
        > label {
          color: white;
          margin: 4px;
          text-stroke: 2px black;
        }
      }
      
      .score-earned {
        height: 32px;
        background-color: gold;
        transition: width 1s;
        
        &:intro {
          width: 0;
        }
      }
    }
  }
  
  &.show {
    opacity: 1;
  }
}