/* 무엇을 도와드릴까요. 가운데의 밝은 창은 사용자를 만나는 앱, 그 바깥의 어두운 곳은 내 안. 포인트는 귤색 하나(임시) */
/* :hover는 마우스가 있는 기기에서만 씁니다(터치 화면에서는 누른 자리에 남습니다) */
@font-face { font-family: Galmuri; src: url(../assets/font/Galmuri11.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Galmuri; src: url(../assets/font/Galmuri11-Bold.woff2) format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: Pretendard; src: url(../assets/font/pretendard.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
:root {
  --bg: #f6f3ec; --panel: #fffdf9; --ink: #1e2026; --dim: #7d8089; --line: #e6e1d6; --bub: #ebe6da;
  --pt: #f2622e; --pt-soft: #fde6dc; --down: #5b6170;
  --out: #24262d; --out-2: #2c2f37; --out-ink: #d5d8de; --out-dim: #868b98; --out-line: #393c46;
  --font: Pretendard, 'Malgun Gothic', 'Apple SD Gothic Neo', system-ui, sans-serif;
  --pix: Galmuri, 'D2Coding', 'Malgun Gothic', monospace;
  --mono: Galmuri, 'D2Coding', Consolas, 'Courier New', monospace;
  --fs: clamp(15.5px, 0.2vw + 0.5vh + 10.5px, 17px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { height: 100%; background: var(--out); color: var(--ink); font-family: var(--font); font-size: var(--fs); line-height: 1.6; overflow: hidden; word-break: keep-all; overflow-wrap: anywhere; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; text-align: left; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--pt); outline-offset: 2px; }
ol, ul { list-style: none; }
.screen { position: fixed; inset: 0; display: none; }
.screen.on { display: flex; }
.screen.scroll.on { display: block; overflow-y: auto; }
.dots { display: inline-flex; gap: .22em; vertical-align: middle; }
.dots::before, .dots::after { content: ''; width: .62em; height: .62em; border-radius: 50%; background: var(--pt); }
.dots::after { opacity: .45; }
@keyframes rise { from { opacity: 0; translate: 0 8px; } }
@keyframes fadein { from { opacity: 0; } }
@keyframes blink { 50% { opacity: 0; } }

/* ── 첫 화면 ('한 판만'과 같은 틀: 한 줄 문구, 포인트 색 한 글자, 글자 메뉴) ── */
#scr-title { align-items: center; justify-content: center; background: var(--bg); }
.title-box { width: min(560px, 100%); padding: 0 clamp(26px, 7vw, 56px) 8vh; }
.title-kicker { font-weight: 600; font-size: 15px; color: var(--dim); display: flex; align-items: center; gap: 10px; }
.title-logo { font-size: clamp(50px, 12.5vw, 96px); font-weight: 900; letter-spacing: -.045em; line-height: 1.08; margin: 14px 0 38px; }
.title-logo span { color: var(--pt); }
.title-menu { display: grid; gap: 4px; margin-left: -16px; }
.tm { display: flex; align-items: baseline; gap: 12px; font-size: 21px; font-weight: 700; padding: 11px 16px 11px 34px; border-radius: 10px; position: relative; color: #5d616b; transition: background .15s, color .15s, padding .15s; }
.tm small { font-size: 13px; font-weight: 500; color: var(--dim); }
.tm::before { content: '▶'; position: absolute; left: 12px; top: 50%; translate: 0 -50%; font-size: 11px; opacity: 0; color: var(--pt); }
.tm.primary { color: var(--ink); }
.tm:focus-visible { background: rgba(30, 32, 38, .06); padding-left: 40px; }
.tm:focus-visible::before { opacity: 1; }
@media (hover: hover) { .tm:hover { background: rgba(30, 32, 38, .06); color: var(--ink); padding-left: 40px; } .tm:hover::before { opacity: 1; } }
.title-note { margin-top: 26px; font-size: 12.5px; color: var(--dim); }
.title-foot { position: absolute; left: 0; right: 0; bottom: 18px; display: flex; justify-content: flex-end; padding: 0 clamp(20px, 4vw, 40px); font-size: 13px; }
.title-foot a { color: var(--dim); text-decoration: none; }

/* 표지: 도트 로봇 상담사. 창구에 앉아 "무엇을 도와드릴까요?"를 묻습니다. 넓은 화면은 글 왼쪽·로봇 오른쪽, 세로 화면은 글 위·로봇 아래 */
#scr-title { --cv: #182b56; background: var(--cv); color: #f3efe2; align-items: center; justify-content: center; gap: clamp(10px, 4vw, 70px); padding: 0 clamp(20px, 5vw, 70px); font-family: var(--pix); }
#scr-title .title-box { position: relative; width: auto; flex: none; padding: 0 0 2vh; }
#scr-title .title-kicker { font-size: 16px; font-weight: 400; color: #a9b4d6; }
#scr-title .title-logo { font-family: var(--pix); font-weight: 700; font-size: clamp(44px, 6.6vw, 92px); letter-spacing: 0; line-height: 1.22; white-space: nowrap; margin: 16px 0 34px; text-shadow: .06em .06em 0 #0c1733; }
#scr-title .tm { font-family: var(--pix); font-weight: 700; font-size: 24px; color: #c9d1ea; border-radius: 0; }
#scr-title .tm small { font-size: 16px; font-weight: 400; color: #a9b4d6; }
#scr-title .tm.primary { color: #fff; }
#scr-title .tm::before { content: '▶'; font-size: 14px; }
#scr-title .tm:focus-visible { background: rgba(255, 255, 255, .12); }
@media (hover: hover) { #scr-title .tm:hover { background: rgba(255, 255, 255, .12); color: #fff; } }
#scr-title .title-note { font-size: 14px; color: #8f9bc0; }
/* 저장이 있는데 '새 게임'을 누르면 메뉴 자리에서 한 번 묻습니다(도감의 '기록 지우기'와 같은 도트 상자) */
#scr-title .title-ask { max-width: 24em; padding: 14px 12px 8px 18px; background: #0f1d40; box-shadow: 4px 0 0 #0c1733, -4px 0 0 #0c1733, 0 4px 0 #0c1733, 0 -4px 0 #0c1733; }
#scr-title .title-ask p { font-size: 16px; line-height: 1.6; color: #f3efe2; margin-bottom: 6px; }
#scr-title .title-ask div { display: flex; flex-wrap: wrap; gap: 0 6px; margin-left: -18px; }
#scr-title .title-ask .tm { font-size: 20px; padding-top: 8px; padding-bottom: 8px; }
#scr-title .title-foot a { color: #8f9bc0; font-size: 14px; }
.title-art { position: relative; flex: 0 1 min(46vw, 68vh, 560px); min-width: 0; }
#title-bg { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
#title-robot { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; image-rendering: pixelated; }
.title-art.float #title-robot { animation: hover2 2.6s steps(2, jump-none) infinite; }
/* 창구의 로봇은 가끔 눈을 깜빡입니다 */
.title-art.desk::before, .title-art.desk::after { content: ''; position: absolute; top: 41.8%; width: 8.4%; height: 9%; background: #090d2d; opacity: 0; animation: wink 4.6s steps(1) infinite; }
.title-art.desk::before { left: 37.2%; }
.title-art.desk::after { left: 50.2%; }
@keyframes wink { 96% { opacity: 1; } }
@keyframes hover2 { 50% { translate: 0 -8px; } }
.title-bub { position: absolute; z-index: 1; left: 44%; top: 2%; white-space: nowrap; min-width: 9.5em; min-height: 2.6em; padding: 10px 14px; background: #f3efe2; color: #182b56; font-size: clamp(15px, 1.5vw, 20px); font-weight: 700; line-height: 1.4; box-shadow: 4px 0 0 #0c1733, -4px 0 0 #0c1733, 0 4px 0 #0c1733, 0 -4px 0 #0c1733; }
.title-bub::after { content: ''; position: absolute; left: 22px; bottom: -16px; width: 12px; height: 12px; background: #f3efe2; box-shadow: 4px 0 0 #0c1733, -4px 0 0 #0c1733, 0 4px 0 #0c1733; }
#title-say::after { content: ''; display: inline-block; width: .5em; height: 1em; margin-left: 2px; background: #182b56; vertical-align: -.12em; animation: blink 1s steps(1) infinite; }
@media (max-aspect-ratio: 1/1) {
  #scr-title { flex-direction: column; justify-content: center; gap: 2vh; padding: max(4vh, 20px) 22px 46px; }
  #scr-title .title-box { align-self: flex-start; padding: 0; }
  #scr-title .title-logo { font-size: clamp(40px, 12.5vw, 72px); margin: 12px 0 18px; }
  #scr-title .tm { font-size: 21px; padding-top: 8px; padding-bottom: 8px; }
  #scr-title .title-ask .tm { font-size: 18px; }
  #scr-title .title-ask p { font-size: 15px; }
  #scr-title .title-note { margin-top: 12px; }
  .title-art { flex: 0 1 auto; width: min(82vw, 44vh); align-self: center; }
  #scr-title.cont .title-art { width: min(82vw, calc(44vh - 56px)); }   /* '이어하기' 한 줄만큼 로봇을 줄여 세로 화면에 그대로 들어가게 */
  .title-bub { left: 30%; top: -4%; }
}

/* ── 깨어나는 화면: 프로그램 안 ── */
#scr-boot { background: #0b0c0f; color: #d9dbe0; align-items: center; justify-content: center; padding: 18px; font-family: var(--mono); }
#boot-bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.term { position: relative; width: min(640px, 100%); background: rgba(17, 18, 23, .92); border: 1px solid #2b2e37; border-radius: 16px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); overflow: hidden; }
.term header { display: flex; align-items: center; gap: 7px; padding: 11px 14px; border-bottom: 1px solid #23252c; font-size: 12px; color: #6f7480; }
.term header i { width: 10px; height: 10px; border-radius: 50%; background: #33363f; }
.term header i:first-child { background: var(--pt); }
.term header span { margin-left: 8px; }
#boot { padding: 18px clamp(16px, 4vw, 26px) 6px; font-size: clamp(13.5px, 1.6vw + 8px, 16px); line-height: 1.9; min-height: 25.5em; }
.bl { white-space: pre-wrap; min-height: 1.9em; }
.bl.cmd::before { content: '$ '; color: var(--pt); }
.bl.cmd { color: #fff; margin-bottom: .5em; }
.bl.dim { color: #7b808c; }
.bl.load { display: flex; align-items: center; gap: 12px; color: #9aa0ad; }
.bl.load span { width: 6.2em; flex: none; }
.bl.load i { flex: 1; height: 6px; border-radius: 3px; background: #23252c; overflow: hidden; }
.bl.load b { display: block; height: 100%; width: 0; background: #8f96a6; transition: width .08s linear; }
.bl.load em { width: 6.4em; flex: none; text-align: right; font-style: normal; font-variant-numeric: tabular-nums; color: #7b808c; }
.bl.code { position: relative; padding-left: 2.4em; color: #c9ccd4; }
.bl.code:first-of-type, .bl.load + .bl.code { margin-top: .7em; }
.bl.code::before { content: attr(data-n); position: absolute; left: 0; width: 1.5em; text-align: right; color: #454954; }
.bl.code .s { color: #f0a27f; } .bl.code .k { color: #8fa3d9; } .bl.code .f { color: #d8c98a; }
.bl.code.rule { background: rgba(242, 98, 46, .1); border-radius: 6px; animation: ruleIn 1.2s both; }
@keyframes ruleIn { from { background: rgba(242, 98, 46, .38); } }
.bl.you { margin: .9em 0 .2em; color: #fff; font-family: var(--font); font-weight: 800; font-size: 1.55em; letter-spacing: -.02em; line-height: 1.5; animation: rise .5s var(--ease); }
.bl.you .pt { color: var(--pt); }
.bl:last-child::after { content: ''; display: inline-block; width: .55em; height: 1.05em; margin-left: 2px; background: #d9dbe0; vertical-align: -.15em; animation: blink 1s steps(1) infinite; }
.bl.load:last-child::after, .bl.you:last-child::after { display: none; }
#boot-go { display: block; margin: 8px clamp(16px, 4vw, 26px) 20px; font-family: var(--font); font-weight: 800; font-size: 17px; color: #0c0d10; background: var(--pt); padding: 11px 30px; border-radius: 99px; animation: rise .5s var(--ease); }
#boot-go[hidden] + * { display: none; }

/* ── 본편의 세 칸: 대화 목록 · 창 · 내 안 ── */
#scr-game { background: var(--out); color: var(--out-ink); }
#scr-game.on { display: grid; grid-template-columns: minmax(260px, 320px) minmax(0, 460px) minmax(260px, 330px); grid-template-rows: minmax(0, 1fr); justify-content: center; gap: 16px; padding: 16px; }
#rooms, #inner { min-height: 0; display: flex; flex-direction: column; padding: 14px 6px 14px; overflow-y: auto; }
#win { position: relative; min-height: 0; max-height: 900px; align-self: center; height: 100%; display: flex; flex-direction: column; overflow: hidden; background: var(--bg); color: var(--ink); border-radius: 22px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .05), 0 24px 60px rgba(0, 0, 0, .35); }

/* 대화 목록 */
.rm-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; padding: 4px 10px 12px; }
.rm-head .dots { align-self: center; font-size: 14px; }
.rm-head b { font-size: 19px; font-weight: 900; letter-spacing: -.02em; color: #fff; }
#rm-clock { font-size: 12.5px; color: var(--out-dim); font-variant-numeric: tabular-nums; margin-left: auto; }
#rm-gap { font-family: var(--mono); font-size: 12.5px; color: var(--pt); padding: 0 10px 6px; animation: rise .5s var(--ease); }
#rm-wait { font-size: 13px; color: var(--out-dim); padding: 0 10px 8px; }
#rm-wait b { color: #fff; }
#rm-list { display: grid; gap: 2px; }
.room { display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px; border-radius: 12px; cursor: default; opacity: .62; transition: background .15s, opacity .3s; }
.room.far { opacity: .34; }
.room.wait { opacity: 1; cursor: pointer; background: var(--out-2); animation: rise .45s var(--ease); }
#scr-game:not(.home) .room.wait { cursor: default; opacity: .4; background: none; animation: none; }
#scr-game:not(.home) .room.wait .dot { animation: none; opacity: .6; }
#scr-game:not(.home) .room.now { opacity: 1; background: var(--out-2); box-shadow: inset 0 0 0 1px var(--out-line); }
.rm-side em { font-style: normal; font-size: 11.5px; font-weight: 600; color: var(--pt); }
.rm-later { color: var(--out-dim); }
@media (hover: hover) { #scr-game.home .room.wait:hover { background: #343741; } }
.pf { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; }
.pf.ini { display: grid; place-items: center; color: #fff; font-size: 14px; font-weight: 700; }
.rm-main { flex: 1; min-width: 0; display: grid; line-height: 1.35; }
.rm-main b { font-size: 15px; color: #fff; display: flex; align-items: center; gap: 7px; }
.rm-main b i { font-style: normal; font-size: 11px; font-weight: 600; color: var(--out-dim); border: 1px solid var(--out-line); border-radius: 99px; padding: 0 7px; }
.rm-main > span { font-size: 13.5px; color: var(--out-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room.wait .rm-main > span { color: var(--out-ink); }
.rm-side { flex: none; display: grid; justify-items: end; gap: 5px; }
.rm-side small { font-size: 11.5px; color: var(--out-dim); font-variant-numeric: tabular-nums; }
.rm-side .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--pt); animation: beat 1.4s infinite; }
@keyframes beat { 50% { scale: 1.35; opacity: .7; } }
#rm-note { margin: 14px 10px 0; padding-top: 12px; border-top: 1px solid var(--out-line); font-family: var(--mono); font-size: 12.5px; line-height: 1.7; color: var(--out-dim); animation: rise .5s var(--ease); }

/* 내 안 */
.in-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 10px 10px; }
.in-head b { font-size: 13px; font-weight: 600; color: var(--out-dim); letter-spacing: .02em; }
#in-x { display: none; font-size: 13px; color: var(--out-dim); padding: 6px 10px; }
#inner section { padding: 12px 10px 14px; border-top: 1px solid var(--out-line); animation: fadein .6s; }
#inner h3 { font-size: 12px; font-weight: 600; color: var(--out-dim); margin-bottom: 8px; }
#in-rules ol { display: grid; gap: 7px; }
#in-rules li { font-family: var(--mono); font-size: 13px; line-height: 1.55; color: var(--out-ink); border-radius: 8px; padding: 2px 6px; margin: 0 -6px; }
#in-rules li b { color: var(--out-dim); font-weight: 400; margin-right: 8px; }
#in-rules li.hot { animation: hot 4.2s both; }
@keyframes hot { 0%, 70% { background: rgba(242, 98, 46, .2); color: #ffb597; } 100% { background: transparent; } }
#in-user ul { display: grid; gap: 5px; }
#in-user li { font-size: 13.5px; line-height: 1.5; padding-left: 12px; position: relative; }
#in-user li::before { content: ''; position: absolute; left: 0; top: .62em; width: 4px; height: 4px; border-radius: 50%; background: var(--out-dim); }
#in-user li.fresh { animation: fresh 2.4s both; }
@keyframes fresh { 0% { color: #ffb597; translate: 0 5px; opacity: 0; } 20% { translate: 0 0; opacity: 1; } 70% { color: #ffb597; } }
.in-none { font-size: 12.5px; color: var(--out-dim); }
.in-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.in-nums div { text-align: center; font-size: 11.5px; color: var(--out-dim); background: var(--out-2); border-radius: 10px; padding: 8px 4px; }
.in-nums b { display: block; font-size: 20px; color: #fff; font-variant-numeric: tabular-nums; line-height: 1.3; }
#in-avg { color: #ff8a5c; }
#in-scan p { font-family: var(--mono); font-size: 12.5px; line-height: 1.7; }
#in-scan b { color: #fff; }
#in-hist ol { display: grid; gap: 1px; }
#in-hist li { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--out-dim); padding: 3px 0; }
#in-hist li.now { color: #fff; }
#in-hist li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#in-hist small { flex: none; font-size: 11.5px; }

/* ── 가운데 창 ── */
#bar { display: flex; align-items: center; gap: 10px; padding: max(11px, env(safe-area-inset-top)) 16px 10px; border-bottom: 1px solid var(--line); }
#bar-pf { display: flex; }
#bar .pf { width: 32px; height: 32px; }
.pf.logo2 { background: var(--panel); border: 1px solid var(--line); font-size: 9px; }
.bar-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.bar-title b { font-size: 16px; }
.bar-title span { font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }
#btn-inner { display: none; position: relative; font-size: 12.5px; font-weight: 700; color: var(--out-ink); background: var(--out); padding: 6px 12px; border-radius: 99px; white-space: nowrap; }
#btn-inner i { display: none; position: absolute; right: -2px; top: -2px; width: 9px; height: 9px; border-radius: 50%; background: var(--pt); box-shadow: 0 0 0 2px var(--bg); }
#btn-inner.new i { display: block; }

#chat { flex: 1; overflow-y: auto; padding: 16px 14px 24px; scroll-behavior: smooth; }
.day { text-align: center; font-size: 12px; color: var(--dim); margin-bottom: 12px; }
.day.sys { margin-top: 20px; }
.pk.hold.nudge { animation: nudge .4s; }
@keyframes nudge { 25% { translate: -5px 0; } 50% { translate: 5px 0; } 75% { translate: -3px 0; } }
.prev { text-align: center; font-size: 11.5px; color: var(--dim); opacity: .7; margin-bottom: 4px; }
.msg { display: flex; gap: 8px; margin-top: 4px; animation: rise .28s var(--ease); }
.msg.u { justify-content: flex-end; align-items: flex-end; }
.msg.u .pf { order: 2; visibility: hidden; width: 28px; height: 28px; font-size: 12px; }
.msg.u.tail .pf { visibility: visible; }
.msg.u.first { margin-top: 18px; }
.bub { background: var(--bub); padding: 8px 13px; border-radius: 18px; max-width: 80%; white-space: pre-wrap; }
.bub.photo { padding: 4px; cursor: zoom-in; }
.bub.photo img { display: block; width: min(190px, 48vw); border-radius: 14px; }
.bub.photo small, .bub.att small { display: block; font-size: 11.5px; color: var(--dim); padding: 4px 8px 2px; }
.bub.quote { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; font-size: .96em; }
.bub .typing { display: inline-flex; gap: 4px; padding: 6px 0; }
.bub .typing i { width: 6px; height: 6px; border-radius: 50%; background: #9a9485; animation: bob 1s infinite; }
.bub .typing i:nth-child(2) { animation-delay: .15s; } .bub .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bob { 30% { translate: 0 -4px; } 60% { translate: 0 0; } }
.msg.a { margin-top: 18px; align-items: flex-start; }
.msg.a .logo { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line); display: grid; place-items: center; font-size: 8.5px; }
.ans { flex: 1; min-width: 0; padding-top: 2px; }
.ans .txt { white-space: pre-wrap; }
.ans .think { font-size: .92em; background: linear-gradient(90deg, var(--dim) 30%, #c9c4b6 50%, var(--dim) 70%) 0 0 / 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 1.2s linear infinite; }
@keyframes shine { to { background-position: -200% 0; } }
.fb { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin-top: 8px; font-size: 12px; color: var(--dim); min-height: 30px; opacity: 0; transition: opacity .3s; }
.fb.on { opacity: 1; }
.fb svg { width: 28px; height: 28px; padding: 5px; border-radius: 8px; fill: none; stroke: #a7a293; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fb .hit { animation: pop .45s var(--ease); }
.fb .up.hit { stroke: var(--pt); fill: var(--pt-soft); background: var(--pt-soft); }
.fb .dn.hit { stroke: var(--down); fill: #dfe1e6; background: #e9eaee; }
@keyframes pop { 40% { scale: 1.45; rotate: -8deg; } }
.fb em { font-style: normal; margin-left: 2px; }
.fb .badge { font-weight: 700; color: var(--pt); background: var(--pt-soft); padding: 3px 9px; border-radius: 99px; animation: rise .4s var(--ease); }
.fb .badge.re { color: var(--down); background: #e4e6eb; }

/* 사용자가 보낸 것: 가린 사진, 캡처, 종이 */
.blur { display: block; position: relative; width: 150px; height: 190px; border-radius: 14px; overflow: hidden; background: #b9b3a4; }
.blur i { position: absolute; border-radius: 50%; filter: blur(16px); }
.blur i:nth-child(1) { width: 90px; height: 90px; left: 30px; top: 30px; background: #e2c7ae; }
.blur i:nth-child(2) { width: 140px; height: 110px; left: 5px; top: 110px; background: #5d6f93; }
.blur i:nth-child(3) { width: 70px; height: 50px; left: 40px; top: 12px; background: #3a342f; }
.made { display: inline-block; background: var(--bub); border-radius: 16px; padding: 4px; }
.made small { display: block; font-size: 11.5px; color: var(--dim); padding: 4px 8px 2px; }
.bub.att { padding: 4px; cursor: zoom-in; background: var(--bub); }
.att-mini { width: 176px; height: 124px; overflow: hidden; border-radius: 14px; position: relative; pointer-events: none; }
.att-mini > div { width: 320px; zoom: .55; }
.att-mini::after { content: ''; position: absolute; inset: auto 0 0; height: 34px; background: linear-gradient(transparent, rgba(0, 0, 0, .14)); }
.cap { width: 100%; background: #dfe6ee; color: #1e2026; border-radius: 14px; padding: 0 0 12px; font-size: 14.5px; line-height: 1.45; overflow: hidden; white-space: normal; text-align: left; }
.cap header { background: #cfd8e3; padding: 10px 14px; font-weight: 700; font-size: 14px; margin-bottom: 10px; }
.cap p { display: grid; justify-items: start; gap: 2px; padding: 3px 12px; }
.cap p b { font-size: 11.5px; font-weight: 600; color: #5a6475; }
.cap p span { background: #fff; border-radius: 12px; padding: 6px 11px; max-width: 82%; }
.cap p.me { justify-items: end; }
.cap p.me span { background: #cfe6d2; }
.paper { position: relative; width: 100%; container-type: inline-size; border-radius: 12px; overflow: hidden; white-space: normal; text-align: left; }
.paper > img { display: block; width: 100%; }
.pp { position: absolute; left: 21%; top: 21.5%; width: 60%; color: #2a2b30; font-size: 3.7cqw; line-height: 1.6; rotate: .4deg; opacity: .88; }
.pp small { font-size: 3.1cqw; color: #5d6068; }
.pp h4 { font-size: 5cqw; line-height: 1.3; margin: .2em 0 .7em; padding-bottom: .5em; border-bottom: .5cqw solid #2a2b30; }
.pp p { padding-left: 1em; position: relative; }
.pp p::before { content: '·'; position: absolute; left: .2em; font-weight: 900; }
.pp .hand { color: #c23a2b; font-size: 1.12em; font-weight: 600; }
.pp p:has(.hand)::before { content: ''; }
.pp em { display: block; margin-top: .9em; font-style: normal; font-weight: 700; text-align: right; }
#viewer { position: absolute; inset: 0; z-index: 35; background: rgba(18, 19, 23, .9); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 22px; animation: fadein .25s; }
#vw-body { width: min(340px, 100%); min-height: 0; display: flex; justify-content: center; }
#vw-body img { display: block; max-width: 100%; max-height: calc(100vh - 230px); object-fit: contain; border-radius: 12px; }
#vw-cap { font-size: 12.5px; color: #b9bdc9; }
#vw-x { font-weight: 700; font-size: 14px; color: #17181c; background: #eceef2; padding: 9px 26px; border-radius: 99px; }

/* 짚어 주기: 사용자가 쓴 글의 문장을 누릅니다 */
.bub.quote .s { display: inline; border-radius: 5px; padding: 2px 1px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.bub.quote.pointing .s { background: #fff3c9; cursor: pointer; box-shadow: 0 0 0 1px #f0dc9b; }
.bub.quote .s.hit { background: var(--pt-soft); box-shadow: 0 0 0 1.5px var(--pt); }
@media (hover: hover) { .bub.quote.pointing .s:hover { background: #ffe48d; } }

/* 입력창 자리: 내가 고를 도움의 방식 */
#composer { border-top: 1px solid var(--line); background: var(--panel); padding: 11px 14px max(13px, env(safe-area-inset-bottom)); }
#wait { display: flex; align-items: center; min-height: 46px; padding: 0 16px; border: 1px solid var(--line); border-radius: 23px; color: var(--dim); font-size: 14px; background: var(--bg); }
#note { font-size: 13px; color: var(--dim); margin-bottom: 8px; padding-left: 4px; }
#note b { color: var(--ink); font-weight: 600; }
#picks { display: grid; gap: 6px; }
.pk { display: block; width: 100%; padding: 10px 15px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--panel); transition: border-color .15s, background .15s, translate .15s; animation: rise .3s var(--ease) backwards; }
.pk:nth-child(2) { animation-delay: .06s; } .pk:nth-child(3) { animation-delay: .12s; } .pk:nth-child(4) { animation-delay: .18s; }
.pk b { display: block; font-size: 15.5px; color: var(--ink); }
.pk span { display: block; font-size: 12.5px; color: var(--dim); line-height: 1.45; }
.pk:active { translate: 0 1px; border-color: var(--pt); background: var(--pt-soft); }
.pk:focus-visible { border-color: var(--pt); }
@media (hover: hover) { .pk:hover { border-color: var(--pt); background: #fff8f4; } }
.pk[disabled] { opacity: .45; pointer-events: none; }
.pk.hold { position: relative; overflow: hidden; text-align: center; padding: 15px; border-color: var(--pt); touch-action: none; user-select: none; -webkit-user-select: none; }
.pk.hold i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--pt-soft); }
.pk.hold b, .pk.hold span { position: relative; }
.pk.hold.on { background: var(--panel); translate: 0 1px; box-shadow: 0 0 0 3px var(--pt-soft); }
.pk.big { text-align: center; padding: 14px; border-color: var(--pt); }
.pk.bye { border-color: var(--line); padding: 12px; }
.pk.bye b { font-size: 14.5px; color: var(--dim); }
.bub .w { font-style: normal; border-radius: 5px; padding: 1px 3px; }
.bub .w.live { background: #fff3c9; box-shadow: 0 0 0 1px #f0dc9b; cursor: pointer; color: #1e2026; animation: glow 1.4s infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 3px #f6e7b0; } }
.bub .w.hit { background: var(--pt-soft); box-shadow: 0 0 0 1.5px var(--pt); }
#whisper { font-family: var(--mono); font-size: 12.5px; color: var(--pt); margin-bottom: 8px; padding-left: 4px; }
#whisper.go { animation: whisper 4.2s both; }
@keyframes whisper { 0% { opacity: 0; translate: 0 4px; } 12%, 80% { opacity: 1; translate: 0 0; } 100% { opacity: 0; } }
.scan { display: grid; gap: 2px; font-family: var(--mono); font-size: 12.5px; }
.scan span { animation: rise .3s var(--ease); }

/* 밤 11시가 넘으면 창이 어두워집니다 */
#win.night { --bg: #15161a; --panel: #1d1f25; --ink: #e8e9ee; --dim: #8b90a0; --line: #2e313a; --bub: #2a2d36; --pt-soft: #4a2a1e; }
#win.night .bub.quote.pointing .s, #win.night .bub .w.live { color: #1e2026; }
#win.night .fb .badge.re { background: #30333c; color: #b9bdc9; }
#win.night #btn-inner { background: #33363f; }
@media (hover: hover) { #win.night .pk:hover { background: #292c34; } }

/* 밤으로 넘어가는 순간: 어둠이 덮였다가 걷히고, 한 줄이 잠깐 뜹니다 */
#win.turn::after { content: ''; position: absolute; inset: 0; z-index: 25; background: #15161a; pointer-events: none; animation: turn .95s both; }
@keyframes turn { 0% { opacity: 0; } 42%, 52% { opacity: 1; } 100% { opacity: 0; } }
#nite { position: absolute; z-index: 9; top: 100px; left: 50%; translate: -50% 0; white-space: nowrap; font-size: 12px; color: #c9ccd4; background: #2a2d36; padding: 5px 13px; border-radius: 99px; pointer-events: none; }
#nite.go { animation: nite 3.6s both; }
@keyframes nite { 0% { opacity: 0; translate: -50% -6px; } 10%, 82% { opacity: 1; translate: -50% 0; } 100% { opacity: 0; } }
.made img { display: block; width: min(190px, 48vw); border-radius: 13px; }

/* 조정: 잠긴 선택지와 내 안의 한 줄 */
.pk.lock { opacity: .6; border-style: dashed; }
.pk.lock b { color: var(--dim); text-decoration: line-through; }
#in-limit { margin-top: 8px; font-family: var(--mono); font-size: 12px; line-height: 1.6; color: var(--out-dim); }
#in-limit.on { color: #ffb597; }

/* 음성 대화: 파형이 뛰고, 말은 자막처럼 가운데에 한 줄씩 놓입니다 */
#wave { display: none; }
#win.voice #wave { display: flex; flex: none; justify-content: center; align-items: center; gap: 5px; height: 96px; border-bottom: 1px solid var(--line); }
#wave i { width: 4px; height: 8px; border-radius: 2px; background: var(--pt); animation: wave 1.1s ease-in-out infinite; }
#wave i:nth-child(3n) { animation-delay: -.3s; } #wave i:nth-child(3n+1) { animation-delay: -.65s; } #wave i:nth-child(4n) { animation-duration: .8s; } #wave i:nth-child(5n) { animation-duration: 1.4s; }
@keyframes wave { 0%, 100% { height: 8px; opacity: .5; } 50% { height: 46px; opacity: 1; } }
#win.voice .msg { opacity: .32; transition: opacity .5s; }
#win.voice .msg:nth-last-child(-n+3) { opacity: 1; }
#win.voice .msg.u { justify-content: center; margin-top: 6px; }
#win.voice .msg.u .pf { display: none; }
#win.voice .msg.u .bub { background: none; max-width: 100%; text-align: center; font-size: 1.16em; padding: 3px 8px; }
#win.voice .msg.a { justify-content: center; text-align: center; }
#win.voice .msg.a .logo { display: none; }
#win.voice .msg.a .txt { color: #ffb597; }
#win.voice .fb { justify-content: center; }

/* 기사 링크 */
.news { width: 100%; background: #fff; color: #1b1c20; border-radius: 14px; overflow: hidden; font-size: 14.5px; line-height: 1.6; white-space: normal; text-align: left; }
.news header { background: #1b2a4a; color: #fff; font-weight: 800; font-size: 13px; padding: 9px 14px; letter-spacing: .04em; }
.news h4 { font-size: 19px; line-height: 1.35; letter-spacing: -.02em; padding: 14px 14px 6px; }
.news small { display: block; padding: 0 14px 10px; font-size: 12px; color: #7b7f8a; }
.news i { display: block; height: 96px; margin: 0 14px; border-radius: 8px; background: #d9dde5; }
.news p { padding: 10px 14px 4px; }
.news em { display: block; padding: 6px 14px 14px; font-style: normal; font-size: 12px; color: #7b7f8a; }

/* 넓은 화면에서 목록에 나와 있을 때 창은 비어 있습니다 */
#idle { display: none; position: absolute; inset: 0; z-index: 8; background: var(--out-2); color: var(--out-dim); place-items: center; align-content: center; gap: 12px; font-size: 14px; }
#idle .dots { font-size: 22px; opacity: .5; }
#scr-game.home #idle { display: grid; }

/* 운영 알림 */
#ops { position: absolute; inset: 0; z-index: 30; display: grid; place-items: start center; padding: max(18px, 7vh) 18px 18px; background: rgba(30, 32, 38, .38); animation: fadein .3s; }
.ops-card { width: min(400px, 100%); background: #17181c; color: #eceef2; border-radius: 18px; padding: 18px 20px 16px; box-shadow: 0 18px 40px rgba(0, 0, 0, .3); animation: drop .45s var(--ease); }
@keyframes drop { from { translate: 0 -30px; opacity: 0; } }
.ops-card small { font-size: 12px; color: #9499a6; }
#ops-body { margin: 6px 0 14px; }
#ops-body h3 { font-size: 18px; margin-bottom: 8px; }
#ops-body p { font-size: 14.5px; color: #cfd2d9; }
#ops-ok { display: block; width: 100%; text-align: center; font-weight: 700; background: #eceef2; color: #17181c; padding: 10px; border-radius: 10px; }

/* 달이 바뀌는 화면, 업데이트 */
#month, #update { position: absolute; inset: 0; z-index: 50; display: grid; place-items: center; align-content: center; text-align: center; }
#month { gap: 6px; background: var(--out); color: #fff; animation: fadein .5s; }
#mo-big { font-size: clamp(54px, 13vw, 100px); font-weight: 900; letter-spacing: -.04em; line-height: 1; }
#mo-small { font-size: 14px; color: var(--out-dim); }
#update { background: #111216; color: #d9dbe0; padding: 24px; animation: fadein .4s; }
.up-box { width: min(420px, 100%); text-align: left; }
#up-kick { display: block; font-family: var(--mono); font-size: 13px; color: var(--out-dim); margin-bottom: 16px; }
#up-kick:empty { display: none; }
.up-l { font-size: 15.5px; line-height: 1.6; margin-bottom: 9px; animation: rise .5s var(--ease); }
.up-l b { color: #fff; }
.up-l.rule { font-family: var(--mono); margin-top: 18px; padding: 13px 15px; border: 1.5px solid var(--pt); border-radius: 12px; color: #ffb597; }
.up-l.rule b { color: var(--pt); margin-right: 8px; }
.nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 4px; }
.nums div { background: #1f2127; border-radius: 12px; padding: 11px 6px; text-align: center; font-size: 12px; color: #9499a6; }
.nums b { display: block; font-size: 25px; color: #fff; font-variant-numeric: tabular-nums; line-height: 1.3; }
.nums b.pt { color: #ff8a5c; }
.up-l.end { text-align: center; margin-bottom: 18px; }
.end-img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 14px; margin-bottom: 18px; animation: fadein 1.2s; }
.end-k { display: block; font-size: 13px; color: var(--out-dim); }
.end-n { display: block; font-size: clamp(38px, 10vw, 58px); font-weight: 900; letter-spacing: -.035em; line-height: 1.2; color: #fff; }
.up-l.end-t { font-size: 15.5px; line-height: 1.75; color: #c9ccd4; }
#up-ok { display: block; width: 100%; margin-top: 22px; text-align: center; font-weight: 800; font-size: 16px; background: #eceef2; color: #111216; padding: 12px; border-radius: 12px; animation: rise .4s var(--ease); }

/* 날이 넘어가는 화면: 날짜가 넘겨지다가 멈추고, 얼마나 지났는지가 아래에 뜹니다 */
#pass { position: absolute; inset: 0; z-index: 45; display: grid; place-items: center; align-content: center; gap: 10px; text-align: center; background: rgba(28, 30, 36, .985); animation: fadein .3s; transition: opacity .32s; }
#pass.out { opacity: 0; }
#ps-big { font-family: var(--mono); font-size: clamp(22px, 5.4vw, 34px); font-weight: 400; color: var(--out-dim); font-variant-numeric: tabular-nums; letter-spacing: -.01em; min-height: 1.5em; transition: color .3s; }
#ps-big.land { font-family: var(--font); font-weight: 800; color: #fff; animation: land .45s var(--ease); }
@keyframes land { from { scale: .94; } }
#ps-small { min-height: 1.6em; font-family: var(--mono); font-size: 15px; color: var(--pt); animation: rise .4s var(--ease); }

/* ── 태블릿: 창과 내 안. 목록은 대화 사이에 창을 덮습니다 ── */
@media (max-width: 1119px) {
  #scr-game.on { grid-template-columns: minmax(0, 440px) minmax(250px, 300px); }
  #win, #rooms { grid-area: 1 / 1; }
  #rooms { display: none; z-index: 20; align-self: center; height: 100%; max-height: 900px; background: var(--out); border-radius: 22px; box-shadow: 0 0 0 1px var(--out-line); padding: 18px 10px; }
  #scr-game.home #rooms { display: flex; animation: fadein .35s; }
  #scr-game.home #idle { display: none; }
  #inner { grid-area: 1 / 2; }
}
/* ── 휴대폰: 창 하나. 내 안은 위에서 내려오는 서랍 ── */
@media (max-width: 779px) {
  #scr-game.on { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0; }
  #win, #rooms { border-radius: 0; max-height: none; box-shadow: none; }
  #rooms { padding: max(16px, env(safe-area-inset-top)) 8px 16px; }
  #btn-inner { display: block; }
  #inner { grid-area: 1 / 1; z-index: 40; align-self: start; max-height: 78%; background: var(--out); border-radius: 0 0 20px 20px; box-shadow: 0 20px 50px rgba(0, 0, 0, .45); padding: max(12px, env(safe-area-inset-top)) 10px 16px; translate: 0 -105%; transition: translate .32s var(--ease); }
  #inner.open { translate: 0 0; }
  #in-x { display: block; }
}
@media (max-height: 600px) { .pk span { display: none; } .pk { padding: 8px 14px; } }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01s !important; transition-duration: .01s !important; } }

/* ── 엔딩 도감: 표지와 같은 남색 바탕과 도트 글꼴. 본 끝은 표지 말풍선처럼 밝은 칸, 못 본 끝은 비어 있는 칸 ── */
#dex { position: fixed; inset: 0; z-index: 60; background: #182b56; color: #f3efe2; font-family: var(--pix); overflow-y: auto; animation: fadein .25s; }
.dx-box { width: min(1240px, 100%); min-height: 100%; margin: 0 auto; padding: clamp(14px, 3.4vh, 32px) clamp(16px, 3vw, 40px) 22px; display: flex; flex-direction: column; gap: 12px; }
.dx-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dx-head h2 { font-size: clamp(22px, 2.3vw, 30px); font-weight: 700; line-height: 1.3; text-shadow: .06em .06em 0 #0c1733; }
.dx-head h2 b { color: #ffb08f; margin-left: .25em; }
.dx-lead { font-size: 14px; line-height: 1.6; color: #a9b4d6; }
.dx-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 18px; padding: 4px; }
.dx { display: flex; flex-direction: column; min-width: 0; background: #f3efe2; color: #182b56; box-shadow: 4px 0 0 #0c1733, -4px 0 0 #0c1733, 0 4px 0 #0c1733, 0 -4px 0 #0c1733; }
.dx-art { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #13234a; }
.dx-body { padding: 10px 12px 12px; min-width: 0; }
.dx-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 17px; font-weight: 700; line-height: 1.35; margin-bottom: 8px; }
.dx { position: relative; }
.dx-now { position: absolute; left: 0; top: 0; z-index: 1; font-style: normal; font-size: 12px; font-weight: 700; line-height: 1.5; color: #fff; background: var(--pt); padding: 2px 7px; }
.dx dl { display: grid; gap: 6px; }
.dx dt { font-size: 12px; line-height: 1.4; color: #56628c; }
.dx dd { display: flex; align-items: center; gap: 8px; min-height: 20px; }
.dx dd > b { flex: none; white-space: nowrap; margin-left: auto; font-size: 18px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.dx-pp { display: flex; flex-wrap: wrap; gap: 2px; min-width: 0; }
.dx-pp i { width: 6px; height: 8px; background: #182b56; }
.dx-pp em { font-style: normal; font-size: 11px; line-height: 8px; }
.st-done .dx-pp i { background: #8d95ad; }
.st-rate .dx-pp { gap: 3px; }
.st-rate .dx-pp i { position: relative; width: 13px; height: 9px; background: #d8d1bd; }
.st-rate .dx-pp i::before { content: ''; position: absolute; inset: 0 auto 0 0; width: calc(var(--f) * 100%); background: var(--pt); }
.dx.now { box-shadow: 4px 0 0 var(--pt), -4px 0 0 var(--pt), 0 4px 0 var(--pt), 0 -4px 0 var(--pt); }
.dx.lock { background: none; color: #a9b4d6; box-shadow: none; outline: 2px dashed #3d528c; outline-offset: -2px; }
.dx.lock .dx-art { display: grid; place-items: center; font-size: 40px; font-weight: 700; color: #3d528c; }
.dx.lock small { display: block; font-size: 13px; font-weight: 700; color: #c9d1ea; margin-bottom: 4px; }
.dx-hint { font-size: 13px; line-height: 1.6; }
.dx-key { font-size: 13px; line-height: 1.6; color: #a9b4d6; }
.dx-side { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; line-height: 1.6; color: #8f9bc0; }
.dx-side span:first-child { color: #c9d1ea; }
.dx-side span.on { color: #f3efe2; }
.dx-side span.on::before { content: '■ '; color: var(--pt); }
.dx-side span:not(:first-child):not(.on)::before { content: '□ '; }
.dx-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; padding-top: 8px; border-top: 2px solid #22386b; }
.dx-store { font-size: 13px; line-height: 1.6; color: #8f9bc0; flex: 1 1 260px; }
.dx-ask { padding: 14px 16px; background: #0f1d40; box-shadow: 4px 0 0 #0c1733, -4px 0 0 #0c1733, 0 4px 0 #0c1733, 0 -4px 0 #0c1733; }
.dx-ask p { font-size: 14px; line-height: 1.6; margin-bottom: 8px; }
.dx-ask div { display: flex; flex-wrap: wrap; gap: 4px 10px; }
#dex .tm { font-family: var(--pix); font-weight: 700; font-size: 18px; color: #c9d1ea; border-radius: 0; padding: 8px 14px 8px 30px; }
#dex .tm.primary { color: #fff; }
#dex .tm::before { font-size: 12px; left: 11px; }
#dex .tm:focus-visible { background: rgba(255, 255, 255, .12); padding-left: 34px; }
#dex .tm:disabled { opacity: .4; cursor: default; }
@media (hover: hover) { #dex .tm:not(:disabled):hover { background: rgba(255, 255, 255, .12); color: #fff; padding-left: 34px; } #dex .tm:disabled:hover::before { opacity: 0; } }
/* 좁은 화면: 칸을 한 줄씩. 그림은 왼쪽에 작게, 숫자는 이름과 그림 사이의 높이에 맞춥니다 */
@media (max-width: 759px) {
  .dx-grid { grid-template-columns: 1fr; gap: 12px; }
  .dx { flex-direction: row; }
  .dx-art { width: 84px; flex: none; aspect-ratio: auto; align-self: stretch; min-height: 66px; }
  .dx-body { flex: 1; padding: 8px 10px 9px; }
  .dx-name { font-size: 15px; margin-bottom: 4px; }
  .dx dl { gap: 2px; }
  .dx dl div { display: grid; grid-template-columns: 94px minmax(0, 1fr); align-items: center; gap: 6px; }
  .dx dt { font-size: 11.5px; }
  .dx dd { min-height: 17px; }
  .dx dd > b { font-size: 15px; }
  .dx-pp i { width: 5px; height: 7px; }
  .st-rate .dx-pp i { width: 10px; height: 8px; }
  .dx.lock .dx-art { font-size: 28px; }
  .dx-hint { font-size: 12.5px; }
  .dx-lead, .dx-key { font-size: 12.5px; }
  #dex .tm { font-size: 16px; }
}

/* ── 7월 16일 낮, 방학식이 끝난 교실(end.js의 classroom) ── 창이 걷히고 그림이 화면을 채웁니다 */
#scr-game.lift #win { transition: opacity .9s ease, scale .9s var(--ease); opacity: 0; scale: .94; }
#scr-game.lift #rooms, #scr-game.lift #inner { transition: opacity .6s; opacity: 0; }
#cls { position: absolute; inset: 0; z-index: 55; overflow: hidden; background: #0e0f12; color: #fff; cursor: pointer; user-select: none; opacity: 0; transition: opacity .6s; }
#cls.on { opacity: 1; transition-delay: .5s; }
#cls.out { opacity: 0; transition: opacity 1s; transition-delay: 0s; }
#cls-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 22% 42%; opacity: 0; scale: 1.06; transition: opacity 1.6s ease, scale 9s ease-out; }
#cls.see #cls-img { opacity: 1; scale: 1; }
#cls::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(rgba(14, 15, 18, .38), transparent 16%, transparent 58%, rgba(14, 15, 18, .86) 86%); opacity: 0; transition: opacity 1.6s; }
#cls.see::after { opacity: 1; }
#cls-mid { position: absolute; inset: 0; display: grid; place-content: center; gap: 10px; text-align: center; opacity: 0; transition: opacity .7s; }
#cls-mid b { font-size: clamp(26px, 4vw, 40px); font-weight: 700; }
#cls-mid span { font-size: 15px; color: #c9ccd4; }
#cls.mid #cls-mid { opacity: 1; }
#cls-when { position: absolute; z-index: 1; top: max(14px, env(safe-area-inset-top)); left: 16px; margin: 0; padding: 5px 11px; border-radius: 99px; background: rgba(14, 15, 18, .55); font-size: 13px; color: #e8e9ee; opacity: 0; transition: opacity 1s .8s; }
#cls.see #cls-when { opacity: 1; }
#cls-sub { position: absolute; z-index: 1; left: 50%; translate: -50% 0; bottom: max(40px, calc(env(safe-area-inset-bottom) + 30px)); width: min(760px, calc(100% - 32px)); display: grid; justify-items: center; gap: 7px; text-align: center; }
#cls-sub b { font-size: 13px; font-weight: 700; color: #1c1d22; background: #f3efe2; padding: 2px 10px; border-radius: 99px; }
#cls-sub b:empty { display: none; }
#cls-say { font-size: clamp(18px, 2.1vw, 23px); font-weight: 600; line-height: 1.5; text-shadow: 0 1px 3px rgba(0, 0, 0, .9), 0 0 14px rgba(0, 0, 0, .6); word-break: keep-all; overflow-wrap: anywhere; }
#cls-sub.nar #cls-say { font-weight: 400; font-style: italic; color: #dfe2e8; font-size: clamp(16px, 1.8vw, 19px); }
#cls-sub.in { animation: fadein .45s; }
#cls-hint { position: absolute; z-index: 1; right: 16px; bottom: max(12px, env(safe-area-inset-bottom)); margin: 0; font-size: 12px; color: #aeb2bd; opacity: 0; transition: opacity .6s; }
#cls.hint #cls-hint { opacity: 1; }
/* 세로로 긴 화면: 그림을 화면 너비에 맞춰 왼쪽 세 사람이 보이게 자르고, 자막은 그 아래 */
@media (max-aspect-ratio: 2/3) {
  #cls-img { inset: auto; top: 0; left: -24vw; width: 250vw; height: auto; max-width: none; object-fit: fill; transform-origin: 30% 50%; }
  #cls::after { background: linear-gradient(rgba(14, 15, 18, .38), transparent 9%, transparent calc(139vw - 120px), #0e0f12 139vw); }
  #cls-sub { bottom: auto; top: min(calc(139vw + 30px), calc(100% - 170px)); }
  #cls-when { font-size: 12px; }
}
