/* Colourful Language on the big screen: the live board. Stage pixels (see 16_main_shell.css).
   Header (game, round and speaker, countdown ring), the square spectrum board with pins, scoring rings and
   the target diamond, and the right column: clue, note, four-step phase bar, leaderboard.
   Pins, rings and the target are painted by colourful_language_board_controller.js into .gtf-cl__layer. */

.gtf-cl-screen {
  --cl-purple: oklch(0.78 0.16 285);
  --cl-hot: oklch(0.72 0.19 40);
  --cl-track: #3A322A;
  --cl-done: #6B5F52;
}

/* The shell's body padding is handled by .gtf-cl itself so the header can sit in the same box. */
.gtf-cl-screen .gtf-screen__body {
  inset: 0;
}

.gtf-cl {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 28px;
  padding: calc(160px * var(--gtf-m, 1)) var(--gtf-board-pad) 40px;
}

/* ---------- Header ---------- */

.gtf-cl__name {
  color: var(--cl-purple);
}

.gtf-cl__round {
  display: flex;
  align-items: center;
  gap: 28px;
}

.gtf-cl__round-text {
  text-align: right;
}

.gtf-cl__clock {
  --clock-deg: 0deg;
  flex: none;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: conic-gradient(var(--cl-purple) var(--clock-deg), var(--cl-track) 0);

  &.is-low {
    background: conic-gradient(var(--cl-hot) var(--clock-deg), var(--cl-track) 0);

    & .gtf-cl__clock-face {
      color: var(--cl-hot);
    }
  }
}

.gtf-cl__clock-face {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--gtf-ink);
  font-family: var(--gtf-mono);
  font-size: 30px;
  color: var(--gtf-cream);
}

/* ---------- Board ---------- */

/* Square, as tall as the stage body, but never so wide that the right column drops under 480px. */
.gtf-cl__board {
  position: relative;
  align-self: start;
  height: min(100%, calc(var(--gtf-stage-w, 1920px) - 156px - 480px));
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
}

.gtf-cl__canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.gtf-cl__layer {
  --cl-pin: 44px;
  position: absolute;
  inset: 0;
}

.gtf-cl__ring {
  position: absolute;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 3px solid var(--gtf-cream);
  pointer-events: none;
}

.gtf-cl__ring--1 { border-color: var(--gtf-teal); }
.gtf-cl__ring--2 { border-color: var(--gtf-yellow); }

.gtf-cl__pin {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transform: translate(-50%, -50%);
}

.gtf-cl__pin-dot {
  display: grid;
  place-items: center;
  width: var(--cl-pin);
  height: var(--cl-pin);
  border-radius: 50%;
  border: 3px solid var(--gtf-cream);
  box-shadow: 0 0 0 2px var(--gtf-ink);
  overflow: hidden;
  background: var(--gtf-cream);
  color: var(--gtf-ink);
  font-size: calc(var(--cl-pin) * 0.32);
  font-weight: 900;

  & img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

.gtf-cl__layer.is-dense .gtf-cl__pin-dot {
  border-width: 2px;
  box-shadow: 0 0 0 1px var(--gtf-ink);
  font-size: 0;
}

.gtf-cl__layer.is-dense .gtf-cl__pin-dot img {
  display: none;
}

.gtf-cl__pin-pts {
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--gtf-ink);
  color: var(--gtf-cream);
  font-family: var(--gtf-mono);
  font-size: 16px;
  white-space: nowrap;
}

.gtf-cl__target {
  position: absolute;
  width: 34px;
  height: 34px;
  transform: translate(-50%, -50%) rotate(45deg);
  border: 4px solid var(--gtf-cream);
  box-shadow: 0 0 0 2px var(--gtf-ink);
}

.gtf-cl__banner {
  position: absolute;
  left: 50%;
  bottom: 7%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 86%;
  padding: 16px 26px;
  border-radius: 12px;
  background: var(--gtf-ink);
  font-size: 26px;
  font-weight: 800;
  text-align: center;
}

/* ---------- Right column ---------- */

.gtf-cl__side {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
  min-height: 0;
}

.gtf-cl__clue-label {
  padding-bottom: 4px;
  font-size: 16px;
  font-weight: 600;
  color: var(--gtf-text-2);
}

.gtf-cl__clue-text {
  font-size: clamp(44px, calc(var(--gtf-stage-w, 1920px) * 0.054), 88px);
  line-height: 1;
  letter-spacing: -0.03em;
  font-weight: 900;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.gtf-cl__note {
  margin-top: 12px;
  font-size: 20px;
  line-height: 1.4;
  color: var(--gtf-text-2);
}

.gtf-cl__phases {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.gtf-cl__phase-bar {
  display: block;
  height: 8px;
  border-radius: 4px;
  background: var(--gtf-surface-2);
}

.gtf-cl__phase-label {
  display: block;
  padding-top: 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--gtf-text-2);
}

.gtf-cl__phase.is-done .gtf-cl__phase-bar { background: var(--cl-done); }

.gtf-cl__phase.is-current {
  & .gtf-cl__phase-bar { background: var(--cl-purple); }
  & .gtf-cl__phase-label { color: var(--gtf-cream); }
}

/* ---------- Leaderboard ---------- */

.gtf-cl__leaders {
  min-height: 0;
}

.gtf-cl__leaders-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 8px;

  & h2 {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: normal;
  }
}

.gtf-cl__locked {
  font-family: var(--gtf-mono);
  font-size: 16px;
  color: var(--gtf-text-2);
}

.gtf-cl__row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 0;
  border-top: 2px solid var(--gtf-surface-2);
}

.gtf-cl__row[hidden],
.gtf-cl__more[hidden] { display: none; }

.gtf-cl__rank {
  width: 28px;
  flex: none;
  font-size: 18px;
  font-weight: 900;

  &.is-first { color: var(--gtf-yellow); }
}

.gtf-cl__tile {
  flex: none;
  display: inline-flex;

  & .avatar-component {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  & .avatar-component__initials { font-size: 15px; }
}

.gtf-cl__who {
  flex: 1;
  min-width: 0;
  font-size: 20px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gtf-cl__tag {
  font-size: 16px;
  color: var(--gtf-text-2);

  &.is-gain { color: var(--gtf-success); }
}

.gtf-cl__total {
  width: 64px;
  text-align: right;
  font-family: var(--gtf-mono);
  font-size: 22px;
}

.gtf-cl__more {
  padding-top: 10px;
  border-top: 2px solid var(--gtf-surface-2);
  font-size: 18px;
  color: var(--gtf-text-2);
}

/* The round / speaker block and the timer ring are taller than the slim header the boards share, so give
   Colourful Language a little more header room and push the board down to match. */
.gtf-cl-screen .gtf-screen__header {
  height: calc(150px * var(--gtf-m, 1));
  padding-top: calc(20px * var(--gtf-m, 1));
}
