@font-face {
  font-family: "Cooper*";
  src: url("Cooper.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 900;
  font-display: block;
}

@font-face {
  font-family: "Cooper*";
  src: url("Cooper-Italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 400 900;
  font-display: block;
}

* {
  box-sizing: border-box;
}
*::before,
*::after {
  box-sizing: inherit;
}

:root {
  --canvas: #252134;
  --surface: #302750;
  --highlight: #7c56fc;
  --accent: #0ff10f;
  --text: #fff;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100dvh;
}

html {
  background-color: var(--canvas);
}

body {
  font-family: "Cooper*";
  color: var(--text);
  background-color: transparent;
  text-align: center;
  text-wrap: pretty;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.wrapper {
  padding: 1.5rem;
}

/** BUTTON */
.button {
  all: unset;
  display: block;
  padding: .5em;
  color: var(--accent);
  border: 1px solid currentcolor;
  border-radius: .5rem;
  background-color: var(--canvas);
  font-size: 1em;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.button:active,
.button[aria-pressed="true"] {
  color: var(--canvas);
  background-color: var(--accent);
}

/** BIG NUMBAH **/

.big-number {
  font-weight: 900;
  text-shadow: 0 0.05em 0 var(--highlight);
}

/** CONN LABEL */

.conn-label {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  font-style: italic;
  font-weight: 600;
}

.conn-label::before {
  content: "";
  display: inline-block;
  inline-size: .66em;
  block-size: .66em;
  border-radius: 50%;
  background-color: crimson;
}

.conn-label--connected::before {
  background-color: limegreen;
  box-shadow: 0 0 .4em limegreen;
}

/** PREZZO */

html.slide-deck {
  scroll-snap-type: y mandatory;
}

.slide {
  display: flex;
  padding-inline: 3vw;
  padding-bottom: 15vh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100vh;
  scroll-snap-align: start;
  text-align: center;
}

.slide--no-pad {
  padding-bottom: 0;
}

.prose > * {
  margin-bottom: 9vh;
}

.prose > :last-child {
  margin-bottom: 0;
}

.logo {
  max-width: 80%;
  max-height: 80%;
  animation-name: logoFloat;
  animation-duration: 22s;
  animation-iteration-count: infinite;
}

@keyframes logoFloat {
  0%, 100% {
    rotate: -1.6deg;
  }
  50% {
    rotate: 2.2deg;
  }
}

.subtitle {
  font-size: 5vh;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--accent);
}

.title {
  font-size: 18vh;
  font-weight: 900;
  font-style: italic;
  text-shadow: 0 0.05em 0 var(--highlight);
  line-height: 0.8;
  text-wrap: balance;
}

.title--s {
  font-size: 9vh;
}

.rules,
.helpers {
  font-weight: 500;
  line-height: 1.25;
}

.rules {
  font-size: 5vh;
}

.rules--s {
  font-size: 3.5vh;
}

.points,
.helpers {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: 1.5em;
  font-size: 4vh;
}

.points {
  display: none;
}

.points mark {
  background: none;
  color: var(--accent);
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 2vmin;
}

.image-grid img {
  block-size: 100%;
  inline-size: 100%;
  object-fit: cover;
  border-radius: 20px;
}

/** SCOREBOARD */

.scoreboard {
  --surface: var(--highlight);

  display: flex;
  justify-content: space-around;
  align-items: end;
  position: fixed;
  inset-inline: 0;
  inset-block-end: 0;
  background-image: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--surface), transparent 100%),
    color-mix(in srgb, var(--surface), transparent 98.2%),
    color-mix(in srgb, var(--surface), transparent 95.2%),
    color-mix(in srgb, var(--surface), transparent 91%),
    color-mix(in srgb, var(--surface), transparent 86.1%),
    color-mix(in srgb, var(--surface), transparent 80.2%),
    color-mix(in srgb, var(--surface), transparent 73%),
    color-mix(in srgb, var(--surface), transparent 65%),
    color-mix(in srgb, var(--surface), transparent 56.5%),
    color-mix(in srgb, var(--surface), transparent 47%),
    color-mix(in srgb, var(--surface), transparent 34%),
    color-mix(in srgb, var(--surface), transparent 19%),
    color-mix(in srgb, var(--surface), transparent 0%)
  );
  text-align: center;
  transform: translateY(100%);
  transition: transform 0.6666s ease-in-out;
}

.scoreboard--visible {
  transform: translateY(0);
}

.team-block {
  flex: 0 0 25%;
  padding-inline: 2vw;
  padding-block-start: 8vh;
  padding-block-end: 3vh;
  transition: border-color .1s ease-in-out;
}

.team-block--buzzed {
  background-image: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--accent), transparent 100%),
    color-mix(in srgb, var(--accent), transparent 98.2%),
    color-mix(in srgb, var(--accent), transparent 95.2%),
    color-mix(in srgb, var(--accent), transparent 91%),
    color-mix(in srgb, var(--accent), transparent 86.1%),
    color-mix(in srgb, var(--accent), transparent 80.2%),
    color-mix(in srgb, var(--accent), transparent 73%),
    color-mix(in srgb, var(--accent), transparent 65%),
    color-mix(in srgb, var(--accent), transparent 56.5%),
    color-mix(in srgb, var(--accent), transparent 47%),
    color-mix(in srgb, var(--accent), transparent 34%),
    color-mix(in srgb, var(--accent), transparent 19%),
    color-mix(in srgb, var(--accent), transparent 0%)
  );
}

.team-block--scored {

}

.team-block .team-name {
  font-size: 4vh;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 0.05em 0 var(--canvas);
}

.team-block .team-score {
  font-size: 9vh;
  line-height: 0.8;
}

/** BACKDROP */

.backdrop {
  height: 110vh;
  position: fixed;
  inset: 0;
  z-index: -1;
  color: var(--surface);
  font-size: 28vh;
  font-weight: 900;
  line-height: 0.8;
  overflow: hidden;
  user-select: none;
  opacity: 0.67;
}

.backdrop div {
  rotate: 2.8deg;
  display: inline-block;
  white-space: nowrap;
  animation-name: backdrop-animation;
  animation-duration: 800s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-fill-mode: both;
  animation-direction: alternate;
}

.backdrop div:nth-child(2n) {
  animation-delay: -800s;
}

@keyframes backdrop-animation {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(calc(-100% + 100vw));
  }
}

/** BUZZERS */

.buzzer-header {
  display: flex;
  align-items: baseline;
  gap: 1em;
  padding: 1rem;
  padding-block-start: 2rem;
  background-color: var(--surface);
  font-size: xx-large;
  font-weight: 700;
  line-height: 1;
  justify-content: space-between;
}

.buzzer {
  --offset: 1rem;

  all: unset;
  display: inline-block;
  inline-size: 90%;
  max-inline-size: 20rem;
  margin-block: 4rem;
  aspect-ratio: 1;
  position: relative;
  border: 4px solid var(--highlight);
  border-radius: 50%;
  background-color: var(--canvas);
  font: inherit;
  font-size: clamp(3rem, 10vw, 5rem);
  font-weight: 900;
  font-style: italic;
  cursor: pointer;
  box-shadow: 0 var(--offset) 0 var(--highlight);
  touch-action: manipulation;
}

.buzzer::after {
  content: "";
  display: block;
  position: absolute;
  inset: 0;
}

.buzzer:active {
  inset-block-start: var(--offset);
  box-shadow: none;
}

.buzzer:active::after {
  inset-block-start: calc(0px - var(--offset));
}

.buzzer:disabled {
  pointer-events: none;
  filter: grayscale(100%);
}

/** BUZZER INDEX */

.team-list {
  margin: 0;
  padding: 0;
  font-size: 3rem;
  list-style: none;
}

.team-list li {
  margin-top: .5rem;
}

.team-list a {
  color: var(--accent);
  text-decoration: none;
}

/** CONTROL PANEL */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 2rem;
  margin-block: 2rem;
}

.team-card {
  padding: .5rem;
  border: 2px solid var(--highlight);
  border-radius: 1rem;
}

.team-card--buzzed {
  border-color: var(--accent);
  outline: 6px solid var(--accent);
}

.team-card__header {

}

.team-card__name {
  all: unset;
  inline-size: 100%;
  font-size: 2rem;
  font-weight: 600;
}

.team-card__score {
  margin-block: 1rem;
  font-size: 3rem;
  line-height: 1;
}

.team-card__controls {
  display: flex;
  gap: 1rem;
}

.team-card__controls > .button {
  padding-block: 1em;
}

.team-card__controls > .button--increment {
  flex: 0 1 75%;
}

.team-card__controls > .button--decrement {
  flex: 0 1 25%;
}

.admin-buttons {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  font-size: 1.5em;
}

.danger {
  margin-block-start: 10rem;
  text-align: left;
}
