/* story.css — visual-novel player and ending screen */
.vn { position: relative; width: 396px; height: 704px; overflow: hidden; background: #0c0612; font-family: var(--font); }
.vn-bg { position: absolute; inset: -20px; background: center / cover no-repeat; opacity: 0; transition: opacity .7s; animation: vnDrift 16s ease-in-out infinite alternate; }
.vn-bg.on { opacity: 1; }
.vn-shade { position: absolute; left: 0; right: 0; bottom: 0; height: 260px; background: linear-gradient(0deg, rgba(10, 4, 16, .7), rgba(0, 0, 0, 0)); pointer-events: none; }
.vn-portrait { position: absolute; left: 50%; bottom: 164px; height: 470px; max-width: 396px; object-fit: contain; transform: translateX(-50%); animation: vnIn .4s ease-out both; filter: drop-shadow(0 0 12px rgba(0, 0, 0, .6)); pointer-events: none; }
.vn-portrait.out { opacity: 0; transition: opacity .25s; }
.vn-box { position: absolute; left: 8px; top: 528px; width: 380px; height: 166px; }
.vn-text { font-size: 17px; line-height: 1.5; font-weight: 700; text-shadow: var(--outline); white-space: pre-wrap; overflow: hidden; height: 100%; }
.vn-text.narr { text-align: center; font-style: italic; color: #f4e8ff; display: flex; align-items: center; justify-content: center; }
.vn-more { position: absolute; right: 10px; bottom: 4px; color: var(--gold); font-size: 16px; animation: vnBlink .9s steps(2) infinite; text-shadow: var(--outline); }
.vn-name { position: absolute; left: 20px; top: 494px; min-width: 96px; max-width: 220px; padding: 3px 16px; text-align: center; font-size: 16px; font-weight: 900; color: #fff; text-shadow: var(--outline); border: 2px solid var(--gold); border-radius: 14px 14px 14px 2px; box-shadow: 0 2px 8px rgba(0, 0, 0, .6); animation: pop .2s ease-out; }
.vn-skip { position: absolute; right: 12px; top: 478px; }
.vn-choice { position: absolute; left: 28px; right: 28px; top: 120px; height: 360px; display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.vn-choice .btn { width: 100%; min-height: 56px; animation: pop .3s cubic-bezier(.3, 1.6, .5, 1) both; }
.vn-choice .btn .btn-label { white-space: normal; text-align: center; line-height: 1.3; }
.vn-cg { position: absolute; inset: 0; background: #000 center / cover no-repeat; animation: vnCg 1s ease-out both; }
@keyframes vnDrift { from { transform: scale(1) translate(0, 0); } to { transform: scale(1.08) translate(-8px, -6px); } }
@keyframes vnIn { from { opacity: 0; transform: translateX(-50%) translateY(24px); } to { opacity: 1; transform: translateX(-50%); } }
@keyframes vnBlink { 50% { opacity: 0; } }
@keyframes vnCg { from { opacity: 0; transform: scale(1.06); } to { opacity: 1; transform: none; } }

/* ending screen */
.screen-ending { background: radial-gradient(circle at 50% 20%, #3a1840, #120a18 70%); }
.end-wrap { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; padding: 14px 24px 18px; gap: 6px; }
.end-pic { width: 348px; height: 214px; flex: none; border: 3px solid var(--gold); border-radius: 8px; background: #000 center / cover no-repeat; box-shadow: 0 0 18px rgba(243, 210, 122, .5), inset 0 0 0 2px #2a0f1e; position: relative; animation: vnCg .8s ease-out both; }
.end-badge { position: absolute; right: -8px; top: -10px; background: var(--crimson); color: #fff; font-weight: 900; font-size: 15px; padding: 3px 12px; border: 2px solid var(--gold); border-radius: 14px; transform: rotate(8deg); text-shadow: var(--outline); animation: pop .4s .8s cubic-bezier(.3, 1.8, .5, 1) both; }
.end-name { font-size: 30px; font-weight: 900; color: var(--gold); text-shadow: var(--outline), 0 0 14px rgba(243, 210, 122, .7); text-align: center; animation: endSlam .6s .2s cubic-bezier(.3, 1.6, .5, 1) both; }
.end-count { font-size: 15px; color: var(--text); text-shadow: var(--outline); }
.end-sub { font-size: 14px; font-style: italic; color: #e9d7ff; text-shadow: var(--outline); text-align: center; min-height: 20px; }
.end-rewards { width: 348px; display: flex; flex-direction: column; gap: 4px; padding: 4px 10px; background: rgba(20, 8, 26, .7); border: 1px solid rgba(243, 210, 122, .5); border-radius: 12px; animation: drop .4s .6s both; }
.end-row { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 800; text-shadow: var(--outline); min-height: 30px; }
.end-row img { width: 26px; height: 26px; object-fit: contain; }
.end-row .btn { margin-left: auto; }
.end-stats { width: 348px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 8px; margin-top: 6px; }
.end-stat { display: flex; align-items: center; gap: 5px; font-size: 16px; font-weight: 800; text-shadow: var(--outline); }
.end-seal { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; color: #fff; text-shadow: var(--outline); border: 1px solid var(--gold2); }
.end-btns { margin-top: auto; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.end-btns .btn { min-width: 220px; }
@keyframes endSlam { 0% { opacity: 0; transform: scale(2.4); } 100% { opacity: 1; transform: scale(1); } }
