:root{color-scheme:dark;--bg:var(--hg-deep);--panel:var(--hg-panel);--panel2:var(--hg-panel2);--line:var(--hg-line);--cream:var(--hg-cream);--muted:var(--hg-muted);--gold:var(--hg-gold);--jade:var(--hg-jade);--jadeDark:var(--hg-jade-dark)}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{margin:0;background:radial-gradient(ellipse at 50% 0,#263a31 0,#121d1a 34rem,#101917 62rem);color:var(--cream);font:16px/1.47 system-ui,sans-serif}
h1,h2,h3,p,dl,dd{margin:0}
button,a,input,select,summary{font:inherit}
button{color:inherit;cursor:pointer}
button:disabled{cursor:default}
a{color:inherit;text-decoration:none}
button,summary,a{touch-action:manipulation;-webkit-tap-highlight-color:transparent}
button:focus-visible,a:focus-visible,summary:focus-visible,select:focus-visible,input:focus-visible{outline:2px solid var(--gold);outline-offset:3px}
.appBar{max-width:804px;margin:auto;padding:14px 18px 11px;display:flex;align-items:center;justify-content:space-between;gap:7px}
.brand{display:flex;align-items:center;gap:9px;font:600 23px/1 Georgia,serif}
.brand>span{width:36px;height:36px;display:grid;place-items:center;background:#302c1c;border:1px solid #8f7750;border-radius:8px;color:var(--gold)}
.brand small{font:12px system-ui,sans-serif;display:block;margin-top:4px;color:var(--muted)}
.gameMenu{position:relative;z-index:4}
.gameMenu summary{cursor:pointer;color:var(--muted);font-size:13px;padding:6px 8px;border:1px solid var(--line);border-radius:7px}
.gameMenu>div{position:absolute;right:0;top:36px;display:grid;width:max-content;max-width:90vw;background:var(--panel);border:1px solid var(--line);border-radius:8px;padding:5px;box-shadow:0 9px 28px #0008}
.gameMenu a,.gameMenu button{background:none;border:0;padding:8px 10px;text-align:left;font-size:14px;border-radius:5px}
.gameMenu a:hover,.gameMenu button:hover{background:#32473d}
.layout{max-width:804px;padding:0 18px 116px;margin:auto}
.identity,.screen,.incident{border:1px solid var(--line);background:var(--panel);border-radius:13px;overflow:hidden}
.intro{min-height:164px;position:relative;isolation:isolate;display:flex;align-items:end;justify-content:space-between;padding:15px;gap:10px}
.landscape,.intro::before{position:absolute;inset:0;width:100%;height:100%}
.landscape{object-fit:cover;object-position:center 47%;z-index:-2}
.intro::before{content:"";background:linear-gradient(0deg,#101d18f8,#14231ca0 48%,#18251a12 100%);z-index:-1}
.hero{display:flex;align-items:end;gap:10px;min-width:0}
.portrait{width:60px;height:60px;border:1px solid #bda46b;border-radius:9px;object-fit:cover;object-position:center 38%;box-shadow:0 2px 19px #0007;background:var(--panel)}
.kicker{font-size:11px;text-transform:uppercase;letter-spacing:.13em;color:var(--gold);font-weight:800}
h1{font:600 clamp(24px,5vw,42px)/1.03 Georgia,serif;overflow-wrap:anywhere}
#playerStage{font-size:13px;color:#d4e0ce;margin-top:5px}
.lifeAge{border:1px solid #94b193;border-radius:9px;background:#0b1d17c9;color:var(--jade);text-align:center;min-width:68px;padding:5px 8px}
.lifeAge span{display:block;font-size:10px;letter-spacing:.19em}
.lifeAge strong{font:600 36px/1.1 Georgia,serif}
.figures{display:grid;grid-template-columns:1.45fr .9fr .9fr;gap:8px;padding:10px 14px;border-bottom:1px solid var(--line)}
.figures small{display:block;color:var(--muted);font-size:12px}
.figures strong{display:block;color:var(--cream);font-size:15px;line-height:1.22;margin-top:2px}
.vitals{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;padding:9px 14px 12px}
.vital{min-width:0}
.vital p{display:flex;justify-content:space-between;font-size:12px;color:var(--muted);gap:3px}
.vital p span{color:#e5e8d6}
.vital progress{display:block;width:100%;height:6px;accent-color:var(--jade);margin-top:4px}
.vital:nth-child(2) progress{accent-color:#edc281}.vital:nth-child(3) progress{accent-color:#99bee6}.vital:nth-child(4) progress{accent-color:#c5a5e1}
.screen,.incident{margin-top:10px;padding:14px 15px}
.incident{border-color:#9c8055;background:linear-gradient(110deg,#3a3426,#222b24)}
.incidentHead{color:var(--gold);text-transform:uppercase;letter-spacing:.1em;font-size:11px;font-weight:800}
h2{font:600 26px/1.1 Georgia,serif}
h3{font:600 18px/1.2 Georgia,serif}
.incident h2{margin:4px 0 7px}
.incident p,.subcopy{color:#cbd3c1;font-size:14px;margin:4px 0 10px}
.incidentChoices{display:flex;gap:6px;flex-wrap:wrap}
.incidentChoices button,.quiet,.chip,.solid{border:1px solid #567169;background:#263c34;border-radius:8px;padding:7px 9px;color:var(--cream);font-size:14px}
.incidentChoices button:disabled,.chip:disabled{opacity:.58}
.incidentChoices button:hover:not(:disabled),.quiet:hover,.chip:hover:not(:disabled){border-color:var(--gold)}
.solid{background:var(--jadeDark);color:#14331f;border-color:#daefc3;font-weight:800}
.heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 0 9px}
.badge{color:var(--jade);font-size:12px;border:1px solid #4d6956;border-radius:30px;padding:3px 8px;white-space:nowrap}
.activities,.subnav{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:10px}
.subnav button[aria-pressed=true]{background:#38574b;border-color:#9bc1a3;color:#fff}
.activity,.person{border:1px solid var(--line);background:#1d2c27;border-radius:8px;padding:8px 10px}
.activity[aria-expanded=true]{border-color:var(--gold);color:var(--gold)}
.actionsList{display:grid;gap:6px;margin:7px 0 12px}
.row{width:100%;display:flex;justify-content:space-between;align-items:center;gap:10px;text-align:left;border:1px solid var(--line);border-radius:8px;background:#1a2c26;padding:9px 10px}
.row:not(:disabled):hover{border-color:var(--gold);background:#293e34}
.row:disabled{background:#18231f;color:#c1cbbc;border-color:#334640}
.row strong,.row small{display:block}
.row small{color:var(--muted);font-size:13px;margin-top:2px}
.row .lock{color:#ecd198;font-size:12px}
.log{border-top:1px solid var(--line);padding:6px 0 0;list-style:none;margin:0}
.log li{display:grid;grid-template-columns:52px 1fr;gap:7px;padding:9px 0;border-bottom:1px solid #304038;font-size:14px}
.log li:last-child{border-bottom:0}
.log .year{font-weight:800;color:var(--jade);font-size:12px}
.log li[data-kind=event] span:last-child{color:#ffe0aa}
.log li[data-kind=people] span:last-child{color:#efd1cf}
.log li[data-kind=path] span:last-child{color:#cfedbb}
.peopleGrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin:0 0 12px}
.person{text-align:left;min-width:0}
.person[aria-pressed=true]{border-color:#aed0a8;background:#304a3b}
.person strong,.person small{display:block}
.person small{color:var(--muted);font-size:12px}
.person progress{display:block;width:100%;height:7px;accent-color:#d2b1dc;margin-top:5px}
.realmCard{border:1px solid #536a52;background:#293a2d;border-radius:8px;margin-bottom:9px;padding:9px 10px}
.realmCard p{color:#d9e5c8;font-size:13px}
.dock{position:fixed;z-index:3;bottom:0;left:50%;transform:translateX(-50%);width:min(100%,804px);display:grid;grid-template-columns:repeat(2,1fr) 1.28fr repeat(2,1fr);gap:7px;background:#14211ded;border:1px solid #546951;border-bottom:0;border-radius:13px 13px 0 0;padding:7px 13px max(8px,env(safe-area-inset-bottom));box-shadow:0 -12px 35px #0008;backdrop-filter:blur(8px)}
.dock button{display:grid;place-items:center;align-content:center;gap:3px;border:1px solid transparent;border-radius:9px;background:none;color:#bfcdc0;font-size:13px;padding:7px 2px;min-width:0;line-height:1.05;min-height:48px}
.dock button span{font-size:19px;line-height:.95}
.dock [aria-current=page]{background:#294139;color:#f1ffe7;border-color:#446853}
.dock .ageButton{background:#c5e9bc;color:#14301f;border-color:#e5f6d5;font-size:15px;font-weight:800;min-height:52px;box-shadow:0 0 16px #a4deb045}
.dock .ageButton:hover:not(:disabled){background:#e5f6cf}
.dock .ageButton:disabled{opacity:.55;box-shadow:none}
dialog{width:min(480px,calc(100vw - 22px));max-height:calc(100svh - 22px);color:var(--cream);background:var(--panel);border:1px solid #7d9272;border-radius:13px;padding:17px;box-shadow:0 10px 60px #000b}
dialog::backdrop{background:#050a08ce}
.formHead{display:flex;align-items:center;justify-content:space-between;gap:5px}
form p{font-size:14px;color:var(--muted);margin:6px 0 8px}
form label,form legend{font-size:14px;font-weight:750}
form label{display:block;margin-top:7px}
form input,form select{width:100%;padding:7px;background:#101d19;color:var(--cream);border:1px solid #547364;border-radius:6px;margin:3px 0}
form fieldset{border:0;padding:0;margin:8px 0}
form small{display:block;color:var(--muted)}
form .solid{width:100%;margin-top:12px}
.portraitOptions{display:flex;gap:8px;margin-top:4px}
.pickCharacter{display:flex;align-items:center;gap:7px;background:#263c34;border:1px solid #567169;border-radius:8px;padding:5px 7px}
.pickCharacter[aria-pressed=true]{border-color:var(--gold);color:var(--gold)}
.pickCharacter img{width:43px;height:36px;object-fit:cover;border-radius:5px}
.sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
@media(max-width:580px){.appBar{padding:9px 10px}.layout{padding:0 8px 92px}.intro{min-height:127px;padding:10px}.brand{font-size:21px}.brand>span{width:31px;height:31px}.portrait{width:48px;height:48px}.figures{padding:8px 10px}.figures strong{font-size:14px}.vitals{padding:7px 10px 9px;gap:6px}.vital p{font-size:11px}.screen,.incident{padding:11px}.dock{padding-inline:6px;gap:4px}.dock button{font-size:12px}.dock .ageButton{font-size:14px}}

.actionPoints{margin:0 0 10px;padding:6px 10px;border:1px solid var(--line);border-radius:8px;color:var(--gold);font-size:14px;letter-spacing:.02em}

/* Realm frame overlay on the portrait */
.portraitWrap{position:relative;display:block;flex:none;width:60px;height:60px}
.portraitWrap .portrait{width:100%;height:100%;display:block}
.frame{position:absolute;inset:-3px;width:calc(100% + 6px);height:calc(100% + 6px);pointer-events:none;object-fit:contain}
@media(max-width:580px){.portraitWrap{width:48px;height:48px}}

/* Hollow Gate ending cards */
.endingCard{background:var(--panel) center/cover no-repeat;border-radius:10px;padding:16px 14px}
.endingCard h2{margin:0 0 8px;color:var(--gold)}
.endingCard p{margin:0 0 9px;color:var(--cream)}
.endingCard .solid{margin-top:6px;min-height:44px}

/* Race cards on the create screen (repainted race-<id>-v2.webp, 512x512) */
.raceOptions{display:grid;grid-template-columns:repeat(3,1fr);gap:7px}
.pickRace{display:flex;flex-direction:column;align-items:center;gap:4px;background:#263c34;border:1px solid #567169;border-radius:8px;padding:5px;font-size:.85rem}
.pickRace[aria-pressed=true]{border-color:var(--gold);color:var(--gold)}
.pickRace img{width:100%;aspect-ratio:1;object-fit:cover;border-radius:5px}

.incidentHint{margin:8px 0 0;font-size:.85rem;color:var(--hg-muted,#9db3aa);font-style:italic}

/* HG-016: the "Awaken your spirit root" row stands out until the root is awake */
.row.featured{border-color:var(--gold);background:linear-gradient(180deg,#34513f,#26402f);padding:14px 12px;box-shadow:0 0 0 1px #ebc38055}
.row.featured strong{font-size:1.1rem;color:var(--gold)}

/* Content pack 2a: technique / item rows with icons, equip slots, stance, risky choices */
.rowIcon{flex:none;width:40px;height:40px;border-radius:8px;border:1px solid #536a52;background:#14211d;display:grid;place-items:center;overflow:hidden;color:var(--gold);font-weight:700}
.rowIcon img{width:100%;height:100%;object-fit:cover;display:block}
.row{justify-content:flex-start}
.row>div{flex:1;min-width:0}
.row>span[aria-hidden]:last-child:not(.rowIcon){margin-left:auto}
.listHead{margin:12px 2px 6px;font-size:13px;letter-spacing:.04em;text-transform:uppercase;color:var(--gold)}
.stanceBox{margin-bottom:10px}
.stanceBox .subnav{flex-wrap:wrap}
.stanceInfo{display:block;color:var(--muted);margin-top:4px}
.realmFlavor{font-style:italic;margin-top:4px}
.incidentChoices .risky{border-color:#c9984e}
.incidentChoices .fate,button.fate{margin-top:8px;border-style:dashed}
.row.danger{border-color:#c0523f}
.lock.deadly{color:#ff8b7a;font-weight:700}
.formButtons{display:flex;gap:6px}

/* =====================================================================================================================
   M2 skin (Art Director's UI kit, art/ui/*, spec: ui-kit-spec.md). Chrome is 9-slice PNGs via border-image ... fill, so every
   framed element sets border-radius:0 and background:none (the rounded corners are painted into the files). Layout is unchanged;
   this block only swaps looks, fonts and the top bar. Fonts are self-hosted in fonts/fonts.css (Latin subsets, OFL).
   ===================================================================================================================== */
:root{
  --font-title:"Ma Shan Zheng","Noto Serif SC",serif;
  --font-head:"ZCOOL XiaoWei","Noto Serif SC",serif;
  --font-body:"Noto Serif","Noto Serif SC",Georgia,serif;
  --ink:#2a261e;--ink2:#3a3228;--ink3:#6e6050;
  --panelW:20px;--scrollV:44px;--scrollH:34px;--tabV:10px;--tabH:14px;--topV:24px;--topH:48px;
}
body{
  font-family:var(--font-body);
  background:radial-gradient(ellipse at 50% 30%,#0000 0,#101917b0 75rem),url("art/ui/ui-bg-pattern.webp") #101917;
  background-attachment:fixed,scroll;
}
.brand,h3,.heading h2{font-family:var(--font-head);font-weight:400}
.brand{font-size:24px;letter-spacing:.01em}
.brand>span{font-family:"Noto Serif SC",serif;font-weight:700;background:#14211d;border:2px solid #b99a5e;border-radius:6px;box-shadow:inset 0 0 0 1px #0007,0 0 10px #0006}
.brand small{font-family:var(--font-body);font-size:11px}
h1,h2,.incident h2,#realm{font-family:var(--font-title);font-weight:400}
h1{font-size:clamp(30px,5.6vw,46px);line-height:1.02;text-shadow:0 2px 12px #000a}
h2{font-size:28px}
h3{font-size:20px}
.heading h2{font-size:26px}
.kicker,.incidentHead,.lifeAge span{font-family:var(--font-body);font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:var(--gold)}
.kicker{font-size:10px}
.gameMenu summary{font-family:var(--font-body)}

/* shared 9-slice helpers ------------------------------------------------------------------------------------------- */
.identity,.screen,.incident,.realmCard,dialog,.gameMenu>div,.dock,
.row,.chip,.activity,.quiet,.person,.incidentChoices button,.pickCharacter,.pickRace,.dock button,.solid,.gameMenu summary,.vital .track,.rowIcon{
  border-style:solid;border-color:transparent;border-radius:0;background:none;box-shadow:none;
}
.identity,.screen,.realmCard,dialog,.gameMenu>div,.dock{
  border-width:var(--panelW);border-image-source:url("art/ui/ui-panel.png");border-image-slice:48 fill;border-image-width:var(--panelW);border-image-repeat:stretch;
}
.identity{overflow:visible;border-width:var(--topV) var(--topH);border-image-source:url("art/ui/ui-topbar.png");border-image-slice:36 96 36 96 fill;border-image-width:var(--topV) var(--topH);padding:0;margin-top:2px}
.screen{padding:4px 6px 8px}
.realmCard{--panelW:16px;padding:0 4px;margin-bottom:9px}
.realmCard p{color:#d9e5c8}
.incident{
  border-width:var(--scrollV) var(--scrollH);border-image-source:url("art/ui/ui-scroll.png");border-image-slice:72 56 72 56 fill;border-image-width:var(--scrollV) var(--scrollH);
  color:var(--ink);padding:0 6px;overflow:visible;
}
.incident .incidentHead{color:#8f7750}
.incident h2{color:var(--ink);font-size:34px;line-height:1.05}
.incident p,.incident .subcopy{color:var(--ink2);font-size:15px}
.incident .incidentHint{color:var(--ink3);font-style:italic}
.incident::after{content:"";display:block;clear:both}
.npcPortrait{float:right;width:96px;height:96px;margin:0 0 8px 14px;object-fit:cover;border:3px solid #8f7750;border-radius:6px;box-shadow:0 0 0 1px #2a261e66,0 3px 10px #2a261e55;background:#2a261e}

/* tablets: jade for choices and nav, gold for primary actions ------------------------------------------------------- */
.row,.chip,.activity,.quiet,.person,.incidentChoices button,.pickCharacter,.pickRace,.dock button,.gameMenu summary{
  border-width:var(--tabV) var(--tabH);border-image-source:url("art/ui/ui-btn.png");border-image-slice:28 36 fill;border-image-width:var(--tabV) var(--tabH);border-image-repeat:stretch;
  color:var(--cream);padding:3px 4px;font-family:var(--font-body);
}
.row:not(:disabled):hover,.chip:hover:not(:disabled),.activity:hover:not(:disabled),.quiet:hover,.incidentChoices button:hover:not(:disabled),.pickCharacter:hover,.pickRace:hover,.person:hover,.gameMenu summary:hover,
.person[aria-pressed=true],.activity[aria-expanded=true],.subnav button[aria-pressed=true],.pickCharacter[aria-pressed=true],.pickRace[aria-pressed=true],.dock [aria-current=page]{
  border-image-source:url("art/ui/ui-btn-hover.png");
}
.row:disabled,.chip:disabled,.activity:disabled,.incidentChoices button:disabled,.dock button:disabled{
  border-image-source:url("art/ui/ui-btn-disabled.png");color:#d6ccaa;opacity:1;
}
.subnav button[aria-pressed=true],.activity[aria-expanded=true],.pickCharacter[aria-pressed=true],.pickRace[aria-pressed=true]{color:#fff;text-shadow:0 0 8px #ebc38099}
.incidentChoices{gap:8px}
.incidentChoices button{font-size:14px;min-height:40px}
.incidentChoices .risky{color:#ffe3a6}
.incidentChoices .fate,button.fate{border-style:solid;font-style:italic}
.row{min-height:44px;padding:5px 6px}
.row:not(:disabled):hover,.row:disabled{background:none;border-color:transparent}
.row.featured{background:none;box-shadow:none;border-image-source:url("art/ui/ui-btn-hover.png");padding:10px 6px}
.row.featured strong{color:var(--gold);font-family:var(--font-head);font-weight:400;font-size:1.25rem}
.row.danger{color:#ffb4a4}
.row small{color:#c3d0c4}
.row:disabled small{color:#d6ccaa}
.person{min-height:56px}
.person small{color:#c3d0c4}
.solid,.dock .ageButton:not(:disabled),button.primary{
  border-width:var(--tabV) var(--tabH);border-image-source:url("art/ui/ui-btn-gold.png");border-image-slice:28 36 fill;border-image-width:var(--tabV) var(--tabH);border-image-repeat:stretch;
  color:#101917;font-weight:700;padding:3px 6px;text-shadow:0 1px 0 #ffe9b455;min-height:40px;
}
.solid:not(:disabled):hover,.dock .ageButton:not(:disabled):hover,button.primary:not(:disabled):hover{border-image-source:url("art/ui/ui-btn-gold-hover.png");background:none}
.solid:not(:disabled):active,.dock .ageButton:not(:disabled):active,button.primary:not(:disabled):active{border-image-source:url("art/ui/ui-btn-gold-pressed.png")}
.solid:disabled,.dock .ageButton:disabled,button.primary:disabled{border-image-source:url("art/ui/ui-btn-disabled.png");color:#d6ccaa;text-shadow:none}
.endingCard .solid{min-height:48px}

/* dock: the Age Up button is the gold tablet */
.dock{--panelW:16px;gap:6px;padding:0 2px max(0px,env(safe-area-inset-bottom));backdrop-filter:none;box-shadow:none;border-bottom-width:calc(var(--panelW) + 2px)}
.dock button{min-height:50px;font-size:13px;color:#cfdcd0;padding:2px 2px}
.dock button span{font-size:18px}
.dock [aria-current=page]{color:#f6ffe8}
.dock .ageButton{font-family:var(--font-head);font-size:20px;font-weight:400;letter-spacing:.03em;min-height:54px;box-shadow:none;color:#101917}
.dock .ageButton span{font-size:20px}
.dock .ageButton strong{font-weight:400}
.dock .ageButton:not(:disabled){filter:drop-shadow(0 0 8px #ebc38066)}
.dock .ageButton:disabled{opacity:1;filter:none}

/* dividers: the heading rule and the log use the gold cloud-scroll strip */
.heading{border-bottom:0;background:url("art/ui/ui-divider.png") center bottom/min(100%,760px) 18px no-repeat;padding-bottom:20px;margin-bottom:6px}
.badge{font-family:var(--font-body);border-color:#8f7750;color:var(--gold);background:#0b1512aa}
.actionPoints{border:0;background:none;padding:2px 2px;margin:0 0 6px;color:var(--gold);font-size:14px;font-family:var(--font-body)}
.log{border-top:0;padding:0}
.log li{border-bottom:1px solid #2f4a40}
.log .year{font-family:var(--font-body);color:var(--gold)}
.subcopy{color:#cbd3c1}

/* dialog, menu */
dialog{padding:0;--panelW:26px;overflow:auto;color:var(--cream)}
dialog>form{padding:2px 4px 4px}
dialog::backdrop{background:#050a08d6}
.gameMenu>div{--panelW:14px;padding:0;top:42px}
.gameMenu a,.gameMenu button{font-family:var(--font-body)}
.gameMenu summary{padding:2px 4px;font-size:13px;min-width:92px;text-align:center;list-style:none}
.gameMenu summary::-webkit-details-marker{display:none}
form input,form select{border:1px solid #8f7750;background:#0c1613;border-radius:6px}
.pickRace img,.pickCharacter img{border:1px solid #8f775088}
.pickRace{font-size:.8rem;padding:2px}

/* icon slots (techniques / items) */
.rowIcon{width:52px;height:52px;border-width:8px;border-image-source:url("art/ui/ui-slot.png");border-image-slice:24 fill;border-image-width:8px;background:#0c1613;border-radius:0}
.rowIcon img{width:100%;height:100%;border-radius:0}

/* identity bar: figures and the Qi / Health / Focus bars ------------------------------------------------------------ */
.intro{padding:12px 12px 10px}
.portrait{border:2px solid #bda46b;border-radius:8px}
.lifeAge{border:2px solid #b99a5e;background:#0b1512d8;color:var(--jade);border-radius:6px;box-shadow:0 0 14px #0009,inset 0 0 0 1px #0007}
.lifeAge strong{font-family:var(--font-head);font-weight:400;font-size:38px}
.figures{grid-template-columns:1.7fr .9fr .9fr .85fr .85fr;border-bottom:0;padding:6px 10px 2px}
.figures small{font-family:var(--font-body);font-size:11px;letter-spacing:.04em;color:#b5c5b8}
.figures strong{font-weight:400;font-size:15px}
.vitals{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;padding:6px 10px 10px;align-items:start}
.vital p{font-family:var(--font-body);font-size:12px;color:#c3d0c4}
.vital p span{color:#f0efdc;font-weight:600;font-variant-numeric:tabular-nums}
.vital .track{display:block;position:relative;height:19px;margin-top:2px;border-width:5px 16px;border-image-source:url("art/ui/ui-bar-frame.png");border-image-slice:12 40 fill;border-image-width:5px 16px;border-image-repeat:stretch}
.vital .fill{height:100%;min-width:0;border-radius:3px;background:linear-gradient(180deg,#d6f5df,#a7e6bb 45%,#5fb585);box-shadow:0 0 8px #a7e6bb66;transition:width .5s ease}
.vitalHealth .fill{background:linear-gradient(180deg,#e4f6d7,#c4edc0 45%,#7fc98a);box-shadow:0 0 8px #c4edc055}
.vitalFocus .fill{background:linear-gradient(180deg,#bdb2ea,#9083c7 45%,#5f54a1);box-shadow:0 0 8px #9083c755}
.vital .estimate{display:block;margin-top:2px;font-size:12px;line-height:1.25;color:var(--gold);font-weight:600}
.vital .estimate[data-state=ready]{color:#d6ffd9;text-shadow:0 0 8px #a7e6bb99}
.vitalQi:has(.estimate[data-state=ready]) .fill{background:linear-gradient(180deg,#fff0c4,#ebc380 45%,#c58f3c);box-shadow:0 0 10px #ebc380aa}
.vital .estimate[data-state=locked],.vital .estimate[data-state=herbs]{color:#d9c79a;font-weight:400;font-style:italic}
.vital .estimate[data-limit=focus]{color:#c8c0f2}

/* people-tab bond bars (native progress, restyled) */
.person progress{appearance:none;-webkit-appearance:none;height:8px;border:1px solid #8f7750;border-radius:5px;background:#0c1613;accent-color:#a7e6bb;overflow:hidden}
.person progress::-webkit-progress-bar{background:#0c1613}
.person progress::-webkit-progress-value{background:linear-gradient(180deg,#e7cdf0,#d2b1dc 50%,#9d79ad);border-radius:4px}
.person progress::-moz-progress-bar{background:#c9a5d6;border-radius:4px}

/* breakthrough sequence overlay (breakthrough-fx.mjs) */
.btFx{position:fixed;inset:0;z-index:100;background:#101917;cursor:pointer;touch-action:manipulation}
.btFx canvas{display:block;width:100%;height:100%}

@media(prefers-reduced-motion:reduce){.vital .fill{transition:none}}

/* narrow screens: thinner frames, same layout */
@media(max-width:580px){
  :root{--panelW:14px;--scrollV:34px;--scrollH:24px;--tabV:8px;--tabH:11px;--topV:20px;--topH:32px}
  .brand{font-size:22px}
  .screen{padding:2px 2px 6px}
  .realmCard{--panelW:12px}
  .identity{margin-top:0}
  .intro{padding:8px 6px 8px;min-height:116px}
  .figures{grid-template-columns:repeat(3,minmax(0,1fr));padding:6px 6px 2px}
  .figures strong{font-size:13px}
  .vitals{gap:6px;padding:6px 6px 8px}
  .vital p{font-size:11px}
  .vital .track{height:17px;border-width:4px 11px;border-image-width:4px 11px}
  .vital .estimate{font-size:10.5px}
  .incident{padding:0 2px}
  .incident h2{font-size:28px}
  .incident p,.incident .subcopy{font-size:14px}
  .npcPortrait{width:72px;height:72px}
  .incidentChoices button{font-size:13px}
  .dock{--panelW:12px;padding:0 0 max(0px,env(safe-area-inset-bottom));gap:3px}
  .dock button{font-size:11.5px;min-height:46px}
  .dock .ageButton{font-size:17px;min-height:50px}
  .heading h2{font-size:23px}
  .rowIcon{width:46px;height:46px;border-width:7px;border-image-width:7px}
  dialog{--panelW:18px}
  h1{font-size:30px}
  .layout{padding-bottom:98px}
}
#realm{font-family:var(--font-head);font-size:17px;line-height:1.2}

/* Race is picked with the race cards; the select stays in the DOM as the form value (Art Director, M2) */
.srOnly{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0 0 0 0)!important;white-space:nowrap!important;border:0!important}

/* HG-055: the outcome of the last action stays on screen under the action points (win = jade, lose = red) */
.resultLine{margin:0 0 10px;padding:9px 12px;border:1px solid #546951;border-left-width:4px;border-radius:8px;background:#14211dcc;color:var(--cream,#f6eddb);font-size:14px;line-height:1.4}
.resultLine[data-result=win]{border-color:#9bc1a3;border-left-color:#a7e6bb}
.resultLine[data-result=lose]{border-color:#a8574a;border-left-color:#e0715f;background:#2a1613cc}

/* HG-056: room under the content equals the real height of the bottom nav (set from life.mjs as --dockH) plus the device safe area, at every width */
.layout{padding-bottom:calc(var(--dockH,120px) + 28px + env(safe-area-inset-bottom,0px))}
html{scroll-padding-bottom:calc(var(--dockH,120px) + 20px)}
/* HG-057: a locked event choice carries its reason under the label */
.incidentChoices .locked{display:flex;flex-direction:column;align-items:flex-start;text-align:left;gap:2px}
.incidentChoices small.lock{display:block;color:#ecd198;font-size:12px;line-height:1.3}

/* HG-058: childhood aptitude block on the Life tab */
.aptitudeBox{margin:0 0 10px;padding:9px 12px;border:1px solid #546951;border-radius:8px;background:#14211dcc}
.aptitudeBox strong{display:block;font-size:15px;color:var(--gold,#ebc380)}
.aptitudeBox progress{width:100%;height:12px;margin:6px 0 4px;accent-color:#ebc380}
.aptitudeBox small{display:block;font-size:12px;line-height:1.35}
.rootLine{margin:4px 0 0;font-size:13px;color:#ecd198}
/* Techniques: one tab per school with learned/total, same-school bonus tag */
.techTabs{display:flex;flex-wrap:wrap;gap:6px;margin:4px 0 10px}
.techTab{display:inline-flex;align-items:center;gap:6px;min-height:44px;padding:6px 10px}
.techTab .tabIcon{width:30px;height:30px;flex:none;display:block}
.techTab .tabBonus{color:#ecd198;font-size:12px}
.techTab[aria-selected=true]{background:#38574b;border-color:#9bc1a3;color:#fff}
.row .bonusTag{display:inline-block;color:#ecd198;font-size:12px;border:1px solid #6a5a2e;border-radius:10px;padding:0 6px;margin-top:3px}
.slotBonus{margin-top:-4px}
.resultLine[data-result=draw]{border-color:#c2a964;border-left-color:#e0c36f}
.log li[data-result=win] span:last-child{color:#c8f0c9}
.log li[data-result=lose] span:last-child{color:#ffb4a6}
.log li[data-result=draw] span:last-child{color:#f0dc9a}

/* HG-065: the multi-year skip sits in its own block at the foot of the Life screen, away from the event choices */
.skipAhead{margin:26px 0 14px;padding-top:12px;border-top:1px dashed var(--line);display:flex;flex-wrap:wrap;align-items:center;gap:10px}
.skipAhead .subcopy{margin:0;flex:1 1 100%}
.skipAhead .activity{opacity:.85}

/* HG-068: Break Through only lights up when the requirement is met; the first one asks first */
.breakBtn{width:100%;display:flex;justify-content:space-between;align-items:center;margin:0 0 10px;padding:12px 14px;font-size:16px;box-shadow:0 0 14px rgba(218,239,195,.45)}
.breakBtn .breakFail{font-weight:600;opacity:.85}
.breakConfirm{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:0 0 10px;padding:12px;border:1px solid var(--gold);border-radius:10px;background:#1d2c27}
.breakConfirm .breakAsk{flex:1 1 100%;margin:0;font-weight:700}
/* ---- Reincarnate create (M3 section 6): path cards, luck, talent hand, Fate sheet. CSS frames only; Art's rarity frames can replace them later. */
dialog{padding-bottom:max(0px,env(safe-area-inset-bottom))}
.fateStep{margin:12px 0 8px}
.fateStep legend{font:600 18px/1.2 Georgia,serif;color:var(--gold);margin-bottom:2px}
.pathOptions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:7px}
.pathCard{display:flex;flex-direction:column;align-items:flex-start;gap:3px;text-align:left;min-height:132px;padding:10px;border-radius:10px;border:1px solid #567169;background:#1a2a24}
.pathCard strong{font:600 16px/1.15 Georgia,serif}
.pathZh{font-size:22px;line-height:1}
.pathLine{font-size:12.5px;color:#cbd3c1;line-height:1.3}
.pathTag{margin-top:auto;font-weight:800;font-size:12px}
.path-righteous .pathZh,.path-righteous .pathTag{color:#f0cf7d}
.path-demonic .pathZh,.path-demonic .pathTag{color:#ff8a7a}
.pathCard.path-righteous[aria-pressed=true]{border-color:#f0cf7d;background:linear-gradient(160deg,#4a3d1c,#1d2a23);box-shadow:0 0 0 2px #f0cf7d55,0 0 18px #f0cf7d33}
.pathCard.path-demonic[aria-pressed=true]{border-color:#ff7a68;background:linear-gradient(160deg,#4a1c1c,#1d2a23);box-shadow:0 0 0 2px #ff7a6855,0 0 18px #ff5a4833}
.luckRow{display:grid;grid-template-columns:44px 1fr 44px 40px;align-items:center;gap:8px;margin-top:6px}
.luckBtn{min-height:44px;font-size:20px;padding:0}
.luckRow input[type=range]{width:100%;margin:0;accent-color:#e9c46a;padding:0;border:0;background:none;min-height:44px}
.luckRow output{font:600 24px/1 Georgia,serif;color:#e9c46a;text-align:center}
#luckEffect{color:#e9c46a;margin-top:2px}
.talentHand{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-top:7px}
.talentCard{display:flex;flex-direction:column;align-items:flex-start;gap:2px;text-align:left;min-height:118px;padding:8px 9px;border-radius:10px;border:2px solid var(--r,#6f8a7c);background:linear-gradient(170deg,var(--rbg,#1f302a),#15211d);position:relative}
.talentCard strong{font:600 15px/1.15 Georgia,serif}
.talentRarity{font-size:10px;font-weight:800;letter-spacing:.12em;text-transform:uppercase;color:var(--r,#9fb8a8)}
.talentZh{font-size:12px;color:#d9d2b8}
.talentEffect{font-size:12px;color:#e8eedf;line-height:1.25}
.talentFlavor{font-size:11.5px;color:#a9b6a6;line-height:1.25}
.talentCard[aria-pressed=true]{box-shadow:0 0 0 2px var(--r),0 0 16px var(--r);transform:translateY(-1px)}
.talentCard[aria-pressed=true]::after{content:"✓";position:absolute;top:6px;right:8px;font-weight:900;color:var(--r)}
.rarity-common{--r:#8fb3a0;--rbg:#1f302a}
.rarity-rare{--r:#6fb0ff;--rbg:#172a3d}
.rarity-legendary{--r:#ffc94d;--rbg:#3d2f12}
.talentBar{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:8px;flex-wrap:wrap}
.talentBar .quiet{min-height:40px}
.createError{color:#ffb4a8!important;font-weight:700;margin:8px 0 0!important}
.deathButtons .solid,.deathButtons .chip{min-height:46px}
.deathButtons .reincarnate{flex-basis:100%;font-size:16px}
.fateSheet{border:1px solid #6d6142;border-radius:11px;padding:10px 12px;margin:0 0 12px;background:linear-gradient(120deg,#2a281c,#1b2723)}
.fateHead{display:flex;align-items:center;justify-content:space-between;gap:8px}
.fateHead strong{font:600 18px/1.1 Georgia,serif;color:var(--gold)}
.pathBadge.path-righteous{color:#f0cf7d;border-color:#8f7750}
.pathBadge.path-demonic{color:#ff8a7a;border-color:#8a4a42}
.karmaLine,.luckLine{display:flex;justify-content:space-between;gap:8px;font-size:13px;color:#d4dccb;margin-top:7px}
.lean-righteous{color:#f0cf7d}.lean-demonic{color:#ff8a7a}.lean-neutral{color:var(--muted)}
.karmaBar{position:relative;height:10px;border-radius:6px;margin:5px 0 2px;background:linear-gradient(90deg,#ffd76a 0%,#e9c46a 30%,#8b8f7a 50%,#c45a4a 70%,#d8322a 100%);border:1px solid #0006}
.karmaMark{position:absolute;top:-4px;width:4px;height:16px;margin-left:-2px;border-radius:2px;background:#fff;box-shadow:0 0 6px #000}
.talentChips{display:flex;flex-wrap:wrap;gap:5px;margin-top:8px}
.talentChip{font-size:12px;border:1px solid var(--r);color:var(--r);border-radius:20px;padding:3px 8px;background:var(--rbg)}
@media(max-width:380px){.talentHand{grid-template-columns:1fr}.pathCard{min-height:120px}}
/* Sticky create progress bar (Path, You, Luck, Talents) and the filled Luck track */
.createProgress{position:sticky;top:0;z-index:2;margin:8px -4px 6px;padding:8px 10px 9px;border:1px solid #8f7750;border-radius:10px;background:linear-gradient(180deg,#1d2b25f7,#16221df7);box-shadow:0 6px 16px #000a;backdrop-filter:blur(4px)}
.progressLabel{display:flex!important;align-items:baseline;gap:8px;margin:0 0 6px!important;font-size:13px!important;color:var(--muted)}
.progressLabel strong{color:var(--gold);font:600 15px/1 Georgia,serif}
.progressLabel #progressName{color:var(--cream);font-weight:700}
.progressDone{margin-left:auto;font-size:12px;color:var(--jade)}
.progressTrack{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(4,1fr);gap:5px}
.progressTrack button{width:100%;min-height:36px;padding:14px 0 2px;border:0;background:none;color:var(--muted);font-size:12px;font-weight:700;position:relative;letter-spacing:.02em}
.progressTrack button::before{content:"";position:absolute;left:0;right:0;top:2px;height:9px;border-radius:5px;background:#0c1613;border:1px solid #547364}
.progressTrack li.done button::before{background:linear-gradient(90deg,#9fd3a5,#e9c46a);border-color:#e9c46a;box-shadow:0 0 8px #e9c46a66}
.progressTrack li.current button{color:var(--gold)}
.progressTrack li.current button::before{outline:2px solid #e9c46a;outline-offset:1px}
.progressTrack li.done button{color:#e7efd9}
.luckRow input[type=range]{-webkit-appearance:none;appearance:none;height:44px;background:transparent;--fill:0%}
.luckRow input[type=range]::-webkit-slider-runnable-track{height:12px;border-radius:7px;border:1px solid #8f7750;background:linear-gradient(90deg,#9fd3a5,#e9c46a var(--fill),#0c1613 var(--fill))}
.luckRow input[type=range]::-moz-range-track{height:12px;border-radius:7px;border:1px solid #8f7750;background:#0c1613}
.luckRow input[type=range]::-moz-range-progress{height:12px;border-radius:7px;background:linear-gradient(90deg,#9fd3a5,#e9c46a)}
.luckRow input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:26px;height:26px;margin-top:-8px;border-radius:50%;background:#f3d27a;border:2px solid #fff6d6;box-shadow:0 0 8px #e9c46a}
.luckRow input[type=range]::-moz-range-thumb{width:24px;height:24px;border-radius:50%;background:#f3d27a;border:2px solid #fff6d6}
/* ---- Life as story (docs/design/life-as-story.md): the Life tab reads as continuous prose, one passage per year */
.storySection{margin-top:14px}
.story{display:grid;gap:4px;padding-top:2px}
.storyEarlier{margin:0 0 8px}
.passage{padding:10px 2px 12px;border-bottom:1px solid #2f4a40}
.passage:last-child{border-bottom:0}
.passageTitle{font:700 12px/1.2 var(--font-body,system-ui);letter-spacing:.14em;text-transform:uppercase;color:var(--gold);margin:0 0 5px}
.prose{margin:0;font:15px/1.65 Georgia,var(--font-body,serif);color:#e3e7d6;overflow-wrap:anywhere}
.storyLine[data-kind=event]{color:#ffe0aa}
.storyLine[data-kind=people]{color:#efd1cf}
.storyLine[data-result=win]{color:#c8f0c9}
.storyLine[data-result=lose]{color:#ffb4a6}
.storyLine[data-result=draw]{color:#f0dc9a}
.passage.opening{padding:12px 12px 14px;margin-bottom:4px;border:1px solid #6d6142;border-radius:11px;background:linear-gradient(160deg,#2a281c,#18241f)}
.passage.opening .passageTitle{font:600 19px/1.2 Georgia,serif;letter-spacing:.02em;text-transform:none}
.passage.opening .prose{font-size:15.5px}
.passage.latest:not(.opening) .passageTitle{font-size:13px;color:#f3d27a}
.passage.latest .prose{font-size:17px;line-height:1.6;color:#f4f1e2}
.passage.latest{scroll-margin-bottom:calc(var(--dockH,80px) + var(--noteH,0px) + 16px)}
body.railOn .passage.latest{scroll-margin-bottom:calc(var(--dockH,80px) + var(--railH) + var(--noteH,0px) + 24px + env(safe-area-inset-bottom,0px))}
/* The Fate card on Cultivate: a summary line that opens to the full card */
details.fateSheet{padding:0;margin:0 0 12px;background:none;border-color:#4a4532}
details.fateSheet[open]{padding:0 12px 10px;background:linear-gradient(120deg,#2a281c,#1b2723)}
.fateLine{display:flex;align-items:center;gap:8px;padding:7px 10px;cursor:pointer;list-style:none;font-size:13px;color:#cfc6a8;min-width:0}
.fateLine::-webkit-details-marker{display:none}
.fateLine::after{content:"\25BE";margin-left:auto;color:#8f866a}
details[open] > .fateLine{padding:8px 0 6px}
details[open] > .fateLine::after{content:"\25B4"}
.fateQuiet{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.storyHint{text-align:center;margin-top:10px}
/* Section 4: the vitals header is off the Life tab (the story heading names you); it stays on People, Cultivate and World */
body[data-route=life] .identity{display:none}
.dock [hidden]{display:none!important}
/* Autoplay: the event's option buttons ride beside the story, in a rail above the dock; the story keeps going if nobody taps */
/* Ka Let 3:21 AM ET: the event card kept covering the story. Autoplay keeps it off the Life tab; Options on the rail opens the choice. */
body.autoplay[data-route=life] #incident{display:none!important}
.storyRail .railOptions.hasEvent{border-color:var(--gold);color:var(--gold)}
.storyRail .railOptions.open{background:#3a3220}
.optionSheet h2{font-family:var(--font-title);font-weight:400;font-size:26px;line-height:1.1;color:var(--cream);margin:4px 0 8px}
.optionSheet .incidentChoices{margin:8px 0}
.optionSheet .incidentHead{margin-top:4px}
.deathButtons .regress{min-height:40px}
.chip.regress.armed{border-color:var(--gold);color:var(--gold)}
.storySection .heading .badge{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:62%}
/* the newest year is the current scene */
.passage.latest:not(.opening){border-left:3px solid var(--gold);padding-left:12px}
.passage.latest:not(.opening) .passageTitle{color:var(--gold)}

/* Side rail (Regress, Reincarnate, God) above the dock on the running story, and the God sheet over the story (life-as-story.md section 6) */
:root{--railH:54px}
.storyRail{position:fixed;z-index:4;left:50%;transform:translateX(-50%);bottom:var(--dockH,96px);width:min(100%,804px);box-sizing:border-box;overflow:hidden;height:var(--railH);display:flex;gap:5px;align-items:center;justify-content:center;padding:6px 8px;background:#101b17f0;border-top:1px solid #546951}
.storyRail[hidden]{display:none}
.storyRail .chip{min-height:40px;flex:1 1 auto;min-width:0;max-width:120px;padding:4px 3px;font-size:clamp(10px,2.9vw,13px);white-space:nowrap;overflow:hidden;text-overflow:clip}
.storyRail .godButton{border-color:var(--gold);color:var(--gold)}
.storyRail .godButton.open{background:#3a3220}
body.railOn .layout{padding-bottom:calc(var(--dockH,120px) + var(--railH) + var(--noteH,0px) + 48px + env(safe-area-inset-bottom,0px))}
body.railOn .story{padding-bottom:12px}
body.railOn{scroll-padding-bottom:calc(var(--dockH,120px) + var(--railH) + var(--noteH,0px) + 24px + env(safe-area-inset-bottom,0px))}
.godSheet{position:fixed;z-index:5;left:50%;transform:translateX(-50%);bottom:calc(var(--dockH,96px) + var(--railH));width:min(100%,804px);max-height:45vh;display:flex;flex-direction:column;background:linear-gradient(170deg,#2b2719f7,#17221ef7);border:1px solid #8a7a4e;border-bottom:0;border-radius:13px 13px 0 0;padding:10px 12px 6px;box-shadow:0 -14px 40px #000c}
.godSheet[hidden]{display:none}
.godHead{display:flex;align-items:baseline;gap:8px}
.godHead strong{font:600 19px/1.1 Georgia,serif;color:var(--gold)}
.godHead .godClose{margin-left:auto;min-width:40px;min-height:36px}
.godSheet .subnav{margin:8px 0 6px}
.godBody{overflow:auto;min-height:0}
.godRow{display:grid;grid-template-columns:1fr auto auto;gap:6px;align-items:center;padding:6px 0;border-bottom:1px solid #3d4a3c}
.godRow > div{min-width:0}
.godRow strong{display:block;font-size:14px}
.godRow small{display:block;font-size:12px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.godRow .chip{min-height:36px;padding:4px 10px;font-size:13px}
.godRow .godTake{border-color:#8a4b45}

/* playtest pass (Dec 1, 2026, 10 PM): confirm lines, Gate button, God toast, create hints */
.carryNote{position:fixed;z-index:6;left:50%;transform:translateX(-50%);bottom:calc(var(--dockH,96px) + var(--railH) + 4px);width:min(calc(100% - 16px),788px);margin:0;padding:8px 10px;border:1px solid var(--gold);border-radius:10px;background:#1c2a24f5;color:var(--gold);font-size:13px;line-height:1.35}
.carryNote[hidden]{display:none}
.storyRail .chip.armed{border-color:var(--gold);color:var(--gold);background:#3a3220}
.storyRail .railGate.lit{border-color:var(--gold);color:#1a1405;background:var(--gold);font-weight:700;box-shadow:0 0 12px #d9b45a99}
.storyRail.hasGate .chip{font-size:clamp(9px,2.45vw,11.5px);padding:4px 1px}
.godNote{margin:6px 0 0;padding:6px 8px;border-left:3px solid var(--gold);background:#00000033;font-size:13px;line-height:1.35;overflow-wrap:anywhere}
.godNote[hidden]{display:none}
.godRow.godEnd .danger{border-color:#ff8a7a;color:#ffb4a8}
.carryLine{font-size:13px;margin:4px 0}
.storyWaiting{color:var(--gold)}
.talentNote{flex-basis:100%;margin:6px 0 0}
.talentNote[hidden]{display:none}

.storyRail{padding-left:max(6px,env(safe-area-inset-left));padding-right:max(6px,env(safe-area-inset-right));gap:4px}
@media (max-width:380px){.storyRail{gap:3px;padding-left:max(3px,env(safe-area-inset-left));padding-right:max(3px,env(safe-area-inset-right))}.storyRail .chip{font-size:9.5px;padding:4px 1px}.storyRail.hasGate .chip{font-size:8.6px;padding:4px 0}}

/* an armed Regress / Reincarnate takes a full first row, so its tap-again label is never squeezed or clipped */
body.railArmed{--railH:100px}
.storyRail.armedRow{flex-wrap:wrap;align-content:center;row-gap:4px}
.storyRail.armedRow .chip.armed{flex:1 1 100%;max-width:none;order:-1;white-space:normal}

/* ==== Word Games Simulator look (Ka Let Dec 4, 2026 ET). Art Director's docs/art/simulator-ui-spec.md (82c3b53): tokens, sizes and layout.
   Style only: no reference art or text. Life tab = stat bar + framed year log + right-hand rail; create = Talents + Set Points rows. */
:root{
  --sim-bg-top:#1A3E56;--sim-bg-mid:#245572;--sim-bg-low:#2D6685;--sim-bg-bottom:#337494;
  --sim-grid:rgba(91,174,234,.07);--sim-panel:#173A51;--sim-bar:#193962;--sim-chip:#0E2B50;--sim-bar-selected:#1E4A7A;
  --sim-cyan:#5BAEEA;--sim-cyan-strong:#7BC4F2;--sim-cyan-glow:rgba(91,174,234,.45);--sim-cut:10px;
  --sim-title:#F1C045;--sim-subtitle:#A8B7C2;--sim-text:#FFFFFF;--sim-body:#B4C9CF;--sim-muted:#8AA0AE;
  --sim-stripe-grey:#939BA7;--sim-stripe-blue:#6EB3F9;--sim-stripe-purple:#896FF6;--sim-stripe-orange:#F19B5D;
  --sim-choice-a:#5EC2DC;--sim-choice-b:#EFA63E;--sim-choice-c-border:#A7E6BB;
  --sim-jade:#A7E6BB;--sim-crimson:#C43C4E;--sim-gold:var(--sim-title);
  --sim-font-ui:"Segoe UI","PingFang SC","Noto Sans","Helvetica Neue",ui-sans-serif,system-ui,sans-serif;
  --sim-font-title:Georgia,"Palatino Linotype",Palatino,"Noto Serif","Times New Roman",serif;
  --sim-tap:44px;--sim-radius-row:10px;--sim-radius-frame:14px;--sim-stripe-w:5px;--sim-row-gap:10px;--sim-chip-h:28px;--sim-chip-gap:6px;
  --simRailW:72px;
}
body{background:linear-gradient(180deg,var(--sim-bg-top) 0%,var(--sim-bg-mid) 45%,var(--sim-bg-low) 75%,var(--sim-bg-bottom) 100%) fixed;background-color:var(--sim-bg-top);color:var(--sim-text)}
body::before{content:"";pointer-events:none;position:fixed;inset:0;z-index:0;background-image:linear-gradient(var(--sim-grid) 1px,transparent 1px),linear-gradient(90deg,var(--sim-grid) 1px,transparent 1px);background-size:28px 28px;-webkit-mask-image:linear-gradient(180deg,#0000005a,#000000b3);mask-image:linear-gradient(180deg,#0000005a,#000000b3)}
.layout{position:relative;z-index:1}
.appBar{position:relative;z-index:2} /* above the layout so the open Game menu is never under the story or an event card */
body[data-path=righteous]{--sim-path:var(--sim-gold);--sim-path-2:var(--sim-jade)}
body[data-path=demonic]{--sim-path:var(--sim-crimson);--sim-path-2:#E07A86}

/* Stat bar: 8 chips, 2 rows of 4, always on top of the Life tab (sticky) */
.statBar{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:var(--sim-chip-gap);margin:0 0 8px;font-family:var(--sim-font-ui)}
.storySection>.statBar{position:sticky;top:0;z-index:3;padding:8px 0;margin:0 0 4px;background:linear-gradient(180deg,var(--sim-bg-top) 70%,#1a3e5600)}
.statTag{display:flex;align-items:center;justify-content:center;gap:4px;height:var(--sim-chip-h);min-width:0;padding:0 6px;border-radius:999px;background:var(--sim-chip);border:1px solid rgba(91,174,234,.7);white-space:nowrap;overflow:hidden}
.statName{font-size:11px;color:var(--sim-text);overflow:hidden;text-overflow:ellipsis;min-width:0}
.statValue{font-size:12px;font-weight:700;color:var(--sim-title);font-variant-numeric:tabular-nums}
@keyframes sim-chip-flash{0%,100%{box-shadow:0 0 0 1px var(--sim-cyan)}40%{box-shadow:0 0 0 2px var(--sim-title),0 0 12px rgba(241,192,69,.65)}}
.statTag.flash{animation:sim-chip-flash .9s ease-in-out 2}
@media (prefers-reduced-motion:reduce){.statTag.flash,.yearCard.is-waiting{animation:none}}

/* Framed year log: cut corners + cyan glow (the glow sits on the wrapper because clip-path would cut a box-shadow) */
.wgsFrame{filter:drop-shadow(0 0 6px var(--sim-cyan-glow))}
body[data-path=demonic] .wgsFrame{filter:drop-shadow(0 0 6px rgba(196,60,78,.45))}
.wgsPanel{background:var(--sim-panel);border:1px solid var(--sim-cyan);border-radius:var(--sim-radius-frame);clip-path:polygon(var(--sim-cut) 0,calc(100% - var(--sim-cut)) 0,100% var(--sim-cut),100% calc(100% - var(--sim-cut)),calc(100% - var(--sim-cut)) 100%,var(--sim-cut) 100%,0 calc(100% - var(--sim-cut)),0 var(--sim-cut))}
body[data-path=righteous] .wgsPanel{border-color:color-mix(in srgb,var(--sim-cyan) 75%,var(--sim-title))}
body[data-path=demonic] .wgsPanel{border-color:color-mix(in srgb,var(--sim-cyan) 55%,var(--sim-crimson))}
.story.wgsPanel{display:grid;gap:6px;padding:10px 8px 12px}
.passage.yearCard,.passage.yearCard.opening,.passage.yearCard.latest:not(.opening){display:grid;grid-template-columns:34px minmax(0,1fr);column-gap:6px;padding:10px 12px 10px 10px;margin:0;border:0;border-radius:10px;background:transparent}
.yearCard .ageTag,.passage.yearCard .passageTitle,.passage.yearCard.opening .passageTitle,.passage.latest:not(.opening) .passageTitle{grid-column:1;margin:0;padding-left:6px;border-left:3px solid var(--sim-title);font:700 13px/1.45 var(--sim-font-ui);letter-spacing:0;text-transform:none;color:var(--sim-title);font-variant-numeric:tabular-nums;min-width:28px;align-self:start}
.yearCard .prose,.passage.yearCard.latest .prose,.passage.yearCard.opening .prose{grid-column:2;font:14px/1.45 var(--sim-font-ui);color:var(--sim-body)}
.yearCard .storyPara{margin:0 0 6px}
.yearCard .storyPara:last-child{margin-bottom:0}
.yearCard .storyLine[data-kind=event]{color:#dfe9ec}
.yearCard .fxTag{color:color-mix(in srgb,var(--sim-title) 90%,transparent);font-weight:600;margin-left:.3em;white-space:nowrap}
.passage.yearCard.latest{scroll-margin-bottom:calc(var(--dockH,80px) + var(--noteH,0px) + 88px)}
/* HG-086: an armed Regress/Reincarnate note sets --noteH, so the waiting card and its pills scroll clear of it */
.choicePills{scroll-margin-bottom:calc(var(--dockH,80px) + var(--noteH,0px) + 24px)}
.yearCard.hasChoice{background:#1b4460;border:1px solid var(--sim-cyan)}
@keyframes sim-pulse-edge{0%,100%{box-shadow:0 0 0 1px var(--sim-cyan),0 0 8px var(--sim-cyan-glow)}50%{box-shadow:0 0 0 2px var(--sim-cyan-strong),0 0 16px rgba(91,174,234,.85)}}
.yearCard.is-waiting{animation:sim-pulse-edge 1.6s ease-in-out infinite}
.inlineEvent{grid-column:1/-1;margin-top:8px}
.inlineTitle{margin:0 0 4px;font:600 14px/1.35 var(--sim-font-ui);color:var(--sim-text)}
.inlineText{margin:0 0 8px;font:14px/1.45 var(--sim-font-ui);color:var(--sim-body)}
.choicePills{display:flex;flex-wrap:wrap;gap:8px}
.choicePills .choice{flex:1 1 calc(50% - 8px);min-width:0;min-height:44px;padding:6px 14px;border-radius:999px;border:0;color:#fff;font:600 14px/1.2 var(--sim-font-ui);text-shadow:0 1px 2px #0006;white-space:normal;overflow-wrap:anywhere}
.choicePills .choice-a{background:var(--sim-choice-a)}
.choicePills .choice-b{background:var(--sim-choice-b)}
.choicePills .choice-c{background:transparent;border:1.5px solid var(--sim-choice-c-border)}
.choicePills .choice:disabled{opacity:.45}
.choicePills .choice .lock{display:block;font-size:11px;font-weight:500;opacity:.9}
.storySection .heading h2{color:var(--sim-title)}
.storySection .heading .badge{background:var(--sim-chip);border-color:rgba(91,174,234,.7);color:var(--sim-body)}

/* Right-hand rail on the running story (spec "Side dock"): small glowing panels, 72 px wide. The log clears it. */
body.railOn{--railH:0px}
body.railOn.railArmed{--railH:0px}
.storyRail{left:auto;right:max(6px,calc((100vw - 804px)/2 + 6px));transform:none;top:calc(env(safe-area-inset-top,0px) + 186px);bottom:auto;width:var(--simRailW);height:auto;flex-direction:column;align-items:stretch;justify-content:flex-start;gap:8px;padding:0;background:none;border:0;overflow:visible}
.storyRail .chip,.storyRail.hasGate .chip{flex:0 0 auto;max-width:none;min-height:44px;padding:4px 2px;border-radius:10px;background:var(--sim-bar);border:1px solid var(--sim-cyan);box-shadow:0 0 8px var(--sim-cyan-glow);color:var(--sim-text);font:600 11px/1.2 var(--sim-font-ui);white-space:normal;overflow-wrap:anywhere;text-overflow:clip}
body[data-path=demonic] .storyRail .chip{border-color:color-mix(in srgb,var(--sim-cyan) 55%,var(--sim-crimson))}
.storyRail .chip.open,.storyRail .chip.armed,.storyRail .railOptions.hasEvent,.storyRail .godButton.open{border-color:var(--sim-title);color:var(--sim-title);background:var(--sim-bar);box-shadow:0 0 12px rgba(241,192,69,.55)}
.storyRail .godButton{color:var(--sim-title)}
.storyRail .railGate.lit{color:#1a1405;background:var(--sim-title)}
.storyRail.armedRow{flex-wrap:nowrap}
.storyRail.armedRow .chip.armed{flex:0 0 auto;order:0}
body.railOn[data-route=life] .wgsFrame{margin-right:calc(var(--simRailW) + 8px)}
body.railOn[data-route=life] .storySection>.heading{margin-right:calc(var(--simRailW) + 8px)}
@media (max-width:380px){.storyRail .chip,.storyRail.hasGate .chip{font-size:10.5px;padding:4px 1px}}
.dock{background:#10283af2;border-color:var(--sim-cyan)}
.carryNote{background:#132f45f5;border-color:var(--sim-title);color:var(--sim-title)}
.godSheet{background:linear-gradient(170deg,#1b4460f7,#132f45f7);border-color:var(--sim-cyan)}

/* Create: goal line, Talents rows, Set Points rows */
#create{background:linear-gradient(180deg,var(--sim-bg-top),var(--sim-bg-bottom));border-color:var(--sim-cyan);color:var(--sim-text);font-family:var(--sim-font-ui)}
.createProgress{background:var(--sim-bg-top)}
.createGoal{margin:2px 0 8px;text-align:center;font-size:14px;font-style:italic;color:var(--sim-subtitle)}
.wgsStep>legend{width:100%;text-align:center;font:italic 700 26px/1.2 var(--sim-font-title);color:var(--sim-title);text-shadow:0 2px 6px #0007}
.wgsSub{display:block;text-align:center;font-size:14px;letter-spacing:.08em;color:var(--sim-subtitle);margin-bottom:6px}
.talentHand.wgsHand{display:flex;flex-direction:column;gap:var(--sim-row-gap)}
.talentRow,.talentRow.talentCard{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:var(--sim-tap);height:auto;padding:5px 26px 5px calc(var(--sim-stripe-w) + 10px);border:0;border-radius:var(--sim-radius-row);background:var(--sim-bar);color:var(--sim-text);text-align:center;overflow:hidden;box-shadow:none;transform:none}
.talentRow::before{content:"";position:absolute;left:0;top:0;bottom:0;width:var(--sim-stripe-w);background:var(--r)}
.talentRow.rarity-grey{--r:var(--sim-stripe-grey)}
.talentRow.rarity-common{--r:var(--sim-stripe-blue)}
.talentRow.rarity-rare{--r:var(--sim-stripe-purple)}
.talentRow.rarity-legendary{--r:var(--sim-stripe-orange)}
.talentChip.rarity-grey{--r:var(--sim-stripe-grey);--rbg:#2a2f36}
.talentLine{font-size:14px;line-height:1.25;color:var(--sim-text)}
.talentQuip{font-size:11.5px;line-height:1.2;color:var(--sim-muted);font-style:italic}
.talentQuip.inheritMark{color:var(--sim-title);font-style:normal}
.talentRow[aria-pressed=true],.talentRow.talentCard[aria-pressed=true]{background:var(--sim-bar-selected);box-shadow:inset 0 0 0 1.5px var(--sim-cyan);transform:none}
.talentRow[aria-pressed=true]::after{content:"\2713";position:absolute;right:10px;top:50%;transform:translateY(-50%);color:var(--sim-title);font-weight:800}
.wgsStep .talentBar{justify-content:center;gap:10px}
.wgsStep .talentBar .badge{flex-basis:100%;text-align:center;background:none;border:0;color:var(--sim-title)}
.wgsBtn{flex:1 1 40%;min-height:44px;border-radius:999px;background:transparent;border:2px solid var(--sim-cyan);box-shadow:0 0 10px var(--sim-cyan-glow);color:var(--sim-text);font:600 14px/1.2 var(--sim-font-ui)}
.wgsBtn:disabled{opacity:.4;box-shadow:none}
.pointsRows{display:flex;flex-direction:column;gap:var(--sim-row-gap);margin-top:6px}
.pointsRow{display:grid;grid-template-columns:minmax(0,1fr) 44px 44px 44px;align-items:center;gap:6px;min-height:var(--sim-tap);padding:4px 6px 4px 12px;border-radius:var(--sim-radius-row);background:var(--sim-bar)}
.pointsName{display:flex;flex-direction:column;min-width:0}
.pointsName strong{font-size:14px;color:var(--sim-text)}
.pointsMap{font-size:12px;color:var(--sim-muted)}
.pointsValue{text-align:center;font:700 22px/1 var(--sim-font-ui);color:var(--sim-title);font-variant-numeric:tabular-nums}
.stepper{width:44px;height:44px;min-height:44px;padding:0;border-radius:999px;background:transparent;border:2px solid var(--sim-cyan);color:#fff;font:700 20px/1 var(--sim-font-ui)}
.stepper:disabled{opacity:.4}
#pointsLeft{color:var(--sim-title);font-size:15px}
#pointsLeft.done{color:var(--sim-jade)}
#beginLife{border-radius:999px;min-height:48px}

/* End sheet on the death screen: age, realm, final stats, the ending, inherit 1 talent */
.endSheet{padding:12px;margin:8px 0 12px;filter:none}
.endFacts{display:flex;align-items:baseline;gap:10px;margin-bottom:8px}
.endFacts .ageTag{padding-left:6px;border-left:3px solid var(--sim-title);font:700 16px/1.2 var(--sim-font-ui);color:var(--sim-title)}
.endRealm{font:italic 700 20px/1.2 var(--sim-font-title);color:var(--sim-text)}
.endLine{margin:8px 0;font-size:14px;line-height:1.45;color:var(--sim-body)}
.inheritPick{display:flex;flex-direction:column;gap:8px;margin-top:10px}
.inheritTitle{color:var(--sim-title);font-size:15px}
/* WGS: the 9-slice parchment/jade panels give way to the cyan frame on the create dialog, the dock and the Life tab (other tabs keep theirs for now) */
#create{border-image:none;border:1px solid var(--sim-cyan);border-radius:var(--sim-radius-frame);box-shadow:0 0 18px var(--sim-cyan-glow),0 10px 60px #000b;padding:6px 12px 12px}
#create .createProgress{border-color:var(--sim-cyan);background:linear-gradient(180deg,#1A3E56f7,#173A51f7)}
#create .formHead h2{color:var(--sim-title);font-family:var(--sim-font-title)}
.dock{border-image:none;border:1px solid var(--sim-cyan);border-radius:14px 14px 0 0;background:#10283af2;box-shadow:0 0 12px var(--sim-cyan-glow)}
body[data-route=life] .screen,body[data-route=death] .screen{border-image:none;border:0;padding:0 0 8px;background:none}
.dock button{border-image:none;border:1px solid rgba(91,174,234,.6);border-radius:10px;background:var(--sim-bar);color:var(--sim-text);box-shadow:0 0 6px rgba(91,174,234,.25)}
.dock button[aria-current=page]{border-color:var(--sim-title);color:var(--sim-title);background:var(--sim-bar-selected)}
.dock .ageButton{border-color:var(--sim-title);color:var(--sim-title);background:#1E4A7A}
