:root {
  --black: #000000;
  --surface: #2d2d2d;
  --white: #ffffff;
  --muted: #949494;
  --now: #22f393;
  --next: #d7b7ff;
  --ended: #949494;
  --desktop-unit: min(0.0520833333vw, 0.0925925926vh);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  color: var(--white);
  background: var(--black);
  font-family:
    "TT Norms Pro",
    "Avenir Next",
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

button {
  font: inherit;
}

.app {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--black);
}

.schedule-stage {
  width: calc(1920 * var(--desktop-unit));
  height: calc(1080 * var(--desktop-unit));
  position: relative;
  flex: none;
  overflow: hidden;
  background: var(--black);
}

.academy-header {
  width: 100%;
  height: calc(130 * var(--desktop-unit));
  position: absolute;
  inset: 0 0 auto;
}

.academy-identity {
  position: absolute;
  top: calc(30 * var(--desktop-unit));
  left: calc(48 * var(--desktop-unit));
  display: flex;
  align-items: center;
  gap: calc(20 * var(--desktop-unit));
}

.academy-logo {
  width: calc(70 * var(--desktop-unit));
  height: calc(70 * var(--desktop-unit));
  display: block;
  flex: none;
  border-radius: calc(24 * var(--desktop-unit));
  object-fit: cover;
}

.academy-name,
.current-time,
.current-date {
  margin: 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: calc(35 * var(--desktop-unit));
  font-weight: 500;
  line-height: calc(40 * var(--desktop-unit));
}

.current-time {
  width: calc(304 * var(--desktop-unit));
  position: absolute;
  top: calc(45 * var(--desktop-unit));
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}

.current-date {
  width: calc(360 * var(--desktop-unit));
  position: absolute;
  top: calc(45 * var(--desktop-unit));
  right: calc(48 * var(--desktop-unit));
  text-align: right;
}

.featured-card {
  width: calc(1826 * var(--desktop-unit));
  height: calc(574 * var(--desktop-unit));
  position: absolute;
  top: calc(130 * var(--desktop-unit));
  left: calc(48 * var(--desktop-unit));
  display: grid;
  grid-template-columns: calc(574 * var(--desktop-unit)) minmax(0, 1fr);
  grid-template-areas: "qr info";
  overflow: hidden;
  border-radius: calc(64 * var(--desktop-unit));
  background: var(--surface);
  transition: top 260ms ease;
}

.schedule-stage.is-single .featured-card {
  top: calc(318 * var(--desktop-unit));
}

.featured-qr-panel {
  grid-area: qr;
  display: grid;
  place-items: center;
}

.featured-qr-panel,
.featured-info {
  transition:
    opacity 220ms ease,
    transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.featured-card.is-leaving .featured-qr-panel,
.featured-card.is-leaving .featured-info {
  opacity: 0;
  transform: translateX(calc(-22 * var(--desktop-unit)));
}

.featured-card.is-leaving.is-reversing .featured-qr-panel,
.featured-card.is-leaving.is-reversing .featured-info {
  transform: translateX(calc(22 * var(--desktop-unit)));
}

.featured-card.is-entering .featured-qr-panel,
.featured-card.is-entering .featured-info {
  opacity: 0;
  transform: translateX(calc(22 * var(--desktop-unit)));
  transition: none;
}

.featured-card.is-entering.is-reversing .featured-qr-panel,
.featured-card.is-entering.is-reversing .featured-info {
  transform: translateX(calc(-22 * var(--desktop-unit)));
}

.qr-shell {
  width: calc(494 * var(--desktop-unit));
  height: calc(494 * var(--desktop-unit));
  padding: calc(22 * var(--desktop-unit));
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: calc(24 * var(--desktop-unit));
  background: var(--white);
}

.qr-code {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.qr-code canvas,
.qr-code img,
.qr-code svg {
  width: 100% !important;
  height: 100% !important;
  display: block;
  image-rendering: pixelated;
}

.featured-info {
  grid-area: info;
  min-width: 0;
  padding: calc(40 * var(--desktop-unit));
  display: flex;
  flex-direction: column;
  gap: calc(80 * var(--desktop-unit));
}

.featured-topline {
  min-height: calc(80 * var(--desktop-unit));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(40 * var(--desktop-unit));
}

.status-pill {
  min-width: calc(150 * var(--desktop-unit));
  height: calc(80 * var(--desktop-unit));
  padding: 0 calc(32 * var(--desktop-unit));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  border: 0;
  border-radius: calc(50 * var(--desktop-unit));
  color: var(--black);
  font-size: calc(40 * var(--desktop-unit));
  font-weight: 500;
  line-height: 1;
}

.status-pill[data-status="now"] {
  background: var(--now);
}

.status-pill[data-status="next"] {
  background: var(--next);
}

.status-pill[data-status="ended"] {
  background: var(--ended);
}

.coach {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: calc(21 * var(--desktop-unit));
}

.coach-name {
  overflow: hidden;
  color: var(--white);
  font-size: calc(35 * var(--desktop-unit));
  font-weight: 500;
  line-height: calc(40 * var(--desktop-unit));
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coach-avatar {
  width: calc(80 * var(--desktop-unit));
  height: calc(80 * var(--desktop-unit));
  display: block;
  flex: none;
  border-radius: calc(24 * var(--desktop-unit));
  object-fit: cover;
  background: #111111;
}

.coach[hidden],
.coach-avatar[hidden] {
  display: none;
}

.featured-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: calc(40 * var(--desktop-unit));
}

.featured-time,
.featured-title {
  width: 100%;
  margin: 0;
  color: var(--white);
  font-size: calc(88 * var(--desktop-unit));
  line-height: calc(96 * var(--desktop-unit));
}

.featured-time {
  font-weight: 700;
}

.featured-title {
  max-width: 100%;
  display: -webkit-box;
  overflow: hidden;
  font-weight: 500;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.schedule-grid {
  width: calc(1748 * var(--desktop-unit));
  height: calc(320 * var(--desktop-unit));
  position: absolute;
  top: calc(724 * var(--desktop-unit));
  left: calc(86 * var(--desktop-unit));
  display: block;
  overflow: hidden;
}

.schedule-stage.is-single .schedule-grid {
  display: none;
}

.schedule-pages {
  width: 100%;
  display: flex;
  flex-direction: column;
  transform: translateY(var(--schedule-offset, 0));
  transition: transform 760ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.schedule-pages.is-resetting {
  transition: none;
}

.schedule-page {
  width: 100%;
  height: calc(320 * var(--desktop-unit));
  position: relative;
  display: grid;
  flex: none;
  grid-template-columns: repeat(var(--schedule-columns, 3), minmax(0, 1fr));
  grid-template-rows: repeat(2, calc(160 * var(--desktop-unit)));
  grid-auto-flow: row;
}

.schedule-highlight {
  width: var(--highlight-width, 33.333333%);
  height: calc(160 * var(--desktop-unit));
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  overflow: hidden;
  border-radius: calc(24 * var(--desktop-unit));
  background: var(--surface);
  pointer-events: none;
  transform: translate(var(--active-x, 0%), var(--active-y, 0%));
  transition: transform 620ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.schedule-highlight.is-resetting {
  transition: none;
}

.schedule-item {
  min-width: 0;
  height: calc(160 * var(--desktop-unit));
  position: relative;
  z-index: 1;
  padding: calc(35 * var(--desktop-unit)) calc(40 * var(--desktop-unit));
  overflow: hidden;
  border: 0;
  border-radius: calc(24 * var(--desktop-unit));
  color: rgba(255, 255, 255, 0.6);
  background: transparent;
  text-align: left;
  cursor: pointer;
  appearance: none;
  transition:
    padding 500ms cubic-bezier(0.22, 1, 0.36, 1),
    color 220ms ease;
}

.schedule-item:hover,
.schedule-item:focus-visible {
  color: var(--white);
  outline: none;
}

.schedule-item.is-active {
  padding-top: calc(25 * var(--desktop-unit));
  padding-bottom: calc(45 * var(--desktop-unit));
  color: var(--white);
}

.schedule-item__line {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: calc(10 * var(--desktop-unit));
  overflow: hidden;
}

.schedule-item__dot {
  width: calc(22 * var(--desktop-unit));
  height: calc(22 * var(--desktop-unit));
  flex: none;
  border-radius: 50%;
  background: var(--item-color, var(--muted));
}

.schedule-item__time,
.schedule-item__title {
  max-width: 100%;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: inherit;
  font-size: calc(35 * var(--desktop-unit));
  line-height: calc(40 * var(--desktop-unit));
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-item__time {
  display: block;
  flex: 1;
  font-weight: 700;
}

.schedule-item__title {
  width: 100%;
  display: block;
  margin-top: calc(10 * var(--desktop-unit));
  padding-left: calc(32 * var(--desktop-unit));
  font-weight: 500;
}

.slide-progress {
  width: 100%;
  height: calc(20 * var(--desktop-unit));
  position: absolute;
  bottom: 0;
  left: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.2);
}

.featured-card > .slide-progress {
  display: none;
}

.slide-progress::after {
  width: 0;
  height: 100%;
  display: block;
  background: rgba(255, 255, 255, 0.42);
  content: "";
  animation: slide-progress var(--slide-duration, 10000ms) linear forwards;
}

.mobile-pagination {
  display: none;
}

.empty-state {
  width: min(440px, calc(100vw - 32px));
  min-height: 100dvh;
  margin: auto;
  display: grid;
  place-content: center;
  gap: 20px;
  color: var(--white);
  text-align: center;
}

.empty-state .academy-logo {
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
  border-radius: 20px;
}

.empty-state h1,
.empty-state p {
  margin: 0;
}

.empty-state h1 {
  font-size: 40px;
}

.empty-state p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 18px;
  line-height: 1.5;
}

.loading-spinner {
  width: 52px;
  height: 52px;
  margin: 0 auto 8px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--now);
  border-radius: 50%;
  animation: loading-spin 800ms linear infinite;
}

@keyframes loading-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes slide-progress {
  to {
    width: 100%;
  }
}

@media (max-width: 767px) {
  body {
    overflow-y: auto;
  }

  .app {
    min-height: 100dvh;
    place-items: start center;
  }

  .schedule-stage {
    width: 100%;
    min-height: 100dvh;
    height: auto;
    overflow: visible;
  }

  .academy-header {
    height: 72px;
    position: relative;
  }

  .academy-identity {
    top: 8px;
    left: 50%;
    gap: 16px;
    transform: translateX(-50%);
  }

  .academy-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
  }

  .academy-name {
    max-width: calc(100vw - 104px);
    color: var(--white);
    font-size: 20px;
    line-height: 26px;
    white-space: nowrap;
  }

  .current-time,
  .current-date {
    display: none;
  }

  .featured-card,
  .schedule-stage.is-single .featured-card {
    width: min(359px, calc(100vw - 16px));
    height: 547px;
    position: relative;
    top: auto;
    left: auto;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-top: 24px;
    border-radius: 24px;
  }

  .featured-info {
    display: contents;
  }

  .featured-topline,
  .featured-copy {
    transition:
      opacity 220ms ease,
      transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
  }

  .featured-card.is-leaving .featured-qr-panel,
  .featured-card.is-leaving .featured-topline,
  .featured-card.is-leaving .featured-copy {
    opacity: 0;
    transform: translateX(-14px);
  }

  .featured-card.is-leaving.is-reversing .featured-qr-panel,
  .featured-card.is-leaving.is-reversing .featured-topline,
  .featured-card.is-leaving.is-reversing .featured-copy {
    transform: translateX(14px);
  }

  .featured-card.is-entering .featured-qr-panel,
  .featured-card.is-entering .featured-topline,
  .featured-card.is-entering .featured-copy {
    opacity: 0;
    transform: translateX(14px);
    transition: none;
  }

  .featured-card.is-entering.is-reversing .featured-qr-panel,
  .featured-card.is-entering.is-reversing .featured-topline,
  .featured-card.is-entering.is-reversing .featured-copy {
    transform: translateX(-14px);
  }

  .featured-copy {
    height: 124px;
    padding: 0 16px;
    order: 1;
    gap: 4px;
    text-align: center;
  }

  .featured-time,
  .featured-title {
    font-size: clamp(27px, 8.53vw, 32px);
    line-height: 40px;
  }

  .featured-title {
    -webkit-line-clamp: 2;
  }

  .featured-qr-panel {
    width: 275px;
    height: 275px;
    margin: 0 auto;
    order: 2;
  }

  .qr-shell {
    width: 275px;
    height: 275px;
    padding: 10px;
    border-radius: 10px;
  }

  .featured-topline {
    min-height: 42px;
    padding: 0 16px;
    display: flex;
    justify-content: center;
    order: 3;
  }

  .status-pill {
    min-width: 107px;
    height: 42px;
    padding: 0 32px;
    border-radius: 50px;
    font-size: 20px;
  }

  .coach {
    display: none;
  }

  .slide-progress {
    height: 10px;
  }

  .featured-card > .slide-progress {
    display: block;
  }

  .schedule-stage.is-single .featured-card > .slide-progress {
    display: none;
  }

  .schedule-grid {
    display: none;
  }

  .mobile-pagination {
    height: 48px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 8px;
    padding-top: 12px;
  }

  .pagination-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
  }

  .pagination-dot.is-active {
    background: var(--white);
  }
}

@media (max-width: 340px) {
  .featured-card,
  .schedule-stage.is-single .featured-card {
    height: 503px;
    gap: 18px;
    padding-top: 18px;
  }

  .featured-copy {
    height: 112px;
  }

  .featured-time,
  .featured-title {
    font-size: 27px;
    line-height: 36px;
  }

  .featured-qr-panel,
  .qr-shell {
    width: 245px;
    height: 245px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .featured-card {
    transition: none;
  }

  .schedule-highlight,
  .schedule-pages,
  .schedule-item,
  .featured-qr-panel,
  .featured-info,
  .featured-topline,
  .featured-copy {
    transition: none;
  }

  .slide-progress::after {
    animation: none;
    width: 100%;
  }
}
