/* Death concept 01: last page. Independent components; live game values. */
.death-ornaments,.death-edition { display:none; }
#end-screen:not(.death-page) .ornament-frame { display:none; }
#app:has(.death-page:not([hidden])) { background:#f8f6f0; }
#end-screen.death-page {
 --paper:#f8f6f0; --paper-2:#eeeae2; --paper-3:#fcfaf5;
 --ink:#302b29; --ink-2:#81766e; --blood:#9c383d; --rule:#bfb4a7;
 position:relative; isolation:isolate; min-height:100svh; padding:21px 23px 46px;
 background:#f8f6f0 url('../assets/ui/white-narrative/paper-grain.svg');
}
.death-page .death-ornaments { display:block; position:absolute; inset:0; overflow:hidden; z-index:-1; pointer-events:none; }
.death-leaves { position:absolute; width:145px; height:145px; left:-17px; top:-36px; transform:rotate(83deg); opacity:.31; }
.death-castle { position:absolute; width:128px; height:92px; object-fit:contain; top:0; right:-8px; opacity:.29; }
.death-flower { position:absolute; width:90px; height:190px; object-fit:contain; bottom:10px; right:-17px; opacity:.3; transform:rotate(-26deg); }
.death-page .death-ornaments::after { content:''; position:absolute; width:116px; height:132px; bottom:-24px; left:-24px; background:url('../assets/ui/white-narrative/corner-foliage-v2-small.webp') center/contain no-repeat; transform:rotate(-70deg); opacity:.3; }
.death-page .death-edition { display:flex; align-items:center; justify-content:center; gap:12px; margin:0 auto 40px; width:70%; color:#71685f; font-size:12px; letter-spacing:.1em; position:relative; }
.death-edition::before,.death-edition::after { content:''; flex:1; height:1px; background:linear-gradient(90deg,transparent,#b8ab9d); }
.death-edition::after { transform:rotate(180deg); }
.death-edition span::after { content:''; position:absolute; width:90px; height:22px; top:22px; left:calc(50% - 45px); background:url('../assets/ui/white-narrative/divider.svg') center/contain no-repeat; }
.death-page .end-art-frame { position:relative; margin:0; padding:3px; clip-path:none !important; background:transparent; }
.death-page .end-art-frame > #end-art { display:block; width:100%; height:auto; }
.death-page .end-art-frame::after { content:''; position:absolute; z-index:5; left:calc(50% - 15px); bottom:-16px; width:30px; height:32px; background:transparent url('../assets/ui/white-narrative/starburst.svg') center/contain no-repeat; }
.death-page #end-title { font:400 29px/1.3 var(--f-display); text-align:center; margin:30px 0 15px; letter-spacing:.015em; }
.death-page #end-title::after { content:''; display:block; width:130px; height:2px; margin:10px auto 0; background:linear-gradient(90deg,#9c383d,transparent); transform:rotate(-1deg); }
.death-page .end-desc { font-size:14px; line-height:1.9; margin:0 auto 30px; max-width:355px; text-align:center; text-wrap:balance; }
.death-page .end-stats { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:0; margin:32px 0 31px; position:relative; }
.death-page .end-stats::before { content:''; position:absolute; width:110px; height:18px; top:-25px; left:calc(50% - 55px); background:url('../assets/ui/white-narrative/divider.svg') center/contain no-repeat; }
.death-page .end-stats > div { position:relative; text-align:center; padding:5px 5px 12px; border:0; border-left:1px solid #c9beb2; background:none; }
.death-page .end-stats > div:last-child { border-right:1px solid #c9beb2; }
.death-page .end-stats > div::after { content:'✧'; position:absolute; bottom:-3px; left:25%; width:50%; color:#9b8e81; background:linear-gradient(90deg,transparent,#c8bfb4,transparent) center/100% 1px no-repeat; font-size:10px; }
.death-page .end-stats dt { font-size:12px; color:#665b53; margin-bottom:5px; }
.death-page .end-stats dd { font:400 22px/1.4 var(--f-display); overflow-wrap:anywhere; }
.death-page .end-stats dd.long-value { font-size:12px; line-height:1.6; }
.death-page .end-memory-heading { display:flex; align-items:center; gap:10px; font:400 18px/1.45 var(--f-display); margin:0 0 15px; }
.death-page .end-memory-heading::after { content:''; height:1px; background:linear-gradient(90deg,#ab9c8b,transparent); flex:1; }
.death-page .end-memory-heading img { width:25px; height:25px; filter:grayscale(1); }
.death-page .mem-list { position:relative; min-height:72px; padding:0 55px 12px 0; margin:0; list-style:none; background:url('../assets/ui/white-narrative/wildflowers-v2-small.webp') right center/54px 97px no-repeat; }
.death-page .mem-list li { border:0; margin:0 0 11px; padding:0; display:flex; flex-direction:column; gap:4px; }
.death-page .mem-list b { font-size:17px; font-weight:700; color:#71508d; }
.death-page .mem-list span { font-size:13px; line-height:1.75; }
.end-reset-rules img { width:21px; height:21px; flex-shrink:0; }
.end-reset-rules p { display:flex; gap:10px; align-items:flex-start; }
.death-page .end-reset-rules { border-top:1px dotted #b9ad9e; padding-top:8px; margin-top:10px; }
.death-page .end-reset-rules p { font-size:12px; line-height:1.8; margin:8px 0; }
.death-page .end-retained { color:#4b705e; }
.death-page .end-reset { color:#963b3b; }
.death-page #end-actions { display:grid; grid-template-columns:1fr 1fr; gap:12px 9px; margin-top:36px; position:relative; }
.death-page #end-actions::before { content:''; position:absolute; top:-26px; left:25%; width:50%; height:20px; background:url('../assets/ui/white-narrative/divider.svg') center/contain no-repeat; }
.death-page #end-actions .btn { display:flex; align-items:center; justify-content:center; gap:12px; position:relative; border:0; box-shadow:none; background:none; padding:13px 10px; min-height:55px; font-size:17px; color:#443a32; }
.death-page #end-actions .btn.primary { grid-column:1 / -1; color:#fff8ee; min-height:65px; font-size:25px; letter-spacing:.07em; }
.death-page #end-actions .btn > :not(.ornament-frame) { position:relative; z-index:5; }
.death-page #end-actions .btn img { width:29px; height:29px; }
.death-page #end-actions .primary img { width:38px; height:38px; padding-right:10px; box-sizing:content-box; border-right:1px solid #eaccc0; }
.death-page #end-actions .btn:hover { filter:brightness(1.05); }
.death-page #end-actions .btn:active { transform:translateY(1px); }
@media(max-width:390px) {
 #end-screen.death-page { padding:17px 17px 35px; }
 .death-page .death-edition { font-size:11px; margin-bottom:36px; }
 .death-page #end-title { font-size:26px; margin-top:26px; }
 .death-page .end-desc { font-size:13px; }
 .death-page .end-memory-heading { font-size:16px; }
 .death-page .end-stats dt { font-size:11px; }
 .death-page .end-stats dd { font-size:20px; }
 .death-page #end-actions .btn.primary { font-size:23px; }
 .death-page #end-actions .btn { font-size:16px; gap:8px; }
}
.death-page .mem-list { background:none; }
.death-page .mem-list::after { content:''; position:absolute; right:0; top:0; width:54px; height:97px; background:url('../assets/ui/white-narrative/wildflowers-v2-small.webp') center/contain no-repeat; opacity:.3; pointer-events:none; }
.death-page #end-actions .ghost img { filter:grayscale(1); }
.death-page .end-memory-heading img { filter:none; }
/* Dedicated secondary actions: solid paper fill, matched book/compass and double contour. */
.death-page #end-actions .btn.ghost { min-height:63px; gap:15px; padding:12px 14px; font:400 18px/1.3 var(--f-body); color:#3c3530; }
.death-page #end-actions .ghost img { width:35px; height:35px; flex:0 0 35px; filter:none; }
.death-page #end-actions .ghost span { white-space:nowrap; }
@media(max-width:390px) {
 .death-page #end-actions .btn.ghost { min-height:59px; gap:10px; padding:11px 9px; font-size:16px; }
 .death-page #end-actions .ghost img { width:31px; height:31px; flex-basis:31px; }
}
