/* Main-screen shell: the big shared screen (TV, projector, Zoom share) for the non-gameplay stages:
   lobby, up next, between games, top three, final leaderboard. Sizes are in "stage pixels": the stage
   is a canvas (1280-1920px wide, scale 1 in between; stage-scale sets --gtf-stage-w). Gameplay boards keep their own
   styles and are not inside .gtf-screen yet. */

:root {
  --gtf-silver: #CFC4B2;
  --gtf-bronze: #C99A68;
  --gtf-bronze: oklch(0.75 0.1 60);
}

/* Same base as body.gtf, scoped to the stage so it also works when a page sets its own body theme (game boards, game night nested screens) */
.gtf-screen {
  position: fixed;
  inset: 0;
  z-index: 5;
  overflow: hidden;
  background: var(--gtf-ink);
  color: var(--gtf-cream);
  font-family: var(--gtf-font);
  line-height: 1.2;
  -webkit-font-smoothing: antialiased;

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

  :where(h1, h2, h3, p, ul, ol) {
    margin: 0;
    padding: 0;
  }

  :where(h1, h2, h3) {
    font-weight: 900;
    letter-spacing: -0.03em;
  }

  :where(ul, ol) {
    list-style: none;
  }

  :where(a) {
    color: var(--gtf-yellow);
    text-decoration: none;
  }
}

.gtf-screen__stage {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--gtf-stage-w, 1920px);
  height: var(--gtf-stage-h, 1080px);
  transform: scale(var(--gtf-scale, 1));
  transform-origin: 0 0;
  overflow: hidden;
}

.gtf-screen__header {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  height: 150px;
  padding: 0 64px;
  background: var(--gtf-ink);
  zoom: var(--gtf-m, 1);
}

.gtf-screen__brand {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
}

.gtf-screen__icon {
  flex: none;
  display: inline-flex;
}

.gtf-screen__title {
  font-size: 48px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.gtf-screen__stage-title {
  text-align: right;
}

.gtf-screen__heading {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.gtf-screen__sub {
  font-size: 28px;
  font-weight: 600;
  color: var(--gtf-text-2);
}

/* Stages drawn on a 1920x1080 canvas zoom down (--gtf-m, set by stage-scale) only when the window is short.
   Fluid screens (lobby, boards) opt out below and size their own vertical chrome with the same factor. */
.gtf-screen__body {
  position: absolute;
  inset: 170px 64px 56px 64px;
  z-index: 1;
  zoom: var(--gtf-m, 1);
}

.gtf-hol-screen .gtf-screen__body,
.gtf-cl-screen .gtf-screen__body,
.gtf-hxs-screen .gtf-screen__body {
  zoom: 1;
  /* The designs have no header band: content sits under a slim brand row, with the design's 4vw side padding. */
  inset: calc(120px * var(--gtf-m, 1)) var(--gtf-board-pad) 40px var(--gtf-board-pad);
}

.gtf-hol-screen .gtf-screen__header,
.gtf-cl-screen .gtf-screen__header,
.gtf-hxs-screen .gtf-screen__header {
  height: calc(104px * var(--gtf-m, 1));
  padding: 0 var(--gtf-board-pad);
  zoom: 1;
}

.gtf-hol-screen,
.gtf-cl-screen,
.gtf-hxs-screen {
  --gtf-board-pad: clamp(20px, calc(var(--gtf-stage-w, 1920px) * 0.04), 56px);
}

/* ---------- Message ---------- */

.gtf-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  height: 100%;
  text-align: center;
}

.gtf-message__title {
  max-width: 1400px;
  font-size: 104px;
  line-height: 1.05;
}

.gtf-message__sub {
  max-width: 1200px;
  font-size: 44px;
  line-height: 1.3;
  color: var(--gtf-text-2);
}

/* ---------- Up next ---------- */

.gtf-upnext {
  display: flex;
  flex-direction: column;
  gap: 44px;
  max-width: 1500px;
}

.gtf-upnext__head {
  display: flex;
  align-items: center;
  gap: 44px;
}

.gtf-upnext__label {
  font-size: 40px;
  font-weight: 600;
  color: var(--gtf-text-2);
}

.gtf-upnext__name {
  font-size: 132px;
  line-height: 1;
}

.gtf-upnext__summary {
  font-size: 48px;
  line-height: 1.25;
}

.gtf-upnext__rules {
  display: flex;
  flex-direction: column;
  gap: 20px;
  counter-reset: rule;
  font-size: 38px;
  line-height: 1.3;
  color: var(--gtf-text-2);

  & li {
    display: flex;
    gap: 24px;
    counter-increment: rule;
  }

  & li::before {
    content: counter(rule);
    flex: none;
    width: 52px;
    font-family: var(--gtf-mono);
    color: var(--gtf-yellow);
  }
}

/* ---------- Top three ---------- */

.gtf-podium {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 32px;
  height: 100%;
}

.gtf-podium__fireworks {
  /* fixed inside the transformed stage = the whole stage, whatever the body's zoom */
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.gtf-podium__title {
  text-align: center;
  font-size: 72px;
}

.gtf-podium__places {
  flex: 1;
  display: grid;
  gap: 48px;
  align-items: end;
  grid-template-columns: 1fr 1.25fr 1fr;
}

.gtf-podium__places--2 { grid-template-columns: 1fr 1fr; }
.gtf-podium__places--1 { grid-template-columns: 1fr; justify-items: center; }

.gtf-podium__place {
  --tone: var(--gtf-text-2);
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 420px;
  padding-top: 28px;
  border-top: 8px solid var(--tone);
  transition: opacity 0.6s, transform 0.6s;
}

.gtf-podium__place--1 { --tone: var(--gtf-yellow); min-height: 620px; }
.gtf-podium__place--2 { --tone: var(--gtf-silver); min-height: 520px; }
.gtf-podium__place--3 { --tone: var(--gtf-bronze); min-height: 440px; }

.gtf-podium[data-ready] .gtf-podium__place:not(.is-shown) {
  opacity: 0;
  transform: translateY(48px);
}

.gtf-podium__rank {
  font-size: 110px;
  line-height: 1;
  font-weight: 900;
  color: var(--tone);
}

.gtf-podium__place--1 .gtf-podium__rank { font-size: 160px; }

.gtf-podium__avatar {
  display: inline-flex;
  transform-origin: left center;
  transform: scale(1.6);
  margin: 20px 0 28px 20px;
}

.gtf-podium__place--1 .gtf-podium__avatar { transform: scale(2.1); margin: 32px 0 44px 32px; }

.gtf-podium__name {
  font-size: 60px;
  font-weight: 900;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.gtf-podium__value {
  font-size: 48px;
  color: var(--tone);
}

.gtf-podium__sub {
  font-size: 30px;
  color: var(--gtf-text-2);
}

/* ---------- Final leaderboard ---------- */

.gtf-board {
  position: absolute;
  inset: -20px -64px -56px -64px;
  overflow: hidden;
}

.gtf-board__head {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 2;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  height: 90px;
  padding: 0 64px;
  background: var(--gtf-ink);
}

.gtf-board__title {
  font-size: 64px;
}

.gtf-board__subtitle {
  font-size: 32px;
  font-weight: 600;
  color: var(--gtf-text-2);
}

.gtf-board__viewport {
  position: absolute;
  inset: 90px 64px 0 64px;
  overflow: hidden;
}

.gtf-board__list {
  will-change: transform;
}

.gtf-board__row {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 104px;
  border-top: 2px solid var(--gtf-surface-2);
}

.gtf-board__place {
  width: 80px;
  font-family: var(--gtf-mono);
  font-size: 40px;
  color: var(--gtf-text-2);
}

.gtf-board__place--1 { color: var(--gtf-yellow); }
.gtf-board__place--2 { color: var(--gtf-silver); }
.gtf-board__place--3 { color: var(--gtf-bronze); }

.gtf-board__avatar {
  flex: none;
  display: inline-flex;
}

/* The design's 64px initials tile on the big screen. */
.gtf-board__avatar .avatar-component {
  width: 64px;
  height: 64px;
  flex-basis: 64px;
}

.gtf-board__avatar .avatar-component__initials { font-size: 26px; }

.gtf-board__name {
  flex: 1;
  min-width: 0;
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gtf-board__delta {
  width: 160px;
  font-size: 34px;
  text-align: right;
}

.gtf-board__value {
  flex: none;
  min-width: 260px;
  font-size: 48px;
  text-align: right;
  white-space: nowrap;
}

/* No change column when no row has one (the final leaderboard). */
.gtf-board__delta:empty {
  display: none;
}

.gtf-board__end {
  height: 120px;
}

/* ---------- Two-column layouts (message + side panel) ---------- */

.gtf-screen-split {
  display: grid;
  grid-template-columns: 1fr 560px;
  gap: 96px;
  height: 100%;
  align-items: start;
}

/* Message, night standings and the join card side by side (intermission with the leaders showing). */
.gtf-screen-split--three {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 520px;
  gap: 56px;
}

.gtf-screen-split > .gtf-message {
  align-items: flex-start;
  text-align: left;
  justify-content: flex-start;
  padding-top: 80px;
}

.gtf-screen-side {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.gtf-screen-side__count {
  font-family: var(--gtf-mono);
  font-size: 30px;
  color: var(--gtf-text-2);
}

.gtf-screen-leaders__title {
  margin-bottom: 20px;
  font-size: 56px;
}

.gtf-screen-leaders__row {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 88px;
  border-top: 2px solid var(--gtf-surface-2);
}

.gtf-screen-leaders__place {
  width: 56px;
  font-family: var(--gtf-mono);
  font-size: 36px;
  color: var(--gtf-text-2);
}

.gtf-screen-leaders__avatar {
  display: inline-flex;
}

.gtf-screen-leaders__name {
  flex: 1;
  min-width: 0;
  font-size: 40px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gtf-screen-leaders__points {
  font-size: 36px;
}

.gtf-screen-leaders__empty {
  font-size: 36px;
  color: var(--gtf-text-2);
}
