/* v0.31: image frames and live lettering share one normal-flow layout. */
#game button{box-sizing:border-box;max-width:100%;font-size:16px;line-height:1.5;letter-spacing:0;white-space:normal;overflow-wrap:break-word;text-shadow:none}
#game button:where(:not(.ability):not(.attack):not(.talent-node):not(.inv-tile):not(.character-choice):not(.appearance-card):not([data-create-appearance]):not([data-portrait])){
 border:9px solid transparent!important;border-image:var(--button-frame-0,none) 45 fill / 9px!important;
 background:#132632!important;color:#fff0d0!important;min-height:44px;padding:6px 12px;box-shadow:none
}
#game button.primary{border-image-source:var(--button-frame-1)!important}
#game button:is([aria-current=page],[aria-pressed=true],.active,.selected){border-image-source:var(--button-frame-2)!important}
#game button:disabled{border-image-source:var(--button-frame-3)!important;color:#ddd5c6!important;opacity:1;filter:saturate(.25)}
#game button:not(.talent-node):not(.inv-tile) :is(b,strong,small,span){color:inherit!important;text-shadow:none}
#game button :is(b,strong){font-size:inherit;line-height:inherit;overflow-wrap:break-word;letter-spacing:0}
#game button small{font-size:13px!important;line-height:1.5!important;font-weight:400;letter-spacing:0}
#game :is(button,button *){min-width:0}
#game :is(.actions,.tabs,.mode-tabs,.map-tabs,.forge-tabs,.bag-tabs){flex-wrap:wrap;gap:8px}
#game :is(.actions,.tabs,.mode-tabs,.map-tabs,.forge-tabs,.bag-tabs)>button{flex:1 1 auto;min-width:min(104px,100%);height:auto;padding:7px 12px}
#game .icon-button,#game #itemClose,#game .skill-popup-close{width:44px;height:44px;min-height:44px;padding:0;font-size:22px;line-height:1;flex-shrink:0}
#game .welcome{color:#3e3024}
#game .welcome :is(p,small,span,.tip,.welcome-rules){color:#51412f!important;text-shadow:none}
#game .welcome p{font-size:16px;line-height:1.8}#game .welcome small{font-size:13px;line-height:1.6}
#game .welcome h2{color:#8c362b}#game .welcome .primary{min-height:54px;font-size:18px}
#game .lesson-hud,#game .lesson-hud :is(p,strong,small,span){color:#493825!important}
#game .lesson-hud button{color:#fff0d0!important}
/* The tracked task is a multiline action card, never a fixed-height icon button. */
#game #battleTracker{box-sizing:border-box;padding:10px;width:100%;min-width:0;overflow:auto;max-height:min(38dvh,330px);background:#14222bea;border:1px solid #a58a59}
#game #battleTrack{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;gap:5px;width:100%;height:auto!important;min-height:0;max-height:none;text-align:left;padding:6px 9px;overflow:visible}
#game #battleTrack>*{position:static!important;display:block!important;transform:none!important;width:auto!important;height:auto!important;max-height:none!important;margin:0;line-height:1.5;white-space:normal;overflow-wrap:anywhere}
#game #battleTrack>small{font-size:12px!important;color:#dccda9!important;font-weight:400}
#game #battleTrackTitle{font-size:15px!important;font-weight:600}
#game #battleTrackProgress{font-size:14px!important;font-weight:400}
#game .battle-side-progress{display:flex;flex-direction:column;gap:6px;margin-top:6px}
#game .battle-side-progress>button{display:block;height:auto;min-height:40px;width:100%;text-align:left;font-size:13px;padding:5px 9px;line-height:1.55}
#game #taskDetails{display:block;width:auto;min-width:102px;min-height:38px;margin:7px 0 0 auto;padding:3px 8px;font-size:13px;white-space:nowrap}
/* Icon, title and description remain distinct rows at every viewport width. */
#game .navigation{display:flex;align-items:stretch;gap:4px}
#game .navigation>button{display:flex;flex:1 1 0;flex-direction:column;justify-content:center;align-items:center;gap:3px;padding:3px 2px;min-width:0;min-height:66px;height:auto;font-size:14px;border-width:5px!important;border-image-width:5px!important}
#game .navigation>button>.painted-icon{position:static;width:34px;height:34px;flex:0 0 34px;margin:0}
#game .navigation>button>b{position:static;display:block;line-height:1.35;white-space:nowrap;font-size:14px;margin:0;transform:none}
#game .camp-menu{grid-template-columns:repeat(3,minmax(0,1fr));align-items:stretch}
#game .camp-menu>button{display:grid;grid-template-rows:48px auto 1fr;justify-items:center;align-content:start;align-items:start;gap:8px;height:auto;min-height:150px;padding:12px;text-align:center}
#game .camp-menu>button>.painted-icon{width:48px;height:48px;margin:0}
#game .camp-menu>button>b{display:block;width:100%;font-size:17px;line-height:1.5}
#game .camp-menu>button>small{display:block;width:100%;max-width:23em;font-size:13px!important;line-height:1.6!important}
#game .item,#game .bag-equipped-slot{display:flex;align-items:center;gap:12px;text-align:left;height:auto;min-height:80px}
#game :is(.item,.bag-equipped-slot)>div{flex:1;min-width:0}
#game :is(.item,.bag-equipped-slot) :is(strong,b,small){display:block;position:static;line-height:1.5;margin:0;white-space:normal;overflow-wrap:anywhere}
#game :is(.item,.bag-equipped-slot) :is(strong,b){font-size:15px!important}
#game :is(.item,.bag-equipped-slot) small{font-size:13px!important;margin-top:4px}
#game :is(.item,.bag-equipped-slot) .painted-icon{flex:0 0 44px;width:44px;height:44px}
#game .inv-tile{color:#372a20!important}#game .inv-tile :is(b,span,small){color:inherit!important}
#game .point-row button{min-width:36px;min-height:38px;padding:0;font-size:20px}
#game .chapter-strip button{height:auto;min-height:62px;white-space:normal}
#game .chapter-strip :is(b,small){display:block;line-height:1.5}
#game .option-switch{gap:16px}#game .option-switch>button{min-width:90px;height:auto}
#game .ability,#game .attack,#game .talent-node{background-color:transparent;border-image:none!important}
#game .ability b,#game .attack b{font-size:12px!important;line-height:1.3;color:#fff0d0!important;text-shadow:0 1px 3px #111!important}
#game .talent-node b{font-size:13px!important;line-height:1.4}
#game .live-battle-notice{display:none!important}
@media(max-width:600px){
 #game .camp-menu{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
 #game .camp-menu>button{padding:8px;min-height:160px}#game .camp-menu>button>b{font-size:16px}
 #game .navigation{gap:2px}#game .navigation>button{font-size:13px;min-height:62px}#game .navigation>button>b{font-size:13px}
 #game .navigation>button>.painted-icon{width:30px;height:30px;flex-basis:30px}
 #game .skill-side-nav button{padding:5px 2px;font-size:13px!important;min-height:44px}
 #game .skill-workspace-foot button{padding:6px!important;font-size:13px;min-width:60px}
 #game #battleTracker{padding:7px;max-height:29dvh}#game #battleTrackTitle{font-size:14px!important}#game #battleTrackProgress{font-size:13px!important}
 #game :is(.actions,.tabs,.mode-tabs,.map-tabs)>button{min-width:86px;font-size:14px}
}
@media(orientation:landscape) and (max-height:600px){
 #game #battleTracker{max-height:calc(100dvh - 190px);padding:6px}
 #game .navigation>button{min-height:48px;padding:2px;font-size:13px}#game .navigation>button>.painted-icon{width:24px;height:24px;flex-basis:24px}#game .navigation>button>b{font-size:12px}
 #game #battleTrack{gap:3px;padding:4px 6px}#game #battleTrackTitle{font-size:13px!important}#game #battleTrackProgress{font-size:12px!important}
 #game .skill-detail-tabs button{font-size:14px;padding:4px}#game .skill-side-nav button{min-height:38px}
}

#game .bag-equipped-slot>span{flex:0 0 46px;width:46px;height:54px;display:grid;place-items:center}
#game .bag-equipped-slot>span .art-icon{max-width:44px;max-height:52px}
#game .mode-tabs{display:flex;gap:8px;flex-wrap:wrap}
#game .mode-tabs button{flex:1 1 112px;min-width:100px;height:auto;min-height:46px;font-size:15px;line-height:1.5}
#game .navigation button>.painted-icon{display:block!important}
#game #battleTracker #battleTrack small{line-height:1.5}
@media(orientation:landscape) and (max-height:600px){#game #battleTracker #battleTrack>small{display:none!important}#game .navigation,#game.is-battle .navigation{height:auto;min-height:54px;padding:2px 4px}}

#game .topbar .coin,#game .topbar .coin b{color:#ffe2a6!important;text-shadow:0 1px 3px #071017}
#game .hero-hud .xp-row span,#game .location :is(h1,span){color:#fff0d0!important;text-shadow:0 1px 4px #071017}
#game .boss-hud :is(strong,span){color:#fff0d0!important;text-shadow:0 1px 4px #071017}
#game .event-feed .feed-item{color:#fff0d0!important;text-shadow:0 1px 4px #071017}
/* v32: existing journal and workshop use one expanded subject at a time. */
.story-journal details,.workshop-patterns details,.homecomings details{margin:.65rem 0;border-bottom:1px solid #9d785a;padding:.65rem .25rem;min-width:0;color:#38251b;}
.story-journal summary,.workshop-patterns summary,.homecomings summary{cursor:pointer;font-size:1rem;line-height:1.65;font-weight:700;overflow-wrap:anywhere;min-height:44px;}
.story-journal details p,.workshop-patterns details p,.homecomings details p{font-size:1rem;line-height:1.75;color:#493124;overflow-wrap:anywhere;}
.workshop-patterns .actions{display:flex;flex-wrap:wrap;gap:.5rem;}
.workshop-patterns .actions button{flex:1 1 7rem;min-width:0;white-space:normal;}
.story-journal .bag-tabs{display:flex;flex-wrap:wrap;gap:.35rem;}
.story-journal .bag-tabs button{flex:1 1 7rem;white-space:normal;min-width:0;}
