/* 봄날의 우리: 벚꽃빛 종이 위에 교복 남색. 한 가지 분위기로만 간다(어두운 화면 따로 없음). */
:root {
  color-scheme: light;
  --bg: #fbf1f4;
  --panel: #fffafb;
  --line: #efd9e1;
  --ink: #33283a;
  --dim: #8a7a88;
  --navy: #26304f;
  --pink: #ff8fab;
  --pink-deep: #d0587a;
  --gold: #e8a33d;
  --warn: #e0584f;
  --box: rgba(255, 250, 251, .97);
  --display: 'Jua', 'Gowun Dodum', system-ui, sans-serif;
  --body: 'Gowun Dodum', system-ui, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); }
#app { max-width: 440px; margin: 0 auto; padding-block: 12px 28px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
button { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px; cursor: pointer; }
button:active { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: default; }
button:focus-visible, .box:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; }
button.main { background: linear-gradient(#ff9fb8, #ff7f9f); color: #fff; border: 0; font-weight: 700; box-shadow: 0 3px 0 var(--pink-deep); }
button.wide { display: block; width: 100%; margin-top: 10px; padding: 13px; font-size: 16px; }
button.link { border: 0; background: none; color: var(--dim); font-size: 13px; text-decoration: underline; margin-top: 12px; }
input[type=text] { font: inherit; width: 100%; padding: 11px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.center { text-align: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 12px; margin-top: 10px; }
.small { font-size: 12px; color: var(--dim); }
.fine { font-size: 11px; color: var(--dim); text-align: center; margin-top: 14px; line-height: 1.5; }
.intro { margin: 0; line-height: 1.6; font-size: 14px; }
label.t { display: block; font-size: 13px; color: var(--dim); margin: 12px 0 6px; }

.title { text-align: center; padding: 18px 0 4px; }
.logo { font-family: var(--display); font-size: 40px; color: #ff6f93; letter-spacing: 1px; text-shadow: 0 3px 0 #ffd3df; }
.logo.sm { font-size: 30px; }
.sub { color: var(--dim); font-size: 14px; margin-top: 2px; }
.cast { display: flex; justify-content: center; margin-top: 6px; height: 150px; overflow: hidden; border-radius: 18px; background: linear-gradient(#ffe3ec, #fff3f6); border: 1px solid var(--line); }
.cast img { height: 190px; margin: 0 -34px; image-rendering: pixelated; }

.top { display: flex; justify-content: space-between; align-items: flex-end; }
.phase { font-size: 12px; color: var(--pink-deep); font-weight: 700; }
.when { font-family: var(--display); font-size: 26px; line-height: 1.1; }
.money { font-size: 14px; font-variant-numeric: tabular-nums; }
.progress { height: 4px; background: var(--line); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--pink); }
.goal { color: var(--pink-deep); font-size: 13px; margin-top: 6px; }
.mname { font-weight: 700; font-size: 17px; display: flex; gap: 6px; align-items: center; margin-bottom: 4px; }
.tier { font-size: 11px; font-weight: 700; color: var(--pink-deep); background: #ffe6ee; border-radius: 999px; padding: 2px 8px; }

.stat { display: grid; grid-template-columns: 52px 1fr 30px; gap: 6px; align-items: center; font-size: 12px; margin: 3px 0; }
.stat b { text-align: right; font-variant-numeric: tabular-nums; }
.bar { height: 8px; background: #f3e7ec; border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; background: #8fb4e8; border-radius: 4px; }
.heart { display: grid; grid-template-columns: 52px 1fr; gap: 10px; align-items: center; padding: 4px 0; }
.heart + .heart { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 10px; }
.heart img { width: 52px; height: 52px; object-fit: cover; object-position: top; image-rendering: pixelated; border-radius: 12px; background: #ffeef3; }
.hn { font-weight: 700; display: flex; gap: 6px; align-items: center; margin-bottom: 4px; }
.bar.pink { height: 10px; }

.ph { font-weight: 700; font-size: 13px; color: var(--pink-deep); margin: 6px 0; }
.ph + .grid2, .ph + .small { margin-bottom: 8px; }
.opt { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 9px 10px; min-width: 0; }
.opt b { font-size: 14px; }
.opt small { font-size: 11px; color: var(--dim); }
.opt.on { border: 2px solid var(--pink); background: #fff2f6; padding: 8px 9px; }
.grid4 .opt { align-items: center; }

.log { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin-top: 10px; font-size: 13px; line-height: 1.6; }
.log .y { font-weight: 700; color: var(--pink-deep); }

.end-row { display: grid; grid-template-columns: 48px 1fr; gap: 10px; align-items: center; padding: 6px 0; }
.end-row + .end-row { border-top: 1px dashed var(--line); }
.end-row img { width: 48px; height: 48px; object-fit: cover; object-position: top; border-radius: 10px; image-rendering: pixelated; background: #ffeef3; }
.end-row.locked img { filter: grayscale(1) brightness(.6); }
.end-row .dot { width: 48px; height: 48px; border-radius: 10px; background: #e8e3f0; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.end-pic { display: flex; justify-content: center; height: 220px; overflow: hidden; }
.end-pic img { height: 320px; image-rendering: pixelated; }

/* 대화 장면 */
.scene { position: fixed; inset: 0; display: flex; flex-direction: column; max-width: 440px; margin: 0 auto; background: var(--navy); }
.stage { position: relative; flex: 1; overflow: hidden; display: flex; align-items: flex-end; justify-content: center; }
.bgimg { position: absolute; inset: 0; background-size: cover; background-position: center; image-rendering: pixelated; }
.place { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); left: max(12px, env(safe-area-inset-left, 0px)); background: rgba(20, 16, 30, .55); color: #fff; font-size: 12px; padding: 4px 10px; border-radius: 999px; z-index: 2; }
.pic { position: relative; height: 84%; max-height: 560px; max-width: 100%; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .3)); z-index: 1; }
.pic.in { animation: rise .28s ease-out; }
@keyframes rise { from { transform: translateY(14px); opacity: .2; } to { transform: none; opacity: 1; } }
.fx-rain, .fx-snow { position: absolute; inset: 0; pointer-events: none; display: none; z-index: 3; }
.fx-rain { background: repeating-linear-gradient(105deg, transparent 0 14px, rgba(255, 255, 255, .25) 14px 15px); background-size: 200% 200%; animation: rain .5s linear infinite; }
.stage[data-bg=rain] .fx-rain { display: block; }
.fx-snow { background-image: radial-gradient(2px 2px at 20% 30%, #fff 50%, transparent 51%), radial-gradient(2px 2px at 70% 10%, #fff 50%, transparent 51%), radial-gradient(3px 3px at 40% 70%, #fff 50%, transparent 51%), radial-gradient(2px 2px at 85% 55%, #fff 50%, transparent 51%); background-size: 200px 200px; animation: snow 6s linear infinite; }
.stage[data-bg=snowgate] .fx-snow, .stage[data-bg=xmas] .fx-snow { display: block; }
@keyframes rain { to { background-position: -40px 120px; } }
@keyframes snow { to { background-position: 30px 200px, -20px 200px, 10px 200px, -30px 200px; } }
.box { position: relative; min-height: 170px; background: var(--box); border-top: 3px solid var(--pink); padding: 22px max(16px, env(safe-area-inset-right, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); font-size: 16px; line-height: 1.7; cursor: pointer; }
.who { position: absolute; top: -16px; left: 14px; color: #fff; font-weight: 700; font-size: 14px; padding: 4px 14px; border-radius: 999px; box-shadow: 0 2px 0 rgba(0, 0, 0, .15); }
.say.narr { color: #5e4f5c; }
.say.think { color: #4f6fa8; font-style: italic; }
.next { position: absolute; right: 14px; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); color: var(--pink); font-size: 12px; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.choices { display: flex; flex-direction: column; gap: 8px; }
.choices button { text-align: left; border: 2px solid #ffd0dd; font-size: 15px; background: #fff; }

.toast { position: fixed; left: 50%; top: calc(18px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); background: rgba(51, 40, 58, .92); color: #fff; padding: 8px 14px; border-radius: 999px; font-size: 13px; z-index: 50; transition: opacity .4s, transform .4s; white-space: nowrap; }
.toast.out { opacity: 0; transform: translate(-50%, -10px); }

@media (prefers-reduced-motion: reduce) { .pic.in, .fx-rain, .fx-snow, .next { animation: none; } }

/* 이벤트 그림 */
.cg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; z-index: 1; }
.end-row.has-cg { cursor: pointer; }
.end-row.has-cg .small { color: var(--pink-deep); }
.modal { position: fixed; inset: 0; background: rgba(20, 12, 24, .82); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; z-index: 30; gap: 8px; }
.cg-big { max-width: min(100%, 420px); max-height: 82vh; image-rendering: pixelated; border-radius: 12px; }
.cg-hint { color: #fff; opacity: .7; }

.cg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.cg-cell { display: flex; flex-direction: column; gap: 4px; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--panel); text-align: left; min-width: 0; }
.cg-cell img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; image-rendering: pixelated; display: block; }
.cg-cell span { font-size: 11px; padding: 2px 6px 6px; color: var(--dim); line-height: 1.3; }
.cg-cell.locked .q { aspect-ratio: 2 / 3; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-size: 28px; color: var(--line); background: #f6eef1; }
