.rsr-display-board,
.rsr-display-board * {
  box-sizing: border-box;
}

.rsr-display-page {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: calc(100vh - 100px);
  min-height: 300px;
  margin-left: calc(50% - 50vw);
  overflow: hidden;
  background: #000;
}

body.rsr-kiosk-body .rsr-display-page {
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  margin-left: 0;
}

body.rsr-kiosk-body .rsr-display-board {
  width: min(100%, 200vh);
}

.rsr-display-page:fullscreen {
  width: 100vw;
  height: 100vh;
  min-height: 0;
  margin: 0;
}

.rsr-display-page:fullscreen .rsr-display-board {
  width: min(100%, 200vh);
}

.rsr-display-fullscreen {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 50;
  min-height: 42px;
  padding: 8px 14px;
  border: 1px solid #666;
  border-radius: 4px;
  background: #181818;
  color: #fff;
  cursor: pointer;
  font: 600 14px Arial, sans-serif;
}

.rsr-display-fullscreen:hover,
.rsr-display-fullscreen:focus-visible {
  background: #333;
}

.rsr-display-page:fullscreen .rsr-display-fullscreen {
  opacity: 0.15;
  transition: opacity 180ms ease;
}

.rsr-display-page:fullscreen .rsr-display-fullscreen:hover,
.rsr-display-page:fullscreen .rsr-display-fullscreen:focus-visible {
  opacity: 1;
}

.rsr-display-board {
  container-type: inline-size;
  position: relative;
  display: grid;
  grid-template-columns: 1fr 0.805fr 1fr;
  width: min(100%, calc((100vh - 100px) * 2));
  max-height: 100%;
  aspect-ratio: 2 / 1;
  overflow: hidden;
  background: #000;
  color: #fff;
  font-family: "Arial Black", Arial, sans-serif;
  font-weight: 900;
}

.rsr-display-team {
  --team-color: #444;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(180deg, var(--team-color) 0%, #000 220%);
}

.rsr-display-team-logo {
  position: absolute;
  inset: 8%;
  z-index: 0;
  width: 84%;
  height: 84%;
  object-fit: contain;
  opacity: 0.45;
  pointer-events: none;
}

.rsr-display-team-name {
  position: absolute;
  top: 1.8cqw;
  z-index: 1;
  max-width: 94%;
  overflow: hidden;
  font-size: 6.25cqw;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000, 0 3px 0 #000;
}

.rsr-display-score {
  position: relative;
  z-index: 1;
  font-size: 19.5cqw;
  line-height: 1;
  text-shadow: -3px -3px 0 #000, 3px -3px 0 #000, -3px 3px 0 #000, 3px 3px 0 #000, 0 5px 0 #000;
}

.rsr-display-cards {
  position: absolute;
  bottom: 1cqw;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.8cqw;
  width: 100%;
  min-height: 7.5cqw;
}

.rsr-display-card-entry {
  display: flex;
  max-width: 12cqw;
  flex-direction: column;
  align-items: center;
  gap: 0.3cqw;
}

.rsr-display-card-badge {
  width: 3.65cqw;
  height: 4.45cqw;
  border-radius: 0.4cqw;
}

.rsr-display-card-yellow {
  background: #ffd400;
}

.rsr-display-card-red {
  background: #e2001a;
}

.rsr-display-card-player {
  max-width: 12cqw;
  overflow: hidden;
  font: 700 1.8cqw/1.1 Arial, sans-serif;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 2px 0 #000;
}

.rsr-display-center {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-right: 0.4cqw solid #333;
  border-left: 0.4cqw solid #333;
  background: #111;
}

.rsr-display-main-sponsor {
  position: absolute;
  top: 1.3cqw;
  left: 50%;
  width: 27cqw;
  height: 13.5cqw;
  object-fit: contain;
  object-position: center;
  transform: translateX(-50%);
}

.rsr-display-status {
  min-height: 3.2cqw;
  padding: 0 0.8cqw;
  color: #ff5050;
  font-size: 2.6cqw;
  letter-spacing: 0;
  text-align: center;
}

.rsr-display-timer {
  font-size: 8.35cqw;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.rsr-display-half {
  margin-top: 0.5cqw;
  color: #aaa;
  font-size: 2.35cqw;
}

.rsr-display-current-time {
  position: absolute;
  right: 0;
  bottom: 1cqw;
  left: 0;
  font: 700 3.15cqw Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  text-align: center;
}

.rsr-display-ended .rsr-display-status {
  color: #ffd400;
}

.rsr-display-sponsor-overlay,
.rsr-display-try-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rsr-display-sponsor-overlay {
  z-index: 10;
  background: #000;
}

.rsr-display-sponsor-overlay img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.rsr-display-try-overlay {
  z-index: 20;
  overflow: hidden;
  background: #050505;
}

.rsr-display-try-overlay.rsr-display-hidden,
.rsr-display-sponsor-overlay.rsr-display-hidden {
  display: none;
}

.rsr-display-try-flash {
  position: absolute;
  inset: -20%;
  background: conic-gradient(from 90deg, #ffd400, #e2001a, #0033a0, #ffd400);
  opacity: 0;
}

.rsr-display-try-content {
  position: relative;
  z-index: 1;
  text-align: center;
  transform: scale(0.45) rotate(-6deg);
}

.rsr-display-try-word {
  color: #ffd400;
  font-size: 17.2cqw;
  line-height: 0.85;
  text-shadow: 0 0.8cqw 0 #c8102e, 0 1.3cqw 0 #000;
}

.rsr-display-try-team {
  margin-top: 2.3cqw;
  font: 900 3.9cqw Arial, sans-serif;
  letter-spacing: 0.5cqw;
  text-shadow: 0 0.4cqw 0 #000;
}

.rsr-display-try-playing .rsr-display-try-flash {
  animation: rsr-display-try-flash 5s ease-out both;
}

.rsr-display-try-playing .rsr-display-try-content {
  animation: rsr-display-try-pop 5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes rsr-display-try-flash {
  0% { opacity: 0; transform: rotate(0deg) scale(0.7); }
  12% { opacity: 0.85; }
  28% { opacity: 0.3; }
  100% { opacity: 0; transform: rotate(18deg) scale(1.2); }
}

@keyframes rsr-display-try-pop {
  0% { opacity: 0; transform: scale(0.45) rotate(-6deg); }
  14% { opacity: 1; transform: scale(1.08) rotate(2deg); }
  23% { transform: scale(0.98) rotate(0deg); }
  82% { opacity: 1; transform: scale(1) rotate(0deg); }
  100% { opacity: 0; transform: scale(1.04) rotate(0deg); }
}

.rsr-display-board.rsr-display-blanked {
  visibility: hidden;
}

.rsr-display-connection {
  position: absolute;
  top: 0.5cqw;
  left: 0.5cqw;
  z-index: 30;
  width: 1cqw;
  height: 1cqw;
  border-radius: 50%;
  background: #e2001a;
}

.rsr-display-connection.rsr-display-connected {
  background: #00c853;
}

@media (max-width: 600px) {
  .rsr-display-page {
    width: 100vw;
    height: auto;
    min-height: 55vh;
  }

  .rsr-display-board {
    width: 100vw;
  }
}
