@font-face {
  font-family: "Monocraft";
  src: url("/monocraft-bold.ttf?v=18") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  --page-background: #020506;
  --page-text: #ffffff;
  --frame-glow: #8eefff;
  --card-size: clamp(72px, 7.5vw, 130px);
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: var(--page-background);
}

body {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: clamp(12px, 2vw, 30px);

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;

  overflow-x: hidden;
  background: var(--page-background);
  color: var(--page-text);
  font-family: "Monocraft", Arial, sans-serif;
  font-weight: 700;
}

.roster-content {
  position: relative;
  z-index: 1;

  display: flex;
  flex-direction: column;
  align-items: center;

  width: 100%;
  margin-block: auto;
}

.roster-countdown {
  position: relative;
  z-index: 2;

  display: block;
  flex: 0 0 auto;
  margin: 0 auto clamp(18px, 2.5vw, 38px);

  color: #ffffff;
  font-family: "Monocraft", Arial, sans-serif;
  font-size: clamp(38px, 6vw, 96px);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  text-align: center;
  text-shadow:
    3px 3px 0 rgba(0, 0, 0, 0.9),
    0 0 14px rgba(0, 0, 0, 0.72);
  white-space: nowrap;
}

.site-intro {
  position: fixed;
  z-index: 100;
  inset: 0;

  display: grid;
  place-items: center;

  overflow: hidden;
  background: #000000;
  opacity: 1;
  pointer-events: all;

  animation: intro-safety-release 1ms linear 7.5s forwards;
  transition: opacity 700ms cubic-bezier(0.55, 0, 0.2, 1);
}

.site-intro-logo-stage {
  display: block;
  width: min(78vw, 900px);
  max-width: none;
  max-height: 76vh;

  opacity: 1;
  transform: scale(0.82);
  transform-origin: center;

  transition:
    opacity 600ms ease 100ms,
    transform 750ms cubic-bezier(0.2, 0.75, 0.25, 1);
}

.site-intro-logo {
  display: block;
  width: 100%;
  max-height: 76vh;
  object-fit: contain;

  opacity: 0.82;
  transform: scale(0.97);
  transform-origin: center;

  animation: intro-logo-pulse 1800ms ease-in-out infinite;
}

.site-intro.is-exiting {
  animation: none;
  opacity: 0;
  pointer-events: none;
}

.site-intro.is-exiting .site-intro-logo-stage {
  opacity: 0;
  transform: scale(1.28);
}

.site-intro.is-exiting .site-intro-logo {
  animation-play-state: paused;
}

@keyframes intro-logo-pulse {
  0%,
  100% {
    opacity: 0.78;
    transform: scale(0.97);
  }

  50% {
    opacity: 1;
    transform: scale(1.02);
  }
}

@keyframes intro-safety-release {
  to {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
  }
}

.roster-background {
  position: fixed;
  z-index: 0;
  inset: 0;

  width: 100vw;
  height: 100vh;
  object-fit: cover;
  object-position: center;

  pointer-events: none;
}

.roster-grid {
  position: relative;
  z-index: 1;

  display: grid;
  grid-template-columns: repeat(auto-fit, var(--card-size));
  justify-content: center;
  align-content: center;
  gap: clamp(8px, 1.2vw, 20px);

  width: min(1700px, 100%);
  margin: 0 auto;
}

html.impact-shake body {
  animation: impact-shake 1400ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
  transform-origin: center;
}

@keyframes impact-shake {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0);
  }

  5% {
    transform: translate3d(-14px, 8px, 0) rotate(-0.65deg);
  }

  11% {
    transform: translate3d(13px, -9px, 0) rotate(0.6deg);
  }

  18% {
    transform: translate3d(-11px, -6px, 0) rotate(-0.5deg);
  }

  27% {
    transform: translate3d(10px, 7px, 0) rotate(0.4deg);
  }

  38% {
    transform: translate3d(-8px, 4px, 0) rotate(-0.3deg);
  }

  51% {
    transform: translate3d(6px, -4px, 0) rotate(0.22deg);
  }

  66% {
    transform: translate3d(-4px, 3px, 0) rotate(-0.14deg);
  }

  82% {
    transform: translate3d(2px, -1px, 0) rotate(0.06deg);
  }
}

.credits-button {
  position: relative;
  z-index: 2;
  display: block;
  width: 176px;
  max-width: min(44vw, 176px);
  flex: 0 0 auto;
  margin: clamp(18px, 3vw, 36px) auto 0;
  outline: none;
}

.credits-button img {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  transition: filter 120ms ease, transform 120ms ease;
}

.credits-button:hover img,
.credits-button:focus-visible img {
  filter: brightness(1.18);
  transform: scale(1.035);
}

.credits-button:active img {
  transform: scale(0.98);
}

.player-card {
  display: block;
  width: var(--card-size);
  max-width: 100%;

  color: inherit;
  text-decoration: none;
  outline: none;
}

.portrait-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: visible;
}

.player-portrait {
  position: absolute;
  z-index: 1;
  top: 4%;
  left: 3.6%;

  width: 93%;
  height: 93%;
  object-fit: cover;
  image-rendering: pixelated;

  opacity: 1;
  transition: opacity 300ms ease;
}

.portrait-border {
  position: absolute;
  z-index: 3;
  inset: 0;

  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;

  pointer-events: none;
  filter:
    drop-shadow(0 0 3px var(--frame-glow))
    drop-shadow(0 0 12px var(--frame-glow));
}

.player-soul {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 50%;

  display: block;
  width: 60%;
  aspect-ratio: 1;

  opacity: 0;
  transform: translate(-50%, calc(-50% + 28px)) scale(0.85);
  pointer-events: none;

  transition:
    opacity 260ms ease,
    transform 650ms ease;
}

.player-soul-canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.player-card:hover .player-portrait,
.player-card:focus-visible .player-portrait {
  opacity: 0.22;
}

.player-card:hover .player-soul,
.player-card:focus-visible .player-soul {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.player-card:focus-visible .portrait-stage {
  outline: 3px solid white;
  outline-offset: 8px;
}

@media (max-width: 600px) {
  :root {
    --card-size: clamp(68px, 20vw, 100px);
  }

  .site-intro-logo-stage {
    width: 90vw;
    max-height: 70vh;
  }

  .roster-countdown {
    margin-bottom: 18px;
    font-size: clamp(32px, 10vw, 54px);
    letter-spacing: 0.01em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-intro {
    transition-duration: 250ms;
  }

  .site-intro-logo {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .site-intro.is-exiting .site-intro-logo-stage {
    transform: none;
  }

  .player-portrait,
  .player-soul {
    transition: none;
  }

  html.impact-shake body {
    animation-duration: 500ms;
  }
}
