* {
  box-sizing: border-box;
}

@font-face {
  font-family: "xxQueen Basic";
  src: url("https://jamminstein.github.io/tiago-lol/assets/fonts/xxqueen-basic.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: #000;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  overflow-x: hidden;
}

.tiago-portal-nav {
  position: fixed;
  top: 12px;
  left: 50%;
  right: auto;
  z-index: 2147483647;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.35rem;
  width: max-content;
  max-width: calc(100vw - 24px);
  padding: 8px 15px 7px;
  box-sizing: border-box;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  color: #fff;
  font-family: "xxQueen Basic", serif;
  font-size: 12px;
  font-style: normal;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: lowercase;
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .tiago-portal-nav {
    background: rgba(0, 0, 0, 0.92);
  }
}

.tiago-portal-nav a,
.tiago-portal-nav a:visited {
  color: #fff;
  text-decoration: none;
  opacity: 1;
  transition: opacity 140ms ease;
}

.tiago-portal-nav a:hover,
.tiago-portal-nav a:focus-visible {
  opacity: 0.62;
}

.tiago-portal-nav a:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 2px;
}

button,
input {
  font: inherit;
}

.video-grid {
  display: grid;
  width: 100%;
  min-height: 100dvh;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2px;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
    env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: #000;
  transition: padding-bottom 180ms ease;
}

.has-transport .video-grid {
  padding-bottom: calc(78px + env(safe-area-inset-bottom));
}

.video-tile {
  position: relative;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  aspect-ratio: 16 / 9;
  background: #080808;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.video-tile img,
.video-tile video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.video-tile video {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 180ms ease;
}

.video-tile.preview-ready video {
  opacity: 1;
}

.video-tile img {
  -webkit-user-drag: none;
}

.clip-id {
  position: absolute;
  right: 4px;
  bottom: 3px;
  z-index: 1;
  color: rgb(255 255 255 / 0.4);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-shadow: 0 0 2px #000;
  pointer-events: none;
}

.video-tile:focus-visible {
  z-index: 1;
  outline: 3px solid #fff;
  outline-offset: -3px;
}

.tile-play {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  width: clamp(30px, 4vw, 48px);
  aspect-ratio: 1;
  border: 1px solid rgb(255 255 255 / 50%);
  border-radius: 50%;
  background: rgb(0 0 0 / 58%);
  box-shadow: 0 3px 18px rgb(0 0 0 / 35%);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.9);
  transition: opacity 140ms ease, transform 140ms ease;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.tile-play::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 53%;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 10px solid #fff;
  transform: translate(-50%, -50%);
}

.video-tile:is(:hover, :focus-visible) .tile-play,
.video-tile.is-active .tile-play {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.video-tile.is-active .tile-play::before {
  left: 50%;
  width: 4px;
  height: 13px;
  border: 0;
  border-right: 4px solid #fff;
  border-left: 4px solid #fff;
  transform: translate(-50%, -50%);
}

.media-host {
  position: fixed;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.transport {
  position: fixed;
  z-index: 10;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(10px, env(safe-area-inset-bottom));
  left: max(12px, env(safe-area-inset-left));
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 8px 10px;
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: 18px;
  background: rgb(12 12 12 / 84%);
  box-shadow: 0 10px 35px rgb(0 0 0 / 48%);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.transport[hidden] {
  display: none;
}

.transport-button {
  position: relative;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.transport-button:is(:hover, :focus-visible) {
  background: rgb(255 255 255 / 12%);
  outline: none;
}

.transport-toggle span::before,
.transport-toggle span::after {
  content: "";
  position: absolute;
  top: 12px;
  width: 4px;
  height: 14px;
  border-radius: 1px;
  background: currentColor;
}

.transport-toggle span::before {
  left: 13px;
}

.transport-toggle span::after {
  right: 13px;
}

.transport-toggle.is-paused span::before {
  top: 11px;
  left: 15px;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 12px solid currentColor;
  border-radius: 0;
  background: transparent;
}

.transport-toggle.is-paused span::after {
  display: none;
}

.transport-next span::before {
  content: "";
  position: absolute;
  top: 11px;
  left: 12px;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 11px solid currentColor;
}

.transport-next span::after {
  content: "";
  position: absolute;
  top: 11px;
  right: 11px;
  width: 3px;
  height: 16px;
  border-radius: 1px;
  background: currentColor;
}

.timeline-shell {
  position: relative;
  width: 100%;
  min-width: 0;
  height: 34px;
}

.waveform {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.timeline {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 34px;
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  touch-action: manipulation;
  --progress: 0%;
}

.timeline::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(to right, #fff 0 var(--progress), rgb(255 255 255 / 25%) var(--progress) 100%);
}

.timeline::-moz-range-track {
  height: 3px;
  border-radius: 2px;
  background: rgb(255 255 255 / 25%);
}

.timeline::-moz-range-progress {
  height: 3px;
  border-radius: 2px;
  background: #fff;
}

.timeline::-webkit-slider-thumb {
  width: 12px;
  height: 12px;
  margin-top: -4.5px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  appearance: none;
  -webkit-appearance: none;
}

.timeline::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: #fff;
}

@media (hover: none) {
  .video-tile:not(.is-active) .tile-play {
    opacity: 0.46;
    transform: translate(-50%, -50%) scale(0.82);
  }
}

@media (max-width: 1000px) {
  .video-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .video-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
  }

  .video-tile:focus-visible {
    outline-width: 2px;
  }

  .transport {
    right: max(7px, env(safe-area-inset-right));
    bottom: max(7px, env(safe-area-inset-bottom));
    left: max(7px, env(safe-area-inset-left));
    grid-template-columns: 36px minmax(0, 1fr) 36px;
    gap: 7px;
    min-height: 50px;
    padding: 6px 7px;
    border-radius: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tiago-portal-nav a,
  .video-grid,
  .video-tile video,
  .tile-play {
    transition: none;
  }
}
