:root{--cream:#f6f3ec;--paper:#fffcf6;--white:#fff;--ink:#282a27;--muted:#82827b;--line:#e5e1d7;--red:#9c3136;--red-dark:#75232a;--pink:#faece8;--green:#356b5b;--gold:#b8873f;--blush:#ede1d1;--shadow:0 12px 40px rgba(59,51,39,.065);font-family:'DM Sans',system-ui,sans-serif;color:var(--ink);font-synthesis:none}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--cream);min-height:100vh}button,input,select{font:inherit}button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.45}a{color:inherit;text-decoration:none}button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #bb9956;outline-offset:3px}::selection{background:#e9c9a4}
.boot{font-size:32px;letter-spacing:-2px;font-weight:900;min-height:100dvh;display:flex;align-items:center;justify-content:center;flex-direction:column}.boot span{color:var(--red)}.boot small{font-size:13px;letter-spacing:0;color:var(--muted);font-weight:500;margin-top:14px}
.shell{max-width:1640px;margin:auto;display:grid;grid-template-columns:254px minmax(0,1fr) 290px;gap:0;min-height:100dvh}.sidebar{position:sticky;top:0;height:100dvh;border-right:1px solid var(--line);padding:27px 19px 22px;background:#f8f5ef;display:flex;flex-direction:column;z-index:2}.side-right{border-left:1px solid var(--line);padding:31px 21px 24px;position:sticky;top:0;height:100dvh;overflow:auto;background:#f8f5ef}.content{min-width:0;padding:32px clamp(22px,4.2vw,67px) 55px}.brand{display:flex;align-items:center;gap:11px;padding:3px 8px 28px;border-bottom:1px solid var(--line)}.brand-mark{width:39px;height:39px;background:var(--red);border-radius:10px;color:#fff8ef;display:grid;place-items:center;font-weight:900;font-size:18px;letter-spacing:-2px;transform:rotate(-5deg)}.brand b{font-size:19px;letter-spacing:-.7px}.brand b em{font-style:normal;color:var(--red)}.brand small{display:block;font-size:9px;letter-spacing:1.6px;color:var(--muted);margin-top:3px;font-weight:700}
.side-label,.eyebrow{font-size:10px;letter-spacing:2px;font-weight:800;color:var(--muted);text-transform:uppercase}.side-label{margin:28px 13px 11px}.side-nav{display:flex;flex-direction:column;gap:5px}.nav-button{border:0;background:transparent;border-radius:10px;width:100%;display:flex;align-items:center;gap:13px;padding:12px 13px;color:#73736b;text-align:left;font-size:13px;font-weight:700;transition:.18s}.nav-button:hover{background:#eee8de;color:var(--ink)}.nav-button.active{background:var(--red);color:#fff}.nav-icon{width:18px;text-align:center;font-size:17px;line-height:1}.side-spacer{flex:1}.side-foot{margin-top:22px;padding:17px;border:1px solid var(--line);border-radius:14px;background:var(--paper)}.side-foot .mini-coin{font-family:'DM Serif Display',Georgia,serif;font-size:19px}.side-foot p{font-size:11px;line-height:1.7;color:var(--muted);margin:6px 0 12px}.side-foot button{border:0;background:none;color:var(--red);padding:0;font-size:11px;font-weight:800}.disclaimer{font-size:10px;color:#a19d94;margin:18px 13px 0;line-height:1.6}
.topline{display:flex;justify-content:space-between;align-items:center;gap:15px;margin-bottom:31px}.breadcrumb{font-size:12px;color:var(--muted)}.breadcrumb strong{color:var(--ink);font-weight:700}.top-actions{display:flex;gap:9px;align-items:center}.tiny-pill{border:1px solid var(--line);border-radius:99px;padding:8px 12px;background:var(--paper);color:var(--muted);font-weight:700;font-size:10px;letter-spacing:.5px}.top-dot{display:inline-block;width:6px;height:6px;background:#5b9c7c;border-radius:50%;margin-right:6px}.outline-icon{border:1px solid var(--line);height:34px;width:34px;background:var(--paper);border-radius:50%;font-size:17px}
.hero-kicker{display:flex;align-items:center;gap:11px;margin-bottom:12px}.hero-kicker .bar{width:25px;height:2px;background:var(--red)}.display{font-family:'DM Serif Display',Georgia,serif;font-weight:400;font-size:clamp(43px,5vw,68px);letter-spacing:-2.2px;line-height:1.05;margin:0}.display em{font-style:italic;color:var(--red)}.desc{font-size:14px;line-height:1.85;color:#77786f;max-width:555px;margin:15px 0 26px}.section-title{font-family:'DM Serif Display',Georgia,serif;font-weight:400;font-size:28px;letter-spacing:-.7px;margin:0}.section-sub{color:var(--muted);font-size:12px;line-height:1.7;margin-top:6px}.section-head{display:flex;justify-content:space-between;align-items:end;margin:29px 0 16px;gap:12px}.card{background:var(--paper);border:1px solid var(--line);border-radius:17px;box-shadow:0 4px 20px rgba(58,47,25,.025)}.pad{padding:22px}.card-muted{background:#f1ebe1;border:1px solid #e9e0d2;border-radius:16px;padding:19px}.micro{font-size:10px;color:var(--muted);font-weight:800;letter-spacing:1.3px;text-transform:uppercase}.big-number{font-size:31px;font-family:'DM Serif Display',Georgia,serif;letter-spacing:-.8px}.btn{border:none;border-radius:11px;padding:13px 19px;font-size:12px;font-weight:800;letter-spacing:.1px;display:inline-flex;align-items:center;justify-content:center;gap:10px;transition:.2s}.btn.primary{background:var(--red);color:white}.btn.primary:hover{background:var(--red-dark);transform:translateY(-1px)}.btn.secondary{background:#ede5d8;color:var(--ink)}.btn.secondary:hover{background:#e5dbcb}.btn.ghost{background:transparent;border:1px solid var(--line);color:var(--ink)}.btn.ghost:hover{background:#f0eadf}.btn.small{padding:10px 12px;font-size:11px}.btn:active{transform:translateY(1px)}.btn.full{width:100%}.divider{height:1px;background:var(--line);margin:19px 0}
.onboard-layout{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(235px,.9fr);gap:21px;margin-top:25px}.input-label{display:block;font-size:11px;font-weight:800;margin:0 0 8px;color:#68695f}.field{width:100%;border:1px solid #e0dbcf;border-radius:10px;background:#fffdfa;padding:12px 13px;color:var(--ink);font-size:13px;outline:none}.field:focus{border-color:var(--red);box-shadow:0 0 0 3px rgba(156,49,54,.1)}.field-group{margin-bottom:17px}.two-fields{display:grid;grid-template-columns:1fr 1fr;gap:12px}.form-section{padding:22px}.choice-pills{display:flex;gap:8px;flex-wrap:wrap}.choice-pill{border:1px solid var(--line);background:#fffdfa;border-radius:9px;padding:10px 12px;font-size:11px;color:#66675d;font-weight:700}.choice-pill.chosen{background:#faece8;color:var(--red);border-color:#dbb4aa}.intro-art{min-height:340px;background:#e5d7c3;border:1px solid #dccab5;border-radius:16px;position:relative;overflow:hidden;padding:24px;display:flex;flex-direction:column;justify-content:space-between}.art-sun{position:absolute;width:190px;height:190px;background:#c27b62;border-radius:50%;right:-35px;top:40px;opacity:.7}.art-building{position:absolute;bottom:0;background:#ac9a80}.art-building.b1{height:55%;left:15%;width:55%;clip-path:polygon(0 19%,25% 19%,25% 0,50% 0,50% 19%,100% 19%,100% 100%,0 100%)}.art-building.b2{height:37%;right:-5%;width:36%;background:#847c6c;clip-path:polygon(0 25%,23% 25%,23% 0,55% 0,55% 25%,100% 25%,100% 100%,0 100%)}.art-windows{position:absolute;inset:47% 0 0;background:repeating-linear-gradient(90deg,transparent 0 20px,#6e6b5e 21px 27px,transparent 28px 53px);opacity:.5;mix-blend-mode:multiply}.art-caption{position:relative;z-index:1;margin-top:auto;background:rgba(255,250,242,.9);padding:15px;border-radius:10px;backdrop-filter:blur(8px);font-size:12px;line-height:1.7}.art-top{font-size:10px;letter-spacing:2px;font-weight:900;z-index:1}.art-top span{display:block;font-family:'DM Serif Display',Georgia,serif;font-size:45px;line-height:1.02;letter-spacing:-1.5px;margin-top:7px;font-weight:400}.intro-notes{margin-top:15px;display:grid;grid-template-columns:repeat(3,1fr);gap:9px}.intro-note{padding:13px;background:var(--paper);border:1px solid var(--line);border-radius:10px}.intro-note b{font-size:19px;font-family:'DM Serif Display',Georgia,serif;font-weight:400}.intro-note small{font-size:10px;color:var(--muted);display:block;margin-top:3px}
.profile-hero{display:flex;justify-content:space-between;align-items:center;gap:16px}.profile-main{display:flex;align-items:center;gap:17px}.avatar{border-radius:16px;background:#e4d9cb;color:#73574b;width:66px;height:70px;display:flex;align-items:center;justify-content:center;font-family:'DM Serif Display',Georgia,serif;font-size:28px;flex-shrink:0;position:relative;overflow:hidden}.avatar:after{content:'';width:54px;height:27px;border-radius:50% 50% 0 0;background:#a88772;position:absolute;bottom:-11px}.avatar>span{position:relative;z-index:1}.profile-name{font-size:26px;letter-spacing:-.6px;font-family:'DM Serif Display',Georgia,serif;margin:1px 0 5px}.profile-meta{color:var(--muted);font-size:12px;line-height:1.6}.health-tag{color:var(--green);background:#e8f1e9;border-radius:99px;padding:7px 11px;font-size:10px;font-weight:800;white-space:nowrap}.health-tag.warning{color:#9d6c2f;background:#f5eddb}.health-tag.danger{color:#af3f42;background:#fae5df}.stats-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-top:20px}.stat-box{padding:16px 15px;background:var(--paper);border:1px solid var(--line);border-radius:13px}.stat-title{display:flex;align-items:center;justify-content:space-between;gap:5px;color:var(--muted);font-size:10px;font-weight:700}.stat-value{font-size:24px;font-family:'DM Serif Display',Georgia,serif;margin:9px 0 9px}.stat-track{height:5px;border-radius:20px;background:#ece8e0;overflow:hidden}.stat-fill{height:100%;border-radius:20px;background:var(--red)}
.age-panel{padding:21px 23px;background:#e9e2d7;border:1px solid #e4d9c9;border-radius:15px;display:flex;justify-content:space-between;align-items:center;gap:13px;margin-top:18px}.age-number{font-family:'DM Serif Display',Georgia,serif;font-size:37px;line-height:1.05}.age-panel small{font-size:11px;color:#7d7b70}.age-actions{display:flex;gap:8px}.age-hint{font-size:10px;color:var(--muted);margin-top:7px}.event-card{padding:25px;position:relative;overflow:hidden}.event-card:before{content:'';position:absolute;left:0;top:0;bottom:0;width:4px;background:var(--red)}.event-icon{font-size:28px;margin-bottom:10px}.event-heading{font-family:'DM Serif Display',Georgia,serif;font-size:28px;line-height:1.12;letter-spacing:-.5px;margin:8px 0 10px}.event-text{font-size:13px;line-height:1.87;color:#6f7069;margin-bottom:20px}.choices{display:flex;flex-direction:column;gap:9px}.choice-btn{display:flex;align-items:center;justify-content:space-between;text-align:left;gap:14px;background:#fffdfa;border:1px solid #e5e0d5;border-radius:11px;padding:14px 16px;transition:.18s;width:100%}.choice-btn:hover{border-color:#c99989;background:#fff8f3;transform:translateX(2px)}.choice-btn:disabled{opacity:.5}.choice-btn strong{font-size:12px;display:block}.choice-btn small{font-size:10px;color:var(--muted);display:block;margin-top:5px}.choice-arrow{color:var(--red);font-size:20px}.result-block{padding:16px;border:1px solid #d4e2d5;background:#eef5ed;border-radius:11px;margin-top:12px}.result-block strong{font-size:12px;color:var(--green)}.result-block p{font-size:12px;line-height:1.75;margin:6px 0 0;color:#5f7167}
.news-card{padding:19px 21px;display:flex;gap:13px;margin-top:11px}.news-icon{width:39px;height:39px;background:#f1e7df;color:var(--red);border-radius:10px;display:grid;place-items:center;flex-shrink:0;font-size:19px}.news-headline{font-family:'DM Serif Display',Georgia,serif;font-size:17px;margin:6px 0;line-height:1.33}.news-body{font-size:11px;color:#828176;line-height:1.6}.newspaper-meta{font-size:9px;letter-spacing:1.25px;font-weight:800;color:var(--red)}.quick-links{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.quick-link{padding:15px 12px;background:var(--paper);border:1px solid var(--line);border-radius:12px;text-align:left;display:flex;justify-content:space-between;align-items:center;gap:8px;font-weight:800;font-size:11px}.quick-link:hover{border-color:#c8ada0}.quick-link span{color:var(--red);font-size:17px}
.right-title{font-family:'DM Serif Display',Georgia,serif;font-weight:400;font-size:22px;margin:5px 0 19px}.money-main{font-family:'DM Serif Display',Georgia,serif;font-size:28px;letter-spacing:-.8px;margin:5px 0}.money-sub{font-size:10px;color:#828176;line-height:1.7}.mini-pair{display:flex;justify-content:space-between;gap:10px;font-size:11px;margin:13px 0}.mini-pair span{color:var(--muted)}.mini-pair b{font-size:11px;text-align:right}.right-divider{height:1px;background:var(--line);margin:24px 0}.news-right{padding-bottom:15px;border-bottom:1px solid var(--line);margin-bottom:15px}.news-right-title{font-size:12px;font-weight:700;line-height:1.5;margin-top:6px}.news-right p{font-size:10px;line-height:1.6;color:var(--muted);margin:5px 0 0}.badge{display:inline-flex;align-items:center;gap:5px;background:#f4e8df;color:#a64d3d;border-radius:99px;padding:6px 10px;font-size:9px;font-weight:900;letter-spacing:.5px}.badge.green{background:#e5f0e7;color:var(--green)}.badge.neutral{background:#efeae1;color:#77756c}
.stack{display:grid;gap:12px}.page-intro{margin-bottom:24px}.page-intro .display{font-size:42px}.list-item{display:flex;gap:13px;align-items:start;padding:15px 0;border-bottom:1px solid var(--line)}.list-item:last-child{border-bottom:0}.list-icon{font-size:18px;width:36px;height:36px;display:grid;place-items:center;border-radius:10px;background:#eee7dc;flex-shrink:0}.list-title{font-size:13px;font-weight:800;line-height:1.5}.list-desc{font-size:11px;color:var(--muted);line-height:1.75;margin-top:4px}.tagline{background:#ece1d3;border-radius:15px;padding:23px;margin-top:22px;font-family:'DM Serif Display',Georgia,serif;font-size:22px;line-height:1.4;font-style:italic;color:#756555}.service-card{padding:18px}.service-title{font-weight:800;font-size:13px;margin:0 0 7px}.service-description{font-size:11px;color:var(--muted);line-height:1.7;min-height:30px;margin:0 0 14px}.service-price{font-size:11px;font-weight:800;color:var(--red)}.service-top{display:flex;justify-content:space-between;gap:15px}.services{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}.small-detail{display:flex;align-items:center;justify-content:space-between;font-size:12px;padding:11px 0;border-bottom:1px solid var(--line)}.small-detail span:first-child{color:var(--muted)}.small-detail strong{text-align:right}.record-stat{background:var(--paper);border:1px solid var(--line);padding:21px;border-radius:14px;text-align:center}.record-stat b{font-family:'DM Serif Display',Georgia,serif;font-size:30px;font-weight:400}.record-stat small{display:block;color:var(--muted);font-size:10px;margin-top:5px}.record-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.timeline-item{display:grid;grid-template-columns:58px 1fr;gap:14px;padding:0 0 23px;position:relative}.timeline-item:not(:last-child):before{content:'';position:absolute;left:52px;top:18px;bottom:0;width:1px;background:#ddd5ca}.timeline-year{text-align:right;padding-top:2px;font-size:11px;font-weight:800;color:var(--red)}.timeline-bullet{position:relative;padding:0 0 0 12px}.timeline-bullet:before{content:'';position:absolute;left:-5px;top:5px;width:8px;height:8px;border-radius:50%;background:var(--red)}.timeline-title{font-size:12px;font-weight:800}.timeline-text{font-size:11px;color:var(--muted);line-height:1.8;margin-top:5px}
.family-item{padding:15px;border:1px solid var(--line);border-radius:12px;background:var(--paper);display:flex;gap:13px;align-items:center;justify-content:space-between}.family-avatar{width:42px;height:42px;border-radius:12px;background:#e7d8c8;display:grid;place-items:center;font-family:'DM Serif Display',Georgia,serif;color:#94634c;font-size:20px}.family-name{font-size:12px;font-weight:800}.family-detail{font-size:10px;color:var(--muted);line-height:1.6;margin-top:4px}.relation-tag{font-size:9px;color:var(--red);font-weight:800;padding:6px 8px;background:#f7e7e4;border-radius:99px}
.death-page{text-align:center}.death-ornament{width:62px;height:62px;border:1px solid #c2aca0;border-radius:50%;display:grid;place-items:center;margin:0 auto 15px;font-size:30px;color:var(--red)}.death-label{font-size:10px;color:var(--muted);letter-spacing:2.8px;font-weight:800}.death-name{font-family:'DM Serif Display',Georgia,serif;font-weight:400;font-size:clamp(36px,5vw,58px);line-height:1.1;margin:13px 0 6px}.death-years{font-size:12px;color:var(--muted)}.death-quote{font-family:'DM Serif Display',Georgia,serif;font-style:italic;line-height:1.35;font-size:clamp(23px,3vw,33px);color:#5e4b41;margin:25px auto 17px;max-width:580px}.death-prose{font-size:13px;color:#7b7970;line-height:1.9;max-width:580px;margin:0 auto 25px}.death-medal{background:#efe7da;border-radius:14px;padding:21px;text-align:center;margin-top:17px}.death-medal b{font-family:'DM Serif Display',Georgia,serif;font-size:24px;font-weight:400;display:block;margin-top:7px}.death-actions{display:flex;justify-content:center;gap:10px;flex-wrap:wrap;margin-top:22px}.estate-table{width:100%;border-collapse:collapse;font-size:12px}.estate-table td{border-bottom:1px solid var(--line);padding:14px 0}.estate-table td:last-child{text-align:right;font-weight:800}.estate-table tr:last-child td{border-bottom:0}.successors{display:grid;gap:10px}.successor-card{display:flex;align-items:center;gap:13px;text-align:left;width:100%;padding:17px;border:1px solid var(--line);background:var(--paper);border-radius:12px}.successor-card:hover{border-color:var(--red);background:#fff8f6}.successor-card .next{margin-left:auto;color:var(--red);font-size:20px}
.bottom-nav{display:none}.empty{text-align:center;padding:50px 16px;color:var(--muted);font-size:12px;line-height:1.9}.empty-icon{font-size:33px;display:block;margin-bottom:9px}.toast{position:fixed;bottom:22px;left:50%;transform:translateX(-50%);z-index:50;box-shadow:0 12px 30px #0002;background:#282a27;color:#fff;padding:12px 18px;border-radius:12px;font-size:12px;max-width:calc(100vw - 24px)}.export-button{margin-top:12px}.config-option{margin-bottom:16px}.credits{font-size:10px;line-height:1.8;color:var(--muted)}.visible-mobile{display:none}
@media(max-width:1250px){.shell{grid-template-columns:220px minmax(0,1fr)}.side-right{display:none}.content{padding:29px clamp(24px,4vw,48px) 50px}.sidebar{padding-left:13px;padding-right:13px}.display{font-size:55px}}
@media(max-width:790px){.shell{display:block}.sidebar{display:none}.content{padding:20px 18px 110px;max-width:710px;margin:auto}.topline{margin-bottom:24px}.display{font-size:50px}.onboard-layout{grid-template-columns:1fr}.intro-art{min-height:230px}.art-top span{font-size:35px}.art-building.b1{height:53%}.stats-grid{grid-template-columns:repeat(2,1fr)}.visible-mobile{display:block}.bottom-nav{position:fixed;bottom:0;left:0;right:0;display:flex;justify-content:space-around;align-items:center;z-index:25;background:rgba(252,249,243,.96);border-top:1px solid var(--line);padding:9px 5px max(10px,env(safe-area-inset-bottom));backdrop-filter:blur(16px)}.bottom-btn{border:0;background:transparent;display:grid;justify-items:center;gap:4px;font-size:9px;color:#8e8c82;font-weight:700;min-width:51px;padding:5px}.bottom-btn .bi{font-size:19px}.bottom-btn.on{color:var(--red)}.age-panel{flex-direction:column;align-items:stretch}.age-actions{width:100%}.age-actions .btn{flex:1}.profile-meta{font-size:11px}.profile-name{font-size:23px}.record-grid{grid-template-columns:repeat(3,1fr)}.page-intro .display{font-size:39px}}
@media(max-width:450px){.content{padding:18px 14px 115px}.topline{margin-bottom:23px}.display{font-size:43px}.desc{font-size:12px}.profile-main{gap:11px}.avatar{width:53px;height:57px;font-size:24px}.profile-name{font-size:21px}.profile-meta{max-width:190px;font-size:10px}.health-tag{padding:5px 7px;font-size:9px}.stat-box{padding:13px}.quick-links{gap:6px}.quick-link{font-size:10px;display:block;padding:12px 10px}.quick-link span{display:block;margin-top:6px}.two-fields{grid-template-columns:1fr}.services{grid-template-columns:1fr}.record-grid{grid-template-columns:repeat(2,1fr)}.death-actions{flex-direction:column}.death-actions .btn{width:100%}.event-card{padding:21px}.page-intro .display{font-size:35px}.top-actions .tiny-pill{display:none}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;transition:none!important;animation:none!important}}
/* v0.2 — Living Stories */
.story-spotlight{margin:14px 0 4px;display:flex;align-items:center;justify-content:space-between;gap:14px;background:#eee6d9;border:1px solid #dfd0c0;border-radius:12px;padding:13px 16px;color:#684f43;font-weight:700;font-size:12px}
.story-arc-head{display:flex;align-items:center;gap:13px;margin-bottom:15px}.story-arc-icon{width:48px;height:48px;border-radius:12px;background:#f2ebe0;display:grid;place-items:center;font-size:23px}.story-arc-timeline{display:grid;gap:8px;margin-top:12px}.story-arc-timeline>div{border-left:2px solid #c3a396;padding:4px 0 4px 13px;font-size:12px;line-height:1.5;color:#50493f}.story-arc-timeline>div>span{color:#a15a4b;font-weight:800;margin-right:9px}.story-next{font-size:11px;color:#83624c;background:#f4eee5;border:1px solid #eee2d0;padding:10px 12px;border-radius:9px;margin-top:12px}.story-npc-memory{margin-top:7px;font-size:11px;font-style:italic;color:#8b7164}.story-trust{width:53px;height:6px;border-radius:20px;background:#e9e1d5;overflow:hidden;flex-shrink:0}.story-trust>div{height:100%;background:#698d70;border-radius:20px}
@media(max-width:920px){.bottom-nav{overflow-x:auto;justify-content:space-between;scrollbar-width:none}.bottom-nav::-webkit-scrollbar{display:none}.bottom-btn{flex:1;min-width:46px}.story-spotlight{flex-wrap:wrap}}@media(max-width:450px){.bottom-btn{min-width:43px;font-size:8px}.bottom-btn .bi{font-size:17px}.story-spotlight{font-size:11px}}

/* v0.3 — share studio and cross-generation biography */
.life-share-tools,.death-share-head{display:flex;gap:9px;flex-wrap:wrap;justify-content:flex-end;margin:18px 0 2px}
.death-share-head{justify-content:center;margin:0 0 19px}
.history-toolbar{margin-top:6px}
.history-toolbar-head{display:flex;justify-content:space-between;gap:15px;align-items:center;margin-bottom:20px;flex-wrap:wrap}
.history-filters{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.history-search{margin-top:13px;display:flex;gap:8px;align-items:center}
.history-search>span{font-size:21px;color:#777168}
.history-search .field{min-width:0;flex:1}
.history-summary{margin-top:18px}
.legacy-strip{display:grid;grid-template-columns:repeat(auto-fit,minmax(175px,1fr));gap:10px}
.legacy-small{display:flex;flex-direction:column;gap:8px;background:#fffaf2;padding:17px;border:1px solid var(--line);border-radius:13px;min-width:0}
.legacy-small strong{font-family:'DM Serif Display',Georgia,serif;font-size:21px;font-weight:400;overflow-wrap:anywhere}
.legacy-small>span:last-child{font-size:11px;color:var(--muted);line-height:1.6}
.history-feed{padding:3px 0 10px;position:relative}
.history-feed:before{content:'';position:absolute;left:18px;top:32px;bottom:19px;width:1px;background:#d8cab9}
.history-year-break{position:relative;display:flex;align-items:center;gap:14px;margin:18px 0 16px;z-index:1}
.history-year-break>span{font-family:'DM Serif Display',Georgia,serif;font-size:27px;color:var(--red);background:var(--cream);padding-right:6px}
.history-year-break>i{height:1px;background:#ddd1c3;flex:1}
.history-entry{position:relative;display:flex;align-items:flex-start;gap:15px;margin:0 0 12px;padding-left:4px}
.history-symbol{z-index:1;display:grid;place-items:center;flex-shrink:0;width:30px;height:30px;margin-top:17px;border-radius:50%;font-weight:800;font-size:13px;color:var(--red);background:#f7efe6;border:1px solid #d8bfb3}
.history-entry-body{flex:1;min-width:0;background:#fffcf6;padding:18px 19px;border-radius:13px;border:1px solid var(--line)}
.history-entry-body h3{font-size:16px;line-height:1.35;margin:10px 0 6px;letter-spacing:-.15px}
.history-entry-body p{font-size:12px;line-height:1.75;color:#68675f;margin:0;overflow-wrap:anywhere}
.history-entry-top{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap}
.history-person{font-size:10px;color:var(--red);font-weight:800;background:#faece8;padding:5px 8px;border-radius:20px}
.history-load{text-align:center;margin:9px 0 25px}.history-foot{display:flex;justify-content:space-between;gap:18px;align-items:center;margin-top:20px}.history-foot .service-description{margin-bottom:0;max-width:490px}
.share-layout{display:grid;grid-template-columns:minmax(245px,.9fr) minmax(270px,1.1fr);gap:20px;align-items:start}
.share-options{position:sticky;top:24px}
.share-toggle{display:flex;align-items:center;gap:12px;padding:15px 0;border-bottom:1px solid var(--line);cursor:pointer}
.share-toggle input{appearance:auto;accent-color:var(--red);width:18px;height:18px;flex-shrink:0}
.share-toggle>span{display:flex;flex-direction:column;gap:5px}
.share-toggle b{font-size:12px}.share-toggle small{font-size:11px;color:var(--muted);line-height:1.5}
.share-action-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:15px}
.share-action-grid .btn{text-align:center;min-height:47px;padding:10px 9px;line-height:1.35}
.share-preview-wrap{min-width:0;max-width:500px;margin:0 auto;width:100%}
.share-poster{width:100%;aspect-ratio:9 / 16;background:#f7f0e4;border-top:6px solid var(--red);padding:clamp(20px,4vw,38px);box-shadow:0 16px 40px rgba(55,44,28,.12);display:flex;flex-direction:column;gap:0;overflow:hidden;color:#282a27}
.poster-top{display:flex;justify-content:space-between;align-items:center;gap:7px;font-size:clamp(10px,1vw,15px);font-weight:900;letter-spacing:1.6px}
.poster-top b{font-size:clamp(24px,3.5vw,39px);letter-spacing:-2px;color:var(--red)}
.poster-edition{font-size:clamp(8px,.8vw,10px);margin:10px 0 13px;color:#8a8072;letter-spacing:1.2px}
.poster-line,.poster-divider{width:100%;height:1px;background:#bcae9c}
.poster-eyebrow{font-size:clamp(8px,.7vw,11px);font-weight:900;letter-spacing:1.6px;color:var(--red);margin:25px 0 14px}
.share-poster h2{font-family:'DM Serif Display',Georgia,serif;font-size:clamp(32px,4.5vw,68px);font-weight:400;line-height:1.04;letter-spacing:-1.5px;overflow-wrap:anywhere;margin:0 0 9px}
.poster-period{font-size:clamp(10px,1vw,13px);letter-spacing:1px;color:#7b7469}
.poster-quote{font-family:'DM Serif Display',Georgia,serif;font-size:clamp(21px,3vw,38px);line-height:1.2;font-style:italic;color:var(--red);margin:28px 0;overflow-wrap:anywhere}
.poster-metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:23px 0 14px}
.poster-metrics>div{display:flex;flex-direction:column;gap:3px}
.poster-metrics b{font-family:'DM Serif Display',Georgia,serif;font-size:clamp(26px,3.5vw,45px);font-weight:400}
.poster-metrics span{font-size:clamp(8px,.85vw,11px);color:#8a8276}
.poster-extra{font-size:clamp(9px,.85vw,12px);color:#726a5e;margin:2px 0 5px}
.poster-highlights{margin-top:auto;padding-top:20px;border-top:1px solid #c9b8a4;display:flex;flex-direction:column;gap:8px}
.poster-highlights>div:not(.micro){font-size:clamp(10px,1.05vw,13px);line-height:1.4;color:#534e47}
.poster-highlights b{color:var(--red);margin-right:6px}
.poster-bottom{display:flex;flex-direction:column;background:#e8dbca;padding:16px 20px;margin:18px -20px -20px;gap:4px}
.poster-bottom b{font-size:clamp(17px,2.7vw,29px);letter-spacing:-.8px}.poster-bottom span{font-size:clamp(8px,.7vw,10px);letter-spacing:1px;color:#71685d}
@media(max-width:1180px){.share-layout{grid-template-columns:1fr}.share-options{position:static}.share-preview-wrap{max-width:430px}.share-poster h2{font-size:clamp(42px,5vw,68px)}.poster-quote{font-size:clamp(27px,3.5vw,38px)}}
@media(max-width:540px){.history-filters{grid-template-columns:1fr}.history-toolbar-head .btn{width:100%}.history-foot{flex-direction:column;align-items:stretch}.history-foot .btn{width:100%}.history-entry{gap:11px}.history-entry-body{padding:14px}.share-options{padding:17px}.share-action-grid{grid-template-columns:1fr 1fr}.share-poster{padding:23px}.share-poster h2{font-size:clamp(38px,9vw,55px)}.poster-quote{font-size:clamp(23px,6.5vw,33px)}.poster-top{font-size:11px}.poster-top b{font-size:27px}.poster-edition{font-size:8px}.poster-eyebrow{margin:22px 0 13px}.poster-metrics b{font-size:32px}.poster-highlights>div:not(.micro){font-size:11px}.poster-bottom{margin:15px -23px -23px}.life-share-tools .btn{flex:1}}

@font-face {
  font-family: "Noto Sans Display";
  src: url("assets/noto-sans-display-bold.woff") format("woff");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  --cream: #f5ecdf;
  --paper: #fffaf0;
  --ink: #301e25;
  --muted: #6c5756;
  --line: #e4d3c2;
  --red: #8c3045;
  --red-dark: #612337;
  --display: "Noto Sans Display", system-ui, sans-serif;
  --cover-art: url("assets/kampung-senja.webp");
  color-scheme: light;
  font-family: system-ui, sans-serif;
}

body {
  background: radial-gradient(ellipse at 50% 0%, #fff5e4, transparent 34rem), var(--cream);
  font-size: 1rem;
}

:focus-visible { outline: 3px solid #ab5824; outline-offset: 3px; }
button:focus-visible, input:focus-visible, select:focus-visible { outline-color: #ab5824; }
.game-shell { min-height: 100dvh; }
.game-icon { display: block; width: 1.25rem; height: 1.25rem; flex: none; }
.game-header { background: #491c2c; color: #fff4e5; border-bottom: 4px solid #d08959; }
.header-inner {
  max-width: 72rem;
  min-height: 4rem;
  padding: .5rem clamp(1rem, 4vw, 2rem);
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
.game-brand, .header-help {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
}
.game-brand { font: 700 clamp(1rem, 3.6vw, 1.35rem)/1 var(--display); letter-spacing: .025em; }
.game-brand b { color: #ffcf96; }
.game-mark {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid #ffd4a0;
  border-radius: .7rem;
  background: #f0b676;
  color: #491c2c;
  box-shadow: 0 2px 0 #220f16;
  transform: rotate(-5deg);
  font-size: .95rem;
}
.header-help { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border: 1px solid #825063; border-radius: .7rem; }
.header-help:hover { background: #6a3144; }
.header-status { display: flex; gap: .35rem; align-items: center; }
.header-status span {
  border: 1px solid #8e5966;
  background: #622d40;
  color: #ffe6cf;
  border-radius: .55rem;
  padding: .35rem .5rem;
  font-size: .8125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.game-content { max-width: 72rem; padding: 1.5rem clamp(1rem, 4vw, 2rem) 2.5rem; margin: auto; }
html:has(.has-save) { scroll-padding-bottom: calc(5.4rem + env(safe-area-inset-bottom)); }
.has-save .game-content { padding-bottom: calc(7rem + env(safe-area-inset-bottom)); }
.game-content:focus { outline: none; }
.game-content .card { box-shadow: 0 3px 0 #e8d8c9; }
.game-content :is(.section-title, .display, .service-title, .list-title, .record-stat b, .event-heading, .death-name, .right-title) {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -.035em;
}
.game-content .display em { font-style: normal; }
.game-content .section-title { font-size: clamp(1.35rem, 3.5vw, 1.65rem); line-height: 1.2; }
.game-content .section-head { margin: 1.4rem 0 .75rem; }
.game-content .desc { font-size: 1rem; }
.game-content :is(.list-desc, .service-description, .section-sub, .history-entry-body p, .family-detail, .death-prose, .story-next) { font-size: .9375rem; color: var(--muted); }
.game-content :is(.list-title, .service-title, .family-name, .timeline-title, .share-toggle b) { font-size: 1rem; }
.game-content :is(.field, .input-label) { font-size: .9375rem; }
.game-content .input-label { color: var(--ink); }
.game-content .field { min-width: 0; background: #fffdfa; border-color: #cfbaad; }
.game-content :is(.btn, .btn.small) { min-height: 2.75rem; font-size: .875rem; }
.game-content .btn.primary { background: var(--red); box-shadow: 0 3px 0 var(--red-dark); }
.game-content .btn.primary:hover { background: #9b3a50; }
.game-content .btn.primary:active { box-shadow: 0 1px 0 var(--red-dark); }
.game-content .btn.ghost { background: #fffaf2; border-color: #d8c1b4; }
.game-content .btn.ghost:hover { background: #f9e7de; }
.game-content .credits { color: var(--muted); font-size: .8125rem; }
.text-button {
  color: var(--red-dark);
  background: transparent;
  border: 0;
  border-radius: .5rem;
  padding: .5rem .45rem;
  min-height: 2.75rem;
  white-space: nowrap;
  font-size: .875rem;
  font-weight: 750;
}
.text-button:hover { background: #f5e1d3; }

.game-cover {
  position: relative;
  display: grid;
  align-items: center;
  isolation: isolate;
  overflow: hidden;
  min-height: 17rem;
  border-radius: 1.25rem;
  border: 1px solid #733f46;
  background: #572535;
  color: #fff5e9;
  box-shadow: 0 5px 0 #e2c9b6;
}
.cover-art, .world-art {
  background: #b66f60 var(--cover-art) center 57% / cover no-repeat;
}
.cover-art { position: absolute; z-index: -2; inset: 0 0 0 36%; }
.game-cover::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(90deg, #522137 20%, #522137f5 38%, #52213780 57%, transparent 81%);
}
.cover-copy { padding: clamp(1.25rem, 4.5vw, 3rem); max-width: 35rem; }
.cover-caption { color: #ffc587; font-size: .8125rem; font-weight: 750; letter-spacing: .09em; }
.cover-copy h1 {
  margin: .65rem 0 .85rem;
  font: 700 clamp(2.7rem, 6.9vw, 5rem)/.94 var(--display);
  letter-spacing: -.055em;
}
.cover-copy h1 em { color: #ffc587; font-style: normal; }
.cover-copy p { color: #ffe8d5; line-height: 1.6; max-width: 27ch; margin: 0; }
.launch-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.2rem; margin-top: 1.5rem; }
.launch-tools p { margin: 0; }
.guest-mode { border-top: 1px solid var(--line); margin-top: .3rem; padding: .8rem .6rem .15rem; }
.guest-mode :is(.input-label, .field) { font-size: .875rem; }
.panel-item .game-icon {
  width: 2.5rem;
  height: 2.5rem;
  padding: .6rem;
  border-radius: .75rem;
  color: var(--red-dark);
  background: #f4dfd1;
}

.life-grid { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.life-main { min-width: 0; }
.character-card {
  padding: clamp(.75rem, 2vw, 1.25rem);
  margin-bottom: 1.15rem;
  border: 1px solid #a65e67;
  border-radius: 1.2rem;
  background: linear-gradient(118deg, #712b45, #8c414c);
  color: #fff4e8;
  box-shadow: 0 4px 0 #d3ab9e;
}
.character-top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .8rem; align-items: center; }
.character-top .avatar {
  width: clamp(2.875rem, 8vw, 4rem);
  height: clamp(3rem, 8vw, 4rem);
  border-radius: .85rem;
  border: 1px solid #ffd098;
  box-shadow: 0 3px 0 #522137;
  background: #efb479;
  color: #572035;
  font: 700 clamp(1.4rem, 4vw, 2rem)/1 var(--display);
}
.character-top .avatar::after { background: #bb704e; width: 85%; opacity: .6; }
.character-info { overflow-wrap: anywhere; }
.character-info h1 {
  font: 700 clamp(1.35rem, 4.5vw, 2.15rem)/1.04 var(--display);
  letter-spacing: -.035em;
  margin: .2rem 0 .25rem;
}
.character-place, .character-info p { font-size: .8125rem; color: #ffdec6; margin: 0; line-height: 1.35; }
.character-age { display: grid; text-align: center; padding: .38rem .72rem .45rem; border: 1px solid #c98d82; border-radius: .7rem; background: #4f1e32; min-width: 3.2rem; }
.character-age strong { font: 700 clamp(1.5rem, 4.5vw, 2.3rem)/1 var(--display); }
.character-age span { color: #f8cca9; font-size: .75rem; margin-top: .2rem; }
.hud-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .48rem; margin-top: .95rem; }
.hud-stat { padding: .62rem .55rem; background: #fff2e4; border: 1px solid #f3d6c2; border-radius: .65rem; color: #4c3038; }
.hud-stat-top { display: flex; align-items: center; gap: .28rem; font-size: .8125rem; font-weight: 700; }
.hud-stat-top strong { margin-left: auto; color: var(--meter); font-variant-numeric: tabular-nums; }
.hud-stat-top strong span { font-size: .7rem; }
.hud-stat-icon { color: var(--meter); font-size: .95rem; }
.hud-meter { height: .34rem; margin-top: .42rem; border-radius: 99px; overflow: hidden; background: #e9d5c9; }
.hud-meter span { display: block; height: 100%; border-radius: inherit; background: var(--meter); }

.scene-card { padding: clamp(1rem, 3vw, 1.65rem); border-top: 4px solid var(--red); border-radius: 1.05rem; animation: reveal-scene .24s ease-out both; }
@keyframes reveal-scene { from { opacity: 0; transform: translateY(.3rem); } to { opacity: 1; transform: translateY(0); } }
.scene-top { display: flex; align-items: center; gap: .6rem; color: var(--red-dark); font-size: .875rem; font-weight: 750; }
.scene-icon { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: .58rem; background: #f4ded4; font-size: 1.05rem; }
.scene-card h2 { font: 700 clamp(1.55rem, 4vw, 2.1rem)/1.08 var(--display); letter-spacing: -.035em; margin: .75rem 0 .55rem; }
.scene-card p { color: var(--muted); line-height: 1.58; margin: 0; }
.scene-prompt { margin: 1.2rem 0 .6rem; font-weight: 750; font-size: .875rem; }
.scene-card .choice-btn {
  justify-content: flex-start;
  gap: .75rem;
  border: 1px solid #ddc7b6;
  border-bottom-width: 3px;
  border-radius: .7rem;
  padding: .65rem .75rem;
  background: #fffdf7;
  color: var(--ink);
}
.scene-card .choice-btn:hover { background: #fff1e6; border-color: #b77c80; transform: none; }
.scene-card .choice-btn:active { transform: translateY(2px); }
.scene-card .choice-btn strong { font-size: .9375rem; line-height: 1.3; }
.scene-card .choice-btn small { font-size: .8125rem; color: var(--muted); line-height: 1.35; margin-top: .22rem; }
.choice-key { display: grid; place-items: center; flex: none; width: 1.85rem; height: 1.85rem; border-radius: .45rem; background: #f3ded6; color: var(--red-dark); font: 700 .9375rem/1 var(--display); }
.scene-result { border-top-color: #498063; }
.scene-result :is(.scene-top, .scene-icon) { color: #24563c; }
.scene-result .scene-icon { background: #e0eedf; }
.scene-choice { margin: .25rem 0 .65rem; font-size: .875rem; font-weight: 750; color: #24563c; }
.scene-ready { border-top-color: #be7f41; }
.journal { padding: .1rem .85rem; }
.journal-entry { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .75rem; padding: .85rem 0; }
.journal-entry + .journal-entry { border-top: 1px solid var(--line); }
.journal-entry > span { align-self: start; padding: .25rem .4rem; border-radius: .4rem; background: #f4ddd4; color: var(--red-dark); font-weight: 750; font-size: .8125rem; }
.journal-entry h3 { margin: .15rem 0 .25rem; font-size: .9375rem; }
.journal-entry p { margin: 0; font-size: .875rem; line-height: 1.5; color: var(--muted); }
.world-card { overflow: hidden; }
.world-art { aspect-ratio: 1.8; }
.world-card-content { display: flex; align-items: center; justify-content: space-between; gap: .4rem; padding: .75rem .85rem; }
.world-card-content strong { display: block; margin-top: .22rem; font: 700 clamp(1rem, 3vw, 1.5rem)/1.1 var(--display); overflow-wrap: anywhere; }
.world-card-content .micro { font-size: .75rem; }
.aside-news .news-body { font-size: .875rem; color: var(--muted); }
.aside-news .news-headline { font: 700 1.05rem/1.25 var(--display); }
.aside-share { margin-top: 1rem; }

.game-dock {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: calc(.75rem + env(safe-area-inset-bottom));
  width: min(32rem, calc(100% - 1.25rem));
  transform: translateX(-50%);
  padding: .36rem;
  border: 1px solid #a16c76;
  border-radius: 1.05rem;
  background: #491c2c;
  box-shadow: 0 4px 0 #30111c, 0 10px 25px #38132242;
}
.dock-inner { display: flex; gap: .3rem; }
.dock-button, .dock-advance {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: .2rem;
  flex: 1;
  min-width: 0;
  min-height: 3.25rem;
  border: 0;
  border-radius: .7rem;
  background: transparent;
  color: #ffebdb;
  font-size: .8125rem;
  font-weight: 700;
  white-space: nowrap;
}
.dock-button.on, .dock-button:hover { background: #6f364a; color: #fff1c9; }
.dock-advance {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .24rem;
  flex: 1.6;
  background: #f7bd7e;
  color: #381823;
  font: 700 clamp(.9rem, 3.7vw, 1.125rem)/1 var(--display);
  box-shadow: inset 0 -3px 0 #bd734d;
}
.dock-advance:hover:not(:disabled) { background: #ffcf96; }
.dock-advance:active:not(:disabled) { transform: translateY(2px); box-shadow: inset 0 -1px 0 #bd734d; }
.dock-advance:disabled { opacity: 1; background: #6c3d4c; color: #f8d0bf; box-shadow: none; }
.dock-advance .game-icon { width: 1.05rem; }
.game-dock :focus-visible, .game-header :focus-visible { outline-color: #ffd78f; outline-offset: -2px; }

.game-dialog {
  position: fixed;
  inset: auto 0 calc(5.3rem + env(safe-area-inset-bottom));
  width: min(32rem, calc(100% - 1.25rem));
  max-width: none;
  max-height: calc(100dvh - 6.5rem - env(safe-area-inset-bottom));
  margin: 0 auto;
  padding: 0;
  overflow: auto;
  border: 1px solid #98626a;
  border-radius: 1rem;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 6px 0 #4e243847, 0 18px 55px #28101d4d;
}
.game-shell:not(.has-save) .game-dialog { inset: 4.75rem 0 auto; }
.game-dialog::backdrop { background: #30151f85; }
.panel-head { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: .65rem 1rem; border-bottom: 1px solid var(--line); }
.panel-head h2 { font: 700 1.45rem/1.05 var(--display); letter-spacing: -.02em; margin: 0; }
.panel-close { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border: 0; border-radius: .6rem; color: var(--red-dark); background: #f4e5dc; }
.panel-close:hover { background: #f0d3c6; }
.panel-items { display: grid; gap: .4rem; padding: .6rem .7rem .8rem; }
.panel-item { display: flex; gap: .75rem; align-items: center; text-align: left; padding: .55rem .6rem; background: transparent; color: var(--ink); border: 1px solid transparent; border-radius: .75rem; }
.panel-item:hover { background: #fff0e5; border-color: var(--line); }
.panel-item strong, .panel-item small { display: block; }
.panel-item small { margin-top: .2rem; color: var(--muted); font-size: .8125rem; line-height: 1.3; }
.panel-period { display: flex; gap: .6rem; justify-content: space-between; align-items: center; padding: .65rem .6rem 0; border-top: 1px solid var(--line); }
.panel-period .btn { min-height: 2.75rem; font-size: .875rem; white-space: nowrap; background: #fff5e9; border-color: #dfc8ba; }
.panel-period small { color: var(--muted); font-size: .8125rem; }
.panel-description { margin: .45rem .45rem .65rem; color: var(--muted); line-height: 1.55; }
.toast { bottom: calc(5.35rem + env(safe-area-inset-bottom)); font-size: .875rem; }

@media (max-width: 900px) {
  .hud-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 690px) {
  .game-content { padding-top: 1rem; }
  .life-grid { grid-template-columns: minmax(0, 1fr); }
  .game-cover { min-height: 15rem; align-items: end; }
  .cover-art { inset: 0; background-position: 56% 48%; }
  .game-cover::before { background: linear-gradient(90deg, #3e1829f5, #3e1829a6 50%, #3e182933 100%), linear-gradient(0deg, #3e1829bc, transparent 90%); }
  .cover-copy { padding-block: 1.4rem; }
  .life-aside { display: none; }
  .game-content .section-head { align-items: center; }
}
@media (max-width: 380px) {
  .game-content, .header-inner { padding-inline: .75rem; }
  .cover-caption { font-size: .75rem; }
  .character-top { gap: .55rem; }
  .hud-stat { padding-inline: .48rem; }
  .panel-item { gap: .55rem; }
}

.game-content .random-start {
  margin-top: 1.2rem;
  background: #f7bd7e;
  color: #421d28;
  box-shadow: 0 3px 0 #a55a43;
}
.game-content .random-start:hover { background: #ffd19e; }

html:has(.birth-dialog[open]) { overflow: hidden; }
.birth-dialog {
  width: min(34rem, calc(100% - 1.5rem));
  max-width: none;
  max-height: min(44rem, calc(100dvh - 1.5rem - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
  padding: 0;
  overflow: hidden;
  border: 1px solid #ac787d;
  border-radius: 1.2rem;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 1rem 3rem #28101d66;
}
.birth-dialog[open] { display: flex; flex-direction: column; animation: reveal-scene .24s ease-out both; }
.birth-dialog::backdrop { background: #30151fba; }
.birth-hero {
  flex: none;
  padding: clamp(1rem, 4vw, 1.55rem);
  border-bottom: .25rem solid #db9e72;
  background: linear-gradient(100deg, #411c2e 10%, #511e34ed 53%, #5426388c), var(--cover-art) center 54% / cover, #491c2c;
  color: #fff4e6;
}
.birth-hero p { margin: .25rem 0 0; color: #ffe1c1; font-size: .9375rem; }
.birth-hero .birth-kicker { color: #ffd098; font-weight: 750; margin: 0; }
.birth-hero h2 { margin: .38rem 0; font: 700 clamp(1.8rem, 6.5vw, 2.75rem)/1.06 var(--display); overflow-wrap: anywhere; }
.birth-hero h2:focus { outline: none; }
.birth-content { overflow: auto; overscroll-behavior: contain; padding: 1rem clamp(.9rem, 4vw, 1.55rem); }
.birth-story { margin: 0; color: var(--muted); font-size: 1rem; line-height: 1.5; }
.birth-facts, .birth-parents { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.birth-facts { margin: .9rem 0 1rem; }
.birth-facts div, .birth-parents li { padding: .55rem .65rem; border-radius: .6rem; min-width: 0; overflow-wrap: anywhere; }
.birth-facts div { border: 1px solid var(--line); background: #faf0e6; }
.birth-facts dt, .birth-parents span { color: var(--muted); font-size: .875rem; line-height: 1.3; }
.birth-facts dd { margin: .25rem 0 0; font: 700 1rem/1.15 var(--display); }
.birth-content h3 { margin: 0 0 .4rem; font: 700 1.2rem/1.2 var(--display); }
.birth-parents { padding: 0; margin: 0; list-style: none; }
.birth-parents li { display: grid; gap: .22rem; background: #f2ddd5; border: 1px solid #e7c4bb; }
.birth-parents strong { font: 700 1.05rem/1.15 var(--display); }
.birth-footer { flex: none; border-top: 1px solid var(--line); padding: .75rem clamp(.9rem, 4vw, 1.55rem) .95rem; }
.birth-footer .btn { min-height: 2.8rem; font-size: .9375rem; box-shadow: 0 3px 0 var(--red-dark); }

.wallet-strip {
  display: flex;
  gap: .65rem;
  align-items: center;
  justify-content: space-between;
  min-height: 3.5rem;
  margin-top: .75rem;
  padding: .4rem .55rem .4rem .7rem;
  background: #55243a;
  border: 1px solid #ba7b7b;
  border-radius: .65rem;
}
.wallet-amount { display: flex; align-items: center; gap: .55rem; min-width: 0; color: #ffd9ae; font-size: .8125rem; }
.wallet-amount strong, .shop-balance strong {
  color: #fff4e8;
  display: block;
  margin-top: .2rem;
  font: 700 clamp(1.05rem, 3.8vw, 1.45rem)/1.08 var(--display);
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
.game-content .wallet-shop {
  flex: none;
  padding: .48rem .65rem;
  background: #f7bd7e;
  color: #451d26;
}
.wallet-shop:hover { background: #ffd19e; }
.scene-surprise { border-top-color: #b57226; }
.scene-surprise .scene-top { color: #7b440e; }
.scene-surprise .scene-icon, .shop-icon { background: #f7e3bd; }

.shop-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(12.5rem, 1fr);
  align-items: center;
  gap: 1.1rem;
  padding: clamp(1rem, 3vw, 1.6rem);
  border-top: 4px solid var(--red);
  margin-bottom: 1.1rem;
}
.shop-header p { color: var(--muted); line-height: 1.5; margin: .5rem 0 0; }
.shop-balance {
  justify-self: end;
  min-width: min(100%, 12.5rem);
  padding: .85rem 1rem;
  border: 1px solid #be7979;
  border-radius: .75rem;
  background: #622a40;
  color: #ffe1c9;
}
.shop-balance span, .shop-balance small { display: block; font-size: .875rem; }
.shop-balance small { margin-top: .5rem; }
.shop-balance strong { font-size: clamp(1.3rem, 4vw, 1.7rem); }
.shop-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; }
.shop-item { display: flex; flex-direction: column; gap: .75rem; min-width: 0; padding: 1rem; }
.shop-item-top, .shop-item-actions { display: flex; align-items: center; gap: .7rem; }
.shop-item-top h2 { margin: 0; font: 700 1.2rem/1.1 var(--display); }
.shop-item-top strong { display: block; margin-top: .3rem; color: var(--red-dark); font-size: .9375rem; }
.shop-item p, .shop-item-actions span { color: var(--muted); font-size: .875rem; line-height: 1.4; margin: 0; }
.shop-item-actions { margin-top: auto; }
.shop-item-actions .btn { flex: none; }
.shop-item-actions .btn:disabled { opacity: 1; background: #f2e7dd; color: #5c4949; }
.shop-icon { flex: none; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: .7rem; font-size: 1.35rem; }

@media (max-width: 900px) {
  .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 540px) {
  .shop-header, .shop-grid { grid-template-columns: minmax(0, 1fr); }
  .shop-balance { justify-self: stretch; }
}

.guide-layout, .account-layout { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
.guide-layout h2, .account-saves h2, .account-details h2 { font: 700 1.4rem/1.2 var(--display); margin: 0 0 .65rem; }
.guide-practice, .guide-features { align-self: start; }
.guide-kicker { display: inline-block; color: var(--red-dark); font-size: .875rem; font-weight: 750; margin-bottom: .5rem; }
.guide-practice p, .guide-features dd { color: var(--muted); line-height: 1.5; margin: .4rem 0 1rem; }
.guide-practice .choice-btn { min-height: 2.75rem; }
.guide-practice .choice-btn strong { font-size: .9375rem; }
.guide-practice .choice-btn[aria-pressed="true"] { background: #f2ddd6; border-color: #a95366; }
.guide-practice .guide-outcome { margin: .8rem 0 0; padding: .6rem .75rem; background: #f0e3d5; border-radius: .5rem; }
.guide-features dl, .guide-features dd { margin: 0; }
.guide-features dl > div + div { border-top: 1px solid var(--line); padding-top: .6rem; margin-top: .6rem; }
.guide-features dt { font-weight: 750; margin-bottom: .15rem; }
.guide-continue { margin-top: 1.15rem; }
.year-controls { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem .85rem; margin: 1rem 0; }
.year-controls span { color: var(--muted); font-size: .875rem; }
.year-controls .btn { min-width: 8.5rem; }
.profile-links { margin: 1rem 0; display: grid; gap: .4rem; }
.account-layout { max-width: 55rem; margin-inline: auto; grid-template-columns: minmax(0,.85fr) minmax(18rem,1fr); }
.account-art { min-height: 15rem; border-radius: 1rem; background: #643242 var(--cover-art) center / cover; }
.account-card { max-width: 37rem; margin-inline: auto; width: 100%; }
.account-card .display { font-size: clamp(1.85rem, 5.5vw, 2.75rem); }
.account-card p, .account-details p, .account-saves p { color: var(--muted); line-height: 1.5; margin: .55rem 0 .8rem; }
.account-card .google-button { margin: .35rem 0 .4rem; }
.auth-tabs { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .35rem; padding: .25rem; background: #f0e3d5; border-radius: .65rem; margin: .6rem 0 .85rem; }
.auth-tab { min-height: 2.5rem; border: 0; border-radius: .45rem; background: transparent; color: var(--muted); font: 700 .875rem/1 var(--sans); cursor: pointer; }
.auth-tab.is-active { background: #fffdf9; color: var(--red-dark); box-shadow: 0 1px 3px rgba(55,22,34,.12); }
.auth-tab:focus-visible { outline: 2px solid var(--red-dark); outline-offset: 2px; }
.auth-form { display: grid; gap: .65rem; margin: .65rem 0; }
.auth-form label { font-weight: 700; font-size: .875rem; }
.auth-form .field { display: block; margin-top: .25rem; }
.auth-divider { display: flex; align-items: center; gap: .65rem; color: var(--muted); font-size: .8125rem; margin: .85rem 0 .45rem; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.auth-hint { font-size: .8125rem; color: var(--muted); margin: .6rem 0 0; }
.account-card .account-status { color: var(--red-dark); font-weight: 600; font-size: .875rem; }
.account-card .account-status:empty { display: none; }
.account-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.account-actions .text-button { white-space: normal; }
.account-saves, .account-details { margin: 1rem 0; }
.account-saves-head, .save-list li { display: flex; gap: .85rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.account-saves-head h2, .account-saves-head p, .save-list p { margin: 0; }
.account-saves-head p, .save-list p { font-size: .875rem; }
.save-list { list-style: none; padding: 0; margin: .65rem 0 0; }
.save-list li { padding: .7rem 0; border-top: 1px solid var(--line); }
.save-list strong { overflow-wrap: anywhere; }
.slot-conflict { background: #f9ecdb; border-radius: .65rem; width: 100%; padding: .7rem; }
.slot-conflict p { margin-bottom: .45rem; }
.slot-conflict .btn { margin: .2rem 0; }
.account-details details { margin-top: .9rem; color: var(--red-dark); }
.account-details summary { cursor: pointer; }
.migration-dialog .birth-content p { margin: 0 0 .85rem; line-height: 1.5; }
.migration-dialog .btn { min-height: 2.8rem; font-size: .875rem; }
.pwa-actions:not(:empty) { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: 1rem; }
.pwa-ready { font-size: .8125rem; color: #315940; }

@media (max-width: 690px) {
  .guide-layout, .account-layout { grid-template-columns: minmax(0,1fr); }
  .account-art { min-height: 11rem; }
  .guide-continue { width: 100%; }
}
@media (max-width: 400px) {
  .account-card, .guide-layout .pad { padding: .95rem; }
}
