/*
 * The match box shared by the LED screens and the home page (board.js draws it).
 * Every size is a number times --u, which the page sets: 1vw on the LED (so the LED
 * looks as it always did), a share of the box's own width on the home page.
 */

.board {
  --u: 1vw;
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: calc(var(--u) * 1);
  font-weight: bold;
  line-height: normal;
}

.board * {
  box-sizing: border-box;
}


/* Break and end of match */

.board .break,
.board .finish {
  position: absolute;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 85%;
  background: url('/shared/images/black-overlay.png');
  font-size: calc(var(--u) * 1.8);
}

.board .break {
  height: 42%;
  font-size: calc(var(--u) * 2.5);
}

.board .finish div {
  width: 100%;
  line-height: 1.4;
  font-weight: normal;
  text-align: center;
}

.board .finish div b.yellow {
  color: #ffde00;
}

.board .finish div label {
  padding: calc(var(--u) * .8);
  background: white;
  color: #000;
  font-size: calc(var(--u) * 3);
  font-weight: bold;
  line-height: 2.2;
}

.board .finish div label.innings {
  background: none;
  color: white;
  font-size: calc(var(--u) * 2.6);
}

.board .finish div label.yellow {
  background: #ffde00;
}


/* Names */

.board .names {
  float: left;
  width: 100%;
  height: 15%;
  background: #132749;
}

.board .names .name {
  float: left;
  display: flex;
  align-items: center;
  width: 49.7%;
  height: 100%;
  margin: 0 .3% 0 0;
  padding: calc(var(--u) * .2) calc(var(--u) * .8) 0 calc(var(--u) * .8);
  overflow: hidden;
  white-space: nowrap;
  background: white;
  color: #000;
  font-size: calc(var(--u) * 1.4);
}

.board .names .name.right {
  justify-content: flex-end;
  margin: 0 0 0 .3%;
  background: #ffde00;
}


/* Scores */

.board .content {
  float: left;
  width: 100%;
  height: 85%;
  padding: calc(var(--u) * .5);
}

.board .player {
  float: left;
  width: 40%;
  height: 85%;
}

.board .player.right {
  color: #ffde00;
}

.board .player .score {
  position: relative;
  float: left;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 64%;
  margin-bottom: 2%;
  background: #0f254f;
  font-size: calc(var(--u) * 5.5);
  text-shadow: #000 2px 2px 0;
}

.board .player .score .ball {
  position: absolute;
  top: 5%;
  right: 5%;
  width: calc(var(--u) * 1.6);
}

.board .player.right .score .ball {
  right: auto;
  left: 5%;
}

.board .player .score .timeouts {
  position: absolute;
  top: 5%;
  left: 5%;
  width: 5.5%;
}

.board .player.right .score .timeouts {
  left: auto;
  right: 5%;
}

.board .player .score .timeouts span {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  margin-bottom: 50%;
  border-radius: 50%;
  background: #4eb81a;
}

.board .player .score .timeouts span.fill {
  background: #fff;
  opacity: .3;
}

.board .player .line1,
.board .player .line2 {
  position: relative;
  float: left;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 15%;
  margin-bottom: 2%;
  padding: calc(var(--u) * .8);
  background: #0f254f;
  font-size: calc(var(--u) * 1.5);
}

.board .player .line2 {
  padding: 0;
  background: none;
}

.board .player .line2 div {
  position: relative;
  float: left;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 49%;
  height: 100%;
  margin: 0 1% 0 0;
  background: #0f254f;
}

.board .player .line2 div.right {
  margin: 0 0 0 1%;
}

.board .player .line1 small,
.board .player .line2 small {
  position: absolute;
  top: 15%;
  left: 3%;
  font-size: calc(var(--u) * .7);
  font-weight: normal;
}

.board .player .line2 small {
  left: 6%;
}

.board .middle {
  float: left;
  width: 20%;
  height: 85%;
}

.board .middle .innings,
.board .middle .run {
  float: left;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 56%;
}

.board .middle .run {
  height: 44%;
}

.board .middle .run.yellow {
  color: #ffde00;
}

.board .middle .run div,
.board .middle .innings div {
  text-align: center;
}

.board .middle .run small,
.board .middle .innings small {
  font-size: calc(var(--u) * .8);
  line-height: 1;
}

.board .middle .run b {
  font-size: calc(var(--u) * 2.8);
  line-height: 1;
}

.board .middle .innings b {
  border-bottom: 1px solid #fff;
  font-size: calc(var(--u) * 3.6);
  font-weight: normal;
  line-height: 1;
}


/* Pool: the scores fill the player columns, the race-to the middle */

.board.pool .player .score {
  height: 100%;
  margin-bottom: 0;
}

.board.pool .middle .innings {
  height: 100%;
}


/* Table number and limits */

.board .header {
  position: relative;
  float: left;
  width: 100%;
  height: 15%;
  background: #0f254f;
  font-size: calc(var(--u) * 1.5);
}

.board .header .left {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: calc(var(--u) * .1) calc(var(--u) * .8) 0 calc(var(--u) * .8);
  background: #cc2727;
  letter-spacing: calc(var(--u) * .15);
  text-shadow: #000 1px 1px 0;
}

.board .header .right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  padding: calc(var(--u) * .1) calc(var(--u) * .8) 0 calc(var(--u) * .8);
  font-size: calc(var(--u) * 1.3);
  font-weight: normal;
}
