* { box-sizing: border-box; margin: 0; padding: 0; }
:root { --ink: #2b2430; --accent: #e56b8c; --accent2: #5b7fb8; }
html, body { height: 100%; }
body { font-family: "Malgun Gothic", "Apple SD Gothic Neo", sans-serif; background: #17141d; color: var(--ink); }
#app { max-width: 480px; margin: 0 auto; height: 100dvh; position: relative; background: #000; overflow: hidden; }
@media (min-width: 720px) { #app { max-width: 900px; } }
.screen { position: absolute; inset: 0; }
.hidden { display: none !important; }
/* 타이틀 */
#titleScreen { display: flex; align-items: flex-end; justify-content: center; }
.titleArt { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.titleShade { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(20,14,26,0.05) 40%, rgba(20,14,26,0.78)); }
.titleBox { position: relative; width: 100%; padding: 24px 22px 30px; text-align: center; color: #fff; }
.titleBox h1 { font-size: 40px; letter-spacing: 2px; text-shadow: 0 2px 14px rgba(0,0,0,0.55); }
.tagline { margin: 10px 0 16px; font-size: 15px; line-height: 1.5; opacity: 0.95; }
.nameLabel { display: block; font-size: 13px; margin-bottom: 12px; }
.nameLabel input { margin-left: 8px; padding: 8px 10px; border-radius: 8px; border: none; width: 150px; font-size: 15px; }
.mainBtn, .subBtn { display: block; width: 100%; padding: 13px; margin: 8px 0; border: none; border-radius: 12px; font-size: 16px; cursor: pointer; }
.mainBtn { background: var(--accent); color: #fff; font-weight: bold; }
.subBtn { background: rgba(255,255,255,0.92); color: var(--ink); }
.notice { margin-top: 12px; font-size: 12px; opacity: 0.85; line-height: 1.5; }
/* 게임 */
.bgImg, .cgImg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cgImg { z-index: 3; }
.charImg { position: absolute; bottom: 168px; left: 50%; transform: translateX(-50%); height: 58%; max-width: 92%; object-fit: contain; z-index: 2; filter: drop-shadow(0 6px 18px rgba(0,0,0,0.35)); }
.topBar { position: absolute; top: 0; left: 0; right: 0; display: flex; gap: 4px; padding: 8px; z-index: 6; }
.topBar button { flex: 1; padding: 7px 2px; font-size: 12px; border: none; border-radius: 8px; background: rgba(20,16,28,0.62); color: #fff; cursor: pointer; }
.dialogueBox { position: absolute; left: 10px; right: 10px; bottom: 10px; min-height: 148px; background: rgba(22,17,30,0.86); border-radius: 14px; padding: 26px 16px 14px; z-index: 5; cursor: pointer; }
.speakerName { position: absolute; top: -13px; left: 14px; background: var(--accent2); color: #fff; font-size: 14px; font-weight: bold; padding: 5px 14px; border-radius: 999px; }
.textBody { color: #fff; font-size: 17px; line-height: 1.65; word-break: keep-all; }
.nextMark { position: absolute; right: 14px; bottom: 8px; color: #ffb9cc; font-size: 12px; animation: blink 1.1s infinite; }
@keyframes blink { 0%,100% { opacity: 0.25; } 50% { opacity: 1; } }
.choiceBox { position: absolute; left: 16px; right: 16px; bottom: 190px; z-index: 7; display: flex; flex-direction: column; gap: 10px; }
.choiceBtn { padding: 14px; font-size: 15px; border-radius: 12px; border: 2px solid rgba(255,255,255,0.7); background: rgba(30,22,40,0.92); color: #fff; cursor: pointer; line-height: 1.45; }
.choiceBtn:hover { background: var(--accent); }
.backlogPanel { position: absolute; inset: 12px; background: rgba(24,19,33,0.97); border-radius: 14px; z-index: 9; padding: 14px; display: flex; flex-direction: column; }
.backlogHead { display: flex; justify-content: space-between; align-items: center; color: #fff; font-weight: bold; margin-bottom: 10px; }
.backlogHead button { padding: 6px 12px; border: none; border-radius: 8px; cursor: pointer; }
.backlogList { overflow-y: auto; color: #e9e4f2; font-size: 14px; line-height: 1.6; }
.backlogList p { margin-bottom: 8px; }
.backlogList b { color: #ffb9cc; margin-right: 6px; }
/* 갤러리 */
#galleryScreen { background: #241d2e; color: #fff; padding: 20px 16px; overflow-y: auto; }
#galleryScreen h2 { margin-bottom: 14px; }
.galleryGrid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 720px) { .galleryGrid { grid-template-columns: repeat(3, 1fr); } }
.gItem img { width: 100%; border-radius: 10px; display: block; }
.gItem p { font-size: 13px; margin-top: 6px; }
.gLocked { height: 140px; border-radius: 10px; background: #3a3049; display: flex; align-items: center; justify-content: center; font-size: 34px; color: #8f83a6; }
.endingList { margin: 16px 0; font-size: 14px; line-height: 1.6; }
/* 엔딩 */
#endingScreen { background: linear-gradient(160deg, #2b2138, #17141d); display: flex; align-items: center; justify-content: center; }
.endingBox { width: 86%; text-align: center; color: #fff; }
.endingLabel { letter-spacing: 6px; color: #ffb9cc; font-size: 13px; }
.endingBox h2 { margin: 14px 0 10px; font-size: 25px; line-height: 1.45; }
.endingAff { font-size: 14px; opacity: 0.9; margin-bottom: 18px; }
