@import url('./game-menu.css');
:root{font-family:Georgia,'Times New Roman',serif;color:#273b37;background:#f2eee5;font-size:18px;line-height:1.6;color-scheme:light}*{box-sizing:border-box}body{margin:0}header{max-width:1320px;margin:auto;display:flex;align-items:center;justify-content:space-between;gap:18px;padding:20px 28px;border-bottom:1px solid #d6d2c7}header a{text-decoration:none;color:inherit}header>a:first-child{font:700 12px system-ui;letter-spacing:.12em}.brand{font:bold 25px Georgia}.brand small{display:block;font:10px system-ui;letter-spacing:.23em}button,a{touch-action:manipulation}button{cursor:pointer;font:inherit;color:inherit}button:focus-visible,a:focus-visible,summary:focus-visible{outline:3px solid #ae543d;outline-offset:4px}header button{border:1px solid #bbbcb0;background:transparent;border-radius:30px;padding:9px 18px;font:14px system-ui}main{max-width:1250px;margin:0 auto;padding:36px 28px 60px}.eyebrow{font:700 11px system-ui;letter-spacing:.17em;text-transform:uppercase;color:#7c5b48}h1{font-weight:400;font-size:clamp(36px,5vw,66px);line-height:1.08;margin:18px 0 22px}h2{font-weight:400;line-height:1.2;font-size:34px;margin:12px 0 20px}p{max-width:65ch}.intro{font-size:21px;color:#58665d;max-width:650px}.gallery{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:26px;margin-top:40px}.book{border-top:1px solid #bdbdaf;padding-top:14px}.book svg{width:100%;height:auto;border-radius:8px}.book h2{font-size:28px}.book p{font:15px/1.6 system-ui;color:#56665d}.primary,.choice,.again{background:#294d43;color:#fffdf5;border:0;border-radius:7px;text-align:left;padding:16px 20px;text-decoration:none;display:inline-block;font:600 16px/1.5 system-ui}.primary:hover,.choice:hover,.again:hover{background:#3c6456}.scene-layout{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(300px,1fr);gap:44px;align-items:start}.scene-wrap{position:sticky;top:20px}.scene-wrap svg{display:block;width:100%;height:auto;border-radius:10px}.scene-caption{font:12px/1.5 system-ui;color:#647268;margin-top:12px}.scene-copy h1{font-size:clamp(32px,4vw,48px)}.choices{display:grid;gap:12px;margin:26px 0}.choice{display:flex;gap:16px;align-items:baseline;width:100%}.choice small{font:12px system-ui;opacity:.7}.notice{border-left:3px solid #b07442;padding:12px 18px;background:#e8dfcb}.progress{height:3px;background:#d9d8cb;margin:18px 0 26px}.progress span{display:block;height:100%;background:#ae644a}.facts{border-top:1px solid #cbcdbf;padding-top:16px;font:14px/1.7 system-ui}.facts summary{cursor:pointer;font-weight:600}.facts ul{list-style:none;padding:0}.cast-name{color:#85563d}.inventory{font:14px/1.6 system-ui;background:#e6e7da;padding:12px 15px;border-radius:6px;margin-top:18px}.scene-copy{min-width:0}.end-actions{display:flex;gap:12px;flex-wrap:wrap}.secondary{background:transparent;border:1px solid #788b7c;color:#294d43;border-radius:6px;padding:12px 18px;font:600 15px system-ui}.empty{font-size:14px}footer{border-top:1px solid #d6d2c7;padding:20px 28px;display:flex;justify-content:space-between;font:12px system-ui;color:#687267}dialog::backdrop{background:#172d2bba}body.ts-menu-open{overflow:hidden}#ts-game-menu{max-width:min(94vw,540px)}@media(max-width:850px){.scene-layout{grid-template-columns:1fr;gap:20px}.scene-wrap{position:static}.gallery{grid-template-columns:1fr}.book{display:grid;grid-template-columns:1fr 1fr;gap:18px}.book>svg{grid-row:span 3}.book h2,.book p{margin:0}.book .primary{align-self:start}}@media(max-width:520px){header{padding:14px;gap:10px}.brand{font-size:20px}main{padding:24px 16px 40px}.book{display:block}.book h2{margin:15px 0}.book p{margin-bottom:18px}.scene-copy p{font-size:18px}.choice{font-size:17px;padding:16px}.scene-caption{font-size:12px}header>a:first-child{font-size:10px}#nickname{max-width:70px;display:inline-block;overflow:hidden;vertical-align:bottom;text-overflow:ellipsis}.scene-wrap svg{max-height:43vh}.end-actions{flex-direction:column}}

/* The frame stays in the viewport; only narrative and optional details scroll. */
body{height:100dvh;overflow:hidden;display:flex;flex-direction:column}header{width:100%;flex:none;padding:10px 20px}footer{flex:none;padding:5px 20px}main{width:100%;flex:1;min-height:0;padding:14px 20px;overflow:auto}.scene-layout{height:100%;gap:24px;align-items:stretch}.scene-wrap{position:static;min-height:0;display:flex;flex-direction:column;overflow:auto}#art{flex:1;min-height:70px;display:flex;align-items:center;justify-content:center;cursor:zoom-in}#art svg{width:100%;height:100%;max-height:100%;object-fit:contain}.scene-copy{display:flex;flex-direction:column;min-height:0;overflow:hidden}.scene-copy h1{font-size:clamp(24px,3vw,38px);margin:8px 0}.scene-copy .eyebrow{margin:0}.progress{flex:none;margin:8px 0}.narration{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding-right:10px;font-size:20px;line-height:1.55}.narration p{white-space:pre-line;margin:0 0 18px}.choices{flex:none;margin:10px 0 0;gap:7px}.choice{padding:10px 14px;font-size:16px}.scene-caption{margin:5px 0}.facts{padding-top:5px}.facts ul{margin:5px 0}.inventory{margin-top:5px;padding:7px 10px}.scene-copy>.scene-caption{display:none}.journey{border-top:1px solid #bbc5b7;padding:12px 0}.journey h2{font-size:23px}.source{font:14px/1.5 system-ui}summary{cursor:pointer}.end-actions{flex:none;margin-top:12px}
@media(max-width:850px){.scene-layout{grid-template-columns:1fr;grid-template-rows:minmax(110px,29%) minmax(0,1fr);gap:8px}.scene-wrap{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto;gap:3px 12px}#art{grid-row:1/3}.scene-wrap>.scene-caption{display:none}.facts{overflow:auto}.inventory{font-size:12px}.scene-copy h1{font-size:25px}.narration{font-size:18px;line-height:1.5}.choice{font-size:16px;padding:8px 10px}.scene-wrap svg{max-height:100%}main{padding:8px 12px}header{padding:7px 12px}footer{font-size:10px}.scene-copy>.notice{margin:4px 0;padding:4px 8px;font-size:14px}.gallery{margin-top:10px}.book svg{max-height:180px}}
@media(max-height:520px) and (min-width:600px){.scene-layout{grid-template-columns:minmax(160px,.8fr) minmax(0,1.4fr);grid-template-rows:1fr}.scene-wrap{display:flex}.scene-copy h1{font-size:23px}.choice{padding:5px 9px;font-size:14px}.choices{gap:4px}.narration{font-size:18px}header{padding:4px 12px}footer{display:none}.facts,.inventory{font-size:12px}}

#art>img{display:block;width:100%;height:100%;min-height:0;object-fit:contain;border-radius:10px}

.book>img{display:block;width:100%;height:auto;border-radius:8px}@media(max-width:850px){.book>img{grid-row:span 3;max-height:180px;object-fit:contain}}

/* Persistent end screen. It closes only on activation, never on a timer. */
.ending-screen{position:fixed;inset:0;z-index:900;width:100vw;height:100dvh;margin:0;padding:0;border:0;border-radius:0;display:block;overflow:hidden;background:#080c14;color:#fff;text-align:center;cursor:pointer;touch-action:manipulation;font-family:inherit}
.ending-picture{position:absolute;inset:0;display:flex;align-items:center;justify-content:center}.ending-picture>img,.ending-picture>svg{display:block;width:100%;height:100%;object-fit:contain;max-width:none;max-height:none}
.ending-caption{position:absolute;inset:auto 0 0;display:flex;flex-direction:column;gap:8px;padding:40px max(20px,env(safe-area-inset-right)) max(18px,env(safe-area-inset-bottom));background:linear-gradient(transparent,rgba(5,10,18,.93) 34%);text-shadow:0 1px 3px #000}.ending-caption strong{font-size:clamp(24px,4vw,42px)}.ending-caption>span{font-size:clamp(18px,2vw,22px);line-height:1.4;max-width:75ch;align-self:center}.ending-caption small{font-size:18px;text-decoration:underline;text-underline-offset:4px}.ending-screen:focus-visible{outline:3px solid #f6d77a;outline-offset:-6px}
@media(max-height:480px){.ending-caption{gap:4px;padding:24px 16px 8px}.ending-caption strong{font-size:23px}.ending-caption>span,.ending-caption small{font-size:16px;line-height:1.25}}

.ending-picture>img{object-fit:cover;object-position:50% 45%}

/* Theseus: ending actions remain below the illustration on every screen. */
.theseus-ending{display:flex;flex-direction:column;overflow:auto;cursor:default}
.theseus-ending .ending-picture{position:relative;inset:auto;flex:1 1 auto;min-height:120px}
.theseus-ending .ending-picture>img,.theseus-ending .ending-picture>svg{position:absolute;inset:0;object-fit:contain}
.theseus-ending .ending-caption{position:relative;inset:auto;flex:0 0 auto;padding:16px max(20px,env(safe-area-inset-right)) max(18px,env(safe-area-inset-bottom));background:#080c14}
.theseus-ending-actions{display:flex;justify-content:center;flex-wrap:wrap;gap:12px}
.theseus-ending-actions button{min-height:48px;padding:12px 24px;font:inherit;font-weight:700;cursor:pointer}
.theseus-ending-actions .secondary{background:#202b3a;color:#fff;border:1px solid #8797ac}
@media(max-height:480px){.theseus-ending .ending-picture{min-height:160px}.theseus-ending .ending-caption{padding:10px 16px}.theseus-ending .ending-caption strong{font-size:23px}}

/* Theseus: emphasize the ending restart action only. */
.theseus-ending-actions #ending-restart{background:#ffd66b;color:#171008;border:3px solid #fff0bd;border-radius:12px;font-size:22px;font-weight:800;min-height:56px;padding:14px 32px;box-shadow:0 4px 16px rgba(255,214,107,.28);text-shadow:none}
.theseus-ending-actions #ending-restart:hover{background:#ffe59c}
.theseus-ending-actions #ending-restart:focus-visible{outline:3px solid #fff;outline-offset:4px}

:root{--savitri-title:"Palatino Linotype","Book Antiqua",Georgia,serif;--loki-title:"Copperplate Gothic Light",Copperplate,Georgia,serif}
html[data-myth="savitri"] h1,html[data-myth="savitri"] .lr-entry-hero h1{font-family:var(--savitri-title);color:#7c391e;font-weight:700}
html[data-myth="loki"] h1,html[data-myth="loki"] .lr-entry-hero h1{font-family:var(--loki-title);font-variant:small-caps;letter-spacing:.025em;color:#254e52}
html[data-myth="savitri"] .lr-entry-hero h1{color:#ffe1a0}html[data-myth="loki"] .lr-entry-hero h1{color:#d1f5e8}
.myth-summary{width:min(92vw,760px);height:auto;max-height:88dvh;padding:0;border:1px solid #c9ad78;border-radius:16px;background:#f6f0e3;color:#263b37;box-shadow:0 20px 80px #0007;overflow:hidden}
.myth-summary[open]{display:flex;flex-direction:column}.myth-summary::backdrop{background:#06121bc9}.myth-summary>header{width:100%;display:flex;justify-content:space-between;align-items:center;padding:14px 20px;gap:15px;flex:none;border-bottom:1px solid #c9bda6}.myth-summary h2{font:700 clamp(22px,3vw,30px)/1.2 Georgia;margin:0}.myth-summary-close{font:32px/1 system-ui;min-width:46px;min-height:46px;border:0;border-radius:8px;background:#e3d8c3;color:#293f3a;cursor:pointer}.myth-summary-content{overflow:auto;overscroll-behavior:contain;min-height:0;padding:20px 24px;font:20px/1.65 Georgia;white-space:pre-line}.myth-summary-content p{margin:0 0 18px}.myth-summary-content a{color:#6b4023}.myth-summary-trigger{font-size:13px;padding:7px 10px;margin:4px 0;flex:none;align-self:flex-start}
html[data-myth="savitri"] .ending-picture img,html[data-myth="loki"] .ending-picture img{object-fit:contain}
@media(max-width:850px){.myth-summary-content{font-size:18px;padding:16px}.myth-summary>header{padding:10px 14px}.scene-wrap .myth-summary-trigger{grid-column:2;font-size:11px;margin:0;padding:5px}.scene-wrap:has(.myth-summary-trigger){grid-template-rows:minmax(0,1fr) auto auto}#art:has(img){min-width:0;min-height:0}.lr-entry-single[data-game="savitri"]{--lr-focus:44% 45%}.lr-entry-single[data-game="loki"]{--lr-focus:40% 48%}}
@media(max-height:520px) and (min-width:600px){.myth-summary{max-height:94dvh}.scene-wrap .myth-summary-trigger{font-size:11px;padding:4px 8px}}
