/* 다들 웃길래 — 화면 꾸밈
   글씨는 화면 크기에 따라 커집니다(휴대폰 본문 16px 이상, 큰 화면 20px 안팎). 누르는 것은 44px 이상. */
@font-face { font-family: Pencil; src: url(../assets/fonts/pencil.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: Pretendard; src: url(../assets/fonts/pretendard.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --ink: #1f2a3d; --soft: #4a5568; --paper: #f5f2ec; --card: #fff; --line: #e3ddd2;
  --blue: #2f6fb0; --good: #1c7a4c; --bad: #b3372f; --mid: #9a6300;
  --fs: clamp(16px, 0.55vw + 0.9vh + 9px, 22px);        /* 본문 */
  --fs-s: clamp(14px, 0.4vw + 0.6vh + 8.5px, 17px);      /* 보조 */
  --fs-l: clamp(18px, 0.7vw + 1.1vh + 9px, 25px);        /* 대사 */
  --ease: cubic-bezier(.2, .7, .2, 1);
}
* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }   /* display를 준 요소도 hidden이면 반드시 사라지게. 없으면 숨은 날짜 카드가 화면을 덮어 누르기를 가로챕니다 */
html, body { height: 100%; }
body { font-family: Pretendard, 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif; font-size: var(--fs); line-height: 1.6; color: var(--ink); background: #161b26; word-break: keep-all; overflow-wrap: anywhere; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
kbd { display: none; font: 700 12px/1 Pretendard, sans-serif; border: 1px solid currentColor; border-radius: 5px; padding: 3px 5px; opacity: .6; }
body.keys kbd { display: inline-block; }

.screen { position: fixed; inset: 0; display: none; }
.screen.on { display: block; }
.screen.scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.screen.paper { background: var(--paper); }
.col { max-width: 780px; margin: 0 auto; padding: clamp(24px, 5vh, 56px) 20px 80px; }

.btn { min-height: 48px; padding: 10px 22px; border-radius: 14px; background: #fff; box-shadow: inset 0 0 0 1.5px #c9c2b4; font-weight: 700; font-size: var(--fs); transition: transform .15s var(--ease), background .15s; }
.btn:hover { background: #faf8f3; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); color: #fff; box-shadow: none; }
.btn.primary:hover { background: #2b3a55; }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 1.5px rgba(128, 128, 128, .45); }
.btn small { font-weight: 600; opacity: .7; margin-left: 6px; font-size: .8em; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 28px; }
.kicker { font-size: var(--fs-s); font-weight: 800; color: var(--blue); letter-spacing: .02em; }
h2 { font-size: clamp(26px, 2vw + 16px, 40px); line-height: 1.25; font-weight: 900; letter-spacing: -.02em; margin: 6px 0 18px; }
h3 { font-size: clamp(18px, .6vw + 14px, 23px); font-weight: 800; line-height: 1.4; }

/* ── 첫 화면: '한 판만'과 같은 틀(오른쪽에 글, 그림은 오른쪽만 어둡게, 글자 목록 메뉴). 포인트 색은 제목의 ‘웃’ 한 글자에 포스트잇 노랑 ── */
#scr-title { background: #10141e; color: #fff; }
#scr-title.on { display: flex; align-items: flex-end; }
.tt-art { position: absolute; inset: 0; background: #10141e url(../assets/img/title.webp) center / cover; }
.tt-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(12, 15, 24, 0) 0%, rgba(12, 15, 24, .06) 44%, rgba(12, 15, 24, .6) 57%, rgba(12, 15, 24, .9) 72%, rgba(12, 15, 24, .95) 100%); }
.tt-box { position: relative; margin-left: auto; width: min(620px, 100%); padding: 0 clamp(24px, 5vw, 72px) clamp(72px, 12vh, 130px); }
.tt-kicker { color: #cfd8e6; font-weight: 600; letter-spacing: .02em; font-size: 15px; }
.tt-logo { font-size: clamp(52px, 7.4vw, 104px); font-weight: 900; letter-spacing: -.04em; line-height: 1; margin: 10px 0 34px; white-space: nowrap; }
.tt-logo span { color: #ffe066; }
.tt-menu { display: grid; gap: 6px; }
.tm { display: flex; align-items: baseline; gap: 12px; min-height: 48px; text-align: left; font-size: 21px; font-weight: 700; padding: 11px 16px 11px 34px; border-radius: 10px; position: relative; color: #c6cee2; transition: background .15s, color .15s, padding .15s; }
.tm small { font-size: 13px; font-weight: 500; color: #9aa5c0; }
.tm::before { content: '▶'; position: absolute; left: 12px; top: 50%; translate: 0 -50%; font-size: 11px; opacity: 0; color: #ffe066; }
.tm:hover, .tm:focus-visible { background: rgba(255, 255, 255, .08); color: #fff; padding-left: 40px; outline: none; }
.tm:focus-visible { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .45); }
.tm:hover::before, .tm:focus-visible::before { opacity: 1; }
.tm.primary { color: #fff; }
.tt-note { margin-top: 26px; font-size: 13px; color: #9aa5c0; line-height: 1.6; }
.tt-foot { position: absolute; left: 0; right: 0; bottom: 18px; display: flex; justify-content: flex-end; padding: 0 clamp(20px, 4vw, 40px); font-size: 13px; }
.tt-foot a { color: #9aa5c0; text-decoration: none; }
.tt-foot a:hover, .tt-foot a:focus-visible { color: #fff; }
/* 세로 화면: 그림을 위쪽에 따로 두어 칠판 앞 무리와 스케치북이 글에 가리지 않게 합니다 */
@media (max-aspect-ratio: 3/4) {
  .tt-art { bottom: auto; height: 60%; background-position: 34% center; }
  .tt-art::after { background: linear-gradient(180deg, rgba(16, 20, 30, 0) 0%, rgba(16, 20, 30, 0) 62%, #10141e 100%); }
  .tt-box { padding-bottom: 56px; }
  .tt-logo { margin-bottom: 22px; }
  .tt-note { margin-top: 14px; }
}

/* ── 무대 ── */
#scr-game { background: #0f131b; }
/* overflow: clip — hidden이면 안쪽이 스크롤될 수 있어, 선택지에 초점이 갈 때 무대 전체가 위로 밀립니다 */
#stage { position: absolute; inset: 0; max-width: 1500px; margin: 0 auto; overflow: hidden; overflow: clip; background: #161b26; }
.bg { position: absolute; inset: -3%; background: center / cover no-repeat; opacity: 0; transition: opacity .32s linear; }
.bg.show { opacity: 1; }
.bg.drift1 { animation: drift1 26s ease-in-out infinite alternate; }
.bg.drift2 { animation: drift2 26s ease-in-out infinite alternate; }
@keyframes drift1 { from { transform: scale(1) translateX(0); } to { transform: scale(1.045) translateX(-1%); } }
@keyframes drift2 { from { transform: scale(1.04) translateX(-.8%); } to { transform: scale(1) translateX(.6%); } }
#shade { position: absolute; inset: 0; background: #0f131b; opacity: 0; pointer-events: none; transition: opacity .36s linear; }
#shade.on { opacity: 1; }

#cast { position: absolute; inset: 0; pointer-events: none; }
.sp { position: absolute; bottom: 0; height: min(86%, 132vw); left: 50%; --k: 1; --dy: 0%; transform: translate(-50%, calc(var(--dy) + 14px)) scale(var(--k)); opacity: 0; transition: opacity .26s linear, transform .3s var(--ease), filter .25s linear; transform-origin: 50% 100%; -webkit-user-drag: none; user-select: none; }
.sp.in { opacity: 1; transform: translate(-50%, var(--dy)) scale(var(--k)); }
.sp[data-pos="left"] { left: 27%; }
.sp[data-pos="right"] { left: 73%; }
.sp.quiet { filter: brightness(.72) saturate(.85); }
body:not(.calm) .sp.in { animation: breathe 5.5s ease-in-out infinite; }
@keyframes breathe { 50% { transform: translate(-50%, calc(var(--dy) - 3px)) scale(calc(var(--k) * 1.004)); } }
@media (max-aspect-ratio: 3/4) {
  .sp { bottom: 22%; height: min(64%, 128vw); }
  .sp[data-pos="left"] { left: 30%; }
  .sp[data-pos="right"] { left: 70%; }
}

/* ── 장면 그림 ── */
#cg { position: absolute; inset: 0; background: #161b26 center / cover no-repeat; opacity: 0; pointer-events: none; transition: opacity .4s linear; z-index: 2; }
#cg.on { opacity: 1; }

/* ── 포스트잇 떼기: 사물함 그림(3:4) 위에 포스트잇을 글자로 얹습니다. 붙인 애들의 글씨라 손글씨 글꼴 ── */
#peel { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; align-content: center; gap: 10px; padding: calc(var(--hud, 58px) + 8px) 10px 10px; background: rgba(10, 13, 20, .72); opacity: 0; transition: opacity .2s linear; }
#peel.in { opacity: 1; }
.pl-pic { position: relative; container-type: inline-size; border-radius: 6px; overflow: hidden; box-shadow: 0 16px 44px rgba(0, 0, 0, .5); }
.pl-pic > img { width: 100%; height: 100%; display: block; object-fit: cover; }
.pl-name { position: absolute; left: 32.4%; top: 26.6%; width: 12.2%; height: 5%; display: grid; place-items: center; font-size: 2.3cqw; font-weight: 800; color: #3a3f4a; white-space: nowrap; letter-spacing: -.02em; }
.pl-note { position: absolute; width: 18cqw; height: 17cqw; min-width: 52px; min-height: 50px; translate: -50% -50%; rotate: var(--r); padding: 4px 4px 7px; display: grid; place-items: center; background: #ffe066; color: #262a33; font: 400 max(12.5px, 3.6cqw)/1.12 Pencil, sans-serif; text-align: center; word-break: keep-all; overflow-wrap: normal; box-shadow: 0 3px 5px rgba(0, 0, 0, .28); clip-path: polygon(0 0, 100% 0, 100% 88%, 90% 100%, 0 100%); transition: transform .45s var(--ease), opacity .45s linear; }
.pl-note.c1 { background: #ffd2dc; } .pl-note.c2 { background: #fff1a6; }
.pl-note:hover:not(:disabled) { filter: brightness(1.04); transform: translateY(-2px); }
.pl-note.gone { transform: translate(18px, 70px) rotate(24deg); opacity: 0; pointer-events: none; }
body.calm .pl-note.gone { transform: none; }
.pl-bar { display: grid; gap: 2px; text-align: center; color: #eef1f6; max-width: 560px; }
#pl-say { font-weight: 700; } .pl-help { color: #ffe9a0; font-weight: 700; } #pl-hint { color: #b9c3d3; font-size: var(--fs-s); }

/* ── 스케치북 ── */
#sketch { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; align-content: center; gap: 12px; padding: calc(var(--hud, 58px) + 10px) 14px 14px; background: rgba(10, 13, 20, .7); opacity: 0; transition: opacity .2s linear; perspective: 1400px; cursor: pointer; }
#sketch.in { opacity: 1; }
.sk-page { position: relative; width: min(92vw, 560px, calc((100vh - var(--hud, 58px) - 90px) * 1.25)); aspect-ratio: 5 / 4; transform-style: preserve-3d; transition: transform .6s var(--ease); }
.sk-page.flip, .sk-page.nopic { transform: rotateY(180deg); }
.sk-front, .sk-back { position: absolute; inset: 0; border-radius: 6px; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: #fbf8f0; box-shadow: 0 18px 50px rgba(0, 0, 0, .45), inset 0 0 0 1px #e2dccd; overflow: hidden; }
.sk-front img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sk-back { transform: rotateY(180deg); display: grid; align-content: center; gap: 10px; padding: 8% 10%; background: #fbf8f0 repeating-linear-gradient(transparent 0 calc(1.9em - 1px), #e6e0d2 calc(1.9em - 1px) 1.9em); }
#sk-date { font-size: var(--fs-s); color: #8a8270; font-weight: 700; letter-spacing: .04em; }
#sk-line { font-size: clamp(20px, 1.2vw + 1.4vh + 8px, 32px); line-height: 1.5; color: #3d3a33; font-weight: 500; transform: rotate(-1.2deg); }
.sk-foot { display: flex; gap: 14px; color: #dfe5ee; font-size: var(--fs-s); }
.sk-foot span:empty { display: none; }

/* ── HUD ── */
#hud { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; padding: max(10px, env(safe-area-inset-top)) 14px 10px; color: #fff; background: rgba(16, 20, 30, .62); backdrop-filter: blur(6px); font-size: var(--fs-s); z-index: 5; }
.hud-when { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.hud-when b { font-weight: 800; white-space: nowrap; }
.hud-when span { color: #cfd8e6; white-space: nowrap; }
/* '내 자리' 막대는 다시 짜기 2에서 없앴습니다(점수 대신 사실) */
.hud-btns { display: flex; gap: 6px; margin-left: auto; }
.hbtn { min-height: 44px; min-width: 44px; padding: 6px 12px; border-radius: 10px; color: inherit; font-weight: 700; font-size: var(--fs-s); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .4); display: inline-flex; align-items: center; gap: 6px; }
.hbtn:hover { background: rgba(255, 255, 255, .12); }

/* ── 대화창: 새봄이의 스케치북이 이 게임의 물건이라 종이로 짭니다(11-18) ──
   남의 말과 내가 소리 내어 한 말은 흰 종이(ui-paper)에 인쇄 글씨, 이름은 마스킹 테이프 조각에.
   속말(나레이션)은 스프링에서 뜯은 스케치북 장(ui-sketch)에 연필 손글씨(개구, OFL). 선택지도 같은 스케치북 장에 연필로 그린 네모 칸.
   종이 그림은 9조각으로 늘여 씁니다(border-image). 찐방·톡은 지금처럼 휴대폰 화면입니다 */
#dlg { position: absolute; left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); transform: translateX(-50%) rotate(-.25deg); width: min(95%, 1020px); min-height: clamp(124px, 22vh, 196px); max-height: 48%; overflow-y: auto;
  border-style: solid; border-width: 10px; border-image: url(../assets/img/ui-paper.webp) 24 fill / 10px stretch; padding: clamp(10px, 1.8vh, 18px) clamp(14px, 2.2vw, 30px) clamp(18px, 2.6vh, 26px);
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .42)); cursor: pointer; z-index: 4; animation: dlg-in .2s var(--ease); scrollbar-width: thin; }
@keyframes dlg-in { from { opacity: 0; transform: translate(-50%, 10px) rotate(-.25deg); } }
/* 이름: 종이 위에 붙인 마스킹 테이프 조각. 끝이 손으로 찢은 것처럼 들쭉날쭉합니다 */
.dlg-who { display: inline-block; font-weight: 900; font-size: var(--fs); color: var(--who, var(--ink)); background: rgba(232, 221, 190, .95); padding: 1px 16px 2px; margin: 0 0 6px -4px; transform: rotate(-1.6deg);
  clip-path: polygon(0 8%, 4% 0, 9% 10%, 14% 2%, 100% 0, 97% 22%, 100% 46%, 96% 70%, 100% 100%, 0 100%, 3% 74%, 0 50%, 4% 28%); box-shadow: inset 0 0 0 40px rgba(255, 255, 255, .08); }
.dlg-who:empty { display: none; }
.dlg-text { font-size: var(--fs-l); line-height: 1.6; min-height: 3.2em; color: #22293a; }
#dlg[data-kind="nar"] { transform: translateX(-50%) rotate(.3deg); border-width: 28px 17px 12px 17px; border-image: url(../assets/img/ui-sketch.webp) 58 36 24 36 / 28px 17px 12px 17px round stretch;
  background: #f2efe6 url(../assets/img/ui-sketch.webp) 50% 72% / 170% auto no-repeat; background-clip: padding-box; padding-top: clamp(6px, 1.2vh, 12px); }
#dlg[data-kind="nar"] .dlg-text { font-family: Pencil, 'Malgun Gothic', sans-serif; font-size: calc(var(--fs-l) * 1.2); line-height: 1.42; color: #383b42; letter-spacing: .01em; }
.dlg-next { position: absolute; right: 14px; bottom: 4px; display: none; align-items: center; gap: 6px; font-size: var(--fs-s); color: #8a8d96; }
#dlg.ready:not(.asking) .dlg-next { display: inline-flex; animation: bob 1.2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(3px); } }

/* ── 선택지: 스케치북 장 한 장에 연필로 그린 네모 칸. 고르면 칸에 체크, 고를 수 없게 된 것은 연필로 그은 줄과 까닭 한 줄 ── */
#choices { position: absolute; left: 50%; transform: translateX(-50%) rotate(-.35deg); bottom: calc(max(12px, env(safe-area-inset-bottom)) + clamp(124px, 22vh, 196px) + 10px); width: min(93%, 760px); display: grid; z-index: 6;
  border-style: solid; border-width: 28px 17px 12px 17px; border-image: url(../assets/img/ui-sketch.webp) 58 36 24 36 / 28px 17px 12px 17px round stretch;
  background: #f2efe6 url(../assets/img/ui-sketch.webp) 50% 72% / 170% auto no-repeat; background-clip: padding-box; padding: 2px clamp(6px, 1.2vw, 14px) 6px; filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .42)); animation: sheet-in .22s var(--ease) backwards; }
@keyframes sheet-in { from { opacity: 0; transform: translate(-50%, 8px) rotate(-.35deg); } }
.choice { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 12px 18px; text-align: left; font-size: var(--fs); font-weight: 700; line-height: 1.45; color: var(--ink); background: #fff; border-radius: 14px; box-shadow: 0 6px 20px rgba(0, 0, 0, .28), inset 0 0 0 2px transparent; transition: transform .15s var(--ease), box-shadow .15s, opacity .25s; animation: choice-in .25s var(--ease) backwards; }
@keyframes choice-in { from { opacity: 0; transform: translateY(8px); } }
.choice kbd { flex: none; }
#choices .choice { position: relative; min-height: 50px; padding: 10px 10px 10px 46px; background: transparent; box-shadow: none; border-radius: 6px; animation: none; color: #23293a; }
#choices .choice + .choice { border-top: 1.5px dashed rgba(88, 92, 102, .32); border-radius: 0; }
#choices .choice::before { content: ''; position: absolute; left: 12px; top: 50%; width: 21px; height: 20px; translate: 0 -50%; border: 2.2px solid #4b4f58; border-radius: 3px 5px 3px 4px; rotate: -4deg; opacity: .85; }
#choices .choice:nth-child(2n)::before { rotate: 3deg; border-radius: 5px 3px 4px 3px; }
#choices .choice kbd { order: 2; margin-left: auto; }
#choices .choice:hover:not(.off), #choices .choice:focus-visible { background: rgba(70, 74, 84, .07); }
#choices .choice:hover:not(.off)::before { background: repeating-linear-gradient(-35deg, rgba(75, 79, 88, .35) 0 2px, transparent 2px 5px); }
#choices .choice.picked { color: #111622; transform: none; }
#choices .choice.picked::after { content: '✓'; position: absolute; left: 13px; top: 50%; translate: 0 -62%; font: 400 34px/1 Pencil, sans-serif; color: #2a2d34; }
#choices .choice.gone { opacity: .3; }
.choice.picked { background: var(--ink); color: #fff; transform: scale(.985); }
.choice.gone { opacity: .25; }
.choice:hover { box-shadow: 0 6px 20px rgba(0, 0, 0, .28), inset 0 0 0 2px var(--blue); }
#choices .choice:hover, #choices .choice.picked { box-shadow: none; background-color: transparent; }
/* 고를 수 없게 된 선택지: 숨기지 않고 흐리게, 까닭 한 줄(사용자 결정 11-17). 연필로 그은 줄 */
.choice.off { background: rgba(236, 238, 242, .72); color: #6b7487; box-shadow: none; cursor: not-allowed; font-weight: 600; }
.choice.off span { display: grid; gap: 1px; }
.choice.off small { font-size: var(--fs-s); font-weight: 700; color: #4d5668; }
.choice.off small::before { content: '「'; } .choice.off small::after { content: '」'; }
.choice.off:hover { box-shadow: none; }
#choices .choice.off { background: transparent; color: #8d9099; }
#choices .choice.off::before { opacity: .4; }
#choices .choice.off span > s, #choices .choice.off .off-t { text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: rgba(70, 72, 80, .7); }
#choices .choice.off small { font-family: Pencil, sans-serif; font-weight: 400; font-size: calc(var(--fs) * 1.08); color: #5d5348; line-height: 1.25; }

/* ── 휴대폰 ── */
#phone { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(10, 13, 20, .62); z-index: 7; opacity: 0; transition: opacity .2s linear; padding: calc(var(--hud, 58px) + 8px) 12px 12px; }   /* --hud: 위 막대 높이(main.js가 잽니다) */
#phone.in { opacity: 1; }
#phone[hidden] { display: none; }
.ph-frame, .ep-phone { width: min(100%, 440px); height: min(100%, 780px); display: flex; flex-direction: column; background: #eef1f6; border-radius: 26px; overflow: hidden; box-shadow: 0 20px 60px rgba(0, 0, 0, .5), 0 0 0 6px #10141e; transform: translateY(14px); transition: transform .22s var(--ease); }
#phone.in .ph-frame { transform: none; }
.ph-head { flex: none; padding: 14px 18px; background: #fff; border-bottom: 1px solid #dfe4ec; display: flex; align-items: baseline; gap: 8px; }
.ph-head b { font-weight: 800; } .ph-head small { color: #6b7690; font-size: var(--fs-s); }
.ph-msgs { flex: 1; overflow-y: auto; padding: 14px 14px 18px; display: flex; flex-direction: column; gap: 5px; }
.ph-msg { max-width: 82%; align-self: flex-start; animation: msg-in .2s var(--ease); }
.ph-msg.first { margin-top: 8px; }
.ph-msg.mine { align-self: flex-end; }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } }
.ph-name { display: block; font-size: var(--fs-s); font-weight: 800; color: var(--who, #5b6680); margin: 0 0 3px 4px; }
.ph-bubble { display: inline-block; padding: 9px 14px; border-radius: 16px; background: #fff; font-size: var(--fs); line-height: 1.45; }
.ph-msg.mine .ph-bubble { background: #ffe66b; }
.ph-pic { width: min(240px, 60vw); border-radius: 14px; overflow: hidden; background: #fff; }
.ph-pic img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #c9d0db; }
.ph-nopic { padding: 4px 0; background: #f6f1df; }
.ph-gone { color: #8a93a6; font-style: italic; }
.ph-pic em { display: block; padding: 9px 12px; font-style: normal; font-size: var(--fs-s); color: #3b4760; line-height: 1.45; }
.ph-sys { align-self: center; font-size: var(--fs-s); color: #5b6680; background: #dfe4ec; padding: 3px 12px; border-radius: 999px; margin: 8px 0 2px; }
.ph-foot { flex: none; display: grid; gap: 8px; padding: 10px 12px 14px; background: #fff; border-top: 1px solid #dfe4ec; }
.ph-foot:empty { display: none; }
.ph-foot .choice { box-shadow: inset 0 0 0 1.5px #c5ccd8; min-height: 48px; padding: 10px 14px; }
.ph-foot .choice:hover { box-shadow: inset 0 0 0 2px var(--blue); }
.ph-foot .choice.off { box-shadow: none; }

/* 캡처(체험 2) */
.ph-frame { position: relative; }
.ph-cap { margin-left: auto; align-self: center; display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 6px 14px; border-radius: 999px; font-weight: 800; font-size: var(--fs-s); color: var(--ink); background: #eef1f6; box-shadow: inset 0 0 0 1.5px #c5ccd8; }
.ph-cap:hover { box-shadow: inset 0 0 0 2px var(--blue); }
.ph-cap:active { transform: scale(.96); }
.ph-cap i { position: relative; width: 17px; height: 13px; border: 2px solid currentColor; border-radius: 3px; }
.ph-cap i::after { content: ''; position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%; background: currentColor; }
.ph-tip { position: absolute; right: 12px; top: 60px; z-index: 2; max-width: 70%; padding: 8px 12px; border-radius: 12px; background: var(--ink); color: #fff; font-size: var(--fs-s); line-height: 1.4; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); }
.ph-tip::before { content: ''; position: absolute; right: 30px; top: -6px; border: 6px solid transparent; border-top: 0; border-bottom-color: var(--ink); }
.ph-toast { position: absolute; left: 50%; top: 66px; transform: translateX(-50%); z-index: 2; padding: 7px 14px; border-radius: 999px; background: rgba(31, 42, 61, .92); color: #fff; font-size: var(--fs-s); white-space: nowrap; max-width: 92%; overflow: hidden; text-overflow: ellipsis; }
.ph-toast.go { animation: toast 1.8s var(--ease) forwards; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, -4px); } 12% { opacity: 1; transform: translate(-50%, 0); } 80% { opacity: 1; } 100% { opacity: 0; } }
.ph-frame.flash::after { content: ''; position: absolute; inset: 0; background: #fff; pointer-events: none; animation: flash .35s linear forwards; }
@keyframes flash { from { opacity: .85; } to { opacity: 0; } }

/* 쓰고 지우기(체험 1) */
.wr { display: grid; gap: 8px; }
.wr-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.wr-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px; border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 1.5px #c5ccd8; font-weight: 700; font-size: var(--fs); user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none; }
.wr-chip:hover { box-shadow: inset 0 0 0 2px var(--blue); }
.wr-chip.on { background: #e3eeff; box-shadow: inset 0 0 0 2px var(--blue); }
.wr-chip:active { transform: scale(.97); }
.wr-chip:disabled { opacity: .45; transform: none; }
.wr-row { display: flex; gap: 6px; align-items: stretch; }
.wr-field { flex: 1; min-width: 0; min-height: 44px; display: flex; align-items: center; padding: 6px 12px; border-radius: 12px; background: #f3f5f9; box-shadow: inset 0 0 0 1.5px #dfe4ec; font-size: var(--fs); white-space: nowrap; overflow: hidden; }
.wr-field em { font-style: normal; font-size: var(--fs-s); color: #6b7690; white-space: normal; line-height: 1.3; margin-left: 4px; }
.wr-caret { flex: none; width: 2px; height: 1.2em; margin-left: 1px; background: var(--ink); animation: blink 1s steps(1) infinite; }
.wr-field.typing .wr-caret { animation: none; }
@keyframes blink { 50% { opacity: 0; } }
.wr-del, .wr-send { flex: none; min-height: 44px; min-width: 44px; padding: 0 12px; border-radius: 12px; font-weight: 800; font-size: var(--fs-s); }
.wr-del { color: #4d5668; box-shadow: inset 0 0 0 1.5px #c5ccd8; }
.wr-send { background: #d5dbe5; color: #6b7690; }
.wr-send.ready { background: #ffe066; color: var(--ink); box-shadow: inset 0 0 0 1.5px #e0bf3a; }
.wr-del:disabled, .wr-send:disabled { cursor: default; opacity: .6; }

/* ── 급식실 자리 고르기(체험 3) ── */
#pick { position: absolute; inset: var(--hud, 58px) 0 0 0; z-index: 6; display: flex; flex-direction: column; padding-top: 8px; background: #161b26; opacity: 0; transition: opacity .2s linear; }
#pick.in { opacity: 1; }
.pk-scroll { flex: 1; min-height: 0; display: flex; align-items: center; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.pk-pic { position: relative; flex: none; margin: 0 auto; }
#pick.wide .pk-pic { margin: 0 10px; }
.pk-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 8px; user-select: none; -webkit-user-drag: none; }
#pk-b { opacity: 0; transition: opacity 1.4s ease; }
#pick.eyes #pk-b { opacity: 1; }
.pk-spot { position: absolute; transform: translate(-50%, -100%); padding: 0 0 16px; }
.pk-spot::after { content: ''; position: absolute; left: 50%; bottom: 0; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: #ffe066; box-shadow: 0 0 0 3px rgba(16, 20, 30, .6); }
.pk-label { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px; border-radius: 12px; background: rgba(255, 255, 255, .95); color: var(--ink); box-shadow: 0 6px 18px rgba(0, 0, 0, .35); font-size: var(--fs-s); font-weight: 800; white-space: nowrap; transition: transform .15s var(--ease), box-shadow .15s; }
.pk-spot:hover .pk-label, .pk-spot:focus-visible .pk-label { box-shadow: 0 6px 18px rgba(0, 0, 0, .35), inset 0 0 0 2px var(--blue); transform: translateY(-2px); }
.pk-spot:focus-visible { outline: none; }
.pk-spot.off { cursor: not-allowed; }
.pk-spot.off .pk-label { flex-wrap: wrap; justify-content: center; max-width: 13em; white-space: normal; text-align: center; background: rgba(226, 229, 235, .88); color: #6b7487; font-weight: 600; transform: none; }
.pk-spot.off .pk-label small { flex-basis: 100%; font-weight: 700; color: #4d5668; }
.pk-spot.off .pk-label small::before { content: '「'; } .pk-spot.off .pk-label small::after { content: '」'; }
.pk-spot.off::after { background: #9aa3b2; }
.pk-spot.picked .pk-label { background: var(--ink); color: #fff; }
.pk-spot.gone { opacity: .25; }
.pk-bar { flex: none; display: grid; gap: 2px; padding: 12px 18px max(14px, env(safe-area-inset-bottom)); background: rgba(31, 42, 61, .96); color: #f1f3f7; text-align: center; }
#pk-say { font-size: var(--fs-l); font-weight: 700; line-height: 1.45; }
#pk-hint { font-size: var(--fs-s); color: #b9c3d4; }

/* ── 날짜 카드 ── */
#daycard { position: absolute; inset: 0; z-index: 9; display: grid; place-content: center; justify-items: center; gap: 6px; background: #10141e; color: #fff; opacity: 0; transition: opacity .38s linear; text-align: center; }
#daycard.on { opacity: 1; }
#daycard small { font-size: var(--fs-s); font-weight: 800; letter-spacing: .2em; color: #9fb4d0; }
#daycard b { font-size: clamp(44px, 7vw + 12px, 92px); font-weight: 900; letter-spacing: -.03em; line-height: 1.1; }
#daycard span { font-size: var(--fs-l); color: #dfe5ee; }

/* ── 패널 ── */
.panel { position: absolute; inset: 0; z-index: 12; background: rgba(250, 248, 243, .98); display: flex; flex-direction: column; animation: dlg-in2 .2s var(--ease); }
.panel[hidden] { display: none; }
@keyframes dlg-in2 { from { opacity: 0; transform: translateY(10px); } }
.panel header { flex: none; display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.panel header b { font-size: var(--fs-l); font-weight: 900; }
.panel .hbtn { box-shadow: inset 0 0 0 1.5px #c9c2b4; }
.panel-body { flex: 1; overflow-y: auto; padding: 18px 20px 40px; max-width: 760px; width: 100%; margin: 0 auto; display: grid; gap: 10px; align-content: start; }
.panel-body p b { margin-right: 8px; font-weight: 800; }
.lg-nar { color: var(--soft); } .lg-pick { color: var(--blue); font-weight: 700; }
.tog { display: flex; align-items: center; gap: 12px; min-height: 48px; font-weight: 700; }
.tog input { width: 24px; height: 24px; accent-color: var(--ink); }
.set-keys { color: var(--soft); font-size: var(--fs-s); }
body.keys .set-keys kbd, .set-keys kbd { display: inline-block; }
body:not(.keys) .set-keys { display: none; }

/* ── 엔딩 ── */
#scr-ending { background: var(--paper); }
.end-art { height: min(46vh, 56vw); background: #1f2a3d center 25% / cover; }   /* PC에서는 띠로 잘립니다. 엔딩 그림의 얼굴은 위쪽에 있어 가운데보다 위를 보여 줍니다 */
.end-box { max-width: 780px; margin: 0 auto; padding: 26px 20px 80px; }
.end-box .kicker[data-tone="good"] { color: var(--good); } .end-box .kicker[data-tone="bad"] { color: var(--bad); } .end-box .kicker[data-tone="mid"] { color: var(--mid); }
#end-text { display: grid; gap: 12px; font-size: var(--fs-l); }

/* ── 돌아보기 ── */
.sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.sum div { background: var(--card); border-radius: 16px; padding: 16px 18px; }
.sum b { display: block; font-size: clamp(30px, 2vw + 20px, 44px); font-weight: 900; line-height: 1.15; }
.sum small { font-size: .5em; font-weight: 700; color: var(--soft); }
.sum span { font-size: var(--fs-s); color: var(--soft); }
.rv-note, .lead { margin: 14px 0 6px; color: var(--soft); }
.rv-line { list-style: none; padding: 0; margin-top: 22px; display: grid; gap: 14px; }
.rv-line li { display: grid; grid-template-columns: 5.2em minmax(0, 1fr); gap: 12px; }
.rv-when { padding-top: 16px; } .rv-when b { display: block; font-weight: 900; } .rv-when span { font-size: var(--fs-s); color: var(--soft); }
.rv-card { background: var(--card); border-radius: 16px; padding: 16px 18px; }
.rv-card h3 { font-size: var(--fs); font-weight: 700; color: var(--soft); }
.rv-pick { font-weight: 800; font-size: var(--fs-l); margin: 6px 0 12px; line-height: 1.45; }
.rv-pick i { display: inline-block; font-style: normal; font-size: var(--fs-s); font-weight: 800; padding: 1px 10px; border-radius: 999px; margin-right: 8px; vertical-align: 2px; }
.stop .rv-pick i { background: #ddf3e7; color: var(--good); } .go .rv-pick i { background: #fbe6e4; color: var(--bad); }
.rv-card dl { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.rv-card dt { font-size: var(--fs-s); font-weight: 800; color: var(--blue); } .rv-card dd { margin: 0; }
.rv-march { background: #f6efe2; border-radius: 10px; padding: 8px 12px; } .rv-march dt { color: var(--mid); }
@media (max-width: 560px) { .rv-line li { grid-template-columns: 1fr; gap: 4px; } .rv-when { padding: 0; display: flex; gap: 8px; align-items: baseline; } }

/* ── 설문지 ── */
.sheet { background: var(--card); border-radius: 16px; padding: 20px; display: grid; gap: 16px; margin-top: 16px; }
.sv-row { display: grid; grid-template-columns: minmax(0, 1fr) 3.4em; gap: 6px 12px; align-items: center; }
.sv-row p { grid-column: 1 / -1; font-weight: 700; }
.sv-bar { height: 16px; border-radius: 8px; background: #ece7dc; overflow: hidden; }
.sv-bar i { display: block; height: 100%; background: #8b97ab; border-radius: 8px; }
.sv-row.hot .sv-bar i { background: var(--bad); }
.sv-row b { font-weight: 900; text-align: right; white-space: nowrap; }
.sv-mine { border-top: 1px solid var(--line); padding-top: 12px; color: var(--soft); }
.flip { background: var(--ink); color: #fff; border-radius: 16px; padding: 22px; margin-top: 18px; display: grid; gap: 10px; }
.flip h3 { font-size: var(--fs-l); font-weight: 900; }
.flip b { color: #ffd766; }
.sv-h { margin: 26px 0 10px; }
.sv-notes { list-style: none; padding: 0; display: grid; gap: 8px; }
.sv-notes li { background: #fffbe6; border-radius: 4px 14px 14px 14px; padding: 12px 16px; box-shadow: 0 1px 0 #e9dfb8; }

/* ── 노아의 휴대폰 ── */
.ep-phone { height: auto; max-height: none; margin: 8px auto 0; box-shadow: 0 0 0 6px #10141e; }
.ep-phone .ph-msgs { overflow: visible; }
.ep-phone .ph-name { color: #5b6680; }

/* ── 생각 나누기 ── */
.tk-card { background: var(--card); border-radius: 18px; padding: 22px; margin-top: 16px; display: grid; gap: 12px; }
.tk-card h3 { display: flex; align-items: center; gap: 10px; }
.tk-card h3 b { flex: none; display: grid; place-items: center; width: 1.7em; height: 1.7em; border-radius: 50%; background: var(--ink); color: #fff; font-size: .85em; }
.tk-say { color: var(--soft); }
.tk-picks { display: grid; gap: 8px; }
.tk-picks button { min-height: 48px; text-align: left; padding: 10px 14px; border-radius: 12px; box-shadow: inset 0 0 0 1.5px #d9d2c4; font-weight: 600; line-height: 1.45; }
.tk-picks button small { display: block; font-size: var(--fs-s); color: var(--blue); font-weight: 800; }
.tk-picks button.on { background: #e3eeff; box-shadow: inset 0 0 0 2px var(--blue); }
.tk-when { font-weight: 800; }
.tk-steps { padding-left: 1.4em; display: grid; gap: 8px; }
.tk-scene { background: #eef1f6; border-radius: 14px; padding: 14px 16px; display: grid; gap: 6px; }
.tk-scene b { margin-right: 8px; font-weight: 800; } .tk-scene .nar { color: var(--soft); }
.tk-mine { font-weight: 800; } .tk-mine i { font-style: normal; font-size: var(--fs-s); color: var(--blue); margin-right: 8px; }
.tk-write { display: grid; gap: 6px; }
.tk-write textarea { font: inherit; padding: 12px 14px; border-radius: 12px; border: 1.5px solid #c9c2b4; resize: vertical; min-height: 76px; width: 100%; }
.tk-write small { color: var(--soft); font-size: var(--fs-s); }
.tk-save canvas { display: block; width: min(360px, 100%); height: auto; border-radius: 14px; border: 1px solid #dcd5c7; }
.tk-save .btns { margin-top: 0; } #tk-saved { font-size: var(--fs-s); color: var(--soft); }
.tk-help { background: var(--ink); color: #fff; border-radius: 18px; padding: 22px; margin-top: 16px; }
.tk-help ul { list-style: none; padding: 0; margin-top: 10px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px 20px; }
.tk-help li { display: flex; gap: 10px; align-items: baseline; } .tk-help b { color: #a9cdf5; font-weight: 900; white-space: nowrap; }

/* ── 첫 구간 끝(미리 보기) ── */
.sg-now { display: grid; gap: 4px; margin-top: 18px; padding: 20px 22px; border-radius: 18px; background: var(--ink); color: #fff; }
.sg-now > small:first-child { font-size: var(--fs-s); color: #b9c3d4; font-weight: 700; }
.sg-now b { font-size: clamp(26px, 2vw + 16px, 36px); font-weight: 900; line-height: 1.2; }
.sg-now b + small { font-size: var(--fs-s); color: #dfe5ee; }
.sg-facts { display: grid; gap: 8px; margin-top: 12px; }
.sg-fact { display: grid; grid-template-columns: 5.5em minmax(0, 1fr); gap: 10px; padding: 12px 16px; border-radius: 14px; background: var(--card); }
.sg-fact dt { padding-top: 2px; font-size: var(--fs-s); font-weight: 800; color: var(--blue); }
.sg-fact dd { margin: 0; display: grid; gap: 2px; }
.sg-fact dd small { font-size: var(--fs-s); color: var(--soft); }
.sv-notes li small { color: var(--soft); font-size: var(--fs-s); }
.sg-closed { list-style: none; padding: 0; display: grid; gap: 8px; }
.sg-closed li { display: grid; gap: 2px; padding: 12px 16px; border-radius: 12px; background: var(--card); }
.sg-closed s { color: var(--soft); } .sg-closed span { font-weight: 700; } .sg-closed small { font-size: var(--fs-s); color: var(--soft); }
.sg-marks { padding-left: 1.4em; display: grid; gap: 6px; }
.sg-marks small { margin-right: 8px; font-size: var(--fs-s); color: var(--soft); }
.sg-marks i { font-style: normal; font-size: var(--fs-s); font-weight: 800; color: var(--mid); background: #f6efe2; padding: 1px 8px; border-radius: 999px; }

/* ── 도감 ── */
.gal { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.gal li { background: var(--card); border-radius: 16px; overflow: hidden; }
.gal-art { display: block; aspect-ratio: 16 / 9; background: #d8d2c5 center / cover; }
.gal b { display: block; padding: 12px 14px; }
.gal .lock b { color: #9a927f; }

body.calm *, body.calm *::before, body.calm *::after { animation: none !important; transition-duration: .01s !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition-duration: .01s !important; } }
.rv-late { font-style: normal; font-size: .8em; font-weight: 800; color: var(--mid); margin-left: 6px; }

/* ── 열다섯 해 뒤(later.js): 링크 카드, 게시판 글, 댓글 칸 ── */
.ph-link { display: grid; gap: 3px; max-width: 250px; box-shadow: inset 0 0 0 1.5px #c5ccd8; }
.ph-link small { font-size: var(--fs-s); color: #6b7690; }
.ph-link b { font-weight: 700; line-height: 1.4; }
.bd { flex: none; background: #fff; border-radius: 16px; padding: 18px 16px 16px; display: grid; gap: 12px; }
.bd h3 { font-size: var(--fs-l); font-weight: 800; line-height: 1.35; letter-spacing: -.01em; }
.bd-meta { font-size: var(--fs-s); color: #6b7690; }
.bd p { font-size: var(--fs); line-height: 1.7; }
.bd-mine { background: #fff1a8; color: inherit; padding: 2px 1px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.bd-add { padding-top: 12px; border-top: 1px solid #dfe4ec; color: #3b4760; }
.bd-add b { margin-right: 8px; font-size: var(--fs-s); color: #6b7690; }
.bd-cmts { flex: none; display: grid; gap: 8px; margin-top: 8px; }
.bd-cmts h4 { font-size: var(--fs-s); font-weight: 800; color: #5b6680; margin-left: 4px; }
.bd-cmt { background: #fff; border-radius: 14px; padding: 12px 14px; }
.bd-cmt b { font-size: var(--fs-s); color: #5b6680; } .bd-cmt p { line-height: 1.6; margin-top: 2px; }
.bd-done { flex: none; align-self: stretch; margin: 12px 0 4px; }
#lt-off { justify-self: stretch; }
