/* ==========================================================================
   Weekly Challenge — public page, archive, and TV view (BC-1419)
   ==========================================================================
   Scoped to .ch so nothing here can leak into the site chrome (the retired
   /fathers-day page taught that lesson). Design follows the BC-1399 asset
   pack: paper cards pinned and taped onto a dark lounge backdrop, Montserrat,
   Copper #C84F36 / Sunflower #F7B32B / Graphite #2A2A2A / Off-white #EEF0F2.
   Playful on purpose. This is a challenge, not an announcement.
   ========================================================================== */

.ch {
  --ch-bg:      #1A1715;
  --ch-paper:   #F3EFE7;
  --ch-paper-2: #FBF9F4;
  --ch-ink:     #2A2A2A;
  --ch-body:    #6B6B6B;
  --ch-copper:  #C84F36;
  --ch-copper-2:#A33A24;
  --ch-gold:    #F7B32B;
  --ch-tint:    #FBEDE8;
  --ch-line:    #E4DED3;
  font-family: var(--bc-font, 'Montserrat', system-ui, sans-serif);
  background: var(--ch-bg);
  color: var(--ch-ink);
  position: relative;
  overflow: hidden;
}
/* Lounge glow: the asset backdrop's soft copper and gold light. */
.ch::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 40% at 15% 0%,  rgba(200,79,54,.22), transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 100%, rgba(247,179,43,.10), transparent 60%);
}
.ch > * { position: relative; }
.ch a { color: inherit; }

.ch__wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--bc-gutter, 24px); }

/* --- Type ramps ---------------------------------------------------------- */
.ch__eyebrow {
  font-size: 11px; font-weight: 800; letter-spacing: .3em; text-transform: uppercase;
  color: var(--ch-copper);
}
.ch__label {
  font-size: 11px; font-weight: 800; letter-spacing: .22em; text-transform: uppercase;
  color: var(--ch-copper); margin-bottom: 8px;
}
.ch__badge {
  display: inline-block; margin-top: 10px;
  font-size: 11px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase;
  background: var(--ch-ink); color: var(--ch-gold);
  padding: 7px 12px; border-radius: 3px;
}
.ch__badge--ended { background: var(--ch-body); color: #fff; }
.ch__title {
  margin: 14px 0 8px;
  font-size: clamp(40px, 6.4vw, 78px); line-height: .94; font-weight: 900;
  letter-spacing: -.02em; text-transform: uppercase; color: var(--ch-ink);
}
.ch__setup { font-size: 16px; font-weight: 600; color: var(--ch-body); }
.ch__tagline { font-size: 18px; font-weight: 700; color: var(--ch-ink); margin-top: 6px; }

/* --- Top bar: brand + handle --------------------------------------------- */
.ch__top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 34px 0 10px;
}
.ch__top img { width: 170px; height: auto; }
.ch__handle { font-size: 12px; font-weight: 700; letter-spacing: .16em; color: rgba(255,255,255,.5); text-decoration: none; }
.ch__handle:hover { color: #fff; }

/* --- Staff preview banner (drafts, via /challenge/preview/<id>) ---------- */
.ch__preview {
  background: var(--ch-gold); color: var(--ch-ink); border-radius: 4px;
  padding: 10px 14px; margin: 6px 0 18px; font-size: 13px; font-weight: 600; line-height: 1.6;
  display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center;
}
.ch__preview strong { font-weight: 900; letter-spacing: .1em; text-transform: uppercase; font-size: 11px; }
.ch__preview a { font-weight: 800; color: var(--ch-ink); text-decoration: underline; text-underline-offset: 3px; }

/* --- Hero composition: polaroid + card ----------------------------------- */
.ch__hero {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px;
  align-items: center; padding: 26px 0 56px;
}
@media (max-width: 860px) {
  .ch__hero { grid-template-columns: 1fr; gap: 28px; padding-bottom: 40px; }
}

.ch__polaroid {
  background: var(--ch-paper-2); padding: 16px 16px 20px; border-radius: 3px;
  box-shadow: 0 24px 50px rgba(0,0,0,.45);
  transform: rotate(-2deg); position: relative;
}
@media (max-width: 860px) { .ch__polaroid { transform: rotate(-1deg); max-width: 520px; margin: 0 auto; } }
.ch__pin {
  position: absolute; top: -14px; left: 50%; width: 26px; height: 26px; margin-left: -13px;
  border-radius: 50%; background: radial-gradient(circle at 35% 35%, #FFD36A, #E39A0E 70%);
  box-shadow: 0 6px 10px rgba(0,0,0,.4);
}
.ch__photo {
  display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover;
  background: #2A2A2A; border-radius: 2px;
}
.ch__photo--empty {
  display: grid; place-items: center; text-align: center;
  background: radial-gradient(ellipse at 30% 20%, #3a3a3a, #1e1e1e);
  color: rgba(255,255,255,.55); font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  padding: 20px;
}
.ch__caption {
  margin-top: 14px; text-align: center;
  font-size: 12px; font-weight: 800; letter-spacing: .22em; text-transform: uppercase; color: var(--ch-copper);
}

.ch__card {
  background: var(--ch-paper); padding: 44px 44px 40px; border-radius: 3px;
  box-shadow: 0 24px 50px rgba(0,0,0,.45);
  transform: rotate(1deg); position: relative;
}
@media (max-width: 860px) { .ch__card { transform: none; padding: 34px 26px 30px; } }
.ch__tape {
  position: absolute; top: -12px; left: 34px; width: 120px; height: 26px;
  background: var(--ch-copper); opacity: .92; transform: rotate(-3deg);
  border-radius: 2px;
}
.ch__card-actions { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.ch__btn {
  display: inline-block; padding: 14px 26px; border-radius: 4px;
  font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; text-decoration: none;
  background: var(--ch-copper); color: #fff; transition: background .2s;
}
.ch__btn:hover { background: var(--ch-copper-2); color: #fff; }
.ch__btn--ghost { background: transparent; color: var(--ch-ink); border: 2px solid var(--ch-ink); }
.ch__btn--ghost:hover { background: var(--ch-ink); color: #fff; }

/* --- Details sheet: how to play / to win / prize / week ------------------ */
.ch__sheet {
  background: var(--ch-paper); border-radius: 3px; padding: 44px 48px 40px;
  box-shadow: 0 18px 40px rgba(0,0,0,.35); margin-bottom: 34px;
}
@media (max-width: 720px) { .ch__sheet { padding: 30px 22px 26px; } }
.ch__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 40px; }
@media (max-width: 860px) { .ch__grid { grid-template-columns: 1fr; gap: 28px; } }

.ch__steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ch__steps li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; font-size: 15px; font-weight: 600; line-height: 1.45; }
.ch__steps li span {
  width: 26px; height: 26px; border-radius: 50%; background: var(--ch-copper); color: #fff;
  font-size: 12px; font-weight: 800; display: grid; place-items: center; margin-top: 1px;
}

.ch__win {
  border: 2px solid var(--ch-copper); background: var(--ch-tint); border-radius: 5px;
  padding: 18px 20px; margin-top: 26px;
}
.ch__win-h { font-size: 21px; font-weight: 800; line-height: 1.25; }
.ch__win-p { font-size: 13px; font-weight: 600; color: var(--ch-body); margin-top: 6px; }

.ch__facts { display: grid; gap: 22px; align-content: start; }
.ch__fact-h { font-size: 18px; font-weight: 900; line-height: 1.2; text-transform: uppercase; }
.ch__fact-h--copper { color: var(--ch-copper); }
.ch__fact-p { font-size: 12.5px; font-weight: 600; color: var(--ch-body); margin-top: 6px; line-height: 1.5; }

/* --- Leaderboard --------------------------------------------------------- */
.ch__board {
  background: var(--ch-paper-2); border-radius: 3px; padding: 40px 48px 36px;
  box-shadow: 0 18px 40px rgba(0,0,0,.35); position: relative; margin-bottom: 34px;
}
@media (max-width: 720px) { .ch__board { padding: 30px 18px 26px; } }
.ch__board-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.ch__board-h { font-size: clamp(26px, 3.6vw, 36px); font-weight: 900; text-transform: uppercase; letter-spacing: -.01em; line-height: 1; }
.ch__board-sub { font-size: 12.5px; font-weight: 600; color: var(--ch-body); margin-top: 6px; }
.ch__board-count { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--ch-body); }

.ch__rows { list-style: none; margin: 0; padding: 0; }
.ch__row {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 13px 8px; border-bottom: 1px solid var(--ch-line);
}
.ch__row:last-child { border-bottom: 0; }
.ch__row--win { background: linear-gradient(90deg, rgba(247,179,43,.16), transparent 70%); border-radius: 4px; }
.ch__rank {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  font-size: 14px; font-weight: 900; background: #E9E4DA; color: var(--ch-ink);
}
.ch__rank--1 { background: var(--ch-gold); }
.ch__rank--2 { background: #D9D9D9; }
.ch__rank--3 { background: #E4A57E; }
.ch__name { font-size: 17px; font-weight: 800; line-height: 1.2; min-width: 0; }
.ch__attempts { display: block; font-size: 12px; font-weight: 600; color: var(--ch-body); margin-top: 2px; }
.ch__result { text-align: right; font-size: 22px; font-weight: 900; letter-spacing: -.01em; white-space: nowrap; }
.ch__stamp {
  display: inline-block; margin-left: 10px; vertical-align: middle;
  font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ch-copper); border: 2px solid var(--ch-copper); border-radius: 3px; padding: 3px 7px;
  transform: rotate(-4deg);
}
.ch__empty {
  border: 2px dashed #CFC7B8; border-radius: 6px; padding: 30px 20px; text-align: center;
  font-size: 15px; font-weight: 700; color: var(--ch-body);
}
.ch__empty small { display: block; font-size: 12.5px; font-weight: 600; margin-top: 6px; }

/* Sticky note: ties + verification, tucked on the board's corner. */
.ch__note {
  position: absolute; right: 28px; top: -16px; transform: rotate(3deg);
  background: var(--ch-gold); color: var(--ch-ink); padding: 10px 14px; border-radius: 2px;
  font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  box-shadow: 0 8px 18px rgba(0,0,0,.25); max-width: 220px; line-height: 1.4;
}
@media (max-width: 720px) { .ch__note { position: static; transform: none; display: inline-block; margin-bottom: 16px; } }

/* --- Fine print + archive links ----------------------------------------- */
.ch__fine {
  padding: 8px 0 40px; font-size: 11.5px; line-height: 1.7; font-weight: 600;
  color: rgba(238,240,242,.5); max-width: 900px;
}
.ch__links { display: flex; flex-wrap: wrap; gap: 8px 24px; padding-bottom: 46px; }
.ch__links a { font-size: 13px; font-weight: 800; color: var(--ch-gold); text-decoration: none; letter-spacing: .04em; }
.ch__links a:hover { text-decoration: underline; }

/* --- Archive list -------------------------------------------------------- */
.ch__archive-head { padding: 30px 0 22px; color: #fff; }
.ch__archive-head h1 { font-size: clamp(30px, 5vw, 52px); font-weight: 900; text-transform: uppercase; line-height: 1; letter-spacing: -.02em; margin-top: 12px; }
.ch__archive-head p { font-size: 15px; color: rgba(255,255,255,.7); margin-top: 12px; max-width: 60ch; }
.ch__tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; padding-bottom: 46px; }
.ch__tile {
  display: block; background: var(--ch-paper); border-radius: 3px; padding: 22px 22px 20px;
  text-decoration: none; color: var(--ch-ink); box-shadow: 0 14px 30px rgba(0,0,0,.35);
  transition: transform .15s, box-shadow .2s;
}
.ch__tile:hover { transform: translateY(-3px); box-shadow: 0 20px 40px rgba(0,0,0,.45); }
.ch__tile:nth-child(3n+1) { transform: rotate(-.6deg); }
.ch__tile:nth-child(3n+2) { transform: rotate(.5deg); }
.ch__tile:hover { transform: translateY(-3px) rotate(0); }
.ch__tile-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 2px; background: #2A2A2A; margin-bottom: 14px; }
.ch__tile-h { font-size: 22px; font-weight: 900; text-transform: uppercase; line-height: 1; margin: 6px 0 4px; }
.ch__tile-p { font-size: 13px; font-weight: 600; color: var(--ch-body); }
.ch__tile-win { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--ch-line); font-size: 13px; font-weight: 700; }
.ch__tile-win strong { color: var(--ch-copper); }

/* ==========================================================================
   TV view — chrome-less, 1920x1080, auto-refreshing (challenge.php?view=tv)
   ========================================================================== */
.chtv { min-height: 100vh; display: flex; flex-direction: column; }
.chtv .ch__wrap { max-width: none; padding: 0 56px; width: 100%; }
.chtv .ch__top { padding: 32px 0 8px; }
.chtv .ch__top img { width: 220px; }
.chtv .ch__handle { font-size: 15px; }
.chtv__main {
  flex: 1; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px;
  align-items: start; padding: 26px 0 20px;
}
.chtv__left { display: grid; gap: 34px; }
.chtv .ch__polaroid { transform: rotate(-2deg); }
.chtv .ch__card { padding: 36px 38px 32px; transform: rotate(1deg); }
.chtv .ch__title { font-size: clamp(40px, 4.6vw, 64px); }
.chtv .ch__board { margin: 0; padding: 36px 44px 30px; }
.chtv .ch__board-h { font-size: 40px; }
.chtv .ch__row { grid-template-columns: 52px minmax(0, 1fr) auto; padding: 14px 10px; }
.chtv .ch__rank { width: 42px; height: 42px; font-size: 17px; }
.chtv .ch__name { font-size: 24px; }
.chtv .ch__attempts { font-size: 14px; }
.chtv .ch__result { font-size: 32px; }
.chtv .ch__empty { padding: 44px 20px; font-size: 20px; }
.chtv .ch__fine { padding: 14px 0 28px; font-size: 13px; max-width: none; }
.chtv__clock { font-size: 13px; font-weight: 700; letter-spacing: .12em; color: rgba(255,255,255,.35); text-transform: uppercase; }
