#game-overlay[data-view="ranking"] .ranking-heroes{display:flex!important;flex-wrap:wrap!important;gap:8px!important;align-items:stretch!important}#game-overlay[data-view="ranking"] .ranking-heroes>[data-ranking="hero"]{display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:flex-start!important;gap:10px!important;min-width:112px!important;min-height:47px!important;height:auto!important;padding:7px 12px!important;line-height:1.3!important;position:relative!important}#game-overlay[data-view="ranking"] .ranking-heroes>[data-ranking="hero"]>img{position:static!important;display:block!important;flex:0 0 32px!important;width:32px!important;height:34px!important;max-width:32px!important;max-height:34px!important;margin:0!important;transform:none!important;object-fit:cover!important;border-radius:5px}#game-overlay[data-view="ranking"] .ranking-heroes>[data-ranking="hero"]>span{position:static!important;display:block!important;flex:1!important;min-width:0!important;margin:0!important;padding:0!important;transform:none!important;white-space:nowrap!important;text-align:left!important;font-size:13px!important;line-height:1.3!important}.character-card.character-locked .character-actions{display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:8px!important}.character-card.character-locked .character-actions>small{font-size:10px;line-height:1.5;text-align:center;color:#9dc4d3}.character-shop-link{font-size:11px!important;line-height:1.3!important;padding:7px 10px!important;white-space:nowrap!important;border-color:#5898a8!important;background:linear-gradient(#215468,#133447)!important}#game-overlay .combat-skill-options>.combat-skill-option.in-use,#game-overlay .combat-skill-more .combat-skill-option.in-use{background:linear-gradient(120deg,#205a48,#123a34)!important;border:1px solid #71c99a!important;box-shadow:inset 4px 0 #69d79e,0 0 12px #4ecb8722!important;opacity:1!important}#game-overlay .combat-skill-option.in-use:hover{background:linear-gradient(120deg,#286c55,#174b40)!important}#game-overlay .combat-skill-option.in-use>span>b{color:#e9fff2!important}#game-overlay .combat-skill-option.in-use>span>small:first-of-type{display:inline-block!important;align-self:flex-start;color:#a7f6c7!important;font-weight:700;font-size:10px;letter-spacing:.45px}#game-overlay .combat-skill-option.in-use .skill-damage-line{color:#b4f2d0!important}@media(max-width:650px){#game-overlay[data-view="ranking"] .ranking-heroes>[data-ranking="hero"]{min-width:98px!important;padding:6px 9px!important;gap:7px!important}}body :is(#game-overlay [data-ui="close"], #game-overlay #overlay-close, #modal > #close, #modal [data-loot-close], dialog .dialog-close, .gc-red-close) {
  color: #fff2f3 !important;
  background: linear-gradient(#a4424b, #681f2e) !important;
  border-color: #d5737d !important;
  box-shadow: inset 0 1px #ffc1c633 !important;
}
body :is(#game-overlay [data-ui="close"], #game-overlay #overlay-close, #modal > #close, #modal [data-loot-close], dialog .dialog-close, .gc-red-close):hover {
  background: linear-gradient(#bd535d, #812a3a) !important;
}

.codex-piece.ready { position: relative; }
.codex-piece .codex-ready-mark {
  position: absolute;
  top: 2px;
  right: 2px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffd268;
  color: #302106;
  box-shadow: 0 0 5px #ffd26880;
  font: 800 11px/1 system-ui, sans-serif;
  pointer-events: none;
}

.inventory-v2-bag > .inventory-tabs { display:flex; flex-wrap:wrap; padding-right:75px; }
.inventory-v2-bag { position:relative; }
.inventory-bulk-bar:not(.selecting) { position:absolute; top:56px; right:10px; }
.inventory-mode-buttons { display:flex; gap:5px; }
.inventory-mode svg { width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.inventory-mode { display:grid; place-items:center; width:31px; height:29px; padding:5px!important; }
.inventory-mode.active { background:#285965!important; border-color:#7cdfdd!important; }
.inventory-bulk-bar.selecting { display:flex; flex-wrap:wrap; gap:7px; align-items:center; margin:6px 0 10px; padding:9px; background:#102f40; border:1px solid #426d80; border-radius:8px; }
.inventory-bulk-bar strong { font-size:12px; }
.inventory-bulk-bar button { font-size:11px; padding:5px 8px; }
.inventory-bulk-bar .rarity-selection { flex-basis:100%; display:flex; flex-wrap:wrap; gap:4px; }
.inventory-bulk-execute { display:flex; gap:7px; width:100%; }
.inventory-v2:not(.bulk-selecting) .inventory-check { display:none!important; }
.inventory-v2.bulk-selecting .owned-item-cell:has(input:checked) > .owned-item { border-color:#8ef2ce!important; box-shadow:inset 0 0 0 2px #52c9aa!important; }

.inventory-tab-toolbar { display:flex; flex-wrap:wrap; gap:7px; align-items:flex-start; margin-bottom:8px; }
.inventory-tab-toolbar > .inventory-tabs { flex:1; margin:0!important; min-width:0; }
.inventory-tab-toolbar .inventory-bulk-bar:not(.selecting) { position:static; }
.inventory-tab-toolbar .inventory-bulk-bar.selecting { flex-basis:100%; margin:0; }
.inventory-v2.bulk-selecting .inventory-check:has(input:disabled) { opacity:.3; }

/* Fit inventory controls to the bag width. */
body.arcane-layout #game-overlay .inventory-v2-bag {
 container:inventory-bag / inline-size;
}
body.arcane-layout #game-overlay .inventory-tab-toolbar {
 display:block!important;
 width:100%;
 min-width:0;
}
body.arcane-layout #game-overlay .inventory-tab-toolbar > .inventory-tabs {
 display:grid!important;
 grid-template-columns:repeat(4,minmax(0,1fr));
 gap:5px!important;
 width:100%!important;
 min-width:0!important;
 margin:0!important;
 padding:0!important;
 overflow:visible!important;
}
body.arcane-layout #game-overlay .inventory-tab-toolbar [data-ui="inventory-tab"] {
 width:100%!important;
 min-width:0!important;
 max-width:100%!important;
 height:28px!important;
 padding:4px!important;
 margin:0!important;
 white-space:nowrap!important;
 overflow:hidden!important;
 text-overflow:ellipsis;
 font-size:10px!important;
}
body.arcane-layout #game-overlay .inventory-pagination {
 display:flex!important;
 justify-content:center!important;
 align-items:center!important;
 flex-wrap:wrap;
 gap:8px!important;
}
body.arcane-layout #game-overlay .inventory-pagination .inventory-bulk-bar {
 position:static!important;
 flex:0 0 auto;
 margin:0 0 0 6px!important;
}
body.arcane-layout #game-overlay .inventory-bulk-bar.selecting {
 display:grid!important;
 grid-template-columns:1fr 1fr;
 gap:6px;
 padding:9px!important;
 margin:8px 0 0!important;
 width:100%;
 flex:0 0 auto;
}
body.arcane-layout #game-overlay .inventory-bulk-bar.selecting > strong {
 grid-column:1 / -1;
 font-size:12px;
}
body.arcane-layout #game-overlay .inventory-bulk-bar.selecting .rarity-selection {
 display:grid!important;
 grid-template-columns:repeat(6,minmax(0,1fr));
 grid-column:1 / -1;
 gap:5px;
}
body.arcane-layout #game-overlay .inventory-bulk-bar.selecting .inventory-bulk-execute {
 grid-column:1 / -1;
 display:grid;
 grid-template-columns:1fr auto;
}
body.arcane-layout #game-overlay .inventory-bulk-bar.selecting button {
 min-width:0!important;
 padding:5px 7px!important;
 margin:0!important;
 font-size:11px!important;
 white-space:nowrap!important;
}
body.arcane-layout #game-overlay .inventory-bulk-bar.selecting {
 container: bulk-actions / inline-size;
 box-sizing: border-box;
}
body.arcane-layout #game-overlay .inventory-bulk-bar.selecting .rarity-selection > button {
 display: grid !important;
 place-items: center;
 padding-inline: 4px !important;
 color: var(--rarity) !important;
 border: 1px solid color-mix(in srgb, var(--rarity) 72%, #23394b) !important;
 background: linear-gradient(180deg, color-mix(in srgb, var(--rarity) 22%, #152c3d), #0c2030) !important;
}
body.arcane-layout #game-overlay .inventory-bulk-bar.selecting .rarity-selection > button:is(:hover, :focus-visible) {
 border-color: var(--rarity) !important;
 background: linear-gradient(180deg, color-mix(in srgb, var(--rarity) 35%, #152c3d), #0c2030) !important;
}
@container bulk-actions (max-width: 460px) {
 body.arcane-layout #game-overlay .inventory-bulk-bar.selecting .rarity-selection { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@container bulk-actions (max-width: 220px) {
 body.arcane-layout #game-overlay .inventory-bulk-bar.selecting .rarity-selection { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container inventory-bag (max-width:300px) {
 body.arcane-layout #game-overlay .inventory-tab-toolbar > .inventory-tabs { grid-template-columns:repeat(3,minmax(0,1fr)); }
}

/* Pending codex registrations on character and rarity filters. */
.codex-filter-row [data-setcodex]{position:relative;overflow:visible!important}.codex-filter-pending{position:absolute;right:-4px;top:-5px;display:grid;place-items:center;width:15px;height:15px;border:1px solid #ffe7a0;border-radius:50%;background:linear-gradient(145deg,#e5b94a,#a66915);color:#102331;font:bold 11px/1 Arial,sans-serif;box-shadow:0 0 6px #e5b94a65;pointer-events:none;z-index:2}

.set-codex-entry:has(.codex-register-set){display:flex;flex-direction:column}.codex-register-set{margin-top:auto!important;width:100%;min-height:25px;padding:4px 7px!important;font-size:10px!important;flex-shrink:0;background:linear-gradient(180deg,#205354,#123b40)!important;border-color:#58a59c!important;color:#d9f9e9!important}.set-codex-entry:has(.codex-register-set) .codex-piece-grid{flex:1;min-height:50px}

.codex-stat-filter{display:flex;flex-wrap:wrap;align-items:center;gap:5px;padding:6px 0 9px}.codex-stat-filter>small{font-size:10px;color:#a5c9d5;margin-right:4px}.codex-stat-filter>button{font-size:10px!important;padding:4px 9px!important;min-height:25px}.codex-stat-filter>button.active{background:linear-gradient(180deg,#197f87,#104953)!important;box-shadow:inset 0 0 8px #36dae845,0 0 5px #30ccdc35}

body.arcane-layout #arcane-shell #game-overlay[data-view=codex] #overlay-body .codex-piece-grid{grid-auto-rows:65px!important;height:135px!important;min-height:135px!important;max-height:135px!important;overflow-y:auto!important;overflow-x:hidden!important}.codex-piece-actions{display:flex;flex-direction:column;gap:2px;width:40px;min-width:40px;height:65px}body.arcane-layout #arcane-shell #game-overlay[data-view=codex] #overlay-body .codex-piece-actions>.codex-piece{width:40px!important;min-width:40px!important;max-width:40px!important;height:46px!important;min-height:46px!important;max-height:46px!important;padding:2px 2px 11px!important}.codex-piece-actions>.codex-piece img{width:34px!important;height:32px!important;max-width:34px!important;max-height:32px!important}.codex-piece-actions>.codex-piece small{font-size:6px!important;line-height:10px!important}.codex-market-piece{width:40px!important;min-width:0!important;height:16px!important;min-height:16px!important;padding:0!important;font-size:8px!important;line-height:14px!important;border-radius:4px!important;color:#bfe5ee!important;background:linear-gradient(#234c60,#102f40)!important;border:1px solid #5e8d9f!important}.codex-market-piece:hover{color:#fff!important;border-color:#63e2ed!important;box-shadow:0 0 5px #39d6e766!important}


/* Keep rarity and bulk-selection colors distinct from item inspection. */
body.arcane-layout #arcane-shell #game-overlay[data-view="inventory"] .inventory-v2:not(.bulk-selecting)
 :is(.owned-item,.paper-slot).selected {
 background: var(--active-filter-surface, #303640) !important;
 border-color: var(--rarity, #8db5ca) !important;
 outline: 1px solid #d9eff9;
 outline-offset: -3px;
 box-shadow: none !important;
}


body.arcane-layout #arcane-shell #game-overlay[data-view=inventory] .inventory-v2 .owned-items-grid {
 grid-template-columns: repeat(auto-fill,minmax(48px,1fr)) !important;
 grid-auto-rows: 52px !important;
 gap: 5px !important;
 min-height: 52px !important;
 max-height: none !important;
 flex: 1 1 0 !important;
 overflow: hidden !important;
}
body.arcane-layout #arcane-shell #game-overlay[data-view=inventory] .owned-items-grid
 :is(.owned-item-cell,.owned-item,.inventory-empty-slot) {
 min-height: 0 !important;
 height: 100% !important;
 aspect-ratio: auto !important;
}
@media (max-width: 900px) {
 body.arcane-layout #arcane-shell #game-overlay[data-view=inventory] .inventory-v2 .owned-items-grid {
  flex: 0 0 clamp(166px,38vh,394px) !important;
 }
}

/* Account name projected above the active fighter. */
.battle-nickname {
 position:absolute;
 z-index:3;
 transform:translate(-50%,-100%);
 pointer-events:none;
 box-sizing:border-box;
 max-width:min(190px,45%);
 overflow:hidden;
 text-overflow:ellipsis;
 white-space:nowrap;
 padding:3px 12px 4px;
 border:1px solid #b78c51;
 border-radius:12px 12px 9px 9px;
 background:linear-gradient(180deg,#20394b,#0a1725 75%);
 box-shadow:0 2px 9px #07101dcc,inset 0 1px 0 #f9d59b44,0 0 8px #e0ab5b55;
 color:#ffe6b1;
 font:bold clamp(11px,1.15vw,14px)/1.2 Georgia,serif;
 letter-spacing:.035em;
 text-shadow:0 1px 2px #000,0 0 5px #e9ba6b55;
}

#arcane-header-tools > .arcane-settings-button {
 display:grid;
 place-items:center;
 flex:0 0 36px;
 width:36px;
 height:36px;
 padding:5px;
 color:#d0ecff;
 border:1px solid #507389;
 border-radius:8px;
 background:linear-gradient(#203c50,#102536);
}
#arcane-header-tools > .arcane-settings-button:hover {border-color:#82d9ef;}
#arcane-header-tools > .arcane-settings-button img {width:22px;height:22px;}
.settings-redesign {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr));gap:14px;align-items:start;}
.settings-redesign .settings-audio-note {padding:10px 12px;border:1px solid #426879;border-radius:8px;background:#10293a;color:#bddce9;}
.settings-redesign form {display:grid;gap:10px;}
.settings-redesign input[type=range] {accent-color:#67d7e7;}


body.arcane-layout #live-stats > h3 {padding-right:38px;margin:0 0 10px;}
body.arcane-layout #live-stats > .journey-stats-close {
 position:absolute!important;inset:9px 9px auto auto!important;
 width:28px;height:28px;padding:4px;
}
body.arcane-layout #live-stats > .journey-stats-close svg {display:block;width:100%;height:100%;}
