/* Three independent manual readers share the same persistent navigation. */
.manual-reader.manual-page {
  width: min(1120px, calc(100vw - 48px));
  max-height: calc(100dvh - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #eee8db;
  border: 1px solid #75614a;
  border-radius: 14px;
  background: linear-gradient(145deg, #20282c, #131b20 75%);
  box-shadow: 0 24px 90px #000a;
}
.manual-reader .manual-header { flex: none; gap: 24px; padding: 20px 28px; border-bottom: 1px solid #675641; background: #151d22; }
.manual-reader .manual-header h1 { margin: 0; font-size: 24px; line-height: 1.3; }
.manual-reader button { font-family: inherit; cursor: pointer; }
.manual-reader button:focus-visible { outline: 3px solid #f2c775; outline-offset: 4px; }
.manual-reader .manual-header button,
.manual-reader .manual-element-filter button,
.manual-reader .manual-crosslinks button,
.manual-reader .manual-element-index button,
.manual-reader .manual-world-entry { min-height: 42px; padding: 9px 16px; color: #f3e7cf; border: 1px solid #82704f; border-radius: 7px; background: #263137; }
.manual-reader-content { overflow-y: auto; overscroll-behavior: contain; min-height: 0; padding: 28px; scrollbar-color: #a68b63 #151d22; }
.manual-reader-content h2 { color: #f5dcad; font-size: 24px; margin: 26px 0 14px; }
.manual-reader-content h3 { color: #efddb8; font-size: 18px; margin: 0 0 12px; }
.manual-reader-content p { margin: 0 0 16px; line-height: 1.8; font-size: 16px; color: #d3d8d7; }
.manual-reader .manual-kicker { display: block; color: #d0aa6d; font-size: 13px; letter-spacing: .15em; }
.manual-reader .manual-lede { max-width: 830px; }
.manual-reader .manual-menu { padding: 18px 8px 30px; }
.manual-reader .manual-menu h2 { margin-top: 15px; font-size: 34px; }
.manual-reader .manual-destinations { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 32px; }
.manual-reader .manual-destinations button { text-align: left; min-height: 190px; padding: 28px; color: #f7ead2; border: 1px solid #86724f; border-radius: 10px; background: linear-gradient(140deg, #3b4140, #243239); }
.manual-reader .manual-destinations b { display: block; font-size: 32px; margin-bottom: 18px; }
.manual-reader .manual-destinations span { display: block; font-size: 15px; line-height: 1.6; color: #dce0db; }
.manual-reader .manual-destinations small { display: block; margin-top: 20px; color: #ddbd84; }
.manual-reader .manual-element-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.manual-reader .manual-element-filter button[aria-pressed="true"] { color: #1d2529; background: #e0bb79; border-color: #e0bb79; }
.manual-reader .manual-rule-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.manual-reader .manual-rule-grid article,
.manual-reader .manual-ordered-combos article { border: 1px solid #4e5a5c; border-radius: 8px; padding: 20px; background: #202c32; }
.manual-reader .manual-rule-grid p { margin-bottom: 0; }
.manual-reader .manual-world-entry { display: inline-block; margin: 0 0 24px; }
.manual-reader .manual-hero-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.manual-reader .manual-hero-tile { display: flex; flex-direction: column; overflow: hidden; padding: 0; text-align: left; border: 1px solid #69746e; border-radius: 9px; background: #28333a; color: #eee8db; }
.manual-reader .manual-hero-tile .manual-portrait { width: 100%; aspect-ratio: 3/4; object-fit: contain; object-position: center bottom; background: radial-gradient(ellipse at bottom, #5e685e, #202c32 75%); }
.manual-reader .manual-hero-caption { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 12px; padding: 14px; }
.manual-reader .manual-hero-caption b { font-size: 21px; }
.manual-reader .manual-hero-caption span { color: #debc82; font-size: 14px; }
.manual-reader .manual-hero-caption small { width: 100%; color: #cbd0cf; font-size: 12px; line-height: 1.6; }
.manual-reader .manual-hero-intro { display: grid; grid-template-columns: minmax(220px, 32%) minmax(0, 1fr); align-items: center; gap: 32px; }
.manual-reader .manual-hero-intro > .manual-portrait { width: 100%; max-height: 470px; object-fit: contain; object-position: center bottom; }
.manual-reader .manual-hero-intro h2 { font-size: 34px; margin: 12px 0 20px; }
.manual-reader blockquote { margin: 24px 0; border-left: 3px solid #d8b875; padding: 12px 20px; font-size: 21px; color: #f0d7a8; line-height: 1.6; }
.manual-reader .manual-biography { max-width: 850px; margin: 30px auto; }
.manual-reader .manual-combo-directory { border-top: 1px solid #485655; margin-top: 30px; padding-top: 10px; }
.manual-reader .manual-ordered-combos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 20px 0; }
.manual-reader .manual-crosslinks { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: #cbd4d2; font-size: 14px; }
.manual-reader .manual-element-index { display: flex; flex-wrap: wrap; gap: 12px; }
.manual-reader .manual-world { max-width: 820px; margin: 0 auto; }
.manual-reader .manual-world section { margin: 28px 0; }
.manual-reader .manual-world ol { padding-left: 28px; }
.manual-reader .manual-world li { padding: 8px 0; color: #e9cc96; }
.manual-reader .manual-world li strong { display: block; font-size: 19px; margin-bottom: 10px; }
.manual-reader .manual-footnote { border-top: 1px solid #52625f; padding-top: 18px; font-size: 13px; color: #b4bfbc; }
.manual-reader .skill-codex > div { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.manual-reader .skill-codex .codex-card { min-width: 0; }
@media (max-width: 850px) {
  .manual-reader .manual-hero-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .manual-reader .skill-codex > div { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .manual-reader .manual-destinations { gap: 12px; }
  .manual-reader .manual-destinations button { padding: 20px; }
}
@media (max-width: 600px) {
  .manual-reader.manual-page { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); }
  .manual-reader .manual-header { padding: 16px; gap: 12px; }
  .manual-reader .manual-header h1 { font-size: 22px; }
  .manual-reader-content { padding: 20px 16px; }
  .manual-reader .manual-destinations { grid-template-columns: 1fr; margin-top: 24px; }
  .manual-reader .manual-destinations button { min-height: 130px; }
  .manual-reader .manual-destinations b { font-size: 26px; margin-bottom: 8px; }
  .manual-reader .manual-destinations small { margin-top: 12px; }
  .manual-reader .manual-hero-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .manual-reader .manual-hero-intro { grid-template-columns: 1fr; gap: 20px; }
  .manual-reader .manual-hero-intro > .manual-portrait { max-height: 330px; }
  .manual-reader .manual-rule-grid, .manual-reader .manual-ordered-combos { grid-template-columns: 1fr; }
  .manual-reader .skill-codex > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .manual-reader .manual-menu h2 { font-size: 27px; }
}

.manual-reader .codex-card{display:flex;flex-direction:column;text-align:left;border:1px solid #69746e;border-radius:8px;padding:0;overflow:hidden;background:#253139;color:#eee8db;height:auto!important;min-height:0!important}
.manual-reader .manual-card-art{aspect-ratio:16/9;width:100%;display:grid;place-items:center;background:radial-gradient(ellipse,#697058,#1c2b34);overflow:hidden}
.manual-reader .manual-card-art img{width:100%;height:100%;object-fit:cover}
.manual-reader .manual-card-art>span{font-size:32px}
.manual-reader .codex-card>span{padding:12px;display:block;font-size:15px}
.manual-reader .codex-card small{display:block;padding-top:6px;color:#d5c097}

.manual-screen .manual-reader.manual-page{inset:0;width:100%;height:100%;max-width:none;max-height:none;border-radius:0;overflow:hidden}
.manual-reader-content{flex:1}


/* Recovered notes and everyday memories sit apart from the rule panels. */
.manual-reader .manual-card-count { margin: 18px 0; color: #dcc18e; }
.manual-reader .manual-card-category { margin: 30px 0; }
.manual-reader .manual-card-category h2 small { font-size: 14px; font-weight: normal; color: #c6cbbb; }
.manual-reader .manual-empty { padding: 28px; border: 1px dashed #7d755e; border-radius: 8px; }
.manual-reader .manual-memory-fragment { border-top: 1px solid #555950; padding: 24px 0 8px; }
.manual-reader .manual-memory-fragment h3 { letter-spacing: .08em; color: #ddc28c; }
.manual-reader .manual-world-memory { margin: 26px 0 34px; }
.manual-reader .manual-world-memory img { display: block; width: 100%; height: auto; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; border: 1px solid #78674b; }
.manual-reader .manual-world-memory figcaption { margin-top: 12px; font-size: 14px; color: #baa98a; line-height: 1.8; }
.manual-reader .manual-world-fragments article { padding: 22px 0 10px; border-top: 1px solid #4b5653; }

/* Full-viewport readers keep navigation floating above the content. */
.manual-reader.manual-page{position:relative;min-height:0}
.manual-accessible-title{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.manual-reader-content{min-height:0;padding-top:58px}
.manual-reader[data-manual-current-page="heroes"]>.manual-reader-content{overflow:hidden;padding:58px 22px 16px;display:flex}
.manual-reader .manual-hero-grid{display:flex;flex:1;min-height:0;gap:16px;overflow-x:auto;overflow-y:hidden;align-items:stretch;scroll-snap-type:x proximity;overscroll-behavior-x:contain;padding:0 0 10px;touch-action:pan-x}
.manual-reader .manual-hero-grid>.manual-hero-tile{flex:0 0 clamp(150px,min(calc(75dvh - 128px),85vw),720px);height:100%;min-height:0;display:flex;flex-direction:column;padding:0;scroll-snap-align:start;overflow:hidden}
.manual-reader .manual-hero-grid .manual-portrait{width:100%;height:0;flex:1;min-height:0;object-fit:contain;object-position:center bottom}
.manual-reader .manual-hero-grid .manual-world-tile .manual-portrait{object-fit:cover;object-position:center}
.manual-reader .manual-hero-caption{flex:none;padding:12px 10px;min-height:76px;box-sizing:border-box}
.manual-reader[data-manual-current-page="hero"]>.manual-reader-content{padding:0;overflow:hidden;display:flex}
.manual-reader .manual-hero-detail{flex:1;min-height:0;display:grid;grid-template-columns:minmax(0,38%) minmax(0,1fr);height:100%;gap:0;overflow:hidden}
.manual-reader .manual-hero-visual{min-width:0;min-height:0;height:100%;padding:48px 12px 12px;box-sizing:border-box}
.manual-reader .manual-hero-visual>.manual-portrait{width:100%;height:100%;max-height:none;object-fit:contain;object-position:center bottom}
.manual-reader .manual-hero-scroll{min-width:0;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:54px 26px 24px}
.manual-reader .manual-hero-intro{display:block;margin:0}
.manual-reader .manual-hero-scroll .manual-biography{margin:24px 0}
@media(max-width:600px){
 .manual-reader .manual-hero-detail{grid-template-columns:minmax(0,38%) minmax(0,1fr)}
 .manual-reader .manual-hero-scroll{padding:54px 12px 20px}
 .manual-reader .manual-hero-scroll h2{font-size:25px}
 .manual-reader .manual-hero-grid{gap:10px}
 .manual-reader[data-manual-current-page="heroes"]>.manual-reader-content{padding:54px 12px 12px}
}

/* Compact intersecting filters use the platform's accessible select controls. */
.manual-reader .manual-card-filters{display:flex;align-items:center;gap:16px;flex-wrap:nowrap;margin:0 0 18px}
.manual-reader .manual-select-filter{display:flex;align-items:center;gap:8px;color:#d8c8a6;font-size:14px;min-width:0}
.manual-reader .manual-select-filter select,.manual-reader .manual-gameplay-pagination select{min-height:36px;border:1px solid #8b8067;border-radius:6px;background:#23323a;color:#f0e6cf;font:inherit;padding:6px 28px 6px 10px;max-width:100%}
.manual-reader .manual-card-filters .manual-card-count{margin:0 0 0 auto;white-space:nowrap;font-size:13px;color:#c5b999}
.manual-reader .manual-card-common-note{margin:24px 0 4px;padding-top:14px;border-top:1px solid #485655;font-size:12px;line-height:1.6;color:#9faeaa}
/* Only the current chapter is mounted; long text scrolls above the fixed pager. */
.manual-reader[data-manual-current-page="gameplay"]>.manual-reader-content{display:flex;overflow:hidden;padding-bottom:12px}
.manual-reader .manual-gameplay-reader{display:flex;flex-direction:column;flex:1;min-width:0;min-height:0;overflow:hidden}
.manual-reader .manual-gameplay-chapter{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:0 16px 12px;max-width:900px;width:100%;box-sizing:border-box;margin:0 auto}
.manual-reader .manual-gameplay-chapter>h2{margin:0 0 18px;font-size:30px;color:#e9d1a5}
.manual-reader .manual-gameplay-chapter>p{font-size:19px;line-height:1.9}
.manual-reader .manual-gameplay-pagination{flex:none;display:flex;gap:12px;align-items:center;justify-content:center;padding:12px 0 0;border-top:1px solid #53615c}
.manual-reader .manual-gameplay-pagination label{display:flex;align-items:center;gap:7px;min-width:0;color:#c8d0c8;font-size:13px}
.manual-reader .manual-gameplay-pagination select{max-width:240px}
.manual-reader .manual-gameplay-pagination>span{white-space:nowrap;color:#d6c298;font-size:13px}
.manual-reader .manual-gameplay-pagination button{white-space:nowrap;min-height:40px;padding:7px 12px;border:1px solid #9e875d;border-radius:7px;background:#26373e;color:#f3e7cf}
.manual-reader .manual-gameplay-pagination button:not(:disabled):hover{background:#3c5054}
.manual-reader .manual-gameplay-pagination button:disabled{opacity:.38;cursor:default}
@media(max-width:600px){
 .manual-reader .manual-card-filters{gap:8px}
 .manual-reader .manual-select-filter{gap:4px;font-size:12px;flex:1}
 .manual-reader .manual-select-filter select{width:100%;min-width:0;padding-right:16px}
 .manual-reader .manual-card-filters .manual-card-count{font-size:11px}
 .manual-reader .manual-gameplay-chapter{padding:0 2px 10px}
 .manual-reader .manual-gameplay-chapter>h2{font-size:24px;margin-bottom:12px}
 .manual-reader .manual-gameplay-chapter>p{font-size:16px;line-height:1.75}
 .manual-reader .manual-gameplay-pagination{gap:6px;flex-wrap:nowrap}
 .manual-reader .manual-gameplay-pagination label{font-size:0;flex:1}
 .manual-reader .manual-gameplay-pagination select{min-width:0;width:100%;font-size:11px}
 .manual-reader .manual-gameplay-pagination button{padding:6px;font-size:11px}
 .manual-reader .manual-gameplay-pagination>span{font-size:11px}
}

/* Status stays in the caption under the portrait, aligned to its upper right. */
.manual-reader .manual-hero-caption .hero-unlock-status{width:100%;display:flex;flex-direction:column;align-items:flex-end;gap:2px;color:#e3c68e;font-size:12px;line-height:1.5;text-align:right}
.manual-reader .manual-hero-caption .hero-unlock-status span{font-size:inherit;color:inherit;max-width:100%}
.manual-reader .manual-hero-caption .hero-unlock-status.is-unlocked{color:#b5d0ba}
