/* TGN canonical controls: gold carved boxes with live HTML labels. */
.journey button,.journey-open .sound-controls button{position:relative;isolation:isolate;border:2px solid #c7a661!important;border-radius:4px!important;border-image:none!important;background:linear-gradient(155deg,#234534f5,#09271ef5)!important;color:#f7e6b9!important;box-shadow:inset 0 0 0 2px #081d1766,0 2px 5px #0004!important;}
.journey button::before,.journey-open .sound-controls button::before{content:'';position:absolute;inset:3px;border:1px solid #e5c38266;border-radius:1px;pointer-events:none;}
.journey button::after,.journey-open .sound-controls button::after{content:'';position:absolute;inset:-2px;pointer-events:none;background:url('./assets/interface/button-corner-tl-v4.svg') left top,url('./assets/interface/button-corner-tr-v4.svg') right top,url('./assets/interface/button-corner-br-v4.svg') right bottom,url('./assets/interface/button-corner-bl-v4.svg') left bottom;background-size:14px 14px;background-repeat:no-repeat;}
.journey button:is(.journey-primary,.selection-confirm,[aria-pressed=true],.selected){background:linear-gradient(160deg,#7b303e,#481120)!important;border-color:#edcb80!important;color:#fff0bd!important;}
.journey button:disabled{opacity:.42;cursor:default}.journey button:focus-visible{outline:2px solid #fff0bd;outline-offset:3px}.journey button:not(:disabled):hover{filter:brightness(1.13)}
.journey .selection-confirm,.journey .selection-back{font-family:'Cinzel',Georgia,serif!important;}
.journey .selection-confirm::after,.journey .selection-back::after{background-size:22px 22px;}
.journey .roster-filters{gap:4px;border:0;}.journey .roster-filters button{flex:1;min-width:0;padding:7px 6px!important;font-size:clamp(10px,1.1vw,13px)!important;}
.journey .roster-card{padding:5px 3px 3px!important;gap:2px;}.journey .roster-card::after{background-size:11px 11px;}.journey .roster-medallion{width:min(calc(100cqw - 12px),calc(100cqh - 31px));}.journey .roster-card.selected .roster-medallion{box-shadow:0 0 0 1px #e5c27d;}
.journey .profile-tabs{display:flex;gap:8px;border:0;margin:8px 0 12px;}.journey .profile-tabs button{padding:7px 14px!important;font-size:14px!important;flex:1;min-width:0;}
.journey .model-turn-controls button{min-width:34px!important;width:34px!important;height:34px!important;min-height:34px!important;}.journey .stage-replay{border-radius:4px!important;}
/* Only the paper content scrolls; title, tabs and spindles stay in view. */
.journey .lontar-scroll{background:none;box-shadow:none;animation:none;}
.lontar-sheet-inner{height:100%;min-height:0;background:#ceb074 url('./assets/interface/lontar.webp') center/100% 100%;box-shadow:0 14px 30px #0005;}
.journey .lontar-content{box-sizing:border-box;padding-bottom:18px;overflow:hidden;}
.journey .lontar-content>:not(.profile-body){flex-shrink:0;}
.journey .profile-body{flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;touch-action:pan-y;scrollbar-width:thin;scrollbar-color:#84602d #bc965c33;scrollbar-gutter:stable;padding:2px 7px 14px 2px;text-align:left;}
.profile-body:focus-visible{outline:2px solid #684518;outline-offset:-2px;}.profile-body::-webkit-scrollbar{width:5px}.profile-body::-webkit-scrollbar-thumb{background:#84602d;border-radius:3px}
.journey .profile-stats{margin:0;padding:0;}.journey .profile-homeland{margin-top:16px;}.journey .profile-story>p{display:block;}.journey .profile-specialty{display:block;}
.journey .leader-lontar[data-profile=story] .profile-stats,.journey .leader-lontar[data-profile=stats] .profile-story{display:none;}
.journey .leader-lontar .lontar-scroll::after{bottom:auto;top:calc(100% - 7px);}
.leader-lontar.is-opening .lontar-sheet-inner{animation:canonical-unroll-down 1s cubic-bezier(.22,.68,.25,1) both;}
.journey .leader-lontar.is-opening .lontar-scroll::after{animation:canonical-spindle-down 1s cubic-bezier(.22,.68,.25,1) both;}
.leader-lontar.is-opening .lontar-content{animation:canonical-ink-in .65s .25s both;}
@keyframes canonical-unroll-down{from{clip-path:inset(0 0 100%)}to{clip-path:inset(0)}}
@keyframes canonical-spindle-down{from{top:-7px}to{top:calc(100% - 7px)}}
@keyframes canonical-ink-in{from{opacity:0}to{opacity:1}}
.journey-mode .lontar-sheet{animation:canonical-unroll-side .8s ease both;}.journey-scenario .scenario-brief,.world-transition .transition-lontar{animation:canonical-unroll-center .9s ease both;}
@keyframes canonical-unroll-side{from{clip-path:inset(0 100% 0 0)}to{clip-path:inset(0)}}
@keyframes canonical-unroll-center{from{clip-path:inset(0 50%)}to{clip-path:inset(0)}}
@media(max-height:539px){.journey .profile-tabs{margin:5px 0 8px;gap:5px;}.journey .profile-tabs button{font-size:12px!important;padding:5px 8px!important;min-height:32px;}.journey .roster-filters button{padding:5px 3px!important;}.journey .lontar-content{padding-bottom:10px;}.journey .profile-body{padding-bottom:10px;}.journey .model-turn-controls button{width:29px!important;min-width:29px!important;height:29px!important;min-height:29px!important;}.journey .model-turn-controls button::after{background-size:10px 10px;}}
@media(prefers-reduced-motion:reduce){.leader-lontar.is-opening .lontar-sheet-inner,.journey .leader-lontar.is-opening .lontar-scroll::after,.leader-lontar.is-opening .lontar-content,.journey-mode .lontar-sheet,.journey-scenario .scenario-brief,.world-transition .transition-lontar{animation:none;}}
/* Leave a clear inset above the permanent lower gold frame. */
.journey-character{--footer-height:84px;}.journey .selection-footer{padding-bottom:max(15px,env(safe-area-inset-bottom));}
@media(max-height:759px){.journey-character{--footer-height:70px;}}
@media(max-height:539px){.journey-character{--footer-height:64px;}.journey .selection-back,.journey .selection-confirm{font-size:12px!important;}}
@media(max-height:365px){.journey-character{--footer-height:60px;}}

/* TGN UI2: touch gestures, a centered selection label and clear frame spacing. */
.journey-character{--footer-height:100px;}
.journey-character .selection-footer{display:grid;grid-template-columns:subgrid;gap:0;padding:12px 0 max(30px,calc(env(safe-area-inset-bottom) + 22px));align-items:center;}
.journey-character .selection-footer .selection-back{justify-self:start;margin-left:max(36px,calc(env(safe-area-inset-left) + 24px));padding:10px 18px!important;}
.journey-character .selection-footer>p{grid-column:2;min-width:0;text-align:center;margin:0 10px 0 20px;line-height:1.3;white-space:normal;}
.journey-character .selection-footer>p span{display:block;font-size:10px;letter-spacing:.1em;}
.journey-character .selection-footer>p strong{display:block;font-size:15px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.journey-character .selection-footer .selection-confirm{grid-column:3;justify-self:end;margin-right:max(36px,calc(env(safe-area-inset-right) + 24px));min-width:0;width:calc(100% - 56px);max-width:320px;gap:12px;}
.journey-character .selection-stage .model-turn-controls,.journey-character .selection-stage .stage-replay{display:none!important;}
.journey-character .is-3d .figure-nameplate{left:3%;right:3%;padding-inline:8px;}
@supports not (grid-template-columns:subgrid){.journey-character .selection-footer{grid-template-columns:minmax(260px,30%) minmax(300px,32%) minmax(0,1fr);}}
@media(max-width:1100px){.journey-character .selection-footer>p{margin-left:14px;margin-right:7px;}@supports not (grid-template-columns:subgrid){.journey-character .selection-footer{grid-template-columns:minmax(230px,31%) minmax(260px,34%) minmax(0,1fr);}}}
@media(max-height:759px){.journey-character{--footer-height:90px;}}
@media(max-height:539px){.journey-character{--footer-height:82px;}.journey-character .selection-footer{padding-top:8px;padding-bottom:max(28px,calc(env(safe-area-inset-bottom) + 20px));}.journey-character .selection-footer .selection-back{padding:8px 14px!important;min-height:40px;}.journey-character .selection-footer .selection-confirm{padding:8px 12px!important;min-height:40px;font-size:12px!important;}.journey-character .selection-footer>p strong{font-size:13px;}}
@media(max-width:780px) and (orientation:landscape){.journey-character .selection-footer .selection-back{margin-left:max(28px,calc(env(safe-area-inset-left) + 18px));}.journey-character .selection-footer .selection-confirm{margin-right:max(28px,calc(env(safe-area-inset-right) + 18px));width:calc(100% - 38px);font-size:11px!important;gap:5px;}.journey-character .selection-confirm span{font-size:16px;}@supports not (grid-template-columns:subgrid){.journey-character .selection-footer{grid-template-columns:minmax(205px,30%) minmax(250px,37%) minmax(0,1fr);}}}

/* TGN UI3: circular portraits, one era dropdown and quiet utility icons. */
.journey .roster-panel button.roster-card{border:0!important;background:transparent!important;box-shadow:none!important;border-radius:50%!important;padding:2px!important;gap:0;}
.journey .roster-panel button.roster-card::before,.journey .roster-panel button.roster-card::after{display:none!important;}
.journey .roster-panel .roster-medallion{width:min(calc(100cqw - 8px),calc(100cqh - 8px));height:auto;aspect-ratio:1;max-height:none;filter:none;}
.journey .roster-panel .roster-card.selected .roster-medallion{box-shadow:0 0 0 2px #f9dc95,0 0 15px #e1b86666;}
.roster-filter-dropdown{position:relative;display:block;min-width:0;border:2px solid #c7a661;border-radius:4px;background:linear-gradient(155deg,#234534f5,#09271ef5);box-shadow:inset 0 0 0 2px #081d1766;}
.roster-filter-dropdown::before{content:'';position:absolute;inset:3px;border:1px solid #e5c38266;pointer-events:none;}
.roster-filter-dropdown::after{content:'';position:absolute;inset:-2px;pointer-events:none;background:url('./assets/interface/button-corner-tl-v4.svg') left top,url('./assets/interface/button-corner-tr-v4.svg') right top,url('./assets/interface/button-corner-br-v4.svg') right bottom,url('./assets/interface/button-corner-bl-v4.svg') left bottom;background-size:14px 14px;background-repeat:no-repeat;}
.journey .roster-filter-dropdown select{display:block;appearance:none;width:100%;min-width:0;min-height:36px;padding:7px 30px!important;margin:0;border:0!important;box-shadow:none!important;background:transparent!important;color:#f7e6b9!important;font:14px Georgia,serif;text-align:center;text-align-last:center;cursor:pointer;border-radius:0;}
.roster-filter-dropdown option{background:#102e24;color:#f7e6b9;}.roster-filter-dropdown>span{position:absolute;right:14px;top:50%;transform:translateY(-60%);pointer-events:none;color:#f7e6b9;}
.journey .journey-tools button,.journey-open .sound-controls button{border:0!important;background:transparent!important;box-shadow:none!important;border-radius:0!important;color:#eedba9!important;}
.journey .journey-tools button::before,.journey .journey-tools button::after,.journey-open .sound-controls button::before,.journey-open .sound-controls button::after{display:none!important;}
.journey .journey-tools button:hover,.journey-open .sound-controls button:hover{color:#fff4ce!important;filter:drop-shadow(0 0 5px #eac57188);}
.journey-character .selection-stage{padding:6px 1% 12px;}
.journey-character .selection-footer .selection-confirm{width:min(220px,calc(100% - 64px));max-width:220px;min-width:0;justify-self:center;margin:0;justify-content:center;text-align:center;padding:10px 16px!important;min-height:44px;gap:0;}
.journey-character .selection-footer .selection-back{display:flex;align-items:center;justify-content:center;text-align:center;min-width:105px;}
@media(max-height:539px){.journey-character .selection-stage{padding:2px 1% 8px;}.journey .roster-filter-dropdown select{min-height:30px;padding:5px 28px!important;font-size:12px;}.journey-character .selection-footer .selection-confirm{width:min(176px,calc(100% - 56px));min-height:40px;padding:8px 10px!important;font-size:12px!important;}}
@media(max-width:780px) and (orientation:landscape){.journey-character .selection-footer .selection-confirm{width:calc(100% - 54px);font-size:11px!important;}.journey-character .selection-footer .selection-back{min-width:90px;}}
/* Final compact control alignment. */
.journey .journey-tools button,.journey-open .sound-controls button{display:inline-flex!important;align-items:center;justify-content:center;line-height:1!important;}
@media(max-width:780px) and (orientation:landscape){.journey-character .selection-footer .selection-confirm{width:min(160px,calc(100% - 54px));}}

/* UI4: no legacy figure while the 3D model loads or is unavailable. */
.character-loading{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:14px;text-align:center;color:#ead7a6;padding:18px;z-index:2;}
.character-loading[hidden],.character-refresh[hidden]{display:none!important;}
.character-loading p{margin:0;font-size:clamp(14px,1.5vw,20px);text-shadow:0 2px 5px #001b12;}
.journey-character .character-refresh{width:auto;min-width:112px;min-height:44px;padding:10px 24px;border:1px solid #caae70;border-radius:4px;background:#102f25;color:#f1dfb3;font:inherit;cursor:pointer;}
.character-refresh:focus-visible{outline:2px solid #f1dfb3;outline-offset:4px;}

/* Roster pagination uses unframed arrow icons. */
.journey .roster-pager button{border:0!important;background:transparent!important;box-shadow:none!important;border-radius:0!important;}
.journey .roster-pager button::before,.journey .roster-pager button::after{display:none!important;}
