/* Episode tracker on the left wall's board -- see tracker.js. Sizes are
   in cqw (1% of the board's width) so it scales with the artwork. */

.tk-layer {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease;
  font-family: "Londrina Solid", system-ui, sans-serif;
}
.tk-layer.is-on {
  opacity: 1;
}
.tk-layer.is-on .tk-board {
  pointer-events: auto;
}

.tk-board {
  position: absolute;
  container-type: size;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 2.4cqw 4.5cqw 3cqw;
  gap: 1.8cqw;
  color: #eef7ff;
  /* a dim display glow over the blank board */
  background: radial-gradient(ellipse at 50% 40%, rgba(120, 230, 255, 0.16), rgba(20, 16, 40, 0.38));
}

/* header: < Season 1 > */
.tk-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3cqw;
}
.tk-title {
  margin: 0;
  min-width: 26cqw;
  text-align: center;
  font-size: 5.2cqw;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 0 1.2cqw rgba(126, 240, 255, 0.6);
}
.tk-arrow,
.tk-back {
  font: inherit;
  cursor: pointer;
  border: 0.3cqw solid rgba(126, 240, 255, 0.7);
  background: rgba(20, 16, 40, 0.55);
  color: #fff;
  border-radius: 1.2cqw;
}
.tk-arrow {
  width: 5.5cqw;
  height: 5.5cqw;
  font-size: 4.6cqw;
  line-height: 1;
  padding: 0 0 0.5cqw;
}
.tk-arrow:disabled {
  opacity: 0.25;
  cursor: default;
}
.tk-arrow:not(:disabled):hover,
.tk-back:hover {
  background: rgba(126, 240, 255, 0.25);
}

/* the 6 x 2 grid */
.tk-grid {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 1.6cqw;
  min-height: 0;
}
.tk-tile {
  position: relative;
  display: grid;
  place-items: center;
  padding: 0.8cqw;
  border: 0.3cqw solid rgba(0, 0, 0, 0.55);
  border-radius: 1.2cqw;
  background: #191426;
  box-shadow: inset 0 0 1.4cqw rgba(0, 0, 0, 0.6);
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: transform 0.12s ease;
}
.tk-tile:not(.is-locked):hover,
.tk-tile:focus-visible {
  outline: none;
  transform: scale(1.05);
}
.tk-tile.is-locked {
  cursor: default;
  background: #221b33;
}
.tk-tile .tk-icon {
  width: 82%;
  height: 82%;
  object-fit: contain;
}
.tk-tile.is-locked svg {
  width: 48%;
  filter: drop-shadow(0 0 0.8cqw rgba(126, 240, 255, 0.55));
}
.tk-badge {
  position: absolute;
  right: 0.6cqw;
  bottom: 0.6cqw;
  width: 3.4cqw;
}
.tk-badge svg {
  display: block;
  width: 100%;
}

/* the juice drop with a number on it (tiles and the episode view) */
.tk-drop {
  position: relative;
  display: inline-block;
  width: 3.2cqw;
  aspect-ratio: 166 / 240;
}
.tk-drop img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.tk-drop b {
  position: absolute;
  left: 0;
  right: 0;
  top: 44%;
  text-align: center;
  font-weight: 900;
  font-size: 1.7cqw;
  line-height: 1;
  color: #fff;
  -webkit-text-stroke: 0.22cqw #1a3a10;
  paint-order: stroke fill;
}

.tk-soon {
  flex: 1 1 auto;
  display: grid;
  place-items: center;
  font-size: 5cqw;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  border: 0.35cqw dashed rgba(255, 255, 255, 0.2);
  border-radius: 1.6cqw;
}

/* ---- episode view ---- */
.tk-head-ep {
  justify-content: space-between;
}
.tk-back {
  font-size: 3cqw;
  padding: 0.8cqw 2.2cqw;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.tk-epnum {
  font-size: 3cqw;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}
.tk-ep {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: center;
  gap: 4cqw;
}
.tk-ep-title {
  width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0.5cqw 1cqw rgba(0, 0, 0, 0.4));
}
.tk-ep-side {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.8cqw;
}
.tk-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2cqw;
}
.tk-status {
  display: inline-flex;
  align-items: center;
  gap: 1cqw;
  font-size: 3.2cqw;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
}
.tk-status svg {
  width: 3.4cqw;
}
.tk-status.is-done {
  color: #b8f28a;
}
.tk-worth {
  display: inline-flex;
  align-items: center;
  gap: 1cqw;
  font-size: 2.4cqw;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
}
.tk-worth .tk-drop {
  width: 4.4cqw;
}
.tk-worth .tk-drop b {
  font-size: 2.3cqw;
}
.tk-btn {
  font: inherit;
  cursor: pointer;
  border: 0;
  border-radius: 1.4cqw;
  padding: 1.6cqw 2cqw;
  font-size: 3.6cqw;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #0c3b3f;
  background: #b8f28a;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5cqw;
}
.tk-btn:hover {
  background: #fff;
}
.tk-btn.is-trivia {
  background: #7ef0ff;
}
.tk-btn small {
  font-size: 2.2cqw;
  opacity: 0.75;
}
.tk-note {
  text-align: center;
  font-size: 2.6cqw;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

/* ---- trivia, full-screen over the lab ---- */
.tk-trivia {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  background: #0f0d19;
}
.tk-trivia.is-on {
  display: block;
}
.tk-trivia iframe {
  width: 100%;
  height: 100%;
  border: 0;
}
.tk-trivia-close {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  z-index: 1;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  background: #0f0d19cc;
  color: #fff;
  font-family: "Londrina Solid", system-ui, sans-serif;
  font-size: 18px;
  letter-spacing: 0.05em;
  cursor: pointer;
}

/* the juice drop sits in the tile's bottom-right corner (beats .tk-drop's
   inline positioning, which is for the episode view) */
.tk-tile .tk-badge.tk-drop {
  position: absolute;
  right: 0.5cqw;
  bottom: 0.5cqw;
  width: 3.4cqw;
}

/* episode view header, right side: "Episode N  [Next episode >]" */
.tk-epnav {
  display: inline-flex;
  align-items: center;
  gap: 2cqw;
}
.tk-back.tk-next:disabled {
  opacity: 0.3;
  cursor: default;
}

/* episode view actions: [ button ][ juice ] rows (watch, trivia) */
.tk-ep-side {
  gap: 2cqw;
}
.tk-act {
  display: flex;
  align-items: stretch;
  gap: 1.6cqw;
}
.tk-act .tk-btn {
  flex: 1 1 auto;
  min-height: 9cqw;
  border-radius: 0.6cqw;
  font-size: 3.8cqw;
  color: #fff;
  text-shadow: 0 0.25cqw 0 rgba(0, 0, 0, 0.25);
}
.tk-act .tk-btn.is-watch { background: #52b8c8; }
.tk-act .tk-btn.is-trivia { background: #f05f9a; }
.tk-act .tk-btn.is-watch:not(:disabled):hover { background: #6fd0de; }
.tk-act .tk-btn.is-trivia:not(:disabled):hover { background: #ff7fb1; }
.tk-act .tk-btn:disabled { cursor: default; }
.tk-act .tk-btn.is-watch:disabled { background: rgba(82, 184, 200, 0.45); }
.tk-act .tk-btn.is-trivia:disabled { background: rgba(240, 95, 154, 0.35); font-size: 3cqw; }
.tk-act .tk-btn small { font-size: 2.2cqw; opacity: 0.85; }
.tk-val {
  flex: 0 0 9cqw;
  display: grid;
  place-items: center;
  border-radius: 0.6cqw;
  background: rgba(255, 255, 255, 0.07);
}
.tk-val .tk-drop { width: 4.6cqw; }
.tk-val .tk-drop b { font-size: 2.4cqw; }
.tk-val > svg { width: 5cqw; }

/* ---- episode view: watch / trivia rows that open into info cards ----
   .tk-ep-side.is-watch:  trivia row folds away, the watch card opens
   .tk-ep-side.is-trivia: watch row folds away (trivia slides up), the
                          trivia card opens
   Rows and cards fold with max-height so the others slide into place. */
.tk-ep-side {
  gap: 0;
}
.tk-act,
.tk-card {
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.3s ease, margin 0.4s ease;
}
.tk-act {
  max-height: 12cqw;
  margin-bottom: 1.8cqw;
}
.tk-card {
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
}
.tk-ep-side.is-watch .tk-act-trivia,
.tk-ep-side.is-trivia .tk-act-watch {
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
}
.tk-ep-side.is-watch .tk-card-watch,
.tk-ep-side.is-trivia .tk-card-trivia {
  max-height: 24cqw;
  opacity: 1;
  margin-bottom: 1.8cqw;
}

/* the juice box doubles as the close (x) button while its card is open */
.tk-act .tk-val {
  font: inherit;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: #fff;
}
.tk-act .tk-val:hover { background: rgba(255, 255, 255, 0.14); }
.tk-val-on { display: none; font-size: 4cqw; line-height: 1; }
.tk-ep-side.is-watch .tk-act-watch .tk-val-off,
.tk-ep-side.is-trivia .tk-act-trivia .tk-val-off { display: none; }
.tk-ep-side.is-watch .tk-act-watch .tk-val-on,
.tk-ep-side.is-trivia .tk-act-trivia .tk-val-on { display: block; }
.tk-act .tk-btn.is-watch:disabled { background: #52b8c8; }

/* the info card */
.tk-card {
  display: flex;
  align-items: center;
  gap: 2.4cqw;
  border-radius: 1cqw;
  background: rgba(10, 8, 22, 0.35);
}
.tk-ep-side.is-watch .tk-card-watch,
.tk-ep-side.is-trivia .tk-card-trivia {
  padding: 1.8cqw 2.2cqw;
}
.tk-card-watch { box-shadow: inset 0 0 0 0.35cqw rgba(82, 184, 200, 0.7); }
.tk-card-trivia { box-shadow: inset 0 0 0 0.35cqw rgba(240, 95, 154, 0.7); }
.tk-big {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 11cqw;
  height: 13cqw;
  border-radius: 1cqw;
  background: radial-gradient(circle, rgba(170, 255, 110, 0.25), transparent 70%);
}
.tk-big .tk-drop { width: 8.5cqw; }
.tk-big .tk-drop b { font-size: 3.6cqw; }
.tk-card-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 1.2cqw;
}
.tk-card-head,
.tk-card-sub,
.tk-steps {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tk-card-head {
  display: flex;
  align-items: center;
  gap: 1cqw;
  font-size: 3cqw;
  line-height: 1.1;
}
.tk-card-head svg { width: 3.2cqw; flex: 0 0 auto; }
.tk-card-sub { font-size: 2.3cqw; color: #b8f28a; }
.tk-steps {
  display: flex;
  align-items: center;
  gap: 1.2cqw;
  font-size: 2.4cqw;
}
.tk-steps span { display: inline-flex; align-items: center; gap: 0.8cqw; }
.tk-steps i {
  font-style: normal;
  display: inline-grid;
  place-items: center;
  width: 3.4cqw;
  height: 3.4cqw;
  border-radius: 50%;
  background: #fff;
  color: #1a1626;
  font-size: 2.2cqw;
}
.tk-steps .tk-arrow-r { color: rgba(255, 255, 255, 0.6); }
.tk-card-btns {
  display: flex;
  gap: 1.4cqw;
}
.tk-btn.tk-sm {
  flex: 1 1 0;
  min-height: 6cqw;
  padding: 0.8cqw 1.4cqw;
  font-size: 2.6cqw;
  border-radius: 0.6cqw;
  color: #fff;
  text-decoration: none;
  text-shadow: 0 0.2cqw 0 rgba(0, 0, 0, 0.25);
}
.tk-btn.tk-sm.is-watch { background: #52b8c8; }
.tk-btn.tk-sm.is-trivia { background: #f05f9a; }
.tk-btn.tk-sm.is-redeem { background: #6fd83a; color: #12320a; text-shadow: none; }
.tk-btn.tk-sm:hover { filter: brightness(1.12); }
.tk-btn.tk-sm:disabled { opacity: 0.45; cursor: default; filter: none; }
@media (prefers-reduced-motion: reduce) {
  .tk-act, .tk-card { transition: none; }
}

/* with a card open, the title art steps back to give the card room */
.tk-ep {
  transition: grid-template-columns 0.4s ease;
}
.tk-ep:has(.tk-ep-side.is-watch),
.tk-ep:has(.tk-ep-side.is-trivia) {
  grid-template-columns: 0.62fr 1.5fr;
  gap: 3cqw;
}
.tk-steps span { white-space: nowrap; }

/* "Play trivia" in the trivia card is yellow, so it stands out from the
   pink Trivia row above it */
.tk-card-trivia .tk-btn.tk-sm.is-trivia {
  background: #ffd23f;
  color: #3a2a00;
  text-shadow: none;
}

/* ---- tile progress (tracker.js renderSeason) ----
   is-new      faded icon + what watching is worth
   is-started  full-colour icon + pips: blue = watched, pink = trivia
   is-badge    both done: gold frame + glow, yellow check, a little shine */
/* (is-new icons are full colour; a juice drop with a + marks juice to earn) */
.tk-pips {
  position: absolute;
  left: 0.8cqw;
  right: 0.8cqw;
  bottom: 0.7cqw;
  display: flex;
  gap: 0.5cqw;
}
.tk-pips i {
  flex: 1 1 0;
  height: 0.8cqw;
  border-radius: 0.4cqw;
  background: rgba(255, 255, 255, 0.18);
}
.tk-pips i.on { background: #52b8c8; }
.tk-pips i.is-t.on { background: #f05f9a; }
.tk-tile.is-badge {
  border-color: #ffd23f;
  box-shadow: 0 0 1.4cqw rgba(255, 210, 63, 0.55), inset 0 0 1.6cqw rgba(255, 210, 63, 0.25);
  background: radial-gradient(circle at 50% 40%, #3a2f12, #191426 75%);
}
.tk-tile.is-badge .tk-icon {
  filter: drop-shadow(0 0 0.8cqw rgba(255, 220, 110, 0.7));
}

/* a tile's total worth: a small pill, tiny drop + number, bottom-right */
.tk-worth-pill {
  position: absolute;
  right: 0.5cqw;
  bottom: 0.5cqw;
  display: inline-flex;
  align-items: center;
  gap: 0.3cqw;
  padding: 0.25cqw 0.7cqw 0.25cqw 0.45cqw;
  border-radius: 999px;
  background: rgba(10, 8, 22, 0.8);
  font-size: 1.7cqw;
  line-height: 1;
  letter-spacing: 0.02em;
  color: #c8ff9a;
}
.tk-worth-pill img {
  width: 1.3cqw;
  height: auto;
}

/* an episode with juice still to earn: a juice drop with a white plus, bottom-right */
.tk-plus-drop {
  position: absolute;
  right: 0.6cqw;
  bottom: 0.5cqw;
  width: 2.6cqw;
  pointer-events: none;
  filter: drop-shadow(0 0.2cqw 0.35cqw rgba(0, 0, 0, 0.55));
}
.tk-plus-drop img { display: block; width: 100%; height: auto; }
.tk-plus-drop::before,
.tk-plus-drop::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 64%;
  background: #fff;
  border-radius: 0.2cqw;
  transform: translate(-50%, -50%);
}
.tk-plus-drop::before { width: 1.25cqw; height: 0.36cqw; }
.tk-plus-drop::after { width: 0.36cqw; height: 1.25cqw; }

/* watch juice not paid yet (Angel account linking): a small "soon" tag on the Watch row's drop */
.tk-val-off { position: relative; }
.tk-soon-tag {
  position: absolute;
  left: 50%;
  bottom: -0.9cqw;
  transform: translateX(-50%);
  padding: 0.2cqw 0.8cqw 0.1cqw;
  border-radius: 999px;
  font-style: normal;
  font-size: 1.5cqw;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.2;
  pointer-events: none;
  background: #ffd23f;
  color: #2a1a00;
}
