body {
  overflow: hidden;
}

html, body {
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

div,
span {
  user-select: none;
  font-family: monospace;
}

.base-timer {
  position: absolute;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

#timer-circle {
  transition: 1.1s linear;
  fill: none;
  fill-rule: nonzero;
  stroke-width: 15px;

  transform: scaleX(-1) rotate(270deg);
  transform-origin: center;
}

@keyframes warning {
  0% {
    fill: white;
  }
  50% {
    fill: red;
  }
  90% {
    fill: white;
  }
}

.timer-end {
  animation: warning 1s infinite;
}

.timer-red {
  fill: red;
}

.timer-yellow {
  fill: yellow;
}

.timer-white {
  fill: white;
}

#timer-display {
  user-select: none;
}

.no-matches {
  opacity: 0;
  pointer-events: none;
}

.matches {
  opacity: 100;
  pointer-events: auto;
}

.button-row {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-content: center;
  transition: ease 2s;
}

.button-row button {
  width: 50px;
  height: 50px;
  margin: 0px 5px 0px 5px;
  padding: 0px;
  background-color: #3b3a3a;
  background-repeat: no-repeat;
  background-size: 100%;
  border: none;
  transition: ease-in-out 0.2s;
  border-radius: 15px;
}

.button-row span {
  color: white;
  font-size: 35px;
  display: inline-flex;
  align-items: center;
}

.button-row button:hover {
  scale: 1.1;
  background-color: #4e4e4e;
}

.scores {
  width: 400px;
  height: 215px;
  position: absolute;
  margin: 0px;
  padding: 0px;
  font-weight: 600;

  /* Center text */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-content: center;

  font-size: 150px;
  color: white;
  border-radius: 10px;
  transform: translateY(calc(50vh - 50%));
  transition: 2s ease-in-out;
}

.scores span {
  font-size: 30px;
  margin: 5px;
}

.team-icon {
  position: absolute;
  transform: translateY(calc(50vh - 180px));
  height: 60px;
  width: auto;
}

.icon-toggle {
  animation: fadeIn 2s;
}

#red-icon {
  left: 10px;
}

#blue-icon {
  right: 10px;
}

#red-score {
  background: linear-gradient(to right, #ed1c24 150px, #3b3a3a);
  text-align: left;
}

#blue-score {
  background: linear-gradient(to right, #3b3a3a, #0066b3 250px);
  text-align: right;
}

.blue-score-enter {
  right: 10px;
}

.blue-score-exit {
  right: -500px;
}

.red-score-enter {
  left: 0px;
}

.red-score-exit {
  left: -500px;
}

.display-penalty {
  position: absolute;
  transform: translateY(calc(50vh - 50% + 130px));

  color: yellow;
  font-size: 40px;
}

.red-tracker {
  position: absolute;
  left: 20px; 
  top: 320px;  
}

.blue-tracker {
  position: absolute;
  right: 20px; 
  top: 320px;  
}


#red-penalties {
  left: 15px;
}

#blue-penalties {
  right: 15px;
}

.circle-red {
  stroke: rgb(205, 11, 11);
}

.circle-orange {
  stroke: orange;
}

.circle-green {
  stroke: #56ea16;
}

.game-piece-tracker {
  position: fixed;
  top: 70vh;
  bottom: 20px;
  width: clamp(150px, 26vw, 800px);
  border-radius: 10px;
  padding: clamp(8px, 1vw, 20px);
  color: white;
  font-family: monospace;
  box-sizing: border-box;
  font-size: 20px;
  font-weight: bold;
  box-sizing: border-box;
}

.red-tracker {
  left: 20px;
  border: 2px solid #ff4d4d;
  background: rgba(214, 0, 0, 0.348);
}

.blue-tracker {
  right: 20px;
  border: 2px solid #4d94ff;
  background: rgba(0, 26, 255, 0.348);
}

.tracker title {
  font-size: 20px; 
  font-weight: bold;
  text-align: center; 
  margin-bottom: 8px;
  color: #ddd;
  border-bottom: 1px solid #555;
  padding-bottom: 4px;
}

.piece-row {
  display: flex;
  justify-content: space-between;
  font-size: 30px;
  margin: 4px 0;
}

.red-tracker .piece-row span:last-child {
  color: #ff4d4d;
  font-weight: bold;
}

.blue-tracker .piece-row span:last-child {
  color: #4d94ff;
  font-weight: bold;
}

.reveal {
  height: 100%;
  width: 50%;
  position: absolute;
  top: 0px;
  margin: 0;
  transition: 3s ease;
  font-size: 100px;
}

.breakdown-card {
  position: absolute;
  top: 55vh;
  left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(720px, 50vw, 1000px);
  height: clamp(450px, 50vh, 1000px);
  background-color: #e6e6e6;
  color: #222;
  border-radius: 8px;
  box-shadow: 0px 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 5;
  overflow: hidden;
  font-family: Arial, sans-serif;
  transition: opacity 0.8s ease;
}

.breakdown-card.hidden {
  opacity: 0;
  pointer-events: none;
}

.breakdown-section-title {
  background-color: #cccccc;
  text-align: center;
  font-weight: bold;
  font-size: 25px;
  padding: 4px 0;
  letter-spacing: 1px;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  font-size: 40px;
  font-weight: bold;
}

.breakdown-row.header {
  background-color: #ffffff;
  text-align: center;
  border-bottom: 2px solid #ccc;
  font-size: 32px;
}

.breakdown-title {
  font-size: 40px;
  color: #000000;
  text-align: center;
  letter-spacing: 2;
}

.breakdown-row .label {
  font-size: 30px;
  color: #444;
  font-weight: normal;
  text-align: center;
}

#red-reveal {
  background-color: #ed1c24;
}

#blue-reveal {
  background-color: #0066b3;
}

.blue-reveal-enter {
  right: 0%;
}

.blue-reveal-exit {
  right: -100%;
}

.red-reveal-enter {
  left: 0%;
}

.red-reveal-exit {
  left: -100%;
}

.points {
  color: white;
  font-size: 150px;
}

.penalties {
  color: yellow;
  font-size: 100px;
}

.reveal-score :first-child {
  color: white;
  font-size: 75px;
}

.reveal-score {
  position: relative;
  top: 115px;
  bottom: 40px;
  max-width: 100%;
  text-wrap: wrap;
  justify-content: center;
  align-content: center;
  text-align: center;
  align-items: center;
}

#red-reveal .reveal-score {
  right: 70px;
  text-align: right;
  align-items: flex-end;
}

#blue-reveal .reveal-score {
  left: 70px;
  text-align: left;
  align-items: flex-end;
}

#red-reveal-name,
.alliance-name {
  position: absolute;
  bottom: -65vh;
  left: 55%;
  transform: translateX(-50%); 
  
  /* Box Styling */
  background-color: rgb(236, 0, 0); 
  border: 0px solid rgba(255, 255, 255, 0.8); 
  border-radius: 0px;                        
  padding: 10px 24px;                        
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); 

  /* Text Styling */
  color: #ffffff;
  font-size: 40px;
  font-weight: bold;
  text-transform: uppercase;
  z-index: 3;
  justify-content: center;
  align-content: center;
  text-align: center;
  align-items: center;
}
#blue-reveal-name,
.alliance-name {
  position: absolute;
  bottom: -65vh;
  left: 45%;
  transform: translateX(-50%); 
  
  /* Box Styling */
  background-color: rgb(0, 0, 159); 
  border: 0px solid rgba(255, 255, 255, 0.8); 
  border-radius: 0px;                         
  padding: 10px 24px;                       
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  /* Text Styling */
  color: #ffffff;
  font-size: 40px;
  font-weight: bold;
  text-transform: uppercase;             
  z-index: 3;
  justify-content: center;
  align-content: center;
  text-align: center;
  align-items: center;
}

#winner {
  position: absolute;
  height: 120px;
  width: 100%;
  background-color: #e2e22a;
  color: black;

  
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;

  font-size: 100px;
  font-weight: bold;
  text-shadow: 0px 0px 200px white;
  border-radius: 0px 0px 8px 8px;
  z-index: 10;
}


.winner-icon {
  height: 90px; 
  width: auto;
  filter: drop-shadow(0px 4px 6px rgba(0, 0, 0, 0.2));
}

#tied {
  position: absolute;
  height: 130px;
  line-height: 130px;
  font-size: 150px;
  width: 200%;
  background-color: rgb(168, 168, 168);
  color: black;
  text-align: center;
  text-shadow: 0px 0px 200px white;
  border-radius: 0px 0px 8px 8px;
  animation: 4s fadeIn;
}

@keyframes fadeIn {
  0% {
    opacity: 0%;
  }
  75% {
    opacity: 0%;
  }
  100% {
    opacity: 100%;
  }
}

.scoreboard {
  position: fixed;
  top: 0;
  left: 50%;
  width: 100%;
  height: 100%;
  transform: translateX(-50%);
  color: white;
  border-radius: 5px;
  text-align: center;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: 1.2s ease-in-out;

  text-align: center;
  background-color:#00000086;

  color: white;
}

.top-table::-webkit-scrollbar {
  display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
.top-table {
  -ms-overflow-style: none;  
  scrollbar-width: none; 
}

.scoreboard.hidden {
  opacity: 0;
  top: -100% !important;
}

.top-table {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.bottom-table {
  width: 100%;
  flex-shrink: 0;
  padding: 10px;
  position: sticky;
  bottom: 0;
  z-index: 10;
  box-sizing: border-box;
  padding-right: 10px; 
}

.score-content {
  display: flex;
  align-items: center;  
  justify-content: center;  
  gap: 6px;                 
}

.bottom-table table {
  width: 100%;
}

#match-table {
  width: 100%;
  pointer-events: auto;
  border-collapse: separate;
  border-spacing: 2px;
}

th {
  padding: 0px;
  font-weight: bolder;
  position: sticky;
  top: 0px;
  z-index: 1;
}

td, th {
  font-size: xx-large;
  border-radius: 3px;
  padding: 3px;
  margin: 3px;
}

td {
  vertical-align: top;
}

.top-table td:first-child, .top-table th:first-child {
  background-color: #707070;
}

.top-table td:nth-child(even), .top-table th:nth-child(even) {
  background-color: #ed1c23ef;
}

.top-table td:nth-child(odd):not(:first-child), .top-table th:nth-child(odd):not(:first-child) {
  background-color: #0066b3ef;
}

.bottom-table th, .bottom-table td {
  background-color: #4e4e4e;
}

.tournament {
  height: 34px;
  width: 34px;

  position: absolute;

  top: 80%;
  right: 12px;
  z-index: 2;
}

.hidden {
  opacity: 0%;
}

@media screen and (max-height: 650px) {
  .game-piece-tracker {
    top: 180px; 
    padding: 6px 10px;
  }
  
  .tracker-title {
    font-size: 11px;
    margin-bottom: 4px;
  }

  .piece-row {
    font-size: 12px;
    margin: 2px 0;
  }
}