:root{font-family:system-ui,'Malgun Gothic',sans-serif;color:#fff5e8}*{box-sizing:border-box}body{margin:0;background:#110e12}.game{position:relative;width:min(100%,470px);height:100dvh;min-height:550px;margin:auto;overflow:hidden;background:#241922;box-shadow:0 0 80px #0008}.background{position:absolute;inset:0;background:linear-gradient(180deg,#110b1699 0%,transparent 25%,#150c1430 52%,#110c15b8 90%),url('image/bg/bg_1.webp') center/cover no-repeat}.top{position:absolute;z-index:10;top:0;left:0;right:0;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:max(12px,env(safe-area-inset-top)) 12px 10px;background:linear-gradient(#160e18cc,transparent)}.top>div{text-align:center}.top strong{display:block;font-size:17px}.top small{display:block;font-size:11px;color:#e6cfb4}.top button,.page-controls button,.history-head button{border:1px solid #e6cba277;border-radius:10px;background:#34251dcc;color:#fff0dd;padding:9px 11px;cursor:pointer}.actors{position:absolute;inset:65px 0 28%;pointer-events:none;display:flex;align-items:end;justify-content:center;z-index:1}.actor{width:54%;height:100%;position:relative;transition:filter .35s,opacity .35s,transform .35s;filter:brightness(.4);opacity:.78}.actor:first-child{margin-right:-8%;transform:translateX(-3%)}.actor:last-child{transform:translateX(3%)}.actor.active{filter:brightness(1);opacity:1;z-index:2}.actor img{width:100%;height:100%;object-fit:contain;object-position:center bottom;filter:drop-shadow(0 8px 16px #0008)}.actor span{position:absolute;bottom:15%;left:50%;transform:translateX(-50%);padding:4px 11px;background:#25151ca8;border-radius:20px;font-size:12px;white-space:nowrap}.dialogue-area{position:absolute;z-index:5;bottom:0;left:0;right:0;padding:8px 12px max(12px,env(safe-area-inset-bottom));background:linear-gradient(transparent,#0f0a12a8 8%,#0f0a12e8 100%)}.page-controls{display:flex;align-items:center;gap:7px;margin-bottom:7px}.page-controls button{font-size:12px;padding:8px 10px}.page-controls button:disabled{opacity:.4}.page-controls span{margin-left:auto;font-size:12px;white-space:nowrap}.dialogue{min-height:150px;max-height:31dvh;overflow:auto;background:#211a22ed;border:1px solid #d8b98c;border-radius:14px;padding:14px 16px;box-shadow:0 6px 25px #0009;cursor:pointer}.speaker{font-size:15px;font-weight:750;color:#e8c78e;margin-bottom:8px}.line{font-size:15px;line-height:1.8;white-space:pre-wrap;overflow-wrap:anywhere;min-height:75px}.dialogue.action .speaker{color:#bdb0c4}.dialogue.action .line{font-style:italic;color:#e2d4e3}.dialogue.user .speaker{color:#eebc91}.choices{display:flex;flex-wrap:wrap;gap:6px;max-height:105px;overflow:auto;padding:8px 0}.choices:empty{display:none}.choices button{border:1px solid #d5b48e;background:#4b352de8;color:#fff2e2;border-radius:18px;padding:8px 10px;font-size:12px;cursor:pointer}.composer{display:flex;gap:8px;margin-top:6px}.composer input{flex:1;min-width:0;border-radius:11px;padding:12px;border:1px solid #c9ad94;background:#fff9f2;color:#39291f;font-size:14px}.composer button{border:0;border-radius:11px;padding:0 17px;background:#e5c18b;color:#392619;font-weight:750;cursor:pointer}.history[hidden]{display:none}.history{position:absolute;z-index:30;inset:0;background:#09060bba;display:flex;align-items:center;justify-content:center;padding:18px}.history-box{width:100%;max-height:80%;overflow:hidden;display:flex;flex-direction:column;border:1px solid #c6a57b;background:#2c2229;border-radius:16px}.history-head{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;border-bottom:1px solid #806954}.history-box #historyContent{overflow:auto;padding:14px}.history-entry{padding:10px 0;border-bottom:1px solid #ffffff20;font-size:13px;line-height:1.6}.history-entry strong{color:#e8c78e}@media(min-width:701px){.game{height:min(100dvh,950px)}}@media(max-height:700px){.actors{bottom:33%}.dialogue{min-height:115px;max-height:27dvh}.line{min-height:50px}}

/* v2: 두 캐릭터 130% 확대, 좌우 간격 확장, 대기자는 불투명하게 어둡게 */
.actors{justify-content:space-between;overflow:hidden}
.actor{width:70.2%;flex:0 0 70.2%;opacity:1;filter:brightness(.38);transition:filter .35s ease,transform .35s ease}
.actor:first-child{margin-right:0;transform:translateX(-29%)}
.actor:last-child{transform:translateX(29%)}
.actor.active{opacity:1;filter:brightness(1);z-index:2}

/* v3: 확대 비율 유지, 두 인물을 화면 안쪽으로 이동 */
.actors{justify-content:center;overflow:hidden}
.actor{position:absolute;bottom:0;width:70.2%;height:100%;flex:none;opacity:1}
.actor:first-child{left:-8%;margin-right:0;transform:none}
.actor:last-child{right:-8%;transform:none}
.actor.active{opacity:1}

/* v4: 발언자는 원본 대비 1.3배, 대기자는 1.2배. 투명도 변화 없음. */
.actor{width:64.8%;flex-basis:64.8%;opacity:1;filter:brightness(.38)}
.actor.active{width:70.2%;flex-basis:70.2%;opacity:1;filter:brightness(1)}

/* AI 응답 중 전송 비활성화 */
.composer button:disabled{opacity:.5;cursor:wait}
.chat-status{position:absolute;right:12px;bottom:100%;font-size:12px;color:#f5d9b1;text-shadow:0 1px 4px #000}

/* v9: 추천 행동과 질문 칩 구분 */
.choices button.choice-action{background:#294a46;border-color:#8ac3ad;color:#e7fff4}
.choices button.choice-dialogue{background:#4b352de8;border-color:#d5b48e;color:#fff2e2}
.choices button:focus-visible,.dialogue:focus-visible{outline:2px solid #f4d9a0;outline-offset:2px}
/* 사용자의 말풍선은 기존 인물 대사와 구분되는 짙은 갈색 */
.dialogue.user{background:#513427f2;border-color:#e1ad76}
.dialogue.user .speaker{color:#ffd6a6}
.dialogue.user .line{color:#fff1e3}
/* 말풍선 왼쪽/오른쪽을 탭하면 각각 이전/다음 페이지로 이동 */
.dialogue{touch-action:pan-y;user-select:text}

/* v15: 기존 캐릭터 이미지의 중심 X/Y를 유지한 채 시각적 크기만 2배 확대.
   actor의 위치/크기는 건드리지 않고 이미지 자체만 중앙 기준으로 확대한다. */
   .actor img {
    transform: translateX(-40px)
               translateY(-180px)
               scale(2);
    transform-origin: center center;
}

.actor:last-child img {
    transform: translateX(40px)
               translateY(-180px)
               scale(2) scaleX(-1);
    transform-origin: center center;
}