/* v84 extends the existing Trono artwork; no battle or card selectors. */
body.frames84 .t84-framed {position:relative;isolation:isolate}
body.frames84 .t84-framed > .t83-frame {inset:0!important;border-width:24px!important;z-index:3}

/* The shell never scrolls. Its inner viewport stays clear of all four edges. */
body.frames84 #char-profile-modal .cpm-panel.t84-shell,
body.frames84 dialog.c43-dialog.t84-shell {
  box-sizing:border-box;overflow:hidden!important;padding:18px!important;
  max-height:calc(100dvh - 24px)!important;
  border:1px solid #755238!important;border-radius:4px!important;
  background:radial-gradient(ellipse at 0 0,#4c242d66,transparent 65%),#0e0d12!important;
  box-shadow:0 24px 90px #000c!important;
}
body.frames84 #char-profile-modal .cpm-panel.t84-shell,
body.frames84 dialog.c43-dialog.t84-shell[open] {display:flex;flex-direction:column}
body.frames84 .t84-shell > .t83-frame {border-width:35px!important}
body.frames84 .t84-scroll {
  position:relative;flex:0 1 auto;min-height:0;min-width:0;
  overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;
  scrollbar-width:thin;scrollbar-color:#8d7046 #141116;
  padding:10px 14px 18px;scroll-padding:12px;
}
body.frames84 .t84-scroll:focus-visible {outline:1px solid #d6af72;outline-offset:-2px}
body.frames84 #char-profile-modal .aden-character-heading {
  position:relative;flex:0 0 auto;margin:0;padding:8px 110px 12px 14px;
  border-bottom:1px solid #88644040;min-height:68px;box-sizing:border-box;
}
body.frames84 #char-profile-modal .aden-character-heading small {font-size:9px;letter-spacing:2px}
body.frames84 #char-profile-modal .aden-character-heading h2 {font:28px/1.15 Georgia,serif;margin:7px 0 0}
body.frames84 #char-profile-modal .cpm-panel > .cpm-close {top:26px!important;right:26px!important;z-index:5}
body.frames84 #char-profile-modal .aden-character-heading > .a82-launch {position:absolute!important;top:8px!important;right:60px!important;width:44px!important;height:44px!important;z-index:5}
body.frames84 #char-profile-modal .cpm-nav-btn {min-width:0}

/* A reserved toolbar keeps sound and close above the territory artwork. */
body.frames84 dialog.c43-dialog.t84-shell {position:fixed;width:min(620px,calc(100vw - 24px));padding-top:74px!important}
body.frames84 .c43-dialog > .a82-dialog-tools {position:absolute!important;inset:24px 24px auto auto!important;display:flex;min-height:44px;margin:0!important;z-index:5}
body.frames84 .c43-dialog.t84-has-close > .a82-dialog-tools {right:78px!important}
body.frames84 .c43-dialog > .c43-close {position:absolute;top:24px;right:24px;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;border-radius:3px;border:1px solid #80603d;background:linear-gradient(#322027,#141116);z-index:5}
body.frames84 .c43-dialog .a82-launch {width:44px!important;height:44px!important;min-height:44px!important;border-radius:3px}
body.frames84 .c43-dialog > .t84-scroll {padding:0 10px 12px;max-width:100%}
body.frames84 .c43-detail-art {margin:0;padding:32px 22px 22px;min-height:210px;border-radius:2px}
body.frames84 .c43-detail-art::after {background:linear-gradient(0deg,#110e13,transparent 90%)}
body.frames84 .c43-detail-art h2 {font-size:clamp(28px,5vw,38px)}
body.frames84 .c43-detail-body {padding:20px 8px 0}
body.frames84 .c43-encounters li {border-color:#75523966;background:linear-gradient(120deg,#2a1b23,#141217);border-radius:3px;padding:13px 12px}
body.frames84 .c43-encounters .next {border-color:#c29559;background:linear-gradient(100deg,#582731,#24131b);box-shadow:inset 3px 0 #d5af6b}
body.frames84 .c43-encounters .done {opacity:1;color:#b1a999}
body.frames84 .c43-encounters small {color:#b7ab98}
body.frames84 .c43-reward {padding:23px;border:0;border-radius:2px;background:linear-gradient(130deg,#3c222d,#141116)}
body.frames84 .c43-dialog .c43-primary {color:#fff0d5!important;background:linear-gradient(#8c303e,#431922)!important;border-color:#be9062!important}
body.frames84 .c43-dialog .c43-secondary {background:#22151d!important}

/* Chapters and destination cards retain their original states and actions. */
body.frames84 .c43-hero {border:0;border-radius:3px;background:#1d1118}
body.frames84 .c43-hero > .t83-frame,body.frames84 .power-hero > .t83-frame {border-width:34px!important}
body.frames84 .c43-route {border:0;border-radius:2px;background:linear-gradient(140deg,#32202ae8,#100e13f5);padding:26px}
body.frames84 .c43-chapter > header {padding:20px 24px;border-radius:3px;background:linear-gradient(110deg,#36212b,#121116);margin-bottom:18px}
body.frames84 .c43-territory {border:0;border-radius:3px;background:linear-gradient(#22151e,#110e14);box-shadow:0 10px 30px #0005}
body.frames84 .c43-territory.current {box-shadow:0 0 22px #b27b342b}
body.frames84 .c43-picture::after {background:linear-gradient(0deg,#20141d,transparent 65%,#08090e40)}
body.frames84 .c43-state {top:18px;right:18px}
body.frames84 .c43-number {top:18px;left:18px}
body.frames84 .c43-card-copy {padding:0 20px 24px}
body.frames84 .c43-territory.locked > .t83-frame {filter:saturate(.45) brightness(.8)}
body.frames84 .c43-territory.conquered .c43-state {background:#15211dda;color:#cee2b7}
body.frames84 .power-hero {border:0;border-radius:3px;padding:34px;background:linear-gradient(100deg,#281521f0,#110e14c9),url('../img/aden/castle-board.png') center/cover}
body.frames84 .power-region {padding:28px;border:0;border-radius:3px;gap:14px;background:linear-gradient(180deg,#2b172191,#140f16f5 58%),var(--power-art,linear-gradient(135deg,#3a2430,#130f16)) center/cover;box-shadow:0 12px 32px #0006}
body.frames84 .power-region-top {gap:8px;color:#e0c799;line-height:1.6;flex-wrap:wrap}
body.frames84 .power-region-top > span:first-child {color:#e8c781}
body.frames84 .power-region h3 {font-size:29px;color:#f0d6a6}
body.frames84 .power-region > p {color:#c8bcad}
body.frames84 .power-facts span {background:#150f18bc;border-color:#77583d80;border-radius:3px;color:#d1c0a5}
body.frames84 .power-loot {border-color:#97704655}
body.frames84 .power-region .btn,body.frames84 .power-hero .btn {min-height:44px;white-space:normal;border:1px solid #9f764c;background:linear-gradient(#31202a,#161017);border-radius:3px;color:#e9d4ae}
body.frames84 .power-region .btn.primary {background:linear-gradient(#8c303e,#441923);border-color:#bb8b5d;color:#fff0d5}
body.frames84 .power-region.is-locked > .t83-frame {filter:saturate(.4) brightness(.75)}
body.frames84 .power-region.is-locked {background:linear-gradient(180deg,#17141bcc,#100e13f7 60%),var(--power-art,linear-gradient(#302631,#141017)) center/cover}
body.frames84 .power-region.is-locked .power-region-top > span:first-child {color:#b3a69c}
body.frames84 .power-help {border-radius:3px;border-color:#76553666;background:linear-gradient(100deg,#281a23,#121116)}

/* Compact back rail: content width, no full-width strip or surplus padding. */
body.frames84 .pve-screen-header.t84-compact-rail {
  display:flex;align-self:center;align-items:center;flex-wrap:nowrap!important;
  width:max-content;max-width:calc(100% - 24px);min-height:0!important;
  box-sizing:border-box;margin:8px 12px 4px;padding:4px 8px!important;gap:8px;
  border:0!important;border-radius:3px;background:linear-gradient(100deg,#31202a,#151117)!important;
}
body.frames84 .t84-compact-rail > .t83-frame {border-width:15px!important}
body.frames84 .t84-compact-rail .pve-screen-title {flex:0 1 auto;font:17px/1.2 Georgia,serif!important;letter-spacing:0!important;min-width:0;margin-right:5px}
body.frames84 .t84-compact-rail .pve-screen-info {font-size:10px;letter-spacing:.5px;color:#bca788;white-space:nowrap;margin:0 4px}
body.frames84 .t84-compact-rail .pve-screen-info {flex:0 1 auto}
body.frames84 .t84-compact-rail .pve-back-btn {gap:6px;padding:0 10px!important;min-width:44px;min-height:44px;border:0!important;background:transparent!important;font-size:13px!important}
body.frames84 .t84-compact-rail .pve-edit-deck {min-height:44px;padding:0 10px!important;font-size:12px!important;background:#140e1680!important;border-color:#8d663940!important}
body.frames84 .t84-compact-rail .a82-launch {width:44px!important;height:44px!important;min-height:44px!important;flex:0 0 44px;padding:10px!important}

@media(max-width:640px) {
  body.frames84 #char-profile-modal .cpm-panel.t84-shell {width:calc(100vw - 16px)!important;max-height:calc(100dvh - 16px)!important;padding:12px!important}
  body.frames84 .t84-shell > .t83-frame {border-width:27px!important}
  body.frames84 #char-profile-modal .aden-character-heading {padding:10px 102px 12px 10px;min-height:76px}
  body.frames84 #char-profile-modal .aden-character-heading small {font-size:8px;letter-spacing:1px}
  body.frames84 #char-profile-modal .aden-character-heading h2 {font-size:24px}
  body.frames84 #char-profile-modal .cpm-panel > .cpm-close {top:24px!important;right:20px!important}
  body.frames84 #char-profile-modal .aden-character-heading > .a82-launch {top:12px!important;right:58px!important}
  body.frames84 .t84-scroll {padding:14px 10px 18px}
  body.frames84 #char-profile-modal .cpm-nav-btns {grid-template-columns:1fr!important}
  body.frames84 #char-profile-modal .cpm-nav-btn {min-height:72px!important}
  body.frames84 dialog.c43-dialog.t84-shell {padding:12px!important;padding-top:70px!important;width:calc(100vw - 16px);max-height:calc(100dvh - 16px)!important}
  body.frames84 .c43-dialog > .a82-dialog-tools {top:20px!important;right:20px!important}
  body.frames84 .c43-dialog.t84-has-close > .a82-dialog-tools {right:72px!important}
  body.frames84 .c43-dialog > .c43-close {top:20px;right:20px}
  body.frames84 .c43-dialog > .t84-scroll {padding:0 8px 12px}
  body.frames84 .c43-detail-art {padding:28px 16px 20px;min-height:190px}
  body.frames84 .c43-detail-body {padding:16px 4px 0}
  body.frames84 .c43-encounters li {padding:12px 10px}
  body.frames84 .c43-reward {padding:22px 18px}
  body.frames84 .c43-chapter > header {padding:20px;gap:10px}
  body.frames84 .c43-chapter-progress {margin:0 0 0 52px}
  body.frames84 .c43-card-copy {padding:0 15px 20px}
  body.frames84 .c43-territory > .t83-frame {border-width:20px!important}
  body.frames84 .c43-state {top:36px;right:12px}
  body.frames84 .c43-number {top:14px;left:14px}
  body.frames84 .power-hero {padding:26px 23px}
  body.frames84 .power-region {padding:25px 23px}
  body.frames84 .power-region h3 {font-size:27px}
  body.frames84 .power-heading h2 {font-size:26px}
  body.frames84 .pve-screen-header.t84-compact-rail {max-width:calc(100% - 16px);margin:6px 8px 2px;padding:3px 6px!important;gap:4px}
  body.frames84 .t84-compact-rail .t84-back-label {display:none}
  body.frames84 .t84-compact-rail .pve-back-btn {padding:0!important;font-size:19px!important;flex:0 0 44px}
  body.frames84 .t84-compact-rail .pve-screen-title {font-size:14px!important;line-height:1.2;margin-right:2px}
  body.frames84 .t84-compact-rail .pve-edit-deck {font-size:10px!important;padding:0 6px!important}
  body.frames84 .t84-compact-rail .pve-screen-info {font-size:9px;white-space:normal;max-width:70px;line-height:1.3}
}

/* Landscape phones and short windows need the whole height for the map. */
@media(max-height:600px) {
  body.frames84 :is(#pve-screen-historia,#pve-screen-raid,#pve-screen-aventura) {top:0!important;z-index:160}
}
