/* R8: one-screen character atlas, native comic reader, near-fullscreen play. */
.lore-section {padding:12px 0;scroll-margin-top:var(--beatworks-header-height,88px)}
.lore-wrap {width:calc(100% - 24px);max-width:1800px}
.r8-enabled .lore-section .section-head {display:none}
.r8-enabled .lore-full-page .lore-page-title {position:absolute;inline-size:1px;block-size:1px;overflow:hidden;clip-path:inset(50%)}
.lore-r8.lore-workbench {height:calc(100svh - var(--beatworks-header-height,88px) - 24px);min-height:0;max-height:none;grid-template-rows:auto auto minmax(0,1fr) auto;border-radius:28px}
.lore-r8 .lore-heading {padding:12px 22px}
.lore-r8 .lore-heading .eyebrow {display:none}
.lore-r8 .lore-heading h2 {font-size:clamp(20px,2.5vw,32px)}
.lore-r8 .lore-tabs {display:flex;gap:8px;padding:7px 18px;border-bottom:1px solid var(--line)}
.lore-r8 .lore-tabs .chip {flex:1;min-height:44px;font-size:12px;padding:8px 10px}
.lore-r8 .lore-body {min-height:0;display:grid;grid-template-columns:.85fr 1.15fr}
.lore-r8 .lore-showcase {height:auto;padding:8px 20px 14px}
.lore-r8 .lore-reading {display:grid;grid-template-rows:minmax(0,1fr) auto;padding:16px 22px;overflow:hidden;height:100%;min-height:0}
.lore-r8 .lore-page-content {overflow:hidden;min-height:0}
.lore-r8 .lore-page-content p {font-size:clamp(13px,1.1vw,16px);line-height:1.7;margin:0 0 8px}
.lore-r8 .lore-page-tools {display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:44px;margin-top:6px;font-size:11px}
.lore-r8 .lore-page-tools[hidden] {display:none}
.lore-r8 .lore-page-tools button {width:44px;height:44px;flex:none}
.lore-r8 .lore-facts {grid-template-columns:1fr 1fr;gap:8px}
.lore-r8 .lore-fact {padding:10px;gap:9px;flex-direction:row;align-items:center}
.lore-r8 .lore-fact img {width:44px;height:54px;object-fit:contain}
.lore-r8 .lore-relation {padding:8px 12px;gap:14px;min-height:104px}
.lore-r8 .lore-relation-avatar {width:72px;height:96px;flex:0 0 72px;border-radius:22px}
.lore-r8 .lore-relation-avatar img {width:100%;height:100%;object-fit:contain}
.lore-r8 .lore-console {padding:10px 16px 12px}
.lore-r8 .lore-console-head {margin-bottom:8px}
.lore-r8 .lore-roster {grid-template-columns:repeat(var(--roster-columns,10),minmax(0,1fr));grid-template-rows:none;overflow:visible;gap:6px}
.lore-r8 .lore-pick {min-width:0;min-height:0;padding:4px;gap:4px}
.lore-r8 .lore-pick img {width:100%;height:var(--roster-avatar,88px);object-fit:contain;flex:none}
.lore-r8 .lore-pick span {font-size:10px;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.lore-r8 .lore-pick[hidden] {display:none!important}
.lore-roster-pages {display:flex;gap:10px;align-items:center;justify-content:center;margin-top:8px;font-size:11px}
.lore-roster-pages[hidden] {display:none}
.lore-roster-pages button {width:44px;height:44px}
.lore-r8 .lore-showcase-foot {flex-direction:row;align-items:center}
.lore-r8 .lore-showcase-foot p {max-width:55%;font-size:12px}
@media(max-width:700px){
 .lore-r8 .lore-heading {padding:8px 12px}
 .lore-r8 .lore-age {font-size:10px;padding:5px 8px}
 .lore-r8 .lore-heading>div:first-child {gap:8px}
 .lore-r8 .lore-heading h2 {font-size:24px}
 .lore-r8 .lore-tabs {padding:5px 8px;gap:4px}
 .lore-r8 .lore-tabs .chip {font-size:11px;padding:6px}
 .lore-r8 .lore-body {display:block}
 .lore-r8 .lore-showcase {height:100%;padding:6px 16px 10px}
 .lore-r8[data-view=portrait] .lore-reading {display:none}
 .lore-r8:not([data-view=portrait]) .lore-showcase {display:none}
 .lore-r8 .lore-reading {padding:12px;display:grid}
 .lore-r8 .lore-console {padding:8px}
 .lore-r8 .lore-console-head {gap:6px;flex-wrap:nowrap}
 .lore-r8 .lore-console-head>strong {display:none}
 .lore-r8 .lore-search-label {order:0;flex:1;max-width:none;display:block}
 .lore-r8 .lore-search-label input {height:40px;min-height:40px;font-size:12px;padding:6px 10px}
 .lore-r8 .lore-search-label span {display:none}
 .lore-r8 .lore-count {font-size:10px}
 .lore-r8 .lore-fact img {width:32px;height:40px}
 .lore-r8 .lore-fact {gap:7px;padding:9px}
 .lore-r8 .lore-fact dt,.lore-r8 .lore-fact dd {font-size:11px;line-height:1.4}
 .lore-r8 .lore-relation-avatar {width:60px;height:86px;flex-basis:60px}
 .lore-r8 .lore-relation {min-height:94px;gap:10px}
 .lore-r8 .lore-relation span {font-size:11px}
}
@media(max-height:550px){
 .topbar .nav {min-height:52px;padding-top:0;padding-bottom:0}
 .topbar .brandlink,.topbar .brandlink>img {height:34px;width:160px}
 .lore-section {padding:4px 0}
 .lore-r8.lore-workbench {height:calc(100svh - var(--beatworks-header-height,52px) - 8px);border-radius:20px}
 .lore-r8 .lore-heading {padding:4px 12px}
 .lore-r8 .lore-heading h2 {font-size:21px}
 .lore-r8 .lore-tabs {padding:3px 8px}
 .lore-r8 .lore-console {padding:4px 8px}
 .lore-r8 .lore-console-head {display:none}
 .lore-r8 .lore-roster-pages {margin-top:2px}
 .lore-r8 .lore-reading {padding:6px 10px}
 .lore-r8 .lore-fact img {display:none}
 .lore-r8 .lore-fact {padding:7px}
 .lore-r8 .lore-relation {min-height:0;padding:5px 8px}
 .lore-r8 .lore-relation-avatar {width:44px;height:56px;flex-basis:44px}
 .lore-r8 .lore-relation-copy {gap:2px}
 .lore-r8 .lore-showcase-foot {display:none}
}
.reader-page .page-intro {display:none}
.reader-app {padding-top:20px;padding-bottom:36px;max-width:1400px}
.reader-top {display:flex;align-items:center;gap:18px;margin-bottom:14px}
.reader-top h1 {flex:1;font-size:clamp(18px,2.2vw,28px);line-height:1.25;margin:0}
.reader-tools {position:sticky;top:var(--beatworks-header-height,88px);z-index:5;display:flex;justify-content:center;gap:10px;align-items:center;background:var(--surface);padding:10px;border:1px solid var(--edge);border-radius:20px;box-shadow:var(--lift)}
.reader-tools label {display:flex;align-items:center;gap:8px;font-size:12px;font-weight:800}
.reader-tools select {min-height:44px;background:var(--bg);border:1px solid var(--edge);border-radius:12px;color:var(--ink);padding:6px 12px}
.reader-sheet {margin:14px auto;text-align:center;min-height:250px}
.reader-sheet img {display:block;max-width:100%;height:calc(100svh - var(--beatworks-header-height,88px) - 180px);width:auto;object-fit:contain;margin:auto;border-radius:10px;box-shadow:var(--lift)}
.reader-sheet[data-zoom=true] img {width:100%;height:auto;max-height:none;max-width:1600px}
.reader-sheet figcaption {font-size:12px;margin:12px 0}
.reader-words {max-width:820px;margin:24px auto}
@media(max-width:600px){.reader-app{width:calc(100% - 20px);padding-top:14px}.reader-top{gap:10px;flex-wrap:wrap}.reader-top h1{flex-basis:calc(100% - 140px)}.reader-top>a:last-child{display:none}.reader-tools{gap:6px;padding:6px}.reader-tools .btn{padding:9px;min-width:40px;font-size:11px}.reader-tools label{font-size:0;gap:0}.reader-tools select{font-size:12px;padding:5px}.reader-sheet img{height:calc(100svh - var(--beatworks-header-height,78px) - 160px)}}
.play-launch {min-height:60svh;display:flex;flex-wrap:wrap;gap:16px;align-content:center;justify-content:center;text-align:center}
.play-launch h1,.play-launch p {flex-basis:100%}
.play-stage-r8 {position:fixed;inset:8px;z-index:100;display:grid;grid-template-rows:48px minmax(0,1fr) 24px;background:var(--bg);border:1px solid var(--edge);border-radius:20px;overflow:hidden;box-shadow:var(--lift)}
.play-stage-r8[hidden] {display:none}
.game-stage-bar {display:flex;align-items:center;gap:12px;padding:4px 10px;background:var(--surface);border-bottom:1px solid var(--line)}
.game-stage-bar strong {flex:1;font-size:13px}
.game-stage-bar>div {display:flex;gap:6px}
.game-stage-bar .iconbtn {height:40px;min-width:40px;width:40px}
.game-stage-bar .btn {min-height:38px;padding:7px 13px}
.play-stage-r8 iframe {display:block;border:0;width:100%;height:100%;min-height:0;background:var(--bg)}
.game-stage-status {font-size:10px;margin:0;padding:3px 12px;background:var(--surface);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
body.game-open {overflow:hidden}
.play-stage-r8:fullscreen {inset:0;border:0;border-radius:0;width:100%;height:100%}
@media(max-width:600px){.play-stage-r8{inset:0;border-radius:0}.game-stage-bar{gap:6px;padding:4px 6px}.game-stage-bar strong{font-size:11px}.game-stage-bar .btn{font-size:11px;padding:7px 9px}}

/* Scope the live game stage: decorative home sections also use .play-stage-r8. */
.sculpted main>section[data-game-stage] {position:fixed;isolation:isolate;aspect-ratio:auto;max-width:none;margin:0;width:auto;height:auto;padding:0}
.lore-r8 .lore-console-head {min-height:44px;gap:12px;display:flex}
.lore-r8 .lore-roster-pages {margin:0;flex:none;font-size:10px}
.lore-r8 .lore-search-label {margin-left:auto}
.lore-r8 .lore-roster {padding-bottom:0}
.lore-r8 .lore-portrait {min-width:0;align-self:stretch;justify-self:center;width:100%;height:100%;aspect-ratio:auto}
.lore-r8 .lore-showcase-foot {min-height:44px}
@media(max-width:700px){.lore-r8 .lore-console-head{gap:6px}.lore-r8 .lore-count{display:none}.lore-r8 .lore-roster-pages{gap:5px}.lore-r8 .lore-roster-pages button{width:36px;min-width:36px}.lore-r8 .lore-showcase-foot p{font-size:10px}.lore-r8 .lore-showcase-foot .btn{padding:8px 12px}}
@media(max-height:550px){.lore-r8 .lore-console-head{margin-bottom:3px;min-height:36px}.lore-r8 .lore-search-label{display:none}.lore-r8 .lore-count{display:block;margin-right:auto}.lore-r8 .lore-roster-pages button{height:36px;min-height:36px}.lore-r8 .lore-heading .iconbtn{height:36px;min-height:36px}.lore-r8 .lore-showcase-foot{display:none}.lore-r8 .lore-reading{padding:5px 10px}}

.game-view{position:relative;overflow:hidden;min-height:0;min-width:0}.game-view iframe{position:absolute;top:0;left:0;transform-origin:0 0;max-width:none}

/* Reading gets the available screen; the Hero tab restores character choice. */
@media(max-width:700px),(max-height:550px){.lore-r8:not([data-view=portrait]) .lore-console{display:none}.lore-r8 .lore-facts{grid-template-columns:1fr}}
