/* ═══════════════════════════════════════════════════════════════════
   debate.css — BP Debate (ember)
   A chamber with the floor lit between the benches, skills read on a
   scale, a record that brightens as it goes, and a prep pad that runs
   like the fifteen minutes before a round. Colours are tokens only.
   ═════════════════════════════════════════════════════════════════ */

/* ── hero: an open quote stands behind the title ─────────────────── */
.phero-glyph { opacity: 0.09; }
[data-theme="light"] .phero-glyph { opacity: 0.12; text-shadow: none; }

/* ── chapter one: the chamber ─────────────────────────────────────── */
.chamber {
  position: relative;
  margin-top: clamp(64px, 8vw, 120px);
  display: grid; grid-template-columns: minmax(0, 1fr) clamp(56px, 7vw, 112px) minmax(0, 1fr);
  grid-template-rows: auto auto; row-gap: var(--gap);
}
/* the floor between the benches, lit, with the adjudicator's mark at its centre */
.chamber::before {
  content: ''; grid-column: 2; grid-row: 1 / 3; justify-self: center; width: 1px;
  background: linear-gradient(to bottom, transparent, var(--line-2) 14%, color-mix(in srgb, var(--accent) 70%, transparent) 50%, var(--line-2) 86%, transparent);
}
.chamber::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 16%, transparent), 0 0 26px var(--accent);
}
.seat:nth-of-type(1) { grid-area: 1 / 1; }
.seat:nth-of-type(2) { grid-area: 1 / 3; }
.seat:nth-of-type(3) { grid-area: 2 / 1; }
.seat:nth-of-type(4) { grid-area: 2 / 3; }
.seat {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; gap: 12px; align-content: start;
  padding: clamp(24px, 2.8vw, 40px);
  border: 1px solid var(--line); border-radius: 0;
  background: var(--bg-raise);
  transition: border-color 0.5s var(--ease);
}
/* each bench faces the floor: its inner edge carries the light */
.seat.gov { background: linear-gradient(270deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 55%), var(--bg-raise); }
.seat.opp { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 55%), var(--bg-raise); }
.seat::after {
  content: ''; position: absolute; top: 20%; bottom: 20%; width: 2px; border-radius: 2px;
  background: var(--accent);
}
.seat.gov::after { right: 0; }
.seat.opp::after { left: 0; }
.seat:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
/* two speakers a bench: government seats filled, opposition in outline */
.seat-pips { display: flex; gap: 6px; margin-bottom: 4px; }
.seat-pips i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--accent); }
.seat.gov .seat-pips i { background: var(--accent); }
.seat-role { font: 500 var(--step--1)/1.3 var(--f-sans); font-stretch: var(--wd-label); letter-spacing: 0.005em;  color: var(--accent); }
.seat-title { font: 700 clamp(21px, 1rem + 0.9vw, 30px)/1.12 var(--f-disp); letter-spacing: -0.025em; color: var(--text); text-wrap: balance; }
.seat-desc { color: var(--text-2); font-size: 15.5px; line-height: 1.62; }
@media (max-width: 760px) {
  .chamber { grid-template-columns: minmax(0, 1fr); }
  .chamber::before, .chamber::after { display: none; }
  .seat:nth-of-type(n) { grid-area: auto; }
}

/* ── chapter two: six skills on a graduated scale ────────────────── */
.skills {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(32px, 5vw, 88px);
  border-top: 1px solid var(--line-2);
}
.skill {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 18px 20px;
  padding: clamp(24px, 2.8vw, 36px) 0 clamp(22px, 2.6vw, 32px);
  border-bottom: 1px solid var(--line);
}
.skill-name { font: 700 clamp(22px, 1rem + 1.1vw, 34px)/1.1 var(--f-disp); letter-spacing: -0.03em; color: var(--text); }
.skill-pct {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  font: 500 var(--step--1)/1 var(--f-sans); font-stretch: var(--wd-label); letter-spacing: 0.005em;  color: var(--accent);
}
.skill-meter {
  grid-column: 1 / -1; position: relative; height: 16px;
  background:
    linear-gradient(var(--line-2), var(--line-2)) 100% 100% / 1px 6px no-repeat,
    repeating-linear-gradient(90deg, var(--line-2) 0 1px, transparent 1px 10%) 0 100% / 100% 6px no-repeat,
    linear-gradient(var(--line-2), var(--line-2)) 0 100% / 100% 1px no-repeat;
}
.skill-meter span {
  position: absolute; left: 0; bottom: 0; height: 3px; width: calc(var(--lvl, 0) * 100%);
  background: linear-gradient(90deg, transparent, var(--accent));
  transform-origin: left; transition: transform 1.6s var(--ease) 0.3s;
}
.skill-meter span::after {
  content: ''; position: absolute; right: -1px; bottom: 0; width: 2px; height: 14px;
  background: var(--accent);
}
.can-reveal .skill:not(.is-in) .skill-meter span { transform: scaleX(0); }
@media (max-width: 800px) { .skills { grid-template-columns: minmax(0, 1fr); } }

/* ── interlude: the trophy, a portrait held in its own light ─────── */
.cine { height: clamp(420px, 52vw, 820px); border-inline: 0; background: var(--bg-deep); }
.cine-portrait::before {
  content: ''; position: absolute; inset: -10%; z-index: 0; pointer-events: none;
  background: url('../../../images/debate-trophy-medals.webp') center 40% / cover no-repeat;
  filter: blur(44px) saturate(1.2); opacity: 0.55;
}
.cine-portrait::after {
  content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(60% 85% at 50% 50%, transparent 30%, color-mix(in srgb, var(--bg-deep) 78%, transparent));
}
.cine-portrait img {
  position: relative; z-index: 1;
  object-fit: contain; padding-block: clamp(28px, 4vw, 64px);
  transition: transform 2.8s var(--ease-img), filter 0.8s var(--ease);
}
.can-reveal .cine:not(.is-in) img { transform: scale(1.08); }
.cine > .cine-cap {
  display: flex; align-items: center; gap: 14px;
  padding: 120px var(--mx) clamp(22px, 3vw, 40px);
  font-size: 12.5px; letter-spacing: 0.005em; 
}
.cine > .cine-cap::before { content: ''; flex: none; width: 28px; height: 1px; background: var(--accent); }
@media (max-width: 760px) {
  .cine { height: auto; aspect-ratio: 4 / 5; }
  .cine-portrait img { object-fit: cover; object-position: center 30%; padding: 0; }
}

/* ── chapter three: the record, brightening as it goes ────────────── */
.record {
  --rec-pad: clamp(30px, 3vw, 44px);
  --rec-row: clamp(24px, 2.6vw, 34px);
  position: relative; padding-left: var(--rec-pad);
  border-top: 1px solid var(--line-2);
}
.record::before, .record::after { content: ''; position: absolute; left: 5px; bottom: 0; width: 1px; pointer-events: none; }
.record::before { top: 0; background: linear-gradient(to bottom, var(--line-2), color-mix(in srgb, var(--accent) 50%, var(--line-2)) 55%, var(--accent)); }
.record::after { top: 45%; left: 4px; width: 3px; background: linear-gradient(to bottom, transparent, var(--accent)); filter: blur(4px); opacity: 0.8; }
.rec { position: relative; display: grid; gap: 10px; padding: var(--rec-row) 0; border-bottom: 1px solid var(--line); }
.rec::before {
  content: ''; position: absolute; top: calc(var(--rec-row) + 4px); left: calc(1px - var(--rec-pad));
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg); border: 1.5px solid color-mix(in srgb, var(--accent) 70%, var(--line-2));
  box-shadow: 0 0 0 4px var(--bg);
}
.rec.lit { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent 60%); }
.rec.lit::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--bg), 0 0 18px var(--accent); }
.rec-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.rec-event { font: 500 12.5px/1.45 var(--f-sans); font-stretch: var(--wd-label); letter-spacing: 0.005em;  color: var(--accent); }
.rec-badge { min-height: 26px; font-size: 11px; }
.rec-title { font: 700 clamp(20px, 1rem + 0.8vw, 28px)/1.15 var(--f-disp); letter-spacing: -0.025em; color: var(--text); text-wrap: balance; }
.rec-detail { max-width: 62ch; color: var(--text-2); font-size: 15.5px; line-height: 1.62; }

/* ── archive: two frames, one height ─────────────────────────────── */
.gallery.duo { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr); grid-auto-rows: auto; }
.gallery.duo > figure:first-child { aspect-ratio: 4 / 5; }
@media (max-width: 700px) {
  .gallery.duo { grid-template-columns: minmax(0, 1fr); }
  .gallery.duo > figure:last-child { aspect-ratio: 3 / 2; }
}

html[lang="zh-CN"] :is(.seat-role, .skill-pct, .rec-event, .prep-cat-label, .prep-motion-label, .prep-field-label) { letter-spacing: 0.04em; }
html[lang="zh-CN"] :is(.seat-title, .skill-name, .rec-title) { letter-spacing: 0; line-height: 1.3; }

/* ── prep pad: the legacy demo, restyled as an instrument ─────────── */
.prep { background: radial-gradient(60% 45% at 50% 72%, color-mix(in srgb, var(--accent) 6%, transparent), transparent 70%); }
.prep .sec-head { margin-bottom: clamp(40px, 5vw, 72px); }
.prep-cat-row { flex-wrap: wrap; gap: 8px 10px; padding: 12px clamp(16px, 2.2vw, 28px); }
.prep-cat-row .lights { margin-right: 6px; }
.prep-cat-label { margin-right: 4px; font: 500 11.5px/1 var(--f-sans); font-stretch: var(--wd-label); letter-spacing: 0.005em;  color: var(--text-3); }
.prep-cat-btn {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  border-radius: var(--r-pill); border: 1px solid var(--line-2);
  font: 500 12.5px/1 var(--f-mono); letter-spacing: 0.06em; color: var(--text-2);
  transition: color 0.3s, border-color 0.3s, background-color 0.3s, box-shadow 0.3s;
}
.prep-cat-btn:hover { color: var(--text); border-color: var(--text-3); }
.prep-cat-btn.active {
  color: var(--accent); border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);

}

/* the motion, set like the card handed over at the draw */
.prep-motion-bar {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
  gap: 14px clamp(18px, 2.4vw, 32px);
  padding: clamp(28px, 3.6vw, 52px) clamp(18px, 2.6vw, 36px);
  border-bottom: 1px solid var(--line);
  background: radial-gradient(70% 120% at 50% 0%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 70%);
}
.prep-motion-label { align-self: start; padding-top: 0.9em; font: 500 11.5px/1 var(--f-sans); font-stretch: var(--wd-label); letter-spacing: 0.005em;  color: var(--accent); }
.prep-motion-text { font: italic 400 clamp(22px, 1rem + 1.4vw, 38px)/1.28 var(--f-serif); letter-spacing: -0.01em; color: var(--text); text-wrap: balance; }
.prep-draw-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 24px; white-space: nowrap;
  border-radius: var(--r-pill); background: var(--accent); color: var(--on-accent);
  font: 600 14.5px/1 var(--f-sans);
  box-shadow: 0 10px 34px -12px color-mix(in srgb, var(--accent) 75%, transparent);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.prep-draw-btn:hover { transform: translateY(-2px); box-shadow: 0 16px 44px -14px color-mix(in srgb, var(--accent) 85%, transparent); }

/* benches: a segmented control */
.prep-roles {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px;
  margin: clamp(16px, 2vw, 24px) clamp(18px, 2.6vw, 36px) 0; padding: 6px;
  border: 1px solid var(--line); border-radius: 0; background: var(--bg-deep);
}
.prep-role {
  min-height: 48px; padding: 8px 12px; border-radius: 0; text-align: center;
  font: 500 12.5px/1.25 var(--f-mono); letter-spacing: 0.03em; color: var(--text-3);
  transition: color 0.3s, background-color 0.3s, box-shadow 0.4s var(--ease);
}
.prep-role:hover { color: var(--text); background: color-mix(in srgb, var(--text) 5%, transparent); }
.prep-role.active {
  color: var(--text); background: var(--bg-raise2);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent), 0 8px 22px -10px color-mix(in srgb, var(--accent) 60%, transparent);
}

/* HOLA: four voices, each in its own light */
.prep-case {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(12px, 1.4vw, 18px);
  padding: clamp(18px, 2.4vw, 32px) clamp(18px, 2.6vw, 36px);
  border-bottom: 1px solid var(--line);
}
.prep-field {
  --voice: var(--accent);
  display: grid; grid-template-rows: auto auto 1fr; gap: 10px;
  padding: 18px; border-radius: 0; border: 1px solid var(--line); background: var(--bg-deep);
  transition: border-color 0.3s, box-shadow 0.4s var(--ease);
}
.prep-field:nth-child(1) { --voice: var(--w-record); }
.prep-field:nth-child(2) { --voice: var(--w-debate); }
.prep-field:nth-child(3) { --voice: var(--w-research); }
.prep-field:nth-child(4) { --voice: var(--w-community); }
.prep-field:focus-within {
  border-color: color-mix(in srgb, var(--voice) 55%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--voice) 12%, transparent), 0 0 34px -10px color-mix(in srgb, var(--voice) 45%, transparent);
}
.prep-field-label {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  font: 600 12px/1.2 var(--f-sans); font-stretch: var(--wd-label); letter-spacing: 0.005em;  color: var(--voice);
}
.prep-field-label::before { content: ''; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--voice); }
.prep-hint { min-height: 3.1em; font-size: 13.5px; line-height: 1.5; font-style: italic; color: var(--text-2); }
html[lang="zh-CN"] .prep-hint { font-style: normal; }
.prep-textarea {
  width: 100%; min-height: 132px; resize: vertical; padding: 12px 14px;
  border-radius: 0; border: 1px solid var(--line-2); background: var(--bg-raise); color: var(--text);
  font: 400 16px/1.6 var(--f-sans);
  transition: border-color 0.3s;
}
.prep-textarea::placeholder { color: var(--text-3); }
.prep-textarea:hover { border-color: var(--text-3); }
.prep-textarea:focus { outline: none; border-color: var(--voice); }
.prep-textarea:focus-visible { outline: 2px solid var(--voice); outline-offset: 2px; }

/* the clock and the judge */
.prep-bottom {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 18px clamp(24px, 3vw, 48px);
  padding: clamp(18px, 2.4vw, 30px) clamp(18px, 2.6vw, 36px);
}
.prep-timer-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.prep-timer {
  min-width: 5ch; margin-right: 6px;
  font: 600 clamp(34px, 1.2rem + 1.8vw, 52px)/1 var(--f-mono); letter-spacing: 0.02em; color: var(--text);
  font-variant-numeric: tabular-nums;

  transition: color 0.3s;
}
.prep-timer.urgent { color: var(--accent); animation: urgent 1.1s ease-in-out infinite alternate; }
@keyframes urgent { to { opacity: 0.55; } }
.prep-timer-btn {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px;
  border-radius: var(--r-pill); border: 1px solid var(--line-2);
  font: 600 13.5px/1 var(--f-sans); color: var(--text);
  transition: border-color 0.3s, color 0.3s, transform 0.5s var(--ease);
}
.prep-timer-btn:hover { border-color: var(--accent); color: var(--accent); }
#prepTimerBtn { background: var(--accent); color: var(--on-accent); border-color: transparent; box-shadow: 0 10px 30px -12px color-mix(in srgb, var(--accent) 70%, transparent); }
#prepTimerBtn:hover { color: var(--on-accent); transform: translateY(-1px); }
.prep-speech-est { font: 500 12px/1.4 var(--f-mono); letter-spacing: 0.04em; color: var(--text-3); }
.prep-judge {
  padding: 16px 20px; border-radius: 0;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--line));
  background: radial-gradient(90% 140% at 0% 0%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 60%), var(--bg-deep);
  color: var(--text-2); font-size: 15px; line-height: 1.6;
}
.prep-judge strong { font-weight: 600; color: var(--accent); }
.prep-judge em { color: var(--text); }
@media (max-width: 1100px) { .prep-case { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .prep-bottom { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .prep-motion-bar { grid-template-columns: minmax(0, 1fr); }
  .prep-motion-label { padding-top: 0; }
  .prep-draw-btn { justify-self: start; }
}
@media (max-width: 640px) {
  .prep-roles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prep-case { grid-template-columns: minmax(0, 1fr); }
}

/* ── the coda ─────────────────────────────────────────────────────── */
.bigger { overflow: hidden; background: radial-gradient(55% 60% at 12% 45%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 70%); }
.bigger-grid { display: grid; gap: clamp(28px, 4vw, 56px); margin-top: clamp(22px, 3vw, 34px); }
.bigger-grid .display { max-width: 12ch; }
.bigger-grid .lead { justify-self: end; max-width: 46ch; color: var(--text-2); }
@media (max-width: 760px) { .bigger-grid .lead { justify-self: start; } }
