/* Comfortable reading and touch targets on small screens. */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
/* 가로 원본의 가장자리와 이미지 안의 이름이 잘리지 않도록 표시합니다. */
/* Keep bookmarks outside animated views so fixed positioning follows the viewport. */
.chapter-ribbon{display:none;left:10px;top:calc(var(--top) + (100svh - var(--top))/2);gap:8px;max-height:calc(100svh - var(--top) - 24px);overflow-y:auto;scrollbar-width:thin;padding:4px}
.mode-world .chapter-ribbon{display:grid}
.chapter-ribbon button{display:flex;align-items:center;gap:8px;width:86px;min-height:48px;height:auto;padding:10px;text-align:left;background:#f1e6cfee;border:1px solid #a488557d;border-right:3px solid #a4885580;box-shadow:2px 3px 7px #462f1318}
.chapter-number{flex-shrink:0;min-width:22px;font:12px/1.5 var(--serif);text-align:center}
.chapter-label{font-size:13px;line-height:1.65}
.chapter-ribbon button.active{border-right-color:#caa677;box-shadow:2px 4px 9px #462f1329}
.world-view{padding-left:112px;padding-right:112px}
.world-view .page{width:100%;max-width:1240px}
/* Original portrait files: only the viewport crops, with no image filters or overlays. */
.character-portrait{position:relative;aspect-ratio:4/5;overflow:hidden;border:1px solid #a58b615f;background:#e9ddc7}
.character-portrait img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center;filter:none}
.character-card:hover .character-portrait{border-color:#97784b}
.map-npcs .character-portrait{aspect-ratio:1}
.character-detail .portrait-detail{aspect-ratio:3/4;width:100%;align-self:start}
#starlight{position:fixed;inset:0;z-index:45;pointer-events:none;contain:strict}
.mobile-map-hint{display:none}
@media(hover:hover) and (pointer:fine){
  body,button,a,[role="button"]{cursor:url('assets/pixel-feather-cursor.png') 5 28,auto}
  button,a,[role="button"]{cursor:url('assets/pixel-feather-cursor.png') 5 28,pointer}
  input,textarea,[contenteditable="true"]{cursor:text}
  input[type="range"]{cursor:ew-resize}
  button:disabled,input:disabled{cursor:not-allowed}
}
@media(prefers-reduced-motion:reduce),(forced-colors:active){#starlight{display:none}}
@media(forced-colors:active){body,button,a,[role="button"]{cursor:auto}}
html[data-pointer-preview="touch"] body,html[data-pointer-preview="touch"] button,html[data-pointer-preview="touch"] a{cursor:auto}
@media(min-width:761px) and (max-width:1024px){
  .chapter-ribbon{left:4px}.chapter-ribbon button{width:80px;padding:10px 8px;gap:6px}.chapter-label{font-size:12px}
  .world-view{padding-left:96px;padding-right:96px}
  .world-view .realm-spread,.world-view .apostle-layout{grid-template-columns:1fr;gap:28px}
  .world-view .realm-figure{max-width:560px;margin-left:auto;margin-right:auto}
  .realm-copy .body-copy,.apostle-copy>.body-copy{font-size:15px;line-height:1.95}
  .synopsis{font-size:16px}.realm-subtitle{font-size:17px}
  .character-card h3{font-size:16px}.character-card>p{font-size:12px}
  .location-thumb span{font-size:13px}.realm-figure figcaption{font-size:12px;line-height:1.8;letter-spacing:0}
  .map-card>p:not(.eyebrow){font-size:14px}.map-location-group button{font-size:13px;min-height:44px}
  .rift-roles p{font-size:13px}.rift-roles h3{font-size:14px}.chapter-buttons button{font-size:13px}
}
@media(max-width:760px){
  :root{--top:112px;--muted:#695641}
  html:has(body.mode-world){scroll-padding-top:calc(var(--top) + 56px)}
  .chapter-ribbon{left:0;right:0;top:var(--top);transform:none;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px;height:56px;max-height:none;overflow:visible;padding:6px 10px;background:#f7f0e1f5;border-bottom:1px solid var(--line);box-shadow:0 3px 9px #462f130c;backdrop-filter:blur(12px)}
  .chapter-ribbon button{width:100%;min-width:0;min-height:44px;padding:5px 3px;flex-direction:row;justify-content:center;gap:4px;border-right-width:1px;border-bottom-width:2px;text-align:center;box-shadow:none}
  .chapter-number{min-width:14px;font-size:11px;line-height:1.2}
  .chapter-label{font-size:12px;line-height:1.4;white-space:nowrap}
  .chapter-ribbon button.active{border-bottom-color:#caa677;box-shadow:none}
  .world-view{padding:calc(var(--top) + 56px) 12px 0}
  .world-view .page{min-height:calc(100svh - var(--top) - 56px)}
  .scenery-book{background-position:left center}
  body{font-size:16px;line-height:1.8}
  .topbar{padding:10px 16px 8px;gap:2px}
  .brand{font-size:14px;min-height:34px}
  .top-actions{display:grid;grid-template-columns:max-content max-content max-content minmax(65px,1fr);gap:9px;width:100%;font-size:11px;align-items:center}
  .external-link{min-height:44px;padding:0;display:flex;align-items:center}
  .external-link span{margin-left:3px}
  .bgm-toggle{min-height:44px;padding:0 0 0 9px;font-size:10px}
  .volume-control{min-width:0;gap:4px;min-height:44px}
  .volume-control svg{width:12px;flex-shrink:0}
  .volume-control input{min-width:25px;width:100%;height:28px;margin:0}
  .volume-control output{width:28px;flex-shrink:0;font-size:10px}
  .page{width:calc(100% - 24px);padding:26px 23px 96px;background:#f5eddd}
  .running-head{font-size:10px;line-height:1.6;align-items:start;letter-spacing:.03em}
  .running-head>span{max-width:51%}
  .running-head>span:last-child{text-align:right}
  .page-footer{left:23px;right:23px;bottom:20px;font-size:10px;line-height:1.6;min-height:44px}
  .page-footer button{font-size:12px;min-height:44px;padding:8px 0}
  .page-footer>span:first-child{max-width:42%}
  .eyebrow{font-size:10px;letter-spacing:.12em}
  .prologue-content{padding:36px 0;min-height:0}
  .prologue-content h2{font-size:clamp(27px,7vw,37px);line-height:1.6;letter-spacing:-.055em}
  .prologue-content>.eyebrow{font-size:10px}
  .synopsis{font-size:16px;line-height:2;text-align:left;margin-top:10px}
  .chapter-buttons{max-width:none;width:100%;margin-top:28px}
  .chapter-buttons button{font-size:14px;min-height:50px;padding:13px 14px}
  .section-heading{margin:29px 0 25px}
  .section-heading h2{font-size:32px}
  .section-heading>p:last-child{font-size:14px;line-height:1.9}
  .rank-card h3{font-size:20px}.rank-card p{font-size:12px}.rank-number{font-size:11px}
  .fine-note{font-size:13px;line-height:1.9}
  .territory-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:23px 15px}
  .territory-card{min-width:0}
  .territory-card h3{font-size:clamp(18px,5.6vw,22px)}.territory-card .eyebrow{font-size:9px}.territory-card .concept{font-size:13px}.territory-card .card-action{font-size:12px}
  .realm-spread,.apostle-layout{padding:30px 0;gap:30px}
  .realm-copy h2{font-size:38px}.realm-subtitle{font-size:17px;line-height:1.7;margin-bottom:24px}
  .realm-copy .body-copy,.apostle-copy>.body-copy{font-size:16px;line-height:1.95;color:#4c3d2f;margin-bottom:20px}
  .realm-meta{font-size:14px;gap:20px;line-height:1.7}.realm-meta span{font-size:12px}
  .realm-figure figcaption{font-size:12px;line-height:1.8;letter-spacing:0;margin:13px 0 20px}
  .location-thumbs{gap:10px}.location-thumb span{font-size:13px;line-height:1.6;margin-top:10px}
  .filter-tabs{gap:3px;margin:14px -5px 25px}.filter-tabs button{font-size:12px;min-height:44px;padding:8px 10px}
  .character-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:26px 17px}
  .character-grid .empty-portrait{aspect-ratio:4/5;height:auto}
  .character-detail .portrait-detail{max-width:320px;margin:0 auto;aspect-ratio:4/5}
  .character-card h3{font-size:17px;line-height:1.5;margin-top:12px}.character-card>p{font-size:12px;line-height:1.8}
  .empty-portrait .empty-caption{font-size:10px;bottom:13px}
  .rift-roles{grid-template-columns:1fr;gap:17px}.rift-roles h3{font-size:15px}.rift-roles p{font-size:14px;line-height:1.9}
  .rift-seal>.eyebrow{font-size:10px}.rift-seal li{font-size:12px;line-height:1.7}.rift-seal li span{font-size:12px}
  .rift-info{font-size:14px;min-height:44px;padding:10px 0}
  .kin-heading{font-size:15px;line-height:1.6;gap:8px}.kin-heading span{font-size:11px}.kin-grid{gap:10px}.kin-card p{font-size:13px;line-height:1.7}
  .apostle-art span{font-size:12px}.epilogue-content h2{font-size:32px}
  .map-view{padding-left:12px;padding-right:12px}
  .map-heading{padding:18px 19px;gap:16px;background:#f6eedeeF}
  .map-heading h2{font-size:32px}.map-heading>p{font-size:14px;line-height:1.8}
  .map-heading .text-button{font-size:14px;min-height:44px;display:flex;align-items:center;justify-content:flex-end}
  .mobile-map-hint{display:block;margin:-8px 0 13px;padding:0 5px;font:12px/1.7 var(--ui);color:#695641}
  .map-node{width:44px;height:44px}.map-node .pin-label{font-size:12px;bottom:38px}
  .map-card{padding:23px;background:#f8f0e2f5}
  .map-card h3{font-size:27px}.map-card>p:not(.eyebrow){font-size:15px;line-height:1.9}
  .map-card .location-image{width:104px;margin-right:17px}
  .map-card .kin-heading{clear:both;padding-top:17px}
  .map-card .rift-map-note{font-size:12px!important;line-height:1.8}
  .map-card>.text-button{font-size:15px;min-height:48px}
  .map-npcs{gap:17px}.map-npcs .character-card{width:min(135px,calc(50% - 9px))}.map-npcs .character-card h3{font-size:16px}
  .map-legend{grid-template-columns:1fr 1fr;font-size:12px;gap:13px}
  .map-location-list{gap:20px 16px;padding:4px 6px;background:#f5ecdcbb}
  .map-location-group h3{font-size:16px;margin:5px 0 8px}.map-location-group button{display:block;font-size:14px;min-height:44px;padding:9px 5px 9px 0;line-height:1.65}
  .map-appendix-group{gap:12px}.map-appendix-group h3{font-size:14px;margin:0}.map-appendix-group p{font-size:12px}
  .map-footnote{font-size:10px;line-height:1.9;letter-spacing:.08em}
  .appendix-label{font-size:10px}.appendix-note{font-size:11px}
  #dialog-content{padding:50px 23px 30px}.dialog-close{width:44px;height:44px}
  .modal-copy>p{font-size:15px;line-height:1.95}.modal-copy .eyebrow{font-size:11px}.modal-copy h2{font-size:30px}
  .modal-meta{font-size:13px;line-height:1.9}.modal-copy .text-button{font-size:15px;min-height:44px}
  .profile-fields{font-size:15px;gap:20px}.profile-fields dt{font-size:12px}.guide-grid p{font-size:15px}.guide-grid h3{font-size:18px}
  .guide-table{font-size:12px;line-height:1.8}.large-empty{font-size:13px}
  .text-button{font-size:14px;min-height:44px}.home-copy>.eyebrow{font-size:10px;line-height:1.8;letter-spacing:.12em}
  .pronunciation{font-size:13px;line-height:1.8;letter-spacing:.06em}.book-button{font-size:14px;min-height:60px;padding:17px 12px}.book-button .book-icon{font-size:17px}
  .home-buttons{gap:10px}.home-caption{font-size:12px;line-height:1.8;bottom:63px}.home-edition{font-size:9px;bottom:34px}
  .home-view{padding:76px 22px 146px}.home-copy{margin-top:0}.home-view:before{background:radial-gradient(ellipse at 50% 43%,#fcf7e8fd 0%,#f5ecd6f2 32%,#f2e5caab 62%,#372e2245 100%)}
}
@media(max-width:359px){
  .topbar{padding-left:12px;padding-right:12px}.top-actions{gap:6px;font-size:10px}.bgm-toggle{font-size:9px;padding-left:6px}.volume-control svg{display:none}
  .page{padding-left:19px;padding-right:19px}.page-footer{left:19px;right:19px}.running-head{font-size:9px}
  .book-button{font-size:13px;padding-left:9px;padding-right:9px;gap:5px}.home-view{padding-left:18px;padding-right:18px}
  .realm-meta{flex-wrap:wrap}.kin-heading{flex-wrap:wrap}.map-appendix-group p{width:100%;margin-bottom:8px}
}

/* 안내와 책 전환은 양피지 색의 테두리 버튼으로 통일합니다. */
.text-button.boxed-button,.map-heading .text-button.boxed-button{
  display:inline-flex;align-items:center;justify-content:center;gap:18px;width:auto;
  min-height:48px;padding:13px 22px;border:1px solid #9b7a4e;
  background:#f4ead5;color:#62472f;text-decoration:none;line-height:1.6;
  box-shadow:inset 0 0 0 3px #fff8e94d;transition:background .18s,color .18s;
}
.text-button.boxed-button:hover{background:#e8d6b4;color:#432f1e}
.text-button.boxed-button span{padding-left:0}
#adventure-open.boxed-button{display:flex;width:fit-content;max-width:100%;margin:25px auto 0}
.text-button.boxed-button:focus-visible{outline:2px solid #6e4c86;outline-offset:4px}
.monster-image{position:relative;overflow:hidden}
.monster-image:before,.monster-image:after{display:none}
.monster-image img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.large-empty.monster-image img{object-fit:contain}
.media-unavailable{position:absolute;inset:auto 8px 18px;text-align:center;font:12px/1.6 var(--ui);color:#796448}
@media(max-width:760px){
  .map-heading .text-button.boxed-button{width:100%;font-size:14px;padding:12px 16px}
}

/* 업로드한 사도·권속 원본의 전체 구도를 보여주는 도감 배치. */
.apostle-layout{grid-template-columns:minmax(0,1fr);gap:22px;align-items:start;min-height:0;padding:32px 0 65px}
.apostle-copy{order:0}.apostle-copy h2{margin:8px 0 12px}.apostle-copy>.body-copy{max-width:none}
.apostle-layout .apostle-art{order:0;width:100%;height:auto;aspect-ratio:1216/704;outline:none;background:transparent}
.apostle-kin{min-width:0}.apostle-kin .kin-heading{margin-top:8px}
.apostle-kin .kin-grid{gap:20px;margin:15px 0 0}
.kin-card .empty-portrait.monster-image{aspect-ratio:1216/704}
.monster-image img{object-fit:contain}
.large-empty.monster-image{height:auto;aspect-ratio:1216/704;width:100%;background:transparent}
.kin-card p{font-size:14px;margin-top:10px}

/* 프로필의 초상화는 두 번째 클릭으로 원본을 여는 버튼입니다. */
.portrait-enlarge{padding:0;display:block;text-align:left}
.portrait-enlarge:focus-visible{outline:2px solid #6e4c86;outline-offset:4px}
.portrait-enlarge-hint{position:absolute;right:9px;bottom:9px;padding:6px 10px;border:1px solid #b99b69;background:#f6eddaef;color:#584027;font:12px/1.5 var(--ui)}
#portrait-lightbox{width:min(1320px,calc(100vw - 40px));max-width:none;max-height:calc(100svh - 30px);margin:auto;padding:16px 20px 12px;background:#201d1a;color:#f6ead5;border:1px solid #ac926a;overflow:auto}
#portrait-lightbox::backdrop{background:#100c09d9;backdrop-filter:blur(7px)}
.portrait-lightbox-bar{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:12px}
#portrait-lightbox-title{margin:0;font:16px/1.5 var(--ui)}
#portrait-lightbox-close{position:static;flex-shrink:0;display:grid;place-items:center;width:44px;height:44px;border:1px solid #ab9068;background:#3c3328;color:#f9edd5;font:30px/1 var(--serif)}
#portrait-lightbox-close:focus-visible{outline:2px solid #d6b2f5;outline-offset:3px}
.portrait-lightbox-image{display:flex;justify-content:center;align-items:center}
#portrait-lightbox-img{display:block;position:static;width:100%;height:auto;max-height:calc(100svh - 160px);object-fit:contain;filter:none}
.portrait-lightbox-note{margin:10px 0 0;text-align:center;font:12px/1.5 var(--ui);color:#c6b694}
@media(max-width:760px){
  .apostle-layout{gap:19px;padding-top:22px;padding-bottom:30px}
  .apostle-kin .kin-grid{grid-template-columns:1fr;gap:22px}
  .kin-card p{font-size:15px;margin-top:8px}
  .portrait-enlarge-hint{font-size:12px}
  #portrait-lightbox{width:calc(100vw - 16px);max-height:calc(100svh - 16px);padding:10px}
  .portrait-lightbox-bar{gap:8px;margin-bottom:10px}#portrait-lightbox-title{font-size:14px}
  #portrait-lightbox-img{max-height:calc(100svh - 136px)}
}
.portrait-lightbox-actions{display:flex;align-items:center;gap:8px;flex-shrink:0}
#portrait-lightbox-zoom{min-width:64px;min-height:44px;border:1px solid #ab9068;padding:8px;background:#3c3328;color:#f9edd5;font:12px/1.5 var(--ui)}

/* 글자 크기 조정 (v3): 본문 / 보조 설명 / 이름을 아래 변수에서 함께 수정하세요.
   책의 명조체와 큰 장 제목은 유지하고, 이름·소제목·표 머리글만 굵게 표시합니다.
   이 블록은 화면 높이에 따라 글자를 줄이던 기존 규칙보다 뒤에 있어야 합니다. */
:root{--reading-size:17px;--support-size:14px;--name-size:20px}
body{font-size:var(--reading-size);line-height:1.85}
.synopsis{font-size:var(--reading-size);line-height:2}
.realm-copy .body-copy,.apostle-copy>.body-copy,.modal-copy>p,.guide-grid p{font-size:var(--reading-size);line-height:1.95}
.realm-subtitle{font-size:19px;line-height:1.7}
.section-heading>p:last-child{font-size:16px;line-height:1.85}
.eyebrow,.modal-copy .eyebrow{font-size:11px;line-height:1.7;letter-spacing:.16em}
.running-head,.page-footer{font-size:11px;line-height:1.7;letter-spacing:.07em}
.page-footer button{font-size:13px;font-weight:600;min-height:40px}
.page{padding-bottom:96px}
.brand{font-size:16px}.brand small{font-size:11px}
.top-actions{font-size:13px}.bgm-toggle{font-size:12px}.bgm-toggle strong{font-weight:700}
.volume-control output{font-size:11px}
.chapter-label{font-weight:600}
.text-button,.map-heading .text-button,.map-heading .text-button.boxed-button,.map-card>.text-button{font-size:16px;font-weight:600}
.chapter-buttons button{font-size:16px;font-weight:600}
.pronunciation{font-size:15px}.book-button{font-size:18px;font-weight:600}
.home-caption{font-size:14px}.home-edition{font-size:10px}
.rank-card h3{font-size:23px;font-weight:700}.rank-card p{font-size:var(--support-size);line-height:1.75}
.rank-number{font-size:12px}.fine-note{font-size:15px;line-height:1.9}
.territory-card h3{font-weight:700}.territory-card .eyebrow{font-size:11px;letter-spacing:.1em}
.territory-card .concept{font-size:15px;line-height:1.8}.territory-card .card-action{font-size:14px;font-weight:600}
.realm-meta{font-size:16px;line-height:1.8;flex-wrap:wrap;gap:20px 28px}
.realm-meta span{font-size:13px;font-weight:600}
.realm-figure figcaption{font-size:var(--support-size);letter-spacing:.02em;line-height:1.85}
.location-thumb span{font-size:15px;font-weight:600;line-height:1.65}
.filter-tabs{flex-wrap:wrap;row-gap:8px}
.filter-tabs button{font-size:15px;min-height:44px;padding:10px 17px}
.filter-tabs button.active{font-weight:700}
.character-grid{row-gap:30px}
.character-card{align-self:start}
.character-card h3{font-size:var(--name-size);font-weight:700;line-height:1.55;margin-top:13px;letter-spacing:-.035em}
.character-card>p{font-size:var(--support-size);line-height:1.8;margin-top:5px}
.rift-roles{gap:24px}.rift-roles h3{font-size:19px;font-weight:700;line-height:1.7}
.rift-roles p{font-size:16px;line-height:1.95}
.rift-seal>.eyebrow{font-size:11px;letter-spacing:.14em}
.rift-seal li{font-size:15px;font-weight:600;line-height:1.8}
.rift-seal li span{font-size:13px;font-weight:400}
.rift-info{font-size:15px;min-height:44px}
.kin-heading{font-size:19px;font-weight:700;line-height:1.7;gap:12px}.kin-heading span{font-size:13px;font-weight:400}
.kin-card p{font-size:17px;font-weight:600;line-height:1.7}
.map-heading>p{font-size:16px}.map-card h3{font-size:28px;font-weight:700}
.map-card>p:not(.eyebrow){font-size:16px;line-height:1.95}
.map-card .rift-map-note{font-size:14px!important;line-height:1.9}
.map-legend{font-size:14px;line-height:1.8}.map-node .pin-label{font-size:13px}
.map-npcs .character-card h3{font-size:18px}
.map-location-group h3{font-size:18px;font-weight:700}.map-location-group button{font-size:15px;line-height:1.8;min-height:42px}
.map-appendix-group p{font-size:13px}.map-footnote{font-size:12px;line-height:1.8;letter-spacing:.08em}
.appendix-label{font-size:11px;letter-spacing:.08em}.appendix-note{font-size:12px}
.modal-heading h2{font-size:36px}.modal-copy h2{font-size:35px}
.modal-meta{font-size:14px;line-height:1.85}
.profile-fields{font-size:17px;line-height:1.85;gap:23px}.profile-fields dt{font-size:14px;font-weight:700}
.guide-grid{gap:30px 36px}.guide-grid h3{font-size:20px;font-weight:700;line-height:1.7;margin-bottom:10px}
.guide-table{font-size:15px;line-height:1.85}.guide-table th,.guide-table td{padding:12px 10px}
.guide-table th{font-weight:700}.guide-table td:not(:first-child){font-weight:700}
.portrait-enlarge-hint,.portrait-lightbox-note{font-size:13px}
#portrait-lightbox-title{font-size:17px;font-weight:600}#portrait-lightbox-zoom{font-size:14px;font-weight:600}

/* 좁은 화면에서는 이름과 설명이 지나치게 잘게 나뉘지 않도록 열 수와 간격도 조정합니다. */
@media(min-width:761px) and (max-width:1100px){
  .character-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .chapter-buttons button{font-size:15px;padding-left:15px;padding-right:15px}
}
@media(max-width:760px){
  :root{--reading-size:16px;--support-size:14px;--name-size:19px}
  .brand{font-size:15px}.brand small{font-size:10px}
  .top-actions{font-size:12px;gap:8px}.bgm-toggle{font-size:11px;padding-left:8px}
  .volume-control output{font-size:11px}
  .running-head{font-size:11px;letter-spacing:.02em}.page-footer{font-size:11px}
  .eyebrow,.prologue-content>.eyebrow,.home-copy>.eyebrow{font-size:11px;letter-spacing:.1em}
  .section-heading>p:last-child{font-size:15px}
  .chapter-buttons button{font-size:15px}.book-button{font-size:16px}
  .pronunciation,.home-caption{font-size:14px}.home-edition{font-size:10px}
  .rank-card h3{font-size:22px}.rank-card p{font-size:13px}.fine-note{font-size:14px}
  .territory-card h3{font-size:clamp(20px,5.6vw,24px)}.territory-card .eyebrow{font-size:10px}
  .territory-card .concept{font-size:14px}.territory-card .card-action{font-size:13px}
  .realm-subtitle{font-size:18px}.realm-meta{font-size:15px;gap:18px}
  .location-thumb span{font-size:14px}.realm-figure figcaption{font-size:13px}
  .filter-tabs{gap:5px;margin-left:0;margin-right:0;justify-content:center}
  .filter-tabs button{font-size:14px;padding:9px 12px}
  .character-grid{gap:28px 16px}.character-card h3{margin-top:12px}
  .rift-roles h3{font-size:18px}.rift-roles p{font-size:16px}
  .rift-seal li{font-size:14px}.rift-seal li span{font-size:12px}
  .kin-heading{font-size:18px;flex-wrap:wrap}.kin-heading span{font-size:13px}
  .kin-card p{font-size:17px}.mobile-map-hint{font-size:13px}
  .map-heading>p{font-size:15px}.map-heading .text-button.boxed-button{font-size:15px}
  .map-location-group h3{font-size:17px}.map-location-group button{font-size:15px}
  .map-npcs .character-card h3{font-size:18px}.map-legend{font-size:13px}
  .map-appendix-group h3{font-size:16px}.map-appendix-group p{font-size:13px}
  .modal-heading h2,.modal-copy h2{font-size:32px}
  .guide-grid{gap:28px}.guide-grid h3{font-size:20px}.profile-fields{font-size:16px}
  .guide-table{font-size:14px;table-layout:fixed}.guide-table th,.guide-table td{padding:11px 5px}
  .guide-table th:first-child{width:60%}.guide-table th:not(:first-child),.guide-table td:not(:first-child){text-align:center;white-space:nowrap;letter-spacing:0}
  #portrait-lightbox-title{font-size:15px}
}
@media(max-width:359px){
  .top-actions{gap:6px;font-size:11px}.bgm-toggle{font-size:11px;padding-left:6px}
  .book-button{font-size:15px}.character-card h3{font-size:18px}
  .character-card>p{font-size:13px}.filter-tabs button{font-size:14px;padding:9px 10px}
  .rift-seal ol{gap:12px}.rift-seal li{font-size:13px}
}

/* v4: 인물 배경과 지도 아래 목록. 지도 그림이 글자 뒤로 비치지 않게 불투명한 양피지를 씁니다. */
.character-summary .character-rank{font-weight:700}
.profile-fields .wide dd{line-height:1.95}
.map-location-list{grid-template-columns:repeat(4,minmax(0,1fr));gap:24px;padding:24px 26px;background:#f5ecd9;border:1px solid #a98c60;box-shadow:inset 0 0 0 4px #fff8e969,0 5px 18px #49301b14}
.map-location-group{min-width:0;border-top:0;padding-top:0}
.map-location-group button{color:#5c4835}
.map-location-group.map-appendix-group{border-top:1px solid var(--line);padding-top:18px}
/* 마지막 장의 서명은 평문 모양을 유지합니다. 키보드로 선택했을 때만 기존 포커스 표시를 사용합니다. */
.page-footer .colophon-profile{font:inherit;letter-spacing:inherit;min-height:0;padding:0;border:0;background:none;color:inherit;text-align:left;box-shadow:none;text-decoration:none;transition:none}
@media(max-width:760px){
  .map-location-list{grid-template-columns:repeat(2,minmax(0,1fr));gap:22px;padding:22px 18px}
  .page-footer .colophon-profile{max-width:42%}
}
@media(max-width:480px){
  .map-location-list{grid-template-columns:minmax(0,1fr)}
  .map-location-group+.map-location-group{border-top:1px solid var(--line);padding-top:18px}
}

/* v5: 표지 소제목 아래의 작은 BGM 버튼. 재생 상태는 상단 메뉴와 공유합니다. */
.home-bgm-toggle{display:inline-flex;align-items:center;justify-content:center;gap:7px;margin:16px auto 0;min-height:40px;padding:8px 14px;border:1px solid #9b7a4e88;border-radius:3px;background:#f5ebd8b8;color:#6b5137;font:12px/1.5 var(--ui);letter-spacing:.06em}
.home-bgm-toggle strong{font-weight:700;min-width:24px;color:#835c34}
.home-bgm-toggle:hover,.home-bgm-toggle[aria-pressed="true"]{background:#eee0c4;border-color:#967347}
.home-bgm-toggle[aria-pressed="true"] strong{color:#5b653e}
.home-copy .home-buttons{margin-top:25px}
@media(max-width:760px){.home-bgm-toggle{min-height:44px;margin-top:13px}.home-copy .home-buttons{margin-top:20px}}

/* v6: 흰색 표식도 밝은 지도에서 보이도록 모든 영토 표식에 짙은 외곽선을 둘러줍니다.
   채우기 색은 content.js의 realms[].color 한 곳에서 노드와 범례에 함께 적용됩니다. */
.map-node:before{width:15px;height:15px;border:2px solid #fff3d9;box-shadow:0 0 0 1.5px #4e3b29,0 2px 5px #26191199}
.map-legend i{width:10px;height:10px;margin-right:7px;border:1px solid #4e3b29;box-shadow:0 0 0 1px #fff3d9}
#portrait-lightbox-zoom:focus-visible{outline:2px solid #d6b2f5;outline-offset:3px}
#portrait-lightbox-title{min-width:0;overflow-wrap:anywhere}
.portrait-zoomed .portrait-lightbox-image{display:block;overflow:auto;max-height:calc(100svh - 170px);overscroll-behavior:contain}
.portrait-zoomed #portrait-lightbox-img{width:max(100%,1216px);max-width:none;max-height:none;height:auto}
@media(max-width:760px){.portrait-zoomed .portrait-lightbox-image{max-height:calc(100svh - 165px)}}

/* v7: SA / AO 플레이를 나란히 두고, 모바일에서는 음악 조작을 다음 줄에 배치합니다. */
@media(max-width:760px){
  :root{--top:88px}
  .topbar{flex-direction:column;flex-wrap:nowrap;align-items:stretch;justify-content:center;gap:0;padding:3px 12px}
  .topbar .brand{height:24px;min-height:24px}
  .top-actions{grid-template-columns:repeat(3,minmax(0,1fr));gap:0 12px}
  .top-actions .external-link{justify-content:center;min-height:28px;padding:0}
  .top-actions .bgm-toggle{grid-column:1;min-height:28px;border-left:0;padding:0}
  .top-actions .volume-control{grid-column:2/-1;min-height:28px}
  .top-actions .volume-control input{height:22px}
  .chapter-ribbon{height:40px;padding:4px 10px}
  .chapter-ribbon button{min-height:32px;padding:2px 3px}
  html:has(body.mode-world){scroll-padding-top:calc(var(--top) + 40px)}
  .world-view{padding-top:calc(var(--top) + 40px)}
  .world-view .page{min-height:calc(100svh - var(--top) - 40px)}
}
