:root {
  --button-size: 2rem;
  --table-color: #1a4996;
  --padding: 2rem;
}

body {
  margin: 0;
  height: 100vh;
  color: white;
  overflow: hidden;
  font-family: "Ubuntu", sans-serif;
  touch-action: manipulation;
}

#table {
  position: fixed;
  top: 0;
  left: 0;
  background-color: var(--table-color);
  width: 100%;
  height: 100%;
  display: flex;
}

#table > div {
  flex: 1;
  padding: var(--padding);
  position: relative;
}

#divider {
  position: fixed;
  left: 50%;
  top: 0;
  height: 100%;
  border: solid rgba(255, 255, 255, 0.7) 0.5rem;
}

#serve {
  position: fixed;
  top: calc(50% - 2rem);
  width: 5rem;
  height: 5rem;
  text-align: center;
  left: calc(50% - 2rem);
  display: block;
  font-size: 4rem;
  background-color: rgba(50, 50, 50, 0.9);
  border-radius: 100%;
  cursor: pointer;
  user-select: none;
}

#serve[state="right"] {
  transform: scaleX(-1);
}

#settings-button {
  position: fixed;
  left: calc(50% - var(--button-size));
  width: calc(var(--button-size) + var(--button-size) / 2);
  background-color: var(--table-color);
  top: -0.25rem;
  border: solid var(--table-color) calc(var(--button-size) / 2);
  border-radius: 100%;
  cursor: pointer;
  z-index: 2;
}

#settings-toggle + div {
  opacity: 0;
  pointer-events: none;
}

#settings-container {
  position: fixed;
  height: 100%;
  width: 100%;
  max-height: 100%;
  overflow-y: scroll;
  z-index: 1;
  background-color: rgba(255, 255, 255, 0.9);
  top: 0;
  left: 0;
  transition: opacity 0.5s;
  color: black;
  padding: 2rem;
  border-top: solid var(--table-color) calc(var(--button-size) * 2.5 + 0.25rem);
  box-sizing: border-box;
}

#settings-toggle:checked + div {
  opacity: 1;
  pointer-events: all;
}

#settings > div {
  margin-bottom: 0.25rem;
}

#settings label {
  width: 10rem;
  display: inline-block;
}

#settings input[type="number"] {
  width: 4rem;
  display: inline-block;
}

#alert-box:not(.inactive):not(.active) {
  display: none;
}

#alert-box {
  display: flex;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  align-items: center;
  z-index: 5;
  left: 100%;
  transition: left 4s;
}

#alert-box.active {
  animation: sus 5s;
}

#alert-box div {
  font-size: 8rem;
  flex: 1;
  text-align: center;
}

#alert-box span {
  font-size: 8rem;
  text-align: center;
  display: inline-block;
  background-color: #9e1910;
  margin: auto;
  padding: 0.5rem;
  border-radius: 0.5rem;
  box-shadow: white 0 0 5rem 3rem;
}

#action-buttons {
  position: fixed;
  top: 2rem;
  right: 1rem;
  padding: 0.5rem;
  background-color: #444;
  opacity: 0.3;
}

#action-buttons:hover {
  opacity: 1;
}

#action-buttons span {
  display: block;
}

#action-buttons img {
  width: 2rem;
}

#action-buttons img:active {
  box-shadow: white 0 0 0.5rem 0.5rem;
}

#action-buttons span:not(:last-child) {
  margin-bottom: 0.5rem;
}

.score {
  text-align: center;
  display: block;
  font-size: 15rem;
  cursor: pointer;
  margin-top: calc(50vh - 14rem);
  user-select: none;
}

.name {
  text-align: center;
  display: inline-block;
  font-size: 3rem;
  position: absolute;
  width: calc(100% - var(--padding) * 2);
  bottom: var(--padding);
}

.match-note {
  text-align: center;
  display: inline-block;
  font-size: 1.5rem;
  position: absolute;
  width: calc(100% - var(--padding) * 2);
  bottom: calc(var(--padding) * 3);
  color: #d4a611;
  -webkit-text-stroke: 1px black;
  text-stroke: 1px black;
}

.input-hidden {
  display: none;
}

@media screen and (max-width: 600px) {
  .score {
    font-size: 6rem;
    margin-top: calc(50vh - 6rem);
  }

  .name {
    font-size: 1.5rem;
  }

  .match-note {
    font-size: 1rem;
  }
}

@keyframes sus {
  0% {
    left: 100%;
  }
  50% {
    left: 0;
  }
  100% {
    left: -100%;
  }
}
