/* 사람일까 AI일까 (act/turingchat.php) — 다크 패널(사이트 테마 무관), 모바일 우선 */
#tc-wrap{width:100%;margin:14px auto 0}   /* 플레이 영역은 본문 폭 100%(10-08 사용자 요청) */
#tc-game{position:relative;display:grid;width:100%;overflow:hidden;border-radius:22px;color:#fff;background:#0d1330;box-shadow:0 16px 42px rgba(10,15,40,.35)}
#tc-game>section{grid-area:1/1;min-width:0}
#tc-game>section[hidden]{display:none}
.tc-screen{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:26px 20px 24px;box-sizing:border-box;text-align:center;min-height:420px;background:radial-gradient(circle at 50% 14%,rgba(99,102,241,.3),transparent 40%),linear-gradient(160deg,rgba(13,19,48,.98),rgba(24,22,66,.98))}
.tc-screen h2{margin:0 0 8px;font-size:1.55rem;font-weight:900;word-break:keep-all;color:#fff;display:flex;align-items:center;gap:4px;justify-content:center}
.tc-screen p{max-width:620px;margin:0 0 14px;color:#cbd5e1;line-height:1.6;font-size:.92rem;word-break:keep-all}
.tc-screen p b{color:#fde68a}
.tc-faces{display:flex;align-items:center;gap:10px;font-size:2.6rem;line-height:1;margin-bottom:8px;filter:drop-shadow(0 9px 15px rgba(0,0,0,.3))}
.tc-faces em{font-style:italic;font-size:1rem;font-weight:900;color:#a5b4fc;letter-spacing:.05em}
.tc-faces.small{font-size:2rem}
.tc-faces.small em{font-size:1.4rem;color:#fde047}
.tc-stat-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;width:100%;max-width:520px;margin:2px 0 16px}
.tc-stat-grid div{padding:9px 6px;border-radius:14px;border:1px solid rgba(255,255,255,.14);background:rgba(8,12,40,.6)}
.tc-stat-grid small{display:block;color:#a5b4fc;font-size:.66rem;font-weight:800;letter-spacing:.03em}
.tc-stat-grid strong{display:block;margin-top:2px;font-size:1.18rem;font-weight:900;font-variant-numeric:tabular-nums;color:#fff}
.tc-stat-grid div:nth-child(2) strong{color:#86efac}
.tc-stat-grid div:nth-child(3) strong{color:#fde047}
.tc-btn{display:inline-flex;align-items:center;justify-content:center;min-width:220px;min-height:54px;padding:0 30px;border:0;border-radius:30px;cursor:pointer;font-family:inherit;font-size:1.08rem;font-weight:900;color:#fff;background:linear-gradient(135deg,#6366f1,#0ea5e9);box-shadow:0 10px 26px rgba(99,102,241,.45);touch-action:manipulation;-webkit-tap-highlight-color:transparent;transition:transform .12s}
.tc-btn:active{transform:translateY(2px)}
.tc-btn.ghost{background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.18);box-shadow:none;font-size:.95rem;min-height:46px;margin-top:10px;color:#dfe3f5}
.tc-btn:disabled{opacity:.6;cursor:default}
.tc-global{margin-top:14px;font-size:.82rem;color:#a5b4fc;font-weight:700}
.tc-global b{color:#fff}
.tc-note{display:block;margin-top:10px;font-size:.72rem;color:#8f97bd;line-height:1.5;word-break:keep-all}
/* 매칭 */
.tc-radar{position:relative;width:120px;height:120px;margin:0 auto 14px}
.tc-radar span{position:absolute;inset:0;border-radius:50%;border:2px solid rgba(99,102,241,.6);animation:tc-ping 2.1s ease-out infinite}
.tc-radar span:nth-child(2){animation-delay:.7s}.tc-radar span:nth-child(3){animation-delay:1.4s}
.tc-radar b{position:absolute;inset:30px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:2rem;font-weight:900;background:linear-gradient(135deg,#6366f1,#0ea5e9);box-shadow:0 8px 24px rgba(99,102,241,.5)}
@keyframes tc-ping{0%{transform:scale(.45);opacity:1}100%{transform:scale(1.15);opacity:0}}
.tc-dots{display:inline-flex;gap:3px;margin-left:4px;vertical-align:middle}
.tc-dots i{width:6px;height:6px;border-radius:50%;background:currentColor;opacity:.35;animation:tc-dot 1.2s infinite}
.tc-dots i:nth-child(2){animation-delay:.2s}.tc-dots i:nth-child(3){animation-delay:.4s}
@keyframes tc-dot{0%,80%,100%{opacity:.3;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}
/* 채팅 */
.tc-chat{display:flex;flex-direction:column;height:min(78vh,620px);min-height:440px;background:#0b1028}
.tc-head{display:flex;align-items:center;gap:10px;padding:10px 12px;background:rgba(5,8,28,.7);border-bottom:1px solid rgba(255,255,255,.08)}
.tc-ava{flex-shrink:0;width:40px;height:40px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-weight:900;font-size:1.2rem;background:linear-gradient(135deg,#6366f1,#0ea5e9)}
.tc-who{flex:1;min-width:0;line-height:1.2}
.tc-who b{display:block;font-size:.98rem}
.tc-who small{display:block;color:#a5b4fc;font-size:.72rem;font-weight:700;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tc-timer{position:relative;width:46px;height:46px;flex-shrink:0}
.tc-timer svg{width:46px;height:46px;transform:rotate(-90deg)}
.tc-timer circle{fill:none;stroke-width:4}
.tc-timer .bg{stroke:rgba(255,255,255,.12)}
.tc-timer .fg{stroke:#38bdf8;stroke-linecap:round;stroke-dasharray:106.8;stroke-dashoffset:0;transition:stroke-dashoffset 1s linear,stroke .3s}
.tc-timer.low .fg{stroke:#f43f5e}
.tc-timer b{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:.68rem;font-weight:900;font-variant-numeric:tabular-nums}
.tc-report{flex-shrink:0;width:38px;height:38px;border:0;border-radius:10px;background:rgba(255,255,255,.07);cursor:pointer;font-size:1rem}
.tc-log{flex:1;min-height:0;overflow-y:auto;padding:14px 12px 8px;display:flex;flex-direction:column;gap:8px;-webkit-overflow-scrolling:touch;overscroll-behavior:contain}
.tc-log>:first-child{margin-top:auto}   /* 카톡처럼 말풍선은 아래에서부터 쌓인다(10-09 사용자 요청) */
.tc-msg{max-width:min(78%,640px);padding:9px 13px;border-radius:18px;font-size:.95rem;line-height:1.45;word-break:break-word;animation:tc-in .18s ease-out}
.tc-msg.me{align-self:flex-end;background:linear-gradient(135deg,#6366f1,#4f46e5);border-bottom-right-radius:6px}
.tc-msg.them{align-self:flex-start;background:#1e2748;border-bottom-left-radius:6px}
.tc-msg.sys{align-self:center;max-width:92%;padding:5px 12px;border-radius:99px;font-size:.74rem;color:#a5b4fc;background:rgba(255,255,255,.06)}
.tc-msg.typing{align-self:flex-start;background:#1e2748;padding:11px 14px}
.tc-msg.typing .tc-dots{margin:0}.tc-msg.typing .tc-dots i{width:7px;height:7px;background:#a5b4fc}
@keyframes tc-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
.tc-turn{position:relative;margin:0 12px 6px;padding:5px 10px;border-radius:10px;font-size:.74rem;font-weight:800;color:#c7d2fe;background:rgba(255,255,255,.06);overflow:hidden;text-align:center}
.tc-turn i{position:absolute;left:0;bottom:0;height:3px;width:100%;background:#38bdf8;transform-origin:left;transition:transform 1s linear}
.tc-turn.them{color:#8f97bd}.tc-turn.them i{background:#64748b}
.tc-turn.nudge{animation:tc-nudge .36s ease-out}
@keyframes tc-nudge{0%,100%{transform:translateX(0)}25%{transform:translateX(-5px)}50%{transform:translateX(5px)}75%{transform:translateX(-3px)}}
.tc-form{display:flex;gap:8px;padding:0 12px 8px}
.tc-form input{flex:1;min-width:0;height:48px;border:1px solid rgba(255,255,255,.16);border-radius:14px;padding:0 14px;font-size:16px;color:#fff;background:#141b3d;outline:none;font-family:inherit}
.tc-form input:focus{border-color:#6366f1;box-shadow:0 0 0 3px rgba(99,102,241,.25)}
.tc-form input:disabled{opacity:.55}
.tc-form button{flex-shrink:0;width:52px;height:48px;border:0;border-radius:14px;cursor:pointer;font-size:1.1rem;color:#fff;background:linear-gradient(135deg,#6366f1,#0ea5e9);touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.tc-form button:disabled{opacity:.45;cursor:default}
.tc-quit{margin:0 12px 12px;padding:8px;border:0;border-radius:10px;background:transparent;color:#8f97bd;font-size:.76rem;font-weight:800;cursor:pointer;font-family:inherit}
/* 판정 */
.tc-choice{display:flex;gap:12px;width:100%;max-width:460px;margin:4px 0 10px}
.tc-pick{flex:1;display:flex;flex-direction:column;align-items:center;gap:4px;padding:18px 8px 14px;border:2px solid rgba(255,255,255,.14);border-radius:20px;background:rgba(255,255,255,.06);color:#fff;font-size:2.2rem;line-height:1;cursor:pointer;font-family:inherit;touch-action:manipulation;-webkit-tap-highlight-color:transparent;transition:transform .12s,border-color .15s}
.tc-pick b{font-size:1.05rem;font-weight:900}
.tc-pick.human:hover,.tc-pick.human.on{border-color:#86efac;background:rgba(134,239,172,.12)}
.tc-pick.ai:hover,.tc-pick.ai.on{border-color:#38bdf8;background:rgba(56,189,248,.12)}
.tc-pick:active{transform:scale(.97)}
.tc-pick:disabled{opacity:.5;cursor:default}
.tc-wait{color:#a5b4fc!important;font-weight:700}
/* 결과 */
.tc-result-badge{display:inline-block;padding:6px 16px;border-radius:99px;font-size:.86rem;font-weight:900;letter-spacing:.04em;margin-bottom:10px;background:#22c55e;color:#052e16}
.tc-result-badge.wrong{background:#f43f5e;color:#fff}
.tc-result-badge.none{background:#64748b;color:#fff}
.tc-rv-persona{color:#a5b4fc!important;font-size:.84rem!important;margin-top:-4px!important}
.tc-rv-judge{width:100%;max-width:560px;margin:0 0 14px;padding:12px 14px;border-radius:16px;background:rgba(255,255,255,.07);border:1px solid rgba(255,255,255,.12);font-size:.9rem;line-height:1.55;color:#e2e8f0;text-align:left;word-break:keep-all}
.tc-rv-judge b{color:#fde68a}
.tc-rv-judge small{display:block;margin-top:4px;color:#a5b4fc;font-size:.78rem}
.tc-rv-global{font-size:.78rem;color:#8f97bd;margin:-6px 0 14px;font-weight:700}
.tc-rv-global b{color:#c7d2fe}
#tc-meta{display:flex;justify-content:center;gap:18px;margin-top:10px;font-size:.82rem;color:var(--muted,#6b7280);font-weight:700}
#tc-meta b{color:var(--text,inherit)}
/* 규칙 박스 */
.tc-guide{text-align:left;line-height:1.7;margin-top:16px}
.tc-guide h3{font-size:1rem;margin:0 0 8px}
.tc-guide p{font-size:.88rem;margin:0 0 10px;word-break:keep-all}
.tc-guide table{width:100%;border-collapse:collapse;font-size:.84rem;margin:6px 0 12px}
.tc-guide th,.tc-guide td{padding:6px 8px;border-bottom:1px solid rgba(128,128,128,.2);text-align:left}
.tc-guide small{font-size:.78rem;color:var(--muted,#6b7280)}
@media (max-width:480px){.tc-screen{padding:22px 14px 20px;min-height:400px}.tc-screen h2{font-size:1.35rem}.tc-btn{width:100%}.tc-chat{height:min(74vh,600px)}.tc-msg{max-width:84%}}
/* 모바일 채팅(10-09 사용자 요청): 패널 안이 아니라 화면 전체를 덮는 고정 레이어 — 입력창이 화면 맨 아래에 붙고,
   키보드가 올라오면 js fitChat() 이 visualViewport 높이/오프셋을 인라인으로 넣어 입력창이 키보드 바로 위에 남는다(iOS 는 dvh 가 안 줄어든다).
   순서는 머리 → 로그 → 그만하기 → 턴 바 → 입력창. z-index 는 공유 토스트(99999)보다 위, 카메라 시트(2147483000)보다 아래 */
@media (max-width:700px){
  html.tc-lock,html.tc-lock body{overflow:hidden!important;height:100%;overscroll-behavior:none}
  .tc-chat:not([hidden]){position:fixed;left:0;top:0;width:100%;height:100vh;height:100dvh;min-height:0;max-height:none;z-index:100000;border-radius:0;box-sizing:border-box}
  .tc-chat:not([hidden]) .tc-head{order:0;padding-top:calc(10px + env(safe-area-inset-top,0px))}
  .tc-chat:not([hidden]) .tc-log{order:1}
  .tc-chat:not([hidden]) .tc-quit{order:2;margin:0 12px 2px;padding:6px}
  .tc-chat:not([hidden]) .tc-turn{order:3}
  .tc-chat:not([hidden]) .tc-form{order:4;padding-bottom:calc(10px + env(safe-area-inset-bottom,0px))}
  /* 축소 모드(키보드가 떠 있을 때, js 가 .kb 토글): 머리 여백·'그만하기' 줄을 줄여 로그에 자리를 더 준다 */
  .tc-chat.kb .tc-head{padding-top:5px;padding-bottom:5px}
  .tc-chat.kb .tc-quit{display:none}
  .tc-chat.kb .tc-log{padding-top:8px}
  .tc-chat.kb .tc-form{padding-bottom:6px}
}
@media (prefers-reduced-motion:reduce){.tc-radar span,.tc-dots i,.tc-msg{animation:none}}
