/* ==========================================================================
   삐약 청중석 — 발표가 끝난 직후의 객석
   --------------------------------------------------------------------------
   채팅앱이 아니라 '발표장'이다. 조명이 꺼진 객석, 무대에서 흘러드는 잔광,
   좌석 등받이 실루엣, 좌석마다 붙은 명패(= 모델 배지). 발표자는 무대에서
   객석을 바라보며 청중이 뭐라고 소곤거리는지 엿본다.

   병아리는 심사위원이 아니라 '처음 생긴 관객'이다 (UI_REDESIGN §0) — 2.5등신,
   또렷한 눈, 늘 숨 쉰다. 멍청해 보이면 들어준 것처럼 안 읽힌다.

   그리고 이 화면은 제품의 성(城)이다 (§7). 3겹 디오라마, 문지방 입장,
   '들켰다' 비트, 서로 듣는 연기까지 — 다른 화면의 두 배를 투자한 자리다.
   ========================================================================== */

:root {
  /* 객석 — 어둡지만 완전한 검정은 아니다. 무대 잔광이 도는 남색 */
  --ch-house: #171b2b;
  --ch-house-deep: #0e1120;
  --ch-seat: #232941;
  --ch-seat-edge: #2f3654;
  --ch-stage: #ffe9b8;          /* 무대에서 흘러드는 빛 */
  --ch-ink: #f7f8fb;
  --ch-ink-2: #a9b1c9;
  --ch-ink-3: #6f7896;

  /* 발표새 — 몸은 하나다. 넷을 가르는 건 색이 아니라 소품이다.
     색으로 가르면 팀이 아니라 랜덤 스티커 모음으로 보인다
     (docs/design_improvement/01_character.md) */
  --chick-body: #FFD96A;        /* 캐릭터 노랑 — 단일 원본 */
  --chick-midm: var(--chick-body);    /* 별칭 유지: chickSvg 가 var(--chick-${speaker}) 를 쓴다 */
  --chick-solar: var(--chick-body);
  --chick-exaone: var(--chick-body);
  --chick-ax: var(--chick-body);
  --chick-line: #356B59;        /* 외곽선 — 검정 대신 브랜드 초록. 부드러움의 핵심 */
  --chick-belly: #FFF3CF;       /* 배의 밝은 크림 패치 */
  --chick-mint: #9ADBC0;        /* 소품(헤드폰·로제트·새싹) */
  --chick-beak: #F0A93C;
  --chick-blush: #F7B6A8;

  /* 말풍선 겸 청중 카드 틴트. 파스텔 4색이 카드를 가르고, 몸은 하나로 둔다 (§7-4) */
  --bub-midm: #E9F6EF;          /* 민트 */
  --bub-solar: #FFF6E0;         /* 노랑 */
  --bub-exaone: #FDEEEA;        /* 핑크 */
  --bub-ax: #EAF2FB;            /* 블루 */
  --bub-ink: #4a3b2c;           /* 따뜻한 잉크색. 검정도 흰색도 아니다 */
  /* 크림 위 대비 5.2:1. #9a8672 는 2.9:1 이라 「소곤」 라벨이 읽히지 않았다 */
  --bub-ink-2: #6f5b45;
}

/* --------------------------------------------------------------------------
   오버레이 골격
   -------------------------------------------------------------------------- */

.ch-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(120% 70% at 50% -10%, rgba(255, 233, 184, .16), transparent 60%),
    linear-gradient(180deg, var(--ch-house) 0%, var(--ch-house-deep) 100%);
  color: var(--ch-ink);
  opacity: 0;
  transition: opacity .5s var(--ease, ease);
  overflow: hidden;
}
.ch-overlay.on { opacity: 1; }

/* 무대에서 내려오는 빛기둥. 객석에 앉아 있다는 신호 */
.ch-overlay::before {
  content: "";
  position: absolute;
  top: -12%;
  left: 50%;
  width: calc(var(--vw) * 0.78);
  height: calc(var(--vh) * 0.62);
  transform: translateX(-50%);
  background: radial-gradient(50% 60% at 50% 0%, rgba(255, 233, 184, .2), transparent 70%);
  pointer-events: none;
}

.ch-top {
  position: relative;
  z-index: 20; /* 문 오버레이보다 위 — 객석 나가기는 언제든 눌러야 한다 */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
}
.ch-stage-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--ch-ink-3);
}
.ch-stage-tag i {
  width: 26px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--ch-stage));
}
.ch-close {
  border: 0;
  background: rgba(255, 255, 255, .08);
  color: var(--ch-ink-2);
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}
.ch-close:hover { background: rgba(255, 255, 255, .14); color: var(--ch-ink); }
.ch-close:focus-visible { outline: 2px solid var(--ch-stage); outline-offset: 2px; }

/* --------------------------------------------------------------------------
   7-1 문지방 — 입장이 곧 마법
   --------------------------------------------------------------------------
   픽사의 세계는 컷으로 들어가지 않는다. 나니아의 옷장, 몬스터 주식회사의 문.
   문이 열리고 카메라가 안으로 들어가야 '들어간' 감각이 생긴다.
   -------------------------------------------------------------------------- */

.ch-door {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 10px;
  text-align: center;
  z-index: 6;
  cursor: pointer;
  background: #0a0c16;
  perspective: 900px;
  transition: opacity .5s ease, visibility .5s ease;
}
.ch-door.gone { opacity: 0; visibility: hidden; pointer-events: none; }
.ch-door b {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -.01em;
}
.ch-door span {
  font-size: 13px;
  color: var(--ch-ink-3);
}

/* 문짝 둘 + 그 사이의 틈. 틈에서 따뜻한 빛과 웅성거림이 새어 나온다 */
.ch-door-frame {
  position: relative;
  width: min(280px, calc(var(--vw) * 0.62));
  height: min(300px, calc(var(--vh) * 0.42));
  margin: 0 auto 14px;
  transform-style: preserve-3d;
}
.ch-door-leaf {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .35), transparent 30%),
    linear-gradient(180deg, #3a2f27, #241c17);
  box-shadow: inset 0 0 0 1px rgba(255, 233, 184, .1);
  transition: transform 1.2s cubic-bezier(.4, 0, .2, 1);
  backface-visibility: hidden;
}
.ch-door-l {
  left: 0;
  transform-origin: left center;
  border-radius: 8px 2px 2px 8px;
}
.ch-door-r {
  right: 0;
  transform-origin: right center;
  border-radius: 2px 8px 8px 2px;
}
.ch-door.open .ch-door-l { transform: rotateY(-78deg); }
.ch-door.open .ch-door-r { transform: rotateY(78deg); }

/* 문틈 — 문짝 뒤에 깔린다. 문이 열리면 그대로 객석의 빛이 된다 */
.ch-door-slit {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: var(--r-ctl);
  background: radial-gradient(120% 80% at 50% 60%, var(--ch-stage), #a9834a 55%, #2a2119);
  animation: chDoorGlow 2.2s ease-in-out infinite;
}
@keyframes chDoorGlow {
  0%, 100% { opacity: .82; }
  50%      { opacity: 1; }
}

/* 문이 열리는 동안 카메라가 안으로 밀고 들어간다 */
.ch-house { transition: transform 1.2s cubic-bezier(.4, 0, .2, 1); }
.ch-overlay.at-door .ch-house { transform: scale(1.07); }

/* 나갈 때는 들어온 그 문으로 (§7-6). 문이 닫히며 웅성거림이 멀어진다.
   transition 이 아니라 keyframe 인 이유: 2회차 즉시 입장이면 문짝이 열린 적이
   없어서, 닫는 transition 의 출발 상태가 없다 */
.ch-door.leaving {
  opacity: 1;
  visibility: visible;
  background: transparent;
  pointer-events: none;
}
.ch-door.leaving .ch-door-frame {
  /* iPad Safari 는 100vh 가 실제 보이는 높이보다 커서 문이 화면을 넘친다. dvh/dvw 로 맞춘다 */
  width: 100dvw;
  height: var(--vh);
  margin: 0;
}
.ch-door.leaving .ch-door-l { animation: chDoorShutL .7s cubic-bezier(.4, 0, .2, 1) forwards; }
.ch-door.leaving .ch-door-r { animation: chDoorShutR .7s cubic-bezier(.4, 0, .2, 1) forwards; }
.ch-door.leaving b, .ch-door.leaving span { display: none; }
@keyframes chDoorShutL {
  from { transform: rotateY(-84deg); }
  to   { transform: rotateY(0); }
}
@keyframes chDoorShutR {
  from { transform: rotateY(84deg); }
  to   { transform: rotateY(0); }
}

/* --------------------------------------------------------------------------
   2단계 객석
   -------------------------------------------------------------------------- */

.ch-house {
  position: relative;
  flex: 1;
  display: flex;
  /* 앞줄 실루엣 바로 위에 앉혀야 원근이 읽힌다. 가운데로 띄우면 병아리와
     앞줄 사이에 빈 띠가 생겨 디오라마가 두 장의 그림으로 쪼개진다 */
  align-items: flex-end;
  justify-content: center;
  padding: 0 16px;
  overflow-x: auto;
  overflow-y: hidden;
}

.ch-row {
  position: relative;
  z-index: 2;                   /* 명패가 앞줄 좌석에 가리면 안 된다 */
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(6px, calc(var(--vw) * 0.022), 26px);
  /* 앞줄 실루엣이 좌석 등받이를 살짝 물어야 '뒤에 앉은 것'이 된다.
     다만 명패(= 모델 배지)까지 가리면 안 된다 — 어느 단계에서도 숨기지 않는다 */
  padding-bottom: 54px;
  min-width: min-content;
}

.ch-seat {
  position: relative;
  width: clamp(124px, calc(var(--vw) * 0.2), 178px);
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  transform: translateY(14px);
  filter: brightness(.82) saturate(.9);
  transition: filter .35s ease;
}
.ch-seat.seated { animation: chSeatIn .5s var(--ease, ease) forwards; }
@keyframes chSeatIn {
  to { opacity: 1; transform: translateY(0); }
}
/* 말하는 중인 청중만 살짝 밝다 — 객석이라 조명이 고르지 않다 */
.ch-seat.talking { filter: brightness(1.06) saturate(1); }

/* 말풍선이 앉은 자리 위로 떠오른다 */
.ch-bubbles {
  position: relative;
  width: 100%;
  min-height: 96px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  margin-bottom: 6px;
}

/* 마시멜로 구름 — 네 모서리 반경이 다 달라야 손으로 그린 것처럼 읽힌다 (§7-4).
   흰 사각 박스는 알림창이지 대사가 아니다. */
.ch-bubble {
  position: relative;
  align-self: center;
  max-width: 100%;
  padding: 10px 13px 11px;
  border-radius: 20px 22px 20px 24px;
  background: var(--bub, #fff8e6);
  color: var(--bub-ink);
  /* 아이패드를 세워 두고 조금 떨어져서 보는 화면이다. 13px 은 작았다 */
  font-size: 15px;
  line-height: 1.6;
  text-align: left;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .38);
  opacity: 0;
  transform: translateY(6px) scale(.9);
  animation:
    chBubbleIn .42s cubic-bezier(.34, 1.56, .64, 1) forwards,
    chBubbleFloat 3.4s ease-in-out .42s infinite;
}
/* 화자의 깃털색이 풍선 색이 된다 — 누가 말했는지를 색으로도 안다 */
.ch-seat[data-speaker="midm"]   .ch-bubble { --bub: var(--bub-midm); }
.ch-seat[data-speaker="solar"]  .ch-bubble { --bub: var(--bub-solar); }
.ch-seat[data-speaker="exaone"] .ch-bubble { --bub: var(--bub-exaone); }
.ch-seat[data-speaker="ax"]     .ch-bubble { --bub: var(--bub-ax); }

/* 꼬리는 부리에서 나온다. 좌석이 줄의 어느 쪽인지에 따라 방향이 기운다 */
.ch-bubble::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  width: 15px;
  height: 15px;
  margin-left: calc(-7.5px + var(--tail-shift, 0px));
  background: inherit;          /* 풍선 색을 그대로 — 따로 두면 흰 꼭지가 남는다 */
  transform: rotate(45deg);
  border-radius: 0 0 3px 0;
}
.ch-seat[data-side="left"]  .ch-bubble { --tail-shift: 9px; }
.ch-seat[data-side="right"] .ch-bubble { --tail-shift: -9px; }

/* 지난 대사는 뒤로 물러나되 읽히기는 해야 한다.
   opacity .42 는 어두운 객석 위에서 글자 대비가 3.2:1 까지 떨어져 안 읽혔다 —
   물러남은 투명도 대신 크기와 그림자로 표현한다 */
.ch-bubble.faded {
  opacity: .88;
  transform: scale(.95);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .3);
  animation: none;
}
@keyframes chBubbleIn {
  to { opacity: 1; transform: translateY(0) scale(1); }
}
/* 떠 있는 동안 1px 부유 — 멈춰 있으면 붙여 놓은 스티커로 보인다 */
@keyframes chBubbleFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-1px); }
}

/* 소곤거림 표시 */
.ch-whisper {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--bub-ink-2);
  margin-bottom: 2px;
}
.ch-bubble-body { display: block; }

/* 인용 = 발표자가 실제로 한 말. 풍선 안의 대본 조각이다 —
   "내 말이 저기 있다" 는 순간이 이 화면의 보석이라 따옴표로 흘려보내지 않는다 */
.ch-quote {
  display: block;
  position: relative;
  margin: 6px 0 2px;
  padding: 7px 10px 7px 20px;
  border-radius: 3px 8px 4px 7px;
  background: #fffaec;
  border-left: 3px solid var(--chick-beak);
  box-shadow: 0 2px 5px rgba(74, 59, 44, .14);
  transform: rotate(-.8deg);
  font-size: 14px;
  line-height: 1.55;
  color: #3b2f23;
}
.ch-quote::before {
  content: "\201C";
  position: absolute;
  left: 6px;
  top: 2px;
  font-size: 19px;
  font-weight: 700;
  color: var(--chick-beak);
  opacity: .55;
}

/* 근거 배지 = 풍선에 매달린 수하물 태그. 끈은 ::before 다 */
.ch-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  padding-left: 2px;
}
.ch-ref {
  position: relative;
  padding: 3px 9px;
  border: 0;
  border-radius: 3px 7px 7px 3px;
  background: #efe4c8;
  color: #6b5a3f;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transform-origin: 0 -10px;
  animation: chTagSwing 4.6s ease-in-out infinite;
}
/* 끈 */
.ch-ref::before {
  content: "";
  position: absolute;
  left: 5px;
  top: -8px;
  width: 1.5px;
  height: 8px;
  background: var(--bub-ink-2);
  opacity: .5;
}
/* 태그 구멍 */
.ch-ref::after {
  content: "";
  position: absolute;
  left: 3.2px;
  top: 50%;
  width: 4px;
  height: 4px;
  margin-top: -2px;
  border-radius: 50%;
  background: var(--bub, #fff8e6);
}
.ch-ref { padding-left: 13px; }
@keyframes chTagSwing {
  0%, 100% { transform: rotate(-2.5deg); }
  50%      { transform: rotate(2.5deg); }
}
.ch-ref:hover { background: #e5d6b2; color: #4a3b2c; }
.ch-ref:focus-visible { outline: 2px solid var(--ch-stage); outline-offset: 2px; }

/* 소곤거리는 중 표시 */
.ch-typing {
  align-self: center;
  display: inline-flex;
  gap: 4px;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
}
.ch-typing i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ch-ink-2);
  animation: chBlink 1.1s infinite;
}
.ch-typing i:nth-child(2) { animation-delay: .18s; }
.ch-typing i:nth-child(3) { animation-delay: .36s; }
@keyframes chBlink {
  0%, 60%, 100% { opacity: .28; transform: translateY(0); }
  30%           { opacity: 1;   transform: translateY(-2px); }
}

/* --------------------------------------------------------------------------
   병아리 — 처음 생긴 관객
   --------------------------------------------------------------------------
   2.5등신, 또렷한 눈, 늘 숨 쉰다. 눈썹은 없다 — 눈썹이 있으면 인상이 생기고
   인상은 '멍청함' 이나 '심사' 로 읽힌다. 뾰로통함은 ∧ 눈으로만 만든다 (§10).

   transform 을 두 층으로 나눈다: svg 는 흔들림·몸짓(mood), 안쪽 .ch-figure 는
   호흡. 한 요소에 몰면 둘 중 하나가 덮인다.
   -------------------------------------------------------------------------- */

.ch-chick {
  /* 말풍선보다 작으면 대사가 주인공이 된다. 들어주는 건 병아리다 */
  width: clamp(96px, calc(var(--vw) * 0.15), 134px);
  height: auto;
  display: block;
  overflow: visible;
  cursor: pointer;
  transform-origin: 50% 96%;
  animation: chSway var(--ch-sway, 2.4s) ease-in-out infinite;
}
/* 좌우 흔들림. 마리마다 주기가 달라야 기계처럼 안 보인다 */
@keyframes chSway {
  0%, 100% { transform: rotate(-1.6deg); }
  50%      { transform: rotate(1.6deg); }
}

/* 숨쉬기 — 가장 싼 생명 신호. 위상을 어긋내지 않으면 넷이 한 기계로 보인다 */
.ch-figure {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: chBreathe 3s ease-in-out infinite;
  animation-delay: var(--ch-breath-delay, 0s);
}
@keyframes chBreathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.015); }
}

.ch-blush { opacity: .5; }
.ch-chick .ch-heart { opacity: 0; transform-origin: center; }
.ch-chick .ch-mark { opacity: 0; }

/* 표정 곡선은 mood 가 켠다. 평소엔 또렷한 눈동자만 보인다 */
.ch-eye-line {
  fill: none;
  stroke: #2F3B33;              /* 눈동자와 같은 잉크 */
  stroke-width: 2.6;
  stroke-linecap: round;
  opacity: 0;
}
.ch-eye-ball, .ch-eye-hi { transform-box: fill-box; transform-origin: center; }

/* 눈깜빡임 — 사람보다 조금 느리게.
   transform-box: fill-box 가 없으면 원점이 viewBox 기준이라 눈이 얼굴 밖으로 찌그러진다 */
.ch-chick .ch-eyes {
  animation: chBlinkEyes 5.6s infinite;
  transform-box: fill-box; transform-origin: center;
}
@keyframes chBlinkEyes {
  0%, 93%, 100% { transform: scaleY(1); }
  96%           { transform: scaleY(.1); }
}

/* 소품 — 반응 연기의 몸이다 (§9). 평소엔 가만히 있는다 */
.ch-prop { transform-box: fill-box; transform-origin: center; }

/* mood — 표정과 몸짓을 한 속성으로 바꾼다 */

/* 뾰로통 = ∧ 눈. 화남이 아니다 */
.ch-seat[data-mood="grumpy"] .ch-eye-grumpy { opacity: 1; }
.ch-seat[data-mood="grumpy"] .ch-eye-ball,
.ch-seat[data-mood="grumpy"] .ch-eye-hi { opacity: 0; }
.ch-seat[data-mood="grumpy"] .ch-chick { animation: chTurnAway 1.1s ease-in-out; }
/* 믿:음이 어긋난 걸 찾았을 때 — 형광펜이 실제로 밑줄을 긋는다 */
.ch-seat[data-mood="grumpy"] .ch-pen-stroke { animation: chPenDraw 1.5s ease-out forwards; }
@keyframes chTurnAway {
  0%, 100% { transform: rotate(0); }
  40%      { transform: rotate(-11deg); }
}
@keyframes chPenDraw {
  0%   { opacity: 0;  clip-path: inset(0 100% 0 0); }
  20%  { opacity: .9; clip-path: inset(0 100% 0 0); }
  70%  { opacity: .9; clip-path: inset(0 0 0 0); }
  100% { opacity: .55; clip-path: inset(0 0 0 0); }
}

/* 신남 = ∪ 눈 */
.ch-seat[data-mood="happy"] .ch-eye-happy { opacity: 1; }
.ch-seat[data-mood="happy"] .ch-eye-ball,
.ch-seat[data-mood="happy"] .ch-eye-hi { opacity: 0; }
.ch-seat[data-mood="happy"] .ch-heart { opacity: 1; animation: chHeart 1.4s ease-out; }
.ch-seat[data-mood="happy"] .ch-chick { animation: chHop .62s ease-in-out 2; }
/* Squash & stretch — 뜨기 전에 눌리고 착지에서 다시 눌린다 */
@keyframes chHop {
  0%, 100% { transform: translateY(0) scale(1, 1); }
  18%      { transform: translateY(0) scale(1.06, .94); }
  50%      { transform: translateY(-7px) scale(.97, 1.03); }
  82%      { transform: translateY(0) scale(1.06, .94); }
}
@keyframes chHeart {
  0%   { opacity: 0; transform: translateY(2px) scale(.7); }
  40%  { opacity: 1; transform: translateY(-3px) scale(1.1); }
  100% { opacity: .8; transform: translateY(-6px) scale(1); }
}

/* 갸웃 — 고개를 기울이고 물음표 */
.ch-seat[data-mood="curious"] .ch-eye-ball { transform: scale(1.08); }
.ch-seat[data-mood="curious"] .ch-mark { opacity: 1; animation: chPop .5s ease-out; }
.ch-seat[data-mood="curious"] .ch-chick { animation: chTilt 1.6s ease-in-out; }
@keyframes chTilt {
  0%, 100% { transform: rotate(0); }
  50%      { transform: rotate(8deg); }
}
@keyframes chPop {
  from { opacity: 0; transform: translateY(4px) scale(.6); }
}

/* 놀람 — 눈이 커진다. Exaggeration 은 0.4초 안에 되돌린다 */
.ch-seat[data-mood="excited"] .ch-eye-ball { animation: chEyeWide .4s ease-out; }
.ch-seat[data-mood="excited"] .ch-chick { animation: chShiver .42s ease-in-out 3; }
@keyframes chEyeWide {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}
@keyframes chShiver {
  0%, 100% { transform: translateX(0) rotate(0); }
  25%      { transform: translateX(-3px) rotate(-3deg); }
  75%      { transform: translateX(3px) rotate(3deg); }
}

/* 말하기 직전 움츠림 (Anticipation) — 풍선이 튀어나오기 전 숨을 들이쉰다 */
.ch-seat.talking .ch-figure { animation: chAnticipate .9s ease-out; }
@keyframes chAnticipate {
  0%   { transform: scale(1); }
  14%  { transform: scale(.96); }
  34%  { transform: scale(1.04); }
  100% { transform: scale(1); }
}

/* --------------------------------------------------------------------------
   7-2 "들켰다!" — 입장 비트
   --------------------------------------------------------------------------
   몰래 엿듣던 발표자가 들킨 게 아니라 수다 떨던 관객이 들킨 것이다.
   권력이 뒤집히는 이 2초가 이 화면 전체의 톤을 정한다.
   -------------------------------------------------------------------------- */

/* 뚝 — 소곤거리던 넷이 동시에 멈춘다. 정적도 연기다 */
.ch-house.caught .ch-chick,
.ch-house.caught .ch-figure { animation-play-state: paused; }

/* 여덟 개의 눈이 일제히 이쪽을 본다 */
.ch-house.spotted .ch-eye-ball { animation: chSpotted .5s ease-out forwards; }
.ch-house.spotted .ch-eye-hi { animation: chSpottedHi .5s ease-out forwards; }
@keyframes chSpotted {
  0%   { transform: scale(1); }
  55%  { transform: scale(1.3); }
  100% { transform: scale(1.16); }
}
@keyframes chSpottedHi {
  0%   { opacity: .8; }
  100% { opacity: 1; }
}

/* 엑씨가 손을 흔든다 — 날개가 없으니 몸을 기울여 인사로 읽힌다 */
.ch-seat.waving .ch-chick { animation: chWave .7s ease-in-out 2; }
@keyframes chWave {
  0%, 100% { transform: rotate(0); }
  30%      { transform: rotate(-9deg); }
  70%      { transform: rotate(6deg); }
}

/* 킥킥 — 다시 수다가 이어진다 */
.ch-house.giggling .ch-figure { animation: chGiggle .32s ease-in-out 2; }
@keyframes chGiggle {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-2px) scale(1.02); }
}

/* --------------------------------------------------------------------------
   7-5 서로 듣는 연기 — 픽사의 리액션 샷
   --------------------------------------------------------------------------
   듣는 연기가 말하는 연기보다 세계를 만든다. 다만 미동까지만이다 —
   말풍선과 시선을 경쟁하는 순간 화면이 시끄러워진다.
   -------------------------------------------------------------------------- */

.ch-head {
  transform-box: fill-box;
  transform-origin: 50% 100%;      /* 목 언저리를 축으로 */
  transition: transform .4s var(--ease, ease);
}
.ch-seat[data-listening="left"] .ch-head { transform: rotate(-8deg); }
.ch-seat[data-listening="right"] .ch-head { transform: rotate(8deg); }
/* Follow-through — 고개가 돌면 몸이 한 박자 늦게 따라간다 */
.ch-seat[data-listening] .ch-torso,
.ch-seat[data-listening] .ch-wing {
  transition: transform .4s var(--ease, ease) 40ms;
}

/* 엑사원이 칭찬하면 다들 같이 짝짝 */
.ch-seat.applauding .ch-figure { animation: chGiggle .34s ease-in-out 3; }
/* 믿:음이 지적하면 쏠라가 대본을 뒤적여 확인한다 */
.ch-seat.checking .ch-prop-script { animation: chFlip .8s ease-in-out 2; }
@keyframes chFlip {
  0%, 100% { transform: rotate(0) translateY(0); }
  40%      { transform: rotate(-11deg) translateY(-2px); }
}

/* --------------------------------------------------------------------------
   7-6 퇴장 — 조명이 아주 살짝 내려가고 넷이 편히 기대앉는다
   -------------------------------------------------------------------------- */

.ch-house.settled { transition: filter 1.2s ease; filter: brightness(.9); }
.ch-house.settled .ch-seat:nth-child(2) .ch-eyes { animation: chYawn 2.4s ease-in-out 1; }
@keyframes chYawn {
  0%, 100% { transform: scaleY(1); }
  45%, 60% { transform: scaleY(.12); }
}

/* 결석(모델 다운) — 재우지 않고 비운다 (§12).
   조는 병아리로 그리면 "이 모델은 일했지만 게을렀다"로 읽힌다. 사실은 안 온 것이다.
   빈 좌석 + 명패가 남아 "국내 LLM 4개" 라는 사실은 그대로 보인다. */
/* 어둡게 눌러 두되, 이 자리가 왜 비었는지는 읽혀야 한다.
   brightness(.6) + --ch-ink-3 이 겹쳐서 "오늘 못 왔어요" 가 배경에 묻혔다 */
.ch-seat[data-absent] { filter: brightness(.78) saturate(.55); }
.ch-empty {
  display: grid;
  place-content: center;
  width: clamp(96px, calc(var(--vw) * 0.15), 134px);
  min-height: 92px;
  margin: 0;
  text-align: center;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ch-ink-2);
}

/* --------------------------------------------------------------------------
   좌석 + 명패 — 모델명이 여기 붙는다 (심사위원 어필 포인트)
   -------------------------------------------------------------------------- */

.ch-seatback {
  position: relative;
  width: 100%;
  margin-top: -14px;
  padding: 14px 8px 12px;
  border-radius: 14px 14px 8px 8px;
  background: linear-gradient(180deg, var(--ch-seat-edge), var(--ch-seat));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 -6px 18px rgba(0, 0, 0, .3);
  text-align: center;
}

.ch-plate {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 10px;
  border-radius: var(--r-ctl);
  background: #f5f2e8;                 /* 종이 명패 */
  color: #2b2f3a;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
  max-width: 100%;
}
.ch-plate b {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -.01em;
}
.ch-plate span {
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  /* 모델 배지는 한 줄로 둔다. 다만 좌석이 가장 좁을 때(124px) 'Upstage Solar'
     가 명패를 뚫지 않게 말줄임으로 받아 준다 */
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --------------------------------------------------------------------------
   7-3 디오라마 — 깊이와 빛
   --------------------------------------------------------------------------
   3겹으로 나눈다: 후경(무대 가장자리·비상구) · 중경(병아리) · 전경(좌석 등받이).
   겹마다 마우스 시차가 다르게 걸려 평면이 공간이 된다.
   소품은 팸플릿과 비상구 표지 둘까지 — 셋부터는 잡동사니다 (Staging).
   -------------------------------------------------------------------------- */

[data-layer] { transform: translate(var(--px, 0), var(--py, 0)); }

/* 후경 — 무대 가장자리와 초록 비상구 표지 (한국 극장의 디테일) */
.ch-far {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.ch-stage-edge {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 12%;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 233, 184, .3), transparent);
}
.ch-exit {
  position: absolute;
  right: 4%;
  top: 16%;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border-radius: 3px;
  background: #0f2a1c;
  box-shadow: 0 0 12px rgba(46, 204, 130, .28);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  color: #4fd39a;
  opacity: .72;
}
.ch-exit i {
  width: 7px;
  height: 9px;
  border-radius: 1px;
  background: #4fd39a;
}

/* 무대에서 새어 드는 사선 광선 하나 + 그 안을 떠다니는 먼지 (코코의 영사기 빛) */
.ch-shaft {
  position: absolute;
  left: 46%;
  top: -18%;
  width: calc(var(--vw) * 0.34);
  height: 108%;
  z-index: 0;
  pointer-events: none;
  transform-origin: 50% 0;
  rotate: 13deg;
  background: linear-gradient(180deg,
    rgba(255, 233, 184, .13), rgba(255, 233, 184, .05) 45%, transparent 78%);
  filter: blur(2px);
}
.ch-dust {
  position: absolute;
  left: calc(18% + var(--d) * 16%);
  top: 20%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--ch-stage);
  opacity: .5;
  animation: chDust 11s linear infinite;
  animation-delay: calc(var(--d) * -2.4s);
}
@keyframes chDust {
  0%   { transform: translate(0, 0); opacity: 0; }
  15%  { opacity: .6; }
  85%  { opacity: .5; }
  100% { transform: translate(-14px, 300px); opacity: 0; }
}

/* 전경 — 앞줄 좌석 실루엣. 우리가 객석 뒤쪽에 있다는 원근 신호이자 가장 어두운 겹 */
.ch-frontrow {
  position: absolute;
  left: -1%;
  right: -1%;
  bottom: 0;
  z-index: 3;
  height: 46px;
  display: flex;
  gap: 10px;
  padding: 0 10px;
  pointer-events: none;
}
.ch-frontrow i {
  position: relative;
  flex: 1;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(180deg, #14192a, #0a0d18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}
/* 팔걸이에 놓인 공연 팸플릿 — 아무도 안 챙겨 간 그 종이 */
.ch-pamphlet {
  position: absolute;
  left: 18%;
  top: -9px;
  width: 26px;
  height: 15px;
  border-radius: 2px 3px 2px 3px;
  background: linear-gradient(160deg, #cbbf9e, #8e856c);
  box-shadow: 0 2px 5px rgba(0, 0, 0, .5);
  transform: rotate(-7deg);
}

/* --------------------------------------------------------------------------
   4단계 엔딩
   -------------------------------------------------------------------------- */

.ch-actions {
  position: relative;
  z-index: 20; /* 문·전경보다 위 */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, transparent, rgba(10, 12, 22, .9) 45%);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .4s ease, transform .4s ease;
  pointer-events: none;
}
.ch-actions.on { opacity: 1; transform: translateY(0); pointer-events: auto; }
.ch-overlay.is-leaving { pointer-events: none; }

.ch-btn {
  height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--r-print);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.ch-btn-primary { background: var(--brand); color: #fff; }
.ch-btn-primary:hover { background: var(--brand-strong); }
.ch-btn-ghost { background: rgba(255, 255, 255, .1); color: var(--ch-ink); }
.ch-btn-ghost:hover { background: rgba(255, 255, 255, .18); }
.ch-btn:active { transform: scale(.97); }
.ch-btn:focus-visible { outline: 2px solid var(--ch-stage); outline-offset: 2px; }

/* --------------------------------------------------------------------------
   리포트 진입 카드
   -------------------------------------------------------------------------- */

.aud-card { cursor: pointer; }
.aud-status { margin: 0 0 16px; font-size: 14px; color: var(--text-2); }

/* 병아리 · 이름 · 모델 · 한 일을 한 칸에 묶는다.
   예전엔 46px 병아리 넷이 한 줄, 모델 이름 넷이 그 아래 다른 줄이라
   누가 누구인지 짝지을 방법이 없었다 */
.aud-seats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0; padding: 0;
  list-style: none;
}
/* 카드마다 배경 틴트가 다르다. 몸 색이 하나가 됐으니 넷을 가르는 건
   소품과 이 틴트다 (docs/design_improvement/03_components.md §4) */
.aud-seat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 16px 12px 14px;
  border-radius: var(--r-inner);
  border: 1.5px solid rgba(255, 255, 255, .9);
  background: var(--seat-tint, var(--fill));
  text-align: center;
}
.aud-seat[data-speaker="midm"]   { --seat-tint: var(--bub-midm); }
.aud-seat[data-speaker="solar"]  { --seat-tint: var(--bub-solar); }
.aud-seat[data-speaker="exaone"] { --seat-tint: var(--bub-exaone); }
.aud-seat[data-speaker="ax"]     { --seat-tint: var(--bub-ax); }

/* 말풍선 한 줄 — 판정이 아니라 역할 소개다. 판정은 객석을 열어야 나온다 */
.aud-line {
  margin-top: 4px;
  padding: 5px 10px;
  border-radius: 12px 14px 12px 4px;
  background: rgba(255, 255, 255, .8);
  color: var(--bub-ink);
  font-size: 13px; font-weight: 500; line-height: 1.45;
}
.aud-id { display: flex; align-items: center; gap: 6px; margin-top: 6px; flex-wrap: wrap; justify-content: center; }
.aud-role-pill {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .75);
  border: 1px solid var(--border);
  font-size: 11px; font-weight: 600; color: var(--text-2);
}
/* 소품(헤드폰·대본·형광펜·배지)이 읽혀야 넷이 구분된다 — 토스 「디테일이 많은
   그래픽은 충분히 크게」 */
.aud-seat .ch-chick {
  width: 76px;
  cursor: default;
  animation-duration: 4s;
}
.aud-name { font-size: 14px; font-weight: 700; color: var(--text); }
/* 후원사 표기 — 4개 국산 LLM 정체성이라 텍스트로 유지한다.
   로고는 허가·에셋 확보 시 이 줄 왼쪽에 12px 단색으로만 (03_components.md §8) */
.aud-model { margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--text-3); }

/* 아직 안 온 것과 실패한 것은 다르게 보인다 */
.aud-block { margin: 0 0 14px; font-size: 13px; font-weight: 500; }
.aud-block.is-waiting { color: var(--text-2); }
.aud-block.is-failed { color: var(--no); }

/* --------------------------------------------------------------------------
   모션 최소화 — 연출을 전부 끄고 내용만 남긴다
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .ch-overlay,
  .ch-caption,
  .ch-actions { transition: none; }
  .ch-chick,
  .ch-chick .ch-eyes,
  .ch-figure,
  .ch-seat.talking .ch-figure,
  .ch-seat.waving .ch-chick,
  .ch-seat.applauding .ch-figure,
  .ch-seat.checking .ch-prop-script,
  .ch-house.giggling .ch-figure,
  .ch-house.spotted .ch-eye-ball,
  .ch-house.spotted .ch-eye-hi,
  .ch-house.settled .ch-seat:nth-child(2) .ch-eyes,
  .ch-eye-ball,
  .ch-pen-stroke,
  .ch-door-slit,
  .ch-door.leaving .ch-door-l,
  .ch-door.leaving .ch-door-r,
  .ch-dust,
  .ch-seat.seated,
  .ch-bubble,
  .ch-ref,
  .ch-typing i { animation: none !important; }
  /* 문·카메라 이동도 끈다. 2회차 즉시 입장과 같은 경로로 떨어진다 */
  .ch-door, .ch-door-leaf, .ch-house, .ch-head,
  .ch-seat[data-listening] .ch-torso,
  .ch-seat[data-listening] .ch-wing { transition: none !important; }
  .ch-overlay.at-door .ch-house { transform: none; }
  .ch-seat { opacity: 1; transform: none; }
  .ch-figure, .ch-ref { transform: none; }
  .ch-bubble { opacity: 1; transform: none; }
  /* 시차는 마우스 이동에만 걸리므로 JS 에서 아예 안 붙인다 (startParallax) */
  /* 밑줄 애니메이션을 껐으니 결과만 그대로 보여준다 (연출이 아니라 정보다) */
  .ch-seat[data-mood="grumpy"] .ch-pen-stroke { opacity: .55; }
}
