:root{
  --bg:#0b0d10;
  --panel:rgba(34,37,43,.92);
  --panel-2:rgba(22,24,29,.97);
  --border:rgba(148,163,184,.16);
  --text:#eef2ff;
  --muted:#94a3b8;
  --gold:#f4c56a;
  --red:#ef4444;
  --green:#22c55e;
  --blue:#60a5fa;
  --shadow:0 22px 60px rgba(0,0,0,.36);
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;background:radial-gradient(circle at top,#30343b 0,#0b0d10 44%,#07080a 100%);color:var(--text);font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
body{min-height:100vh;overflow-x:hidden}
button,input{font:inherit}
.ambient{position:fixed;border-radius:999px;filter:blur(90px);opacity:.16;pointer-events:none;z-index:0}
.ambient-a{width:420px;height:420px;background:#6b7280;left:-180px;top:80px}
.ambient-b{width:460px;height:460px;background:#374151;right:-200px;bottom:0}
.topbar{height:88px;padding:18px 28px;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--border);background:rgba(10,12,16,.78);backdrop-filter:blur(20px);position:sticky;top:0;z-index:10}
h1,h2{margin:0;font-family:Georgia,"Times New Roman",serif;letter-spacing:.01em}
h1{font-size:31px;font-weight:700}.eyebrow{font-size:10px;font-weight:800;letter-spacing:.19em;color:#d1d5db;margin-bottom:4px}.topbar-right{display:flex;gap:10px}.pill{padding:8px 12px;border:1px solid var(--border);background:rgba(255,255,255,.04);border-radius:999px;font-size:12px;color:#dbeafe}.status.online{color:#bbf7d0;border-color:rgba(34,197,94,.3)}.status.offline{color:#fecaca;border-color:rgba(239,68,68,.3)}
.pve-continue-button{min-height:34px;padding:7px 14px;border-radius:999px;border:1px solid rgba(244,197,106,.58);background:linear-gradient(180deg,rgba(244,197,106,.20),rgba(126,34,206,.18));color:#fff1bd;font-size:12px;font-weight:950;letter-spacing:.035em;cursor:pointer;box-shadow:0 0 20px rgba(244,197,106,.08);transition:transform .14s ease,border-color .14s ease,background .14s ease}.pve-continue-button:hover{transform:translateY(-1px);border-color:rgba(255,226,145,.88);background:linear-gradient(180deg,rgba(244,197,106,.29),rgba(126,34,206,.24))}.pve-continue-button:disabled{opacity:.58;cursor:wait;transform:none}.pve-continue-button.hidden{display:none!important}
.pve-retry-button{min-height:34px;padding:7px 14px;border-radius:999px;border:1px solid rgba(248,113,113,.62);background:linear-gradient(180deg,rgba(239,68,68,.19),rgba(126,34,206,.15));color:#fecaca;font-size:12px;font-weight:950;letter-spacing:.035em;cursor:pointer;box-shadow:0 0 20px rgba(248,113,113,.07);transition:transform .14s ease,border-color .14s ease,background .14s ease}.pve-retry-button:hover{transform:translateY(-1px);border-color:rgba(252,165,165,.92);background:linear-gradient(180deg,rgba(239,68,68,.29),rgba(126,34,206,.21))}.pve-retry-button:disabled{opacity:.58;cursor:wait;transform:none}.pve-retry-button.hidden{display:none!important}
.layout{position:relative;z-index:1;display:grid;grid-template-columns:minmax(235px,300px) minmax(460px,1fr) minmax(235px,300px);gap:18px;padding:20px;max-width:1680px;margin:0 auto}.team-column{min-width:0}.section-label{font-size:11px;font-weight:900;letter-spacing:.2em;color:#93c5fd;margin:4px 0 10px 4px}.section-label.enemy{color:#fca5a5}.team-stack{display:flex;flex-direction:column;gap:12px}.empty-state{font-size:13px;color:var(--muted);padding:20px;border:1px dashed var(--border);border-radius:16px;text-align:center}
.center-column{display:flex;flex-direction:column;gap:16px;min-width:0}.panel,.turn-card,.fighter-card{background:linear-gradient(180deg,rgba(44,47,54,.95),rgba(23,25,30,.98));border:1px solid var(--border);box-shadow:var(--shadow)}.panel{border-radius:20px;overflow:hidden}.panel-head{padding:18px 20px 10px;display:flex;justify-content:space-between;align-items:center}.panel-head.compact{padding-bottom:12px}.panel h2{font-size:22px}.prompt-body{padding:12px 20px 22px;min-height:112px}.turn-card{border-radius:18px;padding:14px 16px;display:flex;gap:12px;align-items:center}.turn-card.hidden{display:none}.turn-icon{width:46px;height:46px;border-radius:13px;display:grid;place-items:center;font-size:25px;background:rgba(255,255,255,.06);border:1px solid var(--border)}.turn-details{min-width:0}.turn-name{font-size:18px;font-weight:800}.turn-timer{margin-left:auto;flex:0 0 auto;min-width:68px;height:42px;padding:0 12px;border-radius:999px;display:flex;align-items:center;justify-content:center;gap:2px;font-weight:900;font-variant-numeric:tabular-nums;background:rgba(126,34,206,.32);border:1px solid rgba(192,132,252,.48);box-shadow:0 0 24px rgba(126,34,206,.14)}.turn-timer span{font-size:23px;line-height:1}.turn-timer small{font-size:11px;color:#d8b4fe}.turn-timer.warning{background:rgba(126,34,206,.5);border-color:rgba(216,180,254,.72)}.turn-timer.expired{opacity:.7}.muted{color:var(--muted);font-size:12px;margin-top:2px}
.fighter-card{border-radius:16px;padding:13px;position:relative;overflow:visible}.fighter-card::before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px;border-radius:16px 0 0 16px;background:var(--accent,#64748b)}.fighter-card.current{outline:1px solid var(--gold);box-shadow:0 0 0 2px rgba(244,197,106,.08),var(--shadow)}.fighter-card.dead{opacity:.52;filter:saturate(.5)}.fighter-card.stat-open{z-index:90;opacity:1;filter:none}.fighter-head{display:grid;grid-template-columns:38px minmax(0,1fr) auto;gap:9px;align-items:center}.fighter-icon{width:36px;height:36px;border-radius:11px;display:grid;place-items:center;background:rgba(255,255,255,.06);font-size:21px}.fighter-title{min-width:0;display:flex;flex-direction:column;align-items:flex-start}.fighter-name-line{display:flex;align-items:baseline;gap:7px;min-width:0;max-width:100%;width:100%}.fighter-name{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;max-width:100%;flex:1 1 auto}.fighter-name.name-long{font-size:12px}.fighter-name.name-very-long{font-size:11px}.fighter-name.name-extreme{font-size:10px}.fighter-meta-line{display:flex;align-items:baseline;gap:7px;min-width:0;max-width:100%;margin-top:1px}.fighter-class{font-size:10px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}.fighter-level{display:inline-block;flex:0 0 auto;color:#facc15;font-size:10px;font-weight:950;white-space:nowrap;text-shadow:0 0 8px rgba(250,204,21,.18)}.fighter-head-actions{display:flex;align-items:center;gap:5px}.mana-chip{font-size:11px;padding:5px 7px;border-radius:999px;background:rgba(59,130,246,.13);color:#bfdbfe;border:1px solid rgba(96,165,250,.2);white-space:nowrap}.fighter-stat-toggle{width:25px;height:25px;display:grid;place-items:center;padding:0;border-radius:7px;border:1px solid rgba(156,163,175,.28);background:linear-gradient(180deg,rgba(107,114,128,.15),rgba(55,65,81,.18));color:#b7bec9;font-size:12px;font-weight:950;line-height:1;cursor:pointer;transition:.14s border-color,.14s background,.14s color}.fighter-stat-toggle:hover,.fighter-stat-toggle[aria-expanded="true"]{border-color:rgba(209,213,219,.48);background:rgba(107,114,128,.26);color:#eef2f7}.anti-mana-chip{position:absolute;z-index:6;top:-9px;right:-9px;min-width:27px;height:27px;display:grid;place-items:center;padding:0 7px;border-radius:999px;background:linear-gradient(180deg,#581c87,#3b0764);color:#f3e8ff;border:1px solid #d8b4fe;font-size:11px;font-weight:950;box-shadow:0 5px 16px rgba(76,29,149,.58),0 0 0 2px rgba(15,12,20,.72);text-shadow:0 1px 4px #1e052e}.anti-mana-chip[hidden]{display:none!important}.bar{height:24px;margin-top:11px;border-radius:9px;background:#070a11;border:1px solid rgba(255,255,255,.06);overflow:hidden;position:relative}.bar-fill{height:100%;background:linear-gradient(90deg,#16a34a,#4ade80);transition:width .25s ease}.bar-text{position:absolute;inset:0;display:grid;place-items:center;font-size:10px;font-weight:800;text-shadow:0 1px 4px #000}.effects{display:flex;gap:5px;flex-wrap:wrap;margin-top:8px}.effect-chip{font-size:9px;padding:4px 6px;border-radius:7px;background:rgba(107,114,128,.16);border:1px solid rgba(156,163,175,.28);color:#e5e7eb}
.effect-chip.buff{background:rgba(34,197,94,.18);border-color:rgba(74,222,128,.42);color:#dcfce7}
.effect-chip.debuff{background:rgba(239,68,68,.18);border-color:rgba(248,113,113,.46);color:#fee2e2}
.effect-chip.neutral{background:rgba(107,114,128,.16);border-color:rgba(156,163,175,.28);color:#e5e7eb}
.summons{margin-top:8px;display:flex;flex-direction:column;gap:4px}.summon{font-size:10px;color:#cbd5e1;padding:7px;background:rgba(255,255,255,.035);border-radius:8px}.summon-summary{line-height:1.35}.summon-effects{margin-top:6px}
.action-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.action-card{position:relative;text-align:left;color:var(--text);background:linear-gradient(150deg,rgba(57,61,69,.90),rgba(28,31,37,.96));border:1px solid rgba(148,163,184,.18);border-radius:14px;padding:13px 13px 12px;cursor:pointer;min-height:92px;transition:.16s transform,.16s border-color,.16s background}.action-card:hover{transform:translateY(-2px);border-color:rgba(244,197,106,.5);background:linear-gradient(150deg,rgba(72,77,87,.96),rgba(35,38,45,.99))}.action-card.utility{min-height:58px}.action-cost{position:absolute;top:10px;right:10px;min-width:27px;height:27px;border-radius:999px;display:grid;place-items:center;background:#182b50;border:1px solid rgba(96,165,250,.25);font-size:11px;font-weight:900;color:#bfdbfe}.action-name{font-weight:800;font-size:13px;padding-right:34px}.action-desc{font-size:11px;color:#aab4c5;margin-top:5px;line-height:1.35}.choice-grid{display:flex;flex-wrap:wrap;gap:9px}.choice-button,.primary-button,.ghost-button{border-radius:11px;border:1px solid var(--border);cursor:pointer}.choice-button,.primary-button{background:linear-gradient(180deg,#4b5563,#374151);color:white;padding:10px 13px}.choice-button:hover,.primary-button:hover{border-color:rgba(244,197,106,.5)}.ghost-button{background:transparent;color:#94a3b8;padding:7px 10px}.input-row{display:flex;gap:10px}.input-row input{flex:1;background:#090d16;color:white;border:1px solid var(--border);border-radius:11px;padding:11px 12px;outline:none}.input-row input:focus{border-color:#9ca3af}.deck-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;max-height:480px;overflow:auto;padding-right:5px}.deck-row{display:grid;grid-template-columns:1fr 76px;gap:8px;align-items:center;background:rgba(255,255,255,.035);border:1px solid var(--border);padding:9px;border-radius:11px}.deck-row strong{font-size:11px;display:block}.deck-row small{font-size:10px;color:var(--muted)}.stepper{display:grid;grid-template-columns:25px 26px 25px;align-items:center;border:1px solid var(--border);border-radius:9px;overflow:hidden}.stepper button{border:0;background:#4b5563;color:white;height:29px;cursor:pointer}.stepper span{text-align:center;font-size:11px;font-weight:800}.deck-submit{margin-top:12px;width:100%}
.feed-panel{min-height:260px}.feed{height:330px;overflow:auto;padding:0 18px 18px;font-family:"Cascadia Code",Consolas,monospace;font-size:11px;line-height:1.55}.feed-line{color:#aab4c5;white-space:pre-wrap}.feed-line.major{color:#f8fafc;font-weight:700}.feed-line.death{color:#fca5a5}.feed-line.heal{color:#86efac}.feed-line.system{color:#d1d5db}
@media(max-width:1120px){.layout{grid-template-columns:220px minmax(420px,1fr) 220px}.action-grid,.deck-grid{grid-template-columns:1fr}}
@media(max-width:850px){.layout{grid-template-columns:1fr}.team-column{order:2}.center-column{order:1}.team-stack{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.feed{height:260px}}


/* v0.2 focused target selection */
.target-focus{display:flex;flex-direction:column;gap:12px}
.target-note{font-size:12px;color:var(--muted);padding:9px 11px;border:1px solid var(--border);background:rgba(255,255,255,.025);border-radius:10px}
.target-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.target-button{display:flex;align-items:center;gap:10px;text-align:left;color:var(--text);background:linear-gradient(150deg,rgba(61,65,74,.92),rgba(29,32,38,.97));border:1px solid rgba(248,113,113,.23);border-radius:13px;padding:13px;cursor:pointer;min-height:58px;transition:.16s transform,.16s border-color}
.target-button:hover{transform:translateY(-2px);border-color:rgba(248,113,113,.65)}
.target-crosshair{font-size:20px;color:#fca5a5;flex:0 0 auto}
.cancel-target{align-self:flex-start;padding:9px 13px;border-color:rgba(148,163,184,.24)}

/* v0.2 persistent running stat sheet */
.live-stats-wrap,.raw-log-wrap{position:relative;z-index:1;max-width:1680px;margin:0 auto;padding:0 20px 28px}
.live-stats-panel{border-radius:20px;overflow:hidden}
.stats-scroll{overflow-x:auto;padding:0 16px 8px}
.stats-table{width:100%;min-width:1320px;border-collapse:collapse;font-family:"Cascadia Code",Consolas,monospace;font-size:10px;font-variant-numeric:tabular-nums}
.stats-table th{position:sticky;top:0;background:#25282e;color:#d1d5db;text-align:right;font-size:9px;letter-spacing:.04em;padding:8px 7px;border-bottom:1px solid rgba(148,163,184,.22);white-space:nowrap}
.stats-table th:nth-child(1),.stats-table th:nth-child(2),.stats-table th:nth-child(3){text-align:left}
.stats-table td{text-align:right;padding:8px 7px;border-bottom:1px solid rgba(148,163,184,.09);color:#dbe4f3;white-space:nowrap}
.stats-table td:nth-child(1),.stats-table td:nth-child(2),.stats-table td:nth-child(3){text-align:left}
.stats-table tbody tr:hover{background:rgba(255,255,255,.025)}
.stats-table .stat-player{font-weight:800;color:#f8fafc}
.stats-table .stat-dead{opacity:.58}
.stats-empty{text-align:center!important;color:var(--muted)!important;padding:24px!important}
.team-totals{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:6px 16px 16px}
.team-total-card{display:flex;flex-wrap:wrap;gap:8px 15px;align-items:center;padding:10px 12px;border-radius:11px;border:1px solid var(--border);background:rgba(255,255,255,.025);font-size:10px;color:#cbd5e1}
.team-total-card strong{font-size:11px;margin-right:4px}.team-total-card.team-1 strong{color:#93c5fd}.team-total-card.team-2 strong{color:#fca5a5}
@media(max-width:850px){.target-grid{grid-template-columns:1fr}.live-stats-wrap,.raw-log-wrap{padding:0 12px 20px}.team-totals{grid-template-columns:1fr}}


/* v0.5 left-side battle activity log */
.activity-panel{
  margin-top:16px;
  border:1px solid var(--border);
  border-radius:16px;
  background:linear-gradient(180deg,rgba(44,47,54,.95),rgba(23,25,30,.98));
  box-shadow:var(--shadow);
  overflow:hidden;
}
.activity-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:13px 13px 6px;
}
.activity-head h3{
  font-size:14px;
  margin:2px 0 0;
}
.compact-button{
  padding:5px 8px;
  font-size:10px;
}
.activity-subtitle{
  padding:0 13px 9px;
  color:var(--muted);
  font-size:9px;
  line-height:1.4;
}
.activity-feed{
  max-height:none;
  min-height:120px;
  overflow-y:visible;
  padding:0 9px 10px;
  display:flex;
  flex-direction:column;
  gap:6px;
}
.activity-empty{
  color:var(--muted);
  font-size:10px;
  padding:14px 4px;
  text-align:center;
}
.activity-entry{
  border:1px solid rgba(148,163,184,.12);
  background:rgba(255,255,255,.025);
  border-radius:10px;
  padding:7px 8px;
  font-size:10px;
  line-height:1.35;
  color:#cbd5e1;
  word-break:break-word;
}
.activity-entry.card{border-left:3px solid #f4c56a;color:#f8fafc;font-weight:700}
.activity-entry.damage{border-left:3px solid #f87171}
.activity-entry.heal{border-left:3px solid #4ade80;color:#bbf7d0}
.activity-entry.cc{border-left:3px solid #c084fc;color:#e9d5ff}
.activity-entry.effect{border-left:3px solid #60a5fa}
.activity-entry.death{border-left:3px solid #ef4444;color:#fecaca;font-weight:700}
.activity-entry.revive{border-left:3px solid #facc15;color:#fef08a;font-weight:700}
.activity-entry.summon{border-left:3px solid #94a3b8}
.activity-entry.crit{border-left:3px solid #facc15;color:#fde68a;font-weight:900}
.activity-hp{
  display:inline-block;
  margin-left:3px;
  font-weight:900;
  color:#f8fafc;
}
.activity-delta.damage-delta{color:#fca5a5;font-weight:800}
.activity-delta.heal-delta{color:#86efac;font-weight:800}

/* Raw Python log can be collapsed without destroying it. */
.feed-controls{display:flex;gap:7px;align-items:center}
.feed-panel.raw-collapsed{min-height:0}
.feed-panel.raw-collapsed .feed{display:none}
.feed-panel.raw-collapsed .panel-head{padding-bottom:14px}

/* Battle Activity is capped at 14 entries in JS, so let the panel grow naturally
   instead of adding an internal scrollbar. */
@media(max-width:850px){
  .activity-panel{margin-top:12px}
}

/* v0.20.6 target-selection cleanup */
.target-button.selected{background:linear-gradient(150deg,rgba(91,65,31,.94),rgba(42,31,29,.98));box-shadow:0 0 0 2px rgba(244,197,106,.34) inset;transform:translateY(-1px)}
.target-order{width:24px;height:24px;border-radius:999px;display:grid;place-items:center;font-size:11px;font-weight:900;background:rgba(244,197,106,.12);color:#f4c56a;flex:0 0 auto}
.target-button:not(.selected) .target-order{background:rgba(255,255,255,.035)}
.target-name{font-weight:800}
.target-controls{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.target-controls .primary-button:disabled{opacity:.45;cursor:not-allowed}
.number-choice-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(64px,1fr));gap:10px}
.number-choice-button{min-height:58px;border-radius:13px;border:1px solid var(--border);background:linear-gradient(150deg,rgba(57,61,69,.90),rgba(28,31,37,.96));color:var(--text);font-weight:900;font-size:18px;cursor:pointer}
.number-choice-button:hover{border-color:rgba(244,197,106,.55);transform:translateY(-1px)}

/* v0.21.4 match-feedback cleanup */
#promptPanel .panel-head.target-only-head{display:flex;padding-bottom:8px}
.target-grid-only{margin:0}
.action-card.action-disabled,.action-card:disabled{cursor:not-allowed;opacity:.72;border-color:rgba(248,113,113,.38);background:linear-gradient(150deg,rgba(70,45,48,.78),rgba(38,31,33,.92));transform:none}
.action-card.action-disabled:hover,.action-card:disabled:hover{transform:none;border-color:rgba(248,113,113,.48)}
.action-card.action-disabled .action-name,.action-card:disabled .action-name{color:#fecaca}
.action-card.action-disabled .action-desc,.action-card:disabled .action-desc{color:#c99b9f}
.disabled-reason{margin-top:8px;font-size:9px;font-weight:900;letter-spacing:.08em;color:#fca5a5}
.action-card.form-fixed{min-height:72px}
.action-grid:has(.form-fixed){grid-template-columns:repeat(2,minmax(0,1fr))}

/* v0.21.7 targeting mode: keep Current Turn, then show TARGETS + castable + valid targets + Back. */
body.target-selection-active .center-column > .feed-panel{display:none!important}
body.target-selection-active #turnCard{display:flex!important}
body.target-selection-active #promptPanel{min-height:0}
body.target-selection-active #promptPanel .prompt-body{padding-top:12px}
.target-castable{margin:0 0 14px;padding:10px 12px;border-radius:10px;border:1px solid rgba(148,163,184,.20);background:rgba(255,255,255,.025);font-size:13px;font-weight:850;color:#e5e7eb}
.target-button.target-enemy{border-color:rgba(248,113,113,.72)}
.target-button.target-enemy:hover{border-color:rgba(248,113,113,.98)}
.target-button.target-enemy .target-crosshair{color:#fca5a5}
.target-button.target-friendly{border-color:rgba(74,222,128,.68)}
.target-button.target-friendly:hover{border-color:rgba(74,222,128,.96)}
.target-button.target-friendly .target-crosshair{color:#86efac}
.target-button.target-neutral{border-color:rgba(148,163,184,.38)}
.target-back-button{margin-top:12px;width:100%;min-height:44px;font-weight:800}

/* v0.21.13 multi-action / multi-basic progress */
.sequence-progress{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  align-self:flex-start;
  margin:0 0 12px;
  padding:7px 11px;
  border-radius:999px;
  border:1px solid rgba(250,204,21,.52);
  background:rgba(250,204,21,.09);
  color:#fde047;
  font-size:12px;
  font-weight:950;
  letter-spacing:.08em;
  text-transform:uppercase;
  box-shadow:0 0 0 1px rgba(250,204,21,.05) inset;
}

/* v0.21.40 per-fighter combat stat dropdown */
.fighter-stat-popover{position:absolute;z-index:95;top:calc(100% + 7px);left:7px;width:min(338px,calc(100vw - 32px));border:1px solid rgba(244,197,106,.42);border-radius:14px;background:radial-gradient(circle at 50% -15%,rgba(146,107,46,.18),transparent 44%),linear-gradient(180deg,rgba(31,29,28,.995),rgba(12,14,18,.998));box-shadow:0 24px 62px rgba(0,0,0,.70),inset 0 0 0 1px rgba(255,255,255,.035);backdrop-filter:blur(16px);overflow:hidden}.fighter-stat-popover[hidden]{display:none!important}.fighter-card.right-team .fighter-stat-popover{left:auto;right:7px}.fighter-stat-popover::before{content:"";position:absolute;top:-6px;right:16px;width:10px;height:10px;transform:rotate(45deg);background:#211f1e;border-left:1px solid rgba(244,197,106,.42);border-top:1px solid rgba(244,197,106,.42)}.fighter-stat-sheet{position:relative}.fighter-stat-sheet::after{content:"";pointer-events:none;position:absolute;inset:5px;border:1px solid rgba(244,197,106,.06);border-radius:10px}.fighter-stat-sheet-head{display:flex;justify-content:space-between;align-items:flex-start;gap:10px;padding:12px 13px 9px;border-bottom:1px solid rgba(244,197,106,.15);background:linear-gradient(90deg,rgba(244,197,106,.055),transparent 72%)}.fighter-stat-kicker{font-size:7px;font-weight:950;letter-spacing:.17em;color:#c9ad68}.fighter-stat-name-line{display:flex;align-items:baseline;gap:7px;min-width:0;margin-top:2px}.fighter-stat-name-line strong{min-width:0;max-width:225px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:Georgia,"Times New Roman",serif;color:#fff4d6;font-size:15px}.fighter-stat-name-line span{flex:0 0 auto;color:#facc15;font-size:9px;font-weight:950}.fighter-stat-class{margin-top:2px;color:#a8b2c3;font-size:9px}.fighter-stat-glyph{color:#d6b96f;font-size:18px;text-shadow:0 0 12px rgba(244,197,106,.28)}.fighter-stat-resources{display:flex;gap:5px;flex-wrap:wrap;padding:8px 10px 0}.sheet-resource{font-size:8.5px;font-weight:850;padding:4px 6px;border-radius:999px;border:1px solid rgba(148,163,184,.18);background:rgba(255,255,255,.035);white-space:nowrap}.sheet-resource.hp{color:#bbf7d0;border-color:rgba(74,222,128,.25)}.sheet-resource.mana{color:#bfdbfe;border-color:rgba(96,165,250,.25)}.sheet-resource.anti{color:#e9d5ff;border-color:rgba(216,180,254,.46);background:rgba(88,28,135,.26)}.combat-stat-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;padding:9px 10px 11px}.combat-stat-tile{min-width:0;padding:7px 7px 6px;border-radius:9px;background:linear-gradient(180deg,rgba(9,11,15,.70),rgba(18,20,25,.80));border:1px solid color-mix(in srgb,currentColor 24%,transparent);box-shadow:inset 0 1px rgba(255,255,255,.02)}.combat-stat-tile span{display:block;font-size:7px;font-weight:900;letter-spacing:.05em;color:currentColor;opacity:.82;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.combat-stat-tile strong{display:block;margin-top:2px;font-family:Georgia,"Times New Roman",serif;font-size:14px;line-height:1;color:currentColor;font-variant-numeric:tabular-nums}.stat-health{color:#86efac}.stat-base{color:#fb923c}.stat-pd{color:#f87171}.stat-pr{color:#60a5fa}.stat-md{color:#c084fc}.stat-mr{color:#38bdf8}.stat-crit{color:#fb7185}.stat-cb{color:#a5b4fc}.stat-ap{color:#f59e0b}.stat-mp{color:#d97706}.stat-mana-surge{color:#f4c56a}.stat-anti{color:#c084fc}.stat-accuracy{color:#2dd4bf}.stat-evasion{color:#facc15}.stat-heal-out{color:#4ade80}.stat-heal-in{color:#a3e635}
@media(max-width:1120px){.fighter-head{grid-template-columns:34px minmax(0,1fr) auto}.fighter-icon{width:32px;height:32px}.fighter-head-actions{gap:3px}.mana-chip{font-size:10px;padding:4px 6px}.fighter-stat-toggle{width:23px;height:23px}.fighter-class{display:inline;max-width:95px}.fighter-meta-line{gap:5px}.fighter-stat-popover{width:min(320px,calc(100vw - 24px))}}
@media(max-width:850px){.fighter-stat-popover{width:min(360px,calc(100vw - 26px))}}
@media(max-width:520px){.fighter-stat-popover{position:fixed;top:96px;left:12px!important;right:12px!important;width:auto;max-height:calc(100vh - 112px);overflow:auto}.fighter-stat-popover::before{display:none}.combat-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* v0.21.41 — private Remote Playtest lobby */
.hidden{display:none!important}
.mode-selecting{overflow:hidden}
.play-mode-overlay{position:fixed;inset:0;z-index:1200;display:grid;place-items:center;padding:28px;background:radial-gradient(circle at 50% 0%,rgba(74,85,104,.18),transparent 45%),rgba(5,7,10,.84);backdrop-filter:blur(18px)}
.play-mode-overlay.hidden{display:none!important}
.play-mode-card{width:min(1120px,96vw);max-height:92vh;overflow:auto;border:1px solid rgba(148,163,184,.22);border-radius:24px;background:linear-gradient(180deg,rgba(30,33,40,.985),rgba(14,16,21,.995));box-shadow:0 30px 100px rgba(0,0,0,.62);padding:26px}
.play-mode-brand-row{display:flex;justify-content:space-between;align-items:center;gap:18px;margin-bottom:22px}.play-mode-brand-row .realmfall-mark{margin-bottom:0}.overlay-meta{font-size:11px;font-weight:900;color:#cbd5e1}.remote-lobby-subhead{display:flex;justify-content:space-between;align-items:center;gap:18px}.room-code-line{font-size:12px;font-weight:850;color:#ddd6fe}.remote-player-list.simple{display:block;color:#e5e7eb;font-size:13px;font-weight:800;line-height:1.55}.remote-player-name.ready{color:#bbf7d0}.remote-player-name.offline{opacity:.5}
.realmfall-mark{font-family:Georgia,"Times New Roman",serif;font-size:13px;font-weight:900;letter-spacing:.28em;color:#f4c56a;margin-bottom:22px}.mode-kicker{font-size:10px;font-weight:950;letter-spacing:.19em;color:#94a3b8;margin-bottom:7px}.play-mode-card h2{font-size:30px;line-height:1.05;margin:0;color:#f8fafc}.mode-copy{max-width:740px;margin:10px 0 0;color:#aab4c3;font-size:13px;line-height:1.55}.mode-actions,.remote-lobby-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:20px}.mode-button{min-height:44px;padding:10px 17px;border-radius:12px;border:1px solid rgba(148,163,184,.28);background:linear-gradient(180deg,rgba(100,116,139,.14),rgba(51,65,85,.15));color:#e5e7eb;font-weight:850;font-size:13px;cursor:pointer}.mode-button:hover{border-color:rgba(203,213,225,.46);background:rgba(100,116,139,.22)}.mode-button.primary{border-color:rgba(244,197,106,.46);background:linear-gradient(180deg,rgba(244,197,106,.18),rgba(146,107,46,.16));color:#fff4cf}.mode-button.subtle{margin-top:10px;width:100%;background:rgba(59,130,246,.06);border-color:rgba(96,165,250,.20)}.mode-button.ready-button{border-color:rgba(74,222,128,.48);color:#bbf7d0;background:rgba(34,197,94,.10)}.mode-button:disabled{opacity:.42;cursor:not-allowed}.text-button{margin-top:18px;border:0;background:none;color:#94a3b8;cursor:pointer;padding:6px 0;font-weight:750}.text-button:hover{color:#e5e7eb}
.remote-field{display:grid;gap:7px;margin-top:18px;max-width:420px}.remote-field span,.remote-lobby-toolbar label{font-size:10px;font-weight:900;letter-spacing:.08em;color:#cbd5e1}.remote-field input,.join-box input,.remote-lobby-toolbar select,.remote-slot select{min-height:42px;border-radius:10px;border:1px solid rgba(148,163,184,.24);background:#0b0e13;color:#e5e7eb;padding:9px 11px;font-size:13px;outline:none}.remote-field input:focus,.join-box input:focus,.remote-lobby-toolbar select:focus,.remote-slot select:focus{border-color:rgba(244,197,106,.54);box-shadow:0 0 0 2px rgba(244,197,106,.08)}.remote-entry-grid{display:grid;grid-template-columns:minmax(180px,240px) minmax(300px,1fr);gap:12px;margin-top:14px;max-width:720px}.join-box{display:grid;grid-template-columns:1fr auto;gap:8px}.join-box input{text-transform:uppercase;letter-spacing:.14em;font-weight:900}.remote-error,.remote-inline-error{color:#fecaca;font-size:12px;margin-top:10px}.remote-inline-error{padding:8px 10px;border:1px solid rgba(248,113,113,.25);border-radius:9px;background:rgba(127,29,29,.12)}
.remote-lobby-head{display:flex;justify-content:space-between;gap:18px;align-items:flex-start}.room-limit{padding:8px 10px;border:1px solid rgba(148,163,184,.18);border-radius:999px;color:#94a3b8;font-size:10px;font-weight:900;white-space:nowrap}.remote-lobby-toolbar{display:flex;align-items:end;gap:14px;margin-top:18px;padding:12px;border:1px solid rgba(148,163,184,.13);border-radius:13px;background:rgba(255,255,255,.02)}.remote-lobby-toolbar label{display:grid;gap:6px;min-width:118px}.remote-lobby-help{font-size:11px;color:#94a3b8;line-height:1.4}.remote-player-list{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}.remote-player-chip{display:grid;gap:2px;min-width:140px;padding:8px 10px;border-radius:10px;border:1px solid rgba(148,163,184,.17);background:rgba(255,255,255,.025)}.remote-player-chip span{font-size:11px;font-weight:850;color:#e5e7eb}.remote-player-chip small{font-size:9px;color:#94a3b8}.remote-player-chip.ready{border-color:rgba(74,222,128,.27);background:rgba(34,197,94,.055)}.remote-player-chip.offline{border-color:rgba(248,113,113,.25);opacity:.65}.remote-team-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:16px}.remote-team-card{border:1px solid rgba(148,163,184,.15);border-radius:15px;background:rgba(6,8,12,.46);overflow:hidden}.remote-team-title{padding:10px 12px;font-size:10px;font-weight:950;letter-spacing:.18em;border-bottom:1px solid rgba(148,163,184,.13)}.remote-team-title.team-one{color:#93c5fd;background:rgba(59,130,246,.06)}.remote-team-title.team-two{color:#fca5a5;background:rgba(239,68,68,.05)}.remote-slot{display:grid;grid-template-columns:38px minmax(0,1.35fr) minmax(0,.9fr);gap:8px;align-items:center;padding:9px 10px;border-bottom:1px solid rgba(148,163,184,.08)}.remote-slot:last-child{border-bottom:0}.remote-slot-number{display:grid;place-items:center;width:31px;height:31px;border-radius:9px;background:rgba(148,163,184,.08);color:#cbd5e1;font-size:10px;font-weight:950}.remote-slot select{min-width:0;width:100%;font-size:11px;padding:7px 8px}.remote-slot select:disabled,.remote-lobby-toolbar select:disabled{opacity:.8;color:#cbd5e1}.remote-validation{margin-top:14px;min-height:22px;padding:9px 11px;border-radius:10px;background:rgba(15,23,42,.50);border:1px solid rgba(148,163,184,.10);font-size:10px;color:#fca5a5;line-height:1.45}.remote-valid{color:#86efac}.remote-room-badge{border-color:rgba(167,139,250,.28);color:#ddd6fe;background:rgba(88,28,135,.12)}
.remote-waiting{display:flex;align-items:center;gap:6px;min-height:58px;padding:12px 14px;border-radius:12px;border:1px solid rgba(148,163,184,.14);background:rgba(15,23,42,.34);color:#94a3b8}.remote-waiting strong{color:#e5e7eb}
@media(max-width:900px){.remote-team-grid{grid-template-columns:1fr}.remote-entry-grid{grid-template-columns:1fr}.remote-lobby-toolbar{align-items:stretch;flex-direction:column}}
@media(max-width:560px){.play-mode-overlay{padding:10px}.play-mode-card{width:100%;max-height:96vh;border-radius:17px;padding:18px}.play-mode-card h2{font-size:25px}.remote-slot{grid-template-columns:32px 1fr}.remote-slot .slot-controller{grid-column:2}.join-box{grid-template-columns:1fr}.remote-lobby-head{align-items:center}}


/* v0.21.42 — RealmFall dark-purple battle theme + teammate read-only prompts */
:root{
  --bg:#0d0814;
  --panel:rgba(39,27,52,.94);
  --panel-2:rgba(24,15,34,.98);
  --border:rgba(196,181,253,.17);
  --text:#f6f1ff;
  --muted:#aaa0b9;
  --shadow:0 22px 60px rgba(4,1,8,.48);
}
html,body{
  background:radial-gradient(circle at 50% -10%,#38224b 0,#170d22 31%,#0d0814 59%,#08050d 100%);
}
.ambient-a{background:#7c3aed;opacity:.13}
.ambient-b{background:#4c1d95;opacity:.16}
.topbar{
  background:rgba(17,10,26,.84);
  border-bottom-color:rgba(196,181,253,.16);
}
.panel,.turn-card,.fighter-card,.activity-panel{
  background:linear-gradient(180deg,rgba(51,35,66,.96),rgba(25,16,35,.985));
  border-color:rgba(196,181,253,.16);
  box-shadow:var(--shadow);
}
.turn-icon,.fighter-icon{background:rgba(196,181,253,.07);border-color:rgba(196,181,253,.14)}
.pill{background:rgba(196,181,253,.055);border-color:rgba(196,181,253,.16)}
.action-card{
  background:linear-gradient(150deg,rgba(67,46,84,.93),rgba(34,22,47,.98));
  border-color:rgba(196,181,253,.17);
}
.action-card:hover{
  border-color:rgba(244,197,106,.52);
  background:linear-gradient(150deg,rgba(81,55,102,.97),rgba(42,27,58,.995));
}
.target-button,.number-choice-button{
  background:linear-gradient(150deg,rgba(66,45,83,.94),rgba(33,21,46,.985));
}
.choice-button,.primary-button{
  background:linear-gradient(180deg,#5a416e,#3e2c50);
  border-color:rgba(196,181,253,.19);
}
.input-row input,.remote-field input,.join-box input,.remote-lobby-toolbar select,.remote-slot select{
  background:#130b1d;
  border-color:rgba(196,181,253,.19);
}
.feed-line{color:#bbb0ca}.feed-line.major{color:#f7f2ff}.feed-line.system{color:#cfc5db}
.stats-table th{background:#30223d;color:#ded5e9}
.stats-table td{color:#e4dcf0}
.team-total-card,.activity-entry,.summon,.deck-row{background:rgba(196,181,253,.035)}
.play-mode-overlay{
  background:radial-gradient(circle at 50% 0%,rgba(109,40,217,.18),transparent 46%),rgba(8,4,13,.88);
}
.play-mode-card{
  border-color:rgba(196,181,253,.22);
  background:linear-gradient(180deg,rgba(47,31,62,.99),rgba(20,12,29,.997));
  box-shadow:0 30px 100px rgba(4,1,8,.72);
}
.mode-button{
  border-color:rgba(196,181,253,.26);
  background:linear-gradient(180deg,rgba(124,58,237,.11),rgba(76,29,149,.10));
}
.mode-button:hover{border-color:rgba(216,180,254,.47);background:rgba(124,58,237,.16)}
.remote-lobby-toolbar,.remote-team-card,.remote-validation{
  border-color:rgba(196,181,253,.14);
  background:rgba(12,7,18,.48);
}
.remote-player-chip{border-color:rgba(196,181,253,.15);background:rgba(196,181,253,.025)}
.remote-slot{border-bottom-color:rgba(196,181,253,.08)}
.remote-room-badge{border-color:rgba(192,132,252,.34);background:rgba(88,28,135,.17)}
.fighter-stat-popover{
  background:radial-gradient(circle at 50% -15%,rgba(124,58,237,.15),transparent 44%),linear-gradient(180deg,rgba(38,25,49,.997),rgba(14,9,20,.999));
  border-color:rgba(216,180,254,.29);
}
.fighter-stat-popover::before{background:#291b35;border-left-color:rgba(216,180,254,.29);border-top-color:rgba(216,180,254,.29)}
.combat-stat-tile{background:linear-gradient(180deg,rgba(14,9,20,.72),rgba(29,19,38,.84))}

/* Teammates see the controller's live decision surface, but cannot interact. */
.spectator-prompt{
  border-color:rgba(167,139,250,.28);
  box-shadow:0 22px 60px rgba(4,1,8,.48),0 0 0 1px rgba(124,58,237,.05) inset;
}
.remote-spectator-banner{
  margin:0 0 12px;
  padding:8px 10px;
  border:1px solid rgba(167,139,250,.24);
  border-radius:10px;
  background:linear-gradient(90deg,rgba(91,33,182,.14),rgba(55,48,163,.055));
  color:#c4b5fd;
  font-size:9px;
  font-weight:850;
  letter-spacing:.055em;
  text-transform:uppercase;
}
.remote-spectator-banner strong{color:#ede9fe}
.spectator-prompt .action-card:disabled,
.spectator-prompt .action-card.action-disabled,
.spectator-prompt .target-button:disabled,
.spectator-prompt .choice-button:disabled,
.spectator-prompt .number-choice-button:disabled,
.spectator-prompt .primary-button:disabled,
.spectator-prompt .ghost-button:disabled,
.spectator-prompt .stepper button:disabled{
  opacity:.56;
  cursor:default;
  filter:saturate(.35) brightness(.83);
  transform:none!important;
  border-color:rgba(148,139,164,.18)!important;
  background:linear-gradient(150deg,rgba(57,51,62,.72),rgba(31,27,35,.82))!important;
  color:#b7afbd!important;
  box-shadow:none!important;
}
.spectator-prompt .action-card:disabled .action-name,
.spectator-prompt .action-card:disabled .action-desc,
.spectator-prompt .action-card:disabled .disabled-reason{
  color:#a9a1ae!important;
}
.spectator-prompt .action-card:disabled .action-cost{
  background:#292331;
  color:#9f97a7;
  border-color:rgba(148,139,164,.18);
}
.spectator-prompt input:disabled,
.spectator-prompt select:disabled,
.spectator-prompt textarea:disabled{
  opacity:.58;
  cursor:default;
  color:#a9a1ae;
  background:#18131d;
}


/* v0.21.44 — early-edition legendary menu bait */
.early-edition-promo{
  display:block;
  margin-top:24px;
  padding:14px 15px;
  border:1px solid rgba(250,204,21,.28);
  border-radius:14px;
  background:linear-gradient(180deg,rgba(250,204,21,.065),rgba(120,83,18,.035));
  color:inherit;
  text-decoration:none;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.018);
  transition:transform .14s ease,border-color .14s ease,background .14s ease,box-shadow .14s ease;
}
.early-edition-promo:hover{
  transform:translateY(-1px);
  border-color:rgba(250,204,21,.55);
  background:linear-gradient(180deg,rgba(250,204,21,.105),rgba(120,83,18,.055));
  box-shadow:0 8px 28px rgba(0,0,0,.22),inset 0 0 0 1px rgba(255,255,255,.025);
}
.early-edition-cta{
  display:block;
  color:#facc15;
  font-family:Georgia,"Times New Roman",serif;
  font-size:16px;
  font-weight:900;
  line-height:1.25;
  text-shadow:0 0 12px rgba(250,204,21,.16);
}
.early-edition-stats{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:10px;
}
.early-edition-stats > span{
  display:inline-flex;
  align-items:center;
  min-height:24px;
  padding:4px 7px;
  border:1px solid rgba(250,204,21,.16);
  border-radius:7px;
  background:rgba(10,6,15,.35);
  color:#eadfb9;
  font-size:10px;
  font-weight:850;
  letter-spacing:.01em;
}

/* v0.21.51 visual card hand -------------------------------------------------
   Playable cards are now selected by clicking their actual RealmFall card
   face. Utility actions (Base Attack / Pass / Discard) remain compact controls.
---------------------------------------------------------------------------- */
.realm-card-grid{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  align-items:flex-start;
  gap:14px 12px;
  width:100%;
  max-width:948px;
  margin:0 auto;
}
.realm-card-choice{
  width:228px;
  flex:0 0 228px;
  min-width:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-start;
  gap:7px;
  border:0;
  outline:0;
  padding:0;
  background:transparent;
  cursor:pointer;
  user-select:none;
  border-radius:18px;
}
.realm-card-stage{
  position:relative;
  width:228px;
  height:328px;
  overflow:hidden;
  border-radius:23px;
  transition:.16s transform,.16s filter,.16s box-shadow;
  filter:drop-shadow(0 12px 18px rgba(0,0,0,.34));
}
.realm-card-frame{
  position:absolute;
  left:0;
  top:0;
  width:330px;
  height:475px;
  border:0;
  background:transparent;
  transform:scale(.69);
  transform-origin:top left;
  pointer-events:none;
}
.realm-card-choice:hover .realm-card-stage,
.realm-card-choice:focus-visible .realm-card-stage{
  transform:translateY(-5px) scale(1.018);
  filter:drop-shadow(0 18px 25px rgba(0,0,0,.48));
}
.realm-card-choice:focus-visible{
  outline:2px solid rgba(244,197,106,.8);
  outline-offset:5px;
}
.realm-card-choice.selected .realm-card-stage{
  box-shadow:0 0 0 4px #f4c56a,0 0 28px rgba(244,197,106,.34);
}
.realm-card-choice.action-disabled{
  cursor:not-allowed;
}
.realm-card-choice.action-disabled .realm-card-stage{
  filter:grayscale(.38) brightness(.63) drop-shadow(0 10px 16px rgba(0,0,0,.28));
}
.realm-card-choice.action-disabled:hover .realm-card-stage{
  transform:none;
}
.realm-card-disabled-reason{
  margin-top:-48px;
  z-index:3;
  min-width:96px;
  padding:8px 11px;
  border-radius:999px;
  border:1px solid rgba(248,113,113,.7);
  background:rgba(73,18,23,.94);
  color:#fecaca;
  font-size:10px;
  font-weight:950;
  letter-spacing:.08em;
  box-shadow:0 7px 18px rgba(0,0,0,.42);
}
.utility-action-grid{
  margin:0 0 16px;
  grid-template-columns:repeat(3,minmax(0,1fr));
}
.utility-action-grid .action-card.utility{
  min-height:64px;
}
.discard-card-grid{
  max-height:none;
  overflow:visible;
  padding:0;
}
.discard-controls{
  margin:0 0 14px;
  position:sticky;
  top:0;
  z-index:5;
  padding:4px 0 10px;
  background:linear-gradient(180deg,rgba(22,24,30,.99) 0%,rgba(22,24,30,.97) 74%,transparent 100%);
}
@media(max-width:1120px){
  .realm-card-grid{max-width:708px}
  .realm-card-choice{width:220px;flex-basis:220px}
  .realm-card-stage{width:220px;height:317px}
  .realm-card-frame{transform:scale(.667)}
}
@media(max-width:560px){
  .realm-card-grid{max-width:100%}
  .realm-card-choice{width:211px;flex-basis:211px}
  .realm-card-stage{width:211px;height:304px}
  .realm-card-frame{transform:scale(.64)}
  .utility-action-grid{grid-template-columns:1fr}
}


/* v0.21.52 stat-sheet comparison + viewport safety */
.fighter-stat-popover{max-height:calc(100vh - 112px);overflow:auto}
.team-stack .fighter-card:nth-last-child(-n+2) .fighter-stat-popover{top:auto;bottom:calc(100% + 7px)}
.team-stack .fighter-card:nth-last-child(-n+2) .fighter-stat-popover::before{top:auto;bottom:-6px;transform:rotate(225deg)}
@media(max-width:850px){
  .team-stack .fighter-card:nth-last-child(-n+2) .fighter-stat-popover{top:auto;bottom:calc(100% + 7px)}
}

/* v0.21.53 — desktop combat viewport + reliable stat sheets -----------------
   Keep the complete 4+3 card hand, Action controls, fighter effects and turn
   header visible in a normal desktop viewport without requiring page scroll.
---------------------------------------------------------------------------- */
.fighter-stat-popover{
  position:fixed!important;
  z-index:1000!important;
  width:min(338px,calc(100vw - 20px));
  max-height:calc(100vh - 20px)!important;
  overflow:auto!important;
}
.fighter-card.right-team .fighter-stat-popover{right:auto}
.fighter-stat-popover::before{display:none!important}

.target-back-button{
  width:auto;
  min-width:92px;
  min-height:38px;
  margin:0 0 10px;
  padding:8px 16px;
  color:#e5e7eb;
  border-color:rgba(244,197,106,.34);
  background:rgba(255,255,255,.035);
}
.target-back-button::before{content:"← ";font-weight:900}

@media(min-width:851px){
  .topbar{
    height:70px;
    padding:12px 24px;
  }
  .topbar h1{font-size:29px}
  .layout{
    gap:14px;
    padding:10px 20px 12px;
    max-width:1680px;
  }
  .center-column{gap:10px}
  .turn-card{
    min-height:62px;
    padding:9px 13px;
  }
  .turn-icon{width:40px;height:40px;font-size:22px}
  .turn-name{font-size:16px}
  #promptPanel .panel-head{
    padding:10px 16px 5px;
  }
  #promptPanel .panel-head h2{font-size:20px}
  #promptPanel .prompt-body{
    padding:6px 16px 10px;
    min-height:0;
  }
  .utility-action-grid{
    gap:8px;
    margin:0 0 9px;
  }
  .utility-action-grid .action-card.utility{
    min-height:50px;
    padding:9px 11px 8px;
  }
  .utility-action-grid .action-name{font-size:12px}
  .utility-action-grid .action-desc{font-size:10px;margin-top:2px}
  .utility-action-grid .action-cost{top:7px;right:8px;width:24px;min-width:24px;height:24px}

  .realm-card-grid{
    max-width:734px;
    gap:8px 10px;
    align-content:flex-start;
  }
  .realm-card-choice{
    width:176px;
    flex:0 0 176px;
    gap:4px;
    border-radius:15px;
  }
  .realm-card-stage{
    width:176px;
    height:254px;
    border-radius:18px;
    filter:drop-shadow(0 8px 12px rgba(0,0,0,.32));
  }
  .realm-card-frame{
    width:330px;
    height:475px;
    transform:scale(.5333333);
  }
  .realm-card-choice:hover .realm-card-stage,
  .realm-card-choice:focus-visible .realm-card-stage{
    transform:translateY(-3px) scale(1.012);
  }
  .realm-card-disabled-reason{
    margin-top:-37px;
    padding:6px 9px;
    font-size:9px;
  }

  .fighter-card{padding:11px}
  .bar{height:21px;margin-top:8px}
  .effects{margin-top:6px;gap:4px}
  .effect-chip{font-size:8.5px;padding:3px 5px}
  .summons{margin-top:6px}
  .activity-panel{margin-top:12px}
}

@media(min-width:851px) and (max-height:790px){
  .topbar{height:62px;padding:8px 20px}
  .layout{padding-top:7px}
  .turn-card{min-height:54px;padding:7px 11px}
  #promptPanel .panel-head{padding-top:7px}
  .realm-card-grid{max-width:686px;gap:6px 8px}
  .realm-card-choice{width:165px;flex-basis:165px}
  .realm-card-stage{width:165px;height:238px}
  .realm-card-frame{transform:scale(.5)}
}


/* v0.21.55 — grey combat theme, red logs/turn, stable utility row + card reveal */
:root{
  --bg:#101216;
  --panel:rgba(34,37,43,.96);
  --panel-2:rgba(24,27,32,.99);
  --border:rgba(148,163,184,.17);
  --text:#f1f3f5;
  --muted:#a5acb8;
  --shadow:0 22px 60px rgba(0,0,0,.42);
}
html,body{
  background:radial-gradient(circle at 50% -12%,#363b43 0,#1b1e23 32%,#111318 62%,#0b0d10 100%);
}
.ambient-a{background:#6b7280;opacity:.09}
.ambient-b{background:#374151;opacity:.12}
.topbar{
  background:rgba(19,21,25,.90);
  border-bottom-color:rgba(148,163,184,.14);
}
.panel,.fighter-card{
  background:linear-gradient(180deg,rgba(44,47,54,.97),rgba(26,29,34,.992));
  border-color:rgba(148,163,184,.16);
  box-shadow:var(--shadow);
}
.action-card{
  background:linear-gradient(150deg,rgba(58,62,70,.94),rgba(31,34,40,.99));
  border-color:rgba(148,163,184,.17);
}
.action-card:hover{
  background:linear-gradient(150deg,rgba(70,75,84,.98),rgba(37,40,47,.998));
}
.target-button,.number-choice-button{
  background:linear-gradient(150deg,rgba(57,61,69,.95),rgba(29,32,38,.99));
}
.choice-button,.primary-button{
  background:linear-gradient(180deg,#4b515b,#363b43);
  border-color:rgba(148,163,184,.19);
}
.input-row input,.remote-field input,.join-box input,.remote-lobby-toolbar select,.remote-slot select{
  background:#13161a;
  border-color:rgba(148,163,184,.19);
}
.stats-table th{background:#30343a;color:#e1e5ea}
.stats-table td{color:#dde1e6}
.team-total-card,.summon,.deck-row{background:rgba(255,255,255,.028)}
.fighter-stat-popover{
  background:radial-gradient(circle at 50% -15%,rgba(148,163,184,.09),transparent 44%),linear-gradient(180deg,rgba(38,41,47,.998),rgba(19,21,25,.999));
  border-color:rgba(148,163,184,.25);
}
.combat-stat-tile{background:linear-gradient(180deg,rgba(18,20,24,.78),rgba(31,34,39,.88))}

/* Battle Activity, Current Turn and Raw Python Log stay deliberately dark red. */
.activity-panel,
.turn-card,
.raw-log-wrap .feed-panel{
  background:linear-gradient(180deg,rgba(63,24,29,.97),rgba(35,13,17,.995));
  border-color:rgba(248,113,113,.22);
  box-shadow:0 22px 60px rgba(18,3,6,.43);
}
.activity-entry{background:rgba(127,29,29,.12);border-color:rgba(248,113,113,.12)}
.activity-panel .eyebrow,.turn-card .eyebrow,.raw-log-wrap .eyebrow{color:#fca5a5}
.raw-log-wrap .feed-line{color:#d9c7ca}
.raw-log-wrap .feed-line.major{color:#fff1f2}
.raw-log-wrap .feed-line.system{color:#fecdd3}

/* Target screen order is Back -> ability name -> target buttons. */
body.target-selection-active #promptPanel .panel-head{display:none!important}
body.target-selection-active #promptPanel .prompt-body{padding-top:10px}
.target-castable{
  margin:0 0 10px;
  padding:11px 13px;
  font-size:15px;
  font-weight:900;
  letter-spacing:.02em;
  background:rgba(255,255,255,.035);
  border-color:rgba(148,163,184,.20);
}
.target-back-button{margin:0 0 10px}

/* Keep the entire fixed action strip on one desktop row, including Turtle's
   disabled Base Attack. Never let the red/blocked Basic push controls down. */
@media(min-width:851px){
  .utility-action-grid{
    display:flex;
    flex-wrap:nowrap;
    grid-template-columns:none;
    width:100%;
  }
  .utility-action-grid > .action-card{
    flex:1 1 0;
    min-width:0;
  }
}

/* Frames are hydrated in one batch and revealed together so a hand never pops
   in one card at a time. Visibility keeps the final layout reserved. */
.realm-card-grid.card-grid-loading .realm-card-choice{visibility:hidden}
.realm-card-grid.card-grid-ready .realm-card-choice{visibility:visible}

/* v0.21.55 final grey override for setup/remote surfaces as well. */
.play-mode-overlay{
  background:radial-gradient(circle at 50% 0%,rgba(107,114,128,.12),transparent 46%),rgba(10,12,15,.91);
}
.play-mode-card{
  border-color:rgba(148,163,184,.20);
  background:linear-gradient(180deg,rgba(45,48,55,.995),rgba(23,26,31,.999));
  box-shadow:0 30px 100px rgba(0,0,0,.68);
}
.mode-button{
  border-color:rgba(148,163,184,.24);
  background:linear-gradient(180deg,rgba(107,114,128,.13),rgba(55,65,81,.11));
}
.mode-button:hover{border-color:rgba(203,213,225,.42);background:rgba(107,114,128,.16)}
.remote-lobby-toolbar,.remote-team-card,.remote-validation{
  border-color:rgba(148,163,184,.14);
  background:rgba(18,20,24,.55);
}
.remote-player-chip{border-color:rgba(148,163,184,.15);background:rgba(255,255,255,.025)}
.remote-slot{border-bottom-color:rgba(148,163,184,.08)}
.remote-room-badge{border-color:rgba(148,163,184,.28);background:rgba(71,85,105,.14);color:#e2e8f0}
.spectator-prompt{border-color:rgba(148,163,184,.25);box-shadow:var(--shadow)}
.remote-spectator-banner{
  border-color:rgba(148,163,184,.21);
  background:linear-gradient(90deg,rgba(71,85,105,.15),rgba(51,65,85,.06));
  color:#cbd5e1;
}
.remote-spectator-banner strong{color:#f1f5f9}

/* v0.22.0 — purple information surfaces; the rest of the interface stays dark grey. */
.activity-panel,
.turn-card,
.raw-log-wrap .feed-panel,
.live-stats-panel{
  background:linear-gradient(180deg,rgba(61,34,88,.975),rgba(31,18,47,.997));
  border-color:rgba(192,132,252,.27);
  box-shadow:0 22px 60px rgba(20,8,31,.46);
}
.activity-entry{
  background:rgba(126,34,206,.11);
  border-color:rgba(192,132,252,.14);
}
.activity-panel .eyebrow,
.turn-card .eyebrow,
.raw-log-wrap .eyebrow,
.live-stats-panel .eyebrow{
  color:#d8b4fe;
}
.raw-log-wrap .feed-line{color:#ddd0e8}
.raw-log-wrap .feed-line.major{color:#faf5ff}
.raw-log-wrap .feed-line.system{color:#e9d5ff}
.live-stats-panel .stats-table th{
  background:#39264b;
  color:#f3e8ff;
}
.live-stats-panel .team-total-card,
.live-stats-panel .summon{
  background:rgba(126,34,206,.075);
  border-color:rgba(192,132,252,.14);
}

/* UI identity patch ---------------------------------------------------------
   RealmFall wordmarks use the same small-caps fantasy face as the cards.
   Menu/lobby action pills use the shared purple identity. Rickroll legendary
   promo intentionally keeps its existing gold treatment. */
:root{
  --realm-purple:#c084fc;
  --realm-purple-bright:#d8b4fe;
  --realm-purple-deep:#6d28d9;
  --realm-purple-panel:#3b1f55;
}

/* Every visible RealmFall wordmark: top-left, purple, card-title typography. */
.topbar h1,
.realmfall-mark{
  font-family:"IM Fell English SC",Georgia,"Times New Roman",serif!important;
  color:var(--realm-purple)!important;
  font-weight:400!important;
  text-shadow:0 0 16px rgba(192,132,252,.24);
}
.topbar h1{letter-spacing:.035em}
.realmfall-mark{
  position:fixed;
  z-index:1305;
  top:17px;
  left:24px;
  margin:0!important;
  font-size:25px!important;
  line-height:1;
  letter-spacing:.035em!important;
}
.play-mode-brand-row{
  min-height:12px;
  justify-content:flex-end;
  margin-bottom:18px;
}

/* Purple pill language across Local/Online and the complete online flow. */
.mode-button,
.mode-button.primary,
.mode-button.subtle,
.mode-button.ready-button{
  border-radius:999px!important;
  border:1px solid rgba(192,132,252,.48)!important;
  background:linear-gradient(180deg,rgba(126,34,206,.33),rgba(88,28,135,.30))!important;
  color:#f3e8ff!important;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.025),0 6px 18px rgba(45,14,70,.18);
}
.mode-button:hover:not(:disabled),
.mode-button.primary:hover:not(:disabled),
.mode-button.subtle:hover:not(:disabled),
.mode-button.ready-button:hover:not(:disabled){
  border-color:rgba(216,180,254,.76)!important;
  background:linear-gradient(180deg,rgba(147,51,234,.45),rgba(107,33,168,.39))!important;
  transform:translateY(-1px);
}
.mode-button:disabled{
  opacity:.42;
  filter:saturate(.7);
}
.mode-button.ready-button{
  border-color:rgba(216,180,254,.70)!important;
  background:linear-gradient(180deg,rgba(147,51,234,.43),rgba(88,28,135,.38))!important;
}
.online-nav-row{
  display:flex;
  justify-content:flex-start;
  margin:0 0 16px;
}
.online-nav-row-bottom{
  margin:18px 0 0;
}
.online-back-button{
  min-height:36px;
  padding:7px 14px;
  font-size:11px;
}

/* Targeting: Back + selected ability/card are a single row, targets below. */
.target-selection-header{
  display:flex;
  align-items:stretch;
  gap:9px;
  width:100%;
  margin:0 0 10px;
}
.target-selection-header .target-back-button{
  flex:0 0 auto;
  margin:0!important;
  border-radius:999px;
  border-color:rgba(192,132,252,.48);
  background:linear-gradient(180deg,rgba(126,34,206,.27),rgba(88,28,135,.24));
  color:#f3e8ff;
}
.target-selection-header .target-castable{
  flex:1 1 auto;
  display:flex;
  align-items:center;
  margin:0!important;
  min-width:0;
  min-height:38px;
  padding:8px 13px;
  border-radius:11px;
  color:#f3e8ff;
  background:linear-gradient(180deg,rgba(83,49,107,.62),rgba(48,31,64,.72));
  border:1px solid rgba(192,132,252,.25);
}

@media(max-width:560px){
  .realmfall-mark{top:13px;left:14px;font-size:21px!important}
  .target-selection-header{gap:7px}
  .target-selection-header .target-back-button{min-width:78px;padding-left:11px;padding-right:11px}
}

/* v0.24.1 — fixed four open slots per team; empty rows are intentionally valid. */
.remote-lobby-toolbar.open-slot-toolbar{align-items:center}
.remote-slot.open-slot{opacity:.82}
.remote-slot.open-slot .remote-slot-number{border:1px dashed rgba(192,132,252,.26);background:rgba(126,34,206,.055);color:#c4b5fd}

/* v0.26.1 — PvP/PvE mode split + encounter lobby */
.primary-mode-actions{gap:14px}
.mode-button-large{min-width:150px;min-height:58px;font-size:17px;letter-spacing:.06em}
.remote-field select optgroup,.remote-slot select optgroup{background:#12151b;color:#d8b4fe;font-weight:800}
.remote-field select option,.remote-slot select option{background:#0b0e13;color:#e5e7eb}
.encounter-toolbar{display:grid;grid-template-columns:minmax(250px,420px) 1fr;align-items:end}
.encounter-toolbar label{min-width:0}
.encounter-toolbar select{width:100%;min-height:42px;border-radius:10px;border:1px solid rgba(192,132,252,.34);background:#0b0e13;color:#e5e7eb;padding:9px 11px;font-size:13px;outline:none}
.encounter-summary{min-height:42px;display:flex;align-items:center;padding:8px 11px;border-radius:10px;border:1px solid rgba(234,179,8,.18);background:rgba(234,179,8,.045);color:#fde68a;font-size:11px;font-weight:800;line-height:1.4}
.pve-team-grid{align-items:start}
.pve-enemy-card{border-color:rgba(234,179,8,.16)}
.pve-enemy-roster{display:grid;grid-template-columns:1fr 1fr;gap:0}
.pve-enemy-row{display:grid;grid-template-columns:32px 1fr;gap:8px;align-items:center;padding:10px 12px;border-bottom:1px solid rgba(148,163,184,.08)}
.pve-enemy-row:nth-child(odd){border-right:1px solid rgba(148,163,184,.08)}
.pve-enemy-row span{display:grid;place-items:center;width:27px;height:27px;border-radius:8px;background:rgba(234,179,8,.08);color:#fde68a;font-size:10px;font-weight:950}
.pve-enemy-row strong{font-size:12px;color:#f1f5f9;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(max-width:760px){.encounter-toolbar{grid-template-columns:1fr}.pve-enemy-roster{grid-template-columns:1fr}.pve-enemy-row:nth-child(odd){border-right:0}}

/* V0.26.1 — keep stock and imported builds as visibly separate pickers. */
.slot-character-pickers{display:grid;grid-template-columns:1fr 1fr;gap:6px;min-width:0}
.slot-character-pickers .slot-character{min-width:0;width:100%}
@media(max-width:760px){.slot-character-pickers{grid-template-columns:1fr}}
@media(max-width:560px){.remote-slot .slot-character-pickers{grid-column:2}}


/* v0.26.1 — quieter grey navigation buttons */
.mode-button.online-back-button,
.target-back-button,
.target-selection-header .target-back-button{
  border-color:rgba(148,163,184,.30)!important;
  background:linear-gradient(180deg,rgba(75,85,99,.30),rgba(55,65,81,.26))!important;
  color:#d1d5db!important;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.018),0 4px 12px rgba(0,0,0,.12)!important;
}
.mode-button.online-back-button:hover:not(:disabled),
.target-back-button:hover:not(:disabled),
.target-selection-header .target-back-button:hover:not(:disabled){
  border-color:rgba(203,213,225,.42)!important;
  background:linear-gradient(180deg,rgba(107,114,128,.36),rgba(75,85,99,.31))!important;
  color:#f3f4f6!important;
}

/* v0.26.2 — off-turn planning hand: own cards stay visible but inert. */
.planning-hand-prompt{
  border-color:rgba(148,163,184,.22);
  box-shadow:0 22px 60px rgba(0,0,0,.42),0 0 0 1px rgba(148,163,184,.035) inset;
}
.planning-hand-banner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin:0 0 12px;
  padding:8px 10px;
  border:1px solid rgba(148,163,184,.18);
  border-radius:10px;
  background:linear-gradient(90deg,rgba(71,85,105,.16),rgba(31,41,55,.08));
  color:#cbd5e1;
  font-size:9px;
  font-weight:850;
  letter-spacing:.045em;
  text-transform:uppercase;
}
.planning-hand-banner strong{color:#f1f5f9}
.planning-hand-banner span{color:#94a3b8;font-weight:750}
.planning-card-grid .realm-card-choice{
  cursor:default;
  pointer-events:none;
}
.planning-card-grid .realm-card-choice.action-disabled .realm-card-stage{
  filter:grayscale(.72) saturate(.35) brightness(.68) drop-shadow(0 9px 14px rgba(0,0,0,.24));
  opacity:.82;
}
.planning-card-grid .realm-card-choice.action-disabled:hover .realm-card-stage{transform:none}
.planning-hand-empty{padding:14px 2px}
@media(max-width:760px){.planning-hand-banner{align-items:flex-start;flex-direction:column;gap:4px}}

/* v0.26.3 — centered mode choice screens with balanced spacing. */
.mode-choice-screen{
  width:min(620px,100%);
  margin:0 auto;
  padding:18px 18px 8px;
  text-align:center;
}
.mode-choice-screen .mode-actions{
  justify-content:center;
  align-items:center;
  margin-top:22px;
}
.mode-choice-transport .mode-actions{
  gap:14px;
}
.mode-choice-transport .mode-button:not(.online-back-button){
  min-width:150px;
}
.mode-choice-screen .online-nav-row-bottom{
  justify-content:center;
  margin-top:24px;
}
@media(max-width:560px){
  .mode-choice-screen{padding:12px 4px 4px}
  .mode-choice-transport .mode-button:not(.online-back-button){min-width:132px}
}


/* v0.26.21 — Wizard101-style in-hand Tip / Cleric enchant targeting */
.realm-card-choice.card-enchanted .realm-card-stage{
  box-shadow:0 0 0 3px rgba(250,204,21,.78),0 0 24px rgba(250,204,21,.36),0 16px 30px rgba(0,0,0,.42);
  transform:translateY(-2px);
}
.realm-card-choice.card-enchanted.action-disabled .realm-card-stage{
  box-shadow:0 0 0 3px rgba(250,204,21,.46),0 0 18px rgba(250,204,21,.22);
}
.realm-card-enchantment-badge{
  position:absolute;left:50%;bottom:7px;z-index:7;transform:translateX(-50%);
  max-width:88%;padding:5px 9px;border-radius:999px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  border:1px solid rgba(253,224,71,.78);background:rgba(28,24,12,.94);color:#fef08a;
  font-size:11px;font-weight:800;letter-spacing:.045em;text-transform:uppercase;
  pointer-events:none;box-shadow:0 3px 12px rgba(0,0,0,.42);
}
.realm-card-enchantment-badge.empowerment{
  border-color:#ffe77a;
  background:linear-gradient(180deg,#f8df72,#d8aa2d);
  color:#3a2705;
  text-transform:none;
  letter-spacing:.02em;
  font-weight:950;
  box-shadow:0 3px 12px rgba(0,0,0,.46),0 0 12px rgba(250,204,21,.28);
  text-shadow:0 1px 0 rgba(255,248,199,.55);
}
.hand-attachment-note{margin:0 0 10px;color:var(--muted);font-size:.9rem}
.hand-attachment-controls{margin-bottom:8px}
.hand-attachment-grid .realm-card-choice.action-disabled{filter:grayscale(.75);opacity:.42}
.hand-attachment-grid .realm-card-choice:not(.action-disabled) .realm-card-stage{
  box-shadow:0 0 0 2px rgba(125,211,252,.42),0 13px 28px rgba(0,0,0,.38);
}

/* v0.26.46 — React prompt previews only the reacting player's offered card. */
.react-card-preview{
  display:flex;
  justify-content:center;
  margin:8px auto 14px;
}
.react-card-preview .realm-card-choice{
  width:min(310px, 72vw);
}

/* ============================================================
   v0.27.0 — Realm 1 battlefield + simultaneous team planning
   ============================================================ */
.layout{
  isolation:isolate;
  min-height:720px;
  padding-top:26px;
  padding-bottom:34px;
  overflow:hidden;
  border-left:1px solid rgba(255,255,255,.04);
  border-right:1px solid rgba(255,255,255,.04);
}
.layout::before{
  content:"";
  position:absolute;
  inset:0;
  z-index:-3;
  background:
    linear-gradient(180deg,rgba(4,8,6,.18),rgba(3,6,5,.42)),
    url('/static/realm1/forest_battlefield.png') center/cover no-repeat;
  filter:saturate(.92) brightness(.78);
}
.layout::after{
  content:"";
  position:absolute;
  inset:0;
  z-index:-2;
  pointer-events:none;
  background:linear-gradient(90deg,rgba(4,6,8,.70) 0%,rgba(4,6,8,.15) 25%,rgba(4,6,8,.06) 50%,rgba(4,6,8,.15) 75%,rgba(4,6,8,.70) 100%);
}
.team-column,.center-column{position:relative;z-index:4}
.team-column .fighter-card{background:linear-gradient(180deg,rgba(23,27,27,.82),rgba(11,14,15,.90));backdrop-filter:blur(5px)}
.center-column .panel,.center-column .turn-card{background:linear-gradient(180deg,rgba(24,28,28,.88),rgba(11,14,15,.93));backdrop-filter:blur(7px)}
.battle-sprite-layer{
  position:absolute;
  z-index:2;
  inset:72px 285px 70px;
  pointer-events:none;
}
.battle-sprite{
  position:absolute;
  width:146px;
  height:176px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-end;
  transform-origin:center bottom;
  transition:opacity .18s ease,filter .18s ease;
}
.battle-sprite.dead{opacity:.26;filter:grayscale(.78)}
.battle-sprite img{
  display:block;
  width:136px;
  height:136px;
  max-width:142px;
  max-height:142px;
  object-fit:contain;
  image-rendering:pixelated;
  image-rendering:crisp-edges;
  filter:drop-shadow(0 8px 5px rgba(0,0,0,.42));
  user-select:none;
  -webkit-user-drag:none;
}
.battle-sprite.team-2 img{transform:scaleX(-1)}
.battle-sprite .sprite-name{
  margin-top:2px;
  padding:2px 7px;
  border-radius:999px;
  background:rgba(4,7,7,.72);
  border:1px solid rgba(255,255,255,.12);
  color:#f5f7f7;
  font-size:10px;
  font-weight:900;
  text-shadow:0 1px 2px #000;
  white-space:nowrap;
  max-width:145px;
  overflow:hidden;
  text-overflow:ellipsis;
}
.battle-sprite .sprite-hp{
  width:92px;height:7px;margin-top:3px;border-radius:999px;overflow:hidden;
  background:rgba(46,17,17,.9);border:1px solid rgba(255,255,255,.16)
}
.battle-sprite .sprite-hp > i{display:block;height:100%;background:#4ade80}
.battle-sprite.slot-0.team-1{left:2%;top:39%}
.battle-sprite.slot-1.team-1{left:14%;top:7%}
.battle-sprite.slot-2.team-1{left:18%;top:68%}
.battle-sprite.slot-3.team-1{left:31%;top:30%}
.battle-sprite.slot-0.team-2{right:2%;top:39%}
.battle-sprite.slot-1.team-2{right:14%;top:7%}
.battle-sprite.slot-2.team-2{right:18%;top:68%}
.battle-sprite.slot-3.team-2{right:31%;top:30%}
.battle-summon-sprite{position:absolute;width:45px;height:45px;z-index:3;image-rendering:pixelated;filter:drop-shadow(0 4px 3px rgba(0,0,0,.45))}
.battle-summon-sprite.team-2{transform:scaleX(-1)}
.team-phase-badge{
  position:absolute;z-index:8;top:14px;left:50%;transform:translateX(-50%);
  min-width:92px;padding:7px 15px;border-radius:999px;
  background:rgba(6,9,9,.82);border:1px solid rgba(255,255,255,.15);
  color:#f4e5ad;font-size:11px;font-weight:950;letter-spacing:.13em;text-align:center;
  box-shadow:0 8px 24px rgba(0,0,0,.28);backdrop-filter:blur(5px)
}
body.team-resolving #promptPanel{opacity:0;transform:translateY(24px);pointer-events:none}
#promptPanel{transition:opacity .18s ease,transform .18s ease}
body.target-selection-active #promptPanel{opacity:1!important;transform:none!important;pointer-events:auto!important}

.team-plan-shell{display:grid;gap:12px}
.team-plan-fighter{padding:10px;border:1px solid rgba(148,163,184,.17);border-radius:13px;background:rgba(7,10,11,.45)}
.team-plan-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:7px}
.team-plan-head strong{font-size:12px;color:#f4f4f4}
.team-plan-lock{font-size:9px;font-weight:950;letter-spacing:.08em;color:#7ddf8d;text-transform:uppercase}
.team-plan-fighter.locked{border-color:rgba(74,222,128,.34);background:rgba(12,45,24,.28)}
.team-plan-fighter .realm-card-grid{margin-top:0}
.team-plan-fighter .utility-action-grid{margin:0 0 7px}
.team-plan-fighter.locked .realm-card-choice:not(.selected-plan),
.team-plan-fighter.locked .action-card:not(.selected-plan){opacity:.28;pointer-events:none}
.team-plan-fighter .selected-plan .realm-card-stage,
.team-plan-fighter .action-card.selected-plan{box-shadow:0 0 0 2px rgba(244,197,106,.88),0 0 20px rgba(244,197,106,.20)}
.team-plan-fighter .realm-card-choice{transform:scale(.92);transform-origin:center top}
.team-plan-fighter .realm-card-grid{gap:4px}
.team-plan-waiting{min-height:44px;display:grid;place-items:center;color:#cbd5e1;font-size:12px;font-weight:850}

.battle-sprite.attack-right{animation:rf-lunge-right .50s ease}
.battle-sprite.attack-left{animation:rf-lunge-left .50s ease}
.battle-sprite.attack-center-right{animation:rf-lunge-center-right .55s ease}
.battle-sprite.attack-center-left{animation:rf-lunge-center-left .55s ease}
.battle-sprite.hit-shake{animation:rf-hit-shake .34s linear}
.battle-sprite.heal-pulse{animation:rf-heal-pulse .52s ease}
@keyframes rf-lunge-right{50%{transform:translateX(95px) scale(1.04)}}
@keyframes rf-lunge-left{50%{transform:translateX(-95px) scale(1.04)}}
@keyframes rf-lunge-center-right{50%{transform:translateX(128px) scale(1.05)}}
@keyframes rf-lunge-center-left{50%{transform:translateX(-128px) scale(1.05)}}
@keyframes rf-hit-shake{0%,100%{transform:translateX(0)}20%{transform:translateX(-9px)}40%{transform:translateX(9px)}60%{transform:translateX(-6px)}80%{transform:translateX(6px)}}
@keyframes rf-heal-pulse{50%{filter:drop-shadow(0 0 14px #77f593) brightness(1.35)}}
.battle-damage-float{position:absolute;z-index:10;pointer-events:none;color:#ffe07b;font-size:18px;font-weight:1000;text-shadow:0 2px 4px #000;animation:rf-float .70s ease forwards}
.battle-damage-float.heal{color:#79f39b}
@keyframes rf-float{0%{transform:translate(-50%,0);opacity:0}18%{opacity:1}100%{transform:translate(-50%,-48px);opacity:0}}

/* During action resolution, targeting lives on the battlefield. The old target
   buttons remain as an accessibility fallback, but the cards never come back. */
body.target-selection-active .battle-sprite-layer{pointer-events:auto;z-index:10}
.battle-sprite.targetable{pointer-events:auto;cursor:crosshair;filter:drop-shadow(0 0 10px rgba(255,235,130,.66))}
.battle-sprite.target-enemy{filter:drop-shadow(0 0 10px rgba(248,113,113,.78))}
.battle-sprite.target-friendly{filter:drop-shadow(0 0 10px rgba(74,222,128,.78))}
.battle-sprite.targetable:hover{transform:translateY(-4px) scale(1.03)}
body.battlefield-targeting #promptPanel{position:absolute;z-index:12;left:50%;bottom:18px;transform:translateX(-50%)!important;width:min(520px,90%);opacity:1!important;background:rgba(10,13,13,.88)}
body.battlefield-targeting #promptPanel .target-grid{display:none}
body.battlefield-targeting #promptPanel .panel-head{display:none}
body.battlefield-targeting #promptPanel .prompt-body{min-height:0;padding:9px 11px}

@media(max-width:1180px){
  .battle-sprite-layer{inset:72px 215px 80px}
  .battle-sprite{width:120px;height:150px}.battle-sprite img{max-width:116px;max-height:116px}
}
@media(max-width:900px){
  .battle-sprite-layer{display:none}
  .layout::before{opacity:.5}
  body.battlefield-targeting #promptPanel{position:relative;left:auto;bottom:auto;transform:none!important;width:auto}
  body.battlefield-targeting #promptPanel .target-grid{display:grid}
}
.battle-summon-sprite.targetable{pointer-events:auto;cursor:crosshair;outline:2px solid rgba(255,235,130,.75);outline-offset:2px;border-radius:50%}
.battle-summon-sprite.target-enemy{outline-color:rgba(248,113,113,.92)}
.battle-summon-sprite.target-friendly{outline-color:rgba(74,222,128,.92)}
.battle-summon-sprite.target-selected{box-shadow:0 0 0 3px rgba(244,197,106,.82)}
.battle-sprite.target-selected{filter:drop-shadow(0 0 13px rgba(244,197,106,.95))}
body.team-resolving.resolution-prompt-active #promptPanel{opacity:1;transform:none;pointer-events:auto}


/* v0.27.1 — planning cards float over the battlefield instead of living in a
   large framed TEAM A/TEAM B panel. */
body.team-planning #promptPanel{
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  backdrop-filter:none!important;
  overflow:visible!important;
}
body.team-planning #promptPanel .panel-head{display:none!important}
body.team-planning #promptPanel .prompt-body{padding:0 4px 12px;min-height:0}
body.team-planning .team-plan-fighter{
  padding:4px 2px 8px;
  border:0;
  background:transparent;
}
body.team-planning .team-plan-head{padding:0 4px;margin-bottom:3px}

/* Large battlefield target plate: centered over the sprite art and deliberately
   larger than the visible character so target selection never requires pixel precision. */
.battle-target-hitbox{
  position:absolute;
  z-index:24;
  left:50%;
  top:-4px;
  width:190px;
  height:154px;
  transform:translateX(-50%);
  border-radius:30px;
  border:2px solid rgba(255,235,130,.40);
  background:rgba(255,255,255,.015);
  cursor:crosshair;
  outline:0;
}
.battle-target-hitbox.target-enemy{border-color:rgba(248,113,113,.58);box-shadow:0 0 18px rgba(248,113,113,.16) inset}
.battle-target-hitbox.target-friendly{border-color:rgba(74,222,128,.58);box-shadow:0 0 18px rgba(74,222,128,.16) inset}
.battle-target-hitbox:hover,.battle-target-hitbox:focus-visible{background:rgba(255,255,255,.075);border-width:3px}
@media(max-width:1180px){.battle-target-hitbox{width:158px;height:132px;top:-3px}}

/* ============================================================
   v0.27.4 — battlefield scale / framing / target cleanup pass
   ============================================================ */
.layout{
  min-height:calc(100vh - 88px);
  padding-top:18px;
  padding-bottom:22px;
}
.layout::before{
  background-position:center 64%;
  background-size:cover;
  filter:saturate(.96) brightness(.84);
}
.battle-sprite-layer{
  inset:48px 220px 58px;
}
.battle-sprite{
  width:210px;
  height:232px;
}
.battle-sprite img{
  width:var(--rf-sprite-size, 180px);
  height:var(--rf-sprite-size, 180px);
  max-width:none;
  max-height:none;
  object-fit:contain;
}
/* Directional class art already has a true front-inward angle. Only generated
   Realm 1 creatures/bosses use horizontal mirroring on Team 2. */
.battle-sprite.team-2 img{transform:none}
.battle-sprite img.sprite-mirror{transform:scaleX(-1)}

/* Compact 2x2 party formations keep each team visibly together inside the
   central clearing instead of scattering characters into the trees. */
.battle-sprite.slot-0.team-1{left:15%;top:22%}
.battle-sprite.slot-1.team-1{left:2%;top:10%}
.battle-sprite.slot-2.team-1{left:2%;top:55%}
.battle-sprite.slot-3.team-1{left:15%;top:52%}
.battle-sprite.slot-0.team-2{right:15%;top:22%}
.battle-sprite.slot-1.team-2{right:2%;top:10%}
.battle-sprite.slot-2.team-2{right:2%;top:55%}
.battle-sprite.slot-3.team-2{right:15%;top:52%}

/* Intentional world scale. PNG canvas size no longer decides creature size. */
.battle-sprite.sprite-player{--rf-sprite-size:188px}
.battle-sprite.sprite-raccoon{--rf-sprite-size:78px}
.battle-sprite.sprite-deer,.battle-sprite.sprite-stag{--rf-sprite-size:126px}
.battle-sprite.sprite-wolf{--rf-sprite-size:116px}
.battle-sprite.sprite-boar{--rf-sprite-size:120px}
.battle-sprite.sprite-tiger{--rf-sprite-size:142px}
.battle-sprite.sprite-bear{--rf-sprite-size:154px}
.battle-sprite.sprite-elephant{--rf-sprite-size:192px}
.battle-sprite.sprite-druid-boss{--rf-sprite-size:168px}
.battle-sprite.sprite-witch-boss{--rf-sprite-size:164px}
.battle-sprite.sprite-necromancer-boss{--rf-sprite-size:166px}
.battle-sprite.sprite-briarheart{--rf-sprite-size:208px}
.battle-sprite.sprite-gnome-brawler,
.battle-sprite.sprite-gnome-scout,
.battle-sprite.sprite-gnome-warrior,
.battle-sprite.sprite-gnome-fighter{--rf-sprite-size:108px}
.battle-sprite.sprite-placeholder{--rf-sprite-size:132px}

.battle-sprite .sprite-name{font-size:11px;max-width:180px}
.battle-sprite .sprite-hp{width:112px;height:8px}

/* Keep target selection generous even when the creature itself is small. */
.battle-target-hitbox{
  width:224px;
  height:196px;
  top:4px;
  border-radius:34px;
}

/* Target controls are anchored to the viewport so Back is never below the fold.
   The battlefield itself is the target picker, so no giant black panel is needed. */
body.battlefield-targeting #promptPanel{
  position:fixed;
  z-index:80;
  left:50%;
  bottom:24px;
  transform:translateX(-50%)!important;
  width:min(480px,calc(100vw - 32px));
  opacity:1!important;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  backdrop-filter:none!important;
  overflow:visible!important;
}
body.battlefield-targeting #promptPanel .prompt-body{padding:0;overflow:visible}
body.battlefield-targeting .target-selection-header{
  margin:0;
  padding:7px;
  border-radius:15px;
  background:rgba(8,10,13,.78);
  border:1px solid rgba(255,255,255,.12);
  backdrop-filter:blur(8px);
}
body.battlefield-targeting .target-selection-header .target-back-button{
  min-height:48px;
  min-width:104px;
  font-size:13px;
  font-weight:900;
}
body.battlefield-targeting .target-selection-header .target-castable{min-height:48px;font-weight:850}

/* If target Back returns to the Action hand during resolution, keep that hand
   visually floating over the battlefield instead of resurrecting the old frame. */
body.team-resolving.resolution-action-prompt #promptPanel{
  opacity:1!important;
  transform:none!important;
  pointer-events:auto!important;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  backdrop-filter:none!important;
  overflow:visible!important;
}
body.team-resolving.resolution-action-prompt #promptPanel .panel-head{display:none!important}
body.team-resolving.resolution-action-prompt #promptPanel .prompt-body{padding:0 4px 12px;min-height:0}

/* Free actions are visibly committed but keep the same fighter's hand open. */
.team-plan-fighter .queued-free-action{
  opacity:.38!important;
  filter:saturate(.45);
  pointer-events:none!important;
}

/* Bigger, slower combat numbers: purple fill with a strong yellow pixel-like outline. */
.battle-damage-float{
  z-index:42;
  color:#b65cff!important;
  font-size:31px;
  line-height:1;
  font-weight:1000;
  -webkit-text-stroke:2px #ffd84d;
  paint-order:stroke fill;
  text-shadow:
    -2px -2px 0 #ffd84d, 2px -2px 0 #ffd84d,
    -2px 2px 0 #ffd84d, 2px 2px 0 #ffd84d,
    0 3px 5px rgba(0,0,0,.85);
  animation:rf-float-readable 1.55s ease-out forwards;
}
@keyframes rf-float-readable{
  0%{transform:translate(-50%,8px) scale(.78);opacity:0}
  12%{transform:translate(-50%,0) scale(1.08);opacity:1}
  68%{transform:translate(-50%,-34px) scale(1);opacity:1}
  100%{transform:translate(-50%,-62px) scale(.96);opacity:0}
}

@media(max-width:1180px){
  .battle-sprite-layer{inset:52px 170px 64px}
  .battle-sprite{width:174px;height:205px}
  .battle-sprite.sprite-player{--rf-sprite-size:158px}
  .battle-sprite.sprite-raccoon{--rf-sprite-size:68px}
  .battle-sprite.sprite-deer,.battle-sprite.sprite-stag{--rf-sprite-size:108px}
  .battle-sprite.sprite-wolf{--rf-sprite-size:101px}
  .battle-sprite.sprite-boar{--rf-sprite-size:104px}
  .battle-sprite.sprite-tiger{--rf-sprite-size:122px}
  .battle-sprite.sprite-bear{--rf-sprite-size:132px}
  .battle-sprite.sprite-elephant{--rf-sprite-size:160px}
  .battle-target-hitbox{width:190px;height:170px;top:6px}
}
@media(max-width:900px){
  body.battlefield-targeting #promptPanel{position:relative;left:auto;bottom:auto;transform:none!important;width:auto}
}
.battle-sprite.sprite-witch{--rf-sprite-size:164px}
.battle-sprite.sprite-necromancer{--rf-sprite-size:166px}
.battle-sprite.sprite-druid{--rf-sprite-size:168px}

/* ============================================================
   v0.27.7 — battlefield spacing / readable combat feedback
   ============================================================ */
/* Reframed Realm 1 clearing: the source image is cropped toward the open ground,
   and the CSS keeps that clearing centered behind both staggered parties. */
.layout::before{
  background-position:center 56%;
  background-size:cover;
}

/* Pull the sprite stage inward from the side information panels and leave more
   clean ground below the final row so names/HP bars are not covered by cards. */
.battle-sprite-layer{
  inset:26px 260px 44px;
}
.battle-sprite{
  width:200px;
  height:212px;
}

/* Ordered staggered party formation. Slot order is visual order: Player 1 is
   always the top model, then Player 2, Player 3, Player 4. Team 2 mirrors it. */
.battle-sprite.slot-0.team-1{left:19%;top:0%}
.battle-sprite.slot-1.team-1{left:6%;top:22%}
.battle-sprite.slot-2.team-1{left:19%;top:44%}
.battle-sprite.slot-3.team-1{left:6%;top:66%}
.battle-sprite.slot-0.team-2{right:19%;top:0%}
.battle-sprite.slot-1.team-2{right:6%;top:22%}
.battle-sprite.slot-2.team-2{right:19%;top:44%}
.battle-sprite.slot-3.team-2{right:6%;top:66%}

/* Targeting stays forgiving, but the plate now hugs the visible model instead
   of extending across a huge section of the battlefield. */
.battle-target-hitbox{
  width:clamp(128px,calc(var(--rf-sprite-size,140px) + 22px),172px);
  height:clamp(120px,calc(var(--rf-sprite-size,140px) + 18px),166px);
  top:18px;
  border-radius:25px;
  border-width:2px;
}

/* Discard remains a neutral grey utility control in the team planner. */
.team-plan-fighter .discard-plan-action,
.team-plan-discard-confirm{
  border-color:rgba(148,163,184,.30)!important;
  background:linear-gradient(180deg,rgba(75,85,99,.42),rgba(55,65,81,.40))!important;
  color:#eef2f7!important;
}
.team-plan-fighter .discard-plan-action:hover:not(:disabled),
.team-plan-discard-confirm:hover:not(:disabled){
  border-color:rgba(203,213,225,.48)!important;
  background:linear-gradient(180deg,rgba(107,114,128,.50),rgba(75,85,99,.45))!important;
}
.team-plan-discard-controls{margin-bottom:10px}

/* Basic Attack movement is deliberately larger and longer than generic card
   lunges so a normal attack cannot visually read as the character standing still. */
.battle-sprite.basic-attack-right{animation:rf-basic-lunge-right .65s cubic-bezier(.2,.75,.25,1)}
.battle-sprite.basic-attack-left{animation:rf-basic-lunge-left .65s cubic-bezier(.2,.75,.25,1)}
@keyframes rf-basic-lunge-right{
  0%,100%{transform:translate(0,0) scale(1)}
  48%{transform:translate(148px,-7px) scale(1.08)}
}
@keyframes rf-basic-lunge-left{
  0%,100%{transform:translate(0,0) scale(1)}
  48%{transform:translate(-148px,-7px) scale(1.08)}
}

/* Combat numbers by effect family. Fill = readable bright center; outline =
   darker family tone, except True/status damage keeps the purple/yellow look. */
.battle-damage-float{
  --rf-float-fill:#b65cff;
  --rf-float-outline:#ffd84d;
  z-index:42;
  color:var(--rf-float-fill)!important;
  font-size:32px;
  line-height:1;
  font-weight:1000;
  -webkit-text-stroke:2px var(--rf-float-outline);
  paint-order:stroke fill;
  text-shadow:
    -2px -2px 0 var(--rf-float-outline),2px -2px 0 var(--rf-float-outline),
    -2px 2px 0 var(--rf-float-outline),2px 2px 0 var(--rf-float-outline),
    0 4px 6px rgba(0,0,0,.88);
  animation:rf-float-readable-v277 1.95s ease-out forwards;
}
.battle-damage-float.physical{--rf-float-fill:#ff6b6b;--rf-float-outline:#7f1010}
.battle-damage-float.magic{--rf-float-fill:#69c2ff;--rf-float-outline:#103d7a}
.battle-damage-float.heal{--rf-float-fill:#91f5a5;--rf-float-outline:#145c2d}
.battle-damage-float.true{--rf-float-fill:#b65cff;--rf-float-outline:#ffd84d}
@keyframes rf-float-readable-v277{
  0%{transform:translate(-50%,10px) scale(.76);opacity:0}
  10%{transform:translate(-50%,0) scale(1.12);opacity:1}
  72%{transform:translate(-50%,-40px) scale(1);opacity:1}
  100%{transform:translate(-50%,-72px) scale(.96);opacity:0}
}

@media(max-width:1180px){
  .battle-sprite-layer{inset:34px 195px 48px}
  .battle-sprite{width:174px;height:190px}
  .battle-sprite.slot-0.team-1{left:18%;top:0%}
  .battle-sprite.slot-1.team-1{left:5%;top:22%}
  .battle-sprite.slot-2.team-1{left:18%;top:44%}
  .battle-sprite.slot-3.team-1{left:5%;top:66%}
  .battle-sprite.slot-0.team-2{right:18%;top:0%}
  .battle-sprite.slot-1.team-2{right:5%;top:22%}
  .battle-sprite.slot-2.team-2{right:18%;top:44%}
  .battle-sprite.slot-3.team-2{right:5%;top:66%}
  .battle-target-hitbox{
    width:clamp(120px,calc(var(--rf-sprite-size,125px) + 18px),154px);
    height:clamp(114px,calc(var(--rf-sprite-size,125px) + 14px),148px);
    top:15px;
  }
}

/* ============================================================
   v0.27.8 — compact W101-style planning hand + lower battlefield
   ============================================================ */
/* Lower both parties into the clearing so the top row never fights the sticky
   header/turn UI. Keep the requested alternating x/y stagger in slot order. */
.layout::before{
  background-position:center 68%;
}
.battle-sprite-layer{
  inset:40px 260px 14px;
}
.battle-sprite.slot-0.team-1{left:19%;top:8%}
.battle-sprite.slot-1.team-1{left:6%;top:27%}
.battle-sprite.slot-2.team-1{left:19%;top:46%}
.battle-sprite.slot-3.team-1{left:6%;top:65%}
.battle-sprite.slot-0.team-2{right:19%;top:8%}
.battle-sprite.slot-1.team-2{right:6%;top:27%}
.battle-sprite.slot-2.team-2{right:19%;top:46%}
.battle-sprite.slot-3.team-2{right:6%;top:65%}

/* Planning is one compact strip: three utilities above, all seven cards in one
   horizontal row below. No instructional frame or extra explanatory copy. */
body.team-planning .team-plan-shell{gap:0}
body.team-planning .team-plan-fighter{padding:2px 0 6px}
body.team-planning .team-plan-head{
  min-height:34px;
  padding:0 4px 5px;
  margin:0;
  display:flex;
  align-items:center;
  justify-content:space-between;
}
body.team-planning .team-plan-head strong{
  font-size:13px;
  letter-spacing:.01em;
}
.team-plan-head-right{display:flex;align-items:center;gap:8px}
.team-plan-timer{
  min-width:55px;
  height:30px;
  padding:0 9px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:2px;
  border-radius:999px;
  background:rgba(126,34,206,.34);
  border:1px solid rgba(192,132,252,.52);
  color:#f3e8ff;
  font-weight:950;
  font-variant-numeric:tabular-nums;
  box-shadow:0 0 18px rgba(126,34,206,.13);
}
.team-plan-timer-value{font-size:17px;line-height:1}
.team-plan-timer small{font-size:9px;color:#d8b4fe}
.team-plan-timer.warning{background:rgba(126,34,206,.56);border-color:rgba(216,180,254,.80)}
.team-plan-timer.expired{opacity:.68}

body.team-planning .team-plan-fighter .utility-action-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
  margin:0 auto 7px;
  width:min(520px,100%);
}
body.team-planning .team-plan-fighter .utility-action-grid .action-card.utility{
  min-height:39px;
  padding:7px 10px;
  border-radius:999px;
  text-align:center;
  display:grid;
  place-items:center;
}
body.team-planning .team-plan-fighter .utility-action-grid .action-name{
  padding:0;
  font-size:11px;
  line-height:1.05;
  text-align:center;
}
body.team-planning .team-plan-fighter .utility-action-grid .action-desc,
body.team-planning .team-plan-fighter .utility-action-grid .action-cost{
  display:none!important;
}

body.team-planning .team-plan-fighter .realm-card-grid{
  width:100%;
  max-width:932px;
  margin:0 auto;
  display:flex;
  flex-wrap:nowrap;
  justify-content:center;
  align-items:flex-start;
  gap:6px;
  overflow:visible;
}
body.team-planning .team-plan-fighter .realm-card-choice{
  width:128px;
  flex:0 0 128px;
  gap:0;
  transform:none;
  border-radius:12px;
}
body.team-planning .team-plan-fighter .realm-card-stage{
  width:128px;
  height:184px;
  border-radius:13px;
  overflow:hidden;
  filter:drop-shadow(0 7px 10px rgba(0,0,0,.30));
}
body.team-planning .team-plan-fighter .realm-card-frame{
  width:330px;
  height:475px;
  border:0;
  background:transparent!important;
  transform:scale(.388);
  transform-origin:top left;
}
body.team-planning .team-plan-fighter .realm-card-choice:hover .realm-card-stage,
body.team-planning .team-plan-fighter .realm-card-choice:focus-visible .realm-card-stage{
  transform:translateY(-4px) scale(1.02);
}

@media(max-width:1500px) and (min-width:901px){
  body.team-planning .team-plan-fighter .realm-card-grid{max-width:820px;gap:5px}
  body.team-planning .team-plan-fighter .realm-card-choice{width:112px;flex-basis:112px}
  body.team-planning .team-plan-fighter .realm-card-stage{width:112px;height:161px}
  body.team-planning .team-plan-fighter .realm-card-frame{transform:scale(.3394)}
  .battle-sprite-layer{inset:40px 205px 14px}
}
@media(max-width:1180px) and (min-width:901px){
  body.team-planning .team-plan-fighter .realm-card-grid{max-width:715px;gap:4px}
  body.team-planning .team-plan-fighter .realm-card-choice{width:98px;flex-basis:98px}
  body.team-planning .team-plan-fighter .realm-card-stage{width:98px;height:141px}
  body.team-planning .team-plan-fighter .realm-card-frame{transform:scale(.297)}
  .battle-sprite.slot-0.team-1{left:18%;top:8%}
  .battle-sprite.slot-1.team-1{left:5%;top:27%}
  .battle-sprite.slot-2.team-1{left:18%;top:46%}
  .battle-sprite.slot-3.team-1{left:5%;top:65%}
  .battle-sprite.slot-0.team-2{right:18%;top:8%}
  .battle-sprite.slot-1.team-2{right:5%;top:27%}
  .battle-sprite.slot-2.team-2{right:18%;top:46%}
  .battle-sprite.slot-3.team-2{right:5%;top:65%}
}


/* ============================================================
   v0.27.9 — centered planning hand / stable clock / motion cleanup
   ============================================================ */
.team-phase-badge{display:none!important}

/* Fullscreen planning belongs in the visual center of the battlefield, not
   pinned to the top of the center column. */
body.team-planning #promptPanel{
  position:fixed!important;
  z-index:72!important;
  left:50%!important;
  top:52%!important;
  bottom:auto!important;
  transform:translate(-50%,-50%)!important;
  width:min(1160px,calc(100vw - 56px))!important;
  max-height:calc(100vh - 118px);
}
body.team-planning #promptPanel .prompt-body{padding:0 8px 8px!important;overflow:visible}
body.team-planning .team-plan-fighter{overflow:visible}
body.team-planning .team-plan-head{
  position:relative;
  min-height:48px;
  padding:7px 8px 9px;
  margin:0 0 5px;
  overflow:visible;
}
body.team-planning .team-plan-head strong{
  font-size:14px;
  line-height:1.25;
  padding-right:70px;
  white-space:nowrap;
  overflow:visible;
}
/* The clock has one fixed home in the exact center of the planning header, so
   longer names and switching P1→P2 cannot make it jump around. */
body.team-planning .team-plan-timer{
  position:absolute;
  left:50%;
  top:6px;
  transform:translateX(-50%);
  min-width:64px;
  height:34px;
  margin:0;
}
body.team-planning .team-plan-lock{margin-left:auto}

body.team-planning .team-plan-fighter .utility-action-grid{
  width:min(560px,100%);
  margin:0 auto 10px;
  gap:10px;
}
body.team-planning .team-plan-fighter .utility-action-grid .action-card.utility{
  min-height:42px;
  border-radius:999px;
  background:linear-gradient(180deg,rgba(38,44,52,.86),rgba(25,30,37,.88));
  border-color:rgba(148,163,184,.24);
}
/* Discard is intentionally the lighter grey utility; Base Attack and Pass stay dark. */
body.team-planning .team-plan-fighter .utility-action-grid .discard-plan-action{
  background:linear-gradient(180deg,rgba(148,163,184,.48),rgba(100,116,139,.42))!important;
  border-color:rgba(203,213,225,.52)!important;
  color:#f8fafc!important;
}

/* Seven readable cards, still one row, slightly larger than v0.27.8. */
body.team-planning .team-plan-fighter .realm-card-grid,
body.team-planning .team-plan-subpicker .realm-card-grid{
  width:100%;
  max-width:1088px;
  margin:0 auto;
  display:flex;
  flex-wrap:nowrap;
  justify-content:center;
  align-items:flex-start;
  gap:7px;
  overflow:visible;
}
body.team-planning .team-plan-fighter .realm-card-choice,
body.team-planning .team-plan-subpicker .realm-card-choice{
  width:148px;
  flex:0 0 148px;
  transform:none;
}
body.team-planning .team-plan-fighter .realm-card-stage,
body.team-planning .team-plan-subpicker .realm-card-stage{
  width:148px;
  height:213px;
  border-radius:14px;
  overflow:hidden;
}
body.team-planning .team-plan-fighter .realm-card-frame,
body.team-planning .team-plan-subpicker .realm-card-frame{
  width:330px;
  height:475px;
  transform:scale(.4485);
  transform-origin:top left;
  background:transparent!important;
}

/* Modern planning sub-pickers (Discard / Sharpen Tip / Enchantments) stay on
   the same transparent centered surface instead of the old black 4x3 panel. */
.team-plan-subpicker{padding:4px 0 10px}
.team-plan-subpicker-head{
  min-height:48px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:14px;
  margin-bottom:8px;
}
.team-plan-subpicker-head .target-back-button{position:absolute;left:10px;margin:0}
.team-plan-subpicker-head strong{font-size:14px;color:#f8fafc}
body.team-planning .team-plan-discard-controls{
  width:min(560px,100%);
  margin:0 auto 10px;
  position:relative;
  top:auto;
  padding:0;
  background:transparent;
  display:flex;
  justify-content:center;
  gap:10px;
}
body.team-planning .team-plan-discard-controls .team-plan-discard-confirm{
  background:linear-gradient(180deg,rgba(148,163,184,.50),rgba(100,116,139,.44))!important;
  border-color:rgba(203,213,225,.54)!important;
}
body.team-planning .discard-card-grid{
  width:100%;
  max-width:1088px;
  margin:0 auto;
  display:flex;
  flex-wrap:nowrap;
  justify-content:center;
  gap:7px;
  overflow:visible;
}
body.team-planning .discard-card-grid .realm-card-choice{width:148px;flex:0 0 148px}
body.team-planning .discard-card-grid .realm-card-stage{width:148px;height:213px}
body.team-planning .discard-card-grid .realm-card-frame{transform:scale(.4485)}

/* Fallback runtime hand-attachment prompt uses the same transparent centered
   card presentation if an unusual card cannot be preplanned. */
body.modern-hand-subpicker #promptPanel{
  position:fixed;z-index:82;left:50%;top:52%;bottom:auto;
  transform:translate(-50%,-50%)!important;
  width:min(1160px,calc(100vw - 56px));
  background:transparent!important;border:0!important;box-shadow:none!important;
  backdrop-filter:none!important;overflow:visible!important;
}
body.modern-hand-subpicker #promptPanel .panel-head{display:none!important}
body.modern-hand-subpicker #promptPanel .prompt-body{padding:0 8px 8px;overflow:visible}
body.modern-hand-subpicker .hand-attachment-note{display:none}
body.modern-hand-subpicker .hand-attachment-controls{background:transparent;margin:0 auto 10px;display:flex;justify-content:center}
body.modern-hand-subpicker .hand-attachment-grid{
  width:100%;max-width:1088px;margin:0 auto;display:flex;flex-wrap:nowrap;justify-content:center;gap:7px;overflow:visible;
}
body.modern-hand-subpicker .hand-attachment-grid .realm-card-choice{width:148px;flex:0 0 148px}
body.modern-hand-subpicker .hand-attachment-grid .realm-card-stage{width:148px;height:213px}
body.modern-hand-subpicker .hand-attachment-grid .realm-card-frame{transform:scale(.4485);background:transparent!important}

/* Heal feedback must remain green; this explicit higher-specificity rule beats
   every historical purple true-damage fallback. */
.battle-damage-float.heal{
  --rf-float-fill:#a7f3b4!important;
  --rf-float-outline:#145c2d!important;
  color:var(--rf-float-fill)!important;
  -webkit-text-stroke-color:var(--rf-float-outline)!important;
}

@media(max-width:1500px) and (min-width:901px){
  body.team-planning #promptPanel{width:min(1010px,calc(100vw - 44px))!important}
  body.team-planning .team-plan-fighter .realm-card-grid,
  body.team-planning .team-plan-subpicker .realm-card-grid,
  body.team-planning .discard-card-grid{max-width:940px;gap:6px}
  body.team-planning .team-plan-fighter .realm-card-choice,
  body.team-planning .team-plan-subpicker .realm-card-choice,
  body.team-planning .discard-card-grid .realm-card-choice{width:128px;flex-basis:128px}
  body.team-planning .team-plan-fighter .realm-card-stage,
  body.team-planning .team-plan-subpicker .realm-card-stage,
  body.team-planning .discard-card-grid .realm-card-stage{width:128px;height:184px}
  body.team-planning .team-plan-fighter .realm-card-frame,
  body.team-planning .team-plan-subpicker .realm-card-frame,
  body.team-planning .discard-card-grid .realm-card-frame{transform:scale(.388)}
}
@media(max-width:1180px) and (min-width:901px){
  body.team-planning #promptPanel{width:min(875px,calc(100vw - 36px))!important}
  body.team-planning .team-plan-fighter .realm-card-grid,
  body.team-planning .team-plan-subpicker .realm-card-grid,
  body.team-planning .discard-card-grid{max-width:820px;gap:5px}
  body.team-planning .team-plan-fighter .realm-card-choice,
  body.team-planning .team-plan-subpicker .realm-card-choice,
  body.team-planning .discard-card-grid .realm-card-choice{width:112px;flex-basis:112px}
  body.team-planning .team-plan-fighter .realm-card-stage,
  body.team-planning .team-plan-subpicker .realm-card-stage,
  body.team-planning .discard-card-grid .realm-card-stage{width:112px;height:161px}
  body.team-planning .team-plan-fighter .realm-card-frame,
  body.team-planning .team-plan-subpicker .realm-card-frame,
  body.team-planning .discard-card-grid .realm-card-frame{transform:scale(.3394)}
}


/* ============================================================
   v0.27.10 — scale / target-picker / roster polish
   ============================================================ */
/* Playable characters should read as the heroes of the scene, not tiny tokens. */
.battle-sprite.sprite-player{--rf-sprite-size:220px}
.battle-sprite:has(> img[src*="/static/skins/directions/"]){width:236px;height:252px}

/* Side roster is reference UI, not the visual focus: roughly 3/4 of the old
   vertical footprint while keeping names, Mana and health readable. */
.team-column .team-stack{gap:8px}
.team-column .fighter-card{padding:9px 10px;border-radius:13px}
.team-column .fighter-card::before{border-radius:13px 0 0 13px}
.team-column .fighter-head{grid-template-columns:30px minmax(0,1fr) auto;gap:6px}
.team-column .fighter-icon{width:28px;height:28px;border-radius:8px;font-size:16px}
.team-column .fighter-name{font-size:12px}
.team-column .fighter-name.name-long{font-size:11px}
.team-column .fighter-name.name-very-long{font-size:10px}
.team-column .fighter-name.name-extreme{font-size:9px}
.team-column .fighter-class,.team-column .fighter-level{font-size:8px}
.team-column .fighter-meta-line{gap:4px;margin-top:0}
.team-column .fighter-head-actions{gap:3px}
.team-column .mana-chip{font-size:9px;padding:3px 5px}
.team-column .fighter-stat-toggle{width:21px;height:21px;font-size:10px}
.team-column .bar{height:18px;margin-top:7px;border-radius:7px}
.team-column .bar-text{font-size:8px}
.team-column .effects{gap:3px;margin-top:5px}
.team-column .effect-chip{font-size:7.5px;padding:3px 5px}
.team-column .summons{margin-top:5px;gap:3px}
.team-column .summon{font-size:8px;padding:5px}

/* Discard is the same neutral utility treatment as Base Attack and Pass. */
body.team-planning .team-plan-fighter .utility-action-grid .discard-plan-action,
body.team-planning .team-plan-fighter .utility-action-grid .discard-plan-action:hover:not(:disabled),
body.team-planning .team-plan-discard-controls .team-plan-discard-confirm,
body.team-planning .team-plan-discard-controls .team-plan-discard-confirm:hover:not(:disabled){
  background:linear-gradient(180deg,rgba(38,44,52,.86),rgba(25,30,37,.88))!important;
  border-color:rgba(148,163,184,.24)!important;
  color:#f8fafc!important;
}

/* Seven cards remain one row, but are larger and packed closer together. */
body.team-planning #promptPanel{width:min(1210px,calc(100vw - 44px))!important}
body.team-planning .team-plan-fighter .realm-card-grid,
body.team-planning .team-plan-subpicker .realm-card-grid,
body.team-planning .discard-card-grid{
  max-width:1140px!important;
  gap:4px!important;
}
body.team-planning .team-plan-fighter .realm-card-choice,
body.team-planning .team-plan-subpicker .realm-card-choice,
body.team-planning .discard-card-grid .realm-card-choice{
  width:158px!important;
  flex-basis:158px!important;
}
body.team-planning .team-plan-fighter .realm-card-stage,
body.team-planning .team-plan-subpicker .realm-card-stage,
body.team-planning .discard-card-grid .realm-card-stage{
  width:158px!important;
  height:227px!important;
}
body.team-planning .team-plan-fighter .realm-card-frame,
body.team-planning .team-plan-subpicker .realm-card-frame,
body.team-planning .discard-card-grid .realm-card-frame{
  transform:scale(.4788)!important;
}

/* Target plates hug the artwork vertically instead of being anchored near the
   top of the carrier. This especially fixes the small raccoon target. */
.battle-target-hitbox{
  top:auto!important;
  bottom:27px!important;
  width:clamp(116px,calc(var(--rf-sprite-size,140px) + 14px),166px)!important;
  height:clamp(108px,calc(var(--rf-sprite-size,140px) + 10px),160px)!important;
}
.battle-sprite.sprite-raccoon .battle-target-hitbox{
  width:92px!important;
  height:84px!important;
  bottom:29px!important;
  border-radius:20px!important;
}

/* Team-planning target selection occupies the same centered UI zone as the
   hand, and uses the exact same live 35-second deadline. */
body.team-planning.battlefield-targeting #promptPanel{
  position:fixed!important;
  z-index:86!important;
  left:50%!important;
  top:52%!important;
  bottom:auto!important;
  transform:translate(-50%,-50%)!important;
  width:min(720px,calc(100vw - 44px))!important;
  max-height:none!important;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  backdrop-filter:none!important;
  overflow:visible!important;
}
body.team-planning.battlefield-targeting #promptPanel .prompt-body{padding:0!important;overflow:visible!important}
body.team-planning.battlefield-targeting .target-selection-header.team-plan-target-header{
  position:relative;
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;
  gap:12px;
  margin:0 auto;
  padding:8px 10px;
  min-height:54px;
  max-width:680px;
  border-radius:16px;
  background:rgba(8,10,13,.82);
  border:1px solid rgba(255,255,255,.13);
  backdrop-filter:blur(8px);
}
body.team-planning.battlefield-targeting .team-plan-target-header .target-back-button{
  position:static!important;
  min-width:94px;
  min-height:42px;
  margin:0!important;
}
body.team-planning.battlefield-targeting .team-plan-target-header .target-castable{
  min-height:42px;
  display:grid;
  place-items:center;
  font-size:14px;
  font-weight:900;
  text-align:center;
}
body.team-planning.battlefield-targeting .team-plan-target-header .team-plan-target-timer{
  position:static!important;
  transform:none!important;
  margin:0!important;
  min-width:64px;
  height:34px;
}

@media(max-width:1500px) and (min-width:1181px){
  body.team-planning #promptPanel{width:min(1050px,calc(100vw - 36px))!important}
  body.team-planning .team-plan-fighter .realm-card-grid,
  body.team-planning .team-plan-subpicker .realm-card-grid,
  body.team-planning .discard-card-grid{max-width:1000px!important;gap:4px!important}
  body.team-planning .team-plan-fighter .realm-card-choice,
  body.team-planning .team-plan-subpicker .realm-card-choice,
  body.team-planning .discard-card-grid .realm-card-choice{width:138px!important;flex-basis:138px!important}
  body.team-planning .team-plan-fighter .realm-card-stage,
  body.team-planning .team-plan-subpicker .realm-card-stage,
  body.team-planning .discard-card-grid .realm-card-stage{width:138px!important;height:198px!important}
  body.team-planning .team-plan-fighter .realm-card-frame,
  body.team-planning .team-plan-subpicker .realm-card-frame,
  body.team-planning .discard-card-grid .realm-card-frame{transform:scale(.4182)!important}
}
@media(max-width:1180px) and (min-width:901px){
  .battle-sprite.sprite-player{--rf-sprite-size:185px}
  .battle-sprite:has(> img[src*="/static/skins/directions/"]){width:198px;height:220px}
  body.team-planning #promptPanel{width:min(900px,calc(100vw - 30px))!important}
  body.team-planning .team-plan-fighter .realm-card-grid,
  body.team-planning .team-plan-subpicker .realm-card-grid,
  body.team-planning .discard-card-grid{max-width:860px!important;gap:3px!important}
  body.team-planning .team-plan-fighter .realm-card-choice,
  body.team-planning .team-plan-subpicker .realm-card-choice,
  body.team-planning .discard-card-grid .realm-card-choice{width:118px!important;flex-basis:118px!important}
  body.team-planning .team-plan-fighter .realm-card-stage,
  body.team-planning .team-plan-subpicker .realm-card-stage,
  body.team-planning .discard-card-grid .realm-card-stage{width:118px!important;height:170px!important}
  body.team-planning .team-plan-fighter .realm-card-frame,
  body.team-planning .team-plan-subpicker .realm-card-frame,
  body.team-planning .discard-card-grid .realm-card-frame{transform:scale(.3576)!important}
}


/* ============================================================
   v0.27.11 — battlefield-anchored hand / clean arena / summon formation
   ============================================================ */
/* The visible activity log is removed from the battle layout. Combat events
   continue to exist for engine/debug plumbing, but they no longer consume
   battlefield space under Team 1. */
.activity-panel{display:none!important}

/* Planning belongs to the arena itself, not the browser viewport. Making the
   center column static lets the absolutely-positioned prompt anchor to .layout. */
body.team-planning .center-column,
body.modern-hand-subpicker .center-column{position:static!important}
body.team-planning #promptPanel,
body.modern-hand-subpicker #promptPanel{
  position:absolute!important;
  z-index:72!important;
  left:50%!important;
  top:50%!important;
  bottom:auto!important;
  transform:translate(-50%,-50%)!important;
  width:min(1210px,calc(100% - 40px))!important;
  max-height:calc(100% - 60px)!important;
}
body.team-planning.battlefield-targeting #promptPanel{
  position:absolute!important;
  left:50%!important;
  top:50%!important;
  bottom:auto!important;
  transform:translate(-50%,-50%)!important;
  width:min(720px,calc(100% - 44px))!important;
}

/* V0.31.8 — shared formation, responsive 53/48/40px based on congestion.
   Higher specificity prevents generic fighter sprites from inflating summons. */
.battle-sprite > img.battle-summon-sprite{
  position:absolute!important;
  width:40px!important;
  height:40px!important;
  max-width:none!important;
  max-height:none!important;
  min-width:0!important;
  object-fit:contain!important;
  right:auto!important;
  bottom:auto!important;
  image-rendering:pixelated;
  z-index:7;
}

/* ============================================================
   v0.27.12 — tight seven-card arena hand
   ============================================================ */
/* Give the battlefield more real horizontal room instead of shrinking or
   overlapping the seven-card hand. The side reference columns were already
   visually compressed in v0.27.10, so they can safely occupy less width. */
@media(min-width:1501px){
  .layout{
    grid-template-columns:minmax(200px,225px) minmax(0,1fr) minmax(200px,225px)!important;
    gap:8px!important;
    padding-left:14px!important;
    padding-right:14px!important;
    max-width:1840px!important;
  }

  /* Anchor the planner to the actual center battlefield column again. */
  body.team-planning .center-column,
  body.modern-hand-subpicker .center-column{
    position:relative!important;
  }
  body.team-planning #promptPanel,
  body.modern-hand-subpicker #promptPanel{
    left:50%!important;
    width:min(1130px,calc(100% - 4px))!important;
  }

  /* Keep full readable card size. No overlap: just remove dead air. */
  body.team-planning .team-plan-fighter .realm-card-grid,
  body.team-planning .team-plan-subpicker .realm-card-grid,
  body.team-planning .discard-card-grid,
  body.modern-hand-subpicker .realm-card-grid{
    max-width:1118px!important;
    column-gap:1px!important;
    row-gap:4px!important;
    flex-wrap:nowrap!important;
  }
  body.team-planning .team-plan-fighter .realm-card-choice,
  body.team-planning .team-plan-subpicker .realm-card-choice,
  body.team-planning .discard-card-grid .realm-card-choice,
  body.modern-hand-subpicker .realm-card-choice{
    width:158px!important;
    flex:0 0 158px!important;
  }
}

/* ============================================================
   v0.27.13 — impact sequencing / summon motion / picker highlight
   ============================================================ */
/* The side roster highlights only the fighter whose hand this browser is
   actively choosing. It deliberately disappears while watching the opponent. */
.team-column .fighter-card.plan-picking{
  outline:2px solid rgba(244,197,106,.92)!important;
  box-shadow:0 0 0 2px rgba(244,197,106,.15),0 0 20px rgba(244,197,106,.26)!important;
  background:linear-gradient(180deg,rgba(55,48,30,.88),rgba(18,18,17,.94))!important;
}

/* Summon attacks need visible motion too; otherwise a 25-PD Skeleton strike
   looks like an unexplained floating damage number. */
.battle-summon-sprite.summon-attack-right{animation:rf-summon-lunge-right .46s cubic-bezier(.2,.78,.25,1)}
.battle-summon-sprite.summon-attack-left{animation:rf-summon-lunge-left .46s cubic-bezier(.2,.78,.25,1)}
@keyframes rf-summon-lunge-right{0%,100%{translate:0 0}48%{translate:42px -4px}}
@keyframes rf-summon-lunge-left{0%,100%{translate:0 0}48%{translate:-42px -4px}}

/* A lethal target remains fully readable for the impact/number, then settles
   into a clearly defeated grey state once the visual HP commit occurs. */
.battle-sprite.dead{opacity:.34;filter:grayscale(1) saturate(.12)}


/* ============================================================
   v0.27.15 — linked target hover + deeper enemy formation
   ============================================================ */
/* During hostile/friendly target selection, link the battlefield model to its
   side roster card so the player can instantly identify which unit is which. */
.team-column .fighter-card.target-hover-enemy{
  outline:2px solid rgba(248,113,113,.98)!important;
  box-shadow:0 0 0 2px rgba(248,113,113,.16),0 0 22px rgba(248,113,113,.34)!important;
  background:linear-gradient(180deg,rgba(66,28,28,.92),rgba(20,16,16,.96))!important;
}
.team-column .fighter-card.target-hover-friendly{
  outline:2px solid rgba(74,222,128,.95)!important;
  box-shadow:0 0 0 2px rgba(74,222,128,.14),0 0 20px rgba(74,222,128,.28)!important;
}
.battle-sprite.target-hover-linked.target-enemy{
  filter:drop-shadow(0 0 16px rgba(248,113,113,.98)) drop-shadow(0 0 5px rgba(248,113,113,.9))!important;
}
.battle-sprite.target-hover-linked.target-friendly{
  filter:drop-shadow(0 0 16px rgba(74,222,128,.96)) drop-shadow(0 0 5px rgba(74,222,128,.86))!important;
}

/* Keep Team 1's compact formation, but use the vacant right-side clearing for
   a real enemy front/back stagger. Slots 0/2 are the forward line; 1/3 are
   the rear line. The top unit is also lowered out from under the UI bar. */
.battle-sprite.slot-0.team-2{right:27%!important;top:14%!important}
.battle-sprite.slot-1.team-2{right:9%!important;top:29%!important}
.battle-sprite.slot-2.team-2{right:27%!important;top:48%!important}
.battle-sprite.slot-3.team-2{right:9%!important;top:64%!important}

@media(max-width:1500px) and (min-width:981px){
  .battle-sprite.slot-0.team-2{right:23%!important;top:14%!important}
  .battle-sprite.slot-1.team-2{right:7%!important;top:29%!important}
  .battle-sprite.slot-2.team-2{right:23%!important;top:48%!important}
  .battle-sprite.slot-3.team-2{right:7%!important;top:64%!important}
}

/* ============================================================
   v0.27.16 — explicit overflow enemy slots (5–8)
   ============================================================ */
/* Encounters can author up to eight enemies. Slots 5–8 must never fall back
   to the generic top-right origin. They form a second, farther-forward line
   inside the open clearing, continuing the enemy stagger toward Team 1. */
.battle-sprite.slot-4.team-2{right:42%!important;top:18%!important}
.battle-sprite.slot-5.team-2{right:36%!important;top:35%!important}
.battle-sprite.slot-6.team-2{right:42%!important;top:52%!important}
.battle-sprite.slot-7.team-2{right:36%!important;top:68%!important}

@media(max-width:1500px) and (min-width:981px){
  .battle-sprite.slot-4.team-2{right:37%!important;top:18%!important}
  .battle-sprite.slot-5.team-2{right:32%!important;top:35%!important}
  .battle-sprite.slot-6.team-2{right:37%!important;top:52%!important}
  .battle-sprite.slot-7.team-2{right:32%!important;top:68%!important}
}

/* ============================================================
   v0.27.17 — grass-anchored formations / planner cleanup / cast cues
   ============================================================ */
/* Planning uses one 30s clock. The obsolete CURRENT TURN / 25s pill is never
   shown while the team planner or its target picker owns the UI. */
body.team-planning #turnCard{display:none!important}
body.team-planning .team-plan-head{justify-content:center!important;min-height:36px}
body.team-planning .team-plan-head-right{margin:0 auto;justify-content:center}
body.team-planning .team-plan-lock:empty{display:none}

/* Neutral grey normally, yellow in the final 10 seconds, red in the final 5. */
.team-plan-timer{
  color:#f3f4f6!important;
  background:rgba(75,85,99,.78)!important;
  border-color:rgba(209,213,219,.42)!important;
  box-shadow:none!important;
}
.team-plan-timer small{color:#d1d5db!important}
.team-plan-timer.caution{
  color:#fff5b8!important;
  background:rgba(133,100,15,.86)!important;
  border-color:rgba(250,204,21,.78)!important;
}
.team-plan-timer.caution small{color:#fde68a!important}
.team-plan-timer.warning{
  color:#fff!important;
  background:rgba(153,27,27,.90)!important;
  border-color:rgba(248,113,113,.88)!important;
}
.team-plan-timer.warning small{color:#fecaca!important}

/* Discard/attachment sub-pickers keep the exact same live planning deadline. */
.team-plan-discard-controls{display:flex!important;align-items:center!important;justify-content:center!important;gap:10px!important}
.team-plan-discard-controls .team-plan-timer{margin-left:8px}
.team-plan-subpicker-head{grid-template-columns:auto minmax(0,1fr) auto!important}
.team-plan-attachment-timer{justify-self:end}

/* Target selection lives at the top of the arena: Back | selected action | clock.
   Battlefield models/hitboxes are the actual target controls. */
body.team-planning.battlefield-targeting #promptPanel{
  position:absolute!important;
  left:50%!important;
  top:8px!important;
  bottom:auto!important;
  transform:translateX(-50%)!important;
  width:min(720px,calc(100% - 20px))!important;
}
body.team-planning.battlefield-targeting .target-selection-header.team-plan-target-header{
  max-width:700px!important;
}
@media(min-width:901px){
  body.team-planning.battlefield-targeting .target-grid{display:none!important}
}

/* Unaffordable cards remain visible in-hand but are simply grey/unplayable. */
body.team-planning .realm-card-choice.action-disabled{
  opacity:.48!important;
  filter:grayscale(1)!important;
  pointer-events:none!important;
}
body.team-planning .realm-card-choice.action-disabled .realm-card-stage{
  filter:grayscale(1) brightness(.62) drop-shadow(0 8px 12px rgba(0,0,0,.22))!important;
}

/* Any non-attack ability visibly belongs to its caster. */
.battle-sprite.ability-cast-wiggle{animation:rf-ability-cast-wiggle .46s ease-in-out}
@keyframes rf-ability-cast-wiggle{
  0%,100%{translate:0 0}
  18%{translate:-9px 0}
  38%{translate:9px 0}
  58%{translate:-7px 0}
  78%{translate:7px 0}
}

/* Formation rows are fixed to the grass band rather than percentages of the
   ever-changing fullscreen height. Player 1 is always top; Player 6 is bottom.
   Odd-numbered slots are the forward column, evens the rear column; Team 2 mirrors. */
.battle-sprite-layer{inset:44px 250px 12px!important}

/* Four-person parties: keep the familiar stagger but pin vertical placement. */
.battle-sprite-layer.team1-count-4 .battle-sprite.slot-0.team-1{left:21%!important;top:54px!important}
.battle-sprite-layer.team1-count-4 .battle-sprite.slot-1.team-1{left:6%!important;top:190px!important}
.battle-sprite-layer.team1-count-4 .battle-sprite.slot-2.team-1{left:21%!important;top:326px!important}
.battle-sprite-layer.team1-count-4 .battle-sprite.slot-3.team-1{left:6%!important;top:462px!important}
.battle-sprite-layer.team2-count-4 .battle-sprite.slot-0.team-2{right:27%!important;top:54px!important}
.battle-sprite-layer.team2-count-4 .battle-sprite.slot-1.team-2{right:8%!important;top:190px!important}
.battle-sprite-layer.team2-count-4 .battle-sprite.slot-2.team-2{right:27%!important;top:326px!important}
.battle-sprite-layer.team2-count-4 .battle-sprite.slot-3.team-2{right:8%!important;top:462px!important}

/* Five players/enemies:
      X
             X
      X
             X
      X
*/
.battle-sprite-layer.team1-count-5 .battle-sprite.slot-0.team-1{left:27%!important;top:42px!important}
.battle-sprite-layer.team1-count-5 .battle-sprite.slot-1.team-1{left:7%!important;top:142px!important}
.battle-sprite-layer.team1-count-5 .battle-sprite.slot-2.team-1{left:27%!important;top:242px!important}
.battle-sprite-layer.team1-count-5 .battle-sprite.slot-3.team-1{left:7%!important;top:342px!important}
.battle-sprite-layer.team1-count-5 .battle-sprite.slot-4.team-1{left:27%!important;top:442px!important}
.battle-sprite-layer.team2-count-5 .battle-sprite.slot-0.team-2{right:27%!important;top:42px!important}
.battle-sprite-layer.team2-count-5 .battle-sprite.slot-1.team-2{right:7%!important;top:142px!important}
.battle-sprite-layer.team2-count-5 .battle-sprite.slot-2.team-2{right:27%!important;top:242px!important}
.battle-sprite-layer.team2-count-5 .battle-sprite.slot-3.team-2{right:7%!important;top:342px!important}
.battle-sprite-layer.team2-count-5 .battle-sprite.slot-4.team-2{right:27%!important;top:442px!important}

/* Six players/enemies continue the same alternating columns; Player 6 is bottom. */
.battle-sprite-layer.team1-count-6 .battle-sprite.slot-0.team-1{left:27%!important;top:26px!important}
.battle-sprite-layer.team1-count-6 .battle-sprite.slot-1.team-1{left:7%!important;top:106px!important}
.battle-sprite-layer.team1-count-6 .battle-sprite.slot-2.team-1{left:27%!important;top:186px!important}
.battle-sprite-layer.team1-count-6 .battle-sprite.slot-3.team-1{left:7%!important;top:266px!important}
.battle-sprite-layer.team1-count-6 .battle-sprite.slot-4.team-1{left:27%!important;top:346px!important}
.battle-sprite-layer.team1-count-6 .battle-sprite.slot-5.team-1{left:7%!important;top:426px!important}
.battle-sprite-layer.team2-count-6 .battle-sprite.slot-0.team-2{right:27%!important;top:26px!important}
.battle-sprite-layer.team2-count-6 .battle-sprite.slot-1.team-2{right:7%!important;top:106px!important}
.battle-sprite-layer.team2-count-6 .battle-sprite.slot-2.team-2{right:27%!important;top:186px!important}
.battle-sprite-layer.team2-count-6 .battle-sprite.slot-3.team-2{right:7%!important;top:266px!important}
.battle-sprite-layer.team2-count-6 .battle-sprite.slot-4.team-2{right:27%!important;top:346px!important}
.battle-sprite-layer.team2-count-6 .battle-sprite.slot-5.team-2{right:7%!important;top:426px!important}


/* ============================================================
   v0.27.18 — calmer combat pacing / Return to Nature utility
   ============================================================ */
/* One deliberate motion per attack. The JS queue holds authoritative redraws
   until these animations finish, preventing NPC motions from being replaced
   by a state refresh halfway through the lunge. */
.battle-sprite.attack-right{animation-duration:.74s!important}
.battle-sprite.attack-left{animation-duration:.74s!important}
.battle-sprite.attack-center-right{animation-duration:.78s!important}
.battle-sprite.attack-center-left{animation-duration:.78s!important}
.battle-sprite.basic-attack-right{animation-duration:.82s!important}
.battle-sprite.basic-attack-left{animation-duration:.82s!important}
.battle-summon-sprite.summon-attack-right{animation-duration:.65s!important}
.battle-summon-sprite.summon-attack-left{animation-duration:.65s!important}
.battle-sprite.hit-shake{animation-duration:.48s!important}
.battle-sprite.ability-cast-wiggle{animation-duration:.62s!important}
.battle-damage-float{animation-duration:2.25s!important}

/* Return to Nature is a fixed form utility, not a hand card. It lives on the
   upper-left of the planner and does not consume a grid column or move the
   centered Base Attack / Discard / Pass trio. */
body.team-planning .team-plan-fighter{position:relative!important}
body.team-planning .team-plan-fighter .return-nature-action{
  position:absolute!important;
  left:10px!important;
  top:51px!important;
  width:138px!important;
  min-height:42px!important;
  padding:7px 10px!important;
  border-radius:999px!important;
  display:grid!important;
  place-items:center!important;
  z-index:4!important;
  background:linear-gradient(180deg,rgba(38,44,52,.86),rgba(25,30,37,.88))!important;
  border:1px solid rgba(148,163,184,.24)!important;
  color:#f8fafc!important;
  text-align:center!important;
}
body.team-planning .team-plan-fighter .return-nature-action .action-name{
  font-size:11px!important;
  line-height:1.05!important;
  padding:0!important;
}
body.team-planning .team-plan-fighter .return-nature-action .action-desc,
body.team-planning .team-plan-fighter .return-nature-action .action-cost{display:none!important}
@media(max-width:1120px) and (min-width:901px){
  body.team-planning .team-plan-fighter .return-nature-action{left:2px!important;width:118px!important;font-size:10px!important}
}

/* ============================================================
   v0.27.19 — grass-anchored resize + simultaneous AoE impacts
   ============================================================ */
/* The grass-relative Y positions are computed from the forest cover image in
   app.js, and recalculated on F11/window/layout resize. The older slot X
   stagger stays in CSS; only the obsolete fixed slot Y values are overridden. */
.battle-summon-sprite.hit-shake{animation:rf-hit-shake .48s linear!important}

/* ============================================================
   V0.27.20 - Single stable phase indicator, legible greyed cards,
   transformation placeholders and one floating number per target.
   ============================================================ */
/* The former CURRENT TURN / 25s card has been removed entirely. The small
   stable badge in the page header is purely a phase label, never a clock. */
.topbar .team-phase-badge:not(.hidden){
  display:inline-flex!important;
  position:static!important;
  transform:none!important;
  align-items:center;
  justify-content:center;
  min-width:156px;
  height:32px;
  padding:6px 10px;
  border-radius:999px;
  font-size:10px;
  letter-spacing:.08em;
  white-space:nowrap;
  color:#e5e7eb;
  background:rgba(55,65,81,.72);
  border:1px solid rgba(156,163,175,.35);
  box-shadow:none;
  backdrop-filter:none;
}
/* Reduce fading without undoing the disabled state. Desaturate the artwork
   while retaining sufficient brightness to read mana, titles and card text. */
body.team-planning .realm-card-choice.action-disabled{
  opacity:.88!important;
  filter:none!important;
  pointer-events:none!important;
}
body.team-planning .realm-card-choice.action-disabled .realm-card-stage{
  opacity:1!important;
  filter:grayscale(.95) brightness(.87) saturate(.20) drop-shadow(0 8px 12px rgba(0,0,0,.22))!important;
}
body.team-planning .realm-card-choice.action-disabled .realm-card-stage:hover{transform:none!important}
.battle-sprite.sprite-transformed .sprite-form-tag,
.battle-sprite.sprite-tiger .sprite-form-tag{
  display:inline;
  font-size:10px;
  color:#d8b4fe;
  text-transform:capitalize;
  text-shadow:0 1px 2px #000;
}
/* The old 2.25 second fade overlapped later strikes on the same target. */
.battle-damage-float{animation-duration:1.55s!important}

/* ============================================================
   V0.27.21 — navigation, reliable planner clock and discard picker
   ============================================================ */
/* Target-screen Back sits above all character hitboxes, can always receive
   input, and does not submit a move or touch the team timer. */
body.team-planning.battlefield-targeting #promptPanel{
  z-index:120!important;
  pointer-events:auto!important;
}
body.team-planning.battlefield-targeting .team-plan-target-header .target-back-button{
  z-index:2!important;
  pointer-events:auto!important;
  cursor:pointer!important;
}
/* Raise the one visible timer a few pixels without changing its deadline. */
body.team-planning .team-plan-head .team-plan-timer{top:0!important}
/* Return to Nature is the same 42px utility pill as Base Attack, Discard and
   Pass, while staying on the far-left edge of the active hand. */
body.team-planning .team-plan-fighter .return-nature-action{
  box-sizing:border-box!important;
  width:180px!important;
  height:42px!important;
  min-height:42px!important;
  max-height:42px!important;
  padding:7px 10px!important;
  line-height:1.15!important;
}
@media(max-width:1180px){
  body.team-planning .team-plan-fighter .return-nature-action{
    width:160px!important;
    left:0!important;
  }
}
/* Discard is an actual card-selection screen, using the same single-row
   cards/sizing as the hand. Eliminate the old sticky black controls overlay. */
body.team-plan-discard-active #promptPanel{
  z-index:92!important;
  opacity:1!important;
  pointer-events:auto!important;
}
body.team-plan-discard-active #promptPanel .prompt-body{overflow:visible!important}
body.team-plan-discard-active .team-plan-discard-controls{
  position:relative!important;
  background:none!important;
  padding:0 4px 12px!important;
  margin:0 auto 8px!important;
  justify-content:center!important;
  align-items:center!important;
  flex-wrap:nowrap!important;
}
body.team-plan-discard-active .team-plan-discard-controls .target-back-button{
  margin:0!important;
  min-height:42px!important;
  width:118px!important;
}
body.team-plan-discard-active .team-plan-discard-controls .team-plan-discard-confirm{
  min-height:42px!important;
  border-radius:999px!important;
}
body.team-plan-discard-active .discard-card-grid{
  display:flex!important;
  flex-wrap:nowrap!important;
  justify-content:center!important;
  align-items:flex-start!important;
  max-height:none!important;
  overflow:visible!important;
  padding:4px 0 12px!important;
}
body.team-plan-discard-active .discard-card-grid .realm-card-choice{
  cursor:pointer!important;
  position:relative!important;
}
body.team-plan-discard-active .discard-card-grid .realm-card-choice.selected .realm-card-stage{
  outline:3px solid #f4c56a!important;
  outline-offset:3px!important;
  box-shadow:0 0 0 4px rgba(244,197,106,.78),0 0 22px rgba(244,197,106,.55)!important;
}

/* V0.27.23 — status applications float in gold over the RECIPIENT. */
.battle-effect-float{
  position:absolute;z-index:120;pointer-events:none;
  transform:translate(-50%,-50%);white-space:nowrap;max-width:240px;
  color:#ffd86b;font-size:16px;font-weight:950;letter-spacing:.2px;
  text-align:center;text-shadow:-1px -1px 0 #271600,1px -1px 0 #271600,
  -1px 1px 0 #271600,1px 1px 0 #271600,0 3px 9px #000;
  animation:rf-effect-pop 1.7s ease-out forwards;
}
@keyframes rf-effect-pop{
  0%{opacity:0;translate:0 12px;scale:.86}
  12%,68%{opacity:1;scale:1}
  100%{opacity:0;translate:0 -48px;scale:1.04}
}
/* Keep the target Back button above all arena character hitboxes. */
body.team-planning.battlefield-targeting #promptPanel{
  z-index:10001!important;isolation:isolate!important;pointer-events:auto!important;
}
body.team-planning.battlefield-targeting .team-plan-target-header{
  z-index:10002!important;isolation:isolate!important;pointer-events:auto!important;
}
body.team-planning.battlefield-targeting .team-plan-target-header .target-back-button{
  z-index:10003!important;position:relative!important;pointer-events:auto!important;
  cursor:pointer!important;touch-action:manipulation!important;
}

/* V0.27.23 follow-up — discard selection is a true header + card row, not
   a floating button which card hover artwork can cover. */
body.team-plan-discard-active #promptPanel .prompt-body{
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  gap:18px!important;
}
body.team-plan-discard-active .team-plan-discard-controls{
  position:relative!important;z-index:100!important;
  isolation:isolate!important;
  display:grid!important;
  grid-template-columns:auto minmax(90px,1fr) auto auto!important;
  width:min(680px,100%)!important;
  min-height:58px!important;
  gap:12px!important;
  align-items:center!important;
  margin:0 auto 0!important;
  padding:9px 12px!important;
  border:1px solid rgba(244,197,106,.38)!important;
  border-radius:14px!important;
  background:rgba(18,20,26,.96)!important;
  box-shadow:0 12px 28px rgba(0,0,0,.42)!important;
  pointer-events:auto!important;
}
body.team-plan-discard-active .team-plan-discard-title{
  color:#ffda78;font-size:13px;letter-spacing:.16em;
  text-align:center;white-space:nowrap;
}
body.team-plan-discard-active .team-plan-discard-controls .target-back-button,
body.team-plan-discard-active .team-plan-discard-controls .team-plan-discard-confirm{
  position:relative!important;z-index:101!important;pointer-events:auto!important;
  margin:0!important;min-height:42px!important;
}
body.team-plan-discard-active .team-plan-discard-controls .team-plan-timer{
  position:relative!important;z-index:101!important;
  margin-left:0!important;transform:none!important;
}
body.team-plan-discard-active .discard-card-grid{
  position:relative!important;z-index:1!important;
  margin:0 auto!important;padding:12px 0 16px!important;
  justify-content:center!important;
}
/* Target Back always lives above the battlefield, not at sprite height. */
body.team-planning.battlefield-targeting #promptPanel{
  position:absolute!important;top:10px!important;bottom:auto!important;
  left:50%!important;transform:translateX(-50%)!important;
  width:min(720px,calc(100vw - 32px))!important;
  z-index:10001!important;pointer-events:auto!important;
}
body.team-planning.battlefield-targeting #promptPanel .team-plan-target-header{
  position:relative!important;z-index:10002!important;
}
@media(max-width:650px){
  body.team-plan-discard-active .team-plan-discard-controls{
    grid-template-columns:auto 1fr auto!important;
    gap:6px!important;padding:6px!important;
  }
  body.team-plan-discard-active .team-plan-discard-title{font-size:10px}
  body.team-plan-discard-active .team-plan-discard-controls .team-plan-timer{grid-column:1/-1;justify-self:center}
}

/* ============================================================
   V0.27.24 — stable discard header and correctly aligned Back hitboxes
   ============================================================ */
body.team-plan-discard-active .team-plan-discard-title{display:none!important}
body.team-plan-discard-active .team-plan-discard-controls{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  flex-wrap:nowrap!important;
  width:min(600px,calc(100vw - 32px))!important;
  min-height:54px!important;
  gap:12px!important;
  margin:0 auto 8px!important;
  padding:7px 12px!important;
  box-sizing:border-box!important;
  background:rgba(18,20,26,.88)!important;
  border:1px solid rgba(180,190,208,.25)!important;
  border-radius:12px!important;
  box-shadow:0 8px 20px rgba(0,0,0,.28)!important;
  isolation:isolate!important;
  z-index:300!important;
  pointer-events:auto!important;
}
body.team-plan-discard-active .team-plan-discard-controls .target-back-button,
body.team-plan-discard-active .team-plan-discard-controls .team-plan-discard-confirm{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  position:relative!important;
  top:auto!important;
  bottom:auto!important;
  left:auto!important;
  transform:none!important;
  width:auto!important;
  height:42px!important;
  min-height:42px!important;
  margin:0!important;
  padding:8px 16px!important;
  flex:0 0 auto!important;
  z-index:301!important;
  pointer-events:auto!important;
}
body.team-plan-discard-active .team-plan-discard-controls .team-plan-timer{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  position:relative!important;
  top:auto!important;
  bottom:auto!important;
  left:auto!important;
  right:auto!important;
  transform:none!important;
  grid-column:auto!important;
  margin:0!important;
  flex:0 0 auto!important;
  z-index:301!important;
}
body.team-plan-discard-active .discard-card-grid{
  position:relative!important;z-index:1!important;
  margin:0 auto!important;
}
body.team-planning.battlefield-targeting .team-plan-target-header .target-back-button{
  position:relative!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  transform:none!important;
  inset:auto!important;
  min-height:44px!important;
  margin:0!important;
  box-sizing:border-box!important;
  pointer-events:auto!important;
}
@media(max-width:600px){
  body.team-plan-discard-active .team-plan-discard-controls{gap:5px!important;padding:7px!important}
  body.team-plan-discard-active .team-plan-discard-controls .target-back-button,
  body.team-plan-discard-active .team-plan-discard-controls .team-plan-discard-confirm{padding:6px 9px!important;font-size:12px!important}
}

/* ============================================================
   V0.27.26 — PvP readability, distinct summons, clean discard UI
   ============================================================ */
/* A duel needs real negative space between the two characters. The inherited
   forward 4v4 slots push the 1v1 models together in the same central lane. */
.battle-sprite-layer.team1-count-1.team2-count-1 .battle-sprite.slot-0.team-1{
  left:1%!important;
  right:auto!important;
}
.battle-sprite-layer.team1-count-1.team2-count-1 .battle-sprite.slot-0.team-2{
  right:1%!important;
  left:auto!important;
}
@media(min-width:1250px){
  .battle-sprite-layer.team1-count-1.team2-count-1 .battle-sprite.slot-0.team-1{left:3%!important}
  .battle-sprite-layer.team1-count-1.team2-count-1 .battle-sprite.slot-0.team-2{right:3%!important}
}
/* The discard buttons remain neutral pills, but the former solid black
   rectangle behind them does not belong in the selection screen. */
body.team-plan-discard-active .team-plan-discard-controls{
  background:transparent!important;
  border:0!important;
  border-radius:0!important;
  box-shadow:none!important;
  backdrop-filter:none!important;
  padding:0!important;
  min-height:48px!important;
}
/* Separate, high-contrast summon targeting plate above any summoner hitbox.
   The plate only receives pointer events during an active target picker. */
.battle-summon-sprite.targetable{
  z-index:45!important;
  outline:3px solid rgba(255,221,119,.95)!important;
  outline-offset:5px!important;
  filter:drop-shadow(0 0 8px rgba(255,217,114,.9))!important;
}
.battle-summon-sprite.targetable.target-enemy{outline-color:#fb7185!important}
.battle-summon-sprite.targetable.target-friendly{outline-color:#4ade80!important}
.battle-summon-sprite.target-hover-linked{
  outline-width:4px!important;
  filter:drop-shadow(0 0 15px rgba(255,213,120,.95))!important;
}
.battle-summon-target-control{
  position:absolute;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  z-index:48;
  padding:0 1px 2px;
  border:2px solid #fb7185;
  background:rgba(116,28,43,.16);
  border-radius:14px;
  box-shadow:0 0 14px rgba(251,113,133,.36),inset 0 0 10px rgba(251,113,133,.15);
  cursor:crosshair;
  pointer-events:auto!important;
}
.battle-summon-target-control.target-friendly{
  border-color:#4ade80;
  background:rgba(33,117,61,.14);
  box-shadow:0 0 14px rgba(74,222,128,.34);
}
.battle-summon-target-control:hover,
.battle-summon-target-control:focus-visible,
.battle-summon-target-control.target-selected{
  outline:3px solid #ffcf5c;
  outline-offset:3px;
  background:rgba(255,205,86,.15);
}
.battle-summon-target-label{
  position:absolute;
  top:calc(100% + 4px);
  left:50%;
  transform:translateX(-50%);
  border-radius:7px;
  padding:3px 6px;
  color:#fff4d6;
  background:rgba(15,18,22,.94);
  border:1px solid rgba(251,113,133,.72);
  font-size:10px;
  font-weight:900;
  line-height:1.1;
  white-space:nowrap;
  text-shadow:0 1px 1px #000;
  pointer-events:none;
}
.battle-summon-target-control.target-friendly .battle-summon-target-label{border-color:rgba(74,222,128,.7)}
/* Hovering a minion must never lunge/glow the whole Necromancer, even when
   both are separately eligible targets in the current target picker. */
.battle-sprite.targetable:has(.battle-summon-target-control:hover),
.battle-sprite.targetable:has(.battle-summon-target-control:focus-visible){
  transform:none!important;
  filter:none!important;
}

/* V0.27.29: cards remaining | three action pills | one shared countdown. */
body.team-planning .team-plan-fighter .team-plan-head{
  min-height:4px!important;height:auto!important;padding:0!important;margin:0!important;
}
body.team-planning .team-plan-fighter .team-plan-head:has(.team-plan-lock:empty){display:none!important}
body.team-planning .team-plan-utility-bar{
  display:grid;grid-template-columns:minmax(125px,1fr) minmax(0,560px) minmax(68px,1fr);
  align-items:center;gap:12px;
  width:min(960px,100%);margin:0 auto 10px;
}
body.team-planning .team-plan-fighter .team-plan-utility-bar .utility-action-grid{
  width:100%!important;margin:0!important;
}
.team-plan-cards-pill{
  box-sizing:border-box;display:flex;justify-content:center;align-items:center;
  gap:7px;padding:0 12px;min-height:34px;border-radius:999px;
  border:1px solid rgba(209,213,219,.42);
  background:rgba(55,65,81,.81);color:#f3f4f6;
  white-space:nowrap;font-weight:700;font-size:12px;
}
.team-plan-cards-pill strong{font-size:17px;font-variant-numeric:tabular-nums}
body.team-planning .team-plan-fighter .team-plan-utility-bar .team-plan-timer{
  position:static!important;inset:auto!important;
  transform:none!important;justify-self:start;
  top:auto!important;left:auto!important;margin:0!important;
  min-height:34px!important;
}
@media(max-width:740px){
  body.team-planning .team-plan-utility-bar{gap:5px!important;grid-template-columns:minmax(80px,1fr) minmax(0,3.5fr) 58px!important}
  .team-plan-cards-pill{padding:4px 5px;min-height:36px;gap:3px;font-size:10px;flex-direction:column}
  .team-plan-cards-pill strong{font-size:14px}
  body.team-planning .team-plan-utility-bar .team-plan-timer{min-width:55px!important;padding:0 4px!important}
}

/* v0.27.30 — effect consumption cue and potion resource pulse. */
@keyframes effect-cue-flash{
  0%,100%{filter:brightness(1);transform:scale(1);box-shadow:0 0 0 transparent;}
  16%,49%,82%{filter:brightness(2.1);transform:scale(1.10);box-shadow:0 0 16px 5px rgba(253,224,71,.82);}
  32%,65%{filter:brightness(1);transform:scale(1);box-shadow:0 0 0 transparent;}
}
.fighter-card .effect-chip.effect-cue-active{animation:effect-cue-flash 1.15s ease-in-out 1 both!important;position:relative;z-index:6;outline:2px solid rgba(254,240,138,.82)}
@keyframes mana-gain-pop{0%{transform:scale(1)}50%{transform:scale(1.23);filter:brightness(1.8);box-shadow:0 0 14px rgba(96,165,250,.75)}100%{transform:scale(1)}}
.fighter-card .mana-chip.mana-gain-pulse{animation:mana-gain-pop .48s ease-out 1}
/* Discard Back uses the identical pill silhouette as main action buttons. */
body.team-plan-discard-active .team-plan-discard-controls .target-back-button{
  display:inline-flex!important;align-items:center!important;justify-content:center!important;
  min-width:105px!important;min-height:42px!important;padding:8px 18px!important;
  border-radius:999px!important;border:1px solid rgba(209,213,219,.42)!important;
  background:rgba(55,65,81,.86)!important;color:#f3f4f6!important;
  box-shadow:none!important;text-shadow:none!important;font-size:12px!important;font-weight:800!important;
}
body.team-plan-discard-active .team-plan-discard-controls .target-back-button:hover{
  border-color:rgba(244,197,106,.66)!important;background:rgba(75,85,99,.97)!important;
}


/* RF V0.27.31 positive/negative effect flash */
/* Same three-pulse choreography and 1.15-second pacing as V0.27.30;
   only the glow is color-coded. Unknown/unclassified effects retain the old glow. */
@keyframes rf-v02731-effect-flash-positive {
  0%, 100% { filter: brightness(1); transform: scale(1); box-shadow: 0 0 0 transparent; }
  16%, 49%, 82% { filter: brightness(2.1); transform: scale(1.10); box-shadow: 0 0 16px 5px rgba(74, 222, 128, .86); }
  32%, 65% { filter: brightness(1); transform: scale(1); box-shadow: 0 0 0 transparent; }
}
@keyframes rf-v02731-effect-flash-negative {
  0%, 100% { filter: brightness(1); transform: scale(1); box-shadow: 0 0 0 transparent; }
  16%, 49%, 82% { filter: brightness(2.1); transform: scale(1.10); box-shadow: 0 0 16px 5px rgba(248, 77, 77, .88); }
  32%, 65% { filter: brightness(1); transform: scale(1); box-shadow: 0 0 0 transparent; }
}
 .fighter-card .effect-chip.effect-cue-active[data-rf-cue-tone="positive"] {
  animation-name: rf-v02731-effect-flash-positive !important;
  outline-color: rgba(74,222,128,.88);
}
 .fighter-card .effect-chip.effect-cue-active[data-rf-cue-tone="negative"] {
  animation-name: rf-v02731-effect-flash-negative !important;
  outline-color: rgba(248,77,77,.88);
}

/* V0.27.32: visual special cues (Mana Potion, Druid form) */
.fighter-card .effect-chip.effect-cue-active[data-rf-cue-tone="special"] {
  animation-name: effect-cue-flash !important; outline-color:rgba(253,224,71,.95)!important;
  color:#fde68a!important; background:rgba(113,63,18,.87)!important;
}
.fighter-card .effect-chip.effect-description, .fighter-card .effect-chip.effect-advantage {
  color:#fde68a!important; border-color:rgba(253,224,71,.7)!important;
  background:rgba(71,52,23,.83)!important;
}
body.team-planning .team-plan-fighter .team-plan-utility-bar .return-nature-action {
  position:static!important;left:auto!important;top:auto!important;right:auto!important;
  width:auto!important;max-width:none!important;min-width:0!important;height:42px!important;
  min-height:42px!important;padding:7px 11px!important;z-index:auto!important;
  border-radius:999px!important;justify-self:stretch!important;
}
body.team-planning .team-plan-fighter .team-plan-utility-bar .utility-action-grid:has(.return-nature-action){
  grid-template-columns:repeat(4,minmax(0,1fr))!important;max-width:670px!important;
}

/* V0.27.33 — red harmful, green helpful, gold for explicitly special cues. */
.battle-effect-float.cue-positive{color:#86efac!important;text-shadow:0 1px 2px #062914,0 2px 9px #000!important}
.battle-effect-float.cue-negative{color:#fca5a5!important;text-shadow:0 1px 2px #420b14,0 2px 9px #000!important}
.battle-effect-float.cue-special{color:#fde68a!important}
/* Separate summon hit plates from the owner's transform / targeting halo. */
.battle-sprite.targetable:has(> .battle-summon-sprite.targetable){filter:none!important}
.battle-sprite.targetable:has(> .battle-summon-sprite.targetable) > .battle-target-hitbox:hover,
.battle-sprite.targetable:has(> .battle-summon-sprite.targetable) > .battle-target-hitbox:focus-visible{
  box-shadow:0 0 0 3px currentColor,0 0 15px rgba(255,255,255,.35)!important;
}
.battle-summon-target-control{z-index:150!important;border-radius:999px!important;background:rgba(0,0,0,.02)!important;box-shadow:none!important}
.battle-summon-target-control:hover,.battle-summon-target-control:focus-visible{background:rgba(255,255,255,.1)!important}
.battle-summon-sprite.targetable{outline:0!important;box-shadow:none!important;filter:none!important}
.battle-summon-sprite.targetable.target-hover-linked{outline:2px solid #facc15!important;outline-offset:3px!important}
.battle-summon-target-label{border-radius:999px!important}

/* V0.27.33 — planning control pills BELOW the card hand. */
body.team-planning .team-plan-fighter .team-plan-utility-bar{
  margin:11px auto 0!important;
}
body.team-planning .team-plan-fighter .realm-card-grid{
  min-height:80px;
}
body.team-planning .team-plan-fighter.team-plan-stunned .realm-card-choice,
body.team-planning .team-plan-fighter.team-plan-stunned .action-card{
  opacity:.38!important;
  filter:grayscale(1)!important;
  pointer-events:none!important;
}
body.team-planning .team-plan-fighter.team-plan-stunned .utility-action-grid{
  pointer-events:none!important;
}
.team-plan-stunned-message{
  width:fit-content;margin:4px auto 12px;padding:8px 20px;
  border:1px solid rgba(248,113,113,.7);border-radius:999px;
  color:#fca5a5;background:rgba(80,10,20,.58);
  font-weight:900;letter-spacing:.06em;text-align:center;
}
body.team-planning .team-plan-concede-pill{
  flex:0 0 140px;align-self:center;min-height:49px;
  padding:10px 19px;margin:35px 12px 15px;
  border:2px solid #f87171;border-radius:999px;
  color:#fff;background:linear-gradient(#ae202f,#7f1d1d);
  font-weight:900;font-size:14px;cursor:pointer;box-shadow:0 0 18px rgba(248,113,113,.24);
}
body.team-planning .team-plan-concede-pill:hover:not(:disabled){background:#b91c1c;box-shadow:0 0 20px rgba(248,113,113,.55)}
body.team-planning .team-plan-concede-pill:disabled{opacity:.45;cursor:not-allowed}


/* v0.27.33: first-round immunity and end-of-PvP scoreboard */
.battle-effect-float.cue-immunity{
  color:#ffdb64!important;
  text-shadow:0 1px 2px #502d00,0 0 14px rgba(255,202,55,.9),0 2px 8px #000!important;
}
.pvp-final-results{display:grid;gap:12px;max-width:980px;margin:auto;padding:10px 0 20px}
.pvp-final-results>h3{text-align:center;font-size:22px;color:#f2d47b}
.pvp-result-team{background:rgba(14,20,29,.68);border:1px solid rgba(182,194,219,.24);border-radius:14px;padding:12px}
.pvp-result-team h3{margin:0 0 9px;font-size:16px}
.pvp-result-table-wrap{overflow-x:auto}
.pvp-result-table{border-collapse:collapse;width:100%;min-width:500px;text-align:right;font-size:13px}
.pvp-result-table th,.pvp-result-table td{padding:7px 8px;border-bottom:1px solid rgba(255,255,255,.12);white-space:nowrap}
.pvp-result-table th:first-child,.pvp-result-table td:first-child{text-align:left}
.pvp-result-total{font-weight:800;color:#f2d47b}
.pvp-result-exit{display:block;justify-self:center;min-width:168px;min-height:42px;border-radius:999px;background:#263e5f;color:#fff;border:1px solid #6d8db8;font-weight:800;cursor:pointer}
.pvp-result-exit:hover{background:#375981}


/* V0.27.34: the finished PvP scoreboard must be visible after team resolution. */
body.match-finished #promptPanel{
  opacity:1!important;transform:none!important;pointer-events:auto!important;
  display:block!important;visibility:visible!important;
  position:relative!important;left:auto!important;top:auto!important;bottom:auto!important;
  width:min(1020px,calc(100vw - 32px))!important;max-height:none!important;
  margin:20px auto!important;z-index:75!important;
  background:rgba(10,15,23,.94)!important;
  border:1px solid rgba(214,189,123,.4)!important;
  box-shadow:0 14px 40px rgba(0,0,0,.55)!important;
}
body.match-finished #promptPanel .panel-head{display:block!important;}
body.match-finished #promptPanel .prompt-body{max-height:none!important;overflow:visible!important;opacity:1!important;}
body.match-finished #promptPanel .pvp-final-results{opacity:1!important;visibility:visible!important;}

/* V0.28.0: stable hand and bottom controls across legacy and team discard. */
body.team-plan-discard-active .team-plan-discard-controls{order:3!important;margin:10px auto 0!important}
body.team-plan-discard-active .discard-card-grid{order:1!important;margin:0 auto!important}
body.team-plan-discard-active #promptPanel .prompt-body{gap:0!important}
.discard-controls{order:3;display:flex;justify-content:center;gap:14px;margin:12px auto 0}
.discard-card-grid{order:1}
/* PvE navigation is the only completed-match UI; never cover the battlefield. */
body.pve-match-finished #promptPanel{display:none!important}
.pve-exit-menu-button{min-height:34px;padding:7px 16px;border-radius:999px;border:1px solid #9ca3af;background:#253041;color:#fff;font-weight:800;cursor:pointer}
.pve-exit-menu-button.hidden{display:none!important}
.pve-continue-button{background:#6d28d9!important;border-color:#a78bfa!important;color:#fff!important;box-shadow:0 0 14px rgba(139,92,246,.26)!important}
.pve-continue-button:hover:not(:disabled){background:#7c3aed!important}
/* Elephant names are always fully visible and stay above the large sprite. */
.battle-sprite.sprite-elephant .sprite-name{position:relative!important;z-index:28!important;max-width:240px!important;overflow:visible!important;text-overflow:clip!important;white-space:nowrap!important;font-size:11px!important}
.battle-sprite.sprite-elephant{overflow:visible!important}
/* Consistent selection: no circular or yellow summon decorations. */
.battle-summon-target-control{border-radius:7px!important;border:2px solid #fb7185!important;background:rgba(75,20,30,.08)!important;z-index:250!important;padding:0!important;box-sizing:border-box!important}
.battle-summon-target-control.target-friendly{border-color:#4ade80!important}
.battle-summon-target-control:hover,.battle-summon-target-control:focus-visible,.battle-summon-target-control.target-selected{background:rgba(251,113,133,.13)!important;box-shadow:0 0 0 2px currentColor!important}
.battle-summon-target-label{position:absolute!important;bottom:100%!important;left:50%!important;transform:translateX(-50%)!important;pointer-events:none!important;border-radius:6px!important}
.battle-summon-sprite.targetable,.battle-summon-sprite.targetable.target-hover-linked{outline:none!important;filter:none!important;box-shadow:none!important}
.summon.target-hover-enemy{outline:2px solid #fb7185;background:rgba(251,113,133,.17);border-radius:5px}
.summon.target-hover-friendly{outline:2px solid #4ade80;background:rgba(74,222,128,.15);border-radius:5px}
.effect-chip.effect-description{color:#fca5a5!important;border-color:rgba(248,113,113,.72)!important;background:rgba(100,18,30,.47)!important}
/* Purple fixed-column combat results with team identity independent of names. */
body.match-finished:not(.pve-match-finished) #promptPanel{width:min(1380px,calc(100vw - 30px))!important;border-color:rgba(167,139,250,.67)!important}
.pvp-final-results{max-width:1350px;width:100%;color:#ede9fe}
.pvp-final-results>h3{color:#c4b5fd}
.pvp-mvp{color:#e9d5ff;background:linear-gradient(95deg,rgba(88,28,135,.72),rgba(49,46,129,.56));border:1px solid #a78bfa;border-radius:12px;text-align:center;font-size:18px;font-weight:800;padding:13px}
.pvp-mvp strong{color:#fff}
.pvp-mvp span{font-size:13px;font-weight:500;color:#ddd6fe}
.pvp-result-team{border-color:#8b5cf6;background:rgba(31,20,54,.75)}
.pvp-result-team-1{border-left:5px solid #f87171}.pvp-result-team-2{border-left:5px solid #60a5fa}
.pvp-result-team-1 h3{color:#fca5a5}.pvp-result-team-2 h3{color:#93c5fd}
.pvp-result-table{table-layout:fixed;width:100%;min-width:1130px;text-align:right;font-size:12px}
.pvp-result-table col.pvp-name-column{width:175px}.pvp-result-table col.pvp-number-column{width:87px}
.pvp-result-table td:first-child,.pvp-result-table th:first-child{width:175px;max-width:175px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pvp-result-table th,.pvp-result-table td{padding:9px 5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-variant-numeric:tabular-nums}
.pvp-result-team-1 .pvp-result-total{color:#fca5a5}.pvp-result-team-2 .pvp-result-total{color:#93c5fd}
.pvp-result-exit{background:#6d28d9;border-color:#a78bfa}.pvp-result-exit:hover{background:#7c3aed}

/* Reused Discard hand occupies identical slots even for unavailable cards. */
body.team-plan-discard-active .team-plan-fighter .realm-card-choice.discard-not-eligible{
  opacity:.35!important;pointer-events:none!important;
}
body.team-plan-discard-active .team-plan-fighter .realm-card-grid{order:1!important}
body.team-plan-discard-active .team-plan-fighter .team-plan-discard-controls{order:2!important;margin-top:10px!important}
/* Battlefield controls live in the arena layer, while the central grid column
   occupies transparent space above it. Do not let the empty column intercept
   clicks intended for summon hitboxes; keep the prompt itself interactive. */
body.team-planning.battlefield-targeting .center-column{
  pointer-events:none!important;
}
body.team-planning.battlefield-targeting .center-column #promptPanel,
body.team-planning.battlefield-targeting .center-column #promptPanel *{
  pointer-events:auto;
}
/* Once the final PvP animations finish, the results table replaces the arena.
   Old sprites must not bleed through fixed-width scoreboard columns. */
body.match-finished:not(.pve-match-finished) #battleSpriteLayer{
  visibility:hidden!important;
  pointer-events:none!important;
}

/* Two-line metric headings, with name length never changing metric widths. */
.pvp-result-table th:not(:first-child){white-space:normal!important;overflow-wrap:normal!important;line-height:1.2!important;vertical-align:bottom!important}

/* Dungeon 1 bandit sprites, scaled to the existing player hitbox. */
.battle-sprite.sprite-archer-bandit,
.battle-sprite.sprite-recruit-bandit,
.battle-sprite.sprite-brawler-bandit,
.battle-sprite.sprite-rogue-bandit{--rf-sprite-size:172px}
.battle-sprite.sprite-bandit-boss-bonnie{--rf-sprite-size:196px}
@media(max-width:850px){
  .battle-sprite.sprite-archer-bandit,
  .battle-sprite.sprite-recruit-bandit,
  .battle-sprite.sprite-brawler-bandit,
  .battle-sprite.sprite-rogue-bandit{--rf-sprite-size:145px}
  .battle-sprite.sprite-bandit-boss-bonnie{--rf-sprite-size:164px}
}

/* V0.28.1: separate dungeon entry action beside the campaign Continue button. */
.pve-dungeon-button{min-height:34px;padding:7px 13px;border:1px solid #34d399;border-radius:9px;background:linear-gradient(135deg,#064e3b,#065f46);color:#d1fae5;font-size:12px;font-weight:850;cursor:pointer;box-shadow:0 5px 14px #0004}
.pve-dungeon-button:hover:not(:disabled){background:linear-gradient(135deg,#065f46,#047857)}
.pve-dungeon-button:disabled{opacity:.55;cursor:wait}

/* V0.28.4 — native-sized bandits and correct visual targeting. */
.battle-sprite.sprite-archer-bandit,
.battle-sprite.sprite-recruit-bandit,
.battle-sprite.sprite-brawler-bandit,
.battle-sprite.sprite-rogue-bandit {--rf-sprite-size:120px!important}
.battle-sprite.sprite-bandit-boss-bonnie {--rf-sprite-size:148px!important}
@media(max-width:850px){
  .battle-sprite.sprite-archer-bandit,
  .battle-sprite.sprite-recruit-bandit,
  .battle-sprite.sprite-brawler-bandit,
  .battle-sprite.sprite-rogue-bandit {--rf-sprite-size:102px!important}
  .battle-sprite.sprite-bandit-boss-bonnie {--rf-sprite-size:128px!important}
}
.battle-target-hitbox.rf-precise-target{
  position:absolute!important;right:auto!important;bottom:auto!important;
  z-index:410!important;transform:none!important;
  box-sizing:border-box!important;border-radius:14px!important;
  display:flex!important;align-items:flex-end;justify-content:center;
  background:rgba(248,113,113,.035)!important;
  pointer-events:auto!important;
}
.battle-target-hitbox.rf-precise-target.target-friendly{background:rgba(74,222,128,.035)!important}
.rf-precise-target-label{
  position:absolute;bottom:-20px;left:50%;transform:translateX(-50%);
  padding:2px 7px;background:rgba(11,16,26,.94);border:1px solid #fb7185;
  color:#fff;border-radius:6px;white-space:nowrap;font-size:10px;font-weight:800;
  text-shadow:0 1px 2px #000;pointer-events:none;
}
.target-friendly .rf-precise-target-label{border-color:#4ade80}
.effect-chip.effect-intimidating-roar,
.effect-chip.effect-intimidating-roar.effect-description,
.effect-chip.effect-intimidating-roar.effect-cue-active{
  color:#fecaca!important;border-color:rgba(248,113,113,.8)!important;
  background:rgba(104,17,31,.75)!important;
}


/* V0.28.5: authoritative effect coloring. Yellow/gold is never an effect tone.
   Existing class-specific card-art colors are intentionally unaffected. */
.battle-effect-float,
.battle-effect-float.cue-positive,
.battle-effect-float.cue-immunity,
.battle-effect-float.cue-special {color:#86efac!important;text-shadow:0 1px 2px #062914,0 2px 9px #000!important}
.battle-effect-float.cue-negative{color:#fca5a5!important;text-shadow:0 1px 2px #420b14,0 2px 9px #000!important}
.fighter-card .effect-chip.effect-description,
.fighter-card .effect-chip.effect-advantage {color:#dcfce7!important;border-color:rgba(74,222,128,.6)!important;background:rgba(15,83,41,.7)!important}
.fighter-card .effect-chip.effect-description.debuff,
.fighter-card .effect-chip.effect-advantage.debuff,
.fighter-card .effect-chip.effect-intimidating-roar {color:#fecaca!important;border-color:rgba(248,113,113,.8)!important;background:rgba(104,17,31,.75)!important}
.fighter-card .effect-chip.effect-cue-active[data-rf-cue-tone="positive"],
.fighter-card .effect-chip.effect-cue-active[data-rf-cue-tone="special"],
.fighter-card .effect-chip.effect-cue-active[data-rf-cue-tone="immunity"] {animation-name:rf-v02731-effect-flash-positive!important;outline-color:rgba(74,222,128,.88)!important;color:#dcfce7!important;background:rgba(15,83,41,.72)!important}
.fighter-card .effect-chip.effect-cue-active[data-rf-cue-tone="negative"] {animation-name:rf-v02731-effect-flash-negative!important;outline-color:rgba(248,77,77,.88)!important;color:#fecaca!important;background:rgba(104,17,31,.75)!important}
.fighter-card .mana-chip.mana-gain-pulse{color:#bbf7d0!important;border-color:#4ade80!important;box-shadow:0 0 14px rgba(74,222,128,.5)!important}
@keyframes rf0285-mana-gain-pop{0%,100%{transform:scale(1)}50%{transform:scale(1.22);filter:brightness(1.5);box-shadow:0 0 16px rgba(74,222,128,.8)}}
.fighter-card .mana-chip.mana-gain-pulse{animation:rf0285-mana-gain-pop .48s ease-out 1!important}
/* V0.28.5: keyboard/click target fallback for living enemies, including the
   final fighter; it must NOT be hidden by the desktop battlefield-only rule. */
@media(min-width:901px){
 body.team-planning.battlefield-targeting #promptPanel .target-grid.target-grid-only,
 body.battlefield-targeting #promptPanel .target-grid.target-grid-only{
   display:flex!important;flex-wrap:wrap!important;align-items:center!important;
   justify-content:center!important;gap:6px!important;
   padding:3px 8px 10px!important;margin:0 auto!important;
   pointer-events:auto!important;width:100%!important;
 }
 body.team-planning.battlefield-targeting #promptPanel .target-grid.target-grid-only .target-button{
   width:auto!important;min-width:105px!important;min-height:32px!important;
   padding:5px 12px!important;flex:0 1 auto!important;font-size:11px!important;
 }
 body.team-planning.battlefield-targeting #promptPanel{
   max-height:200px!important;overflow:visible!important;
 }
}
/* V0.28.5: fix the REAL click interception: the full-screen sprite layer had
   z-index 10 above the centered prompt's stacking context. A high z-index on
   #promptPanel alone cannot escape that parent context. Lift its column only
   during targeting, leaving sprite target buttons interactive elsewhere. */
body.target-selection-active .center-column{
  position:relative!important;z-index:10020!important;
}
body.target-selection-active #promptPanel{
  position:relative;z-index:10021!important;pointer-events:auto!important;
}
body.target-selection-active .center-column{pointer-events:none!important}
body.target-selection-active .center-column #promptPanel{pointer-events:auto!important}


/* V0.28.6: React is a clean, front-and-center interrupt, not an old black panel. */
body.reaction-prompt-active #promptPanel{
  position: fixed!important;left:50%!important;top:48%!important;right:auto!important;
  bottom:auto!important;transform:translate(-50%,-50%)!important;
  width:min(490px,calc(100vw - 30px))!important;
  z-index:11000!important;opacity:1!important;pointer-events:auto!important;
  background:transparent!important;border:0!important;box-shadow:none!important;
  backdrop-filter:none!important;overflow:visible!important;
}
body.reaction-prompt-active #promptPanel .panel-head{display:none!important}
body.reaction-prompt-active #promptPanel .prompt-body{
  display:flex!important;flex-direction:column!important;align-items:center!important;
  gap:8px!important;padding:0!important;overflow:visible!important;
  background:transparent!important;box-shadow:none!important;
}
body.reaction-prompt-active .reaction-question{
  color:#f8fafc;font-size:26px;font-weight:1000;letter-spacing:.14em;
  text-shadow:0 3px 5px #060607,0 0 14px #060607;
}
body.reaction-prompt-active .react-card-preview{
  background:transparent!important;border:0!important;box-shadow:none!important;
  margin:0!important;padding:0!important;
}
body.reaction-prompt-active .react-card-preview .realm-card-choice{
  width:178px!important;min-width:178px!important;max-width:178px!important;
  background:transparent!important;border:0!important;box-shadow:none!important;
}
body.reaction-prompt-active .reaction-answer-row{
  display:flex!important;flex-wrap:nowrap!important;gap:12px!important;
  justify-content:center!important;align-items:center!important;
  width:100%!important;background:transparent!important;
}
body.reaction-prompt-active .reaction-answer-row button{
  min-width:96px!important;min-height:46px!important;font-size:16px!important;
  font-weight:900!important;position:relative!important;z-index:11002!important;
}
body.reaction-prompt-active .reaction-countdown{
  color:#f8fafc;font-weight:1000;font-size:24px;font-variant-numeric:tabular-nums;
  text-shadow:0 2px 6px #000;min-width:45px;text-align:center;
}
/* Discard ignores mana affordability entirely and supports multiple selection. */
body.team-planning.team-plan-discard-active .team-plan-fighter .realm-card-choice:not(.discard-not-eligible){
  pointer-events:auto!important;opacity:1!important;filter:none!important;cursor:pointer!important;
}
body.team-planning.team-plan-discard-active .team-plan-fighter .realm-card-choice:not(.discard-not-eligible) .realm-card-stage{
  opacity:1!important;filter:none!important;
}

body.reaction-prompt-active .react-card-preview .realm-card-stage{
 width:178px!important;height:257px!important;border-radius:15px!important;
}
body.reaction-prompt-active .react-card-preview .realm-card-frame{
 transform:scale(.54)!important;transform-origin:top left!important;
}

/* V0.28.7 Dungeon 1: per-character silhouette scale (art has nearly full-canvas coverage). */
.battle-sprite.sprite-recruit-bandit{--rf-sprite-size:134px!important}
.battle-sprite.sprite-archer-bandit{--rf-sprite-size:136px!important}
.battle-sprite.sprite-rogue-bandit{--rf-sprite-size:134px!important}
.battle-sprite.sprite-brawler-bandit{--rf-sprite-size:153px!important}
.battle-sprite.sprite-bandit-boss-bonnie{--rf-sprite-size:161px!important}
@media(max-width:850px){
 .battle-sprite.sprite-recruit-bandit{--rf-sprite-size:112px!important}
 .battle-sprite.sprite-archer-bandit{--rf-sprite-size:114px!important}
 .battle-sprite.sprite-rogue-bandit{--rf-sprite-size:112px!important}
 .battle-sprite.sprite-brawler-bandit{--rf-sprite-size:128px!important}
 .battle-sprite.sprite-bandit-boss-bonnie{--rf-sprite-size:136px!important}
}
/* A defeated unit should settle at the hit, not linger fully visible for seconds. */
.battle-sprite.dead{opacity:.09!important;filter:grayscale(1) saturate(.08)!important;
 transition:opacity .32s ease-out,filter .32s ease-out!important}
.battle-damage-float{animation-duration:1.28s!important}
/* Keep lunge/impact in a single readable movement, with the striker held until contact. */
.battle-sprite.attack-right,.battle-sprite.attack-left{animation-duration:.66s!important}
.battle-sprite.attack-center-right,.battle-sprite.attack-center-left{animation-duration:.72s!important}



/* V0.28.12 — unobtrusive battlefield target selection.
   Target hitboxes retain exact entity IDs and clickable dimensions, but never
   draw a rectangle, number plate, or gray fill over a character. The actual
   fighter/summon sprite carries the red/green highlighting. */
body.battlefield-targeting .battle-target-hitbox,
body.battlefield-targeting .battle-target-hitbox.rf-precise-target,
body.battlefield-targeting .battle-target-hitbox.rf-precise-target.target-friendly,
body.battlefield-targeting .battle-target-hitbox:hover,
body.battlefield-targeting .battle-target-hitbox:focus-visible,
body.battlefield-targeting .battle-summon-target-control,
body.battlefield-targeting .battle-summon-target-control:hover,
body.battlefield-targeting .battle-summon-target-control:focus-visible {
  border:0!important;
  outline:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  -webkit-box-shadow:none!important;
  opacity:1!important;
}
body.battlefield-targeting .battle-target-hitbox .rf-precise-target-label,
body.battlefield-targeting .battle-summon-target-control .battle-summon-target-label{
  display:none!important;
}
body.battlefield-targeting .battle-sprite.targetable.target-enemy{
  filter:drop-shadow(0 0 11px rgba(248,113,113,.88))!important;
}
body.battlefield-targeting .battle-sprite.targetable.target-friendly{
  filter:drop-shadow(0 0 11px rgba(74,222,128,.88))!important;
}
body.battlefield-targeting .battle-sprite.targetable.target-enemy.target-hover-linked,
body.battlefield-targeting .battle-sprite.targetable.target-enemy:hover{
  filter:drop-shadow(0 0 17px rgba(248,113,113,1))!important;
}
body.battlefield-targeting .battle-sprite.targetable.target-friendly.target-hover-linked,
body.battlefield-targeting .battle-sprite.targetable.target-friendly:hover{
  filter:drop-shadow(0 0 17px rgba(74,222,128,1))!important;
}
/* Summons remain individually targetable; don't tint their Necromancer owner. */
body.battlefield-targeting .battle-sprite.targetable:has(> .battle-summon-sprite.targetable){filter:none!important}
body.battlefield-targeting .battle-summon-sprite.targetable.target-enemy{
  outline:0!important;box-shadow:none!important;
  filter:drop-shadow(0 0 9px rgba(248,113,113,.86))!important;
}
body.battlefield-targeting .battle-summon-sprite.targetable.target-friendly{
  outline:0!important;box-shadow:none!important;
  filter:drop-shadow(0 0 9px rgba(74,222,128,.86))!important;
}
body.battlefield-targeting .battle-summon-sprite.targetable.target-hover-linked{
  outline:0!important;box-shadow:none!important;
  filter:drop-shadow(0 0 17px rgba(248,113,113,1))!important;
}
/* No duplicate row of enemy/ally buttons across the top on desktop.
   Small screens still need it: the battlefield sprite layer is hidden there. */
@media (min-width:901px){
  body.team-planning.battlefield-targeting #promptPanel .target-grid.target-grid-only,
  body.battlefield-targeting #promptPanel .target-grid.target-grid-only{
    display:none!important;
  }
}
/* Keep Back / ability / timer floating cleanly on the battlefield, with no
   old dark/gray header frame; retain actual button and clock styles. */
body.battlefield-targeting .target-selection-header,
body.team-planning.battlefield-targeting .target-selection-header.team-plan-target-header,
body.team-planning.battlefield-targeting #promptPanel .team-plan-target-header{
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
}
body.battlefield-targeting .target-selection-header .target-castable,
body.team-planning.battlefield-targeting .team-plan-target-header .target-castable{
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  backdrop-filter:none!important;
}
body.battlefield-targeting #promptPanel,
body.battlefield-targeting #promptPanel .prompt-body{
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  backdrop-filter:none!important;
}
/* True damage: white numbers with neutral charcoal outlines, never purple/gold.
   Keep separate physical (red), magical (blue) and healing (green) colors. */
.battle-damage-float.true{
  --rf-float-fill:#ffffff!important;
  --rf-float-outline:#2a2a35!important;
  color:#fff!important;
  -webkit-text-stroke-color:#2a2a35!important;
}


/* Character Hall / inventory, using RealmFall's existing Fell English branding. */
.character-hall{margin-top:26px;padding:19px;border:1px solid rgba(192,132,252,.30);border-radius:18px;background:linear-gradient(135deg,rgba(72,36,107,.24),rgba(9,13,20,.76));}
.character-hall-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:16px}
.hall-eyebrow{font-size:10px;color:#c4a1ef;letter-spacing:.18em;font-weight:800}
.character-hall h3,.inventory-screen h3,.creation-class-heading{font-family:"IM Fell English SC",Georgia,serif;font-weight:400;color:#e9d5ff}
.character-hall h3{font-size:24px;margin:3px 0}
.character-hall p{font-size:12px;color:#aeb3c3;margin:2px 0 0}
.character-roster{display:grid;grid-template-columns:repeat(auto-fit,minmax(255px,1fr));gap:10px}
.character-roster-card{display:flex;gap:10px;align-items:center;padding:12px;border-radius:12px;border:1px solid rgba(192,132,252,.22);background:rgba(7,10,16,.48)}
.roster-class-art{width:46px;height:55px;object-fit:contain;image-rendering:pixelated;filter:drop-shadow(0 0 10px rgba(192,132,252,.20))}
.character-roster-text{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1}
.character-roster-text strong{font-family:"IM Fell English SC",Georgia,serif;color:#f5edff;font-size:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.character-roster-text small{font-size:11px;color:#c4b5fd}.character-roster-text span{color:#a7a9b6;font-size:10px}
.view-inventory-button{font-size:11px!important;white-space:nowrap;min-height:33px!important;padding:8px 11px!important}
.character-empty,.hall-loading{padding:18px;color:#aeb4c6;font-size:13px;border:1px dashed rgba(192,132,252,.25);border-radius:12px}
.hall-error{color:#fda4af;font-size:12px;min-height:12px;margin-top:8px}
.creation-form{padding:16px;margin-bottom:16px;border:1px solid rgba(192,132,252,.20);border-radius:14px;background:#101019}
.creation-form label,.creation-class-heading{display:block;font-size:16px;color:#f0dbff;margin-bottom:8px}
.creation-form input{box-sizing:border-box;display:block;width:100%;max-width:450px;border:1px solid #7955a2;color:white;background:#0d0e17;border-radius:10px;padding:12px 13px;font-size:14px;outline:none}
.creation-class-heading{margin-top:18px}
.class-choice-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:9px}
.class-choice{cursor:pointer;display:flex;flex-direction:column;align-items:center;gap:4px;min-height:130px;border:1px solid rgba(192,132,252,.25);border-radius:12px;background:rgba(33,24,45,.66);padding:8px;color:#e7d8f7}
.class-choice.selected{background:linear-gradient(180deg,rgba(128,69,171,.47),rgba(53,29,72,.65));border-color:#d8b4fe;box-shadow:0 0 0 1px rgba(216,180,254,.33),inset 0 0 18px rgba(126,34,206,.12)}
.class-choice:hover{border-color:#c084fc}
.class-choice-art{height:67px;width:76px;object-fit:contain;image-rendering:pixelated;filter:drop-shadow(0 0 8px rgba(192,132,252,.15))}
.class-choice strong{font-family:"IM Fell English SC",Georgia,serif;font-size:16px;font-weight:400}
.class-choice span{color:#b4a8c3;font-size:9px;line-height:1.3;text-align:center}
.creation-footer{display:flex;align-items:center;gap:12px;margin-top:16px}
.inventory-screen{color:#dce1e9}
.inventory-hero{display:flex;align-items:center;gap:20px;padding-bottom:16px;border-bottom:1px solid rgba(192,132,252,.22)}
.inventory-hero h2{font-family:"IM Fell English SC",Georgia,serif;color:#f0dbff;font-weight:400;font-size:30px;margin:3px 0}
.inventory-hero p{color:#c4b5fd;margin:0;font-size:13px}
.inventory-hero button{margin-left:auto;white-space:nowrap}
.inventory-portrait{height:90px;width:90px;object-fit:contain;image-rendering:pixelated;filter:drop-shadow(0 0 18px rgba(192,132,252,.22))}
.currency-row{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:16px 0 20px}
.currency-row>div{padding:14px;border:1px solid rgba(192,132,252,.28);border-radius:12px;background:rgba(66,33,91,.25);display:flex;flex-direction:column;gap:4px}
.currency-row span{font-size:11px;color:#bda8d1}.currency-row strong{font-size:21px;color:#f5e9ff;font-variant-numeric:tabular-nums}
.inventory-section-head{display:flex;justify-content:space-between;align-items:center;margin:16px 0 10px}
.inventory-section-head h3{font-size:23px;margin:0}.inventory-section-head span{color:#a5a1b6;font-size:12px}
.inventory-slot-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}
.inventory-slot{border:1px solid rgba(192,132,252,.21);border-radius:12px;padding:12px;min-height:102px;background:rgba(7,10,16,.43);display:flex;flex-direction:column;align-items:flex-start;gap:7px}
.inventory-slot-label{font-size:10px;color:#c4b5fd;font-weight:850;letter-spacing:.13em}
.inventory-slot-empty{color:#8c8e9e;font-size:12px;padding:8px 0}
.inventory-item-details{min-width:0;display:flex;flex-direction:column;gap:4px;flex:1}
.inventory-item-details strong{font-family:"IM Fell English SC",Georgia,serif;font-size:17px;font-weight:400;overflow-wrap:anywhere}
.inventory-item-details small{color:#b3afc0;font-size:10px}.inventory-item-details span{color:#d7c9e7;font-size:11px;line-height:1.45}
.inventory-slot .mode-button{min-height:28px!important;padding:5px 12px!important;font-size:10px!important}
.inventory-bag{display:flex;flex-direction:column;gap:8px}
.inventory-bag-row{display:flex;align-items:center;gap:12px;padding:13px;border:1px solid rgba(192,132,252,.18);border-radius:12px;background:rgba(7,10,16,.4)}
.inventory-bag-empty{border:1px dashed rgba(192,132,252,.2);border-radius:10px;padding:22px}
.inventory-equip-actions{display:flex;align-items:flex-end;gap:8px;flex-wrap:wrap}
.inventory-equip-actions label{display:flex;flex-direction:column;gap:5px;font-size:10px;color:#c4b5fd}
.inventory-equip-actions select{border:1px solid #724990;background:#0d0d15;color:#f3e8ff;padding:7px;border-radius:7px}
.inventory-note{font-size:11px;color:#9491a9;margin-top:18px}
@media(max-width:750px){.class-choice-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.inventory-slot-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.character-hall-head{align-items:flex-start;flex-direction:column}.currency-row{grid-template-columns:repeat(2,minmax(0,1fr))}.inventory-hero{gap:10px}.inventory-portrait{width:60px;height:70px}.inventory-hero button{font-size:10px;padding:8px!important}.inventory-bag-row{align-items:flex-start;flex-direction:column}}
@media(max-width:470px){.inventory-slot-grid{grid-template-columns:1fr}.class-choice-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* Pre-alpha character selection and results inventory button */
body.character-creating .play-mode-card {width:min(750px,96vw)}
body.character-creating .creation-form {max-width:690px;margin:0 auto 12px}
body.character-creating .character-hall {margin-top:20px}
@media(max-width:800px){.topbar{height:auto;min-height:88px;flex-wrap:wrap}.topbar-right{flex-wrap:wrap;justify-content:flex-end}body.character-creating .class-choice-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* Character Selection only: deliberate two-step Shadow Realm banishment. */
.inventory-character-actions{margin-top:14px;display:flex;flex-direction:column;align-items:flex-end;gap:12px}
.inventory-delete-toggle{border-color:rgba(244,114,115,.55)!important;color:#fecaca!important;background:rgba(127,29,29,.16)!important}
.inventory-delete-toggle:hover{background:rgba(153,27,27,.38)!important}
.inventory-delete-confirm{box-sizing:border-box;align-self:stretch;border:1px solid rgba(248,113,113,.55);background:linear-gradient(135deg,rgba(58,16,34,.9),rgba(24,14,35,.95));box-shadow:inset 0 0 32px rgba(116,33,57,.11);padding:18px;border-radius:14px;text-align:center}
.inventory-delete-confirm.hidden{display:none!important}
.inventory-delete-confirm strong{font-family:"IM Fell English SC",Georgia,serif;font-size:24px;font-weight:400;color:#fecaca}
.inventory-delete-confirm p{max-width:540px;margin:9px auto 16px;line-height:1.55;font-size:13px;color:#e9c6d5}
.inventory-delete-buttons{display:flex;gap:12px;justify-content:center;flex-wrap:wrap}
.inventory-delete-final{background:#8f252c!important;border-color:#f87171!important;color:white!important}
.inventory-delete-final:hover:not(:disabled){background:#b91c29!important}
.inventory-delete-final:disabled{opacity:.65}
@media(max-width:470px){.inventory-delete-confirm{padding:12px}.inventory-delete-confirm strong{font-size:20px}}

/* Username-only closed pre-alpha login and compact character selection */
/* Width now scoped per screen in v0.28.22 (not globally to battle lobbies). */
.realm-login-panel{box-sizing:border-box;width:min(410px,100%);margin:28px auto 12px;padding:34px 30px;text-align:center;border:1px solid rgba(192,132,252,.65);border-radius:18px;background:linear-gradient(140deg,rgba(94,44,140,.27),rgba(15,10,27,.96));box-shadow:0 0 35px rgba(126,34,206,.12)}
.realm-login-panel h2{font-family:"IM Fell English SC",Georgia,serif;font-size:44px;font-weight:400;color:#ead7ff;letter-spacing:.06em;margin:0 0 24px}
.realm-login-form{display:grid;gap:11px;text-align:left}
.realm-login-form label{font-family:"IM Fell English SC",Georgia,serif;font-size:18px;color:#e9d5ff}
.realm-login-form input{background:#0d0e18;border:1px solid #9c65c3;border-radius:10px;color:white;padding:13px;font-size:16px;min-width:0}
.realm-login-form button{font-family:"IM Fell English SC",Georgia,serif;font-size:20px;margin-top:8px;border-color:#b784e1}
.character-hall{box-sizing:border-box;max-width:610px;margin:20px auto 0;padding:17px 18px}
.character-hall > h3{text-align:center;margin:0 0 5px!important;font-size:21px!important}
.character-hall-user{position:relative;text-align:center;margin:0 0 16px;min-height:31px;display:flex;align-items:center;justify-content:center}
.character-hall-user h4{font-family:"IM Fell English SC",Georgia,serif;font-size:28px;font-weight:400;color:#f2e7ff;margin:0;overflow-wrap:anywhere}
.realm-logout{position:absolute;right:0;top:0;min-height:31px!important;padding:5px 9px!important;font-size:10px!important;color:#ccbadc}
.character-hall-head{margin-bottom:10px}
.character-hall-label{font-size:11px;color:#c4b5fd;font-weight:700;letter-spacing:.06em}
.character-roster{grid-template-columns:1fr}
.character-empty{text-align:center}
body.character-creating .play-mode-card{width:min(750px,96vw)}
@media(max-width:530px){.character-hall{padding:12px}.character-hall-user{padding-top:24px}.realm-logout{top:0}.character-hall-head{flex-direction:row;align-items:center}.character-hall-label{font-size:10px}}

/* v0.28.21 — compact username roster and unified character picker. */
.character-hall{max-width:490px;padding:13px 14px;margin-top:17px}
.character-hall-user{margin-bottom:9px}
.character-hall-head{margin-bottom:8px}
.realm-login-panel h2{font-family:"IM Fell English SC",Georgia,serif;font-size:49px;letter-spacing:.025em}
.slot-character-pickers{display:block;min-width:0}
.slot-character-pickers .slot-character{width:100%;min-width:0}
body.character-creating .character-hall{max-width:750px}

/* v0.28.22 — visually coherent Character Selection, independent match layout. */
body.mode-selecting .play-mode-card{box-sizing:border-box;width:min(1220px,96vw);max-width:1220px}
body.mode-selecting .play-mode-card:has(.mode-choice-main){width:min(935px,96vw);max-width:935px}
body.mode-selecting .play-mode-card:has(.realm-login-panel){width:min(600px,96vw);max-width:600px}
body.mode-selecting .play-mode-card:has(.inventory-screen){width:min(1030px,96vw);max-width:1030px}
body.mode-selecting .play-mode-card:has(.remote-team-grid){width:min(1300px,96vw);max-width:1300px}
body.mode-selecting .play-mode-card:has(.remote-team-grid) .remote-slot{grid-template-columns:34px minmax(0,1.6fr) minmax(155px,1fr);gap:10px}
body.mode-selecting .play-mode-card:has(.remote-team-grid) .remote-slot select{font-size:12px;min-height:43px}
body.mode-selecting .play-mode-card:has(.remote-team-grid) .remote-team-grid{gap:18px}
body.mode-selecting .play-mode-card:has(.remote-team-grid) .remote-team-card{min-width:0}
body.mode-selecting .play-mode-card:has(.remote-team-grid) .remote-lobby-toolbar{min-width:0}
body.character-creating .play-mode-card:has(.mode-choice-main){width:min(935px,96vw);max-width:935px}
body.mode-selecting .mode-choice-main{max-width:850px;margin:0 auto}
body.mode-selecting .mode-choice-main > h2{text-align:center;font-family:"IM Fell English SC",Georgia,serif;font-weight:400;font-size:31px;letter-spacing:.035em;margin:4px 0 0}
body.mode-selecting .mode-choice-main > .mode-actions{justify-content:center;margin:16px 0 22px}
body.mode-selecting .mode-choice-main > .mode-actions button{min-width:158px}
.character-hall{width:100%;max-width:820px;margin:0 auto;padding:22px 24px 24px;border-radius:20px;border:1px solid rgba(190,139,243,.35);background:linear-gradient(145deg,rgba(61,30,86,.63),rgba(18,13,28,.95) 55%,rgba(28,17,40,.93));box-shadow:0 16px 42px rgba(0,0,0,.23)}
.character-hall-user{min-height:45px;margin:0 0 19px;padding-bottom:15px;border-bottom:1px solid rgba(194,143,240,.18);display:flex;align-items:center;justify-content:center}
.character-hall-user h4{font-size:34px;line-height:1.2;text-shadow:0 2px 15px rgba(186,105,251,.19)}
.character-hall .realm-logout{right:0;top:1px;min-height:32px!important;padding:6px 12px!important}
.character-hall-head{flex-direction:row;align-items:center;gap:15px;margin:0 0 15px}
.character-hall-label{font-family:"IM Fell English SC",Georgia,serif;font-size:22px;font-weight:400;letter-spacing:.025em;color:#ebd8ff}
.character-hall-head .mode-button{flex-shrink:0;min-height:38px;padding:8px 15px;font-family:"IM Fell English SC",Georgia,serif;font-size:17px;font-weight:400}
.character-roster{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.character-roster-card{position:relative;display:grid;grid-template-columns:67px minmax(0,1fr);grid-template-rows:auto auto;column-gap:12px;row-gap:11px;align-items:center;min-width:0;min-height:128px;padding:11px 12px 12px;border-radius:14px;border:1px solid rgba(176,132,222,.23);background:linear-gradient(125deg,rgba(7,10,17,.76),rgba(37,25,48,.52));transition:background .16s,border-color .16s}
.character-roster-card:hover{border-color:rgba(211,170,255,.49);background:linear-gradient(125deg,rgba(21,13,31,.89),rgba(51,32,69,.62))}
.roster-art-frame{height:76px;width:67px;display:grid;place-items:center;grid-row:1 / 3;border-radius:10px;background:radial-gradient(circle at 50% 35%,rgba(116,67,162,.35),rgba(24,16,35,.5));border:1px solid rgba(198,166,234,.15)}
.character-roster-card .roster-class-art{width:59px;height:72px;object-fit:contain}
.character-roster-text{min-width:0;gap:5px;justify-content:center}
.character-roster-text strong{font-size:21px;white-space:normal;overflow-wrap:anywhere;overflow:visible;text-overflow:clip;line-height:1.08}
.character-roster-text small{font-size:12px;color:#d4bafa}
.character-roster-text span{font-size:11px;color:#a8a4b4}
.character-roster-text .roster-divider{color:#8e769f}
.character-roster-card .view-inventory-button{grid-column:2;justify-self:start;font-size:12px!important;min-height:30px!important;padding:6px 13px!important;border-color:rgba(204,161,244,.42)}
.character-empty{grid-column:1/-1;padding:36px 18px;text-align:center;font-family:"IM Fell English SC",Georgia,serif;font-size:19px;color:#d9c5e9;border:1px dashed rgba(200,155,241,.3);background:rgba(15,10,22,.48)}
.character-hall .hall-error:empty{display:none}
body.character-creating .character-hall{max-width:820px}
body.character-creating .character-hall-head{margin-bottom:12px}
body.character-creating .character-roster,body.character-creating .character-hall-head .character-hall-label{display:none}
body.character-creating .creation-form{box-sizing:border-box;margin:0;padding:18px;background:rgba(13,9,21,.7);max-width:none}
body.character-creating .class-choice-grid{gap:10px}
body.character-creating .class-choice{min-height:139px}
body.character-creating .creation-class-heading{font-size:19px}
body.character-creating .creation-footer{justify-content:flex-end}
@media(max-width:980px){body.mode-selecting .play-mode-card:has(.remote-team-grid) .remote-team-grid{grid-template-columns:1fr}body.mode-selecting .play-mode-card:has(.remote-team-grid) .remote-slot{grid-template-columns:34px minmax(0,1fr) minmax(150px,.8fr)}}
@media(max-width:710px){.character-hall{padding:16px}.character-roster{grid-template-columns:1fr}.character-hall-user{justify-content:flex-start}.character-hall-user h4{font-size:27px}.character-hall .realm-logout{right:0}.character-hall-head{flex-wrap:wrap}.character-hall-label{font-size:19px}body.mode-selecting .mode-choice-main > h2{font-size:25px}body.character-creating .class-choice-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:500px){body.mode-selecting .play-mode-card{padding:14px}body.mode-selecting .play-mode-card:has(.remote-team-grid) .remote-slot{grid-template-columns:31px minmax(0,1fr)}body.mode-selecting .play-mode-card:has(.remote-team-grid) .remote-slot .slot-controller{grid-column:2}.character-hall-head .mode-button{font-size:15px}.character-roster-card{grid-template-columns:58px minmax(0,1fr)}.roster-art-frame{width:58px}.character-hall-user{padding-right:76px}.character-hall-user h4{font-size:23px}}

/* Display current HP clearly, without native select ellipsis. */
.slot-character-pickers .slot-character-meta{font-size:11px;line-height:1.35;font-weight:650;color:#d8b4fe;overflow-wrap:anywhere;white-space:normal}
.slot-character-pickers .slot-character-meta:empty{display:none}
body.mode-selecting .play-mode-card:has(.remote-team-grid) .remote-slot{align-items:start}
body.mode-selecting .play-mode-card:has(.remote-team-grid) .remote-slot-number{margin-top:7px}

/* V0.28.22 — Sharpen Tip attachment selection stays on the original card row.
   The existing hand and utility bar retain their sizes while target cards are
   drawn on an overlay. Floating controls never add height to the centered hand. */
body.team-planning .team-plan-fighter.team-plan-attachment-active{position:relative!important}
body.team-planning .team-plan-fighter.team-plan-attachment-active > .realm-card-grid{position:relative!important}
body.team-planning .team-plan-fighter.team-plan-attachment-active > .realm-card-grid > .realm-card-choice{visibility:hidden!important;pointer-events:none!important}
body.team-planning .team-plan-fighter.team-plan-attachment-active > .team-plan-utility-bar{visibility:hidden!important;pointer-events:none!important}
body.team-planning .team-plan-attachment-targets{
  position:absolute!important;inset:0!important;width:100%!important;height:100%!important;
  display:flex!important;align-items:flex-start!important;justify-content:center!important;
  flex-wrap:nowrap!important;gap:4px!important;z-index:4!important;
}
body.team-planning .team-plan-attachment-targets .realm-card-choice{flex-shrink:0!important}
body.team-planning .team-plan-attachment-floating-head{
  box-sizing:border-box!important;position:absolute!important;
  top:-55px!important;left:50%!important;transform:translateX(-50%)!important;
  width:min(720px,100%)!important;min-height:43px!important;margin:0!important;
  display:grid!important;grid-template-columns:110px minmax(0,1fr) 74px!important;
  align-items:center!important;gap:10px!important;
  padding:3px 8px!important;
  background:rgba(15,16,25,.9)!important;border:1px solid rgba(190,147,234,.35)!important;
  border-radius:12px!important;z-index:9!important;
}
body.team-planning .team-plan-attachment-floating-head .target-back-button{
  position:static!important;left:auto!important;margin:0!important;min-height:32px!important;
}
body.team-planning .team-plan-attachment-floating-head strong{text-align:center;line-height:1.25}
body.team-planning .team-plan-attachment-floating-head .team-plan-timer{
  position:static!important;inset:auto!important;transform:none!important;margin:0!important;
  justify-self:end!important;min-height:34px!important;
}
@media(max-width:580px){
  body.team-planning .team-plan-attachment-floating-head{grid-template-columns:72px minmax(0,1fr) 55px!important;gap:4px!important;font-size:11px!important}
}
/* Character roster needs an explicit content width; otherwise the flex parent
   shrink-wraps to its old 584px intrinsic size despite the larger outer card. */
body.mode-selecting .mode-choice-main{box-sizing:border-box;width:min(850px,100%)!important}


/* V0.28.24 — Finished-combat header actions share the same pill sizing.
   Inventory and Continue are the same muted purple; Exit keeps its original color.
   Longer Continue → encounter labels can expand naturally without truncation. */
.topbar-right > .global-inventory-button,
.topbar-right > .pve-continue-button,
.topbar-right > .pve-exit-menu-button {
  box-sizing:border-box;
  min-height:38px;
  min-width:128px;
  padding:9px 16px;
  border-radius:999px;
  font-size:12px;
  font-weight:800;
  line-height:18px;
  letter-spacing:normal;
  white-space:nowrap;
  text-align:center;
}
.topbar-right > .global-inventory-button,
.topbar-right > .pve-continue-button {
  background:rgba(88,28,135,.25)!important;
  border-color:rgba(192,132,252,.55)!important;
  color:#f3e8ff!important;
  box-shadow:none!important;
}
.topbar-right > .global-inventory-button:hover:not(:disabled),
.topbar-right > .pve-continue-button:hover:not(:disabled) {
  background:rgba(126,34,206,.35)!important;
  border-color:rgba(192,132,252,.70)!important;
}


/* V0.28.28 — authoritative combat announcements and PvE reward receipts. */
.combat-callout-layer{
  position:fixed;inset:0;z-index:220;pointer-events:none;overflow:hidden;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;
}
.combat-callout{
  font-family:'IM Fell English SC','IM Fell English',Georgia,serif;
  font-weight:900;font-size:clamp(46px,6.7vw,112px);line-height:1;
  letter-spacing:.05em;white-space:nowrap;color:#ffe16b;
  -webkit-text-stroke:1.3px #8a5100;
  text-shadow:0 3px 0 #633b07,0 0 18px rgba(255,205,47,.94),0 8px 24px rgba(0,0,0,.95);
  animation:realm-combat-callout 1150ms cubic-bezier(.17,.85,.24,1) both;
}
.combat-callout-missed{color:#ffdb48;text-shadow:0 3px 0 #633b07,0 0 16px rgba(255,210,41,.8),0 8px 24px rgba(0,0,0,.95)}
@keyframes realm-combat-callout{
  0%{opacity:0;transform:translateY(16px) scale(.68)}
  22%{opacity:1;transform:translateY(-8px) scale(1.11)}
  40%{opacity:1;transform:translateY(0) scale(1)}
  76%{opacity:1;transform:translateY(0) scale(1)}
  100%{opacity:0;transform:translateY(-30px) scale(1.04)}
}
body.mode-selecting .combat-callout-layer,body.match-finished .combat-callout-layer{display:none}
.match-rewards-panel.hidden{display:none!important}
.match-rewards-panel{
  display:grid;gap:10px;width:min(470px,calc(100vw - 32px));
  max-height:min(60vh,600px);overflow-y:auto;
  margin:14vh auto 0;padding:18px 20px;
  border:1px solid rgba(176,132,244,.7);border-radius:18px;
  background:linear-gradient(155deg,rgba(31,21,52,.95),rgba(14,17,28,.97));
  box-shadow:0 15px 44px rgba(0,0,0,.7),0 0 20px rgba(139,92,246,.16);
  position:relative;z-index:80;pointer-events:auto;
}
.match-rewards-panel>h2{
  margin:0 0 4px;text-align:center;color:#e9d5ff;font-family:'IM Fell English SC',Georgia,serif;
  font-size:clamp(24px,2.6vw,35px);letter-spacing:.035em;
}
.match-reward-character{display:grid;gap:10px;padding:12px;border:1px solid rgba(167,139,250,.22);border-radius:12px;background:rgba(10,13,28,.7)}
.match-reward-character-name{display:flex;align-items:center;gap:8px;flex-wrap:wrap;color:#fff;font-size:14px;font-weight:800}
.match-first-clear{font-size:10px;color:#e9d5ff;border:1px solid #9b72d6;border-radius:999px;padding:3px 8px}
.match-reward-amounts{display:flex;justify-content:space-around;align-items:center;flex-wrap:wrap;gap:12px}
.match-reward-xp,.match-reward-silver,.match-reward-item{font-family:'IM Fell English SC',Georgia,serif;font-weight:900;line-height:1.2}
.match-reward-xp{font-size:25px;color:#d8a7ff;text-shadow:0 0 13px rgba(176,103,251,.55)}
.match-reward-xp-bonus{display:inline-block;margin-left:6px;vertical-align:middle;color:#7beaaf;font-size:15px;font-weight:800;text-shadow:none;white-space:nowrap}
.match-reward-first-clear{display:inline-block;margin-left:6px;vertical-align:middle;color:#7beaaf;font-size:15px;font-weight:800;text-shadow:none;white-space:nowrap}
.match-reward-silver{font-size:25px;color:#f6f8fb;background:linear-gradient(180deg,#b4bac7 0%,#f9fbff 43%,#ffffff 52%,#9ba5b7 100%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;filter:drop-shadow(0 1px 2px #3c4253)}
.match-reward-items{display:grid;gap:5px;border-top:1px solid rgba(167,139,250,.22);padding-top:10px}
.match-reward-item{color:#ffe16b;font-size:clamp(17px,2vw,22px);text-align:center;overflow-wrap:anywhere;text-shadow:0 0 9px rgba(255,200,48,.23)}
.match-reward-none{font-size:12px;color:#aeb6c8;text-align:center;font-style:italic}
body:not(.pve-match-finished) .match-rewards-panel{display:none!important}
@media(max-width:600px){.match-rewards-panel{margin-top:18px;padding:14px;max-height:55vh}.combat-callout{font-size:clamp(42px,11vw,72px)}}
@media(prefers-reduced-motion:reduce){.combat-callout{animation:realm-combat-callout 1150ms linear both}}

/* V0.28.29 — choose a slot only after Equip is clicked; no per-row dropdowns. */
.inventory-equip-actions {flex-shrink:0;align-items:center}
.inventory-slot-picker {position:fixed;inset:0;z-index:3200;display:flex;align-items:center;justify-content:center;padding:20px;box-sizing:border-box;background:rgba(6,5,13,.83);backdrop-filter:blur(7px)}
.inventory-slot-picker-card {box-sizing:border-box;width:min(590px,94vw);max-height:90vh;overflow:auto;padding:24px;border:1px solid rgba(192,132,252,.58);border-radius:17px;background:linear-gradient(165deg,#29213a,#12141d);color:#ede4fb;box-shadow:0 26px 80px #000b}
.inventory-slot-picker-card h3 {font-family:"IM Fell English SC",Georgia,serif;font-size:27px;color:#f2d9ff;font-weight:400;margin:0 0 9px;overflow-wrap:anywhere}
.inventory-slot-picker-card p {font-size:12px;color:#c5b4d8;line-height:1.5;margin:0 0 18px}
.inventory-slot-choices {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.inventory-slot-choice {font-family:inherit;cursor:pointer;text-align:left;display:flex;flex-direction:column;gap:5px;min-height:67px;border:1px solid rgba(192,132,252,.28);border-radius:10px;padding:11px 13px;color:#f0dafa;background:rgba(64,35,87,.45)}
.inventory-slot-choice:hover,.inventory-slot-choice:focus-visible {outline:2px solid #ba8bea;outline-offset:1px;background:rgba(106,57,148,.52)}
.inventory-slot-choice span {font-size:12px;font-weight:800}
.inventory-slot-choice small {color:#c7b7d5;font-size:11px;line-height:1.35;overflow-wrap:anywhere}
.inventory-slot-picker-footer {display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:16px}
.inventory-slot-picker-error {flex:1;min-height:16px}
@media(max-width:480px){.inventory-slot-picker-card{padding:16px}.inventory-slot-choices{grid-template-columns:1fr}.inventory-slot-choice{min-height:56px}}

/* v0.28.30 — rarity tags and item-first inventory actions */
.item-rarity{font-family:inherit;font-size:.76em;font-weight:800;white-space:nowrap}
.item-rarity-common{color:#fff}
.item-rarity-uncommon{color:#a7f3a2}
.item-rarity-rare{color:#60a5fa}
.item-rarity-ultrarare{color:#c084fc}
.item-rarity-legendary{color:#ff525a}
.item-rarity-flags{color:#fb923c}
.item-rarity-unknown{color:#c5c5c5}
.inventory-item-details strong{color:#f5dfae}
.inventory-item-details strong .item-rarity{font-family:system-ui,Arial,sans-serif;vertical-align:baseline;font-size:11px}
.inventory-bag-select{border:0;background:transparent;color:inherit;text-align:left;cursor:pointer;padding:0;width:100%;display:flex;align-items:center;gap:12px;font-family:inherit}
.inventory-bag-select:hover .inventory-item-details strong,.inventory-bag-select:focus-visible .inventory-item-details strong{color:#fff1cc}
.inventory-bag-select:focus-visible{outline:2px solid #ba8bea;outline-offset:5px;border-radius:7px}
.inventory-bag-arrow{color:#d8a7ff;font-size:28px;line-height:1}
.inventory-item-action-choices{margin-top:13px}
.match-reward-item-name{color:#ffe16b}
.match-reward-item .item-rarity{font-family:system-ui,Arial,sans-serif;font-size:15px;text-shadow:none}

.inventory-silver-transfer{margin-top:5px;border:1px solid rgba(197,165,232,.48);border-radius:99px;background:rgba(104,59,138,.22);color:#e4c8ff;font-weight:800;font-size:10px;padding:4px 12px;cursor:pointer}
.inventory-silver-transfer:hover:not(:disabled){background:rgba(104,59,138,.5)}
.inventory-silver-transfer:disabled{opacity:.4;cursor:not-allowed}
.inventory-silver-input{display:flex;flex-direction:column;gap:7px;margin:12px 0}
.inventory-silver-input input{background:#15111e;border:1px solid #8b65b2;border-radius:8px;padding:10px;color:white;max-width:100%}
.inventory-silver-destinations{margin-top:12px}
/* Preserve rarity tag colors over the older generic inventory span selector. */
.inventory-item-details .item-rarity-common{color:#fff}
.inventory-item-details .item-rarity-uncommon{color:#a7f3a2}
.inventory-item-details .item-rarity-rare{color:#60a5fa}
.inventory-item-details .item-rarity-ultrarare{color:#c084fc}
.inventory-item-details .item-rarity-legendary{color:#ff525a}
.inventory-item-details .item-rarity-flags{color:#fb923c}


/* V0.28.31 — Discard Back matches the same deep graphite as Discard Selected. */
body.team-plan-discard-active .team-plan-discard-controls .target-back-button,
body.team-plan-discard-active .team-plan-discard-controls .team-plan-discard-confirm{
  background:linear-gradient(180deg,rgba(38,44,52,.86),rgba(25,30,37,.88))!important;
  border-color:rgba(148,163,184,.24)!important;
  color:#f8fafc!important;
}
body.team-plan-discard-active .team-plan-discard-controls .target-back-button:hover:not(:disabled),
body.team-plan-discard-active .team-plan-discard-controls .team-plan-discard-confirm:hover:not(:disabled){
  background:linear-gradient(180deg,rgba(49,56,67,.95),rgba(35,41,51,.96))!important;
  border-color:rgba(203,213,225,.48)!important;
}


/* v0.28.42: Menu screens use a neutral charcoal gradient, no artwork. */
body.mode-selecting .play-mode-overlay{
  background:linear-gradient(145deg,#34363b 0%,#24262b 42%,#0e1014 100%);
  backdrop-filter:none;
}
body.mode-selecting .play-mode-card{
  background:linear-gradient(180deg,rgba(40,43,50,.97),rgba(16,18,23,.99));
  border-color:rgba(158,163,174,.34);
  box-shadow:0 30px 100px rgba(0,0,0,.72);
}
body.mode-selecting .play-mode-card:has(.mode-choice-main){
  position:relative;
  background:linear-gradient(180deg,rgba(41,44,51,.97),rgba(15,17,22,.99)) !important;
  border-color:rgba(158,163,174,.34);
  box-shadow:0 30px 100px rgba(0,0,0,.72), inset 0 0 0 1px rgba(255,255,255,.02);
}
/* Remove the redundant floating upper-left wordmark on setup overlays,
   while keeping the centered purple menu title and in-battle header intact. */
body.mode-selecting .play-mode-overlay .realmfall-mark{display:none !important;}
body.mode-selecting .play-mode-card .play-mode-brand-row:has(.overlay-meta:empty){display:none;}

body.mode-selecting .play-mode-card:has(.mode-choice-main) .play-mode-brand-row,
body.mode-selecting .play-mode-card:has(.mode-choice-main) #modeContent{
  position:relative;
  z-index:1;
}
body.mode-selecting .play-mode-card:has(.mode-choice-main) .mode-choice-main > .main-menu-title{
  text-align:center;
  font-family:"IM Fell English SC",Georgia,serif;
  font-weight:400;
  font-size:46px;
  letter-spacing:.04em;
  margin:2px 0 8px;
  color:#cf9cff;
  text-shadow:0 2px 16px rgba(126,34,206,.40), 0 0 28px rgba(192,132,252,.16);
}
body.mode-selecting .play-mode-card:has(.mode-choice-main) .mode-choice-main > .mode-actions{
  margin:12px 0 18px;
}
body.mode-selecting .play-mode-card:has(.mode-choice-main) .character-hall{
  background:linear-gradient(145deg, rgba(28,19,41,.56), rgba(14,11,24,.88) 58%, rgba(21,14,31,.92));
  backdrop-filter:blur(5px);
}
@media(max-width:710px){
  body.mode-selecting .play-mode-card:has(.mode-choice-main) .mode-choice-main > .main-menu-title{font-size:34px;}
}


/* v0.28.34 — RealmFall home hub, Navvare kingdom, and world map. */
body.mode-selecting .realm-hub-entry{display:flex;align-items:center;flex-direction:column;gap:11px;margin:14px 0 22px}
.realm-hub-intro{font-family:"IM Fell English",Georgia,serif;color:#dfc8ed;font-size:17px;text-align:center}
body.mode-selecting .realm-enter-button{font-family:"IM Fell English SC",Georgia,serif;font-size:24px;font-weight:400;letter-spacing:.035em;padding:15px 45px;min-width:310px;min-height:56px;border:1px solid #ba8eec;color:#f5deff;background:linear-gradient(180deg,rgba(122,55,170,.86),rgba(60,27,91,.94));box-shadow:0 8px 25px rgba(30,7,53,.44),inset 0 1px rgba(250,234,255,.23);border-radius:15px}
body.mode-selecting .realm-enter-button:hover{background:linear-gradient(180deg,rgba(148,70,193,.96),rgba(73,31,111,.97));transform:translateY(-1px)}
body.mode-selecting .play-mode-card:has(.world-map-screen){width:min(1440px,98vw);max-width:1440px;padding:25px 28px;overflow:auto;max-height:96vh;background:linear-gradient(180deg,rgba(29,25,35,.98),rgba(11,13,21,.99))}
.world-map-screen{font-family:"IM Fell English",Georgia,serif;color:#f2e8f9}
.world-map-top{display:flex;justify-content:space-between;align-items:center;gap:15px;margin-bottom:8px}
.world-map-top h2{font-family:"IM Fell English SC",Georgia,serif;font-size:36px;font-weight:400;color:#ebd7ff;margin:3px 0}
.world-map-subtitle{font-family:"IM Fell English",Georgia,serif;font-size:16px;color:#c8bacf;line-height:1.4;margin:0 0 17px}
.world-map-body{display:grid;grid-template-columns:minmax(0,1fr) 280px;gap:15px;align-items:start}
.world-map-scroll{overflow:auto;border:1px solid rgba(176,125,211,.52);border-radius:16px;background:#121722;max-height:68vh;min-height:430px;scrollbar-color:#674087 #191320}
.world-map-canvas{position:relative;min-width:890px;width:100%;height:1206px;overflow:hidden;background:linear-gradient(180deg,rgba(8,24,14,.08),rgba(6,17,11,.14)),url('/static/realm1_overworld_realm1.png') center top/100% 100% no-repeat}
.world-map-canvas::before{content:'';position:absolute;inset:0;pointer-events:none;background:repeating-linear-gradient(0deg,transparent 0 48px,rgba(229,211,171,.035) 49px),repeating-linear-gradient(90deg,transparent 0 48px,rgba(229,211,171,.035) 49px);z-index:0}
.world-map-route{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:1;filter:drop-shadow(0 2px 2px #16121c)}
.world-map-stage{position:absolute;z-index:3;transform:translate(-50%,-50%);display:flex;flex-direction:column;justify-content:center;align-items:center;min-width:53px;min-height:52px;padding:5px 7px;cursor:pointer;border:1px solid rgba(222,185,115,.55);border-radius:12px;background:linear-gradient(150deg,rgba(27,27,42,.93),rgba(44,33,47,.95));color:#f2dfb5;box-shadow:0 4px 10px rgba(0,0,0,.50);font-family:"IM Fell English SC",Georgia,serif}
.world-map-stage:hover,.world-map-stage.is-selected{border-color:#edcc86;background:#574064;transform:translate(-50%,-50%) scale(1.10)}
.world-map-stage-dot{font-size:13px;color:#d1a25d;line-height:1}.world-map-stage-num{font-size:15px;line-height:1.2;white-space:nowrap}
.world-map-boss{border-color:#d2a149;background:linear-gradient(160deg,#644124,#321c32)}.world-map-boss .world-map-stage-dot{color:#ffe29b}
.world-map-kingdom{position:absolute;z-index:4;transform:translate(-20%,-77%);width:170px;min-height:83px;border-radius:15px;border:2px solid rgba(250,209,131,.83);background:linear-gradient(145deg,rgba(85,59,63,.95),rgba(34,29,44,.97));color:#ffe3ae;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;cursor:pointer;box-shadow:0 0 26px rgba(235,162,69,.25),0 5px 25px rgba(0,0,0,.50);font:16px/1.05 "IM Fell English SC",Georgia,serif;text-align:center}
.world-map-kingdom:hover{background:#65466c}.world-map-castle{font-size:27px;line-height:1}
.world-map-landmark{position:absolute;z-index:1;opacity:.57;font-family:"IM Fell English SC",Georgia,serif;font-size:20px;text-align:center;color:#ddcbdd;text-shadow:0 2px 6px #10121a}
.world-map-landmark small{display:block;font-size:11px;letter-spacing:.1em}.world-map-mountains{top:13%;left:6%}.world-map-woods{top:59%;left:48%}
.world-map-details{box-sizing:border-box;border-radius:14px;border:1px solid rgba(194,154,239,.30);padding:17px;background:linear-gradient(160deg,rgba(50,34,65,.80),rgba(16,15,26,.97));position:sticky;top:0;min-height:420px}
.world-map-details h3{font-family:"IM Fell English SC",Georgia,serif;font-size:27px;line-height:1.16;color:#eed8ff;font-weight:400;margin:7px 0 12px}
.world-map-details p{font-size:15px;color:#c4b7cc;line-height:1.5;margin:0 0 14px}
.world-map-districts{display:grid;gap:8px}
.world-map-action{font-family:"IM Fell English SC",Georgia,serif;text-align:left;width:100%;border-radius:10px;border:1px solid rgba(200,151,245,.45);background:rgba(76,41,115,.48);padding:10px 12px;color:#f8e2ff;font-size:18px;cursor:pointer}
.world-map-action small{display:block;font:12px/1.3 system-ui,sans-serif;color:#b6a9c2;margin-top:3px}
.world-map-action:hover:not(:disabled){border-color:#daa6ff;background:#643c85}.world-map-action.world-map-soon{opacity:.65;cursor:not-allowed}
.world-map-dungeon{margin-top:18px;border-top:1px solid rgba(216,180,254,.25);padding-top:14px}
.world-map-dungeon strong{font-family:"IM Fell English SC",Georgia,serif;font-size:19px;color:#f7dfb8}
.world-map-dungeon p{font-size:12px;margin:7px 0 11px}.world-map-dungeon button{width:100%;font-size:12px;min-height:39px}
.world-map-hint{border-top:1px solid rgba(192,132,252,.25);margin-top:16px;padding-top:12px;font-size:13px;color:#c9bad3;line-height:1.5}
.world-map-encounter-facts{display:flex;gap:11px;flex-wrap:wrap;font-size:14px;color:#d4b9f1;margin:13px 0 18px}
.world-map-begin{width:100%;margin-top:4px;min-height:48px;font-family:"IM Fell English SC",Georgia,serif;font-size:19px}
.world-map-city-return{width:100%;margin-top:11px;font-family:"IM Fell English SC",Georgia,serif}
@media(max-width:980px){.world-map-body{grid-template-columns:1fr}.world-map-scroll{max-height:53vh}.world-map-details{position:static;min-height:200px}.world-map-canvas{height:1206px}}
@media(max-width:580px){.world-map-screen .world-map-top h2{font-size:26px}.world-map-top .mode-button{font-size:11px}.world-map-subtitle{font-size:14px}body.mode-selecting .play-mode-card:has(.world-map-screen){padding:14px}}

.world-map-dungeon-stages{display:flex;gap:5px;margin:7px 0 12px}.world-map-dungeon-stages span{display:grid;place-items:center;flex:1;height:25px;border:1px solid rgba(184,137,223,.35);border-radius:6px;font-family:"IM Fell English SC",Georgia,serif;font-size:13px;color:#e3c2fa;background:rgba(51,32,67,.4)}


/* v0.28.35: Navvare interior, minimal functional copy and map navigation. */
body.mode-selecting .play-mode-card:has(.navvare-interior){
  width:min(1100px,96vw);max-width:1100px;
  min-height:min(640px,88vh);
  border-color:rgba(187,146,255,.42);
  background:linear-gradient(165deg,rgba(42,44,49,.92),rgba(15,16,20,.96));
  image-rendering:auto;
}
.navvare-interior{display:flex;flex-direction:column;align-items:center;justify-content:space-between;
  gap:25px;min-height:min(550px,76vh);color:#f3e8ff;text-align:center;}
.navvare-interior h2{font-size:clamp(28px,4vw,44px)!important;
  font-family:'IM Fell English SC',Georgia,serif!important;font-weight:400;
  color:#f3dcff!important;text-shadow:0 3px 12px #050211,0 0 20px #27103d;}
.navvare-district-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:11px;
  padding:14px;background:rgba(12,12,22,.84);border:1px solid rgba(191,143,235,.44);
  border-radius:15px;backdrop-filter:blur(7px);width:min(820px,100%);box-sizing:border-box;margin-top:auto;}
.navvare-district-actions .world-map-action{text-align:center;font-size:19px;min-height:52px;}
.navvare-interior #navvareReturnMap{align-self:center;background:rgba(12,12,22,.86);}
body.mode-selecting .play-mode-card:has(.navvare-interior) #modeContent{width:100%;}
.world-map-dungeon-marker{position:absolute;z-index:5;transform:translate(-50%,-50%);
  width:127px;min-height:61px;padding:7px 9px;border:2px solid #f87171;border-radius:13px;
  background:linear-gradient(160deg,rgba(114,22,32,.97),rgba(51,8,19,.96));
  color:#ffe4e6;box-shadow:0 0 18px rgba(231,31,54,.3),0 5px 12px #08040b;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;cursor:pointer;}
.world-map-dungeon-marker:hover:not(:disabled){background:#9b273e;}
.world-map-dungeon-marker.is-locked{border-color:#b74a54;opacity:.76;cursor:not-allowed;}
.world-map-dungeon-marker small{font-size:11px;color:#fecdd3;}
.world-map-current{border-color:#e9b8ff!important;box-shadow:0 0 20px rgba(192,132,252,.6)!important;}
/* The scroll map has a separate right-hand details panel; no Bandit Blockade sidebar box. */
.world-map-body > .world-map-scroll{min-width:0;}
.world-map-screen .world-map-top h2{color:#dda8ff;}
.combat-map-button{min-height:38px;min-width:90px;padding:8px 16px;border-radius:999px;
  border:1px solid rgba(192,132,252,.55);background:rgba(88,28,135,.25);
  color:#e9d5ff;font-size:12px;font-weight:800;cursor:pointer;}
.combat-map-button:hover{background:rgba(126,34,206,.35);}
.combat-map-button.hidden{display:none!important;}
.in-game-map-modal{position:fixed;inset:0;z-index:2800;display:grid;place-items:center;
  background:rgba(5,5,12,.82);backdrop-filter:blur(6px);padding:20px;}
.in-game-map-modal.hidden{display:none!important;}
.in-game-map-panel{box-sizing:border-box;width:min(1170px,98vw);max-height:95vh;overflow:auto;
  background:linear-gradient(180deg,#24212c,#10111a);border:1px solid rgba(192,132,252,.48);
  padding:20px;border-radius:18px;box-shadow:0 24px 90px #000b;}
.in-game-map-head{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:16px;}
.in-game-map-head h2{font-size:34px;color:#ddb2ff;font-weight:400;}
.in-game-map-head span{color:#c7acdf;font-size:18px;display:block;margin-top:4px;}
.in-game-map-panel .world-map-scroll{height:min(68vh,800px);max-height:68vh;}
.in-game-map-panel .world-map-stage,.in-game-map-panel .world-map-kingdom,
.in-game-map-panel .world-map-dungeon-marker{cursor:default;pointer-events:none;}
/* User-approved typography throughout: no system-ui / Inter mismatch. */
html,body,body *:not(svg):not(path):not(polyline),button,input,textarea,select,option{
  font-family:'IM Fell English SC','IM Fell English',Georgia,serif!important;
}
@media(max-width:710px){.navvare-district-actions{grid-template-columns:1fr;}
  .navvare-interior{min-height:68vh;}.world-map-dungeon-marker{width:110px;}}

/* v0.28.42: Navvare interior is a plain charcoal menu, not an image. */
body.mode-selecting .play-mode-overlay:has(.navvare-interior){
  background:linear-gradient(145deg,#34363b 0%,#24262b 42%,#0e1014 100%);
  backdrop-filter:none;
}
body.mode-selecting .play-mode-card:has(.navvare-interior){
  min-height:auto;
  width:min(950px,95vw);max-width:950px;
  background:linear-gradient(180deg,rgba(22,22,30,.89),rgba(10,11,18,.93))!important;
  image-rendering:auto;
}
.navvare-interior{min-height:auto;gap:28px;}
.navvare-district-actions{margin-top:0;}


/* V0.28.36 — Navvare four district controls and translucent start/login panels. */
.navvare-district-actions{grid-template-columns:repeat(4,minmax(0,1fr));}
@media(max-width:920px){.navvare-district-actions{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:550px){.navvare-district-actions{grid-template-columns:1fr;}}
/* Match the existing Navvare graphite translucency on the starting login screen. */
body.mode-selecting .play-mode-card:has(.realm-login-panel){
  background:linear-gradient(180deg,rgba(22,22,30,.89),rgba(10,11,18,.93))!important;
}
body.mode-selecting .realm-login-panel{
  background:linear-gradient(145deg,rgba(47,49,55,.62),rgba(14,15,19,.76));
  backdrop-filter:blur(5px);
}


/* v0.28.37 — map marker cleanup */
.world-map-start{
  border-color:rgba(255,223,145,.75);
  background:linear-gradient(160deg,rgba(52,41,28,.95),rgba(31,25,34,.95));
  min-width:58px;min-height:56px;
}
.world-map-final-boss{
  border-color:#85c8ff!important;
  background:linear-gradient(160deg,rgba(22,61,112,.98),rgba(14,30,74,.98))!important;
  color:#e9f6ff!important;
  min-width:74px;min-height:72px;
  box-shadow:0 0 24px rgba(96,165,250,.50),0 6px 16px rgba(0,0,0,.55)!important;
}
.world-map-final-boss .world-map-stage-dot{color:#d7eeff!important;font-size:17px;}
.world-map-final-boss .world-map-stage-num{font-size:18px!important;}
.world-map-kingdom{width:194px;min-height:92px;background:linear-gradient(145deg,rgba(93,66,73,.97),rgba(34,29,44,.98));}
.world-map-kingdom span:last-child{font-size:17px;line-height:1.06;}


/* v0.28.42: PvP setup/host/join screens use the charcoal menu gradient.
   PvP COMBAT still uses the wooded forest. Leave sprites untouched. */
body.mode-selecting.pvp-arena-active .play-mode-overlay{
  background:linear-gradient(145deg,#34363b 0%,#24262b 42%,#0e1014 100%);
  backdrop-filter:none;
}
/* Keep the EXISTING PvP 1v1 character positioning exactly as it was. */
body.pvp-arena-active .battle-sprite-layer.team1-count-1.team2-count-1 .battle-sprite.slot-0{
  top:40%!important;
}


/* V0.28.40: selectable map details, map inventory, and explicit quit action. */
.world-map-top-actions{display:flex;align-items:center;justify-content:flex-end;gap:9px;flex-wrap:wrap}
.world-map-top-actions .mode-button{min-width:96px;min-height:42px;padding:9px 16px;font-size:15px}
.world-map-top-actions .world-map-quit{border-color:rgba(244,114,132,.58);color:#ffe4e6;background:rgba(92,24,39,.52)}
.world-map-top-actions .world-map-quit:hover{background:rgba(141,34,58,.72)}
.world-map-kingdom.is-selected{outline:3px solid #e9b8ff;outline-offset:3px;box-shadow:0 0 27px rgba(192,132,252,.55)}
.world-map-dungeon-marker.is-selected{outline:3px solid #e9b8ff;outline-offset:3px;opacity:1}
.world-map-locked{color:#fda4af;font-size:15px;margin:12px 0}
.world-map-details .world-map-proceed{display:block;width:100%;margin-top:18px;font-size:20px;min-height:54px}
.world-map-inventory-modal{position:fixed;inset:0;z-index:2500;display:grid;place-items:center;padding:18px;background:rgba(5,5,14,.84);backdrop-filter:blur(6px)}
.world-map-inventory-panel{display:flex;flex-direction:column;width:min(1180px,98vw);max-height:94vh;min-height:300px;overflow:hidden;box-sizing:border-box;border-radius:18px;border:1px solid rgba(200,151,245,.5);background:linear-gradient(160deg,#262132,#10121b);box-shadow:0 24px 70px rgba(0,0,0,.6);padding:19px 22px}
.world-map-inventory-head{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:16px}
.world-map-inventory-head h2{font-size:32px;color:#e9d5ff;margin:0}
.world-map-inventory-content{min-height:0;display:grid;grid-template-columns:225px minmax(0,1fr);gap:18px;overflow:hidden;flex:1}
.world-map-inventory-roster{display:flex;flex-direction:column;gap:8px;overflow:auto;padding:6px 5px 6px 0;border-right:1px solid rgba(192,132,252,.2)}
.world-map-inventory-character-button{display:flex;align-items:center;gap:10px;text-align:left;color:#f3e8ff;background:rgba(57,40,76,.55);border:1px solid rgba(181,141,216,.25);padding:9px;border-radius:10px;min-height:67px;cursor:pointer}
.world-map-inventory-character-button.is-selected{border-color:#d8b4fe;background:rgba(102,55,145,.64)}
.world-map-inventory-character-button span{display:flex;flex-direction:column;gap:3px;min-width:0}
.world-map-inventory-character-button strong{overflow-wrap:anywhere;font-size:15px}
.world-map-inventory-character-button small{color:#cbb5e2;font-size:12px}
.world-map-inventory-class-art{width:40px;height:49px;object-fit:contain;image-rendering:pixelated;flex-shrink:0}
.world-map-inventory-character{min-width:0;overflow:auto;padding:3px 8px 14px 0}
.world-map-inventory-character .inventory-screen{padding-bottom:15px}
@media(max-width:700px){.world-map-top{flex-wrap:wrap}.world-map-top-actions{width:100%;justify-content:flex-start;gap:7px}.world-map-top-actions .mode-button{min-width:0;flex:1;padding:8px 5px}.world-map-inventory-panel{padding:11px;max-height:97vh}.world-map-inventory-content{grid-template-columns:1fr;grid-template-rows:auto minmax(0,1fr);gap:9px}.world-map-inventory-roster{flex-direction:row;border-right:0;border-bottom:1px solid rgba(192,132,252,.2);max-height:95px;padding:0 0 8px;min-height:70px}.world-map-inventory-character-button{min-width:156px}}

.world-map-dungeon-marker.is-locked{cursor:pointer;}

/* v0.28.41: Combat information keeps the ORIGINAL readable UI font.
   The fantasy font remains on menus/map, NOT on HP, Mana, effects, or
   in-battle floating/status text. Do not resize or reposition sprites. */
body .fighter-card .mana-chip,
body .fighter-card .anti-mana-chip,
body .fighter-card .bar-text,
body .fighter-card .effects,
body .fighter-card .effects *,
body .fighter-card .fighter-stat-popover,
body .fighter-card .fighter-stat-popover *,
body .battle-effect-float,
body .battle-damage-float,
body .combat-callout,
body .battle-sprite .sprite-hp,
body .summon-effects,
body .summon-effects * {
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important;
}

/* V0.28.43: no redundant adventurer heading; keep Create Character right-aligned. */
body.mode-selecting .character-hall-head{justify-content:flex-end}


/* V0.28.44 — readable effective character stats and one unified transfer flow. */
.inventory-stats-toggle{margin:16px 0 5px;border:1px solid rgba(190,145,229,.35);border-radius:12px;background:rgba(27,24,36,.55);overflow:hidden}
.inventory-stats-toggle summary{cursor:pointer;padding:13px 16px;color:#eedbff;font-size:19px;list-style:revert}
.inventory-stats-toggle summary:hover{background:rgba(109,65,143,.25)}
.inventory-stat-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;padding:0 13px 14px}
.inventory-stat{display:flex;justify-content:space-between;flex-direction:column;gap:5px;border:1px solid rgba(179,144,213,.16);background:rgba(10,12,19,.45);border-radius:8px;padding:10px 12px;min-width:0}
.inventory-stat span{font-size:13px;color:#c8b4d8;overflow-wrap:anywhere}
.inventory-stat strong{font-size:20px;color:#fff;letter-spacing:.02em;font-variant-numeric:tabular-nums}
.inventory-toolbar{display:flex;justify-content:flex-end;align-items:center;margin:-5px 0 16px}
.inventory-toolbar .inventory-transfer{min-width:145px;font-size:16px}
.inventory-bag-equip-label{color:#d8b4fe;font-size:15px;margin-left:auto;white-space:nowrap}
.inventory-transfer-form{display:flex;flex-direction:column;gap:10px;margin:12px 0}
.inventory-transfer-form label{font-size:15px;color:#e8d5fa}
.inventory-transfer-form select,.inventory-transfer-form input{box-sizing:border-box;width:100%;background:#181420;color:#f7eafe;border:1px solid #8b65b2;border-radius:8px;padding:10px 12px;font-size:16px}
.inventory-transfer-amount{display:flex;flex-direction:column;gap:8px}
.inventory-transfer-form .inventory-transfer-confirm{align-self:flex-end;min-width:140px;margin-top:8px}
@media(max-width:850px){.inventory-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:480px){.inventory-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;padding:0 7px 9px}.inventory-stat{padding:8px}.inventory-stat span{font-size:11px}.inventory-stat strong{font-size:16px}}


/* V0.28.47 — Owner-supplied castle art, color graded purple/night.
   ONLY on login and logged-in character menu. Navvare, PvP setup,
   campaign/world map and combat retain their current backgrounds.
   Do not change sprite layout/scaling or add extra menu prose. */
body.mode-selecting .play-mode-overlay:has(.realm-login-panel),
body.mode-selecting .play-mode-overlay:has(.mode-choice-main){
  background:
    linear-gradient(125deg,rgba(10,6,25,.26) 0%,rgba(20,10,35,.20) 48%,rgba(10,8,23,.32) 100%),
    url('/static/menu_castle_purple_night.png') center center / cover no-repeat;
  backdrop-filter:none;
}
body.mode-selecting .play-mode-card:has(.realm-login-panel),
body.mode-selecting .play-mode-card:has(.mode-choice-main){
  background:linear-gradient(180deg,rgba(31,27,41,.73),rgba(14,13,24,.85))!important;
  border-color:rgba(190,163,216,.5);
  backdrop-filter:blur(4px);
}
body.mode-selecting .play-mode-card:has(.mode-choice-main) .character-hall{
  background:linear-gradient(145deg,rgba(29,22,45,.77),rgba(13,12,24,.84) 58%,rgba(21,15,32,.89));
}


/* V0.28.48: one stats sheet UI everywhere, opened adjacent to the arrow.
   Detached from the combat .layout stacking context and card overflow. */
.character-stat-sheet-portal{position:fixed;inset:0;z-index:5000;pointer-events:none;overflow:visible}
.character-stat-sheet-portal .fighter-stat-popover{
  position:fixed!important;z-index:5001!important;display:block!important;
  pointer-events:auto;top:10px;left:10px;right:auto!important;bottom:auto!important;
  width:min(338px,calc(100vw - 20px));max-height:calc(100dvh - 20px)!important;
  overflow-y:auto!important;overscroll-behavior:contain;
  border:1px solid rgba(192,132,252,.42);
  box-shadow:0 18px 56px rgba(0,0,0,.86);
  font-family:Inter,ui-sans-serif,system-ui,sans-serif!important;
}
.character-stat-sheet-portal .fighter-stat-popover *{
  font-family:Inter,ui-sans-serif,system-ui,sans-serif!important;
}
.inventory-hero-identity{min-width:0;flex:1}
.inventory-stat-name-row,.roster-stat-name-row{display:flex;align-items:center;gap:9px;min-width:0}
.inventory-stat-name-row h2{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:0 1 auto}
.inventory-stat-name-row .fighter-stat-toggle,.roster-stat-name-row .fighter-stat-toggle{
  flex:0 0 25px;margin:0!important;width:25px;height:25px;padding:0!important;font-size:12px!important;
}
.roster-stat-name-row strong{min-width:0;overflow:hidden;text-overflow:ellipsis}
@media(max-width:560px){.character-stat-sheet-portal .fighter-stat-popover{width:min(338px,calc(100vw - 20px))!important}}


/* V0.28.49 — keep room state, victory and connection badge data in JS,
   but don't show them in the battle header. */
.topbar-right #remoteRoomBadge,
.topbar-right #roundBadge,
.topbar-right #connectionBadge {display:none!important;}

/* Owner-supplied purple castle art behind the world-map PAGE and Navvare.
   The campaign map canvas retains its separate forest texture, and neither
   PvE nor PvP battlefield art is changed. */
body.mode-selecting .play-mode-overlay:has(.world-map-screen),
body.mode-selecting .play-mode-overlay:has(.navvare-interior){
  background:
    linear-gradient(125deg,rgba(10,6,25,.36),rgba(20,10,35,.25) 48%,rgba(10,8,23,.40)),
    url('/static/menu_castle_purple_night.png') center center / cover no-repeat;
  backdrop-filter:none;
}
body.mode-selecting .play-mode-card:has(.world-map-screen){
  background:linear-gradient(180deg,rgba(29,25,38,.78),rgba(12,13,23,.87))!important;
  border-color:rgba(190,163,216,.5);
  backdrop-filter:blur(4px);
}
body.mode-selecting .play-mode-card:has(.navvare-interior){
  background:linear-gradient(180deg,rgba(29,25,38,.71),rgba(12,13,23,.83))!important;
  border-color:rgba(190,163,216,.5);
  backdrop-filter:blur(4px);
}

/* V0.28.49 inventory: Transfer near profile heading, deletion at bottom.
   Deletion requires an exact user-entered confirmation phrase. */
.inventory-character-actions{margin:12px 0 16px;display:flex;justify-content:flex-end;align-items:center;}
.inventory-character-actions .inventory-transfer{min-width:145px;font-size:16px;}
.inventory-delete-footer{margin:28px 0 0;padding:20px 0 6px;border-top:1px solid rgba(224,193,238,.20);display:flex;flex-direction:column;align-items:flex-end;gap:12px;}
.inventory-delete-confirm{width:100%;}
.inventory-delete-confirm label{display:block;font-size:16px;color:#f1dbea;margin:0 0 12px;}
.inventory-delete-confirm label strong{font-family:inherit!important;font-size:16px;font-weight:600;letter-spacing:normal;color:#fecaca;}
.inventory-delete-phrase{width:100%;max-width:560px;box-sizing:border-box;display:block;margin:0 auto 16px;background:rgba(11,9,20,.87);border:1px solid rgba(248,113,113,.6);border-radius:8px;padding:11px 12px;color:#fff;font-size:16px;}
.inventory-delete-phrase:focus-visible{outline:2px solid #f87171;outline-offset:2px;}


/* V0.28.51 — Main-menu inventory uses the same purple castle environment as Home.
   Scope the artwork to the full-screen Home inventory only: maps and combat stay unchanged. */
body.mode-selecting .play-mode-overlay:has(#modeContent > .inventory-screen){
  background:
    linear-gradient(125deg,rgba(10,6,25,.26) 0%,rgba(20,10,35,.20) 48%,rgba(10,8,23,.32) 100%),
    url('/static/menu_castle_purple_night.png') center center / cover no-repeat;
  backdrop-filter:none;
}
body.mode-selecting .play-mode-card:has(#modeContent > .inventory-screen){
  background:linear-gradient(180deg,rgba(31,27,41,.78),rgba(14,13,24,.88))!important;
  border-color:rgba(190,163,216,.5);
  backdrop-filter:blur(4px);
}

/* Map inventory lives directly under <body> so the map's scroll and blur can
   never constrain its fixed positioning. Header / Back button remain visible. */
.world-map-inventory-modal{
  padding:clamp(9px,2vh,20px);
  overflow:hidden;
  overscroll-behavior:contain;
}
.world-map-inventory-panel{
  width:min(1220px,calc(100vw - 24px));
  height:min(810px,calc(100dvh - 24px));
  max-height:calc(100dvh - 18px);
  min-height:0;
  padding:clamp(11px,1.8vh,20px);
  overflow:hidden;
}
.world-map-inventory-head{flex:0 0 auto;margin-bottom:12px;min-height:41px}
.world-map-inventory-head h2{font-family:"IM Fell English SC",Georgia,serif;font-size:29px;font-weight:400}
.world-map-inventory-head .mode-button{flex-shrink:0;white-space:nowrap}
.world-map-inventory-content{flex:1;min-height:0;grid-template-columns:minmax(155px,185px) minmax(0,1fr);gap:15px}
.world-map-inventory-roster,.world-map-inventory-character,.world-map-inventory-character .inventory-slot,.world-map-inventory-character .inventory-bag{
  scrollbar-width:none;
}
.world-map-inventory-roster::-webkit-scrollbar,.world-map-inventory-character::-webkit-scrollbar,.world-map-inventory-character .inventory-slot::-webkit-scrollbar,.world-map-inventory-character .inventory-bag::-webkit-scrollbar{display:none}
.world-map-inventory-character{height:100%;min-height:0;overflow:hidden;padding:0}
.world-map-inventory-character .inventory-screen{
  display:grid;
  grid-template-rows:auto auto auto minmax(0,1fr) auto;
  height:100%;min-height:0;
  padding:0;
}
.world-map-inventory-character .inventory-hero{min-width:0;gap:12px;padding-bottom:8px}
.world-map-inventory-character .inventory-portrait{width:58px;height:65px}
.world-map-inventory-character .inventory-hero h2{font-size:27px}
.world-map-inventory-character .inventory-character-actions{margin:6px 0;min-height:35px}
.world-map-inventory-character .inventory-character-actions .inventory-transfer{min-height:34px;font-size:14px;min-width:116px;padding:6px 14px}
.world-map-inventory-character .currency-row{gap:8px;margin:5px 0 7px}
.world-map-inventory-character .currency-row>div{padding:8px 11px;gap:1px}
.world-map-inventory-character .currency-row strong{font-size:17px}
.world-map-inventory-character .inventory-collections{
  display:grid;
  grid-template-columns:minmax(0,1.25fr) minmax(245px,.85fr);
  gap:14px;
  min-height:0;
  overflow:hidden;
}
.world-map-inventory-character .inventory-equipment-section,
.world-map-inventory-character .inventory-bag-section{min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden}
.world-map-inventory-character .inventory-section-head{flex:0 0 auto;gap:7px;margin:6px 0 9px;flex-wrap:wrap}
.world-map-inventory-character .inventory-section-head h3{font-size:21px}
.world-map-inventory-character .inventory-slot-grid{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));
  grid-template-rows:repeat(3,minmax(0,1fr));align-items:stretch;
  gap:8px;min-height:0;flex:1;
}
.world-map-inventory-character .inventory-slot{
  min-height:0;max-height:none;overflow:auto;
  padding:9px;gap:5px;
}
.world-map-inventory-character .inventory-slot-label{font-size:10px}
.world-map-inventory-character .inventory-item-details strong{font-size:15px}
.world-map-inventory-character .inventory-item-details span{font-size:10px;line-height:1.3}
.world-map-inventory-character .inventory-bag{overflow-y:auto;overscroll-behavior:contain;min-height:0;flex:1;padding-right:2px}
.world-map-inventory-character .inventory-bag-row{padding:10px}
.world-map-inventory-character #inventoryFeedback{margin:3px 0 0;min-height:0;font-size:12px}
.world-map-inventory-panel > #worldMapInventoryError:empty{display:none}
/* Smaller browser windows keep the Back button in place; only the equipment
   list scrolls when there are more details than can physically fit. */
@media(max-width:900px){
  .world-map-inventory-content{grid-template-columns:145px minmax(0,1fr);gap:10px}
  .world-map-inventory-character .inventory-collections{grid-template-columns:1fr;grid-template-rows:minmax(0,1fr) minmax(100px,.65fr);gap:7px}
  .world-map-inventory-character .inventory-slot-grid{grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr))}
}
@media(max-width:700px){
  .world-map-inventory-panel{height:calc(100dvh - 16px);max-height:calc(100dvh - 16px);padding:10px}
  .world-map-inventory-head{margin-bottom:8px}
  .world-map-inventory-head h2{font-size:24px}
  .world-map-inventory-head .mode-button{min-height:38px;padding:6px 10px;font-size:12px}
  .world-map-inventory-content{grid-template-columns:1fr;grid-template-rows:auto minmax(0,1fr);gap:6px}
  .world-map-inventory-roster{flex-direction:row;overflow-x:auto;overflow-y:hidden;max-height:80px;min-height:70px;padding:0 0 6px}
  .world-map-inventory-character .inventory-screen{grid-template-rows:auto auto auto minmax(0,1fr) auto}
  .world-map-inventory-character .inventory-hero{gap:7px}
  .world-map-inventory-character .inventory-portrait{height:45px;width:45px}
  .world-map-inventory-character .inventory-hero h2{font-size:22px}
  .world-map-inventory-character .inventory-character-actions{margin:2px 0}
  .world-map-inventory-character .currency-row>div{padding:5px 7px}
  .world-map-inventory-character .currency-row span{font-size:10px}
  .world-map-inventory-character .currency-row strong{font-size:14px}
  .world-map-inventory-character .inventory-collections{grid-template-rows:minmax(0,1fr) minmax(95px,.55fr)}
  .world-map-inventory-character .inventory-slot-grid{gap:5px}
  .world-map-inventory-character .inventory-slot{padding:6px}
  .world-map-inventory-character .inventory-section-head{margin:3px 0 5px}
  .world-map-inventory-character .inventory-section-head h3{font-size:18px}
}
@media(max-width:430px){
  .world-map-inventory-character .inventory-slot-grid{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(3,minmax(0,1fr))}
  .world-map-inventory-character .inventory-slot-label{font-size:9px}
}

/* On narrow screens prioritize identifiable equipment and an operable Unequip
   control in every slot; full item modifiers remain visible in the bag. */
@media(max-width:700px){
  .world-map-inventory-character .inventory-collections{grid-template-rows:minmax(0,1.55fr) minmax(76px,.45fr)}
  .world-map-inventory-character .inventory-slot{overflow:hidden}
  .world-map-inventory-character .inventory-slot .inventory-item-details{min-height:0;overflow:hidden;flex:1 1 auto}
  .world-map-inventory-character .inventory-slot .inventory-item-details strong{
    display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;
    overflow:hidden;font-size:13px;line-height:1.1;
  }
  .world-map-inventory-character .inventory-slot .inventory-item-details small,
  .world-map-inventory-character .inventory-slot .inventory-item-details span{display:none}
  .world-map-inventory-character .inventory-slot .mode-button{
    flex:0 0 auto;margin-top:auto;min-height:25px!important;padding:4px 9px!important;
  }
}


/* V0.28.52 — consistent almost-black scrollbars across menus, map, inventory,
   modals, combat logs and every other scrollable region. */
html, body, * {
  scrollbar-width: thin;
  scrollbar-color: #252525 #050505;
}
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: #050505; border-radius: 8px; }
*::-webkit-scrollbar-thumb {
  background: #222; border: 1px solid #424242; border-radius: 8px;
}
*::-webkit-scrollbar-thumb:hover { background: #303030; }
*::-webkit-scrollbar-corner { background: #050505; }
.world-map-scroll { scrollbar-color: #252525 #050505; }
/* Preserve invisible scrollbars for map inventory's deliberately scrollbar-free layout. */
.world-map-inventory-roster, .world-map-inventory-character,
.world-map-inventory-character .inventory-slot,
.world-map-inventory-character .inventory-bag { scrollbar-width: none; }

/* Create Character: map-style contextual panel to the right of the class picker. */
body.character-creating .play-mode-card:has(.mode-choice-main) {
  width:min(1330px,98vw); max-width:1330px;
}
body.character-creating .mode-choice-main { max-width:none; }
body.character-creating .character-hall { max-width:none; }
body.character-creating .creation-form { padding:17px; }
.creation-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(335px,390px); gap:20px; align-items:start; }
.creation-picker-column { min-width:0; }
body.character-creating .creation-picker-column input { max-width:440px; }
body.character-creating .creation-picker-column .class-choice-grid {
  grid-template-columns:repeat(5,minmax(0,1fr)); gap:11px; margin-top:9px;
}
body.character-creating .creation-picker-column .class-choice {
  min-height:133px; padding:10px 5px; justify-content:center; gap:7px;
}
body.character-creating .creation-picker-column .class-choice-art { height:76px; width:81px; }
body.character-creating .creation-picker-column .class-choice strong { font-size:18px; }
body.character-creating .creation-footer { justify-content:space-between; margin-top:17px; flex-wrap:wrap; }
body.character-creating .creation-footer .hall-error { flex:1; }
.creation-class-details {
  min-width:0; box-sizing:border-box; padding:18px; border-radius:14px;
  border:1px solid rgba(194,154,239,.45);
  background:linear-gradient(160deg,rgba(50,34,65,.88),rgba(16,15,26,.98));
  box-shadow:0 12px 32px rgba(0,0,0,.24);
}
.creation-detail-head { display:flex; align-items:center; gap:12px; }
.creation-detail-portrait { width:68px; height:84px; flex-shrink:0; object-fit:contain; image-rendering:pixelated; }
.creation-class-details h3 { font-family:'IM Fell English SC',Georgia,serif; font-size:30px; color:#f1ddff; font-weight:400; margin:3px 0 2px; }
.creation-identity { color:#d7b9f5; font-size:13px; line-height:1.35; }
.creation-detail-description { color:#d3c5df!important; font-size:13px!important; line-height:1.52; margin:14px 0 10px!important; }
.creation-class-details h4 { font-family:'IM Fell English SC',Georgia,serif; font-size:19px; color:#edd3ff; font-weight:400; margin:0 0 7px; }
.creation-playstyle { border-top:1px solid rgba(194,154,239,.20); padding:12px 0; }
.creation-playstyle p { color:#c9bed1; font-size:12px; line-height:1.5; margin:0; }
.creation-starter-deck { border-top:1px solid rgba(194,154,239,.20); padding-top:12px; }
.creation-starter-deck h4 { display:flex; justify-content:space-between; align-items:baseline; gap:8px; }
.creation-starter-deck h4 small { font:11px/1.3 system-ui,sans-serif; color:#beaad1; white-space:nowrap; }
.creation-card-list { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:6px; }
.creation-card-row { border:1px solid rgba(181,136,214,.24); border-radius:9px; padding:8px 10px; background:rgba(9,10,19,.5); }
.creation-card-top { display:flex; justify-content:space-between; gap:10px; align-items:baseline; }
.creation-card-top strong { font:650 12px/1.3 system-ui,sans-serif; color:#f3e5ff; }
.creation-card-meta { white-space:nowrap; color:#b69ddd; font:11px/1.3 system-ui,sans-serif; }
.creation-card-effect { color:#c0b4cd; font:11px/1.4 system-ui,sans-serif; margin-top:4px; }
.creation-deck-note { color:#a69ab7; font:11px/1.4 system-ui,sans-serif; margin:9px 0 0; }
/* Use a vertical stack when a full map-style sidebar would squeeze the class icons. */
@media(max-width:1040px){
  .creation-layout { grid-template-columns:1fr; gap:16px; }
  body.character-creating .creation-picker-column .class-choice-grid { grid-template-columns:repeat(5,minmax(0,1fr)); }
  .creation-class-details { position:static; }
}
@media(max-width:650px){
  body.character-creating .play-mode-card:has(.mode-choice-main){width:100%;}
  body.character-creating .creation-form { padding:12px; }
  body.character-creating .creation-picker-column .class-choice-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  body.character-creating .creation-picker-column .class-choice { min-height:108px; }
  body.character-creating .creation-picker-column .class-choice-art { width:66px; height:65px; }
  .creation-class-details { padding:13px; }
}


/* V0.28.53 — Character creation is a dedicated full-screen workspace.
   Keep the home controls on the home screen; the ONLY navigation during
   creation is the existing Back button. Restore home by toggling back. */
body.character-creating .play-mode-overlay {
  display:block; padding:0; overflow:hidden;
}
body.character-creating .play-mode-card:has(.mode-choice-main) {
  box-sizing:border-box; width:100vw!important; max-width:none!important;
  height:100dvh; max-height:100dvh; min-height:100dvh;
  padding:26px clamp(22px,3.5vw,72px) 42px;
  margin:0; border:0; border-radius:0; box-shadow:none;
  overflow-x:hidden; overflow-y:auto;
  background:linear-gradient(125deg,rgba(17,12,32,.90),rgba(11,9,23,.88))!important;
  backdrop-filter:blur(3px);
}
body.character-creating .play-mode-brand-row,
body.character-creating .mode-choice-main > .main-menu-title,
body.character-creating .realm-hub-entry,
body.character-creating .character-hall-user,
body.character-creating #modeContent > .early-edition-promo {
  display:none!important;
}
body.character-creating .mode-choice-main {
  box-sizing:border-box; width:100%!important; max-width:none!important;
  padding:0; margin:0 auto; text-align:left;
}
body.character-creating .character-hall {
  box-sizing:border-box; width:100%; max-width:1780px!important;
  margin:0 auto; padding:0; border:0; border-radius:0;
  background:none!important; box-shadow:none;
}
body.character-creating .character-hall-head {
  display:flex; justify-content:flex-start!important; align-items:center;
  margin:0 0 22px; padding:0 0 17px;
  border-bottom:1px solid rgba(195,157,225,.27);
}
body.character-creating .character-hall-head .mode-button {
  min-height:42px; padding:9px 21px; font-size:20px;
}
body.character-creating .creation-form {
  box-sizing:border-box; width:100%; max-width:none; margin:0; padding:0;
  background:none; border:0; border-radius:0;
}
body.character-creating .creation-layout {
  display:grid;
  grid-template-columns:minmax(0,1.9fr) minmax(430px,1fr);
  gap:clamp(22px,2.8vw,54px);
  align-items:start;
}
body.character-creating .creation-picker-column {
  box-sizing:border-box; min-width:0;
  padding:clamp(20px,1.8vw,32px);
  border:1px solid rgba(193,145,226,.38); border-radius:20px;
  background:linear-gradient(155deg,rgba(44,28,65,.87),rgba(13,12,27,.96));
  box-shadow:0 12px 38px rgba(0,0,0,.24);
}
body.character-creating .creation-picker-column input {
  width:100%; max-width:530px; min-height:53px;
  padding:12px 17px; font-size:18px;
  border-color:rgba(201,151,247,.55);
}
body.character-creating .creation-picker-column .creation-class-heading {
  margin:26px 0 16px; font-size:23px;
}
body.character-creating .creation-picker-column .class-choice-grid {
  display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:16px;
  margin-top:0;
}
body.character-creating .creation-picker-column .class-choice {
  box-sizing:border-box; min-width:0; min-height:199px;
  padding:16px 8px 13px; gap:12px;
  justify-content:center; overflow:hidden;
  background:linear-gradient(160deg,rgba(53,37,73,.94),rgba(21,18,37,.96));
}
body.character-creating .creation-picker-column .class-choice.selected {
  background:linear-gradient(160deg,rgba(106,58,151,.77),rgba(47,28,75,.90));
}
body.character-creating .creation-picker-column .class-choice-art {
  box-sizing:border-box; width:105px; max-width:100%; height:118px;
  object-fit:contain;
}
body.character-creating .creation-picker-column .class-choice strong {
  display:block; width:100%; font-size:clamp(16px,1.12vw,22px);
  line-height:1.18; text-align:center; white-space:nowrap;
  letter-spacing:-.015em;
}
body.character-creating .creation-footer {
  justify-content:flex-end; gap:18px; margin-top:26px; flex-wrap:wrap;
}
body.character-creating .creation-footer .mode-button {font-size:19px; min-height:45px; padding:9px 24px;}
body.character-creating .creation-class-details {
  box-sizing:border-box; width:100%; min-width:0;
  /* Content sizes to fit; only the existing full-page workspace may scroll. */
  max-height:none; overflow:visible;
  padding:clamp(20px,1.75vw,30px);
  background:linear-gradient(155deg,rgba(44,28,65,.94),rgba(14,13,26,.98));
  border-radius:20px;
}
body.character-creating .creation-detail-portrait{height:94px;width:90px;}
body.character-creating .creation-class-details h3{font-size:36px;}
body.character-creating .creation-identity{font-size:15px;}
body.character-creating .creation-detail-description{font-size:15px!important;line-height:1.5;}
body.character-creating .creation-strength{font-size:12px;padding:5px 10px;}
body.character-creating .creation-class-details h4{font-size:22px;}
body.character-creating .creation-playstyle p{font-size:14px;}
body.character-creating .creation-card-row{padding:9px 12px;}
body.character-creating .creation-card-top strong{font-size:14px;}
body.character-creating .creation-card-effect{font-size:12px;}

/* Compact, readable fallbacks; never squeeze five labels into narrow tiles. */
@media (max-width:1370px) and (min-width:1081px) {
  body.character-creating .creation-layout {grid-template-columns:minmax(0,1.65fr) minmax(370px,1fr);gap:22px;}
  body.character-creating .creation-picker-column .class-choice-grid {grid-template-columns:repeat(3,minmax(0,1fr));}
}
@media (max-width:1080px) {
  body.character-creating .creation-layout{grid-template-columns:1fr; gap:22px;}
  body.character-creating .creation-picker-column .class-choice-grid {grid-template-columns:repeat(5,minmax(0,1fr));}
  body.character-creating .creation-class-details {max-height:none;overflow:visible;}
}
@media (max-width:740px) {
  body.character-creating .play-mode-card:has(.mode-choice-main) {padding:18px 12px 30px;}
  body.character-creating .creation-picker-column{padding:16px;}
  body.character-creating .creation-picker-column .class-choice-grid {grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;}
  body.character-creating .creation-picker-column .class-choice{min-height:145px;gap:8px;}
  body.character-creating .creation-picker-column .class-choice-art{height:86px;width:80px;}
  body.character-creating .creation-picker-column .class-choice strong{font-size:16px;}
}
@media (max-width:460px) {
  body.character-creating .creation-picker-column .class-choice-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
  body.character-creating .creation-picker-column .class-choice{min-height:136px;}
  body.character-creating .creation-picker-column .class-choice strong{font-size:18px;}
}


/* V0.28.59 — Diagonal southwest combat sprites are used directly in
   character creation and on the home roster; never mirror them. */
body.character-creating .class-choice-art,
body.character-creating .creation-detail-portrait,
.character-roster-card .roster-class-art {
  transform: none;
}


/* V0.28.56 — Class picker tiles use the actual outer rim colors from each
   class's card faces; retain dark interior for sprite and label readability. */
body.character-creating .creation-picker-column .class-choice[data-class="Warrior"],
.character-roster-card[data-class="Warrior"] {
  --class-rim-light: #c76868;
  --class-rim-mid: #8f2b2b;
  --class-rim-dark: #5a1717;
}
body.character-creating .creation-picker-column .class-choice[data-class="Paladin"],
.character-roster-card[data-class="Paladin"] {
  --class-rim-light: #d5b46e;
  --class-rim-mid: #8b6a39;
  --class-rim-dark: #69502d;
}
body.character-creating .creation-picker-column .class-choice[data-class="Rogue"],
.character-roster-card[data-class="Rogue"] {
  --class-rim-light: #ff7d13;
  --class-rim-mid: #e86408;
  --class-rim-dark: #843006;
}
body.character-creating .creation-picker-column .class-choice[data-class="Ranger"],
.character-roster-card[data-class="Ranger"] {
  --class-rim-light: #b97845;
  --class-rim-mid: #855023;
  --class-rim-dark: #5a3217;
}
body.character-creating .creation-picker-column .class-choice[data-class="Mage"],
.character-roster-card[data-class="Mage"] {
  --class-rim-light: #6477ed;
  --class-rim-mid: #3249b2;
  --class-rim-dark: #1c286c;
}
body.character-creating .creation-picker-column .class-choice[data-class="Cleric"],
.character-roster-card[data-class="Cleric"] {
  --class-rim-light: #f2df86;
  --class-rim-mid: #c9b85f;
  --class-rim-dark: #8f7e3f;
}
body.character-creating .creation-picker-column .class-choice[data-class="Bard"],
.character-roster-card[data-class="Bard"] {
  --class-rim-light: #84e4e6;
  --class-rim-mid: #35aebc;
  --class-rim-dark: #176875;
}
body.character-creating .creation-picker-column .class-choice[data-class="Necromancer"],
.character-roster-card[data-class="Necromancer"] {
  --class-rim-light: #4a4a4a;
  --class-rim-mid: #2a2a2a;
  --class-rim-dark: #111111;
}
body.character-creating .creation-picker-column .class-choice[data-class="Warlock"],
.character-roster-card[data-class="Warlock"] {
  --class-rim-light: #8d58bd;
  --class-rim-mid: #642690;
  --class-rim-dark: #3b1558;
}
body.character-creating .creation-picker-column .class-choice[data-class="Druid"],
.character-roster-card[data-class="Druid"] {
  --class-rim-light: #4b7d55;
  --class-rim-mid: #2c6538;
  --class-rim-dark: #173f22;
}

body.character-creating .creation-picker-column .class-choice {
  border: 2px solid var(--class-rim-light, #855ba7);
  background: linear-gradient(155deg,
    color-mix(in srgb, var(--class-rim-dark, #311b44) 40%, #32283d),
    #141222 82%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--class-rim-light, #855ba7) 18%, transparent);
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
body.character-creating .creation-picker-column .class-choice:hover {
  border-color: color-mix(in srgb, var(--class-rim-light, #855ba7) 78%, white);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--class-rim-light, #855ba7) 45%, transparent),
    0 0 16px color-mix(in srgb, var(--class-rim-light, #855ba7) 25%, transparent);
}
body.character-creating .creation-picker-column .class-choice.selected {
  border-color: color-mix(in srgb, var(--class-rim-light, #855ba7) 83%, white);
  background: linear-gradient(155deg,
    color-mix(in srgb, var(--class-rim-mid, #644287) 62%, #34243f),
    color-mix(in srgb, var(--class-rim-dark, #311b44) 42%, #171325));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--class-rim-light, #855ba7) 44%, transparent),
    0 0 20px color-mix(in srgb, var(--class-rim-light, #855ba7) 22%, transparent),
    inset 0 0 24px color-mix(in srgb, var(--class-rim-mid, #644287) 20%, transparent);
}


/* V0.28.57 — Use the class frame palettes throughout the home roster.
   One aligned information line replaces the old separately indented rows. */
.character-roster-card {
  border: 2px solid var(--class-rim-light, #855ba7);
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--class-rim-dark, #311b44) 27%, #10101b),
    rgba(14,12,25,.94) 76%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--class-rim-light, #855ba7) 13%, transparent);
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.character-roster-card:hover {
  border-color: color-mix(in srgb, var(--class-rim-light, #855ba7) 78%, white);
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--class-rim-dark, #311b44) 42%, #181020),
    rgba(22,16,34,.95) 76%);
  box-shadow: 0 0 18px color-mix(in srgb, var(--class-rim-light, #855ba7) 18%, transparent);
}
.character-roster-card .roster-art-frame {
  border-color: color-mix(in srgb, var(--class-rim-light, #855ba7) 25%, transparent);
  background: radial-gradient(circle at 50% 35%,
    color-mix(in srgb, var(--class-rim-mid, #654786) 28%, transparent),
    rgba(16,13,27,.6));
}
.character-roster-card .roster-class-art {
  filter: drop-shadow(0 0 9px color-mix(in srgb, var(--class-rim-light, #855ba7) 24%, transparent));
}
.character-roster-card .character-roster-text {
  display:flex; flex-direction:column; align-items:flex-start; justify-content:center;
  min-width:0; gap:5px; text-align:left;
}
.character-roster-card .roster-stat-name-row {width:100%; justify-content:flex-start; gap:6px;}
.character-roster-card .roster-meta-line {
  display:flex; align-items:baseline; flex-wrap:wrap; justify-content:flex-start;
  column-gap:5px; row-gap:2px; width:100%; min-width:0;
  color:#e6ddea; font-size:12px; line-height:1.35;
}
.character-roster-card .roster-meta-line > span {font-size:inherit; color:inherit;}
.character-roster-card .roster-meta-class,
.character-roster-card .roster-meta-inventory {white-space:nowrap;}
.character-roster-card .roster-meta-separator,
.character-roster-card .roster-divider {color:color-mix(in srgb,var(--class-rim-light,#855ba7) 55%,#c9c4cf)!important;}
.character-roster-card .view-inventory-button {margin-top:0;}
@media (max-width:500px) {
  .character-roster-card .roster-meta-line{column-gap:4px;font-size:10px;}
}


/* V0.28.61 — persistent 1–4 character home party and map-based co-op. */
body.character-creating .home-party-head,
body.character-creating .home-party-note,
body.character-creating .home-party-summary {display:none!important;}
.home-party-head{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:5px 0 4px;
  padding:12px 4px 0;border-top:1px solid rgba(215,182,249,.22);}
.home-party-head strong{font:22px/1.15 "IM Fell English SC",Georgia,serif;color:#f5e9ff;font-weight:400;}
.home-party-head span{font:13px/1.2 system-ui,sans-serif;color:#d9cbec;}
.home-party-note{margin:5px 0 12px;color:#e2d3ed;font:14px/1.45 system-ui,sans-serif;text-align:left;}
.home-party-summary{display:flex;flex-wrap:wrap;align-items:center;gap:7px;min-height:30px;margin-bottom:13px;}
.home-party-chip{background:rgba(116,65,147,.29);border:1px solid rgba(199,158,235,.5);border-radius:18px;
 color:#f5e9ff;padding:5px 13px;font:13px/1.3 system-ui,sans-serif;}
.home-party-empty{color:#b6a8bc;font:13px/1.3 system-ui,sans-serif;}
.character-roster-card{grid-template-rows:auto auto;gap:8px 12px;}
.character-roster-card.party-selected{
  outline:2px solid color-mix(in srgb,var(--class-rim-light,#a579bc) 72%, white);
  outline-offset:0;box-shadow:0 0 18px color-mix(in srgb,var(--class-rim-light,#a579bc) 27%,transparent),
  inset 0 0 0 1px color-mix(in srgb,var(--class-rim-light,#a579bc) 35%,transparent);
}
.character-roster-card .party-toggle-button{grid-column:2;grid-row:2;justify-self:start;min-height:31px;
 font:13px/1.1 system-ui,sans-serif;padding:5px 14px;border-radius:8px;}
.character-roster-card.party-selected .party-toggle-button{background:color-mix(in srgb,var(--class-rim-mid,#855ba7) 47%,#2b2235);
 border-color:var(--class-rim-light,#855ba7);}
.character-roster-card .party-toggle-button:disabled{opacity:.50;cursor:not-allowed;}
#enterRealmButton:disabled{opacity:.5;cursor:not-allowed;}
.world-map-launch-error{padding:0 20px;min-height:0;}
.world-map-launch-error:empty{display:none;}
.world-map-top-actions .map-party-connected{border-color:#a075cd;background:rgba(85,42,121,.48);color:#f8edff;}
.world-map-party-panel{display:flex;flex-direction:column;gap:10px;width:min(650px,calc(100vw - 28px));max-height:calc(100dvh - 28px);
 overflow-y:auto;padding:clamp(16px,2.5vw,26px);border:1px solid rgba(185,143,220,.61);border-radius:17px;
 background:linear-gradient(148deg,#261934,#11111e 85%);box-shadow:0 16px 60px rgba(0,0,0,.7);}
.world-map-party-panel .world-map-inventory-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;}
.world-map-party-panel h2,.world-map-party-panel h3{font-family:"IM Fell English SC",Georgia,serif;font-weight:400;}
.world-map-party-panel h2{margin:0;font-size:27px;}
.world-map-party-panel h3{margin:0 0 10px;font-size:22px;}
.map-party-instructions{font:14px/1.5 system-ui,sans-serif;color:#d6cce1;margin:5px 0 15px;}
.map-party-entry{display:flex;align-items:center;gap:12px;flex-wrap:wrap;}
.map-party-join{display:flex;gap:7px;flex:1;min-width:220px;}
.map-party-join input{min-width:110px;max-width:160px;flex:1;background:#11101d;color:#fff;
 border:1px solid #76538e;border-radius:8px;padding:8px 10px;text-transform:uppercase;}
.map-party-room-code{display:flex;align-items:center;gap:12px;font:18px system-ui,sans-serif;}
.map-party-room-code strong{color:#e9beff;letter-spacing:.19em;font-size:26px;}
.map-party-members{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin:10px 0 14px;}
.map-party-member{display:flex;flex-direction:column;gap:4px;background:#191525;border:1px solid #513c63;border-radius:9px;padding:11px;}
.map-party-member span{font:12px system-ui,sans-serif;color:#b5aac4;}
.map-party-your-heroes{border-top:1px solid #534261;padding:16px 0 8px;}
#mapPartyHeroChoices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-bottom:12px;}
.map-party-hero{display:flex;align-items:center;gap:8px;background:#1d172a;padding:10px;
 border-radius:8px;border:1px solid #493953;font:13px/1.4 system-ui,sans-serif;cursor:pointer;}
.map-party-hero input{accent-color:#b879eb;width:16px;height:16px;flex:0 0 auto;}
.map-party-room-actions{border-top:1px solid #483454;padding-top:15px;}
@media (max-width:650px){#mapPartyHeroChoices,.map-party-members{grid-template-columns:1fr;}
 .character-roster-card .party-toggle-button{font-size:12px;padding:6px 11px;}}


/* V0.28.62 — integrate party order into each row and support drag-reordering. */
body.character-creating .home-party-summary{display:none!important;}
.home-party-head{align-items:center;justify-content:space-between;gap:18px;margin:6px 0 10px;padding:10px 4px 0;border-top:1px solid rgba(215,182,249,.22);}
.home-party-head strong{display:none!important;}
.home-party-head .home-party-note{margin:0;flex:1 1 auto;}
.home-party-head span{font:15px/1.1 system-ui,sans-serif;color:#f3e8ff;padding:4px 10px;border-radius:999px;border:1px solid rgba(210,174,245,.36);background:rgba(46,31,62,.68);}
.character-hall-foot{display:flex;justify-content:flex-end;margin-top:16px;padding-top:10px;border-top:1px solid rgba(215,182,249,.16);}
.character-roster-card{grid-template-columns:67px minmax(0,1fr) auto;grid-template-rows:auto auto;align-items:center;}
.character-roster-card .character-roster-text{grid-column:2;grid-row:1 / span 2;}
.character-roster-card .party-toggle-button{grid-column:3;grid-row:1 / span 2;align-self:center;justify-self:end;min-width:88px;}
.character-roster-card.party-selected{outline:2px solid color-mix(in srgb,var(--class-rim-light,#a579bc) 84%, white);box-shadow:0 0 0 1px color-mix(in srgb,var(--class-rim-light,#a579bc) 34%, transparent),0 0 24px color-mix(in srgb,var(--class-rim-light,#a579bc) 34%,transparent), inset 0 0 18px color-mix(in srgb,var(--class-rim-light,#a579bc) 12%,transparent);}
.character-roster-card.party-draggable{cursor:grab;}
.character-roster-card.party-dragging{opacity:.6;cursor:grabbing;}
.character-roster-card.party-drop-target{box-shadow:0 0 0 2px color-mix(in srgb,var(--class-rim-light,#a579bc) 65%, white),0 0 28px color-mix(in srgb,var(--class-rim-light,#a579bc) 28%,transparent), inset 0 0 0 2px color-mix(in srgb,var(--class-rim-light,#a579bc) 18%,transparent);}
.character-roster-card .roster-meta-line{align-items:center;row-gap:5px;}
.party-slot-pill{display:inline-flex;align-items:center;justify-content:center;min-width:22px;height:22px;padding:0 7px;border-radius:999px;border:1px solid color-mix(in srgb,var(--class-rim-light,#855ba7) 65%, white);background:color-mix(in srgb,var(--class-rim-mid,#855ba7) 58%, #191425);color:#fff;font:700 12px/1 system-ui,sans-serif;box-shadow:0 0 10px color-mix(in srgb,var(--class-rim-light,#855ba7) 18%,transparent);cursor:grab;}
.party-slot-pill[hidden]{display:none!important;}
.character-roster-card .party-toggle-button{font:13px/1.1 system-ui,sans-serif;padding:6px 14px;border-radius:10px;}
.character-roster-card.party-selected .party-toggle-button{background:color-mix(in srgb,var(--class-rim-mid,#855ba7) 40%,#251d30);border-color:var(--class-rim-light,#855ba7);}
@media(max-width:710px){.character-roster-card{grid-template-columns:58px minmax(0,1fr);grid-template-rows:auto auto auto;}.character-roster-card .character-roster-text{grid-column:2;grid-row:1 / span 2;}.character-roster-card .party-toggle-button{grid-column:1 / span 2;grid-row:3;justify-self:start;min-width:0;}.character-hall-foot{justify-content:stretch;}.character-hall-foot .mode-button{width:100%;}}
@media(max-width:500px){.home-party-head{align-items:flex-start;flex-direction:column;}.home-party-head span{align-self:flex-start;}.character-roster-card .roster-meta-line{font-size:10px;}}


/* V0.28.63 — move party summary pills into the header gap area. */
.home-party-band{margin:6px 0 14px;padding:10px 4px 14px;border-top:1px solid rgba(215,182,249,.22);border-bottom:1px solid rgba(215,182,249,.16);}
.home-party-head{margin:0;padding:0;border-top:0;align-items:flex-start;justify-content:space-between;gap:18px;}
.home-party-head .home-party-note{margin:0;flex:1 1 auto;}
.home-party-head span{font:15px/1.1 system-ui,sans-serif;color:#f3e8ff;padding:4px 10px;border-radius:999px;border:1px solid rgba(210,174,245,.36);background:rgba(46,31,62,.68);}
.home-party-summary{display:flex;flex-wrap:wrap;align-items:center;gap:8px;min-height:30px;margin:12px 0 0;}
.home-party-chip{display:inline-flex;align-items:center;gap:8px;padding:6px 12px 6px 8px;border-radius:999px;border:1px solid rgba(199,158,235,.5);background:rgba(116,65,147,.29);color:#f5e9ff;font:13px/1.3 system-ui,sans-serif;}
.home-party-chip-order{display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:20px;border-radius:999px;border:1px solid rgba(228,208,249,.35);background:rgba(39,26,52,.7);font:700 11px/1 system-ui,sans-serif;color:#fff;}
.home-party-chip-name{white-space:nowrap;}
.home-party-empty{color:#b6a8bc;font:13px/1.3 system-ui,sans-serif;}
.character-roster-card .roster-meta-line{align-items:baseline;row-gap:2px;}
@media(max-width:500px){.home-party-band{padding:10px 0 12px;}.home-party-head{align-items:flex-start;flex-direction:column;}.home-party-head span{align-self:flex-start;}.home-party-summary{margin-top:10px;}}


/* V0.28.64 — one separator beneath the account name, not two.
   The party band supplies the single line above its note and pills. */
.character-hall > .character-hall-user {
  border-bottom: 0;
  padding-bottom: 0;
  margin-bottom: 7px;
}
.home-party-band { margin-top: 0; }


/* V0.28.65 — concise party instructions, count and ordered chips.
   Keep the instruction and counter on one row and party chips immediately below. */
.character-hall > .character-hall-user{margin-bottom:3px;}
.home-party-band{margin:0 0 9px;padding:7px 4px 8px;}
.home-party-head{margin:0;padding:0;align-items:center;gap:10px;}
.home-party-head .home-party-note{font-size:12px;line-height:1.25;color:#e4d7ee;margin:0!important;}
.home-party-head #homePartyCount{padding:3px 8px;line-height:1.1;font-size:12px;flex:0 0 auto;}
.home-party-summary{gap:6px;min-height:0;margin:5px 0 0;}
.home-party-chip{gap:6px;padding:3px 9px 3px 5px;font-size:12px;line-height:1.2;}
.home-party-chip-order{min-width:17px;height:17px;font-size:10px;}
.home-party-empty{font-size:12px;line-height:1.3;margin:1px 0;}
@media(max-width:500px){.home-party-head{flex-direction:row;align-items:center;}.home-party-head #homePartyCount{align-self:center;}.home-party-band{padding:8px 0;}.home-party-summary{margin-top:6px;}}


/* V0.28.66 — read-only co-op roster grouped by player, same hero details as Home. */
.world-map-party-panel{gap:8px;padding-bottom:12px;}
.world-map-party-panel #worldMapPartyBody{display:flex;flex-direction:column;gap:0;min-height:0;}
.world-map-party-panel .map-party-instructions{margin:3px 0 9px;}
.map-party-player-list{display:flex;flex-direction:column;gap:10px;}
.map-party-player-section{display:flex;flex-direction:column;gap:6px;padding:10px 11px;border:1px solid rgba(165,128,195,.33);border-radius:12px;background:rgba(10,9,20,.32);}
.map-party-player-heading{display:flex;align-items:center;gap:9px;min-height:28px;}
.map-party-player-heading h3{margin:0!important;font-size:21px!important;}
.map-party-host-label{border:1px solid #806395;border-radius:12px;padding:2px 8px;color:#ddc1ec;font:11px/1.3 system-ui,sans-serif;}
.map-party-kick{margin-left:auto;width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;border:1px solid #d76a79;border-radius:7px;background:#581c2a;color:#ffd6db;font:700 23px/1 system-ui,sans-serif;cursor:pointer;}
.map-party-kick:hover,.map-party-kick:focus-visible{background:#a42d41;color:#fff;outline:2px solid #e27b88;}
.map-party-character-list{display:grid;grid-template-columns:1fr;gap:6px;}
.map-party-character-card{grid-template-columns:50px minmax(0,1fr)!important;grid-template-rows:auto!important;min-height:70px!important;gap:8px!important;padding:7px 10px!important;}
.map-party-character-card .roster-art-frame{grid-column:1;grid-row:1;width:44px;height:52px;}
.map-party-character-card .roster-class-art{width:40px;height:50px;}
.map-party-character-card .character-roster-text{grid-column:2;grid-row:1;gap:3px;}
.map-party-character-card .roster-stat-name-row strong{font-size:16px;}
.map-party-character-card .roster-meta-line{font-size:11px;}
.map-party-empty-heroes{margin:0;font:12px/1.4 system-ui,sans-serif;color:#bbaacb;}
.map-party-room-actions{display:flex;justify-content:flex-end;border-top:1px solid #483454;padding-top:9px;margin-top:9px;margin-bottom:0;}
.map-party-room-actions .mode-button{margin:0;}
@media(min-width:680px){.map-party-character-list{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:520px){.map-party-character-list{grid-template-columns:1fr;}.map-party-character-card .roster-meta-line{font-size:10px;}}

/* Hide empty status area so Leave Party sits close to the popup bottom. */
.world-map-party-panel #worldMapPartyError:empty{display:none;}
.world-map-party-panel .world-map-inventory-head{margin-bottom:7px;}
.world-map-party-panel .map-party-room-actions{padding-top:7px;margin-top:8px;}


/* V0.28.68 — scene changes, readable party status, and party stat expanders. */
.scene-curtain{position:fixed;inset:0;z-index:12000;background:#090714;opacity:0;pointer-events:none;transition:opacity 165ms ease-in-out;}
.scene-curtain.scene-curtain-visible{opacity:1;pointer-events:auto;}
.scene-curtain.scene-curtain-hidden{display:none;}
@media(prefers-reduced-motion:reduce){.scene-curtain{transition:none!important;}}
.map-party-status{color:#d5bee8;font:13px/1.4 system-ui,sans-serif;margin:3px 0;min-height:0;}
.map-party-status:empty{display:none;}
.map-party-character-card .map-party-stat-trigger{flex:0 0 auto;cursor:pointer;}

/* V0.28.70 — Sir Aldric Ironbanner, Navvare Flag-gear shop. */
body.mode-selecting .play-mode-overlay:has(.aldric-shop){background:linear-gradient(140deg,#1a1826,#080910 85%);}
body.mode-selecting .play-mode-card:has(.aldric-shop){box-sizing:border-box;width:min(1330px,97vw);max-width:1330px;max-height:95dvh;overflow-y:auto;padding:22px clamp(15px,2.2vw,32px);background:linear-gradient(155deg,#262033,#0c0c18 90%);border:1px solid #705b7b;}
.aldric-shop{color:#eee7f4;min-width:0;}
.aldric-shop-head{display:flex;align-items:center;justify-content:space-between;gap:15px;flex-wrap:wrap;margin-bottom:18px;border-bottom:1px solid #57475d;padding-bottom:13px;}
.aldric-shop-head h2{font-size:clamp(25px,3vw,39px);font-weight:400;color:#f4d49e;margin:0;}
.aldric-shop-layout{display:grid;grid-template-columns:minmax(205px,285px) minmax(0,1fr);gap:22px;align-items:start;}
.aldric-portrait-panel{display:flex;flex-direction:column;align-items:center;gap:15px;min-width:0;padding:14px;background:#191624;border:1px solid #5d4a63;border-radius:14px;}
.aldric-sprite{image-rendering:pixelated;max-width:100%;height:250px;object-fit:contain;}
.aldric-portrait-panel p{font-size:18px;line-height:1.45;color:#f5dcae;margin:0;text-align:center;}
.aldric-shop-help{font-size:13px;line-height:1.5;color:#d0c2d8;text-align:center;}
.aldric-shop-main{min-width:0;}
.aldric-shop-buyer{display:flex;flex-wrap:wrap;align-items:center;gap:12px;padding:12px 14px;background:#191523;border:1px solid #67516d;border-radius:12px;margin-bottom:15px;}
.aldric-shop-buyer label{font-size:17px;}
.aldric-shop-buyer select{background:#13111b;border:1px solid #806395;border-radius:7px;padding:9px 12px;color:#fff;flex:1;min-width:140px;}
.aldric-shop-buyer strong{color:#ffd18a;font-size:16px;}
.aldric-stock-head{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin:0 0 10px;}
.aldric-stock-head h3{margin:0;font-size:27px;font-weight:400;color:#f6d8a2;}
.aldric-stock-head span{color:#c5b4d0;font-size:13px;}
.aldric-stock{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px;}
.aldric-item-card{display:flex;flex-direction:column;gap:9px;border:1px solid #975a38;background:linear-gradient(135deg,#291c23,#14121d);padding:13px;border-radius:11px;min-width:0;}
.aldric-item-title{display:flex;align-items:start;justify-content:space-between;gap:10px;flex-wrap:wrap;}
.aldric-item-title strong{font-size:17px;line-height:1.2;color:#ffe6be;}
.aldric-price{flex:0 0 auto;font-size:13px;color:#ffb673;}
.aldric-item-meta{font-size:12px;color:#cdbccc;}
.aldric-item-stats{display:flex;flex-wrap:wrap;gap:4px;}
.aldric-stat{font-size:11px;color:#e8dbdc;border:1px solid #6d4d45;border-radius:10px;padding:3px 7px;background:#271e25;}
.aldric-buy{margin-top:auto;align-self:end;min-height:32px;padding:5px 12px!important;font-size:13px!important;}
.aldric-buy:disabled{opacity:.5;cursor:not-allowed;}
#aldricShopFeedback{margin:0 0 10px;color:#91f3c0;font-size:14px;}
#aldricShopFeedback:empty{display:none;}
#aldricShopFeedback.aldric-error{color:#ffb4b4;}
@media(max-width:850px){.aldric-shop-layout{grid-template-columns:1fr;}.aldric-portrait-panel{flex-direction:row;text-align:left;}.aldric-portrait-panel p{max-width:320px;}.aldric-sprite{height:160px;}}
@media(max-width:600px){.aldric-stock{grid-template-columns:1fr;}.aldric-portrait-panel{flex-direction:column;}.aldric-sprite{height:175px;}}


/* V0.28.71 — Sir Aldric's temporary smile portrait, wallet, and level-grouped stock. */
body.mode-selecting .play-mode-card:has(.aldric-shop){width:min(1500px,97vw);max-width:1500px;}
.aldric-shop-layout{grid-template-columns:minmax(205px,270px) minmax(0,1fr);gap:20px;}
.aldric-portrait-placeholder{display:flex;justify-content:center;align-items:center;width:100%;min-height:250px;font-size:105px;line-height:1;background:radial-gradient(circle,#34273f,#17131f 70%);border:1px solid #5d4a63;border-radius:12px;}
.aldric-shop-buyer{margin-bottom:10px;}
.aldric-wallet{display:flex;align-items:center;gap:14px;flex-wrap:wrap;padding:12px 14px;margin-bottom:16px;background:#191523;border:1px solid #67516d;border-radius:12px;}
.aldric-wallet-heading{font-size:17px;color:#eee7f4;}
.aldric-currencies{display:grid;grid-template-columns:repeat(3,minmax(105px,1fr));gap:8px;flex:1;}
.aldric-currency{display:flex;justify-content:space-between;align-items:center;gap:9px;padding:9px 12px;border-radius:9px;border:1px solid #63516a;background:#21182b;font:13px/1.25 system-ui,sans-serif;}
.aldric-currency-label{color:#dcd0e5;white-space:nowrap;}
.aldric-currency strong{font:700 15px/1.1 system-ui,sans-serif;color:#f7ebff;font-variant-numeric:tabular-nums;}
.aldric-currency-silver{border-color:#6e7386;}
.aldric-currency-gold{border-color:#ae8a3f;}
.aldric-currency-flags{border-color:#9b6148;}
.aldric-stock{display:flex;flex-direction:column;gap:20px;}
.aldric-stock-tier{min-width:0;}
.aldric-tier-heading{display:flex;align-items:center;gap:12px;margin:0 0 10px;color:#f6d8a2;font-size:23px;font-weight:400;}
.aldric-tier-heading::after{content:"";height:1px;background:linear-gradient(90deg,#9b764e,#513e48 70%,transparent);flex:1;}
.aldric-tier-items{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:11px;align-items:stretch;}
.aldric-item-card{gap:10px;}
.aldric-item-title{align-items:flex-start;}
.aldric-item-stats{display:block;flex:1;}
.aldric-stat-list{display:flex;flex-direction:column;list-style:none;gap:0;margin:0;padding:0;border-top:1px solid rgba(185,133,89,.18);}
.aldric-stat{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:5px 2px;border:0;border-bottom:1px solid rgba(185,133,89,.16);background:none;border-radius:0;font-size:12px;line-height:1.3;}
.aldric-stat strong{color:#ffdbac;font-weight:600;white-space:nowrap;font-variant-numeric:tabular-nums;}
.aldric-buy{margin-top:5px;}
@media(max-width:1100px){.aldric-tier-items{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:850px){.aldric-shop-layout{grid-template-columns:1fr;}.aldric-portrait-panel{flex-direction:row;text-align:left;}.aldric-portrait-panel p{max-width:320px;}.aldric-portrait-placeholder{width:150px;min-height:155px;font-size:75px;flex:0 0 150px;}}
@media(max-width:600px){.aldric-tier-items{grid-template-columns:1fr;}.aldric-portrait-panel{flex-direction:column;}.aldric-portrait-placeholder{width:100%;min-height:165px;}.aldric-currencies{grid-template-columns:repeat(3,minmax(0,1fr));width:100%;flex:1 1 100%;}.aldric-currency{flex-direction:column;align-items:center;gap:4px;padding:7px 4px;}.aldric-shop-buyer select{min-width:0;width:100%;}}


@media(max-width:1080px) {
  body.character-creating .creation-strength {font-size:11px;padding:5px 8px;}
}
@media(max-width:740px) {
  body.character-creating .creation-strength {font-size:10px;padding:4px 6px;}
}

/* Give the preview pane enough width to show the longest class-pill labels. */
@media (min-width:1371px) and (max-width:1650px) {
  body.character-creating .creation-layout {grid-template-columns:minmax(0,1.65fr) minmax(0,1fr);}
}
@media (min-width:1081px) and (max-width:1370px) {
  body.character-creating .creation-layout {grid-template-columns:minmax(0,1.45fr) minmax(390px,1fr);}
}


/* V0.28.73 — Aldric shop uses hoverable blue circle item tokens. */
.aldric-tier-items{display:flex;flex-wrap:wrap;gap:16px 18px;align-items:flex-start;}
.aldric-item-node{position:relative;display:flex;align-items:center;justify-content:center;min-width:70px;min-height:70px;}
.aldric-item-circle{width:56px;height:56px;border-radius:999px;border:2px solid #6eb9ff;background:radial-gradient(circle at 35% 32%, #8bd2ff 0%, #3f86dd 45%, #1e4587 82%, #143064 100%);box-shadow:0 0 0 1px rgba(163,220,255,.22), 0 0 14px rgba(67,131,219,.42), inset 0 1px 0 rgba(255,255,255,.35);cursor:pointer;transition:transform .14s ease, box-shadow .14s ease, border-color .14s ease;}
.aldric-item-circle:hover,.aldric-item-circle:focus-visible,.aldric-item-node:hover .aldric-item-circle,.aldric-item-node:has(.aldric-item-circle:focus-visible) .aldric-item-circle{transform:translateY(-1px) scale(1.04);border-color:#b8e5ff;box-shadow:0 0 0 1px rgba(195,234,255,.34), 0 0 18px rgba(92,163,255,.62), inset 0 1px 0 rgba(255,255,255,.48);outline:none;}
.aldric-item-popover{position:absolute;left:50%;top:calc(100% + 10px);transform:translateX(-50%);z-index:9;width:min(300px,42vw);opacity:0;visibility:hidden;pointer-events:none;transition:opacity .12s ease, transform .12s ease, visibility .12s linear;}
.aldric-item-node:hover .aldric-item-popover,.aldric-item-node:has(.aldric-item-circle:focus-visible) .aldric-item-popover{opacity:1;visibility:visible;pointer-events:auto;transform:translateX(-50%) translateY(0);}
.aldric-item-popover::before{content:"";position:absolute;left:50%;top:-8px;transform:translateX(-50%) rotate(45deg);width:16px;height:16px;background:#211923;border-left:1px solid #975a38;border-top:1px solid #975a38;}
.aldric-item-popover .aldric-item-card{box-shadow:0 12px 24px rgba(0,0,0,.38);}
.aldric-item-card{width:280px;max-width:100%;}
@media(max-width:850px){.aldric-item-popover{left:0;transform:none;}.aldric-item-node:hover .aldric-item-popover,.aldric-item-node:has(.aldric-item-circle:focus-visible) .aldric-item-popover{transform:none;}.aldric-item-popover::before{left:28px;transform:rotate(45deg);}}
@media(max-width:600px){.aldric-tier-items{gap:14px;}.aldric-item-circle{width:52px;height:52px;}.aldric-item-card{width:min(260px,76vw);}}


/* V0.28.74 — Merchant district shares shop language and blue hover items. */
.merchant-hall{min-width:0;max-width:1000px;margin:auto;color:#eee7f4;padding:10px 6px 16px;}
.merchant-hall>p{margin:12px 0 20px;color:#cfc2db;font-size:16px;}
.merchant-hall-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;}
.merchant-choice{display:flex;flex-direction:column;align-items:center;gap:9px;padding:25px 20px;background:linear-gradient(145deg,#2d2134,#171320);color:#f8e4c2;border:1px solid #8b6e6c;border-radius:15px;cursor:pointer;transition:transform .15s,box-shadow .15s,border-color .15s;}
.merchant-choice:hover,.merchant-choice:focus-visible{transform:translateY(-2px);border-color:#e7ba7b;box-shadow:0 0 20px rgba(219,165,100,.23);}
.merchant-choice strong{font:26px/1.15 Georgia,serif;}
.merchant-choice span:last-child{font:14px/1.4 system-ui,sans-serif;color:#d9cadf;}
.merchant-choice-art{font-size:72px;line-height:1.2;}
.mira-shop .aldric-item-node[data-rarity="Uncommon"] .aldric-item-circle{border-color:#73d5a0;box-shadow:0 0 0 1px rgba(80,225,138,.23),0 0 15px rgba(64,195,126,.35),inset 0 1px 0 rgba(255,255,255,.35);}
.mira-shop .aldric-item-card{border-color:#6c7897;}
.mira-shop .aldric-price{color:#c4dfff;}
.mira-shop .mira-buy{margin-top:5px;align-self:end;min-height:32px;padding:5px 12px!important;font-size:13px!important;}
.mira-shop .mira-buy:disabled{opacity:.5;cursor:not-allowed;}
.mira-shop #miraShopFeedback{margin:0 0 10px;color:#91f3c0;font-size:14px;}
.mira-shop #miraShopFeedback:empty{display:none;}
.mira-shop #miraShopFeedback.aldric-error{color:#ffb4b4;}
.merchant-refresh-timer{font:600 14px/1.2 system-ui,sans-serif;color:#b3d6ff!important;font-variant-numeric:tabular-nums;}
@media(max-width:650px){.merchant-hall-options{grid-template-columns:1fr;}.merchant-choice{padding:16px;}.merchant-choice-art{font-size:52px;}}


/* V0.28.74 tooltip placement: keep details in the stock column and bridge
   pointer movement from the blue item token into its purchase popover. */
.aldric-item-node:hover,.aldric-item-node:has(.aldric-item-circle:focus-visible){z-index:15;}
.aldric-item-popover{left:0;top:calc(100% - 2px);transform:none;}
.aldric-item-node:hover .aldric-item-popover,.aldric-item-node:has(.aldric-item-circle:focus-visible) .aldric-item-popover{transform:none;}
.aldric-item-popover::before{left:32px;transform:rotate(45deg);}
@media(max-width:850px){.aldric-item-popover{left:0;transform:none;}.aldric-item-node:hover .aldric-item-popover,.aldric-item-node:has(.aldric-item-circle:focus-visible) .aldric-item-popover{transform:none;}}


/* V0.28.75 — Merchant hall selection is a vertical list of wide shop entries. */
.merchant-hall{max-width:920px;}
.merchant-hall-options{grid-template-columns:minmax(0,1fr);gap:14px;max-width:760px;margin:0 auto;}
.merchant-hall-options .merchant-choice{
  width:100%;min-height:124px;display:flex;flex-direction:row;align-items:center;justify-content:flex-start;
  gap:22px;padding:19px 26px;text-align:left;
}
.merchant-choice-art{display:flex;align-items:center;justify-content:center;flex:0 0 86px;font-size:66px;line-height:1.1;}
.merchant-choice-info{display:flex;flex-direction:column;align-items:flex-start;gap:8px;min-width:0;}
.merchant-choice-info strong{font:26px/1.2 Georgia,serif;}
.merchant-choice-info .merchant-choice-subtitle{font:14px/1.4 system-ui,sans-serif;color:#d9cadf;}
@media(max-width:650px){
  .merchant-hall-options .merchant-choice{gap:14px;min-height:100px;padding:15px 14px;}
  .merchant-choice-art{flex-basis:60px;font-size:47px;}
  .merchant-choice-info strong{font-size:20px;}
  .merchant-choice-info .merchant-choice-subtitle{font-size:12px;}
}


/* V0.28.76 — Mira Fairlady Buy/Sell tabs and sale tooltips. Aldric is buy-only. */
.mira-shop-tabs{display:flex;align-items:center;gap:8px;margin:0 0 16px;padding-bottom:10px;border-bottom:1px solid rgba(175,152,185,.22);}
.mira-shop-tabs .mode-button{flex:0 0 120px;min-height:38px;border:1px solid #66506c;border-radius:9px;background:#221a2b;color:#dcd1eb;font-size:15px;}
.mira-shop-tabs .mode-button[aria-selected="true"]{background:#48305e;border-color:#d3aef0;color:#fff;box-shadow:inset 0 0 0 1px rgba(229,189,255,.16);}
.mira-mode-help{margin:-4px 0 12px;color:#c6b8d0;font:13px/1.45 system-ui,sans-serif;}
.mira-shop .mira-sell-item{align-self:end;min-height:32px;padding:5px 12px!important;font-size:13px!important;}
.mira-sell-empty{padding:15px 16px;border-radius:9px;background:rgba(62,43,74,.36);border:1px solid rgba(180,154,204,.27);font-size:14px;line-height:1.6;color:#d9cede;}

/* Keep Mira's resale popovers inside the scroll panel for short inventories. */
.mira-shop:has(#miraTabSell[aria-selected="true"]) .aldric-item-popover{top:auto;bottom:calc(100% - 2px);}
.mira-shop:has(#miraTabSell[aria-selected="true"]) .aldric-item-popover::before{top:auto;bottom:-8px;border-left:0;border-top:0;border-right:1px solid #975a38;border-bottom:1px solid #975a38;}


/* V0.28.77 — visible price & action beneath each circular merchant item.
   Hover/focus shows only descriptive stats, with purchases and sales outside
   the popover to remain reachable by mouse and keyboard. */
.aldric-tier-items{gap:24px 14px;align-items:flex-start;}
.aldric-item-node{width:132px;min-width:132px;min-height:177px;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:8px;padding:8px 6px 2px;box-sizing:border-box;}
.aldric-token-square{width:86px;height:86px;display:flex;align-items:center;justify-content:center;border-radius:13px;border:1px solid rgba(155,195,235,.34);background:linear-gradient(180deg, rgba(34,46,72,.92), rgba(18,24,43,.96));box-shadow:inset 0 1px 0 rgba(255,255,255,.05), 0 8px 18px rgba(0,0,0,.22);}
.aldric-item-node .aldric-item-circle{flex:0 0 56px;}
.aldric-token-price{color:#d8e9ff;font:600 12px/1.15 system-ui,sans-serif;font-variant-numeric:tabular-nums;text-align:center;white-space:nowrap;}
.aldric-item-node .aldric-token-action{display:block;flex:0 0 auto;align-self:center;min-height:31px;width:93px;padding:5px 8px!important;margin:0!important;font:600 12px/1.15 system-ui,sans-serif!important;border-radius:9px;white-space:nowrap;}
.aldric-item-node .aldric-token-action:disabled{opacity:.48;cursor:not-allowed;}
.aldric-item-node .aldric-item-popover{top:calc(100% + 2px);bottom:auto;left:0;width:285px;max-width:min(285px,82vw);}
.aldric-item-node .aldric-item-popover::before{left:55px;top:-8px;bottom:auto;border:0;border-top:1px solid #975a38;border-left:1px solid #975a38;transform:rotate(45deg);}
.aldric-item-node .aldric-item-card{box-sizing:border-box;width:100%;}
/* Opening a sell tooltip below the token no longer blocks the tabs; the
   space gained from the price/action rows makes the placement consistent. */
.mira-shop:has(#miraTabSell[aria-selected="true"]) .aldric-item-popover{top:calc(100% + 2px);bottom:auto;}
.mira-shop:has(#miraTabSell[aria-selected="true"]) .aldric-item-popover::before{top:-8px;bottom:auto;border:0;border-top:1px solid #975a38;border-left:1px solid #975a38;}
@media(max-width:600px){.aldric-tier-items{gap:16px 9px;}.aldric-item-node{min-width:110px;width:110px;min-height:165px;padding:7px 3px;}.aldric-token-square{width:78px;height:78px;border-radius:12px;}.aldric-item-node .aldric-item-circle{flex-basis:52px;}.aldric-token-price{font-size:11px;}.aldric-item-node .aldric-token-action{width:80px;}}

/* V0.28.77 tooltip: display beside item rather than below the shop panel.
   The tooltip is read-only; its pointer-events never block a visible action. */
.aldric-item-node .aldric-item-popover,
.mira-shop:has(#miraTabSell[aria-selected="true"]) .aldric-item-popover{
  left:calc(100% + 10px);right:auto;top:0;bottom:auto;width:285px;max-width:min(285px,82vw);pointer-events:none;
}
.aldric-item-node.tooltip-left .aldric-item-popover,
.mira-shop:has(#miraTabSell[aria-selected="true"]) .aldric-item-node.tooltip-left .aldric-item-popover{
  left:auto;right:calc(100% + 10px);top:0;bottom:auto;
}
.aldric-item-node .aldric-item-popover::before,
.mira-shop:has(#miraTabSell[aria-selected="true"]) .aldric-item-popover::before{
  left:-8px;top:21px;bottom:auto;transform:rotate(-45deg);
  border:0;border-top:1px solid #975a38;border-left:1px solid #975a38;
}
.aldric-item-node.tooltip-left .aldric-item-popover::before,
.mira-shop:has(#miraTabSell[aria-selected="true"]) .aldric-item-node.tooltip-left .aldric-item-popover::before{
  left:auto;right:-8px;top:21px;bottom:auto;transform:rotate(135deg);
}
/* At compact sizes a smaller tooltip leaves more room within the stock area. */
@media(max-width:750px){.aldric-item-node .aldric-item-popover,.mira-shop:has(#miraTabSell[aria-selected="true"]) .aldric-item-popover{width:min(245px,72vw);}}

/* V0.28.78 — Sold Mira listings remain visible, but cannot be repurchased. */
.mira-item-sold .aldric-item-circle{filter:grayscale(.75);opacity:.4;}
.mira-item-sold .aldric-token-price{opacity:.5;}
.mira-item-sold .mira-buy:disabled{opacity:.8;border-color:#62546a;background:#302c39;color:#e8d9e8;cursor:not-allowed;}


/* V0.28.79 — Integrate wallet balances into the Realm Walker shop selector.
   No redundant heading or boxed currency cards; only functional amounts. */
.aldric-shop-toolbar{
  display:flex;align-items:center;flex-wrap:wrap;column-gap:20px;row-gap:9px;
  min-width:0;margin-bottom:14px;padding:10px 14px;
  border:1px solid #584664;border-radius:11px;background:#191523;
}
.aldric-shop-toolbar .aldric-shop-buyer{
  display:flex;align-items:center;flex:1 1 350px;min-width:255px;flex-wrap:nowrap;
  gap:10px;margin:0;padding:0;border:0;border-radius:0;background:transparent;
}
.aldric-shop-toolbar .aldric-shop-buyer label{font-size:15px;white-space:nowrap;color:#dfd3e7;}
.aldric-shop-toolbar .aldric-shop-buyer select{
  flex:1 1 240px;min-width:0;max-width:470px;padding:8px 10px;
}
.aldric-shop-toolbar .aldric-wallet{
  flex:0 1 auto;display:flex;align-items:center;justify-content:flex-end;
  min-width:0;gap:0;padding:0;margin:0;border:0;border-radius:0;background:transparent;
}
.aldric-shop-toolbar .aldric-currencies{
  display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;
  gap:0;width:auto;min-width:0;flex:0 1 auto;
}
.aldric-shop-toolbar .aldric-currency{
  display:inline-flex;flex-direction:row;align-items:center;justify-content:flex-start;
  gap:7px;padding:3px 11px;min-height:23px;border:0;border-radius:0;
  background:transparent;font:13px/1.2 system-ui,sans-serif;white-space:nowrap;
}
.aldric-shop-toolbar .aldric-currency:first-child{padding-left:0;}
.aldric-shop-toolbar .aldric-currency:last-child{padding-right:0;}
.aldric-shop-toolbar .aldric-currency + .aldric-currency{border-left:1px solid rgba(190,169,198,.28);}
.aldric-shop-toolbar .aldric-currency-label{color:#c7bacd;white-space:nowrap;}
.aldric-shop-toolbar .aldric-currency strong{font:600 14px/1.15 system-ui,sans-serif;color:#f2eaf7;font-variant-numeric:tabular-nums;}
@media(max-width:850px){
  .aldric-shop-toolbar{align-items:flex-start;row-gap:8px;}
  .aldric-shop-toolbar .aldric-wallet{flex:1 1 100%;justify-content:flex-start;}
  .aldric-shop-toolbar .aldric-currencies{justify-content:flex-start;}
}
@media(max-width:500px){
  .aldric-shop-toolbar{padding:10px;}
  .aldric-shop-toolbar .aldric-shop-buyer{flex:1 1 100%;min-width:0;}
  .aldric-shop-toolbar .aldric-currency{padding:3px 7px;gap:4px;font-size:11px;}
  .aldric-shop-toolbar .aldric-currency strong{font-size:12px;}
}

/* V0.28.80 — Maxwell's vacant Gold shop uses the shared merchant layout. */
.maxwell-shop .maxwell-stock{display:block;}
.maxwell-stock-empty{margin:0;padding:22px 16px;border:1px solid rgba(176,151,196,.25);border-radius:10px;background:rgba(25,20,35,.58);color:#c8bace;font:15px/1.35 system-ui,sans-serif;}


/* V0.28.83 — native pixel skins, not emoji placeholders. */
.merchant-choice-art .merchant-hall-sprite{display:block;width:76px;height:76px;object-fit:contain;image-rendering:pixelated;image-rendering:crisp-edges;filter:drop-shadow(0 3px 5px rgba(0,0,0,.44));}
.aldric-portrait-placeholder .merchant-portrait-sprite{display:block;width:min(100%,230px);height:225px;object-fit:contain;image-rendering:pixelated;image-rendering:crisp-edges;filter:drop-shadow(0 6px 8px rgba(0,0,0,.4));}
@media(max-width:850px){.aldric-portrait-placeholder .merchant-portrait-sprite{height:140px;}}
@media(max-width:650px){.merchant-choice-art .merchant-hall-sprite{width:56px;height:56px;}}


/* V0.28.85 — Market at night is the installed Merchants backdrop.
   Keep it separate from Tavern and PvP artwork; both merchant selection
   and every merchant shop use the same market scene. */
body.mode-selecting .play-mode-overlay:has(.merchant-hall),
body.mode-selecting .play-mode-overlay:has(.aldric-shop){
  background:
    linear-gradient(145deg,rgba(10,9,19,.22),rgba(8,7,15,.40)),
    url('/static/backgrounds/merchant_hall.png') center center / cover no-repeat,
    #100e16;
  backdrop-filter:none;
}
body.mode-selecting .play-mode-card:has(.merchant-hall),
body.mode-selecting .play-mode-card:has(.aldric-shop){
  background:linear-gradient(155deg,rgba(34,27,45,.74),rgba(12,11,23,.80))!important;
  border-color:rgba(198,174,212,.52);
  backdrop-filter:blur(2px);
}

/* Keep the supplied castle courtyard on PvP setup/lobby screens only.
   Actual PvP matches use the dedicated arena; PvE retains the forest. */
body.mode-selecting.pvp-arena-active .play-mode-overlay{
  background:
    linear-gradient(155deg,rgba(11,11,18,.37),rgba(8,9,15,.53)),
    url('/static/backgrounds/pvp_courtyard.png') center center / cover no-repeat;
  backdrop-filter:none;
}
body.mode-selecting.pvp-arena-active .play-mode-card{
  background:linear-gradient(170deg,rgba(34,31,44,.84),rgba(13,15,25,.90));
  backdrop-filter:blur(3px);
}
body.pvp-arena-active:not(.mode-selecting) .layout::before{
  background:
    linear-gradient(180deg,rgba(4,8,6,.18),rgba(3,6,5,.42)),
    url('/static/backgrounds/pvp_battlefield.png') center / cover no-repeat;
  filter:saturate(.92) brightness(.78);
}

/* Tavern artwork is staged for the future Tavern & Chat scene; the district
   remains disabled until that feature has a real implementation. */
body.mode-selecting .play-mode-overlay:has(.navvare-tavern){
  background:
    linear-gradient(145deg,rgba(10,8,10,.24),rgba(10,7,8,.43)),
    url('/static/backgrounds/tavern_interior.png') center center / cover no-repeat;
  backdrop-filter:none;
}
body.mode-selecting .play-mode-card:has(.navvare-tavern){
  background:linear-gradient(160deg,rgba(31,22,23,.83),rgba(15,10,14,.89))!important;
}


/* Top-right live combat departure: same fully rounded pill as Map, but danger-red. */
.combat-desert-button{
  color:#ffe4e6; background:rgba(89,25,37,.86); border:1px solid rgba(239,125,133,.65);
  min-height:38px; min-width:90px; padding:8px 16px; border-radius:999px;
  cursor:pointer; font-size:12px; font-weight:800; line-height:1; white-space:nowrap;
}
.combat-desert-button:hover,.combat-desert-button:focus-visible{background:#853047;border-color:#ff9ea8;}
.combat-desert-button:disabled{opacity:.45;cursor:default;}
.combat-desert-button.hidden{display:none!important;}



/* V0.28.91: An empty spectator hand needs no placeholder or panel. */
#promptPanel.planning-hand-empty-state{display:none!important;}
/* Basic Attack is a compact option alongside the other turn actions, not
   a full-sized deck card. */
.team-plan-utility-bar .basic-attack-plan-action{border-color:rgba(164,191,224,.55);background:rgba(55,69,100,.82);}

/* V0.28.92 — tier-colored gear tooltips and side-by-side equipped comparison. */
.gear-tier-common{--gear-color:#f5f5f7;--gear-border:#f5f5f7}
.gear-tier-uncommon{--gear-color:#71dda0;--gear-border:#38985d}
.gear-tier-rare{--gear-color:#86b8ff;--gear-border:#4382c4}
.gear-tier-ultrarare{--gear-color:#d1a0fb;--gear-border:#8b56be}
.gear-tier-legendary{--gear-color:#ff8a69;--gear-border:#dc664b}
.gear-tier-flag1{--gear-color:#ef9197;--gear-border:#cd717d}
.gear-tier-flag2{--gear-color:#e66b7b;--gear-border:#b84453}
.gear-tier-flag3{--gear-color:#bb455b;--gear-border:#752539}
.aldric-item-card{border-color:var(--gear-border,#aaa8b4);}
.aldric-item-card .aldric-item-title strong,.aldric-item-card .aldric-item-meta,.aldric-item-card .aldric-stat strong{color:var(--gear-color,#e5e4ec);}
.aldric-item-node .aldric-token-square{border-color:var(--gear-border,#a3bfd8);}
.aldric-item-popover::before{border-color:var(--gear-border,#aaa8b4);}
.merchant-compare-control{display:flex;gap:12px;align-items:center;flex:1 1 100%;padding-top:8px;border-top:1px solid rgba(190,169,198,.18);font:13px system-ui,sans-serif}
.merchant-compare-control label{color:#dfd3e7;font-weight:650}
.merchant-compare-control select{min-width:0;max-width:440px;width:min(440px,100%);padding:6px 10px;border:1px solid #806395;border-radius:7px;background:#13111b;color:#fff;font:13px system-ui,sans-serif}
.aldric-item-node .aldric-item-popover,.mira-shop:has(#miraTabSell[aria-selected="true"]) .aldric-item-popover{width:570px;max-width:min(570px,85vw)}
.merchant-comparison{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px;align-items:stretch;}
.merchant-compare-shop,.merchant-compare-equipped{min-width:0;display:flex;flex-direction:column;gap:5px}
.merchant-compare-caption{color:#bfc5d7;font:700 11px/1.3 system-ui,sans-serif;text-transform:uppercase;letter-spacing:.07em;}
.merchant-compare-equipped .merchant-compare-caption{color:#89c8dc}
.merchant-comparison .aldric-item-card{width:100%;flex:1;}
.merchant-compare-equipped .aldric-item-card{background:linear-gradient(140deg,#132737,#101821);box-shadow:inset 0 0 0 1px rgba(93,175,198,.16);}
.merchant-compare-empty{border:1px dashed #47758a;color:#a3bdcb;background:#12202c;border-radius:10px;padding:14px;font-size:13px;min-height:74px;}
.merchant-compare-equipped .aldric-item-title strong{font-size:15px}
.merchant-comparison .aldric-item-title strong{overflow-wrap:anywhere}
@media(max-width:820px){.aldric-item-node .aldric-item-popover,.mira-shop:has(#miraTabSell[aria-selected="true"]) .aldric-item-popover{width:min(455px,84vw);}.merchant-comparison .aldric-item-card{padding:8px;}.merchant-comparison .aldric-stat{font-size:10px;}}
@media(max-width:550px){.merchant-comparison{grid-template-columns:1fr;}.aldric-item-node .aldric-item-popover,.mira-shop:has(#miraTabSell[aria-selected="true"]) .aldric-item-popover{width:min(280px,84vw);max-height:75vh;overflow-y:auto;}}
/* Inventory shows only the centered blue item token, with a readable hover/focus popup. */
.inventory-equipment-token{position:relative;display:flex;justify-content:center;align-items:center;width:85px;height:85px;min-height:65px;flex:1 1 auto;max-width:100%;align-self:center;border-radius:12px;background:linear-gradient(180deg,#28334e,#171e30);border:1px solid rgba(143,192,228,.4)}
.inventory-equipment-token .aldric-item-circle{width:52px;height:52px;flex-shrink:0}
.inventory-gear-floating{position:fixed;z-index:4000;pointer-events:none;width:min(285px,85vw);max-height:calc(100vh - 16px);overflow:auto;box-shadow:0 15px 32px #000b;border-radius:11px}
.inventory-gear-floating .aldric-item-card{box-sizing:border-box;width:100%;max-width:none}
.inventory-slot:has(.inventory-equipment-token){overflow:visible}
.world-map-inventory-character .inventory-slot:has(.inventory-equipment-token){overflow:hidden}
@media(max-width:700px){.world-map-inventory-character .inventory-slot .inventory-equipment-token{width:58px;height:58px;min-height:48px}.world-map-inventory-character .inventory-slot .inventory-equipment-token .aldric-item-circle{width:42px;height:42px}.inventory-equipment-token{width:68px;height:68px}}

/* Keep all Mira tooltip borders tied to the actual rarity, not the old shop default. */
.mira-shop .aldric-item-card{border-color:var(--gear-border,#aaa8b4)}

/* V0.28.93 — Requested merchant greetings below portraits, separate from shop mechanics. */
.aldric-portrait-panel .merchant-greeting{max-width:26ch;margin:0;color:#f5dcae;text-align:center;font-size:clamp(15px,1.4vw,18px);line-height:1.5;overflow-wrap:break-word;}
@media(max-width:850px){.aldric-portrait-panel .merchant-greeting{max-width:40ch;text-align:left;}}
@media(max-width:600px){.aldric-portrait-panel .merchant-greeting{max-width:30ch;text-align:center;}}


/* V0.28.98 — Equip directly into the six glowing inventory slots.
   Borders reflect actual item rarity in both the bag and equipped gear. */
.inventory-bag-row[class*="gear-tier-"]{
  border:2px solid var(--gear-border,#f5f5f7);
  transition:border-color .14s ease,box-shadow .14s ease;
}
.inventory-bag-row.is-selected{
  box-shadow:0 0 0 2px var(--gear-color,#f5f5f7),0 0 15px color-mix(in srgb,var(--gear-color,#f5f5f7) 38%,transparent);
}
/* The six outer equipment slots stay the same purple whether empty or occupied.
   Rarity color belongs only to the equipped item's INNER square frame. */
.inventory-slot[class*="gear-tier-"]{
  border:1px solid rgba(192,132,252,.21);
}
.inventory-equipment-token[class*="gear-tier-"]{
  border:1px solid var(--gear-border,#f5f5f7);
}
.inventory-slot{position:relative;transition:outline-color .14s ease,box-shadow .14s ease;}
.inventory-slot.is-equip-target{
  outline:2px solid #ffe19a;outline-offset:1px;
  box-shadow:0 0 0 2px rgba(248,207,106,.16),0 0 23px rgba(255,215,119,.70),inset 0 0 20px rgba(255,212,101,.20);
}
.inventory-slot-equip-target{
  position:absolute;inset:0;z-index:5;
  border:0;border-radius:inherit;
  background:rgba(235,177,65,.11);
  color:#fff6d6;cursor:pointer;
  display:flex;align-items:flex-end;justify-content:center;
  padding:8px 4px;box-sizing:border-box;
}
.inventory-slot-equip-target span{
  padding:3px 9px;border-radius:7px;
  background:rgba(29,20,8,.90);border:1px solid #ffd58a;
  font-size:12px;line-height:1.2;white-space:nowrap;
}
.inventory-slot-equip-target[hidden],.inventory-equip-guide[hidden]{display:none!important;}
.inventory-slot-equip-target:hover,.inventory-slot-equip-target:focus-visible{
  background:rgba(254,215,117,.23);outline:2px solid #fff1bf;outline-offset:0;
}
.inventory-equip-guide{
  display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;
  margin:0 0 10px;color:#ffebad;font-size:13px;
}
.inventory-equip-guide .mode-button{min-height:30px;padding:4px 12px;font-size:12px;}
@media (prefers-reduced-motion:no-preference){
  .inventory-slot.is-equip-target{animation:inventory-slot-glow 1.6s ease-in-out infinite alternate;}
  @keyframes inventory-slot-glow{
    to{box-shadow:0 0 0 2px rgba(248,207,106,.24),0 0 13px rgba(255,215,119,.35),inset 0 0 11px rgba(255,212,101,.14);}
  }
}

/* V0.28.98 — Item stat cards use a neutral black/charcoal gradient.
   Rarity accents belong to the outer border and text, not the fill. Applies
   to inventory hover details and merchant shop/equipped comparisons. */
.aldric-item-card,
.merchant-compare-equipped .aldric-item-card{
  background:linear-gradient(145deg,#2c2e34 0%,#1c1e24 52%,#101116 100%);
  border-color:var(--gear-border,#b5b5c1);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.055);
}
.aldric-item-popover .aldric-item-card{
  box-shadow:inset 0 1px 0 rgba(255,255,255,.055),0 12px 24px rgba(0,0,0,.38);
}
/* The little tooltip pointer must match the panel, never the old warm tint. */
.aldric-item-popover::before{
  background:#24262c;
  border-color:var(--gear-border,#b5b5c1);
}
.aldric-item-card .aldric-stat-list{
  border-top-color:rgba(185,190,199,.16);
}
.aldric-item-card .aldric-stat{
  border-bottom-color:rgba(185,190,199,.14);
}


/* V0.28.99 — full-width, accessible experience bar in all inventory contexts. */
.inventory-screen .currency-row{grid-template-columns:repeat(3,minmax(0,1fr));margin-bottom:10px}
.inventory-xp-section{display:block;min-width:0;margin:0 0 17px}
.inventory-xp-heading{display:block;margin-bottom:6px;color:#cbb5e6;font-size:10px;font-weight:800;letter-spacing:.13em}
.inventory-xp-track{
  position:relative;isolation:isolate;height:30px;box-sizing:border-box;
  overflow:hidden;border:1px solid rgba(212,180,249,.65);border-radius:9px;
  background:linear-gradient(180deg,#0d0d17,#252031);
  box-shadow:inset 0 2px 7px rgba(0,0,0,.75),0 1px 7px rgba(0,0,0,.25);
}
.inventory-xp-fill{
  position:absolute;inset:0 auto 0 0;min-width:0;
  background:linear-gradient(180deg,#e6ccff 0%,#dfc1fd 50%,#d9b6fb 100%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.27),0 0 12px rgba(200,152,250,.31);
  transition:width .25s ease-out;
}
.inventory-xp-text{
  position:absolute;inset:0;z-index:1;display:flex;justify-content:center;align-items:center;
  padding:0 8px;box-sizing:border-box;font-family:Inter,ui-sans-serif,system-ui,sans-serif;
  color:#fff;font-size:13px;font-weight:800;letter-spacing:.02em;
  font-variant-numeric:tabular-nums;text-shadow:0 1px 3px #000,0 0 5px #000;
  white-space:nowrap;
}
/* The map inventory is a fixed-height grid; account for the extra XP row. */
.world-map-inventory-character .inventory-screen{
  grid-template-rows:auto auto auto auto minmax(0,1fr) auto;
}
.world-map-inventory-character .inventory-xp-section{margin:0 0 5px}
.world-map-inventory-character .inventory-xp-heading{margin-bottom:3px;font-size:9px}
.world-map-inventory-character .inventory-xp-track{height:24px}
.world-map-inventory-character .inventory-xp-text{font-size:11px}
@media(max-width:700px){
  .world-map-inventory-character .inventory-screen{
    grid-template-rows:auto auto auto auto minmax(0,1fr) auto;
  }
  .world-map-inventory-character .inventory-xp-heading{margin-bottom:2px}
  .world-map-inventory-character .inventory-xp-track{height:22px}
  .inventory-screen .currency-row{gap:6px}
  .inventory-screen .currency-row>div{min-width:0;padding:8px}
  .inventory-screen .currency-row strong{overflow-wrap:anywhere;font-size:clamp(12px,3vw,18px)}
}
@media(prefers-reduced-motion:reduce){.inventory-xp-fill{transition:none}}

/* V0.29.00 — Keep Compare immediately beneath Silver / Gold / Flags in every
   merchant toolbar, rather than spanning a separate row beneath the buyer. */
.aldric-shop-toolbar .merchant-wallet-stack{
  display:flex;flex-direction:column;align-items:stretch;
  flex:0 1 auto;min-width:0;gap:8px;
}
.aldric-shop-toolbar .merchant-wallet-stack .aldric-wallet{
  flex:0 1 auto;justify-content:flex-end;
}
.aldric-shop-toolbar .merchant-wallet-stack .merchant-compare-control{
  flex:0 0 auto;width:100%;box-sizing:border-box;min-width:0;
  border-top:1px solid rgba(190,169,198,.18);padding-top:8px;
  justify-content:flex-end;
}
.aldric-shop-toolbar .merchant-wallet-stack .merchant-compare-control select{
  width:min(290px,100%);max-width:290px;min-width:0;
}
@media(max-width:850px){
  .aldric-shop-toolbar .merchant-wallet-stack{flex:1 1 100%;width:100%;}
  .aldric-shop-toolbar .merchant-wallet-stack .aldric-wallet,
  .aldric-shop-toolbar .merchant-wallet-stack .merchant-compare-control{justify-content:flex-start;}
}
/* When the chosen gear slot has nothing equipped, display the shop item alone;
   avoid both the empty compare card and an unused blank comparison column. */
.merchant-comparison-single{grid-template-columns:minmax(0,1fr);}
.aldric-item-node .aldric-item-popover:has(.merchant-comparison-single),
.mira-shop:has(#miraTabSell[aria-selected="true"]) .aldric-item-popover:has(.merchant-comparison-single){
  width:285px;max-width:min(285px,85vw);
}
@media(max-width:750px){
  .aldric-item-node .aldric-item-popover:has(.merchant-comparison-single),
  .mira-shop:has(#miraTabSell[aria-selected="true"]) .aldric-item-popover:has(.merchant-comparison-single){
    width:min(245px,72vw);max-width:min(245px,72vw);
  }
}

/* Palette values mirrored from the class-card CSS variables above. */
.home-party-entry[data-class="Warrior"],
.home-party-chip[data-class="Warrior"] {
  --class-rim-light: #c76868;
  --class-rim-mid: #8f2b2b;
  --class-rim-dark: #5a1717;
}
.home-party-entry[data-class="Paladin"],
.home-party-chip[data-class="Paladin"] {
  --class-rim-light: #d5b46e;
  --class-rim-mid: #8b6a39;
  --class-rim-dark: #69502d;
}
.home-party-entry[data-class="Rogue"],
.home-party-chip[data-class="Rogue"] {
  --class-rim-light: #ff7d13;
  --class-rim-mid: #e86408;
  --class-rim-dark: #843006;
}
.home-party-entry[data-class="Ranger"],
.home-party-chip[data-class="Ranger"] {
  --class-rim-light: #b97845;
  --class-rim-mid: #855023;
  --class-rim-dark: #5a3217;
}
.home-party-entry[data-class="Mage"],
.home-party-chip[data-class="Mage"] {
  --class-rim-light: #6477ed;
  --class-rim-mid: #3249b2;
  --class-rim-dark: #1c286c;
}
.home-party-entry[data-class="Cleric"],
.home-party-chip[data-class="Cleric"] {
  --class-rim-light: #f2df86;
  --class-rim-mid: #c9b85f;
  --class-rim-dark: #8f7e3f;
}
.home-party-entry[data-class="Bard"],
.home-party-chip[data-class="Bard"] {
  --class-rim-light: #84e4e6;
  --class-rim-mid: #35aebc;
  --class-rim-dark: #176875;
}
.home-party-entry[data-class="Necromancer"],
.home-party-chip[data-class="Necromancer"] {
  --class-rim-light: #4a4a4a;
  --class-rim-mid: #2a2a2a;
  --class-rim-dark: #111111;
}
.home-party-entry[data-class="Warlock"],
.home-party-chip[data-class="Warlock"] {
  --class-rim-light: #8d58bd;
  --class-rim-mid: #642690;
  --class-rim-dark: #3b1558;
}
.home-party-entry[data-class="Druid"],
.home-party-chip[data-class="Druid"] {
  --class-rim-light: #4b7d55;
  --class-rim-mid: #2c6538;
  --class-rim-dark: #173f22;
}

/* V0.29.02 — Class-colored selection pills on the MAIN MENU party summary.
   Inherit the same class rim colors used by character cards and class picker. */
.home-party-summary .home-party-chip[data-class] {
  border:1px solid var(--class-rim-light,#855ba7);
  background:linear-gradient(145deg,
    color-mix(in srgb,var(--class-rim-light,#a579bc) 84%,#191425),
    color-mix(in srgb,var(--class-rim-mid,#644287) 85%,#191425));
  color:#fff;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.16),0 0 10px color-mix(in srgb,var(--class-rim-light,#a579bc) 25%,transparent);
  text-shadow:0 1px 2px rgba(0,0,0,.8);
}
.home-party-summary .home-party-chip[data-class] .home-party-chip-order {
  border:1px solid color-mix(in srgb,var(--class-rim-light,#a579bc) 80%,white);
  background:color-mix(in srgb,var(--class-rim-dark,#311b44) 85%,#15101c);
  color:#fff;
}

/* V0.29.03: Shop item tokens preview on hover, not on persistent mouse
   click focus. Keyboard tab focus still exposes an item preview. On touch,
   a tap on the token must not emulate a sticky :hover preview; Buy and Sell
   remain normal explicit actions. */
@media (hover:none) {
  .aldric-item-node:hover .aldric-item-popover {
    opacity:0; visibility:hidden; pointer-events:none;
  }
  .aldric-item-node:has(.aldric-item-circle:focus-visible) .aldric-item-popover {
    opacity:1; visibility:visible; pointer-events:none;
  }
}


/* V0.29.06 — one horizontal equipment row, bag beneath, XP as the divider.
   Shared home/map/between-fights inventory UI, with horizontal slot scrolling
   on narrow screens rather than collapsing the six slots into a column. */
.inventory-screen .inventory-hero{gap:14px;padding-bottom:10px}
.inventory-screen .inventory-hero-identity{flex:1;min-width:0}
.inventory-hero-actions{margin-left:auto;display:flex;align-items:center;justify-content:flex-end;gap:8px;flex:0 0 auto}
.inventory-screen .inventory-hero .inventory-hero-actions .mode-button{
  margin-left:0;white-space:nowrap;min-height:34px;padding:7px 14px;font-size:13px;
}
.inventory-screen .currency-row{margin:10px 0 0}
.inventory-screen .inventory-xp-section{
  margin:0 0 8px;padding:10px 0 13px;
  border-bottom:1px solid rgba(192,132,252,.23);
}
.inventory-screen .inventory-xp-track{height:27px;border-radius:7px}
.inventory-screen .inventory-collections{
  display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto;
  gap:16px;min-width:0;
}
.inventory-screen .inventory-equipment-section,
.inventory-screen .inventory-bag-section{min-width:0}
.inventory-screen .inventory-slot-grid{
  display:grid;grid-template-columns:repeat(6,minmax(0,1fr));grid-template-rows:none;
  align-items:stretch;gap:9px;min-width:0;
  overflow-x:auto;overflow-y:visible;padding:2px 1px 7px;
}
.inventory-screen .inventory-slot{
  box-sizing:border-box;min-width:0;min-height:142px;max-height:none;
  padding:9px;gap:6px;overflow:visible;
}
.inventory-screen .inventory-slot-label{font-size:11px}
.inventory-screen .inventory-slot .inventory-slot-empty{overflow-wrap:anywhere}
.inventory-screen .inventory-bag-section{margin-top:0}
.inventory-screen .inventory-bag{min-width:0}
@media(max-width:850px){
  .inventory-screen .inventory-slot-grid{grid-template-columns:repeat(6,minmax(125px,1fr))}
  .inventory-screen .inventory-hero{flex-wrap:wrap}
  .inventory-hero-actions{margin-left:auto}
  .inventory-screen .inventory-hero .inventory-hero-actions .mode-button{min-height:34px;padding:6px 10px;font-size:12px}
}
@media(max-width:470px){
  .inventory-screen .inventory-slot-grid{grid-template-columns:repeat(6,minmax(112px,1fr))}
  .inventory-screen .inventory-hero{gap:6px}
  .inventory-hero-actions{width:100%;justify-content:flex-end}
}
/* World-map modal has a fixed-height scrollable body. The equipment section
   gets its natural height; the inventory bag receives the remaining space. */
.world-map-inventory-character{overflow:hidden}
.world-map-inventory-character .inventory-screen{
  grid-template-rows:auto auto auto minmax(0,1fr) auto;
  height:100%;min-height:0;
}
.world-map-inventory-character .inventory-collections{
  display:grid;grid-template-columns:minmax(0,1fr);
  grid-template-rows:auto minmax(0,1fr);gap:10px;min-height:0;overflow:hidden;
}
.world-map-inventory-character .inventory-equipment-section{flex:0 0 auto;min-height:0;overflow:visible}
.world-map-inventory-character .inventory-bag-section{min-height:0;overflow:hidden}
.world-map-inventory-character .inventory-slot-grid{
  grid-template-columns:repeat(6,minmax(112px,1fr));grid-template-rows:none;
  min-height:0;flex:0 0 auto;gap:6px;overflow-x:auto;overflow-y:visible;
}
.world-map-inventory-character .inventory-slot{
  min-height:126px;max-height:160px;overflow:visible;padding:7px;gap:5px;
}
.world-map-inventory-character .inventory-bag{overflow-y:auto;min-height:0;flex:1}
.world-map-inventory-character .inventory-section-head{margin:4px 0 6px}
.world-map-inventory-character .inventory-xp-section{margin-bottom:5px;padding:6px 0 8px}
.world-map-inventory-character .inventory-hero-actions .mode-button{min-width:0}
@media(max-width:700px){
  .world-map-inventory-character .inventory-screen{grid-template-rows:auto auto auto minmax(0,1fr) auto}
  .world-map-inventory-character .inventory-collections{grid-template-rows:auto minmax(0,1fr)}
  .world-map-inventory-character .inventory-slot-grid{grid-template-columns:repeat(6,minmax(105px,1fr))}
  .world-map-inventory-character .inventory-slot{min-height:112px;max-height:143px}
  .world-map-inventory-character .inventory-slot .inventory-equipment-token{min-height:42px;height:50px}
}
@media(max-width:430px){
  .world-map-inventory-character .inventory-slot-grid{grid-template-columns:repeat(6,minmax(98px,1fr))}
  .world-map-inventory-character .inventory-slot-label{font-size:10px}
}


/* V0.29.08: compact name-only pill DURING battlefield target selection.
   Do not turn real cards (including Shield Bash) into pills in the hand. */
body.battlefield-targeting .target-selection-header .target-castable,
body.team-planning.battlefield-targeting .team-plan-target-header .target-castable{
  display:flex;
  justify-content:center;
  align-items:center;
  min-width:0;
  padding:0;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
}
body.battlefield-targeting .target-selection-header .target-card-name-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:fit-content;
  max-width:100%;
  min-height:34px;
  box-sizing:border-box;
  padding:8px 20px;
  border:1px solid rgba(192,132,252,.65);
  border-radius:999px;
  background:linear-gradient(180deg,rgba(79,46,105,.92),rgba(40,25,62,.94));
  color:#f3e8ff;
  box-shadow:0 3px 12px rgba(10,5,20,.3);
  font-size:14px;
  font-weight:900;
  text-align:center;
  line-height:1.2;
  overflow-wrap:anywhere;
}


/* OWNER HOTFIX — ONLY restyle EXISTING pill-shaped UI.
   Original V0.29.08 menu structure, card hand, enemy-click targeting,
   position, sizes, padding, class fills, sounds and controls are unchanged.
   Black outline and square corners only; decorative round hitboxes/sprites
   and full-sized card artwork must not be touched. */
.pill,
.mode-button, .mode-button.primary, .mode-button.subtle, .mode-button.ready-button,
.mode-button:hover:not(:disabled),
.mode-button.primary:hover:not(:disabled),
.mode-button.subtle:hover:not(:disabled),
.mode-button.ready-button:hover:not(:disabled),
.target-selection-header .target-back-button,
body.battlefield-targeting .target-selection-header .target-card-name-pill,
.home-party-head span,
.home-party-chip,
.home-party-chip-order,
.home-party-summary .home-party-chip[data-class],
.home-party-summary .home-party-chip[data-class] .home-party-chip-order,
.party-slot-pill,
.room-limit,
.sequence-progress,
.turn-timer,
.team-plan-timer,
.team-plan-cards-pill,
.team-phase-badge,
.mana-chip,
.anti-mana-chip,
.action-cost,
.sheet-resource,
.realm-card-enchantment-badge,
.battle-sprite .sprite-name,
.battle-summon-target-label,
.team-plan-stunned-message,
body.team-planning .team-plan-fighter .utility-action-grid .action-card.utility,
body.team-planning .team-plan-fighter .team-plan-utility-bar .utility-action,
body.team-plan-discard-active .team-plan-discard-controls .target-back-button,
body.team-plan-discard-active .team-plan-discard-controls .team-plan-discard-confirm,
body.team-planning .team-plan-concede-pill,
.pve-continue-button,
.pve-retry-button,
.pve-exit-menu-button,
.pvp-result-exit,
.global-inventory-button,
.combat-map-button,
.combat-desert-button {
  border-radius: 0 !important;
  border-color: #000 !important;
}

/* V0.29.10 — Drag only the numbered class-colored party chips on Enter Realm.
   Retain the original rectangular black-border styling and placement. */
.home-party-chip[draggable="true"]{cursor:grab;user-select:none;}
.home-party-chip.party-chip-dragging{opacity:.55;cursor:grabbing;}
.home-party-chip.party-chip-drop-target{outline:2px solid #f5f5f5;outline-offset:2px;}
.home-party-chip[draggable="true"]:focus-visible{outline:2px solid #f5f5f5;outline-offset:2px;}


/* V0.29.11 — Same square purple styling on all finished-match header actions.
   Styling only: World Map and Return Party to Map keep their original behavior. */
.topbar-right > .combat-map-button,
.topbar-right > .global-inventory-button,
.topbar-right > .pve-exit-menu-button,
.topbar-right > .pve-continue-button {
  box-sizing:border-box;
  min-height:38px;
  border-radius:0 !important;
  border:1px solid #000 !important;
  background:rgba(88,28,135,.25) !important;
  color:#f3e8ff !important;
  box-shadow:none !important;
}
.topbar-right > .combat-map-button:hover:not(:disabled),
.topbar-right > .global-inventory-button:hover:not(:disabled),
.topbar-right > .pve-exit-menu-button:hover:not(:disabled),
.topbar-right > .pve-continue-button:hover:not(:disabled) {
  background:rgba(126,34,206,.35) !important;
  border-color:#000 !important;
}


/* V0.29.12 — Inventory mirrors merchant icon tokens and supports drag/drop.
   Existing class/rarity borders and shop black/gray tooltips stay unchanged. */
.inventory-screen .inventory-bag{display:flex;flex-direction:row;flex-wrap:wrap;align-content:flex-start;align-items:flex-start;gap:12px;}
.inventory-screen .inventory-bag-row{display:flex;align-items:center;justify-content:center;width:90px;min-height:90px;padding:2px;box-sizing:border-box;border:0;background:transparent;}
.inventory-screen .inventory-bag-icon{width:82px;height:82px;border:2px solid var(--gear-border,#f5f5f7);box-sizing:border-box;position:relative;}
.inventory-screen .inventory-bag-icon .aldric-item-circle{border:2px solid var(--gear-border,#f5f5f7);width:56px;height:56px;cursor:grab;}
.inventory-screen .inventory-bag-icon .aldric-item-circle:active,
.inventory-screen .inventory-equipment-token .inventory-gear-token:active{cursor:grabbing;}
.inventory-screen .inventory-bag-row:hover .inventory-bag-icon{box-shadow:0 0 14px color-mix(in srgb,var(--gear-color,#f5f5f7) 38%,transparent)}
.inventory-screen .inventory-equipment-token .inventory-gear-token{cursor:grab;}
.inventory-screen.inventory-drag-active .inventory-slot{outline:2px solid #ffe19a;outline-offset:1px;box-shadow:0 0 17px rgba(255,215,119,.35),inset 0 0 12px rgba(255,212,101,.14);}
.inventory-screen.inventory-drag-active .inventory-slot.is-drag-over{background:rgba(255,212,101,.20);box-shadow:0 0 22px rgba(255,215,119,.7);}
.inventory-screen.inventory-drag-unequip .inventory-bag{outline:2px dashed #ffe19a;outline-offset:2px;min-height:95px;}
.inventory-screen.inventory-drag-unequip .inventory-bag.is-drag-over{background:rgba(255,212,101,.12);}
.world-map-inventory-character-button.inventory-transfer-target{outline:2px dashed #b5e3ff;outline-offset:-3px;}
.world-map-inventory-character-button.inventory-drag-over{outline:3px solid #f6e3a3;outline-offset:-3px;background:rgba(113,86,155,.73);}
.mira-shop-tabs .merchant-refresh-timer{margin-left:8px;align-self:center;white-space:nowrap;}
@media(max-width:600px){.inventory-screen .inventory-bag-row{width:76px;min-height:78px}.inventory-screen .inventory-bag-icon{width:72px;height:72px}.inventory-screen .inventory-bag-icon .aldric-item-circle{width:49px;height:49px}.mira-shop-tabs .merchant-refresh-timer{font-size:12px;}}


/* V0.29.13: Preserve existing enemy-click targeting. The three existing
   controls are a compact, adjacent row, not spread across a wide header. */
body.team-planning.battlefield-targeting .target-selection-header.team-plan-target-header,
body.team-planning.battlefield-targeting #promptPanel .team-plan-target-header {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  width: max-content !important;
  max-width: 100% !important;
  min-height: 0 !important;
  margin: 0 auto !important;
  padding: 0 !important;
  grid-template-columns: none !important;
}
body.team-planning.battlefield-targeting .team-plan-target-header .target-back-button {
  flex: 0 0 auto !important;
  min-width: 0 !important;
  min-height: 35px !important;
  padding: 7px 12px !important;
}
body.team-planning.battlefield-targeting .team-plan-target-header .target-castable {
  flex: 0 1 auto !important;
  width: auto !important;
  min-height: 35px !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}
body.team-planning.battlefield-targeting .team-plan-target-header .target-card-name-pill {
  min-height: 35px !important;
  padding: 7px 12px !important;
  white-space: normal !important;
}
body.team-planning.battlefield-targeting .team-plan-target-header .team-plan-target-timer {
  flex: 0 0 auto !important;
  min-width: 51px !important;
  height: 35px !important;
  margin: 0 !important;
  position: static !important;
  transform: none !important;
}
/* Keep the target row usable on smaller displays without reintroducing
   new target buttons or changing the battlefield hit targets. */
@media(max-width:600px){
  body.team-planning.battlefield-targeting .team-plan-target-header .target-back-button{padding:6px 9px!important}
  body.team-planning.battlefield-targeting .team-plan-target-header .target-card-name-pill{padding:6px 9px!important;font-size:12px}
}

/* V0.29.13: Seven larger playable cards fit between team effect rosters.
   The available arena center width, not the whole viewport, determines hand
   width. All seven remain a single row at desktop resolutions. */
@media(min-width:1200px){
  body.team-planning .layout,
  body.modern-hand-subpicker .layout {
    grid-template-columns: minmax(165px,205px) minmax(0,1fr) minmax(165px,205px) !important;
    gap: 8px !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
    max-width: 1840px !important;
  }
  body.team-planning:not(.battlefield-targeting) .center-column,
  body.modern-hand-subpicker:not(.battlefield-targeting) .center-column {
    position: relative !important;
  }
  body.team-planning:not(.battlefield-targeting) #promptPanel,
  body.modern-hand-subpicker:not(.battlefield-targeting) #promptPanel {
    width: min(1320px,calc(100% - 12px)) !important;
    max-width: calc(100% - 12px) !important;
  }
  body.team-planning:not(.battlefield-targeting),
  body.modern-hand-subpicker:not(.battlefield-targeting){--rf-hand-card-scale:.31;}
  body.team-planning:not(.battlefield-targeting) .team-plan-fighter .realm-card-grid,
  body.team-planning:not(.battlefield-targeting) .team-plan-subpicker .realm-card-grid,
  body.team-planning:not(.battlefield-targeting) .discard-card-grid,
  body.modern-hand-subpicker:not(.battlefield-targeting) .realm-card-grid {
    width: 100% !important;
    max-width: 100% !important;
    flex-wrap: nowrap !important;
    column-gap: 3px !important;
    justify-content: center !important;
  }
  body.team-planning:not(.battlefield-targeting) .team-plan-fighter .realm-card-choice,
  body.team-planning:not(.battlefield-targeting) .team-plan-subpicker .realm-card-choice,
  body.team-planning:not(.battlefield-targeting) .discard-card-grid .realm-card-choice,
  body.modern-hand-subpicker:not(.battlefield-targeting) .realm-card-choice{
    width: calc(330px * var(--rf-hand-card-scale)) !important;
    flex: 0 0 calc(330px * var(--rf-hand-card-scale)) !important;
  }
  body.team-planning:not(.battlefield-targeting) .team-plan-fighter .realm-card-stage,
  body.team-planning:not(.battlefield-targeting) .team-plan-subpicker .realm-card-stage,
  body.team-planning:not(.battlefield-targeting) .discard-card-grid .realm-card-stage,
  body.modern-hand-subpicker:not(.battlefield-targeting) .realm-card-stage{
    width: calc(330px * var(--rf-hand-card-scale)) !important;
    height: calc(475px * var(--rf-hand-card-scale)) !important;
  }
  body.team-planning:not(.battlefield-targeting) .team-plan-fighter .realm-card-frame,
  body.team-planning:not(.battlefield-targeting) .team-plan-subpicker .realm-card-frame,
  body.team-planning:not(.battlefield-targeting) .discard-card-grid .realm-card-frame,
  body.modern-hand-subpicker:not(.battlefield-targeting) .realm-card-frame{
    transform: scale(var(--rf-hand-card-scale)) !important;
    transform-origin: top left !important;
  }
}

/* Sizes derived from the center lane. The seven cards never overlap the two
   team effects rosters at standard desktop widths. */
@media(min-width:1280px) and (max-width:1399px){body.team-planning:not(.battlefield-targeting),body.modern-hand-subpicker:not(.battlefield-targeting){--rf-hand-card-scale:.345;}}
@media(min-width:1400px) and (max-width:1499px){body.team-planning:not(.battlefield-targeting),body.modern-hand-subpicker:not(.battlefield-targeting){--rf-hand-card-scale:.40;}}
@media(min-width:1500px) and (max-width:1599px){body.team-planning:not(.battlefield-targeting),body.modern-hand-subpicker:not(.battlefield-targeting){--rf-hand-card-scale:.44;}}
@media(min-width:1600px) and (max-width:1699px){body.team-planning:not(.battlefield-targeting),body.modern-hand-subpicker:not(.battlefield-targeting){--rf-hand-card-scale:.48;}}
@media(min-width:1700px) and (max-width:1799px){body.team-planning:not(.battlefield-targeting),body.modern-hand-subpicker:not(.battlefield-targeting){--rf-hand-card-scale:.51;}}
@media(min-width:1800px){body.team-planning:not(.battlefield-targeting),body.modern-hand-subpicker:not(.battlefield-targeting){--rf-hand-card-scale:.55;}}


/* V0.29.13 — Larger, legible effects on the team roster (NOT card-hand text). */
.team-column .fighter-card .effect-chip,
.team-column .fighter-card .effect-chip.effect-description,
.team-column .fighter-card .effect-chip.effect-advantage {
  font-size: 11.5px !important;
  line-height: 1.4 !important;
  padding: 5px 7px !important;
  overflow-wrap: anywhere;
  white-space: normal;
}
.team-column .effects{gap:5px;margin-top:7px;}

/* Full card artwork and 0–5 copy sliders on the saved-deck editor. */
.inventory-deck-modal {position:fixed;inset:0;z-index:2400;display:flex;justify-content:center;align-items:center;
  padding:12px;background:rgba(5,5,12,.88);box-sizing:border-box;}
.inventory-deck-panel {display:flex;flex-direction:column;gap:13px;width:min(1360px,98vw);max-height:96dvh;
  overflow:hidden;padding:18px;box-sizing:border-box;border:2px solid #000;background:linear-gradient(160deg,#292137,#10111a);color:#f3e8ff;}
.inventory-deck-header {display:flex;align-items:center;gap:15px;flex-wrap:wrap;}
.inventory-deck-header h2{font-size:25px;}
.inventory-deck-name{font-size:12px;color:#dbcced;margin:3px 0 0;}
.inventory-deck-count{margin-left:auto;font:900 18px system-ui,sans-serif;color:#fff;}
.inventory-deck-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(158px,1fr));gap:14px;overflow-y:auto;min-height:0;padding:5px;align-content:start;}
.inventory-deck-entry{display:flex;flex-direction:column;align-items:center;gap:8px;min-width:0;border:1px solid #000;background:rgba(0,0,0,.25);padding:8px;}
.inventory-deck-card{width:152px!important;max-width:100%;flex:0 0 auto!important;pointer-events:none;cursor:default!important;}
.inventory-deck-card .realm-card-stage{width:152px!important;height:219px!important;min-height:0!important;max-width:100%;aspect-ratio:auto;}
.inventory-deck-card .realm-card-frame{width:330px!important;height:475px!important;transform:scale(.46)!important;transform-origin:top left;pointer-events:none;}
.inventory-deck-fallback{padding:14px;font-weight:800;}
.inventory-deck-controls{display:flex;flex-direction:column;gap:5px;width:100%;font:12px system-ui,sans-serif;}
.inventory-deck-controls strong{font-size:12px;min-height:32px;}
.inventory-deck-controls small{color:#f9cb86;}
.inventory-deck-controls label{display:flex;flex-direction:column;gap:7px;}
.inventory-deck-controls output{font-weight:900;font-size:16px;color:#d8b4fe;}
.inventory-deck-controls input{width:100%;accent-color:#a855f7;cursor:pointer;}
.inventory-deck-range{display:flex;justify-content:space-between;color:#dfcdec;font-weight:700;}
.inventory-deck-locked{opacity:.58;}
.inventory-deck-footer{display:flex;align-items:center;gap:10px;justify-content:flex-end;min-height:34px;}
.inventory-deck-feedback{font-size:12px;color:#d8b4fe;margin-right:auto;}
.inventory-screen .inventory-build-deck{flex:0 0 auto;min-height:35px;font-size:12px;padding:6px 12px;}
@media(max-width:650px){.inventory-deck-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}
 .inventory-deck-card .realm-card-stage{min-height:0!important;}
 .inventory-deck-header{gap:6px;}.inventory-deck-count{font-size:13px;}
 .inventory-deck-panel{padding:8px;}.inventory-screen .inventory-build-deck{font-size:11px;}}


/* V0.29.14 — Wider Inventory roster and party-number drag/drop controls.
   The gear area keeps its original width and six equipment slots. */
.world-map-inventory-modal{padding:10px}
.world-map-inventory-panel{width:min(1480px,calc(100vw - 20px));max-width:1480px}
.world-map-inventory-content{grid-template-columns:294px minmax(0,1fr);gap:20px}
.world-map-inventory-roster{position:relative;gap:7px;padding:4px 8px 8px 0}
.inventory-party-roster-top{position:sticky;top:0;z-index:12;display:flex;align-items:center;justify-content:space-between;gap:7px;min-height:42px;padding:4px 7px;background:#211a30;border:1px solid #000;border-radius:5px;color:#eee1fa;font-size:12px;font-weight:850}
.inventory-party-roster-top small{display:block;color:#cdb5e0;font-size:10px;font-weight:650;margin-top:3px}
.inventory-party-remove-drop{width:39px;height:36px;min-width:39px;display:grid;place-items:center;border:2px solid #000;border-radius:0;background:#b5233c;color:white;font:900 27px/1 system-ui,sans-serif;box-shadow:0 0 9px rgba(245,63,92,.3)}
.inventory-party-remove-drop.hidden{display:none!important}
.inventory-party-dragging .inventory-party-remove-drop{animation:inventory-party-remove-pulse 1s ease-in-out infinite alternate}
@keyframes inventory-party-remove-pulse{from{box-shadow:0 0 4px rgba(245,63,92,.3)}to{box-shadow:0 0 15px rgba(245,63,92,.75)}}
.inventory-roster-entry{display:flex;align-items:stretch;gap:7px;min-width:0}
.inventory-roster-party-badge{align-self:center;flex:0 0 36px;width:36px;height:36px;display:grid;place-items:center;padding:0;border:2px solid #000;border-radius:0;color:#fff;font:900 17px/1 system-ui,sans-serif;cursor:grab;box-sizing:border-box}
.inventory-roster-party-badge.is-numbered{background:linear-gradient(180deg,#74519e,#48305e)}
.inventory-roster-party-badge.is-add{background:#27342b;border-color:#000;color:#aef6c2;cursor:pointer;font-size:24px}
.inventory-roster-party-badge.is-add:disabled{opacity:.4;cursor:not-allowed}
.inventory-roster-party-badge.inventory-party-source{opacity:.4}
.inventory-roster-entry .world-map-inventory-character-button{flex:1 1 0;min-width:0;width:0}
.inventory-roster-entry .world-map-inventory-character-button.inventory-party-drag-over,
.inventory-party-remove-drop.inventory-party-drag-over{outline:3px solid #f9dc8f;outline-offset:-2px;filter:brightness(1.2)}
@media(max-width:700px){
  .world-map-inventory-content{grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);gap:9px}
  .world-map-inventory-roster{gap:8px;max-height:125px;overflow-x:auto;overflow-y:hidden;align-items:stretch;padding:0 0 8px}
  .inventory-party-roster-top{position:sticky;left:0;flex:0 0 114px;align-self:stretch;padding:4px;font-size:10px}
  .inventory-party-remove-drop{width:34px;min-width:34px;height:34px}
  .inventory-roster-entry{flex:0 0 194px}
  .inventory-roster-party-badge{width:32px;flex-basis:32px}
  .inventory-roster-entry .world-map-inventory-character-button{min-width:0}
}


/* V0.29.15: Readability and robust party-slot drag targets. Existing layout and
   class colors are unchanged; only text and the existing badges are affected. */
body.mode-selecting .home-party-summary{gap:9px;}
body.mode-selecting .home-party-summary .home-party-chip{
  font-size:14.5px;line-height:1.25;padding:6px 12px 6px 8px;gap:8px;
}
body.mode-selecting .home-party-summary .home-party-chip-order{
  font-size:12px;min-width:21px;height:21px;
}
/* Inventory: keep the same geometry of the portraits, slots and icons. */
.world-map-inventory-panel .world-map-inventory-character-button strong{font-size:17px;}
.world-map-inventory-panel .world-map-inventory-character-button small{font-size:13.5px;}
.world-map-inventory-panel .inventory-party-roster-top{font-size:13.5px;}
.world-map-inventory-panel .inventory-party-roster-top small{font-size:11.5px;}
.world-map-inventory-panel .inventory-roster-party-badge{font-size:19px;}
.world-map-inventory-panel .inventory-roster-party-badge.is-add{font-size:26px;}
.world-map-inventory-panel .inventory-hero p{font-size:15px;}
.world-map-inventory-panel .inventory-hero h2{font-size:29px;}
.world-map-inventory-panel .inventory-section-head h3{font-size:23px;}
.world-map-inventory-panel .inventory-section-head span{font-size:13.5px;}
.world-map-inventory-panel .inventory-slot-label{font-size:12px;}
.world-map-inventory-panel .inventory-slot-empty{font-size:13.5px;}
.world-map-inventory-panel .inventory-bag-empty{font-size:14px;}
.world-map-inventory-panel .inventory-currency-label,
.world-map-inventory-panel .currency-row span{font-size:1.12em;}
.world-map-inventory-panel .currency-row strong{font-size:19px;}
.world-map-inventory-panel .inventory-xp-section{font-size:1.12em;}
.world-map-inventory-panel .inventory-hero-actions .mode-button{font-size:14px;}
.world-map-inventory-panel #inventoryFeedback{font-size:13.5px;}
.world-map-inventory-panel .inventory-stat span{font-size:14.5px;}
.world-map-inventory-panel .inventory-stat strong{font-size:22px;}
.world-map-inventory-panel .inventory-stats-toggle summary{font-size:21px;}
.world-map-inventory-panel .inventory-deck-count{font-size:15px;}
.world-map-inventory-panel .inventory-deck-feedback{font-size:13.5px;}
.world-map-inventory-panel .inventory-roster-party-badge.inventory-party-drag-over,
.world-map-inventory-panel .inventory-party-remove-drop.inventory-party-drag-over{
  outline:3px solid #f9dc8f;outline-offset:2px;filter:brightness(1.2);
}
/* Extra scroll-padding at both edges prevents ITEM1/ITEM6's yellow glow
   from being clipped. Does not enlarge slots or change grid columns. */
.inventory-screen .inventory-slot-grid,
.world-map-inventory-character .inventory-slot-grid{
  padding:11px 14px 13px;box-sizing:border-box;scroll-padding-inline:14px;
}
/* Silver dialog: recipient above amount, and dark-on-light native spinner
   buttons. Other amount inputs and shop controls remain unchanged. */
.inventory-silver-dialog .inventory-transfer-recipient{display:flex;flex-direction:column;gap:8px;}
.inventory-silver-dialog #inventoryTransferAmount{
  color-scheme:light;
  background:linear-gradient(to right,#181420 calc(100% - 29px),#e2cfed calc(100% - 29px));
}
/* Prevent background/dim layer from accidentally closing the silver dialog. */
.inventory-silver-dialog{pointer-events:auto;}
@media(max-width:700px){
  .world-map-inventory-panel .world-map-inventory-character-button strong{font-size:16px;}
  .world-map-inventory-panel .world-map-inventory-character-button small{font-size:13px;}
  .world-map-inventory-panel .inventory-slot-label{font-size:11.5px;}
}


/* V0.29.15: deck builder sits ABOVE the Inventory overlay; preserve actual
   in-game card faces and give five cards per row on desktop. */
.inventory-deck-modal{z-index:3900;}
.inventory-deck-panel{width:min(1470px,98vw);}
.inventory-deck-header .inventory-deck-save{min-width:122px;}
.inventory-deck-feedback{min-height:17px;margin:0;font-size:13px;}
.inventory-deck-grid{grid-template-columns:repeat(5,minmax(0,1fr));column-gap:10px;row-gap:15px;padding:10px 7px;}
.inventory-deck-entry{gap:6px;padding:6px 4px;}
.inventory-deck-card{width:198px!important;max-width:100%!important;}
.inventory-deck-card .realm-card-stage{width:198px!important;height:285px!important;max-width:100%;overflow:hidden;}
.inventory-deck-card .realm-card-frame{width:330px!important;height:475px!important;transform:scale(.6)!important;transform-origin:top left;}
.inventory-deck-controls{font-size:14px;gap:7px;}
.inventory-deck-controls label{flex-direction:row;align-items:center;justify-content:space-between;font-weight:700;gap:6px;flex-wrap:wrap;}
.inventory-deck-controls output{font-size:17px;}
.inventory-deck-controls input[type="range"]{
  --deck-fill:0%;display:block;flex:1 0 100%;height:11px;border:1px solid #000;border-radius:0;
  -webkit-appearance:none;appearance:none;cursor:pointer;
  background:linear-gradient(to right,#9333ea 0%,#9333ea var(--deck-fill),#fff var(--deck-fill),#fff 100%);
}
.inventory-deck-controls input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance:none;appearance:none;width:15px;height:20px;background:#e9ccff;
  border:2px solid #000;border-radius:0;cursor:grab;
}
.inventory-deck-controls input[type="range"]::-moz-range-thumb{
  width:13px;height:18px;background:#e9ccff;border:2px solid #000;border-radius:0;cursor:grab;
}
@media(max-width:1320px) and (min-width:1051px){
  .inventory-deck-card,.inventory-deck-card .realm-card-stage{width:165px!important;}
  .inventory-deck-card .realm-card-stage{height:238px!important;}
  .inventory-deck-card .realm-card-frame{transform:scale(.5)!important;}
}
@media(max-width:1050px){.inventory-deck-grid{grid-template-columns:repeat(3,minmax(0,1fr));}}
@media(max-width:650px){.inventory-deck-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:400px){
  .inventory-deck-card,.inventory-deck-card .realm-card-stage{width:145px!important;}
  .inventory-deck-card .realm-card-stage{height:209px!important;}
  .inventory-deck-card .realm-card-frame{transform:scale(.4394)!important;}
  .inventory-deck-header h2{font-size:20px;}
  .inventory-deck-header .inventory-deck-save{min-width:80px;padding:7px!important;}
}

/* Silver transfer: both action buttons share one row, Send left, Cancel right. */
.inventory-silver-dialog .inventory-slot-picker-card{
  display:grid;grid-template-columns:1fr 1fr;column-gap:10px;row-gap:14px;
}
.inventory-silver-dialog .inventory-slot-picker-card > h3{grid-column:1/-1;}
.inventory-silver-dialog .inventory-transfer-form{display:contents;}
.inventory-silver-dialog .inventory-transfer-recipient,
.inventory-silver-dialog .inventory-transfer-amount{grid-column:1/-1;}
.inventory-silver-dialog .inventory-transfer-confirm{
  grid-column:1;grid-row:4;margin:0;justify-self:start;align-self:center;min-width:130px;
}
.inventory-silver-dialog .inventory-slot-picker-footer{
  grid-column:2;grid-row:4;margin:0;display:flex;align-items:center;justify-content:flex-end;
}
.inventory-silver-dialog .inventory-slot-picker-error{min-width:0;}
.inventory-silver-dialog .inventory-slot-picker-cancel{min-width:130px;}
@media(max-width:420px){
  .inventory-silver-dialog .inventory-transfer-confirm,
  .inventory-silver-dialog .inventory-slot-picker-cancel{min-width:100px;}
}

/* Target selection: Back matches Base Attack / Pass, not the timer.
   Only change Back's colors. Preserve positioning and enemy click targeting. */
body.team-planning.battlefield-targeting .team-plan-target-header .target-back-button,
body.team-planning.battlefield-targeting .team-plan-target-header .target-back-button:not(:disabled){
  background:linear-gradient(180deg,rgba(38,44,52,.86),rgba(25,30,37,.88))!important;
  border:1px solid #000!important;
  color:#f3f4f6!important;
  box-shadow:none!important;
  opacity:1!important;
}
body.team-planning.battlefield-targeting .team-plan-target-header .target-back-button:hover:not(:disabled){
  background:linear-gradient(180deg,rgba(61,69,82,.93),rgba(40,46,55,.95))!important;
  border-color:#000!important;
}


/* V0.29.15: Team roster readability — improve the character identity and
   resources that v0.27.10 compressed too far. Keep both team columns in their
   existing grid lanes and preserve the seven-card hand and effect-chip sizing. */
.team-column .section-label{font-size:13px;letter-spacing:.15em;}
.team-column .team-stack{gap:10px;}
.team-column .fighter-card{padding:11px 10px 12px;}
.team-column .fighter-head{
  display:grid;grid-template-columns:35px minmax(0,1fr);gap:7px 9px;
  align-items:start;
}
.team-column .fighter-icon{
  grid-column:1;grid-row:1;width:35px;height:35px;font-size:20px;
}
.team-column .fighter-title{grid-column:2;grid-row:1;min-width:0;align-self:center;}
.team-column .fighter-name{font-size:15px;line-height:1.25;}
.team-column .fighter-name.name-long{font-size:13.5px;}
.team-column .fighter-name.name-very-long{font-size:12px;}
.team-column .fighter-name.name-extreme{font-size:11px;}
.team-column .fighter-meta-line{gap:5px;margin-top:3px;flex-wrap:wrap;}
.team-column .fighter-class,.team-column .fighter-level{font-size:11px;line-height:1.3;}
.team-column .fighter-head-actions{
  grid-column:1/-1;grid-row:2;gap:8px;justify-content:flex-start;min-width:0;
}
.team-column .mana-chip{font-size:12px;padding:5px 8px;}
.team-column .fighter-stat-toggle{width:27px;height:27px;font-size:13px;}
.team-column .bar{height:22px;margin-top:9px;}
.team-column .bar-text{font-size:11px;}
.team-column .summon{font-size:11px;padding:6px;}
/* Stack long labels instead of clipping the name; no extra horizontal width
   is taken from the middle seven-card battlefield. */
@media(max-width:1199px){
  .team-column .fighter-head{grid-template-columns:32px minmax(0,1fr);gap:6px 8px;}
  .team-column .fighter-icon{width:32px;height:32px;font-size:18px;}
  .team-column .fighter-name{font-size:14px;}
  .team-column .fighter-class,.team-column .fighter-level{font-size:10.5px;}
}


/* V0.29.16 — legible character creation, unclipped inventory slots, matching
   gold gear-transfer highlights; no position/layout changes. */
body.character-creating .creation-identity{font-size:17px;line-height:1.45}
body.character-creating .creation-detail-description{font-size:17px!important;line-height:1.58}
body.character-creating .creation-class-details h4{font-size:25px}
body.character-creating .creation-starter-deck h4 small{font-size:14px;line-height:1.4}
body.character-creating .creation-card-top strong{font-size:16px;line-height:1.42}
body.character-creating .creation-card-meta{font-size:14px;line-height:1.35}
body.character-creating .creation-card-effect{font-size:15px;line-height:1.55}
body.character-creating .creation-card-row{padding:12px 14px}
/* Leave room to draw the selected-party badge highlight on the left edge. */
.world-map-inventory-roster{padding-left:12px;scroll-padding-left:12px}
@media(max-width:700px){.world-map-inventory-roster{padding-left:12px;}}
/* Match ITEM1–ITEM6 gold outlines while dragging equipment to a portrait. */
.world-map-inventory-character-button.inventory-transfer-target{
  outline:2px solid #ffe19a;outline-offset:1px;
  box-shadow:0 0 17px rgba(255,215,119,.35),inset 0 0 12px rgba(255,212,101,.14);
}
.world-map-inventory-character-button.inventory-transfer-target.inventory-drag-over{
  outline:2px solid #ffe19a;outline-offset:1px;
  background:rgba(255,212,101,.20);
  box-shadow:0 0 22px rgba(255,215,119,.7),inset 0 0 12px rgba(255,212,101,.14);
}
@keyframes rf-summon-entry{
  from{opacity:0;filter:brightness(1.6) drop-shadow(0 0 9px #f4df98);translate:0 13px}
  to{opacity:1;filter:drop-shadow(0 4px 3px rgba(0,0,0,.45));translate:0 0}
}
@keyframes rf-summon-depart{to{opacity:0;filter:brightness(.5);translate:0 9px}}
.battle-summon-sprite.summon-entering{animation:rf-summon-entry .65s both ease-out}
.battle-summon-sprite.summon-departing{animation:rf-summon-depart .22s both ease-in!important}


/* V0.29.17: icon FRAME is draggable; the central circle is decorative. */
.inventory-screen .inventory-bag-icon,
.inventory-screen .inventory-equipment-token[draggable="true"]{cursor:grab;user-select:none;-webkit-user-drag:element;touch-action:pan-y;}
.inventory-screen .inventory-bag-icon:active,
.inventory-screen .inventory-equipment-token[draggable="true"]:active{cursor:grabbing;}
.inventory-screen .inventory-gear-token{cursor:inherit;}
.inventory-screen .inventory-item-locked .inventory-bag-icon{filter:grayscale(1);opacity:.44;}
.inventory-screen .inventory-item-locked .inventory-bag-icon:hover{filter:grayscale(.9);opacity:.65;}
/* Increase tooltip readability only; no icon or gear-slot resizing. */
.inventory-gear-floating{width:min(350px,calc(100vw - 24px));}
.inventory-gear-floating .aldric-item-title strong{font-size:18px;line-height:1.35;}
.inventory-gear-floating .aldric-item-meta{font-size:14px;line-height:1.4;}
.inventory-gear-floating .aldric-stat{font-size:15px;line-height:1.45;padding:6px 3px;}
.inventory-gear-floating .aldric-item-card{padding:15px;}
/* Item comparisons also need legible stat values. */
.merchant-comparison .aldric-stat{font-size:14px;line-height:1.35;}
/* The shop content must not create sideways scrolling due to large hidden hover cards. */
body.mode-selecting .play-mode-card:has(.mira-shop){overflow-x:hidden;}
.mira-shop,.mira-shop .aldric-shop-main{min-width:0;max-width:100%;}
.mira-shop-tabs{flex-wrap:wrap;}
.mira-shop .aldric-tier-items{min-width:0;max-width:100%;}
/* Don't reserve extra scroll depth for the last hidden item preview. */
body.mode-selecting .play-mode-card:has(.aldric-shop):not(:has(.mira-shop)){overflow-x:hidden;}
.aldric-shop .aldric-stock{padding-bottom:0;margin-bottom:0;}

/* Merchant popovers live above the scrolling shop rather than enlarging it. */
.aldric-item-node > .aldric-item-popover{display:none!important;}
.merchant-popover-float{position:fixed!important;z-index:5500!important;left:0;top:0;
  width:min(570px,calc(100vw - 16px))!important;max-width:calc(100vw - 16px)!important;
  max-height:calc(100dvh - 16px);overflow:auto;
  opacity:1!important;visibility:visible!important;pointer-events:none!important;transform:none!important;}
.merchant-popover-float::before{display:none!important;}
@media(max-width:820px){.merchant-popover-float{width:min(455px,calc(100vw - 16px))!important;}}
@media(max-width:550px){.merchant-popover-float{width:min(280px,calc(100vw - 16px))!important;}}

/* RealmFall stat panel parity: inventory/roster uses the battle popover's
   width and comparable height while showing saved stats only. */
.character-stat-sheet-portal .fighter-stat-popover.active-stat-sheet{
  width:min(338px,calc(100vw - 20px))!important;
}
.character-stat-sheet-portal .fighter-stat-popover.active-stat-sheet .combat-stat-tile{
  padding:9px 7px 8px;
}
.character-stat-sheet-portal .fighter-stat-popover.active-stat-sheet .combat-stat-tile span{
  font-size:7.5px;
}
.character-stat-sheet-portal .fighter-stat-popover.active-stat-sheet .combat-stat-tile strong{
  font-size:14px;
}
/* Final odd tile spans the complete row: Anti-Mana has no pairing stat. */
.combat-stat-grid > .combat-stat-tile.stat-anti:last-child{grid-column:1 / -1}

/* V0.29.20 — return to the exact V0.29.13 205px side lanes while
   preserving the seven-card hand scale, width, and placement unchanged.
   Keep the fighter identity/resources compact inside their existing lane. */
@media(min-width:1200px){
  body.team-planning .layout,
  body.modern-hand-subpicker .layout{
    grid-template-columns:minmax(165px,205px) minmax(0,1fr) minmax(165px,205px)!important;
  }
}

/* The stage detail card ends shortly below Proceed. */
.world-map-details{min-height:0!important;align-self:start}
@media(max-width:980px){.world-map-details{min-height:0!important}}
.world-map-enemy-icons{display:flex;flex-wrap:wrap;align-items:center;gap:7px;margin:11px 0 16px}
.world-map-enemy-icon{display:grid;place-items:center;width:55px;height:55px;border-radius:9px;border:1px solid rgba(197,153,239,.44);background:rgba(17,17,27,.75)}
.world-map-enemy-icon img{width:49px;height:49px;object-fit:contain;image-rendering:pixelated}
@media(max-width:580px){.world-map-enemy-icon{width:46px;height:46px}.world-map-enemy-icon img{width:41px;height:41px}}

/* V0.29.20 — compact battle roster, never widen into the seven-card area.
   Name stays above; class + level + mana + stats toggle share one readable row. */
.team-column .fighter-card{padding:10px 9px 11px;}
.team-column .fighter-head{
  display:grid;grid-template-columns:30px minmax(0,1fr);
  gap:5px 7px;align-items:center;
}
.team-column .fighter-icon{
  grid-column:1;grid-row:1;width:30px;height:30px;font-size:17px;
}
.team-column .fighter-title{grid-column:2;grid-row:1;min-width:0;align-self:center;}
.team-column .fighter-name{font-size:14.5px;line-height:1.25;}
.team-column .fighter-name.name-long{font-size:13px;}
.team-column .fighter-name.name-very-long{font-size:11.5px;}
.team-column .fighter-name.name-extreme{font-size:10.5px;}
.team-column .fighter-meta-line{
  grid-column:1/-1;grid-row:2;display:flex;align-items:center;
  width:100%;min-width:0;gap:4px;margin-top:0;flex-wrap:nowrap;
}
.team-column .fighter-class{
  flex:1 1 auto;min-width:0;max-width:none;font-size:10.5px;
  line-height:1.25;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.team-column .fighter-level{flex:0 0 auto;font-size:10.5px;line-height:1.25;}
.team-column .fighter-meta-line .fighter-head-actions{
  display:flex;align-items:center;justify-content:flex-end;
  gap:4px;flex:0 0 auto;margin-left:auto;min-width:0;
}
.team-column .mana-chip{font-size:10.5px;padding:3px 5px;line-height:1.2;}
.team-column .fighter-stat-toggle{width:22px;height:22px;font-size:11px;flex:0 0 auto;}
.team-column .bar{height:21px;margin-top:8px;}
.team-column .bar-text{font-size:11px;}
/* Make stage-preview sprites all face left. Files with native left-facing
   artwork are left unchanged; only right-facing artwork is mirrored. */
.world-map-enemy-icon img.preview-flip-left{transform:scaleX(-1);}
/* Both the inner disc and the outer rarity square show the same stats. */
.inventory-screen .inventory-bag-icon,
.inventory-screen .inventory-equipment-token{cursor:grab;}
.inventory-screen .inventory-bag-icon:focus-within,
.inventory-screen .inventory-equipment-token:focus-within{outline:2px solid rgba(233,203,255,.78);outline-offset:2px;}

/* V0.29.21 — battle-hand and roster cleanup.
   The earlier 205px lanes competed with the 7-card hand at intermediate
   resolutions. Compact 188px lanes protect the ORIGINAL seven-card scales,
   while keeping each fighter readable without added perimeter panels. */
@media (min-width:1200px){
  body.team-planning .layout,
  body.modern-hand-subpicker .layout{
    grid-template-columns:minmax(150px,188px) minmax(0,1fr) minmax(150px,188px)!important;
    gap:8px!important;
  }
}
/* No huge black gradient boxes or added rails on the battle perimeter. */
body.team-planning .layout,
body.modern-hand-subpicker .layout{
  border-left:0!important;border-right:0!important;
}
body.team-planning .layout::after,
body.modern-hand-subpicker .layout::after{
  background:none!important;
}
body.team-planning .team-column .fighter-card,
body.modern-hand-subpicker .team-column .fighter-card{
  background:rgba(10,13,18,.57)!important;
  box-shadow:none!important;
  backdrop-filter:blur(2px);
}
/* Effects remain legible, but take fewer rows and stop swallowing the roster. */
.team-column .fighter-card .effect-chip,
.team-column .fighter-card .effect-chip.effect-description,
.team-column .fighter-card .effect-chip.effect-advantage{
  font-size:10px!important;
  line-height:1.28!important;
  padding:3px 5px!important;
  overflow-wrap:normal;
  word-break:normal;
  hyphens:none;
}
.team-column .effects{gap:4px;margin-top:6px;}
/* Keep the same horizontal center and hand geometry. Less surface padding
   means the 7-card grid never intrudes into either roster. */
@media(min-width:1200px){
  body.team-planning:not(.battlefield-targeting) #promptPanel,
  body.modern-hand-subpicker:not(.battlefield-targeting) #promptPanel{
    width:min(1320px,calc(100% - 8px))!important;
    max-width:calc(100% - 8px)!important;
  }
  body.team-planning:not(.battlefield-targeting) #promptPanel .prompt-body,
  body.modern-hand-subpicker:not(.battlefield-targeting) #promptPanel .prompt-body{
    padding-left:2px!important;padding-right:2px!important;
  }
}


/* V0.29.22 PREVIEW CANDIDATE — compact, horizontal player identity cards.
   Battle hand and center column are deliberately NOT modified. Only side
   fighter/title cards change. Name stays above class/level/mana/toggle. */
.team-column .team-stack{gap:7px;}
body.team-planning .team-column .fighter-card,
body.modern-hand-subpicker .team-column .fighter-card,
.team-column .fighter-card{
  padding:7px 8px 8px;
  border-radius:11px;
  background:linear-gradient(155deg,rgba(39,41,50,.94),rgba(22,24,32,.96))!important;
  border:1px solid rgba(157,165,181,.25);
  box-shadow:0 3px 12px rgba(0,0,0,.20)!important;
  backdrop-filter:none;
}
.team-column .fighter-card::before{border-radius:11px 0 0 11px;width:3px;}
.team-column .fighter-head{display:grid;grid-template-columns:25px minmax(0,1fr);gap:2px 6px;align-items:center;}
.team-column .fighter-icon{grid-column:1;grid-row:1;width:25px;height:25px;font-size:15px;border-radius:6px;}
.team-column .fighter-title{grid-column:2;grid-row:1;min-width:0;align-self:center;}
.team-column .fighter-name{font-size:14px;line-height:1.15;}
.team-column .fighter-name.name-long{font-size:12.5px;}
.team-column .fighter-name.name-very-long{font-size:11.5px;}
.team-column .fighter-name.name-extreme{font-size:10.5px;}
.team-column .fighter-meta-line{grid-column:1/-1;grid-row:2;display:flex;align-items:center;gap:3px;margin-top:0;flex-wrap:nowrap;min-width:0;width:100%;}
.team-column .fighter-class{flex:1 1 auto;min-width:0;max-width:none;font-size:10px;line-height:1.15;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.team-column .fighter-level{flex:0 0 auto;font-size:10px;line-height:1.15;}
.team-column .fighter-meta-line .fighter-head-actions{display:flex;align-items:center;justify-content:flex-end;flex:0 0 auto;gap:3px;margin-left:auto;min-width:0;}
.team-column .mana-chip{font-size:10px;line-height:1.15;padding:2px 4px;}
.team-column .fighter-stat-toggle{height:19px;width:19px;min-width:19px;font-size:11px;border-radius:5px;flex:0 0 auto;}
.team-column .bar{height:16px;margin-top:5px;border-radius:5px;}
.team-column .bar-text{font-size:10px;}
.team-column .effects{gap:3px;margin-top:4px;}
.team-column .fighter-card .effect-chip,
.team-column .fighter-card .effect-chip.effect-description,
.team-column .fighter-card .effect-chip.effect-advantage{
  padding:2px 4px!important;
  font-size:10px!important;
  line-height:1.2!important;
  white-space:normal;
  overflow-wrap:break-word;
  word-break:normal;
}
.team-column .summons{margin-top:3px;gap:3px;}


/* V0.29.22 refined preview — restore familiar name/mana arrow top row,
   class + level adjacent below. Keep the short 188px side cards and leave
   seven combat cards and battlefield layout unmodified. */
.team-column .fighter-head{
  display:grid;
  grid-template-columns:24px minmax(0,1fr) max-content;
  grid-template-rows:minmax(23px,auto) auto;
  gap:1px 5px;
  align-items:center;
}
.team-column .fighter-icon{grid-column:1;grid-row:1;width:24px;height:24px;font-size:15px;}
.team-column .fighter-title{grid-column:2;grid-row:1;min-width:0;}
.team-column .fighter-name{display:block;font-size:13.5px;line-height:1.15;}
.team-column .fighter-meta-line{
  grid-column:2/-1;grid-row:2;
  display:flex;align-items:center;justify-content:flex-start;
  gap:4px;margin-top:0;min-width:0;width:auto;
}
.team-column .fighter-class{flex:0 1 auto;max-width:calc(100% - 34px);font-size:10px;line-height:1.2;}
.team-column .fighter-level{flex:0 0 auto;font-size:10px;line-height:1.2;}
.team-column .fighter-head > .fighter-head-actions{
  grid-column:3;grid-row:1;display:flex;align-items:center;
  justify-content:flex-end;gap:3px;margin-left:0;min-width:0;
}
.team-column .fighter-head > .fighter-head-actions .mana-chip{
  font-size:10px;padding:2px 3px;line-height:1.2;
}
.team-column .fighter-head > .fighter-head-actions .fighter-stat-toggle{
  width:18px;height:19px;min-width:18px;font-size:11px;
}


/* Compact Realm Walker header: class name is already printed, so omit
   the redundant shield/orb icons and give their width back to the name.
   Only battle-side roster UI; no change to the playable seven-card hand. */
.team-column .fighter-icon{display:none!important;}
.team-column .fighter-head{
  grid-template-columns:minmax(0,1fr) max-content;
  grid-template-rows:minmax(23px,auto) auto;
  column-gap:4px;
}
.team-column .fighter-title{grid-column:1;grid-row:1;}
.team-column .fighter-head > .fighter-head-actions{grid-column:2;grid-row:1;}
.team-column .fighter-meta-line{grid-column:1/-1;grid-row:2;}


/* V0.29.22 approval preview: exact 2-row side-card header.
   Row 1: name | mana + dropdown. Row 2: Lv. 1 Paladin.
   Allegiance stripe gets its color from app.js, never class color.
   Preserve the seven playable cards and the live rolling stats. */
.team-column .fighter-head{grid-template-columns:minmax(0,1fr) max-content;column-gap:4px;}
.team-column .fighter-title{grid-column:1;grid-row:1;}
.team-column .fighter-head > .fighter-head-actions{grid-column:2;grid-row:1;}
.team-column .fighter-meta-line{grid-column:1/-1;grid-row:2;gap:4px;}
.team-column .fighter-meta-line .fighter-level{order:0;font-size:10px;}
.team-column .fighter-meta-line .fighter-class{order:1;flex:0 1 auto;min-width:0;max-width:100%;font-size:10px;}
.team-column .fighter-icon{display:none!important;}
/* Match Log is removed from the visible battle page; keep the raw-feed DOM
   so existing battle log processing does not throw or impact live match stats. */
.raw-log-wrap{display:none!important;}


/* V0.29.23 — fixed arena perimeter and stable combat profile cards.
   Remove background side rails. Never change roster dimensions when planning,
   animating, targeting or waiting: the two columns are constant across phases. */
.layout{border-left:0!important;border-right:0!important;box-shadow:none!important;}
.layout::after{background:transparent!important;}
@media (min-width:1200px){
  .layout,
  body.team-planning .layout,
  body.team-resolving .layout,
  body.modern-hand-subpicker .layout,
  body.battlefield-targeting .layout{
    grid-template-columns:minmax(150px,188px) minmax(0,1fr) minmax(150px,188px)!important;
    gap:8px!important;
  }
}
@media (min-width:851px) and (max-width:1199px){
  .layout,
  body.team-planning .layout,
  body.team-resolving .layout,
  body.modern-hand-subpicker .layout,
  body.battlefield-targeting .layout{
    grid-template-columns:minmax(145px,170px) minmax(0,1fr) minmax(145px,170px)!important;
    gap:7px!important;
  }
}
/* Preserve the approved two-row title-card layout in ALL gameplay phases. */
.team-column .fighter-card,
body.team-planning .team-column .fighter-card,
body.team-resolving .team-column .fighter-card,
body.modern-hand-subpicker .team-column .fighter-card{
  box-sizing:border-box;
  width:100%;
  min-width:0;
  min-height:112px;
  padding:7px 8px 8px!important;
  background:linear-gradient(155deg,rgba(39,41,50,.94),rgba(22,24,32,.96))!important;
  border:1px solid rgba(157,165,181,.25)!important;
  border-radius:11px!important;
  box-shadow:0 3px 12px rgba(0,0,0,.20)!important;
  backdrop-filter:none!important;
}
/* Waiting is a small message, not another huge full-width card. */
body.team-planning #promptPanel.waiting-for-players{
  width:min(360px,calc(100% - 32px))!important;
  min-height:0!important;
  max-height:90px!important;
  border:0!important;
  background:rgba(24,26,34,.85)!important;
  border-radius:9px!important;
  box-shadow:none!important;
}
body.team-planning #promptPanel.waiting-for-players .prompt-body{padding:13px!important;min-height:0!important;}
.team-plan-waiting-message{text-align:center;font-size:14px;font-weight:750;letter-spacing:.015em;color:#e5d9fa;white-space:nowrap;}

/* Keep the entire arena x-coordinate and padding stable as phases switch.
   Planning previously used 14px/1840px while resolving used 20px/1680px. */
.layout,
body.team-planning .layout,
body.team-resolving .layout,
body.modern-hand-subpicker .layout,
body.battlefield-targeting .layout{
  padding-left:14px!important;
  padding-right:14px!important;
  max-width:1840px!important;
}
.layout::after,
body.team-planning .layout::after,
body.team-resolving .layout::after,
body.modern-hand-subpicker .layout::after,
body.battlefield-targeting .layout::after{
  background:none!important;
}

/* V0.29.24 — actual full-bleed combat background, not just a hidden
   overlay. The old 1840px max-width left dark vertical bars at 1920px.
   Widen only the arena container, NOT the playable seven-card dimensions. */
.layout,
body.team-planning .layout,
body.team-resolving .layout,
body.modern-hand-subpicker .layout,
body.battlefield-targeting .layout{
  max-width:none!important;
  width:100%!important;
  margin-left:0!important;
  margin-right:0!important;
  box-sizing:border-box!important;
  border-left:none!important;
  border-right:none!important;
}
.layout::after,
body.team-planning .layout::after,
body.team-resolving .layout::after,
body.modern-hand-subpicker .layout::after,
body.battlefield-targeting .layout::after{
  display:none!important;
  content:none!important;
}
/* An empty effect container must not reserve the height of a full buff list.
   Preserve the approved name/mana/class/level header and HP bar, allowing
   only actual effects and summons to increase height. */
.team-column .fighter-card,
body.team-planning .team-column .fighter-card,
body.team-resolving .team-column .fighter-card,
body.modern-hand-subpicker .team-column .fighter-card{
  min-height:0!important;
  height:auto!important;
}
.team-column .fighter-card .effects:empty{
  display:none!important;
  margin:0!important;
  padding:0!important;
}

/* Revive-wait copy must wrap without changing the seven-card hand. */
.team-plan-waiting-message.downed-waiting{white-space:normal;max-width:100%;overflow-wrap:normal;}

/* V0.29.25 — actual game roster: previously the mock preview hid how small
   the live 10px metadata and ~98px name were in the 188px columns. Render
   one consistent readable card in all phases without changing card-hand CSS. */
@media(min-width:1400px){
  .layout,body.team-planning .layout,body.team-resolving .layout,
  body.modern-hand-subpicker .layout,body.battlefield-targeting .layout{
    grid-template-columns:204px minmax(0,1fr) 204px!important;
  }
}
.team-column .team-stack{gap:8px!important;}
.team-column .fighter-card,
body.team-planning .team-column .fighter-card,
body.team-resolving .team-column .fighter-card,
body.modern-hand-subpicker .team-column .fighter-card{
  padding:9px 10px 9px!important;
  min-height:0!important;
  height:auto!important;
  background:linear-gradient(155deg,rgba(41,44,53,.96),rgba(23,26,34,.97))!important;
  border:1px solid rgba(167,177,195,.34)!important;
  border-radius:11px!important;
}
.team-column .fighter-head{grid-template-columns:minmax(0,1fr) max-content!important;grid-template-rows:23px 15px!important;column-gap:5px;row-gap:2px;align-items:center;}
.team-column .fighter-title{grid-column:1!important;grid-row:1!important;min-width:0;}
.team-column .fighter-name{font-size:14.5px!important;font-weight:800;line-height:1.22;}
.team-column .fighter-name.name-long{font-size:13px!important;}
.team-column .fighter-name.name-very-long{font-size:11.5px!important;}
.team-column .fighter-name.name-extreme{font-size:10.5px!important;}
.team-column .fighter-head > .fighter-head-actions{grid-column:2!important;grid-row:1!important;gap:3px;}
.team-column .fighter-head > .fighter-head-actions .mana-chip{font-size:10.5px!important;padding:3px 4px!important;}
.team-column .fighter-head > .fighter-head-actions .fighter-stat-toggle{width:19px!important;height:21px!important;min-width:19px!important;}
.team-column .fighter-meta-line{grid-column:1/-1!important;grid-row:2!important;display:flex!important;align-items:center!important;gap:5px!important;}
.team-column .fighter-meta-line .fighter-level{font-size:11px!important;line-height:1.2!important;}
.team-column .fighter-meta-line .fighter-class{font-size:11px!important;line-height:1.2!important;}
.team-column .bar{height:19px!important;margin-top:7px!important;}
.team-column .bar-text{font-size:10.5px!important;}
.team-column .effects:empty,.team-column .summons:empty{display:none!important;margin:0!important;padding:0!important;}
.team-column .effects:not(:empty){margin-top:6px!important;}
.team-column .fighter-card .effect-chip{font-size:10.5px!important;line-height:1.26!important;padding:4px 5px!important;}


/* V0.29.26 — Roomier combat player title cards, with zero change to the
   center seven-card lane. Reclaim the 14px edge padding and 6px of each
   column gap for the side cards rather than shrinking the playable cards.
   The center lane starts/ends at the same x-coordinates as V0.29.25. */
@media (min-width:1400px){
  .layout, body.team-planning .layout, body.team-resolving .layout,
  body.modern-hand-subpicker .layout, body.battlefield-targeting .layout{
    grid-template-columns:224px minmax(0,1fr) 224px!important;
    column-gap:2px!important;
    padding-left:0!important;padding-right:0!important;
  }
}
@media (min-width:1200px) and (max-width:1399px){
  .layout, body.team-planning .layout, body.team-resolving .layout,
  body.modern-hand-subpicker .layout, body.battlefield-targeting .layout{
    grid-template-columns:208px minmax(0,1fr) 208px!important;
    column-gap:2px!important;
    padding-left:0!important;padding-right:0!important;
  }
}
@media (min-width:851px) and (max-width:1199px){
  .layout, body.team-planning .layout, body.team-resolving .layout,
  body.modern-hand-subpicker .layout, body.battlefield-targeting .layout{
    grid-template-columns:190px minmax(0,1fr) 190px!important;
    column-gap:1px!important;
    padding-left:0!important;padding-right:0!important;
  }
}
/* Keep the approved compact two-row header and HP/effects auto height. */
.team-column .fighter-card{margin:0 2px!important;}


/* V0.29.26 — Realm Walker creation: dedicated Back navigation, no leftover
   Home party lines/footers at the top, and a centered primary action. */
body.character-creating .home-party-band,
body.character-creating .character-hall-foot,
body.character-creating #characterHallMessage:empty{display:none!important;}
body.character-creating .character-hall{margin-top:0!important;}
body.character-creating .creation-page-head{
  display:flex;align-items:center;justify-content:flex-end;
  margin:0 0 18px;padding:12px 20px 13px;
  border-bottom:1px solid rgba(195,157,225,.27);
}
body.character-creating .creation-back-button{
  min-height:42px;padding:9px 21px;font-size:18px;
}
body.character-creating .creation-footer{
  display:flex;flex-direction:column;align-items:center;
  justify-content:center!important;gap:10px;
  margin-top:25px;text-align:center;
}
body.character-creating .creation-footer .hall-error{
  width:100%;flex:none!important;text-align:center;
}
body.character-creating .creation-footer .hall-error:empty{display:none;}
body.character-creating #submitNewCharacter{
  display:block;margin:0 auto;min-width:228px;
}


/* V0.29.28 — Home party controls mirror Inventory: square add and a red
   remove drop zone revealed only while dragging a numbered party chip. */
body.mode-selecting .home-party-summary{position:relative;display:flex;align-items:center;gap:9px;flex-wrap:wrap;}
body.mode-selecting .home-party-add-square,
body.mode-selecting .home-party-remove-drop{
  flex:0 0 38px;width:38px;height:38px;display:grid;place-items:center;
  box-sizing:border-box;border:2px solid #050408;border-radius:0;
  font:900 25px/1 system-ui,sans-serif;
}
body.mode-selecting .home-party-add-square{background:#273c2c;color:#aef6c2;cursor:pointer;}
body.mode-selecting .home-party-add-square:hover,
body.mode-selecting .home-party-add-square:focus-visible{outline:2px solid #b2ffd2;outline-offset:2px;}
body.mode-selecting .home-party-remove-drop{background:#b5233c;color:#fff;}
body.mode-selecting .home-party-remove-drop.hidden{display:none!important;}
body.mode-selecting .home-party-dragging .home-party-remove-drop{animation:inventory-party-remove-pulse 1s ease-in-out infinite alternate;}
body.mode-selecting .home-party-remove-drop.party-chip-drop-target{outline:3px solid #f9dc8f;outline-offset:2px;}
body.mode-selecting .home-party-picker{flex:0 0 100%;display:grid;grid-template-columns:repeat(auto-fit,minmax(155px,1fr));gap:7px;
  padding:9px;border:1px solid rgba(193,147,225,.5);border-radius:9px;background:rgba(20,15,31,.92);}
body.mode-selecting .home-party-pick{display:flex;flex-direction:column;align-items:flex-start;gap:3px;
  min-width:0;padding:9px 11px;border:1px solid rgba(169,135,213,.43);border-radius:7px;
  color:#f6eafd;background:#2b213b;cursor:pointer;text-align:left;font:13px/1.3 system-ui,sans-serif;}
body.mode-selecting .home-party-pick:hover,body.mode-selecting .home-party-pick:focus-visible{background:#48325c;border-color:#e7c3ff;}
body.mode-selecting .home-party-pick span{font-size:11px;color:#cdbddc;}
/* The Add/Remove row buttons are gone, so roster text takes the full width. */
body.mode-selecting .character-roster-card{grid-template-columns:67px minmax(0,1fr);}
body.mode-selecting .character-roster-card .character-roster-text{grid-column:2;}
body.mode-selecting .character-roster-card .roster-meta-class{white-space:nowrap;}
@media(max-width:710px){body.mode-selecting .character-roster-card{grid-template-columns:58px minmax(0,1fr);}}
/* Restore an intentional inset for the edge roster cards while retaining the
   exact same center/hand geometry and full-bleed battlefield background. */
@media(min-width:1400px){
 .layout,body.team-planning .layout,body.team-resolving .layout,
 body.modern-hand-subpicker .layout,body.battlefield-targeting .layout{
   padding-left:10px!important;padding-right:10px!important;
   grid-template-columns:214px minmax(0,1fr) 214px!important;
 }
}
@media(min-width:1200px) and (max-width:1399px){
 .layout,body.team-planning .layout,body.team-resolving .layout,
 body.modern-hand-subpicker .layout,body.battlefield-targeting .layout{
   padding-left:10px!important;padding-right:10px!important;
   grid-template-columns:198px minmax(0,1fr) 198px!important;
 }
}
@media(min-width:851px) and (max-width:1199px){
 .layout,body.team-planning .layout,body.team-resolving .layout,
 body.modern-hand-subpicker .layout,body.battlefield-targeting .layout{
   padding-left:8px!important;padding-right:8px!important;
   grid-template-columns:182px minmax(0,1fr) 182px!important;
 }
}

/* V0.29.28 — evade feedback is a small impact-timed floating combat number. */
body .battle-damage-float.missed,
body .battle-damage-float.critical{
 --rf-float-fill:#f5dc78;--rf-float-outline:#594212;
 font-size:clamp(17px,1.5vw,22px)!important;
 -webkit-text-stroke:1px var(--rf-float-outline)!important;
 letter-spacing:.015em!important;
}
body .combat-callout-missed,
body .combat-callout-critical{
 font-size:clamp(18px,1.6vw,25px)!important;
 -webkit-text-stroke:1px #594212!important;
}
/* Separate class/level from inventory numbers without an extra dot glyph. */
body.mode-selecting .character-roster-card .roster-meta-line{column-gap:9px;}

/* V0.29.32: gear emblems are standalone SVG artwork, not new card backgrounds.
   Keep existing rarity-colored SQUARES and all square-level hover/drag logic. */
.aldric-item-circle:has(> .rf-gear-emblem),
.inventory-screen .aldric-item-circle:has(> .rf-gear-emblem) {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  overflow: visible;
}
.aldric-item-circle > .rf-gear-emblem {
  display: block;
  height: 94%;
  width: 94%;
  max-height: 66px;
  max-width: 66px;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.65));
}
.aldric-item-circle:has(> .rf-gear-emblem):focus-visible {
  outline: 2px solid #e5c07c;
  outline-offset: 2px;
}


/* V0.29.34 UI polish. Gear emblem palettes are embedded in the item SVG,
   independent of rarity; leave existing rarity squares/borders untouched. */
.aldric-item-circle > .rf-gear-emblem{
  width:120%!important;height:120%!important;
  max-width:none!important;max-height:none!important;
  flex:0 0 auto;object-fit:contain;
}
/* Item inspection and merchant comparisons: bring the value directly beside
   the label rather than spreading both across the full tooltip width. */
.aldric-stat-list .aldric-stat,
.inventory-gear-floating .aldric-stat,
.merchant-comparison .aldric-stat{
  justify-content:flex-start!important;gap:8px!important;
}
.aldric-stat-list .aldric-stat > span{flex:0 1 auto;width:auto!important;}
.aldric-stat-list .aldric-stat > strong{flex:0 0 auto;margin-left:0!important;}
/* The seven playable card positions stay unchanged; only the upper team title
   cards extend slightly into unused inner space. */
@media(min-width:1200px){
 .layout > .team-column:nth-of-type(1) .fighter-card{
   width:calc(100% + 8px)!important;max-width:none!important;
 }
 .layout > .team-column:nth-of-type(3) .fighter-card{
   width:calc(100% + 8px)!important;max-width:none!important;
   margin-left:-6px!important;
 }
}
@media(min-width:851px) and (max-width:1199px){
 .layout > .team-column:nth-of-type(1) .fighter-card{width:calc(100% + 5px)!important;max-width:none!important;}
 .layout > .team-column:nth-of-type(3) .fighter-card{width:calc(100% + 5px)!important;max-width:none!important;margin-left:-3px!important;}
}

/* V0.29.34: Unequipped inventory drag-to-swap target. No extra boxes at rest. */
.inventory-screen .inventory-bag-row.inventory-swap-target .inventory-bag-icon{
  outline:2px solid #cdb3f8;
  outline-offset:3px;
  box-shadow:0 0 0 3px rgba(90,50,149,.25),0 0 16px rgba(201,166,255,.55);
}

/* Card choices: two unlockable cards, selected through the account-owned API. */
/* V0.29.37: card artwork conveys the card itself; selection uses only two square checkboxes. */
.realm-card-unlock-overlay{position:fixed;inset:0;z-index:200000;display:flex;align-items:center;justify-content:center;background:rgba(4,2,13,.87);padding:22px;overflow-y:auto}
.realm-card-unlock-panel{width:min(650px,96vw);max-height:94vh;overflow-y:auto;padding:24px;background:linear-gradient(150deg,#20112c,#100a1f);border:2px solid #72539e;border-radius:14px;box-shadow:0 20px 70px #07030b;color:#fff;text-align:center}
.realm-card-unlock-panel h2{margin:0 0 6px;font-size:26px;color:#f7ebff}
.realm-card-unlock-panel p{margin:6px 0 18px;color:#d8c5ee}
.realm-card-unlock-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.realm-card-unlock-option{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;padding:16px 10px 13px;background:transparent;color:#fff;border:0;border-radius:0;cursor:pointer;text-align:center;font:inherit;transition:none}
.realm-card-unlock-option:hover,.realm-card-unlock-option:focus-visible{background:transparent;outline:none}
.realm-card-unlock-option.selected{background:transparent;box-shadow:none}
.realm-card-unlock-option:disabled{cursor:wait;opacity:.75}
.realm-card-unlock-checkbox{display:flex;align-items:center;justify-content:center;width:32px;height:32px;min-height:32px;border:2px solid #c5addf;border-radius:3px;background:#0c0816;color:#fff;font-size:26px;line-height:1;font-weight:900}
.realm-card-unlock-option.selected .realm-card-unlock-checkbox{background:#71439d;border-color:#efe0ff}
.realm-card-unlock-face{position:relative;width:152px;height:219px;overflow:hidden;border:0;border-radius:0;background:transparent}
.realm-card-unlock-fallback{display:flex;align-items:center;justify-content:center;height:100%;padding:8px;color:#eadbff;font-weight:700;text-align:center}.realm-card-unlock-face .realm-card-frame{position:absolute;inset:0;width:330px;height:475px;transform:scale(.46);transform-origin:top left;border:0;pointer-events:none}
.realm-card-unlock-panel .realm-card-unlock-hint{font-size:13px;margin:18px 0 14px}
.realm-card-unlock-footer{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:8px}
.realm-card-unlock-learn{min-width:160px}
.realm-card-unlock-learn:disabled{opacity:.48;cursor:not-allowed}
.realm-card-unlock-feedback{font-size:13px;color:#ffbaca}
.realm-card-unlock-feedback:empty{display:none}
/* Learned-card confirmation uses the real card face, centered, and a single Okay button. */
.realm-card-learned-panel{display:flex;flex-direction:column;align-items:center;gap:17px;width:min(520px,96vw)}
.realm-card-learned-panel h2{max-width:460px;font-size:25px;line-height:1.22;margin:0}
.realm-card-learned-face{position:relative;flex:none;width:196px;height:283px;overflow:hidden;border:0;border-radius:0;background:transparent}
.realm-card-learned-face .realm-card-frame{position:absolute;inset:0;width:330px;height:475px;transform:scale(.594);transform-origin:top left;border:0;pointer-events:none}
.realm-card-learned-exit{min-width:160px}
@media(max-width:550px){.realm-card-learned-panel{gap:12px}.realm-card-learned-panel h2{font-size:21px}.realm-card-learned-face{width:152px;height:219px}.realm-card-learned-face .realm-card-frame{transform:scale(.46)}}
@media(max-width:550px){.realm-card-unlock-overlay{padding:9px}.realm-card-unlock-panel{padding:12px}.realm-card-unlock-options{gap:8px}.realm-card-unlock-option{padding:8px 4px;gap:9px}.realm-card-unlock-face{width:115px;height:166px}.realm-card-unlock-face .realm-card-frame{transform:scale(.3485)}}

/* V0.29.35 — Give the combat name cards a little extra room, without
   changing the battlefield grid tracks or any of the seven playable cards. */
@media(min-width:1200px){
  .layout > .team-column:nth-of-type(1) .fighter-card{
    width:calc(100% + 16px)!important;
  }
  .layout > .team-column:nth-of-type(3) .fighter-card{
    width:calc(100% + 16px)!important;
    margin-left:-14px!important;
  }
}
@media(min-width:851px) and (max-width:1199px){
  .layout > .team-column:nth-of-type(1) .fighter-card{
    width:calc(100% + 10px)!important;
  }
  .layout > .team-column:nth-of-type(3) .fighter-card{
    width:calc(100% + 10px)!important;
    margin-left:-8px!important;
  }
}

/* Dedicated RealmFall desert confirmation. No native browser popup. */
.combat-desert-modal{
  position:fixed;inset:0;z-index:4000;
  display:grid;place-items:center;padding:16px;
  background:rgba(5,5,12,.80);backdrop-filter:blur(7px);
}
.combat-desert-modal.hidden{display:none!important;}
.combat-desert-panel{
  box-sizing:border-box;width:min(430px,100%);padding:24px;
  text-align:center;background:linear-gradient(155deg,#23202e,#0e1019);
  border:1px solid rgba(192,132,252,.47);border-radius:13px;
  box-shadow:0 24px 80px rgba(0,0,0,.7);
}
.combat-desert-panel h2{
  margin:0 0 8px;color:#f3e8ff;
  font:normal 29px/1.2 "IM Fell English SC",Georgia,serif;
}
.combat-desert-panel p{margin:0 0 24px;color:#d6c7e4;font-size:14px;line-height:1.4;}
.combat-desert-actions{display:flex;gap:12px;justify-content:center;}
.combat-desert-actions .mode-button{
  flex:1 1 0;min-height:43px;border:1px solid #000!important;border-radius:0!important;
  font:normal 18px/1.1 "IM Fell English SC",Georgia,serif;cursor:pointer;
}
.combat-desert-stay{background:#452c61!important;color:#fff!important;}
.combat-desert-stay:hover,.combat-desert-stay:focus-visible{background:#624180!important;}
.combat-desert-confirm{background:#7b2938!important;color:#fff!important;}
.combat-desert-confirm:hover,.combat-desert-confirm:focus-visible{background:#a0364c!important;}
.combat-desert-actions .mode-button:focus-visible{outline:2px solid #e9d5ff;outline-offset:2px;}



/* V0.29.42: chronological, three-across progression; locked cards are grayscale. */
.realm-progression-events{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;align-items:stretch}
.realm-progression-events>.realm-progression-stage{min-height:219px;padding:12px 7px;background:#1a1229;border:1px solid #6b4c83;border-radius:9px;justify-content:flex-start}
.realm-progression-events>.realm-progression-stage.is-next{border-color:#e5bf71;box-shadow:0 0 0 1px #e5bf71,0 0 12px rgba(229,191,113,.1)}
.realm-progression-events .realm-progression-card-pair{gap:10px;width:100%;align-items:flex-start}
.realm-progression-events .realm-progression-card{background:#140d24}
.realm-progression-events .realm-progression-card.is-locked .realm-progression-art{filter:grayscale(1) brightness(.58);opacity:.8}
.realm-progression-events .realm-progression-card.is-locked{border-color:#403a4d;background:#14111d}
.realm-progression-events .realm-progression-hidden-card{filter:grayscale(1);opacity:.73}
.realm-progression-events .realm-progression-stage.is-locked-level .realm-progression-level{color:#a99aaf}
@media(max-width:900px){.realm-progression-events{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}}
@media(max-width:580px){.realm-progression-events{grid-template-columns:1fr}.realm-progression-events>.realm-progression-stage{min-height:180px}}
/* V0.29.41: minimal bracket tree; card artwork contains all card text. */
.inventory-card-actions{display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap}
.inventory-screen .inventory-card-actions .mode-button{min-height:35px;font-size:12px;padding:6px 12px;white-space:nowrap}
.realm-progression-overlay{position:fixed;inset:0;z-index:210000;background:rgba(5,3,14,.94);display:flex;justify-content:center;align-items:center;padding:12px;color:#fff}
.realm-progression-panel{display:flex;flex-direction:column;width:min(1140px,100%);height:min(94vh,1050px);min-height:0;overflow:hidden;border:2px solid #765399;border-radius:12px;background:linear-gradient(140deg,#21132e,#110c1e 70%);box-shadow:0 20px 65px #07030b}
.realm-progression-header{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:16px 22px;border-bottom:1px solid #6a4b88;flex:0 0 auto}
.realm-progression-header h2{margin:0;font-size:25px;color:#f5ebff}
.realm-progression-subtitle{margin:3px 0 0;color:#dac8ed;font-size:13px}
.realm-progression-body{overflow-y:auto;overscroll-behavior:contain;padding:20px 19px 30px;min-height:0}
.realm-progression-branches{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;align-items:stretch}
.realm-progression-branch{padding:14px 11px 16px;border:1px solid #574071;border-radius:8px;background:#130c24;min-width:0}
.realm-progression-branch-title{text-align:center;margin-bottom:10px;font-size:17px;color:#f4d9ff;font-weight:800;letter-spacing:.025em}
.realm-progression-fork{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;align-items:stretch}
.realm-progression-stage{padding:10px 5px 12px;border:1px solid #523963;border-radius:7px;min-width:0;text-align:center;background:#201331;display:flex;flex-direction:column;justify-content:flex-start;align-items:center}
.realm-progression-stage.is-next{border-color:#efcb79;box-shadow:inset 0 0 0 1px #efcb79}
.realm-progression-level{font-weight:800;font-size:15px;color:#f4d9ff;margin-bottom:10px;text-align:center}
.realm-progression-card-pair{display:flex;justify-content:center;align-items:flex-start;gap:7px;flex-wrap:nowrap;max-width:100%}
.realm-progression-card{min-width:0;position:relative;display:flex;flex-direction:column;align-items:center;padding:4px;border-radius:5px;border:1px solid #533b72;background:#150d27}
.realm-progression-card.is-learned{border-color:#8fcda6;background:#1d2730}
.realm-progression-card.is-chosen{border-color:#e6bcff;box-shadow:0 0 0 1px #ab80ce}
.realm-progression-art{position:relative;width:101px;height:146px;overflow:hidden;border-radius:3px;border:1px solid #9573b6;background:#0f071c;flex:0 0 auto}
.realm-progression-art iframe{position:absolute;top:0;left:0;width:330px;height:475px;transform:scale(.306);transform-origin:top left;border:0;pointer-events:none}
.realm-progression-card.is-future .realm-progression-art{filter:saturate(.73);opacity:.85}
.realm-progression-card-check{position:absolute;top:0;right:0;width:22px;height:22px;display:grid;place-items:center;border-radius:0 3px 0 6px;color:#081b11;background:#abe9bd;font:bold 16px Arial,sans-serif;box-shadow:0 1px 8px #07030b}
.realm-progression-no-art{display:flex;align-items:center;justify-content:center;height:100%;padding:6px;font-size:11px}
.realm-progression-hidden-card{display:grid;place-items:center;width:101px;height:146px;background:repeating-linear-gradient(135deg,#281936,#281936 9px,#302042 9px,#302042 18px);border:1px dashed #6a5184;border-radius:5px;color:#8a709d;font:bold 30px Arial,sans-serif}
.realm-progression-join{height:28px;position:relative;margin:0 24%}
.realm-progression-join:before{content:'';position:absolute;left:0;right:0;top:12px;border-top:2px solid #967db6}
.realm-progression-join:after{content:'';position:absolute;left:50%;top:12px;height:16px;border-left:2px solid #967db6}
.realm-progression-return{display:flex;justify-content:center;align-items:center}
.realm-progression-return>.realm-progression-stage{width:min(270px,100%)}
.realm-progression-endgame{margin-top:22px;padding-top:22px;border-top:1px solid #61437c;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.realm-progression-endgame>.realm-progression-stage{min-height:205px;justify-content:flex-start}
@media(max-width:900px){.realm-progression-branches,.realm-progression-endgame{grid-template-columns:1fr}.realm-progression-body{padding:12px}.realm-progression-art,.realm-progression-hidden-card{width:91px;height:132px}.realm-progression-art iframe{transform:scale(.275)}}
@media(max-width:480px){.realm-progression-overlay{padding:3px}.realm-progression-panel{height:99vh;border-radius:5px}.realm-progression-header{padding:11px}.realm-progression-header h2{font-size:20px}.realm-progression-header .mode-button{font-size:12px;padding:7px 12px}.realm-progression-branch{padding:8px 4px}.realm-progression-stage{padding:7px 2px}.realm-progression-fork{gap:5px}.realm-progression-art,.realm-progression-hidden-card{width:72px;height:104px}.realm-progression-art iframe{transform:scale(.218)}.realm-progression-card{padding:3px}.realm-progression-card-pair{gap:3px}.realm-progression-level{font-size:12px}.realm-progression-branch-title{font-size:14px}}


/* V0.29.43 — Progression only: six battle-sized cards across three level tiles.
   Match the battle hand's viewport scale steps without touching ANY battle CSS.
   Keep the previous 2/1-column layout and card sizing on phones/tablets. */
@media (min-width:901px){
  .realm-progression-overlay { --rf-progression-card-scale: .31; padding:10px; }
  .realm-progression-panel {
    width:min(calc(1980px * var(--rf-progression-card-scale) + 168px), calc(100vw - 20px));
    height:min(96vh, 1100px);
  }
  .realm-progression-header { padding:11px 15px; }
  .realm-progression-body { padding:11px 8px 16px; }
  .realm-progression-events { grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
  .realm-progression-events>.realm-progression-stage {
    min-height:0; padding:8px 2px 9px; border-radius:5px;
  }
  .realm-progression-events .realm-progression-level { margin-bottom:6px; }
  .realm-progression-events .realm-progression-card-pair { gap:4px; justify-content:center; }
  .realm-progression-events .realm-progression-card {
    padding:1px; border-width:1px; border-radius:3px;
  }
  .realm-progression-events .realm-progression-art,
  .realm-progression-events .realm-progression-hidden-card {
    width:calc(330px * var(--rf-progression-card-scale));
    height:calc(475px * var(--rf-progression-card-scale));
    flex:0 0 auto; border-radius:3px;
  }
  .realm-progression-events .realm-progression-art iframe {
    transform:scale(var(--rf-progression-card-scale));
    transform-origin:top left;
  }
}
@media (min-width:1280px) and (max-width:1399px){.realm-progression-overlay{--rf-progression-card-scale:.345;}}
@media (min-width:1400px) and (max-width:1499px){.realm-progression-overlay{--rf-progression-card-scale:.40;}}
@media (min-width:1500px) and (max-width:1599px){.realm-progression-overlay{--rf-progression-card-scale:.44;}}
@media (min-width:1600px) and (max-width:1699px){.realm-progression-overlay{--rf-progression-card-scale:.48;}}
@media (min-width:1700px) and (max-width:1799px){.realm-progression-overlay{--rf-progression-card-scale:.51;}}
@media (min-width:1800px){.realm-progression-overlay{--rf-progression-card-scale:.55;}}

/* V0.29.48 — Equipped gear must not shrink relative to unequipped bag gear.
   Keep the same outer icon square and inner emblem size in all Inventory views.
   Does not affect merchants, card art, or the seven-card battle hand. */
.inventory-screen .inventory-equipment-token,
.world-map-inventory-character .inventory-slot .inventory-equipment-token {
  box-sizing: border-box;
  width: 82px;
  height: 82px;
  min-height: 82px;
  flex: 0 0 82px;
  max-width: 100%;
}
.inventory-screen .inventory-equipment-token .aldric-item-circle,
.world-map-inventory-character .inventory-slot .inventory-equipment-token .aldric-item-circle {
  box-sizing: border-box;
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
}
@media (max-width:600px) {
  .inventory-screen .inventory-equipment-token,
  .world-map-inventory-character .inventory-slot .inventory-equipment-token {
    width: 72px;
    height: 72px;
    min-height: 72px;
    flex-basis: 72px;
  }
  .inventory-screen .inventory-equipment-token .aldric-item-circle,
  .world-map-inventory-character .inventory-slot .inventory-equipment-token .aldric-item-circle {
    width: 49px;
    height: 49px;
    flex-basis: 49px;
  }
}

/* V0.29.49 — Add party members directly through glowing roster cards.
   Keep the square green add button brightly outlined until add/cancel. */
body.mode-selecting .home-party-add-square.is-choosing{
  outline:3px solid #b2ffd2;
  outline-offset:2px;
  border-color:#a6f7be;
  box-shadow:0 0 0 3px rgba(99,242,144,.23),0 0 18px rgba(73,245,137,.55);
  background:#1c4b30;
  color:#e4ffed;
}
body.mode-selecting .character-roster-card.party-add-eligible{
  cursor:pointer;
  border-color:#a6f7be;
  outline:2px solid rgba(156,255,195,.87);
  outline-offset:1px;
  box-shadow:0 0 0 2px rgba(83,211,126,.19),0 0 21px rgba(70,224,120,.40),inset 0 0 12px rgba(75,220,124,.10);
  transition:border-color .16s,background .16s,box-shadow .16s,outline-color .16s;
}
body.mode-selecting .character-roster-card.party-add-eligible:hover,
body.mode-selecting .character-roster-card.party-add-eligible:focus-visible{
  outline-color:#e1ffea;
  box-shadow:0 0 0 3px rgba(120,255,171,.50),0 0 30px rgba(65,253,123,.70),inset 0 0 18px rgba(95,238,153,.18);
  background:linear-gradient(125deg,rgba(16,35,26,.93),rgba(39,54,44,.83));
}
body.mode-selecting .home-party-add-square:disabled{
  opacity:.38;cursor:not-allowed;outline:none;box-shadow:none;
}


/* V0.29.49 — Narrow merchant item-stat cards, preserve rarity outline/title
   and match the stat-book's 15 exact colors for stat labels AND values. */
.aldric-item-card .aldric-stat[class*="stat-"]{background:transparent;}
.aldric-item-card .aldric-stat[class*="stat-"] > span,
.aldric-item-card .aldric-stat[class*="stat-"] > strong{
  color:inherit;opacity:1;
}
/* Merchant single-item cards can wrap long names; unused horizontal space
   no longer stretches the item card to the entire comparison popover. */
.aldric-item-node .aldric-item-popover,
.mira-shop:has(#miraTabSell[aria-selected="true"]) .aldric-item-popover {
  box-sizing:border-box;
  width:244px;
  max-width:min(244px,calc(100vw - 24px));
}
.aldric-item-node .aldric-item-popover:has(.merchant-compare-equipped),
.mira-shop:has(#miraTabSell[aria-selected="true"]) .aldric-item-popover:has(.merchant-compare-equipped){
  width:464px;
  max-width:min(464px,calc(100vw - 24px));
}
.aldric-item-popover .aldric-item-card{box-sizing:border-box;width:100%;padding:10px 11px;gap:7px;}
.aldric-item-popover .aldric-item-title strong{overflow-wrap:anywhere;}
.aldric-item-popover .merchant-comparison{gap:9px;}
.aldric-item-popover .aldric-stat{gap:6px!important;padding:4px 1px;}
@media(max-width:600px){
  .aldric-item-node .aldric-item-popover:has(.merchant-compare-equipped),
  .mira-shop:has(#miraTabSell[aria-selected="true"]) .aldric-item-popover:has(.merchant-compare-equipped){
    width:min(360px,calc(100vw - 24px));
  }
}
@media(max-width:550px){
  .aldric-item-node .aldric-item-popover:has(.merchant-compare-equipped),
  .mira-shop:has(#miraTabSell[aria-selected="true"]) .aldric-item-popover:has(.merchant-compare-equipped){
    width:min(260px,calc(100vw - 24px));
  }
}
/* Use the identical hex colors as the stat-book's .stat-* definitions.
   More specific than the old neutral .aldric-stat color rule. */
.aldric-item-card .aldric-stat.stat-health{color:#86efac}
.aldric-item-card .aldric-stat.stat-mana-surge{color:#f4c56a}
.aldric-item-card .aldric-stat.stat-pd{color:#f87171}
.aldric-item-card .aldric-stat.stat-md{color:#c084fc}
.aldric-item-card .aldric-stat.stat-pr{color:#60a5fa}
.aldric-item-card .aldric-stat.stat-mr{color:#38bdf8}
.aldric-item-card .aldric-stat.stat-crit{color:#fb7185}
.aldric-item-card .aldric-stat.stat-cb{color:#a5b4fc}
.aldric-item-card .aldric-stat.stat-ap{color:#f59e0b}
.aldric-item-card .aldric-stat.stat-mp{color:#d97706}
.aldric-item-card .aldric-stat.stat-accuracy{color:#2dd4bf}
.aldric-item-card .aldric-stat.stat-evasion{color:#facc15}
.aldric-item-card .aldric-stat.stat-heal-out{color:#4ade80}
.aldric-item-card .aldric-stat.stat-heal-in{color:#a3e635}
.aldric-item-card .aldric-stat.stat-anti{color:#c084fc}

/* V0.29.50: Keep keyboard focus visible on the square choice control, not around the card face. */
.realm-card-unlock-option:focus-visible .realm-card-unlock-checkbox{outline:2px solid #f2dfff;outline-offset:4px}

/* V0.29.51 — clearer party add state: selected Realm Walkers recede while
   still-eligible characters retain the existing green selection glow. */
body.mode-selecting .home-party-selection-prompt:not([hidden]){
  display:block; margin:1px 0 7px; color:#baffd2;
  font:700 14px/1.25 "IM Fell English SC",Georgia,serif; text-align:center;
}
body.mode-selecting .character-roster-card.party-add-eligible{filter:none;opacity:1;}
/* Only grey selected roster cards while the add box is active. */
body.mode-selecting:has(.home-party-add-square.is-choosing) .character-roster-card.party-selected{
  filter:grayscale(1); opacity:.43; box-shadow:none; outline-color:rgba(128,128,128,.45);
}
body.mode-selecting:not(:has(.home-party-add-square.is-choosing)) .character-roster-card.party-selected{
  filter:none;opacity:1;
}

/* v0.29.53: Show the authoritative, uninterrupted team timer beside the
   character-specific waiting status; do not create another countdown. */
body.team-planning #promptPanel.waiting-for-players{
  width:min(500px,calc(100% - 20px))!important;
  max-height:none!important;
}
body.team-planning #promptPanel.waiting-for-players .prompt-body{
  display:flex!important; align-items:center; justify-content:center; gap:12px!important;
  padding:10px 13px!important; flex-wrap:wrap;
}
body.team-planning #promptPanel.waiting-for-players .team-plan-waiting-message{
  flex:1 1 auto; min-width:0; white-space:normal; overflow-wrap:anywhere;
}
body.team-planning #promptPanel.waiting-for-players .team-plan-waiting-timer{
  flex:0 0 auto; margin:0!important; position:static!important;
  visibility:visible!important; display:flex!important;
}
.team-plan-waiting-dots{display:inline-block; min-width:1.4em; text-align:left}

/* V0.29.54: visible PvE queue beneath stage preview. Battle cards untouched. */
.world-map-party-queue{margin:14px 0 8px;padding:12px 10px;border:1px solid #715586;background:rgba(15,11,26,.6);border-radius:8px;min-width:0}
.world-map-queue-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;color:#eed9ff;font-size:15px}
.world-map-details .world-map-queue-help{font-size:12px;color:#cbb8d7;margin:5px 0 9px;line-height:1.3}
.world-map-queue-list{display:flex;flex-direction:column;gap:5px}
.world-map-queue-row{display:flex;align-items:center;gap:8px;min-width:0;padding:5px 6px;border:1px solid #56416c;background:#21172f;border-radius:5px}
.world-map-queue-row[draggable="true"]{cursor:grab}
.world-map-queue-row[draggable="true"]:active{cursor:grabbing}
.world-map-queue-row.is-drop-target{outline:2px solid #bda0ed}
.world-map-queue-slot{flex:0 0 25px;height:25px;display:grid;place-items:center;border:1px solid #8f71ae;background:#3c2852;border-radius:3px;font-weight:bold;color:#fff}
.world-map-queue-portrait{width:32px;height:35px;object-fit:contain;flex:0 0 auto;pointer-events:none}
.world-map-queue-identity{display:flex;flex-direction:column;min-width:0;flex:1;font-size:13px;color:#fff}
.world-map-queue-identity strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.world-map-queue-identity small{color:#bfb0ce;font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.world-map-queue-controls{display:flex;gap:3px;flex:0 0 auto}
.world-map-queue-controls button{width:27px;height:29px;border:1px solid #8e69ad;border-radius:3px;background:#4b3168;color:#fff;font-size:18px;cursor:pointer}
.world-map-queue-controls button:disabled{opacity:.24;cursor:default}
.world-map-details .world-map-queue-capacity{font-size:11px;color:#e1ce93;margin:8px 0 0;line-height:1.35}
.world-map-queue-empty{font-size:13px;color:#c0acc9;padding:9px 0}

.world-map-queue-controls .world-map-queue-remove{background:#50252f;border-color:#ab6a77;color:#ffe2e2;font-size:20px}


/* V0.29.55 — Shop preview follows each item's title, not the old 570px
   floating-popover default. Comparison cards are measured independently.
   No changes to rarity frames, colors, header, inventory, or battle cards. */
.aldric-item-popover::before,
.merchant-popover-float::before{content:none!important;display:none!important;}
.merchant-popover-float{
  width:max-content!important;
  max-width:calc(100vw - 16px)!important;
  min-width:0!important;
  box-sizing:border-box!important;
}
.merchant-popover-float .merchant-comparison{
  display:flex;
  flex-direction:row;
  gap:9px;
  align-items:stretch;
  width:max-content;
  max-width:100%;
}
.merchant-popover-float .merchant-compare-shop,
.merchant-popover-float .merchant-compare-equipped{
  flex:0 0 auto;
  min-width:0;
  max-width:100%;
}
.merchant-popover-float .merchant-compare-shop{width:var(--rf-shop-col-width,190px);}
.merchant-popover-float .merchant-compare-equipped{width:var(--rf-equipped-col-width,190px);}
.merchant-popover-float .aldric-item-card{width:100%;min-width:0;max-width:none;}
.merchant-popover-float .aldric-stat{flex-wrap:wrap;column-gap:3px!important;}
.merchant-popover-float.merchant-compare-stacked .merchant-comparison{flex-direction:column;}

/* V0.29.56 — stage party slots: numbered drag handles and compact corner X. */
.world-map-party-queue{padding:9px 8px 8px}
.world-map-queue-heading{margin-bottom:8px}
.world-map-queue-row{position:relative;min-height:49px;padding:5px 31px 5px 6px}
.world-map-queue-row[draggable="true"]{cursor:default}
.world-map-queue-row.is-dragging{opacity:.58}
.world-map-queue-slot[role="button"]{cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none}
.world-map-queue-slot[role="button"]:active{cursor:grabbing}
.world-map-queue-slot[role="button"]:focus-visible{outline:2px solid #d9b9fe;outline-offset:2px}
.world-map-queue-remove{position:absolute;right:3px;top:3px;width:22px;height:22px;display:grid;place-items:center;padding:0;background:#59252d;border:1px solid #b76e7d;border-radius:3px;color:transparent;font-size:0;line-height:1;cursor:pointer;position:absolute}
.world-map-queue-remove:disabled{opacity:.28;filter:grayscale(1);cursor:default}
.world-map-queue-row.is-drop-target{outline:2px solid #bda0ed;outline-offset:-2px}

/* V0.29.57: make every VALID turn-order drop slot obvious while dragging.
   The existing green add-character glow is unaffected. */
.home-party-summary.home-party-dragging .home-party-chip:not(.party-chip-dragging) {
  outline:2px solid #71f4a2 !important;
  outline-offset:3px;
  box-shadow:0 0 10px #52f78b, 0 0 18px rgba(68,255,130,.45) !important;
  animation:realmfall-party-drop-glow 1.05s ease-in-out infinite alternate;
}
.home-party-summary.home-party-dragging .home-party-chip.party-chip-drop-target {
  outline:3px solid #c5ffda !important;
  outline-offset:3px;
  box-shadow:0 0 0 2px #348657, 0 0 22px #70ff9c !important;
  animation:none;
}
@keyframes realmfall-party-drop-glow {
  from{filter:brightness(1);}
  to{filter:brightness(1.35);}
}
@media(prefers-reduced-motion:reduce){
  .home-party-summary.home-party-dragging .home-party-chip:not(.party-chip-dragging){animation:none;}
}

/* V0.29.57: compact host-only sidelined party picker on stage details. */
.world-map-queue-add {
  display:grid; place-items:center; width:36px; height:36px; margin:10px auto 0;
  border:2px solid #8ff1a7; border-radius:6px; background:#1f5630;
  color:#eaffed; font:bold 29px/1 Arial,sans-serif; cursor:pointer;
  box-shadow:0 0 9px rgba(76,245,127,.36);
}
.world-map-queue-add.is-active {background:#26783b;box-shadow:0 0 13px rgba(90,255,139,.68)}
.world-map-queue-add-menu {display:flex;flex-direction:column;gap:5px;margin:8px 0 4px;padding:7px;background:#181024;border:1px solid #5e4275;border-radius:6px}
.world-map-queue-add-option {display:flex;align-items:center;gap:9px;width:100%;padding:6px 8px;cursor:pointer;color:#fff;text-align:left;border-radius:5px;border:1px solid #517b5d;background:#22312a}
.world-map-queue-add-option:hover,.world-map-queue-add-option:focus-visible {outline:2px solid #9af2ae;outline-offset:0;background:#2c4331}
.world-map-queue-add-option span {display:flex;flex-direction:column;min-width:0}
.world-map-queue-add-option strong {white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.world-map-queue-add-option small {font-size:11px;color:#bcceb9}

/* V0.29.60: two separate stacked cards in the map sidebar: stage above,
   party below. The Party panel is NEVER a child of the stage card. */
.world-map-right-rail{display:flex;flex-direction:column;gap:16px;min-width:0;align-self:start;}
.world-map-right-rail>.world-map-details{position:static!important;min-height:0!important;width:100%;}
.world-map-right-rail>.world-map-party-queue{
  box-sizing:border-box; margin:0; padding:17px 12px;
  border:1px solid rgba(194,154,239,.48); border-radius:14px;
  background:linear-gradient(160deg,rgba(50,34,65,.80),rgba(16,15,26,.97));
}
.world-map-right-rail .world-map-queue-heading{
  font-family:"IM Fell English SC",Georgia,serif;font-size:23px;margin:1px 0 12px;
}
.world-map-right-rail .world-map-queue-heading span{font:600 13px/1.3 system-ui,sans-serif;color:#dcc4ef;}
.world-map-right-rail .world-map-enemies-heading{
  margin:6px 0 8px;color:#eed8ff;font:400 21px/1.2 "IM Fell English SC",Georgia,serif;
}
.world-map-queue-identity small{white-space:nowrap;}

/* V0.29.62 — map party identity, friend invitation and inventory-style
   numbered-handle reorder. Only the number is draggable; whole character
   boxes become highlighted targets while that number is being dragged. */
.world-map-party-player-names{
  display:flex;flex-wrap:wrap;gap:6px;margin:-3px 0 12px;
}
.world-map-party-player-names>span{
  display:inline-block;min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;
  white-space:nowrap;padding:3px 8px;border:1px solid rgba(180,148,219,.55);
  border-radius:5px;background:rgba(81,58,113,.44);color:#f0e2fc;
  font:600 12px/1.35 system-ui,sans-serif;
}
.world-map-party-invite-button{
  display:block;width:100%;min-height:43px;margin-top:14px;
  text-align:center;font-size:15px;
}
.world-map-queue-row{cursor:default;transition:outline-color .12s ease,box-shadow .12s ease,background-color .12s ease;}
.world-map-queue-slot[draggable="true"]{cursor:grab;user-select:none;touch-action:none;}
.world-map-queue-slot[draggable="true"]:active{cursor:grabbing;}
.world-map-party-queue.is-order-dragging .world-map-queue-row:not(.is-dragging){
  outline:3px solid #f9dc8f;outline-offset:1px;
  box-shadow:0 0 10px rgba(249,220,143,.42);
}
.world-map-party-queue.is-order-dragging .world-map-queue-row.is-drop-target{
  outline:3px solid #ffe9ae;outline-offset:1px;
  background:#382b46;box-shadow:0 0 16px rgba(249,220,143,.66);
}


/* V0.29.63: pointer-driven number drag with inventory-style gold targets. */
.world-map-queue-slot[role="button"]{cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none}
.world-map-queue-reorder-help{margin:0 0 11px;text-align:left;color:#d5c5e3;font:11px/1.35 system-ui,sans-serif}
.world-map-party-queue.is-order-dragging .world-map-queue-row.is-dragging .world-map-queue-slot{
  color:#221329;background:#f8d993;border-color:#fff4c9;
  box-shadow:0 0 0 2px rgba(249,220,143,.55),0 0 15px rgba(249,220,143,.85);
  cursor:grabbing;
}
.world-map-party-queue.is-order-dragging .world-map-queue-row:not(.is-dragging) .world-map-queue-slot{
  border-color:#f9dc8f;box-shadow:0 0 9px rgba(249,220,143,.65);
}
.world-map-party-queue.is-order-dragging .world-map-queue-row.is-drop-target .world-map-queue-slot{
  background:#a67d42;color:#fff9dc;border-color:#fff4bd;
}
.home-party-note strong{display:block;font-weight:600}
.home-party-note small{display:block;font:11px/1.4 system-ui,sans-serif;color:#ccbad9;margin-top:3px}

/* V0.29.64 — PvP browser, custom hosting and friendly matchmaking */
.pvp-hall{width:min(890px,100%);margin:auto;display:grid;gap:18px;padding:12px 6px 20px;color:#eee5d9}
.pvp-hall-top{display:flex;align-items:center;justify-content:space-between;gap:18px;border-bottom:1px solid rgba(213,182,134,.25);padding-bottom:16px}
.pvp-hall-top h2{margin:5px 0 0;font-size:clamp(25px,3vw,38px)}
.pvp-hall-eyebrow,.pvp-browser-heading,.pvp-create-label>span,.pvp-visibility-field legend,.pvp-private-join label{font-size:11px;letter-spacing:.12em;color:#cdb58e}
.pvp-hall-modes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px}
.pvp-hall-choice{display:flex;flex-direction:column;gap:10px;text-align:left;padding:24px;min-height:235px;cursor:pointer;color:#ebdfcc;border:1px solid #65523e;border-radius:10px;background:linear-gradient(150deg,rgba(65,54,42,.9),rgba(25,29,28,.95));box-shadow:0 9px 22px #0004;transition:border-color .15s,transform .15s}
.pvp-hall-choice:hover,.pvp-hall-choice:focus-visible{border-color:#ddc290;transform:translateY(-2px)}
.pvp-hall-choice-icon{font-size:31px;color:#dbc28f}
.pvp-hall-choice strong{font-size:22px}
.pvp-hall-choice span:not(.pvp-hall-choice-icon){font-size:14px;color:#d9c9b5;line-height:1.45}
.pvp-hall-choice small{margin-top:auto;color:#d9b77c}
.pvp-browser-tools,.pvp-call-to-action{display:flex;gap:10px;flex-wrap:wrap}
.pvp-browser-panel,.pvp-private-join,.pvp-create-form,.pvp-match-profile,.pvp-friend-section{border:1px solid #67563e;border-radius:9px;background:rgba(21,25,24,.86);padding:15px}
.pvp-browser-heading{display:flex;justify-content:space-between;gap:12px;margin-bottom:12px}
.pvp-match-list{display:grid;gap:8px}
.pvp-browser-row{display:grid;grid-template-columns:minmax(0,1fr) 62px 100px 76px;gap:10px;align-items:center;border:1px solid #514538;border-radius:6px;padding:12px;background:rgba(92,73,50,.24)}
.pvp-browser-match{display:grid;gap:5px}.pvp-browser-match strong{font-size:16px}.pvp-browser-match small{color:#cbbba5}
.pvp-browser-empty,.pvp-hall-loading{padding:28px 8px;text-align:center;color:#cfc3b4}.pvp-match-population,.pvp-match-level{text-align:center;font-size:13px}
.pvp-private-join{display:grid;gap:10px}.pvp-private-join>div{display:flex;gap:10px;flex-wrap:wrap}
.pvp-private-join input,.pvp-create-form input[type=text],.pvp-create-form input[type=number],.pvp-create-form input:not([type]) ,.pvp-add-friend input{min-height:43px;min-width:0;flex:1;background:#1d2423;border:1px solid #71604a;border-radius:5px;padding:10px 12px;color:#fff}
.pvp-create-form{display:grid;gap:17px}.pvp-create-label{display:grid;gap:8px}.pvp-create-label small{color:#c8b9a2;font-size:12px}
.pvp-visibility-field{border:0;padding:0;margin:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.pvp-visibility-field legend{margin-bottom:9px}.pvp-visibility-option{display:grid;grid-template-columns:auto 1fr;gap:6px 10px;align-items:center;padding:15px;border:1px solid #625440;border-radius:6px;background:#272a27;cursor:pointer}
.pvp-visibility-option small{grid-column:2;color:#bfb5a8;line-height:1.5}.pvp-visibility-option:has(input:checked){border-color:#dec28a;background:#39362c}
.pvp-friends-switch{display:flex;align-items:center;gap:12px;cursor:pointer}.pvp-friends-switch span{display:grid;gap:5px}.pvp-friends-switch small{color:#bfb5a8}
.pvp-match-profile{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}.pvp-profile-stat{display:grid;gap:8px;text-align:center}.pvp-profile-stat small{color:#cbb58e}.pvp-profile-stat strong{font-size:24px}
.pvp-hall-note{color:#d5c8b7;font-size:13px}.pvp-search-wait{padding:12px 0;font-size:16px}.pvp-friends-list{display:grid;gap:14px}
.pvp-add-friend{display:flex;flex-wrap:wrap;gap:12px;align-items:center}.pvp-friend-row{display:flex;gap:14px;justify-content:space-between;align-items:center;margin:10px 0}
.pvp-custom-lobby-name{display:flex;flex-direction:column;gap:7px;color:#e9dfce}.pvp-custom-lobby-name h2{margin:0}.pvp-custom-lobby-name span{color:#ddc092}
.match-reward-flags{color:#e9bf72;font-weight:700}
/* PvP room filters, friendly queue browser, and read-only live spectators. */
.pvp-browser-filter{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.pvp-browser-filter>span{font-size:11px;letter-spacing:.12em;color:#cdb58e;margin-right:8px}
.pvp-filter-button{background:#252d2b;color:#d6cbba;border:1px solid #71604a;border-radius:6px;padding:9px 17px;font:inherit;cursor:pointer}
.pvp-filter-button.active,.pvp-filter-button[aria-pressed="true"]{border-color:#e0c38c;background:#50452f;color:#fff1c7}
.pvp-queue-panel{display:grid;gap:12px}.pvp-queue-panel .pvp-match-profile{border:0;padding:8px;background:transparent}
.pvp-queue-panel .pvp-call-to-action{justify-content:center}
.pvp-live-row{grid-template-columns:minmax(0,1fr) 125px 95px 95px}
.pvp-versus{font-size:12px;color:#dabb88;margin:0 6px}
.pvp-spectator-banner{position:fixed;z-index:400;top:15px;left:50%;transform:translateX(-50%);display:flex;gap:12px;align-items:center;padding:10px 14px;background:rgba(19,26,25,.96);border:1px solid #dabb88;border-radius:8px;color:#eee6d6;box-shadow:0 7px 25px #0008}
.pvp-spectator-banner span{font-size:12px;color:#c6b9a5}
@media(max-width:670px){.pvp-live-row{grid-template-columns:minmax(0,1fr) 90px}.pvp-spectator-banner{width:min(96%,450px);justify-content:center;flex-wrap:wrap;top:8px}}
@media(max-width:670px){.pvp-hall-modes,.pvp-visibility-field{grid-template-columns:1fr}.pvp-browser-row{grid-template-columns:minmax(0,1fr) 75px;gap:8px}.pvp-match-profile{grid-template-columns:1fr 1fr}.pvp-hall-choice{min-height:175px}}

/* V0.29.67 — PvP kiosk-style browsers. Inspired by the tabbed/list workflow of
   Wizard101's PvP menu, without reusing its artwork, parchment or gold palette. */
body.mode-selecting .play-mode-card:has(.pvp-hall){
  box-sizing:border-box;width:min(1060px,96vw);max-width:1060px;
  padding:20px clamp(16px,2.5vw,34px) 26px;max-height:94dvh;
  background:#191822;border:1px solid #565066;border-radius:12px;
  box-shadow:0 24px 75px #000a;
}
body.mode-selecting .play-mode-card:has(.pvp-hall) .play-mode-brand-row{display:none;}
body.mode-selecting .play-mode-overlay:has(.pvp-hall){
  background:linear-gradient(145deg,#282630,#191820 64%,#121219);
}
.pvp-hall{width:100%;max-width:100%;margin:0;display:flex;flex-direction:column;gap:0;
  padding:0;color:#edeaf3;font:14px/1.4 system-ui,sans-serif;}
.pvp-hall-top{border-bottom:1px solid #514d5c;margin:0;padding:0 0 18px;gap:15px;}
.pvp-hall-top h2{margin:0;font:600 clamp(22px,2.6vw,30px)/1.2 "IM Fell English SC",Georgia,serif;letter-spacing:.01em;color:#f6f3fa;}
.pvp-hall .mode-button{border-radius:5px;min-height:38px;padding:8px 16px;
  font:600 13px/1.2 system-ui,sans-serif;color:#e9e5f2;
  background:#2d2a38;border:1px solid #555062;box-shadow:none;}
.pvp-hall .mode-button:hover,.pvp-hall .mode-button:focus-visible{background:#41394f;border-color:#9583b1;}
.pvp-hall .mode-button.primary{color:#f8f4ff;border:1px solid #82719e;
  background:#56466d;}
.pvp-hall .mode-button.primary:hover{background:#655281;}
.pvp-hall .mode-button:disabled{opacity:.45;}
.pvp-ledger-tabs{display:flex;gap:3px;align-items:end;padding-top:17px;
  border-bottom:1px solid #655a74;flex-wrap:wrap;}
.pvp-hall .pvp-ledger-tab{min-height:43px;padding:9px 23px;border:1px solid #504a60;
  border-bottom:0;background:#272631;color:#c6bed0;border-radius:7px 7px 0 0;
  font:650 15px/1.3 "IM Fell English SC",Georgia,serif;cursor:pointer;letter-spacing:0;}
.pvp-hall .pvp-ledger-tab:hover{background:#34313e;color:#f4effb;}
.pvp-hall .pvp-ledger-tab.active,.pvp-hall .pvp-ledger-tab[aria-selected="true"],
.pvp-hall .pvp-ledger-tab[aria-pressed="true"]{
  position:relative;color:#fff;background:#3a3448;border-color:#817191;}
.pvp-hall .pvp-ledger-tab.active::after,.pvp-hall .pvp-ledger-tab[aria-selected="true"]::after,
.pvp-hall .pvp-ledger-tab[aria-pressed="true"]::after{content:"";position:absolute;height:2px;bottom:-1px;left:0;right:0;background:#ba9dda;}
.pvp-ledger-page{padding:16px 0 0;min-height:278px;}
.pvp-ledger-section-title{display:flex;align-items:center;justify-content:space-between;
  flex-wrap:wrap;gap:12px;margin:0 0 12px;color:#efeaf5;}
.pvp-ledger-section-title strong{font:600 18px/1.3 Georgia,serif;}
.pvp-ledger-section-title span{font-size:12px;color:#afa8b9;}
.pvp-hall .pvp-browser-panel,.pvp-hall .pvp-private-join,.pvp-hall .pvp-create-form,
.pvp-hall .pvp-friend-section{background:#211f2b;border:1px solid #504b5b;border-radius:5px;}
.pvp-hall .pvp-queue-panel{padding:18px 20px;gap:12px;min-height:160px;}
.pvp-hall .pvp-match-profile{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));
  border:1px solid #4c4757;border-radius:5px;overflow:hidden;gap:0;
  background:#272431;padding:0;}
.pvp-hall .pvp-profile-stat{padding:16px 10px;gap:4px;border-right:1px solid #4c4757;}
.pvp-hall .pvp-profile-stat:last-child{border-right:0;}
.pvp-hall .pvp-profile-stat small{color:#beb4cd;text-transform:none;font:600 12px/1.3 system-ui,sans-serif;}
.pvp-hall .pvp-profile-stat strong{font:650 23px/1.4 system-ui,sans-serif;color:#f5f1f9;}
.pvp-hall .pvp-hall-note{font:13px/1.5 system-ui,sans-serif;color:#ada6b6;margin:10px 0;}
.pvp-hall .pvp-call-to-action{justify-content:center;padding-top:8px;}
.pvp-hall .pvp-call-to-action .mode-button{min-width:178px;}
.pvp-ledger-table-head{display:grid;grid-template-columns:minmax(0,1fr) 86px 105px 106px;
  gap:10px;align-items:center;min-height:35px;background:#34303e;padding:9px 15px;
  border:1px solid #504a5b;border-radius:5px 5px 0 0;color:#d2c9dc;
  font:700 12px/1.4 system-ui,sans-serif;}
.pvp-ledger-table-head span:not(:first-child){text-align:center;}
.pvp-hall .pvp-match-list{display:flex;flex-direction:column;gap:0;border:1px solid #504a5b;
  border-top:0;min-height:188px;background:#211f2b;border-radius:0 0 5px 5px;overflow:hidden;}
.pvp-hall .pvp-browser-row,.pvp-hall .pvp-live-row{display:grid;
  grid-template-columns:minmax(0,1fr) 86px 105px 106px;gap:10px;
  padding:12px 15px;align-items:center;background:transparent;
  border:0;border-bottom:1px solid #3e3949;border-radius:0;min-height:66px;}
.pvp-hall .pvp-browser-row:nth-child(even){background:#292631;}
.pvp-hall .pvp-browser-row:hover{background:#353040;}
.pvp-hall .pvp-browser-row:last-child{border-bottom:0;}
.pvp-hall .pvp-browser-match{min-width:0;gap:4px;}
.pvp-hall .pvp-browser-match strong{font:650 14px/1.35 system-ui,sans-serif;color:#f2edf8;overflow-wrap:anywhere;}
.pvp-hall .pvp-browser-match small{font:12px/1.35 system-ui,sans-serif;color:#a9a1b5;}
.pvp-hall .pvp-match-population,.pvp-hall .pvp-match-level{font:13px system-ui,sans-serif;color:#d5cfde;}
.pvp-hall .pvp-versus{font:700 11px system-ui,sans-serif;color:#ad9dc0;}
.pvp-hall .pvp-browser-empty,.pvp-hall .pvp-hall-loading{color:#a9a3b2;padding:36px 15px;}
.pvp-ledger-footer{display:flex;align-items:center;justify-content:space-between;gap:10px;
  flex-wrap:wrap;padding:17px 0 3px;}
.pvp-hall .pvp-private-join{display:grid;grid-template-columns:minmax(180px,.38fr) minmax(0,1fr);
  gap:16px;align-items:center;padding:14px 17px;margin:13px 0 0;}
.pvp-hall .pvp-private-join label{color:#ddd4e6;font:650 13px system-ui,sans-serif;letter-spacing:0;text-transform:none;}
.pvp-hall .pvp-private-join>div{display:flex;gap:8px;flex-wrap:wrap;}
.pvp-hall .pvp-private-join input,.pvp-hall .pvp-create-form input:not([type=checkbox]),
.pvp-hall .pvp-add-friend input{background:#171621;border:1px solid #625a72;color:#eae5f2;
  border-radius:5px;min-height:38px;padding:8px 11px;}
.pvp-hall .pvp-private-join input:focus,.pvp-hall .pvp-create-form input:focus{outline:1px solid #a58dc5;}
.pvp-hall .pvp-create-form{margin-top:17px;padding:23px;gap:18px;}
.pvp-hall .pvp-create-label>span,.pvp-hall .pvp-visibility-field legend{color:#c7bdce;letter-spacing:.04em;font:650 12px system-ui,sans-serif;}
.pvp-hall .pvp-create-label small,.pvp-hall .pvp-visibility-option small,.pvp-hall .pvp-friends-switch small{color:#ada6b8;}
.pvp-hall .pvp-visibility-option{background:#292633;border:1px solid #595366;}
.pvp-hall .pvp-visibility-option:has(input:checked){background:#3b3348;border-color:#9f89b7;}
.pvp-hall .pvp-friends-switch{color:#e9e4f0;}
.pvp-hall input[type=checkbox],.pvp-hall input[type=radio]{accent-color:#9779ba;}
.pvp-hall .pvp-hall-choice{color:#ece6f4;background:#272532;border:1px solid #5b5467;}
.pvp-hall .pvp-hall-choice:hover{border-color:#ad96cc;}
.pvp-hall .pvp-hall-choice-icon,.pvp-hall .pvp-hall-choice small{color:#bca9d3;}
.pvp-hall .pvp-hall-choice span:not(.pvp-hall-choice-icon){color:#cbc2d4;}
@media(max-width:680px){
 body.mode-selecting .play-mode-card:has(.pvp-hall){padding:15px 12px;max-height:96dvh;}
 .pvp-hall .pvp-ledger-tab{padding:9px 13px;font-size:12px;min-height:39px;}
 .pvp-ledger-table-head,.pvp-hall .pvp-browser-row,.pvp-hall .pvp-live-row{grid-template-columns:minmax(0,1fr) 65px 65px 77px;gap:5px;padding:10px 7px;}
 .pvp-ledger-table-head{font-size:10px;}
 .pvp-hall .pvp-browser-row .mode-button{font-size:11px;padding:7px;}
 .pvp-hall .pvp-match-profile{grid-template-columns:1fr;}
 .pvp-hall .pvp-profile-stat{border-right:0;border-bottom:1px solid #4c4757;}
 .pvp-hall .pvp-profile-stat:last-child{border-bottom:0;}
 .pvp-hall .pvp-private-join{grid-template-columns:1fr;gap:9px;}
 .pvp-hall .pvp-hall-modes,.pvp-hall .pvp-visibility-field{grid-template-columns:1fr;}
}

/* V0.29.68 — uncluttered PvP selection, violet-tinted arena artwork */
body.mode-selecting .play-mode-overlay:has(.pvp-hall){
 background:linear-gradient(135deg,rgba(42,22,65,.72),rgba(36,21,58,.80)),url('/static/backgrounds/pvp_courtyard.png') center/cover no-repeat !important;
}
body.mode-selecting .play-mode-card:has(.pvp-hall){background:rgba(24,19,35,.89);}
.pvp-hall-modes{grid-template-columns:repeat(2,minmax(0,1fr));gap:24px;padding:46px 0 34px;}
.pvp-hall-modes #pvpCustomGames{order:1}.pvp-hall-modes #pvpMatchmaking{order:2}
.pvp-hall .pvp-hall-choice{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;min-height:210px;text-align:center;background:rgba(32,26,46,.94);border:1px solid #6f6086;color:#f0e9f7;border-radius:8px;padding:24px;}
.pvp-hall .pvp-hall-choice strong{font:600 clamp(21px,2.5vw,29px) 'IM Fell English SC',Georgia,serif;}
.pvp-hall .pvp-hall-choice small{font:13px/1.45 system-ui,sans-serif;color:#c7b6dc;margin:0;}
.pvp-hall .pvp-hall-choice:hover{border-color:#b39bd6;background:rgba(56,43,76,.96);}
.pvp-hall .pvp-section-actions{justify-content:flex-end;}
.pvp-hall .pvp-ledger-footer{justify-content:flex-start;}
.pvp-queue-party-wrap{max-width:540px;margin:0 auto;}
.pvp-queue-party-wrap .world-map-party-queue{margin:0 auto 18px;background:#211a30;border:1px solid #68547e;padding:16px;border-radius:8px;}
.pvp-queue-actions{display:flex;justify-content:center;margin:14px 0;}
.pvp-queue-actions button{min-width:160px;}
.world-map-queue-row.is-slot-picked{outline:2px solid #c7aeeb;outline-offset:1px;}
.world-map-party-queue.is-order-dragging .world-map-queue-row:not(.is-dragging){outline:2px solid #a88ac7;box-shadow:0 0 9px #714b9870;}
.world-map-party-queue.is-order-dragging .world-map-queue-row.is-drop-target{outline:3px solid #dac4ff;background:#3b2b54;box-shadow:0 0 13px #af83dc88;}
.world-map-party-queue.is-order-dragging .world-map-queue-row.is-dragging .world-map-queue-slot{background:#a581ce;border-color:#dec8fc;color:#1c1325;box-shadow:0 0 0 2px #cdb5f3;}
.global-inventory-button{position:fixed;top:16px;right:20px;z-index:2600;padding:8px 18px;color:#f1ebfa;background:#342a46;border:1px solid #8973ac;border-radius:6px;cursor:pointer;box-shadow:0 3px 14px #0008;}
.global-inventory-button:hover{background:#4d3966;border-color:#c4abeb;}
.world-map-inventory-modal{z-index:2900;}
@media(max-width:670px){.pvp-hall-modes{grid-template-columns:1fr;padding:20px 0;}.global-inventory-button{top:10px;right:10px;font-size:12px;padding:6px 10px;}.pvp-hall-top{padding-right:86px;}}

/* Custom game slot chooser: Realm Walker / NPC / controller, with clear labels. */
.remote-slot .custom-slot-picker-label{display:flex;flex-direction:column;gap:5px;font:600 11px/1.2 system-ui,sans-serif;color:#cbb8df;min-width:0;}
.remote-slot .custom-slot-picker-label select{min-width:0;max-width:100%;width:100%;}
.remote-slot .slot-character-pickers:has(.slot-npc){display:grid;grid-template-columns:1fr 1fr;gap:8px;}
.remote-slot .slot-character-pickers:has(.slot-npc) .slot-character-meta{grid-column:1/-1;}
@media(max-width:740px){.remote-slot .slot-character-pickers:has(.slot-npc){grid-template-columns:1fr;}}

.pvp-hall .pvp-ledger-footer{justify-content:flex-end;}

/* Queue: display the actual full-size party, not a tiny sidebar card inside a second box. */
.pvp-hall .pvp-queue-panel{background:transparent;border:0;padding:12px 0 0;min-height:0;}
.pvp-queue-party-wrap{width:100%;max-width:540px;min-width:0;}
.pvp-queue-party-wrap .world-map-party-queue{box-sizing:border-box;width:100%;margin:0 auto 15px;padding:19px 20px;}
.pvp-queue-party-wrap .world-map-queue-row{min-height:56px;}
.pvp-queue-party-wrap .world-map-queue-portrait{width:43px;height:44px;}
.pvp-queue-party-wrap .world-map-queue-heading{font:600 23px/1.2 'IM Fell English SC',Georgia,serif;margin-bottom:12px;}
.pvp-queue-party-wrap .world-map-queue-identity strong{font-size:15px;}
.pvp-queue-party-wrap .world-map-queue-identity small{font-size:12px;}
.pvp-queue-party-wrap .world-map-queue-slot{flex-basis:32px;height:32px;font-size:15px;}
@media(max-width:670px){.pvp-queue-party-wrap .world-map-party-queue{padding:10px 8px;}}

/* PvP host/join/custom lobbies also retain the same purple-tinted courtyard. */
body.mode-selecting.pvp-arena-active .play-mode-overlay{
 background:linear-gradient(135deg,rgba(42,22,65,.72),rgba(36,21,58,.80)),url('/static/backgrounds/pvp_courtyard.png') center/cover no-repeat !important;
}

/* V0.29.69 — actual occupied RealmWalker/NPC thumbnails in PvP browsers. */
.pvp-custom-tabs{display:flex;align-items:flex-end;gap:3px;}
.pvp-custom-create-tab{margin:0 0 5px auto;min-height:35px!important;}
.pvp-filter-dropdown{display:flex;align-items:center;gap:10px;color:#cfc5dc;font:600 13px system-ui,sans-serif;}
.pvp-filter-dropdown select{appearance:auto;border:1px solid #78678f;border-radius:5px;background:#242031;
  color:#f3edf9;padding:9px 12px;font:600 13px system-ui,sans-serif;min-width:155px;cursor:pointer;}
.pvp-filter-dropdown select:focus-visible,.pvp-room-slot-open:focus-visible{outline:2px solid #d5bdf5;outline-offset:2px;}
.pvp-room-browser-head{display:grid;grid-template-columns:minmax(150px,215px) minmax(0,1fr);align-items:center;gap:16px;
  padding:10px 16px;border:1px solid #52475f;border-radius:5px 5px 0 0;background:#302b3e;
  font:650 12px system-ui,sans-serif;color:#d8cbe8;}
.pvp-hall .pvp-match-list:has(.pvp-room-browser-row){border-top:0;}
.pvp-room-browser-row{display:grid;grid-template-columns:minmax(150px,215px) minmax(0,1fr);gap:16px;
  align-items:center;padding:15px 16px;border-bottom:1px solid #484055;background:#211e2b;min-width:0;}
.pvp-room-browser-row:nth-child(even){background:#292535;}
.pvp-room-browser-row:last-child{border-bottom:0;}
.pvp-room-browser-info{display:flex;flex-direction:column;gap:6px;align-items:flex-start;min-width:0;}
.pvp-room-browser-info strong{font:650 15px/1.3 system-ui,sans-serif;color:#f5eefc;overflow-wrap:anywhere;}
.pvp-room-browser-info span{font:12px system-ui,sans-serif;color:#c7b5d6;}
.pvp-room-browser-info small{font:11px system-ui,sans-serif;color:#a9a0b9;}
.pvp-room-browser-info .mode-button{margin-top:5px;min-height:33px;}
.pvp-room-teams{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;min-width:0;}
.pvp-room-team{min-width:0;display:flex;flex-direction:column;gap:5px;}
.pvp-room-team-label{font:700 10px/1.2 system-ui,sans-serif;letter-spacing:.06em;text-transform:uppercase;color:#bcaacd;}
.pvp-room-team-slots{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;}
.pvp-room-slot{box-sizing:border-box;position:relative;width:100%;min-width:0;height:76px;
  background:#171522;border:1px solid #60536f;border-radius:5px;overflow:hidden;display:flex;flex-direction:column;align-items:center;justify-content:center;}
.pvp-room-slot-filled{padding:3px 2px 2px;}
.pvp-room-slot-filled img{display:block;width:100%;max-width:46px;height:44px;object-fit:contain;
  image-rendering:pixelated;}
.pvp-room-slot-name{display:block;width:100%;text-align:center;font:600 10px/1.2 system-ui,sans-serif;
  color:#f2edf6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:2px 1px 0;}
.pvp-room-slot-level{position:absolute;top:2px;right:2px;color:#e9ddf5;background:#171522d9;
  border-radius:2px;padding:1px 2px;font:700 9px/1.2 system-ui,sans-serif;}
.pvp-room-npc-marker{position:absolute;top:2px;left:2px;background:#4c385f;color:#eadcff;
  border-radius:2px;padding:1px 2px;font:700 8px/1.2 system-ui,sans-serif;}
.pvp-room-slot-open{cursor:pointer;font:600 29px/1 system-ui,sans-serif;color:#b4eda8;
  border:1px dashed #78957b;background:#243228;transition:background .15s,border-color .15s;}
.pvp-room-slot-open:hover{background:#36533d;color:#e8ffe5;border-color:#a8e19e;}
.pvp-room-slot-empty{border-style:dashed;color:#70677d;font:600 28px/1 system-ui,sans-serif;}
.pvp-room-portrait-fallback{font:650 11px system-ui,sans-serif;color:#dac5e8;}
.pvp-hall #pvpCustomMatchesSection .pvp-private-join{margin:16px 0 0;}
@media(max-width:920px){.pvp-room-browser-row,.pvp-room-browser-head{grid-template-columns:minmax(130px,175px) minmax(0,1fr);gap:10px;}
 .pvp-room-teams{gap:8px;}.pvp-room-slot{height:68px;}.pvp-room-slot-filled img{height:36px;}}
@media(max-width:630px){.pvp-room-browser-row,.pvp-room-browser-head{grid-template-columns:minmax(0,1fr);gap:10px;}
 .pvp-room-browser-head span:last-child{display:none;}.pvp-room-browser-row{padding:13px 9px;}
 .pvp-room-slot{height:72px;}.pvp-room-team-slots{gap:4px;}
 .pvp-custom-create-tab{font-size:11px!important;padding:7px!important;min-width:0;}
 .pvp-custom-tabs .pvp-ledger-tab{padding:8px 12px;}}

/* V0.29.70 — Compact match thumbnails: Realm Walker above class;
   NPC type/level followed by a centered, purple NPC badge. */
.pvp-room-slot{height:105px;}
.pvp-room-slot-filled{padding:5px 3px 4px;justify-content:flex-start;gap:2px;}
.pvp-room-slot-filled img{height:48px;max-height:48px;flex:0 1 48px;min-height:0;}
.pvp-room-slot-name{flex:0 0 auto;order:0;font-size:10px;line-height:13px;padding:0 1px;}
.pvp-room-slot-detail{display:block;position:static;max-width:100%;padding:0 1px;color:#d9cee7;background:transparent;
 text-align:center;font:600 10px/13px system-ui,sans-serif;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.pvp-room-npc-marker{position:static;display:inline-block;align-self:center;flex:0 0 auto;
 padding:2px 7px;border-radius:3px;font:700 9px/12px system-ui,sans-serif;
 background:#4c385f;color:#eadcff;}
.pvp-room-slot-filled.pvp-room-npc img{height:57px;max-height:57px;flex-basis:57px;}
@media(max-width:920px){.pvp-room-slot{height:100px;}.pvp-room-slot-filled img{height:42px;flex-basis:42px;}
 .pvp-room-slot-filled.pvp-room-npc img{height:52px;flex-basis:52px;}}
@media(max-width:630px){.pvp-room-slot{height:103px;}.pvp-room-slot-filled img{height:45px;flex-basis:45px;}}
/* Keep full level/class labels readable in smaller PvP match browsers. */
@media(max-width:850px){
 .pvp-room-browser-row,.pvp-room-browser-head{grid-template-columns:minmax(0,1fr);gap:10px;}
 .pvp-room-browser-head span:last-child{display:none;}
 .pvp-room-browser-info{gap:3px;}
 .pvp-room-browser-row{padding:13px 12px;}
}
@media(max-width:630px){
 .pvp-room-teams{grid-template-columns:minmax(0,1fr);gap:10px;}
 .pvp-room-team-slots{gap:6px;}
 .pvp-room-slot{height:99px;}
}

/* V0.29.71: instructional text belongs immediately under the party title
   in the shared World Map, Custom Games, and Matchmaking party panel. */
.world-map-right-rail .world-map-queue-heading,
.pvp-queue-party-wrap .world-map-queue-heading {margin-bottom:3px;}
.world-map-right-rail .world-map-queue-reorder-help,
.pvp-queue-party-wrap .world-map-queue-reorder-help {margin:0 0 12px;}


/* V0.29.72 — the TURN NUMBER is now a physical drag handle. The floating
   badge follows the mouse/finger; only other rows receive drop highlighting. */
.world-map-party-queue .world-map-queue-slot[role="button"]{
  flex:0 0 36px;width:36px;height:36px;
  display:grid;place-items:center;
  font:800 17px/1 system-ui,sans-serif;
  cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none;
  -webkit-touch-callout:none;position:relative;z-index:2;
}
.world-map-party-queue.is-order-dragging .world-map-queue-row.is-dragging .world-map-queue-slot{
  opacity:.38;box-shadow:0 0 0 2px #d9b5fa;cursor:grabbing;
}
.world-map-party-queue .world-map-queue-row.is-slot-picked .world-map-queue-slot{
  outline:2px solid #dcbaff;outline-offset:2px;
}
.realm-party-number-ghost{
  position:fixed;z-index:16000;pointer-events:none;
  width:41px;height:41px;display:grid;place-items:center;
  background:#f1d7ff;color:#261332;border:2px solid #fff;
  border-radius:6px;font:800 19px/1 system-ui,sans-serif;
  box-shadow:0 8px 22px #000a,0 0 0 3px #9874c5a8;
  transform:translate(-50%,-50%) rotate(-5deg);
  user-select:none;-webkit-user-select:none;
}




/* V0.29.73: consistent one-click party removal. The X never becomes a drag target.
   Number badges are strictly for reordering on Home, Map, PvP and Inventory. */
.home-party-entry{display:inline-flex;align-items:center;gap:4px;max-width:100%;}
body.mode-selecting .home-party-summary .home-party-entry .home-party-chip{min-width:0;}
.home-party-remove-button,
.inventory-roster-remove-button{
  flex:0 0 26px;width:26px;height:26px;display:grid;place-items:center;
  padding:0;border:1px solid #b66b7a;border-radius:4px;background:#692b39;
  color:transparent;font-size:0;line-height:1;cursor:pointer;position:relative;
}
.home-party-remove-button::before,
.inventory-roster-remove-button::before,
.world-map-queue-remove::before{
  content:'×';display:block;font:800 17px/1 system-ui,sans-serif;color:#ffe3e7;
  text-align:center;transform:translateY(-.5px);
}
.home-party-remove-button:hover:not(:disabled),
.inventory-roster-remove-button:hover:not(:disabled),
.world-map-queue-remove:hover:not(:disabled){background:#a92e45;color:white;}
.home-party-remove-button:focus-visible,
.inventory-roster-remove-button:focus-visible,
.world-map-queue-remove:focus-visible{outline:2px solid #ffe6ec;outline-offset:2px;}
.home-party-remove-button:disabled,
.inventory-roster-remove-button:disabled{opacity:.30;cursor:not-allowed;}
.inventory-roster-remove-button{align-self:center;flex-basis:25px;width:25px;height:25px;}
.world-map-party-queue .world-map-queue-row{padding-right:31px;}
.world-map-party-queue .world-map-queue-remove{position:absolute;top:50%;right:5px;transform:translateY(-50%);z-index:2;}
@media(max-width:700px){.inventory-roster-entry{gap:4px;}.inventory-roster-remove-button{flex-basis:24px;width:24px;height:24px;}}

/* Only the numbered portion of a Home party chip starts a drag. */
.home-party-chip-order[draggable="true"]{cursor:grab;user-select:none;-webkit-user-select:none;}
.home-party-chip.party-chip-dragging .home-party-chip-order{cursor:grabbing;}
/* Retain the purple number being physically picked up in the map and PvP. */
.realm-party-number-ghost{background:linear-gradient(180deg,#74519e,#48305e);color:#fff;border:2px solid #efd9ff;opacity:1;transform:translate(-50%,-50%) rotate(-5deg) scale(1.04);}

/* V0.29.74: compact horizontal Main Menu party boxes. Number, name and
   direct-remove button share one rectangular frame, followed by the add tile.
   This affects only the Main Menu, not World Map, PvP or Inventory. */
body.mode-selecting #homePartySummary.home-party-summary{
  display:flex;flex-wrap:nowrap;align-items:center;gap:9px;
  width:100%;min-width:0;overflow-x:auto;overflow-y:hidden;
  padding:5px 2px 7px;box-sizing:border-box;
  scrollbar-width:thin;
}
body.mode-selecting #homePartySummary .home-party-entry[data-class]{
  flex:0 0 auto;min-width:0;max-width:100%;display:inline-flex;align-items:center;
  gap:2px;padding:4px 5px 4px 4px;box-sizing:border-box;
  border:1px solid var(--class-rim-light,#9d78b8);border-radius:4px;
  background:linear-gradient(145deg,
    color-mix(in srgb,var(--class-rim-mid,#654887) 58%,#191425),
    color-mix(in srgb,var(--class-rim-dark,#352145) 55%,#14111d));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.12);
}
body.mode-selecting #homePartySummary .home-party-entry .home-party-chip[data-class]{
  display:inline-flex;align-items:center;min-width:0;gap:8px;
  margin:0;padding:1px 4px 1px 2px;border:0;border-radius:0;
  background:none;box-shadow:none;font:600 14px/1.25 system-ui,sans-serif;
}
body.mode-selecting #homePartySummary .home-party-entry .home-party-chip-order{
  flex:0 0 26px;width:26px;min-width:26px;height:26px;border-radius:3px;
  font:700 13px/1 system-ui,sans-serif;
}
body.mode-selecting #homePartySummary .home-party-entry .home-party-chip-name{
  display:block;max-width:145px;overflow:hidden;text-overflow:ellipsis;
  white-space:nowrap;
}
body.mode-selecting #homePartySummary .home-party-entry .home-party-remove-button{
  flex:0 0 24px;width:24px;height:24px;margin-left:4px;
  font-size:17px;line-height:1;border-radius:3px;
}
body.mode-selecting #homePartySummary .home-party-add-square{
  flex:0 0 41px;width:41px;height:41px;border-radius:4px;
}
body.mode-selecting #homePartySummary .home-party-chip.party-chip-drop-target{
  outline:2px solid #b6f4c6;outline-offset:2px;
}
@media(max-width:550px){
  body.mode-selecting #homePartySummary .home-party-entry .home-party-chip-name{max-width:100px;}
  body.mode-selecting #homePartySummary .home-party-entry .home-party-chip[data-class]{gap:5px;font-size:12px;}
  body.mode-selecting #homePartySummary .home-party-entry{padding:3px;}
}


/* V0.29.74 — Purple tint across merchant selection and all three shops;
   use the existing merchant market artwork, not the PvP courtyard. */
body.mode-selecting .play-mode-overlay:has(.merchant-hall),
body.mode-selecting .play-mode-overlay:has(.aldric-shop){
  background:
    linear-gradient(135deg,rgba(66,30,94,.56),rgba(37,18,71,.74)),
    url('/static/backgrounds/merchant_hall.png') center center / cover no-repeat,
    #21132f !important;
}

/* Inventory: put the removal X INSIDE the same rectangular character card.
   Number badge stays separate as a drag handle; neither number nor X changes
   existing party save, item transfer or character selection handlers. */
.world-map-inventory-panel .inventory-roster-character-frame{
  display:flex;align-items:stretch;gap:3px;flex:1 1 0;
  min-width:0;min-height:67px;padding:3px 5px 3px 0;
  border:1px solid rgba(181,141,216,.25);border-radius:10px;
  background:rgba(57,40,76,.55);box-sizing:border-box;
}
.world-map-inventory-panel .inventory-roster-character-frame:has(.world-map-inventory-character-button.is-selected){
  border-color:#d8b4fe;background:rgba(102,55,145,.64);
}
.world-map-inventory-panel .inventory-roster-character-frame .world-map-inventory-character-button{
  flex:1 1 0;min-width:0;width:0;min-height:0;border:0;
  background:transparent;padding:5px 4px 5px 8px;border-radius:9px;
}
.world-map-inventory-panel .inventory-roster-character-frame .world-map-inventory-character-button.is-selected{
  border:0;background:transparent;
}
.world-map-inventory-panel .inventory-roster-character-frame .inventory-roster-remove-button{
  align-self:center;flex:0 0 25px;width:25px;height:25px;margin:0 1px 0 0;
}
@media(max-width:700px){
  .world-map-inventory-panel .inventory-roster-character-frame{min-height:60px;padding:2px 3px 2px 0;}
  .world-map-inventory-panel .inventory-roster-character-frame .inventory-roster-remove-button{
    flex-basis:24px;width:24px;height:24px;
  }
}


/* V0.29.76 — unobtrusive PvP searching/refresh UX and square selection controls. */
.pvp-searching-ellipsis{display:inline-flex;min-width:1.4em;margin-left:2px;letter-spacing:.03em;vertical-align:baseline;}
.pvp-searching-ellipsis>span{display:inline-block;opacity:0;animation:1.35s steps(1,end) infinite;}
.pvp-searching-ellipsis>span:nth-child(1){animation-name:pvp-rolling-dot-one;}
.pvp-searching-ellipsis>span:nth-child(2){animation-name:pvp-rolling-dot-two;}
.pvp-searching-ellipsis>span:nth-child(3){animation-name:pvp-rolling-dot-three;}
@keyframes pvp-rolling-dot-one{0%,100%{opacity:1}}
@keyframes pvp-rolling-dot-two{0%,32%{opacity:0}33%,100%{opacity:1}}
@keyframes pvp-rolling-dot-three{0%,65%{opacity:0}66%,100%{opacity:1}}
@media(prefers-reduced-motion:reduce){.pvp-searching-ellipsis>span{animation:none;opacity:1;}}
/* Both radio choices and Friends Only show a centered solid square, no tick/dot. */
.pvp-hall .pvp-create-form .pvp-visibility-option input[type="radio"],
.pvp-hall .pvp-create-form .pvp-friends-switch input[type="checkbox"]{
  -webkit-appearance:none;appearance:none;box-sizing:border-box;display:inline-grid;place-items:center;
  width:20px;height:20px;min-width:20px;min-height:20px;flex:0 0 20px;margin:0;
  border:1px solid #a390b9;border-radius:3px;background:#1b1724;cursor:pointer;padding:0;
}
.pvp-hall .pvp-create-form .pvp-visibility-option input[type="radio"]::after,
.pvp-hall .pvp-create-form .pvp-friends-switch input[type="checkbox"]::after{
  content:"";width:10px;height:10px;display:block;border-radius:1px;background:#c5a8e9;
  opacity:0;transform:scale(.75);transition:opacity .12s,transform .12s;
}
.pvp-hall .pvp-create-form .pvp-visibility-option input[type="radio"]:checked::after,
.pvp-hall .pvp-create-form .pvp-friends-switch input[type="checkbox"]:checked::after{
  opacity:1;transform:scale(1);
}
.pvp-hall .pvp-create-form .pvp-visibility-option input[type="radio"]:focus-visible,
.pvp-hall .pvp-create-form .pvp-friends-switch input[type="checkbox"]:focus-visible{
  outline:2px solid #e9d6ff;outline-offset:3px;
}

/* V0.29.78 Custom Game slot type, dependent picker and shared full stat dropdown. */
.remote-slot .slot-character-pickers:has(.slot-type){display:grid;grid-template-columns:minmax(96px,.8fr) minmax(0,1.5fr);gap:7px;}
.remote-slot .slot-character-pickers:has(.slot-type) .custom-slot-picker-label{min-width:0;}
.remote-slot-leading{display:flex;flex-direction:column;align-items:center;gap:5px;min-width:0;}
body.mode-selecting .play-mode-card:has(.remote-team-grid) .remote-slot-leading .remote-slot-number{margin-top:0;}
.remote-slot-stats-toggle{display:grid;place-items:center;cursor:pointer;width:30px;height:24px;padding:0;
 border:1px solid #74638d;border-radius:5px;color:#e7dbf5;background:#31243d;font:700 17px/1 system-ui,sans-serif;}
.remote-slot-stats-toggle:hover,.remote-slot-stats-toggle[aria-expanded="true"]{background:#57416e;border-color:#c2a4e5;}
.remote-slot-stats-toggle:focus-visible{outline:2px solid #e8d7fa;outline-offset:2px;}
.remote-slot-stats-toggle:disabled{opacity:.38;cursor:default;}
/* Full stat sheets are rendered in the existing body-level stat sheet portal,
   so they float over the lobby without shifting any character/controller rows. */
@media(max-width:650px){.remote-slot .slot-character-pickers:has(.slot-type){grid-template-columns:1fr;}}

/* V0.29.79: Persistent Gold Shop launcher and alpha-only shop modal.
   Designed to be readable without changing the art of existing game menus. */
.gold-shop-launcher{
 position:fixed;z-index:2850;top:12px;left:14px;min-height:39px;
 display:inline-flex;align-items:center;justify-content:center;gap:6px;
 padding:8px 16px;border:1px solid #a787d4;border-radius:7px;
 background:linear-gradient(180deg,#4a306b,#302042);color:#f5eafb;
 font:700 13px/1.2 system-ui,sans-serif;letter-spacing:.015em;
 box-shadow:0 4px 20px #0b0719a8;cursor:pointer;
}
.gold-shop-launcher:hover{background:linear-gradient(180deg,#614080,#39234f);border-color:#d2b3ef;}
.gold-shop-launcher:focus-visible,.gold-shop-close:focus-visible,.gold-shop-buy:focus-visible{
 outline:2px solid #f1d9ff;outline-offset:3px;
}
body:not(.mode-selecting) .topbar>div:first-child{padding-left:128px;}
.gold-shop-overlay{
 position:fixed;inset:0;z-index:5500;display:flex;align-items:center;justify-content:center;
 padding:18px;overflow:auto;box-sizing:border-box;
 background:rgba(8,6,15,.83);backdrop-filter:blur(6px);
}
.gold-shop-overlay.hidden{display:none!important;}
.gold-shop-panel{
 width:min(1050px,96vw);max-height:min(92dvh,850px);overflow-y:auto;box-sizing:border-box;
 border:1px solid #826b9a;border-radius:13px;
 background:linear-gradient(150deg,#2c2538 0%,#171524 64%,#11131e 100%);
 color:#eee6f9;box-shadow:0 28px 85px #000d,inset 0 1px #ffffff17;
 padding:clamp(17px,3vw,27px);
}
.gold-shop-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:16px;}
.gold-shop-kicker{color:#bca2d9;font:750 10px/1.2 system-ui,sans-serif;letter-spacing:.19em;}
.gold-shop-heading h2{font:400 34px/1.1 "IM Fell English SC",Georgia,serif;margin:6px 0 0;color:#f4e9ff;}
.gold-shop-close{display:grid;place-items:center;flex:0 0 36px;width:36px;height:36px;padding:0;
 background:#35293e;border:1px solid #695470;border-radius:6px;color:#f6e4f5;font:700 26px/1 Arial,sans-serif;cursor:pointer;}
.gold-shop-close:hover{background:#55314f;}
.gold-shop-test-note{padding:12px 14px;border:2px solid #ff4a4a;border-radius:7px;
 background:#bd101b;box-shadow:0 0 0 1px #7e111c,inset 0 1px 0 #ff8080;line-height:1.5;font:700 12px/1.5 system-ui,sans-serif;color:#fff3f3;margin:0 0 17px;}
.gold-shop-test-note strong{color:#fff;letter-spacing:.04em;}
.gold-shop-wallet{font:650 14px/1.4 system-ui,sans-serif;color:#eee1f9;margin:0 0 16px;}
.gold-shop-wallet strong{color:#f5d270;font-size:18px;}
.gold-shop-recipient{display:flex;align-items:center;justify-content:flex-start;gap:10px;flex-wrap:wrap;margin-bottom:19px;}
.gold-shop-recipient label{font:700 13px system-ui,sans-serif;color:#d7c6e6;}
.gold-shop-recipient select{background:#262031;border:1px solid #7a618e;border-radius:6px;color:#f5edff;
 padding:10px 12px;min-width:min(400px,100%);max-width:100%;font:500 13px system-ui,sans-serif;}
.gold-shop-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:11px;}
.gold-pack{display:flex;flex-direction:column;min-width:0;min-height:255px;gap:5px;
 border:1px solid #554d6b;border-radius:9px;padding:15px 12px;
 background:linear-gradient(180deg,rgba(62,49,79,.75),rgba(24,24,37,.95));box-sizing:border-box;}
.gold-pack-supporter{border-color:#a17fc5;background:linear-gradient(180deg,#463256,#292239 60%,#1b1a2b);}
.gold-pack-header{display:flex;flex-direction:column;align-items:flex-start;gap:7px;min-height:44px;}
.gold-pack-label{font:700 12px/1.3 system-ui,sans-serif;color:#e9def5;}
.gold-pack-bonus{font:750 10px/1.2 system-ui,sans-serif;color:#e6c7ff;padding:3px 7px;
 border:1px solid #9e78ca;border-radius:3px;background:#5a3777;}
.gold-pack-amount{display:flex;align-items:baseline;justify-content:center;flex-wrap:wrap;gap:5px;
 margin:7px 0 0;color:#f5eaff;}
.gold-pack-amount strong{font:700 clamp(18px,2.2vw,28px)/1.25 system-ui,sans-serif;letter-spacing:-.055em;font-variant-numeric:tabular-nums;}
.gold-pack-amount>span:last-child{font:600 11px system-ui,sans-serif;color:#ccb8e0;}
.gold-pack-coin{display:inline-grid;place-items:center;align-self:center;width:24px;height:24px;
 border-radius:100%;border:2px solid #dab965;color:#3e2e0e;background:linear-gradient(140deg,#f5e3a7,#b98b38);
 font:800 13px/1 system-ui,sans-serif;box-shadow:inset 0 0 0 2px #f8df8f5e;}
.gold-pack-detail{text-align:center;font:11px/1.4 system-ui,sans-serif;color:#bdb0ca;margin:4px 0 9px;}
.gold-shop-supporter-perks{margin:0 0 9px;padding-left:16px;font:11px/1.45 system-ui,sans-serif;color:#decfe9;}
.gold-shop-supporter-perks li{margin-bottom:5px;}
.gold-pack-footer{display:flex;flex-direction:column;gap:11px;margin-top:auto;align-items:stretch;}
.gold-pack-price{font:750 23px/1 system-ui,sans-serif;color:#f4eaff;text-align:center;}
.gold-pack-price small{font:600 10px system-ui,sans-serif;color:#b7a4c3;}
.gold-shop-buy{min-height:39px;width:100%;padding:8px 7px;border:1px solid #a68abb;border-radius:6px;
 background:linear-gradient(180deg,#704b91,#4b315d);color:#fbf6ff;font:700 11px/1.25 system-ui,sans-serif;cursor:pointer;}
.gold-shop-buy:hover:not(:disabled){border-color:#dac5ed;background:linear-gradient(180deg,#825ca5,#58386c);}
.gold-shop-buy:disabled{opacity:.55;cursor:not-allowed;}
.gold-shop-feedback{min-height:19px;font:600 13px/1.5 system-ui,sans-serif;color:#b4efca;margin:18px 0 0;}
.gold-shop-feedback.gold-shop-error{color:#ffaaaa;}
.gold-shop-own-note{font:12px/1.4 system-ui,sans-serif;color:#cbb6e6;margin-top:14px;}
.gold-shop-loading{font:14px system-ui,sans-serif;color:#cec0dc;}
@media(max-width:930px){.gold-shop-grid{grid-template-columns:repeat(3,minmax(0,1fr));}}
@media(max-width:590px){.gold-shop-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
 .gold-pack{min-height:235px}.gold-shop-overlay{padding:8px}.gold-shop-panel{width:100%;padding:15px;max-height:96dvh;}
 .gold-shop-launcher{top:9px;left:8px;padding:7px 9px;font-size:11px;min-height:33px;}
 body:not(.mode-selecting) .topbar>div:first-child{padding-left:88px;}
 .gold-shop-recipient select{min-width:0;width:100%;}}
@media(max-width:340px){.gold-shop-grid{grid-template-columns:1fr;}}

/* V0.29.87 — Team planning targets. Badges live OUTSIDE the tag on its left;
   badge 1 is nearest the nameplate and additional badges extend farther left.
   The tag retains independent clipping for long names. */
.battle-sprite .sprite-name-holder{
  display:flex;align-items:center;justify-content:center;position:relative;
  flex:0 0 auto;max-width:205px;min-width:0;z-index:25;
}
.battle-sprite .sprite-name-holder .sprite-name{
  min-width:0;max-width:145px;overflow:hidden;text-overflow:ellipsis;
}
.battle-sprite.sprite-elephant .sprite-name-holder .sprite-name{max-width:205px!important;}
.battle-sprite .rf-plan-target-markers{
  position:absolute;right:calc(100% + 5px);top:50%;transform:translateY(-50%);
  display:flex;flex-direction:row-reverse;align-items:center;gap:3px;
  width:max-content;z-index:35;pointer-events:none;
}
.battle-sprite .rf-plan-target-badge{
  width:23px;height:23px;flex:0 0 23px;display:grid;place-items:center;
  border:2px solid #0c0b12;border-radius:5px;
  background:var(--marker-color,#ef4444);color:#fff;
  font:900 13px/1 system-ui,Arial,sans-serif;
  text-shadow:0 1px 2px #141118;box-shadow:0 0 0 1px var(--marker-color),0 2px 7px #000b;
  image-rendering:pixelated;
}
.battle-sprite .rf-plan-target-badge:not(.is-committed){opacity:.75;}
.battle-sprite .rf-plan-target-badge.is-committed{box-shadow:0 0 0 1px var(--marker-color),0 0 10px var(--marker-color),0 2px 7px #000b;}
@media(max-width:900px){.battle-sprite .rf-plan-target-badge{width:19px;height:19px;flex-basis:19px;font-size:11px}.battle-sprite .rf-plan-target-markers{gap:2px;right:calc(100% + 3px)}}

/* V0.29.89 — native 8-bit pixel art instead of SVG emblems. */
.aldric-item-circle > .rf-gear-emblem {
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}


/* V0.29.92 — Pixel-art gear is never framed by the legacy blue circle.
   In particular, the Uncommon rarity override on Mira's shop previously
   restored a green circular border and glow over valid item sprites.
   The surrounding square still shows item rarity and remains interactive. */
.aldric-item-circle:has(> img.rf-gear-emblem),
.mira-shop .aldric-item-node[data-rarity="Uncommon"] .aldric-item-circle:has(> img.rf-gear-emblem),
.mira-shop .aldric-item-circle:has(> img.rf-gear-emblem):hover,
.mira-shop .aldric-item-circle:has(> img.rf-gear-emblem):focus-visible,
.inventory-screen .aldric-item-circle:has(> img.rf-gear-emblem) {
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.aldric-item-circle > img.rf-gear-emblem {
  display: block;
  flex: 0 0 auto;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain;
  object-position: 50% 50%;
  image-rendering: pixelated;
}




/* v0.29.93: never restore the old circular item button around gear art, including Mira Uncommons. */
.mira-shop .aldric-item-node .aldric-item-circle:has(img.rf-gear-emblem),
.aldric-item-node .aldric-item-circle:has(img.rf-gear-emblem),
.inventory-screen .aldric-item-circle:has(img.rf-gear-emblem) {
  border:0!important; border-radius:0!important; background:none!important;
  box-shadow:none!important; outline:none!important; overflow:visible;
}
.aldric-item-circle img.rf-gear-emblem {
  width:100%!important; height:100%!important; object-fit:contain!important;
  object-position:center!important; image-rendering:pixelated;
}


/* v0.29.94 hotfix — restore padded inventory item art fit like the earlier good pass. */
.aldric-item-circle:has(> img.rf-gear-emblem),
.inventory-screen .aldric-item-circle:has(> img.rf-gear-emblem),
.mira-shop .aldric-item-circle:has(> img.rf-gear-emblem) {
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  overflow:visible !important;
}
.aldric-item-circle > img.rf-gear-emblem,
.aldric-item-circle img.rf-gear-emblem {
  width:78% !important;
  height:78% !important;
  max-width:78% !important;
  max-height:78% !important;
  object-fit:contain !important;
  object-position:center center !important;
  image-rendering:pixelated !important;
  flex:0 0 auto !important;
  display:block !important;
  margin:auto !important;
}

/* v0.30.05: Hack3r Man's all-class deck sorting / section labels. */
.inventory-deck-class-heading{grid-column:1/-1;margin:18px 2px 4px;color:#e6d4ab;font-size:1.12rem;font-variant:small-caps;letter-spacing:.045em;border-bottom:1px solid #55486b;padding:0 0 8px;}
.inventory-view-progression:disabled{opacity:.35;filter:grayscale(1);cursor:not-allowed;pointer-events:none;}


/* V0.30.06 — Maxwell's real daily skins and the independent cosmetic slot. */
.maxwell-shop .aldric-shop-main{min-width:0}
.maxwell-shop-help,.maxwell-rotation{font-size:12px;color:#cab7e5;line-height:1.55}
.maxwell-skin-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(145px,1fr));gap:12px;margin:15px 0 25px}
.maxwell-skin-tile{min-width:0;display:flex;flex-direction:column;align-items:center;gap:9px;padding:12px;border:1px solid rgba(195,156,220,.29);border-radius:12px;background:#141322}
.maxwell-skin-tile.maxwell-skin-eligible{border-color:#9d73ce;background:#211a30}
.maxwell-skin-tile>img{width:100%;height:132px;object-fit:contain;image-rendering:pixelated;filter:drop-shadow(0 8px 5px rgba(0,0,0,.5))}
.maxwell-skin-info{display:flex;flex:1;flex-direction:column;align-items:center;gap:7px;text-align:center;width:100%;font-size:12px;color:#c7b4db}
.maxwell-skin-info strong{font-family:'IM Fell English SC',Georgia,serif;font-size:17px;color:#f3e4ff}
.maxwell-skin-info .maxwell-buy{margin-top:auto;min-height:34px;padding:7px 12px;font-size:12px;width:100%}
.maxwell-skin-info .maxwell-buy:disabled{opacity:.46;cursor:not-allowed}
.inventory-skin-section{margin:16px 0}
.inventory-skin-equipped{display:flex;align-items:center;gap:14px;padding:12px 18px;border:1px solid rgba(192,132,252,.25);border-radius:12px;background:#181423}
.inventory-skin-preview{width:84px;height:90px;object-fit:contain;image-rendering:pixelated;flex-shrink:0}
.inventory-skin-label{display:flex;flex-direction:column;gap:5px;flex:1;min-width:0}
.inventory-skin-label strong{color:#f8e4ff;font-size:20px;font-family:'IM Fell English SC',Georgia,serif}
.inventory-skin-label span,.inventory-skin-bag-entry small{color:#af9cbe;font-size:12px}
.inventory-skin-bag-entry{display:flex;align-items:center;gap:14px;padding:10px 14px;border:1px solid rgba(150,98,203,.38);border-radius:10px;background:#1b142a;min-width:0}
.inventory-skin-bag-entry img{width:65px;height:72px;object-fit:contain;image-rendering:pixelated}
.inventory-skin-bag-entry>span{display:flex;flex-direction:column;gap:5px;flex:1;min-width:0}
.inventory-skin-bag-entry strong{font-size:16px;color:#f4d9ff}
.inventory-skin-bag-entry .mode-button{margin-left:auto;min-width:70px}
.inventory-owned-skins{display:flex;flex-direction:column;gap:10px;margin-top:12px}
.inventory-skin-section .inventory-bag-empty{margin-top:10px}
@media(max-width:650px){.maxwell-skin-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.inventory-skin-equipped{flex-wrap:wrap}.inventory-skin-bag-entry{gap:8px}}


/* V0.30.08 — concise Maxwell shop, one daily highlighted price, class color tags. */
.maxwell-shop .maxwell-rotation{display:inline-flex;margin:8px 0 10px}
.maxwell-class-name{display:inline-block;border-radius:5px;padding:2px 8px;border:1px solid currentColor;font-weight:800;letter-spacing:.04em;color:#ded4e8}
.maxwell-class-name[data-class="warrior"]{color:#c76868}
.maxwell-class-name[data-class="paladin"]{color:#d5b46e}
.maxwell-class-name[data-class="rogue"]{color:#ff7d13}
.maxwell-class-name[data-class="ranger"]{color:#b97845}
.maxwell-class-name[data-class="mage"]{color:#6477ed}
.maxwell-class-name[data-class="cleric"]{color:#f2df86}
.maxwell-class-name[data-class="bard"]{color:#84e4e6}
.maxwell-class-name[data-class="necromancer"]{color:#4a4a4a}
.maxwell-class-name[data-class="warlock"]{color:#8d58bd}
.maxwell-class-name[data-class="druid"]{color:#4b7d55}
/* V0.31.93 — On-sale skins: original → discounted on top; percentage below. */
.maxwell-price-row{min-height:43px;display:flex;align-items:center;justify-content:center;width:100%;font-size:12px;font-weight:700}
.maxwell-discount-pricing{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;max-width:100%;}
.maxwell-discount-amounts{display:flex;align-items:center;justify-content:center;flex-wrap:nowrap;gap:10px;max-width:100%;white-space:nowrap;font-variant-numeric:tabular-nums;}
.maxwell-original-price{position:relative;display:inline-flex;align-items:center;color:#b8a8bd;font-weight:600;text-decoration-line:line-through;text-decoration-color:#ff3b3b;text-decoration-thickness:2px;text-decoration-skip-ink:none;}
/* Strong visible strike across both the Ether amount and its small icon. */
.maxwell-original-price::after{content:"";position:absolute;left:0;right:0;top:50%;height:2px;background:#ff3b3b;pointer-events:none;}
.maxwell-sale-price{color:#f5d4ff;font-size:14px;font-weight:900;}
.maxwell-sale-label{display:block;color:#ff6565;font-weight:900;font-size:11px;letter-spacing:.02em;line-height:1.15;}
/* Equalize the visible stature of 64/90/124/128 pixel skins via battle-normalized sprites. */
.battle-sprite.sprite-player{--rf-sprite-size:164px!important}
.battle-sprite.sprite-player>img{width:var(--rf-sprite-size)!important;height:var(--rf-sprite-size)!important;object-fit:contain!important;image-rendering:pixelated!important}
@media(max-width:1180px){.battle-sprite.sprite-player{--rf-sprite-size:140px!important}}
@media(max-width:650px){.battle-sprite.sprite-player{--rf-sprite-size:112px!important}}


/* V0.30.10 — Inventory cosmetics are actual gear-size draggable squares. */
.inventory-screen .inventory-collections{
  display:grid;grid-template-columns:minmax(0,1fr);
  grid-template-rows:auto auto minmax(105px,1fr);
  gap:14px;min-width:0;align-items:start;
}
.inventory-screen .inventory-skin-section{margin:0;min-width:0;position:relative;z-index:1}
.inventory-screen .inventory-skin-slot-row{display:flex;align-items:center;gap:12px;min-height:82px;min-width:0}
.inventory-screen .inventory-skin-slot,.inventory-screen .inventory-skin-bag-tile{
  box-sizing:border-box;flex:0 0 82px;width:82px;height:82px;
  border:2px solid #ad75e3;border-radius:11px;
  background:linear-gradient(145deg,#35204d,#211535);
  display:flex;align-items:center;justify-content:center;
  box-shadow:inset 0 0 0 1px rgba(211,161,255,.15);
  position:relative;cursor:grab;min-width:0;
}
.inventory-screen .inventory-skin-slot{cursor:default}
.inventory-screen .inventory-skin-equipped-token,
.inventory-screen .inventory-skin-bag-tile img{
  display:block;width:100%;height:100%;padding:4px;box-sizing:border-box;
  object-fit:contain;image-rendering:pixelated;
}
.inventory-screen .inventory-skin-slot img[draggable="true"]{cursor:grab}
.inventory-screen .inventory-skin-slot-name{display:flex;flex-direction:column;gap:4px;min-width:0}
.inventory-screen .inventory-skin-slot-name strong{font-family:'IM Fell English SC',Georgia,serif;font-size:17px;color:#efd6ff}
.inventory-screen .inventory-skin-slot-name span{font-size:11px;color:#ac9aba}
.inventory-screen .inventory-skin-bag-tile:hover,.inventory-screen .inventory-skin-bag-tile:focus-visible{
  outline:2px solid #d7adff;outline-offset:2px;background:#4a3068;
}
.inventory-screen .inventory-skin-slot.is-equip-target,
.inventory-screen .inventory-skin-slot.is-drag-over{
  border-color:#f0d3ff;background:#513375;box-shadow:0 0 19px #bc7aff80;
}
.inventory-screen .inventory-skin-transfer-targets{display:none;gap:8px;flex-wrap:wrap;margin:10px 0 0}
.inventory-screen .inventory-skin-transfer-targets.skin-drag-transfer-active:not(:empty){display:flex}
.inventory-screen .inventory-skin-transfer-chip{
  display:flex;align-items:center;gap:5px;border:1px dashed #a777cd;
  border-radius:9px;padding:5px 8px;min-width:88px;height:38px;background:#261935;
  font-size:12px;color:#e8d5fa;
}
.inventory-screen .inventory-skin-transfer-chip.is-drag-over{border-color:#e3adff;background:#513575}
.inventory-screen .inventory-skin-transfer-portrait{width:26px;height:30px;object-fit:contain;image-rendering:pixelated}
.inventory-screen .inventory-bag{display:flex;flex-direction:row;gap:12px;flex-wrap:wrap;align-items:flex-start;align-content:flex-start;min-width:0}
.inventory-screen .inventory-bag-section{min-width:0;position:relative;z-index:1}
/* Map inventory has three sections now; reserve a real row for Skin.
   Do not overlay Skin and Inventory on the equipment tiles. */
.world-map-inventory-character .inventory-collections{
  grid-template-columns:minmax(0,1fr)!important;
  grid-template-rows:auto auto minmax(85px,1fr)!important;
  gap:9px!important;min-height:0;overflow:hidden;
}
.world-map-inventory-character .inventory-bag-section{min-height:0!important;overflow:hidden!important}
.world-map-inventory-character .inventory-bag{overflow-y:auto!important;min-height:0!important;flex:1!important}
@media(max-width:650px){
  .inventory-screen .inventory-skin-slot,.inventory-screen .inventory-skin-bag-tile{width:72px;height:72px;flex-basis:72px}
}
/* PvE Continue is below the battle reward receipts, not in the topbar. */
.center-column .pve-continue-button{
  display:block;position:relative;margin:10px auto 22px;
  width:min(470px,calc(100vw - 32px));max-width:100%;
  min-height:43px;z-index:81;pointer-events:auto;
  font-family:'IM Fell English SC',Georgia,serif;font-size:18px;text-align:center;
}
.center-column .pve-continue-button.hidden{display:none!important}

/* V0.30.10 battle utility swap: time left, actions center, card count right. */
body.team-planning .team-plan-fighter .team-plan-utility-bar .team-plan-timer{justify-self:start!important}
body.team-planning .team-plan-fighter .team-plan-utility-bar .team-plan-cards-pill{justify-self:end!important}
@media(max-width:740px){
  /* Timer is the compact left-hand pill; card count needs the wider right-hand area. */
  body.team-planning .team-plan-fighter .team-plan-utility-bar{
    grid-template-columns:minmax(58px,64px) minmax(0,3.5fr) minmax(80px,1fr)!important;
  }
}

/* V0.30.11 — all account-owned cosmetics visible; incompatible class greyed. */
.inventory-screen .inventory-skin-bag-tile{isolation:isolate;overflow:visible}
.inventory-screen .inventory-skin-bag-tile.skin-class-locked>img{filter:grayscale(1);opacity:.37}
.inventory-screen .inventory-skin-bag-tile.skin-held-elsewhere:not(.skin-class-locked)>img{opacity:.68}
.inventory-screen .inventory-skin-bag-tile:hover,
.inventory-screen .inventory-skin-bag-tile:focus-visible{
  z-index:25;outline:2px solid #f4d8ff;outline-offset:2px;
  border-color:#e2b1ff;background:#4b3074;
  box-shadow:0 0 16px rgba(181,119,255,.74),inset 0 0 0 1px rgba(249,230,255,.35);
  transform:translateY(-2px);transition:box-shadow .12s ease,transform .12s ease;
}
.inventory-screen .inventory-skin-tooltip{
  display:none;pointer-events:none;position:absolute;left:50%;bottom:calc(100% + 8px);
  transform:translateX(-50%);width:max-content;max-width:230px;z-index:30;
  padding:8px 12px;background:#1e132b;border:1px solid #cc8ef9;border-radius:8px;
  box-shadow:0 6px 25px rgba(0,0,0,.7);color:#f5dfff;text-align:center;
  font-size:12px;line-height:1.3;white-space:normal;
}
.inventory-screen .inventory-skin-tooltip strong{display:block;font-size:13px;margin-bottom:3px}
.inventory-screen .inventory-skin-tooltip span{display:block;color:#d7b7f2}
.inventory-screen .inventory-skin-tooltip small{display:block;margin-top:3px;color:#9f8bb6}
.inventory-screen .inventory-skin-bag-tile:hover .inventory-skin-tooltip,
.inventory-screen .inventory-skin-bag-tile:focus-visible .inventory-skin-tooltip{display:block}
/* Keep swapped timer/card-count near the action controls, not at opposite edges. */
body.team-planning .team-plan-fighter .team-plan-utility-bar{
  width:min(660px,100%)!important;max-width:100%!important;
  grid-template-columns:minmax(58px,78px) minmax(0,1fr) minmax(104px,142px)!important;
  justify-content:center!important;gap:8px!important;margin-inline:auto!important;
}
@media(max-width:740px){body.team-planning .team-plan-fighter .team-plan-utility-bar{
  grid-template-columns:minmax(51px,60px) minmax(0,1fr) minmax(78px,102px)!important;
  gap:5px!important;
}}

/* V0.30.11 — choose X Mana at card selection, centered on the battlefield. */
.rf-x-mana-overlay{
  position:fixed;inset:0;z-index:25000;display:flex;align-items:center;
  justify-content:center;padding:20px;background:rgba(5,3,13,.78);
  backdrop-filter:blur(3px);
}
.rf-x-mana-dialog{
  box-sizing:border-box;width:min(440px,95vw);max-height:86vh;overflow:auto;
  border:2px solid #a979e1;border-radius:16px;padding:24px;
  background:linear-gradient(160deg,#2e203f,#151020 70%);
  color:#f4e6ff;box-shadow:0 14px 52px #000d,0 0 28px #9153c855;
  text-align:center;font-family:Georgia,serif;
}
.rf-x-mana-heading{font:26px 'IM Fell English SC',Georgia,serif;color:#f4d8ff}
.rf-x-mana-dialog p{font-size:15px;line-height:1.55;margin:9px 0 18px}
.rf-x-mana-choices{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;margin-bottom:20px}
.rf-x-mana-value{
  min-height:48px;border-radius:9px;border:1px solid #9560cf;
  background:linear-gradient(155deg,#46315d,#2b1d3c);color:#ffecae;
  font-size:21px;font-weight:bold;cursor:pointer;box-shadow:inset 0 0 0 1px #cda2e42d;
}
.rf-x-mana-value:is(:hover,:focus-visible){background:#624082;outline:2px solid #f4d7ff;outline-offset:1px;box-shadow:0 0 13px #bb83ff99}
.rf-x-mana-cancel{min-width:150px}
@media(max-width:380px){.rf-x-mana-dialog{padding:18px}.rf-x-mana-choices{gap:4px}.rf-x-mana-value{min-height:42px}}


/* V0.30.12 — Forest gnome replacement assets, gameplay-relative animal sizes.
   Size is based on the ACTUAL visible character, not the original 1254px canvas.
   Gnomes use 160x160 normalized files. Elephants must dominate the animal
   scale ladder (old 192px was barely bigger than a RealmWalker at 164px). */
.battle-sprite.sprite-forest-gnome{--rf-sprite-size:116px!important}
.battle-sprite.sprite-forest-gnome-juvenile{--rf-sprite-size:102px!important}
.battle-sprite.sprite-forest-gnome-adult{--rf-sprite-size:112px!important}
.battle-sprite.sprite-forest-gnome-elder{--rf-sprite-size:118px!important}
.battle-sprite.sprite-forest-gnome-sentinel{--rf-sprite-size:118px!important}
.battle-sprite.sprite-forest-gnome-warden{--rf-sprite-size:122px!important}
.battle-sprite.sprite-gnome-brawler,
.battle-sprite.sprite-gnome-scout,
.battle-sprite.sprite-gnome-warrior,
.battle-sprite.sprite-gnome-fighter{--rf-sprite-size:115px!important}
.battle-sprite.sprite-raccoon{--rf-sprite-size:80px!important}
.battle-sprite.sprite-deer,.battle-sprite.sprite-stag{--rf-sprite-size:132px!important}
.battle-sprite.sprite-wolf{--rf-sprite-size:120px!important}
.battle-sprite.sprite-boar{--rf-sprite-size:125px!important}
.battle-sprite.sprite-tiger{--rf-sprite-size:148px!important}
.battle-sprite.sprite-bear{--rf-sprite-size:172px!important}
.battle-sprite.sprite-elephant{--rf-sprite-size:258px!important}
/* A larger animal must be allowed to extend above its anchor; the slot keeps
   its original foot position and name/HP controls. */
.battle-sprite.sprite-elephant{overflow:visible!important}
@media(max-width:1180px){
  .battle-sprite.sprite-forest-gnome-juvenile{--rf-sprite-size:90px!important}
  .battle-sprite.sprite-forest-gnome-adult,
  .battle-sprite.sprite-forest-gnome-elder,
  .battle-sprite.sprite-forest-gnome-sentinel,
  .battle-sprite.sprite-forest-gnome-warden{--rf-sprite-size:105px!important}
  .battle-sprite.sprite-raccoon{--rf-sprite-size:69px!important}
  .battle-sprite.sprite-deer,.battle-sprite.sprite-stag{--rf-sprite-size:116px!important}
  .battle-sprite.sprite-wolf{--rf-sprite-size:104px!important}
  .battle-sprite.sprite-boar{--rf-sprite-size:109px!important}
  .battle-sprite.sprite-tiger{--rf-sprite-size:130px!important}
  .battle-sprite.sprite-bear{--rf-sprite-size:147px!important}
  .battle-sprite.sprite-elephant{--rf-sprite-size:216px!important}
}
@media(max-width:650px){
  .battle-sprite.sprite-forest-gnome-juvenile{--rf-sprite-size:70px!important}
  .battle-sprite.sprite-forest-gnome-adult,
  .battle-sprite.sprite-forest-gnome-elder,
  .battle-sprite.sprite-forest-gnome-sentinel,
  .battle-sprite.sprite-forest-gnome-warden{--rf-sprite-size:82px!important}
  .battle-sprite.sprite-raccoon{--rf-sprite-size:54px!important}
  .battle-sprite.sprite-deer,.battle-sprite.sprite-stag{--rf-sprite-size:92px!important}
  .battle-sprite.sprite-wolf{--rf-sprite-size:83px!important}
  .battle-sprite.sprite-boar{--rf-sprite-size:86px!important}
  .battle-sprite.sprite-tiger{--rf-sprite-size:105px!important}
  .battle-sprite.sprite-bear{--rf-sprite-size:125px!important}
  .battle-sprite.sprite-elephant{--rf-sprite-size:175px!important}
}

/* V0.30.14 — scrolling complete character inventory: gear + skins can
   never force the bag or deletion confirmation past an unreachable boundary. */
.world-map-inventory-character{
  height:100%!important;min-height:0!important;
  overflow-x:hidden!important;overflow-y:auto!important;
  overscroll-behavior-y:contain;scrollbar-width:thin!important;
  scrollbar-color:#956bb2 transparent;
  padding-right:6px!important;
}
.world-map-inventory-character::-webkit-scrollbar{display:block!important;width:8px}
.world-map-inventory-character::-webkit-scrollbar-thumb{
  background:#74548d;border-radius:9px;
}
.world-map-inventory-character .inventory-screen{
  display:block!important;height:auto!important;min-height:100%!important;
  overflow:visible!important;padding-bottom:24px!important;
}
.world-map-inventory-character .inventory-collections{
  display:grid!important;grid-template-columns:minmax(0,1fr)!important;
  grid-template-rows:auto auto auto!important;
  overflow:visible!important;min-height:0!important;
}
.world-map-inventory-character .inventory-equipment-section,
.world-map-inventory-character .inventory-skin-section,
.world-map-inventory-character .inventory-bag-section{
  overflow:visible!important;min-height:0!important;
}
.world-map-inventory-character .inventory-bag{
  height:auto!important;max-height:none!important;overflow:visible!important;
  flex:0 0 auto!important;align-content:flex-start;
}
/* Full-screen Home inventory already scrolls inside its enclosing card. */
body.mode-selecting .play-mode-card:has(#modeContent > .inventory-screen){
  overflow-y:auto!important;max-height:92dvh;
}
.inventory-delete-inline{
  margin:12px 0 18px;padding:16px 18px;
  border:1px solid rgba(248,113,113,.36);border-radius:12px;
  background:rgba(55,15,29,.48);
}
.inventory-delete-inline.hidden{display:none!important}
.inventory-screen .inventory-delete-toggle{
  color:#fecaca;border-color:rgba(248,113,113,.5);
}
.inventory-screen .inventory-delete-toggle:hover{
  background:rgba(127,29,29,.22);border-color:#f87171;
}


/* V0.30.15 — PvP arena interface refresh. Only PvP menu screens; never
   apply these styles to the forest battle viewport or combat sprites. */
body.mode-selecting .play-mode-card:has(.pvp-hall){
  width:min(1060px,95vw);max-width:1060px;
  padding:clamp(17px,2.1vw,30px) clamp(18px,2.4vw,34px);
  border:1px solid rgba(186,153,221,.49);border-radius:16px;
  background:linear-gradient(158deg,rgba(39,29,55,.965),rgba(23,20,34,.97) 65%,rgba(23,19,32,.975));
  box-shadow:0 26px 85px rgba(9,4,17,.76),inset 0 1px rgba(240,213,255,.08);
}
body.mode-selecting .play-mode-overlay:has(.pvp-hall){
  background:linear-gradient(122deg,rgba(31,18,44,.75),rgba(30,19,48,.71) 55%,rgba(16,12,30,.80)),url('/static/backgrounds/pvp_courtyard.png') center/cover no-repeat !important;
}
.pvp-hall{gap:0;color:#f0e9f6;min-width:0;}
.pvp-hall-top{
  padding:0 0 19px;border-bottom:1px solid rgba(178,155,206,.3);
  align-items:center;min-height:56px;
}
.pvp-hall-identity{display:flex;align-items:center;gap:15px;min-width:0;}
.pvp-hall-crest{
  display:grid;place-items:center;flex:0 0 50px;width:50px;height:50px;
  color:#dec6f6;border:1px solid #7b6297;border-radius:12px;
  background:linear-gradient(145deg,#594273,#2a233a);box-shadow:inset 0 1px rgba(255,255,255,.13);
}
.pvp-hall-crest svg{width:31px;height:31px;}
.pvp-hall-top h2{font:600 clamp(24px,2.7vw,34px)/1.12 'IM Fell English SC',Georgia,serif;color:#f8f0ff;letter-spacing:.008em;}
.pvp-hall .mode-button{min-height:40px;padding:9px 17px;border-radius:8px;border-color:#655477;background:#332b45;font:650 13px system-ui,sans-serif;transition:background .16s,border-color .16s,transform .16s;}
.pvp-hall .mode-button:not(:disabled):hover{background:#4a3a62;border-color:#c1a1ec;}
.pvp-hall .mode-button:focus-visible,.pvp-hall .pvp-hall-choice:focus-visible,.pvp-hall .pvp-ledger-tab:focus-visible{outline:2px solid #e2cbff;outline-offset:3px;}
.pvp-hall .mode-button.primary{background:linear-gradient(135deg,#775a9c,#5c427d);border-color:#ad8dd4;color:#fff5ff;box-shadow:inset 0 1px rgba(255,255,255,.12);}
.pvp-hall .mode-button.primary:not(:disabled):hover{background:linear-gradient(135deg,#9573bd,#705090);border-color:#d1afed;}
.pvp-hall-modes{
  width:min(870px,100%);margin:0 auto;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));
  gap:20px;padding:32px 0 14px;
}
.pvp-hall .pvp-hall-choice{
  box-sizing:border-box;isolation:isolate;position:relative;overflow:hidden;
  display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;
  min-height:264px;min-width:0;gap:0;padding:25px;
  text-align:left;color:#f3eafa;border:1px solid #655577;border-radius:13px;
  background:linear-gradient(145deg,#352a48,#221c30 72%);
  box-shadow:0 12px 30px rgba(0,0,0,.25),inset 0 1px rgba(255,255,255,.075);
  transition:transform .16s,border-color .16s,background .16s,box-shadow .16s;
}
.pvp-hall .pvp-hall-choice::before{
  content:"";position:absolute;z-index:-1;inset:-50px -60px auto auto;
  width:230px;height:230px;border-radius:50%;pointer-events:none;
  background:radial-gradient(circle,rgba(171,123,227,.14),transparent 69%);
}
.pvp-hall .pvp-mode-matchmaking{border-color:#81714e;background:linear-gradient(145deg,#3d3540,#25202c 75%);}
.pvp-hall .pvp-mode-matchmaking::before{background:radial-gradient(circle,rgba(217,173,91,.18),transparent 69%);}
.pvp-hall .pvp-hall-choice:hover{transform:translateY(-3px);border-color:#c5a4e8;background:linear-gradient(145deg,#49365d,#292037 72%);box-shadow:0 17px 32px rgba(0,0,0,.32),0 0 0 1px rgba(164,118,209,.14);}
.pvp-hall .pvp-mode-matchmaking:hover{border-color:#dbb971;background:linear-gradient(145deg,#514337,#2e2433 72%);box-shadow:0 17px 32px rgba(0,0,0,.32),0 0 0 1px rgba(220,177,107,.17);}
.pvp-choice-visual{
  display:grid;place-items:center;width:72px;height:72px;margin:0 0 17px;
  color:#e2c8ff;border:1px solid rgba(178,142,210,.38);border-radius:12px;
  background:linear-gradient(150deg,rgba(145,102,188,.24),rgba(62,47,81,.30));
}
.pvp-mode-matchmaking .pvp-choice-visual{color:#f0d59a;border-color:rgba(217,179,101,.43);background:linear-gradient(150deg,rgba(180,143,75,.24),rgba(79,60,46,.25));}
.pvp-choice-visual svg{width:48px;height:48px;filter:drop-shadow(0 2px 5px rgba(0,0,0,.25));}
.pvp-choice-copy{display:flex;flex-direction:column;align-items:flex-start;gap:6px;min-width:0;}
.pvp-hall .pvp-hall-choice .pvp-choice-copy strong{font:600 clamp(23px,2.7vw,30px)/1.14 'IM Fell English SC',Georgia,serif;color:#fff1ff;}
.pvp-hall .pvp-hall-choice .pvp-choice-copy small{font:14px/1.5 system-ui,sans-serif;color:#cbbdd7;margin:0;}
.pvp-hall .pvp-hall-choice .pvp-choice-foot{
  display:flex;align-items:center;justify-content:space-between;align-self:stretch;
  gap:10px;margin-top:auto;padding-top:18px;
  color:#e7cff9;border-top:1px solid rgba(191,166,216,.19);font:650 13px/1.3 system-ui,sans-serif;
}
.pvp-hall .pvp-mode-matchmaking .pvp-choice-foot{color:#f0d59a;border-color:rgba(225,184,106,.2);}
.pvp-choice-arrow{display:grid;place-items:center;flex:0 0 34px;width:34px;height:34px;font:700 23px/1 system-ui,sans-serif;border:1px solid currentColor;border-radius:9px;transition:transform .16s,background .16s;}
.pvp-hall-choice:hover .pvp-choice-arrow{transform:translateX(3px);background:rgba(255,255,255,.09);}
/* Better rhythm for queue/match browsers, without altering the actual team slots. */
.pvp-ledger-tabs{gap:8px;padding:21px 0 12px;border-bottom:1px solid rgba(163,133,194,.28);align-items:center;}
.pvp-hall .pvp-ledger-tab{min-height:42px;border:1px solid #5b4c6c;border-radius:9px;padding:10px 17px;background:#292438;font:650 13px/1.35 system-ui,sans-serif;color:#cbbbdc;}
.pvp-hall .pvp-ledger-tab:hover{background:#392d4c;color:#fff;}
.pvp-hall .pvp-ledger-tab.active,.pvp-hall .pvp-ledger-tab[aria-selected="true"]{background:#5b4379;border-color:#a98acd;color:#fff5ff;box-shadow:inset 0 1px rgba(255,255,255,.11);}
.pvp-hall .pvp-ledger-tab.active::after,.pvp-hall .pvp-ledger-tab[aria-selected="true"]::after{display:none;}
.pvp-ledger-page{padding:16px 0 0;min-height:235px;}
.pvp-hall .pvp-queue-panel{padding:12px 0 0;}
.pvp-queue-party-wrap{max-width:600px;}
.pvp-queue-party-wrap .world-map-party-queue{border-radius:12px;border:1px solid rgba(155,116,192,.49);background:linear-gradient(150deg,#2e2440,#241d34);box-shadow:0 10px 27px rgba(10,5,21,.2);}
.pvp-queue-actions{margin:19px 0 10px;gap:12px;}
.pvp-queue-actions .mode-button{min-width:188px;min-height:44px;}
.pvp-hall .pvp-match-list{background:transparent;border:0!important;border-radius:0;min-height:130px;display:flex;flex-direction:column;gap:12px;overflow:visible;}
.pvp-room-browser-head{border-radius:8px;border-color:#51425f;background:#31263f;padding:11px 15px;}
.pvp-room-browser-row,.pvp-room-browser-row:nth-child(even){
  border:1px solid #554462;border-radius:11px;
  background:linear-gradient(150deg,rgba(43,34,57,.97),rgba(32,27,45,.97));
  padding:15px;gap:17px;transition:border-color .15s,background .15s;
}
.pvp-room-browser-row:hover{border-color:#8466a6;background:linear-gradient(150deg,#362847,#292337);}
.pvp-room-browser-info{gap:7px;}
.pvp-room-browser-info strong{font:650 16px/1.35 system-ui,sans-serif;}
.pvp-room-browser-info .mode-button{min-height:36px;margin-top:7px;}
.pvp-room-teams{gap:12px;}
.pvp-room-team{padding:9px 10px 11px;border:1px solid #4d3d5e;border-radius:9px;background:rgba(16,12,25,.27);gap:8px;}
.pvp-room-team-label{letter-spacing:.10em;color:#d7c3ef;font-size:10px;}
.pvp-room-team-slots{gap:6px;}
.pvp-room-slot{border-radius:7px;border-color:#594668;background:#1d1829;}
.pvp-room-slot-open{background:#252e27;border-color:#678569;color:#c4edb6;}
.pvp-room-slot-open:hover{background:#314638;border-color:#a5d79a;}
.pvp-room-slot-empty{color:#756987;}
.pvp-hall .pvp-browser-empty,.pvp-hall .pvp-hall-loading{border:1px dashed rgba(152,120,185,.4);border-radius:10px;padding:35px 18px;background:rgba(31,25,42,.65);color:#c4b7d3;}
.pvp-hall .pvp-create-form,.pvp-hall .pvp-private-join,.pvp-hall .pvp-friend-section{border:1px solid #604b70;border-radius:12px;background:linear-gradient(145deg,#30263d,#211b2d);box-shadow:0 10px 25px rgba(0,0,0,.12);}
.pvp-hall .pvp-visibility-option{border-radius:9px;}
.pvp-hall .pvp-visibility-option:has(input:checked){background:#463456;border-color:#ac85cc;}
.pvp-hall .pvp-private-join{margin-top:18px;}
.pvp-hall .pvp-private-join input,.pvp-hall .pvp-create-form input:not([type=checkbox]),.pvp-hall .pvp-add-friend input{min-height:41px;border-radius:7px;}
.pvp-custom-create-tab{margin-left:auto!important;}
@media(max-width:760px){
 body.mode-selecting .play-mode-card:has(.pvp-hall){width:min(100vw - 20px,650px);max-height:94dvh;padding:18px 15px;border-radius:12px;}
 .pvp-hall-modes{gap:12px;padding:21px 0 8px;}
 .pvp-hall .pvp-hall-choice{min-height:240px;padding:17px;}
 .pvp-choice-visual{width:58px;height:58px;margin-bottom:15px;}
 .pvp-choice-visual svg{width:39px;height:39px;}
 .pvp-hall .pvp-hall-choice .pvp-choice-copy strong{font-size:23px;}
 .pvp-hall .pvp-hall-choice .pvp-choice-copy small{font-size:12px;}
 .pvp-hall-crest{width:43px;height:43px;flex-basis:43px;}
 .pvp-hall-crest svg{width:26px;height:26px;}
 .pvp-hall .pvp-ledger-tab{padding:9px 12px;min-height:38px;font-size:12px;}
 .pvp-room-browser-row{grid-template-columns:minmax(0,1fr);}
}
@media(max-width:540px){
 .pvp-hall-top{padding-bottom:15px;gap:8px;}
 .pvp-hall-identity{gap:9px;}
 .pvp-hall-top h2{font-size:24px;}
 .pvp-hall .pvp-hall-back{min-height:35px;padding:7px 10px;font-size:12px;}
 .pvp-hall-modes{grid-template-columns:1fr;max-width:410px;padding-top:18px;}
 .pvp-hall .pvp-hall-choice{min-height:162px;padding:17px 18px;}
 .pvp-choice-visual{position:absolute;top:17px;right:18px;width:48px;height:48px;margin:0;opacity:.90;}
 .pvp-choice-visual svg{width:32px;height:32px;}
 .pvp-choice-copy{padding:5px 58px 0 0;}
 .pvp-hall .pvp-hall-choice .pvp-choice-copy strong{font-size:23px;}
 .pvp-hall .pvp-hall-choice .pvp-choice-copy small{font-size:12px;}
 .pvp-hall .pvp-hall-choice .pvp-choice-foot{padding-top:12px;margin-top:20px;}
 .pvp-ledger-tabs{gap:6px;}
 .pvp-custom-create-tab{margin-left:0!important;flex:1 0 100%;}
 .pvp-room-team{padding:7px;}
}


/* V0.30.16 — Arcane UI resource icons and Bag labeling. */
.currency-row>div.currency-tile{position:relative;overflow:hidden}
.currency-row>div.currency-tile span{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:700;letter-spacing:.03em}
.currency-icon{width:20px;height:20px;image-rendering:pixelated;flex:0 0 auto}
.currency-row .currency-tile strong{padding-left:28px}
.currency-row .currency-gold{background:linear-gradient(180deg,rgba(87,60,17,.42),rgba(66,33,91,.25));border-color:rgba(255,211,93,.28)}
.currency-row .currency-silver{background:linear-gradient(180deg,rgba(56,79,110,.42),rgba(66,33,91,.25));border-color:rgba(143,210,255,.26)}
.currency-row .currency-flags{background:linear-gradient(180deg,rgba(92,45,45,.42),rgba(66,33,91,.25));border-color:rgba(255,135,135,.26)}
.inventory-section-head .inventory-bag-title{display:flex;align-items:center;gap:8px}
.inventory-section-icon{width:24px;height:24px;image-rendering:pixelated;flex:0 0 auto}
.bag-button-icon{width:18px;height:18px;image-rendering:pixelated;vertical-align:middle;flex:0 0 auto}
.global-inventory-button,.global-inventory-button{display:inline-flex;align-items:center;gap:8px}
@media(max-width:650px){
  .currency-icon{width:17px;height:17px}
  .currency-row>div.currency-tile span{gap:6px;font-size:11px}
  .currency-row .currency-tile strong{padding-left:23px}
  .inventory-section-icon,.bag-button-icon{width:16px;height:16px}
}

/* V0.30.21 — standalone UI.zip glyphs only; original button backgrounds stay intact. */
.pvp-choice-visual img{display:block;width:48px;height:48px;object-fit:contain;image-rendering:pixelated;}
@media(max-width:760px){.pvp-choice-visual img{width:39px;height:39px;}}
@media(max-width:540px){.pvp-choice-visual img{width:32px;height:32px;}}
/* The dark Necromancer color is deliberate: match the character-creation palette. */
.maxwell-class-name[data-class="necromancer"]{background:#c4c4c416;border-color:#4a4a4a;text-shadow:0 0 2px #ccc;}

/* V0.30.22: Wizard-style Realm Walker book, right-edge section navigation. */
.world-map-inventory-panel.realm-book-panel{
  width:min(1390px,calc(100vw - 24px));
  background:linear-gradient(145deg,#282334,#14111e 75%);
  border:1px solid rgba(210,174,247,.54);
}
.realm-book-panel .world-map-inventory-content{
  grid-template-columns:minmax(215px,260px) minmax(0,1fr) 70px;
  gap:12px;overflow:visible;align-items:stretch;
}
.realm-book-panel .world-map-inventory-character{min-width:0;overflow:auto;position:relative;}
.realm-book-nav{
  display:flex;flex-direction:column;gap:12px;align-items:center;
  border-left:1px solid rgba(225,191,255,.20);padding:12px 0 12px 8px;
  min-width:0;z-index:3;
}
.realm-book-tab{
  width:58px;height:60px;flex:0 0 auto;position:relative;display:grid;place-items:center;
  cursor:pointer;border:1px solid rgba(185,153,219,.4);border-radius:11px;
  color:#f6eaff;background:linear-gradient(135deg,#382c4b,#201928);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.09);
}
.realm-book-tab img{width:38px;height:38px;object-fit:contain;image-rendering:pixelated;pointer-events:none;}
.realm-book-tab.is-active{border-color:#efd18d;background:linear-gradient(135deg,#655038,#332542);box-shadow:0 0 0 2px rgba(247,214,157,.17),0 0 16px rgba(228,167,84,.13)}
.realm-book-tab:hover,.realm-book-tab:focus-visible{border-color:#e6c9ff;background:#57416d;outline:none;transform:translateX(-2px);}
.realm-book-tab:focus-visible{outline:2px solid #f3d6ff;outline-offset:2px;}
.realm-book-tooltip{
  display:none;position:absolute;right:calc(100% + 12px);top:50%;transform:translateY(-50%);
  white-space:nowrap;padding:7px 11px;border-radius:6px;pointer-events:none;
  color:#fff4dd;background:#1d1828;border:1px solid #9b7cbd;
  box-shadow:0 6px 18px #000a;font:16px 'IM Fell English SC',Georgia,serif;
}
.realm-book-tab:hover .realm-book-tooltip,.realm-book-tab:focus-visible .realm-book-tooltip{display:block;}
.realm-book-panel .inventory-screen{height:100%;}
.realm-book-panel .inventory-screen .inventory-hero{min-height:60px;}
.realm-book-stats-page{box-sizing:border-box;height:100%;min-height:0;padding:8px 12px 25px;overflow-y:auto;scrollbar-width:thin;}
.realm-book-stats-identity{display:flex;align-items:center;gap:17px;padding:4px 0 12px;border-bottom:1px solid #6f5e79;}
.realm-book-stats-identity .inventory-portrait{width:70px;height:78px;object-fit:contain;image-rendering:pixelated;}
.realm-book-stats-identity h2{margin:0;font:30px 'IM Fell English SC',Georgia,serif;color:#ffe4b5;}
.realm-book-stats-identity p{margin:4px 0;color:#dec9f1;}
.realm-book-currencies{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin:13px 0;}
.realm-book-currency{min-width:0;display:flex;flex-direction:column;gap:5px;padding:12px;border-radius:10px;background:#31253c;border:1px solid #725783;}
.realm-book-currency span{display:flex;align-items:center;gap:8px;color:#d9c6ed;font-size:14px;}
.realm-book-currency .currency-icon{width:22px;height:22px;image-rendering:pixelated;}
.realm-book-currency strong{font:24px Georgia,serif;color:#f6e9ff;font-variant-numeric:tabular-nums;}
.realm-book-stats-page .inventory-xp-section{margin:12px 0;}
.realm-book-stat-sheet{margin-top:17px;overflow:hidden;border:1px solid #6b526e;border-radius:11px;background:linear-gradient(165deg,#181721,#101119);}
.realm-book-stat-sheet .fighter-stat-sheet-head{padding:15px 18px;}
.realm-book-stat-sheet .fighter-stat-name-line strong{max-width:none;font-size:21px;}
.realm-book-stat-sheet .fighter-stat-class{font-size:13px;}
.realm-book-stat-sheet .fighter-stat-kicker{font-size:11px;}
.realm-book-stat-sheet .combat-stat-grid{gap:10px;padding:14px;}
.realm-book-stat-sheet .combat-stat-tile{padding:11px 12px;}
.realm-book-stat-sheet .combat-stat-tile span{font-size:11px;letter-spacing:0;white-space:normal;overflow:visible;}
.realm-book-stat-sheet .combat-stat-tile strong{font-size:22px;}
.realm-book-panel .realm-book-card-content{overflow:hidden;padding:0;}
/* Embed the existing fully functional deck/progression components in the book. */
.realm-book-panel .realm-book-embedded{
  position:relative;inset:auto;display:flex;width:100%;height:100%;max-width:none;
  min-height:0;padding:0;z-index:1;background:transparent;overflow:hidden;box-sizing:border-box;
}
.realm-book-panel .realm-book-embedded .inventory-deck-panel,
.realm-book-panel .realm-book-embedded .realm-progression-panel{
  width:100%;height:100%;min-height:0;max-height:none;box-sizing:border-box;
  margin:0;padding:9px;border:1px solid #6a5079;border-radius:9px;background:#16111f;
  box-shadow:none;overflow:hidden;
}
.realm-book-panel .realm-book-embedded .inventory-deck-panel{gap:8px;}
.realm-book-panel .realm-book-embedded .inventory-deck-header{gap:9px;}
.realm-book-panel .realm-book-embedded .inventory-deck-grid{grid-template-columns:repeat(auto-fill,minmax(135px,1fr));gap:10px;min-height:0;padding:6px;}
.realm-book-panel .realm-book-embedded .realm-progression-header{padding:8px 12px;}
.realm-book-panel .realm-book-embedded .realm-progression-body{padding:10px 7px;}
.realm-book-panel .realm-book-embedded .realm-progression-events{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}
.realm-book-panel .realm-book-embedded .realm-progression-events>.realm-progression-stage{padding:8px 4px;min-width:0;}
.realm-book-panel .realm-book-embedded [hidden]{display:none!important;}
@media(max-width:900px){
  .realm-book-panel .world-map-inventory-content{grid-template-columns:125px minmax(0,1fr) 60px;grid-template-rows:minmax(0,1fr);gap:7px;}
  .realm-book-tab{width:49px;height:53px;}.realm-book-tab img{width:31px;height:31px;}
  .realm-book-panel .realm-book-embedded .inventory-deck-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media(max-width:700px){
  .realm-book-panel .world-map-inventory-content{grid-template-columns:minmax(0,1fr) 53px;grid-template-rows:auto minmax(0,1fr);}
  .realm-book-panel .world-map-inventory-roster{grid-column:1 / -1;grid-row:1;max-height:72px;}
  .realm-book-panel .world-map-inventory-character{grid-column:1;grid-row:2;}
  .realm-book-nav{grid-column:2;grid-row:2;padding:5px 0 5px 5px;gap:7px;}
  .realm-book-tab{width:46px;height:50px;}.realm-book-tab img{width:30px;height:30px;}
  .realm-book-currencies{grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;}
  .realm-book-currency{padding:6px;}.realm-book-currency span{font-size:10px;gap:3px;}.realm-book-currency strong{font-size:15px;}
  .realm-book-stats-identity h2{font-size:22px;}
  .realm-book-stat-sheet .combat-stat-grid{gap:5px;padding:6px;}
  .realm-book-stat-sheet .combat-stat-tile{padding:8px 6px;}
  .realm-book-stat-sheet .combat-stat-tile span{font-size:9px;}
  .realm-book-panel .realm-book-embedded .realm-progression-events{grid-template-columns:1fr;}
  .realm-book-panel .realm-book-embedded .inventory-deck-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
}

@media(min-width:701px) and (max-width:1099px){
 .realm-book-panel .world-map-inventory-content{grid-template-columns:185px minmax(0,1fr) 60px;gap:8px;}
 .realm-book-panel .world-map-inventory-character-button strong{font-size:13px;}
 .realm-book-panel .world-map-inventory-character-button small{font-size:11px;}
}
@media(min-width:1100px){
 .realm-book-panel .world-map-inventory-character-button strong{font-size:15px;}
 .realm-book-panel .world-map-inventory-character-button small{font-size:12px;}
}

/* V0.30.22 — currency denominations always use the artist's 16px sprites. */
.rf-currency-value{display:inline-flex;align-items:center;gap:6px;vertical-align:middle;white-space:nowrap;font-variant-numeric:tabular-nums;}
.rf-currency-icon{width:21px;height:21px;object-fit:contain;image-rendering:pixelated;vertical-align:middle;}
.aldric-currency-label{display:inline-flex!important;align-items:center!important;min-height:23px;}
.aldric-currency-label .rf-currency-icon{width:24px;height:24px;}
.aldric-token-price .rf-currency-value{justify-content:center;}
.gold-shop-launcher{left:auto!important;right:132px;top:16px;gap:9px;min-height:38px;white-space:nowrap;}
.gold-shop-launcher .currency-icon{width:23px;height:23px;}
.gold-pack-amount{align-items:center;}
.gold-pack-amount .rf-currency-icon{width:27px;height:27px;}
.gold-shop-wallet{display:flex;align-items:center;gap:9px;}
.gold-shop-wallet .rf-currency-icon{width:26px;height:26px;}
.gold-shop-feedback .rf-currency-value{font-weight:800;}
.match-reward-silver .rf-currency-value,.match-reward-flags .rf-currency-value{font-size:25px;display:inline-flex;gap:8px;align-items:center;}
/* Avoid inherited gradient text-fill suppressing currency amounts and icons. */
.match-reward-silver{background:none;-webkit-background-clip:initial;background-clip:initial;-webkit-text-fill-color:#e3ebf7;}
.match-reward-silver .rf-currency-icon,.match-reward-flags .rf-currency-icon{width:28px;height:28px;}
.realm-book-currency span{min-height:28px;}
.realm-book-currency .rf-currency-icon{width:28px;height:28px;}
.currency-row>div.currency-tile span{font-size:0;}
.currency-row .currency-tile strong{padding-left:0;}
.currency-row .currency-tile span .rf-currency-icon{width:29px;height:29px;}
.realm-book-footer{display:flex;justify-content:flex-end;border-top:1px solid rgba(225,191,255,.18);padding:9px 6px 0;margin-top:8px;}
.realm-book-footer .realm-book-quit{border-color:#a66572;background:#552b40;color:#ffdee8;min-width:100px;}
.realm-party-leave-icon{width:18px;height:18px;margin-right:6px;object-fit:contain;image-rendering:pixelated;vertical-align:middle;}
.combat-desert-button{color:#fa7f8b!important;background:transparent!important;border:0!important;box-shadow:none!important;font-weight:800!important;}
.combat-desert-button:hover{color:#ffb7bf!important;text-decoration:underline;}
@media(max-width:700px){.gold-shop-launcher{right:98px;top:10px;padding:6px 8px;min-height:34px;}.gold-shop-launcher .currency-icon{width:19px;height:19px;}}

/* Gold Shop moved to top right alongside Bag; reclaim topbar title space. */
body:not(.mode-selecting) .topbar>div:first-child{padding-left:0;}

/* V0.30.23 — Book Deck Builder: five complete cards per desktop row; no redundant copy. */
@media(min-width:1200px){
  .realm-book-panel .realm-book-embedded .inventory-deck-grid{
    grid-template-columns:repeat(5,minmax(0,1fr));
    column-gap:8px;row-gap:12px;padding:6px 4px;
  }
}
@media(min-width:901px) and (max-width:1199px){
  .realm-book-panel .realm-book-embedded .inventory-deck-grid{grid-template-columns:repeat(3,minmax(0,1fr));}
}
/* The book itself already identifies the page: don't repeat its title and character profile. */
.realm-book-panel .realm-book-embedded .inventory-deck-header>div:not(.inventory-deck-loadout-bar){display:none;}
.realm-book-panel .realm-book-embedded .inventory-deck-feedback:empty{display:none;}
.realm-book-panel .realm-book-embedded .inventory-deck-panel{gap:7px;}
.realm-book-panel .realm-book-embedded .inventory-deck-copy-caption,
.realm-book-panel .realm-book-embedded .inventory-deck-range{display:none;}
.realm-book-panel .realm-book-embedded .inventory-deck-card,
.realm-book-panel .realm-book-embedded .inventory-deck-card .realm-card-stage{width:165px!important;max-width:100%!important;}
.realm-book-panel .realm-book-embedded .inventory-deck-card .realm-card-stage{height:238px!important;}
.realm-book-panel .realm-book-embedded .inventory-deck-card .realm-card-frame{transform:scale(.5)!important;}
.realm-book-panel .realm-book-embedded .inventory-deck-entry{gap:5px;padding:6px 3px;overflow:hidden;}
.realm-book-panel .realm-book-embedded .inventory-deck-controls{gap:3px;}
.realm-book-panel .realm-book-embedded .inventory-deck-controls label{justify-content:flex-end;}
@media(max-width:1199px){
  .realm-book-panel .realm-book-embedded .inventory-deck-card,
  .realm-book-panel .realm-book-embedded .inventory-deck-card .realm-card-stage{width:145px!important;}
  .realm-book-panel .realm-book-embedded .inventory-deck-card .realm-card-stage{height:209px!important;}
  .realm-book-panel .realm-book-embedded .inventory-deck-card .realm-card-frame{transform:scale(.4394)!important;}
}
@media(min-width:1200px) and (max-width:1299px){
  .realm-book-panel .realm-book-embedded .inventory-deck-card,
  .realm-book-panel .realm-book-embedded .inventory-deck-card .realm-card-stage{width:148px!important;}
  .realm-book-panel .realm-book-embedded .inventory-deck-card .realm-card-stage{height:213px!important;}
  .realm-book-panel .realm-book-embedded .inventory-deck-card .realm-card-frame{transform:scale(.4485)!important;}
}

/* V0.30.24: Realm Walker book has a fixed 50-slot gear-only bag. */
.inventory-screen .inventory-collections{grid-template-rows:auto auto auto;}
.inventory-screen .inventory-owned-skins{display:flex;flex-wrap:wrap;gap:9px;margin-top:11px;padding:9px 0 0;border-top:1px solid rgba(198,156,225,.24);min-width:0;}
.inventory-screen .inventory-owned-skins:empty{display:none;}
.inventory-screen .inventory-bag.inventory-bag-slots{
  display:grid!important;grid-template-columns:repeat(auto-fill,minmax(74px,1fr));
  gap:8px!important;align-content:start;align-items:start;
  min-width:0;min-height:0;
}
.inventory-screen .inventory-bag-slots>.inventory-bag-row{
  width:100%;height:78px;min-height:78px;padding:0;margin:0;border:1px solid rgba(161,143,172,.22);
  border-radius:8px;background:rgba(20,17,27,.45);box-sizing:border-box;
}
.inventory-screen .inventory-bag-slots>.inventory-bag-row .inventory-bag-icon{
  width:66px;height:66px;max-width:100%;display:flex;justify-content:center;align-items:center;
}
.inventory-screen .inventory-bag-slots>.inventory-bag-slot-empty{
  min-width:0;height:78px;box-sizing:border-box;display:block;
  border:1px solid #55475e;border-radius:8px;
  background:linear-gradient(155deg,rgba(24,21,30,.85),rgba(35,29,41,.88));
  box-shadow:inset 0 1px 3px rgba(0,0,0,.43);
}
.inventory-screen .inventory-bag-slots>.inventory-bag-slot-empty:hover{border-color:#9177a0;}
.inventory-screen .inventory-bag-count{font-variant-numeric:tabular-nums;font-weight:800;white-space:nowrap;}
.realm-book-placeholder{display:flex;justify-content:center;align-items:center;height:100%;min-height:160px;font:28px 'IM Fell English SC',Georgia,serif;color:#e6d5f0;}
/* Six vertical tabs should remain reachable on short screens. */
.realm-book-nav{overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;}
@media(max-width:700px){
  .inventory-screen .inventory-bag.inventory-bag-slots{grid-template-columns:repeat(auto-fill,minmax(60px,1fr));gap:6px!important;}
  .inventory-screen .inventory-bag-slots>.inventory-bag-row,
  .inventory-screen .inventory-bag-slots>.inventory-bag-slot-empty{height:66px;min-height:66px;}
  .inventory-screen .inventory-bag-slots>.inventory-bag-row .inventory-bag-icon{width:57px;height:57px;}
}
/* Keep collected skins next to one another; leave room for the 50-slot bag. */
.inventory-screen .inventory-owned-skins{flex-direction:row!important;align-items:flex-start;align-content:flex-start;}
.match-reward-capacity{font-size:13px;color:#ffb7b7;margin-top:8px;font-weight:700;}

/* V0.30.25: Settings cog (#4), book close X, map/battle settings modal. */
.realm-settings-launcher{width:44px;height:44px;flex:0 0 auto;display:grid;place-items:center;padding:2px;border:0;border-radius:9px;background:transparent;cursor:pointer;box-shadow:none;}
.realm-settings-launcher img{display:block;width:40px;height:40px;object-fit:contain;image-rendering:pixelated;}
.realm-settings-launcher:hover,.realm-settings-launcher:focus-visible{background:transparent;outline:2px solid #cbb2e9;outline-offset:1px;filter:brightness(1.14);}
.realm-settings-map-launcher:not(.hidden){position:fixed;top:16px;right:258px;z-index:2650;}
.realm-book-sidebar-actions{margin-top:auto;padding-top:8px;display:flex;flex-direction:column;align-items:center;gap:10px;}
.realm-book-close{border-color:#9b3f4e;background:#452332;}
.realm-book-close:hover,.realm-book-close:focus-visible{background:#702b3d;border-color:#e98c93;}
.realm-book-settings img{width:38px;height:38px;}
.realm-book-close img{width:34px;height:34px;}
.realm-settings-overlay{position:fixed;inset:0;z-index:5800;display:flex;justify-content:center;align-items:center;padding:16px;box-sizing:border-box;background:rgba(7,5,12,.78);backdrop-filter:blur(5px);}
.realm-settings-overlay.hidden{display:none!important;}
.realm-settings-panel{width:min(470px,100%);max-height:90dvh;overflow:auto;padding:24px;border-radius:15px;border:1px solid #ad91bb;background:linear-gradient(145deg,#34283c,#191522 85%);color:#f3e6fc;box-shadow:0 22px 70px #000b;box-sizing:border-box;}
.realm-settings-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:25px;}
.realm-settings-head h2{margin:0;font:32px 'IM Fell English SC',Georgia,serif;color:#f9e5ff;}
.realm-settings-close{border:0;background:transparent;cursor:pointer;padding:6px;border-radius:7px;}
.realm-settings-close img{display:block;width:28px;height:28px;image-rendering:pixelated;}
.realm-settings-close:hover,.realm-settings-close:focus-visible{background:#60314b;outline:1px solid #ea8f9f;}
.realm-settings-controls{display:flex;flex-direction:column;gap:13px;}
.realm-settings-controls label{display:flex;justify-content:space-between;gap:12px;align-items:center;color:#eee0fb;font:600 17px system-ui,sans-serif;}
.realm-settings-controls output{color:#f6d794;font-variant-numeric:tabular-nums;}
.realm-settings-controls input[type=range]{width:100%;margin:0 0 14px;accent-color:#c59ade;cursor:pointer;}
.realm-settings-footer{display:flex;justify-content:center;margin-top:26px;padding-top:18px;border-top:1px solid #70577c;}
.realm-settings-quit{min-width:134px;border-color:#a85e70!important;background:#5a2b3b!important;color:#ffe5ee!important;}
.realm-settings-quit:hover{background:#87374a!important;}
.realm-settings-quit-confirm{border-top:1px solid #70577c;padding-top:16px;text-align:center;}
.realm-settings-quit-confirm p{font-size:16px;line-height:1.5;margin:0 0 16px;color:#ffe0e4;}
.realm-settings-quit-actions{display:flex;align-items:center;justify-content:center;gap:12px;}
.realm-settings-quit-confirm:not(.hidden)~.realm-settings-footer{display:none;}
.realm-brightness-overlay{position:fixed;inset:0;pointer-events:none;z-index:9999;opacity:0;background:#000;}
@media(max-width:700px){
 .realm-settings-map-launcher:not(.hidden){top:9px;right:188px;width:34px;height:34px;padding:2px;}
 .realm-settings-launcher img{width:32px;height:32px;}
 .realm-settings-panel{padding:18px;}
 .realm-book-sidebar-actions{gap:7px;}
}

/* V0.30.25: only the Bag sidebar offers Settings; Close Bag is always last. */
.realm-book-nav{
  min-height:0;overflow:hidden;display:flex;flex-direction:column;
}
.realm-book-tab-list{
  min-height:0;display:flex;flex-direction:column;align-items:center;gap:12px;
  overflow-x:hidden;overflow-y:auto;scrollbar-width:none;
  overscroll-behavior:contain;padding:2px 3px;
}
.realm-book-tab-list::-webkit-scrollbar{display:none}
.realm-book-sidebar-actions{
  flex:0 0 auto;margin-top:auto;padding-top:10px;
  border-top:1px solid rgba(225,191,255,.20);
  display:flex;flex-direction:column;align-items:center;gap:8px;
}
.realm-book-settings img{width:38px;height:38px;image-rendering:pixelated}
.realm-book-close img{width:34px;height:34px;image-rendering:pixelated}
@media(max-width:900px){
  .realm-book-tab-list{gap:7px}
}
@media(max-width:700px){
  /* Enlarge the character book to use the complete phone screen. */
  .world-map-inventory-modal{padding:0!important;place-items:stretch!important;}
  .world-map-inventory-panel.realm-book-panel{
    width:100vw!important;height:100dvh!important;min-height:0!important;
    max-height:100dvh!important;border-radius:0!important;
    padding:10px 7px 6px 10px!important;
    box-sizing:border-box;
  }
  .realm-book-panel .world-map-inventory-content{
    min-height:0;flex:1;grid-template-columns:minmax(0,1fr) 54px;
    grid-template-rows:auto minmax(0,1fr);gap:6px;
  }
  .realm-book-panel .world-map-inventory-roster{min-height:61px;max-height:66px;}
  .realm-book-nav{padding:1px 0 1px 4px;gap:0;}
  .realm-book-tab-list{gap:6px;padding:2px 2px 1px;}
  .realm-book-tab{width:45px;height:46px;min-height:46px;}
  .realm-book-tab img{width:30px;height:30px;}
  .realm-book-sidebar-actions{gap:6px;padding-top:7px;}
  .realm-book-sidebar-actions .realm-book-tab{width:45px;height:46px;}
  .realm-book-settings img{width:32px;height:32px;}
  .realm-book-close img{width:30px;height:30px;}
  .realm-book-panel .world-map-inventory-character{min-height:0;overflow-y:auto;}
  .realm-book-tooltip{font-size:13px;right:calc(100% + 5px);}
  .realm-settings-panel{width:min(100%,470px);padding:18px 16px;}
}
@media(max-height:600px) and (max-width:900px){
  .realm-book-tab-list{gap:4px;}
  .realm-book-sidebar-actions{gap:5px;padding-top:5px;}
}


/* V0.30.26 — skin collection stays in a single horizontal strip at every width. */
.realm-book-panel .inventory-skin-section{min-width:0;max-width:100%;}
.realm-book-panel .inventory-skin-rail{
 display:flex;flex-direction:row;align-items:flex-start;gap:14px;
 min-width:0;max-width:100%;box-sizing:border-box;
 padding:7px 6px 10px;overflow-x:auto;overflow-y:hidden;
 overscroll-behavior-x:contain;scrollbar-width:thin;scrollbar-color:#87659b transparent;
}
.realm-book-panel .inventory-skin-rail .inventory-skin-slot-row{flex:0 0 auto;min-width:max-content;margin:0;}
.realm-book-panel .inventory-skin-rail .inventory-owned-skins{
 display:flex!important;flex:0 0 auto;flex-direction:row!important;flex-wrap:nowrap!important;
 align-items:flex-start;gap:8px;margin:0!important;padding:0!important;border:0!important;
 min-width:0;min-height:82px;
}
.realm-book-panel .inventory-skin-rail .inventory-skin-bag-tile{flex:0 0 82px;}
.realm-book-panel .inventory-skin-rail .inventory-owned-skins:empty{display:none!important;}
@media(max-width:700px){
 .realm-book-panel .inventory-skin-rail{gap:10px;padding:5px 2px 10px;}
 .realm-book-panel .inventory-skin-slot-name span{display:none;}
 .realm-book-panel .inventory-skin-slot-name strong{font-size:15px;}
 .realm-book-panel .inventory-skin-rail .inventory-skin-slot-row{gap:7px;}
}
/* The selected tab outline must fit INSIDE its tile, not get cropped by scroll. */
.realm-book-nav .realm-book-tab.is-active{
 border:2px solid #f2d79c;
 box-shadow:inset 0 0 0 2px rgba(255,236,183,.30),inset 0 0 14px rgba(222,161,82,.20);
 background:linear-gradient(135deg,#69503b,#3a2c46);
}
.realm-book-tab-list{box-sizing:border-box;min-width:0;max-width:100%;padding-left:4px;padding-right:4px;}
.realm-book-nav .realm-book-tab:focus-visible{outline-offset:-3px;}
/* Keep Silver transfer directly beneath the Silver balance. */
.realm-book-currency.currency-silver .realm-book-transfer-silver{
 align-self:stretch;min-width:0;width:100%;margin-top:5px;
 padding:7px 5px;font-size:13px;white-space:nowrap;
}
.realm-book-transfer-feedback{min-height:0;margin:0;color:#c5dfbf;font-size:12px;}
@media(max-width:700px){
 .realm-book-currency.currency-silver .realm-book-transfer-silver{font-size:10px;padding:7px 2px;letter-spacing:-.1px;}
}

/* V0.30.27 — compact character Skin slot, one shared 50-slot inventory,
   evenly padded/right-aligned book controls, and solid-black hover labels. */
.inventory-screen .inventory-hero{
  display:flex;align-items:center;flex-wrap:nowrap;gap:12px;
}
.inventory-screen .inventory-hero-identity{flex:1 1 auto;min-width:0}
.inventory-screen .inventory-hero-skin{
  flex:0 0 auto;display:flex;align-items:center;gap:10px;
  margin-left:auto;color:#eed6f9;font:600 17px Georgia,serif;
}
.inventory-screen .inventory-hero-skin .inventory-skin-slot{
  flex:none;width:66px;height:66px;min-width:66px;
  display:flex;align-items:center;justify-content:center;
  border:2px solid #ad75e3;border-radius:9px;
  background:linear-gradient(145deg,#35204d,#211535);
  box-sizing:border-box;position:relative;overflow:hidden;
}
.inventory-screen .inventory-hero-skin .inventory-skin-equipped-token{
  width:100%;height:100%;object-fit:contain;padding:4px;
  box-sizing:border-box;image-rendering:pixelated;
}
.inventory-screen .inventory-collections,
.world-map-inventory-character .inventory-collections{
  grid-template-columns:minmax(0,1fr)!important;
  grid-template-rows:auto minmax(0,1fr)!important;
  align-content:start;gap:12px!important;
}
.inventory-screen .inventory-bag-section{min-height:0;overflow:hidden}
.inventory-screen .inventory-bag.inventory-bag-slots{min-height:0;overflow-y:auto;}
.inventory-screen .inventory-bag-slots>.inventory-skin-bag-tile{
  flex:initial;width:100%;height:78px;min-height:78px;
  margin:0;padding:3px;display:flex;align-items:center;justify-content:center;
  background:linear-gradient(145deg,#35204d,#211535);
  border:2px solid #ad75e3;border-radius:8px;
  cursor:grab;box-sizing:border-box;
}
.inventory-screen .inventory-bag-slots>.inventory-skin-bag-tile>img{
  width:100%;height:100%;max-width:100%;max-height:100%;
  padding:3px;object-fit:contain;image-rendering:pixelated;
}
.inventory-screen .inventory-bag-slots>.inventory-skin-bag-tile:hover,
.inventory-screen .inventory-bag-slots>.inventory-skin-bag-tile:focus-visible{
  border-color:#f0d3ff;outline:1px solid #d7adff;outline-offset:-2px;
}
.inventory-screen .inventory-skin-tooltip{
  border-radius:5px;background:#050507!important;color:#fff!important;
  border:1px solid #b8a7c9;box-shadow:0 6px 18px #000e;
}
.realm-book-nav{
  box-sizing:border-box!important;min-width:0;
  padding:5px 6px!important;align-items:center;gap:0!important;
  overflow:hidden!important;
}
.realm-book-tab-list{
  box-sizing:border-box;width:100%;max-width:100%;
  padding:4px 0!important;gap:9px;
  align-items:center;overflow-x:hidden;overflow-y:auto;
}
.realm-book-sidebar-actions{
  box-sizing:border-box;width:100%;max-width:100%;
  padding:9px 0 3px!important;gap:8px!important;align-items:center;
}
.realm-book-nav .realm-book-tab,
.realm-book-nav .realm-book-sidebar-actions .realm-book-tab{
  box-sizing:border-box;display:grid;place-items:center;
  width:50px;height:50px;min-height:50px;
  padding:6px;margin:0;flex:0 0 auto;
  transform:none;
}
.realm-book-nav .realm-book-tab img{
  display:block;position:static;margin:0 auto;
  width:100%;height:100%;max-width:36px;max-height:36px;
  object-fit:contain;object-position:center;image-rendering:pixelated;
}
.realm-book-nav .realm-book-tab:hover{transform:none;}
.realm-book-tooltip{display:none!important}
.realm-book-hover-label{
  position:fixed;z-index:12000;pointer-events:none;
  transform:translateY(-50%);padding:7px 11px;
  white-space:nowrap;max-width:calc(100vw - 18px);
  background:#050505;color:#fff;
  border:1px solid #a99bb8;border-radius:5px;
  box-shadow:0 4px 14px #000c;
  font:600 14px/1.1 Georgia,serif;
}
.realm-book-hover-label[hidden]{display:none!important}
@media(max-width:700px){
 .realm-book-panel .world-map-inventory-content{grid-template-columns:minmax(0,1fr) 56px!important;}
 .realm-book-nav{padding:4px 5px!important;}
 .realm-book-nav .realm-book-tab,
 .realm-book-nav .realm-book-sidebar-actions .realm-book-tab{
   width:44px;height:44px;min-height:44px;padding:5px;
 }
 .realm-book-nav .realm-book-tab img{max-width:32px;max-height:32px;}
 .realm-book-tab-list{gap:7px;padding:2px 0!important;}
 .realm-book-sidebar-actions{gap:7px!important;padding:8px 0 2px!important;}
 .inventory-screen .inventory-hero{gap:6px;flex-wrap:nowrap;}
 .inventory-screen .inventory-hero-skin{gap:4px;font-size:13px;}
 .inventory-screen .inventory-hero-skin .inventory-skin-slot{width:49px;height:49px;min-width:49px;}
 .inventory-screen .inventory-bag-slots>.inventory-skin-bag-tile{height:66px;min-height:66px;}
}
@media(max-width:380px){
 .inventory-screen .inventory-hero-skin{gap:3px;font-size:11px;}
 .inventory-screen .inventory-hero-skin .inventory-skin-slot{width:42px;height:42px;min-width:42px;}
 .inventory-screen .inventory-hero-identity h2{font-size:20px;}
}
/* Let legacy home-page inventory buttons wrap; the book profile stays compact. */
.inventory-screen .inventory-hero{flex-wrap:wrap;}
.world-map-inventory-character .inventory-screen .inventory-hero{flex-wrap:nowrap;}


/* V0.30.28 — Four full-width GREEN party slots, on Home and in PvP queue. */
body.mode-selecting #homePartySummary.home-party-summary{
 display:flex; flex-direction:column;flex-wrap:nowrap;align-items:stretch;
 width:100%;overflow:visible;gap:6px;padding:6px 2px 8px;margin:8px 0;
}
body.mode-selecting #homePartySummary .home-party-entry[data-class]{
 display:flex;flex:0 0 auto;align-items:center;width:100%;max-width:none;min-height:49px;
 padding:4px 10px 4px 6px;box-sizing:border-box;gap:5px;
 background:linear-gradient(96deg,#255a38,#1c3e2b);
 border:1px solid #6bba83;border-radius:6px;
 box-shadow:inset 0 1px rgba(223,255,227,.12);
}
body.mode-selecting #homePartySummary .home-party-entry .home-party-chip[data-class]{
 display:flex;flex:1 1 auto;gap:13px;width:auto;min-width:0;align-items:center;
 color:#effff0;font:700 16px/1.2 system-ui,sans-serif;
}
body.mode-selecting #homePartySummary .home-party-entry .home-party-chip-order{
 flex:0 0 34px;width:34px;min-width:34px;height:34px;
 border:1px solid #a0f0b4;background:#14482b;color:#f2fff3;border-radius:4px;
 font:750 15px/1 system-ui,sans-serif;
}
body.mode-selecting #homePartySummary .home-party-entry .home-party-chip-name{
 max-width:none;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
body.mode-selecting #homePartySummary .home-party-add-square{
 display:flex;align-items:center;justify-content:flex-start;flex:0 0 49px;
 width:100%;min-width:0;height:49px;padding:4px 12px;
 border:1px solid #6bba83;border-radius:6px;text-align:left;
 background:linear-gradient(96deg,#255a38,#1c3e2b);color:#d6ffdf;
 font:750 19px/1 system-ui,sans-serif;
}
body.mode-selecting #homePartySummary .home-party-add-square:disabled{
 opacity:.68;color:#cbf2d2;background:linear-gradient(96deg,#254932,#1d3b2a);
}
body.mode-selecting #homePartySummary .home-party-add-square:not(:disabled):hover{
 background:#2f7547;border-color:#d1ffe0;
}
@media(max-width:550px){
 body.mode-selecting #homePartySummary .home-party-entry .home-party-chip-name{max-width:none;}
 body.mode-selecting #homePartySummary .home-party-entry .home-party-chip[data-class]{font-size:14px;gap:8px;}
}
/* Same full-width occupied / empty party bars inside Map, Matchmaking and Custom Games. */
.world-map-queue-list{display:flex;flex-direction:column;gap:7px;align-items:stretch;}
.world-map-party-queue .world-map-queue-row{
 width:100%;min-height:56px;box-sizing:border-box;
 border:1px solid #76b78a;border-radius:6px;
 background:linear-gradient(100deg,#24563a,#1b3b2a);color:#eaffef;
}
.world-map-party-queue .world-map-queue-slot{
 color:#f0fff0;background:#153a28;border:1px solid #97d6a6;
}
.world-map-party-queue .world-map-queue-add{
 display:flex;justify-content:flex-start;align-items:center;
 box-sizing:border-box;width:100%;min-width:0;min-height:51px;height:51px;
 margin:0;padding:9px 16px;border:1px solid #76b78a;border-radius:6px;
 background:linear-gradient(100deg,#24563a,#1b3b2a);color:#e6ffe9;
 box-shadow:none;font:700 19px/1 system-ui,sans-serif;
}
.world-map-party-queue .world-map-queue-add:hover:not(:disabled),
.world-map-party-queue .world-map-queue-add.is-active{background:#2a7244;border-color:#b4f9c4;box-shadow:0 0 12px #4daf6a35;}
.world-map-party-queue .world-map-queue-add:disabled{opacity:.7;cursor:default;}
.world-map-party-queue .world-map-queue-identity small{color:#d7e9da;}
.pvp-queue-party-wrap,.pvp-queue-party-wrap .world-map-party-queue{max-width:640px;}
.pvp-queue-party-wrap .world-map-queue-add{margin-top:0;}
/* The gold shortcut belongs in the TOP LEFT, even on PvP/menu and small phones. */
.gold-shop-launcher{position:fixed!important;top:14px!important;left:14px!important;right:auto!important;}
@media(max-width:700px){.gold-shop-launcher{top:9px!important;left:8px!important;right:auto!important;}}
body:not(.mode-selecting) .topbar>div:first-child{padding-left:128px;}
/* Consistent icon-only Back on every screen; no label or duplicated text arrow. */
.rf-ui-zip-button.rf-icon-back-only{
 box-sizing:border-box;min-width:44px;width:44px;height:44px;min-height:44px;
 display:inline-flex;align-items:center;justify-content:center;padding:6px!important;
 flex:0 0 auto;
}
.rf-icon-back-only .rf-ui-zip-sprite{width:27px!important;height:27px!important;flex-basis:27px!important;background-size:27px 27px!important;margin:0!important;}
/* PvP — simplified, asset-led medieval design. */
body.mode-selecting .play-mode-card:has(.pvp-hall){
 width:min(940px,calc(100vw - 26px));max-width:940px;padding:clamp(20px,3vw,34px);
 background:linear-gradient(170deg,rgba(36,25,49,.98),rgba(19,17,31,.98));
 border:1px solid #9479a7;border-radius:13px;box-shadow:0 25px 82px #07040dcb;
}
.pvp-hall-top{padding:0 0 19px;border-bottom:1px solid #675373;min-height:58px;}
.pvp-hall-crest{
 display:grid;place-items:center;width:54px;height:54px;flex:0 0 54px;
 border-radius:9px;border:1px solid #9a8057;background:linear-gradient(145deg,#4b3b4b,#24202e);
}
.pvp-hall-crest img{display:block;width:43px;height:43px;object-fit:contain;image-rendering:pixelated;}
.pvp-hall .pvp-hall-back{border-radius:8px;background:#362847;border:1px solid #957aaf;}
.pvp-hall-modes{width:100%;max-width:810px;gap:17px;padding:34px 0 10px;}
.pvp-hall .pvp-hall-choice{
 display:flex;align-items:center;justify-content:center;flex-direction:column;
 min-height:285px;padding:25px 22px;gap:18px;text-align:center;
 border:1px solid #806697;border-radius:13px;
 background:linear-gradient(150deg,#3b2a4c,#221b32);
 transition:transform .15s ease,border-color .15s ease,background .15s ease;
}
.pvp-hall .pvp-hall-choice::before{display:none;}
.pvp-hall .pvp-mode-matchmaking{border-color:#aa8758;background:linear-gradient(150deg,#423442,#28202c);}
.pvp-hall .pvp-hall-choice:hover{transform:translateY(-3px);border-color:#d5b3f5;}
.pvp-hall .pvp-mode-matchmaking:hover{border-color:#ffe2a8;}
.pvp-hall .pvp-choice-visual{
 width:112px;height:112px;margin:0;display:grid;place-items:center;
 border:1px solid #9c7bb1;border-radius:16px;
 background:linear-gradient(150deg,#5d437a,#302340);
}
.pvp-hall .pvp-mode-matchmaking .pvp-choice-visual{border-color:#c19a64;background:linear-gradient(150deg,#625043,#352a32);}
.pvp-hall .pvp-choice-visual img{width:85px;height:85px;object-fit:contain;image-rendering:pixelated;}
.pvp-hall .pvp-choice-copy{padding:0;align-items:center;text-align:center;gap:9px;}
.pvp-hall .pvp-hall-choice .pvp-choice-copy strong{font-size:clamp(26px,3.5vw,34px);}
.pvp-hall .pvp-hall-choice .pvp-choice-copy small{font-size:14px;color:#ddd0e5;}
.pvp-hall .pvp-choice-foot{display:none!important;}
.pvp-hall .pvp-ledger-tab{border-radius:7px;}
.pvp-hall .pvp-queue-panel{padding-top:8px;}
@media(max-width:760px){
 body.mode-selecting .play-mode-card:has(.pvp-hall){width:calc(100vw - 20px);max-width:none;padding:16px 13px;}
 .pvp-hall-modes{gap:12px;padding-top:18px;}
 .pvp-hall .pvp-hall-choice{min-height:245px;}
 .pvp-hall .pvp-choice-visual{position:static;width:84px;height:84px;margin:0;opacity:1;}
 .pvp-hall .pvp-choice-visual img{width:67px;height:67px;}
}
@media(max-width:540px){
 .pvp-hall-modes{grid-template-columns:1fr;max-width:430px;}
 .pvp-hall .pvp-hall-choice{min-height:160px;flex-direction:row;justify-content:flex-start;gap:16px;text-align:left;}
 .pvp-hall .pvp-choice-visual{position:static;flex:0 0 74px;width:74px;height:74px;margin:0;}
 .pvp-hall .pvp-choice-visual img{width:55px;height:55px;}
 .pvp-hall .pvp-choice-copy{padding:0;align-items:flex-start;text-align:left;}
 .pvp-hall .pvp-hall-choice .pvp-choice-copy strong{font-size:26px;}
 .pvp-hall .pvp-hall-choice .pvp-choice-copy small{font-size:12px;}
}

/* V0.30.28 — Silver transfer stays BESIDE the coin, not below the counter. */
.realm-book-currency{justify-content:flex-start;align-items:stretch;}
.realm-book-currency-top{display:flex;align-items:center;justify-content:space-between;gap:3px;min-width:0;min-height:30px;}
.realm-book-currency-top span{display:inline-flex;flex:0 0 auto;align-items:center;min-height:28px;}
.realm-book-currency.currency-silver .realm-book-transfer-silver{
  display:inline-flex;flex:0 0 auto;align-self:center;align-items:center;justify-content:center;
  min-height:25px;height:27px;min-width:0;width:auto;margin:0;padding:2px 8px;
  font:700 12px/1.1 Georgia,serif;letter-spacing:0;white-space:nowrap;
}
.realm-book-currency strong{margin-top:auto;}
@media(max-width:700px){
 .realm-book-stats-page{padding-left:5px;padding-right:5px;}
 .realm-book-currency{padding:5px 4px;}
 .realm-book-currency.currency-silver .realm-book-transfer-silver{
   min-height:22px;height:24px;margin:0;padding:2px 3px;
   font:700 10px/1 Georgia,serif;letter-spacing:-.2px;
 }
 .realm-book-currency-top{gap:1px;}
 .realm-book-currency-top .rf-currency-icon{width:22px;height:22px;}
}

/* V0.30.28: Match the Bag and Gold corner shortcuts visually while retaining their original iconography. */
body .realm-corner-shortcut{
  position:fixed!important;top:14px!important;
  display:inline-flex!important;align-items:center!important;justify-content:center!important;
  box-sizing:border-box!important;min-height:44px!important;height:44px!important;
  gap:8px!important;padding:7px 13px!important;
  color:#f4eafa!important;font:700 14px/1.1 system-ui,sans-serif!important;
  border:1px solid #a787cc!important;border-radius:8px!important;
  background:linear-gradient(180deg,#4b3467 0%,#30223f 100%)!important;
  box-shadow:0 4px 18px rgba(4,1,11,.55),inset 0 1px rgba(255,255,255,.09)!important;
  white-space:nowrap;cursor:pointer;
}
body .realm-corner-shortcut:hover:not(:disabled){
  background:linear-gradient(180deg,#634783,#3f2c54)!important;
  border-color:#d9bbf7!important;
}
body .realm-corner-shortcut:focus-visible{outline:2px solid #f6dfff;outline-offset:3px;}
body #goldShopButton.realm-corner-shortcut{left:14px!important;right:auto!important;}
body #globalInventoryButton.realm-corner-shortcut{right:14px!important;left:auto!important;}
body .realm-corner-shortcut img.currency-icon,
body .realm-corner-shortcut img.bag-button-icon{
  display:block;width:26px!important;height:26px!important;flex:0 0 26px;
  image-rendering:pixelated;object-fit:contain;margin:0!important;
}
/* Character creation is modal: it must stand above BOTH corner shortcuts. */
body.character-creating #playModeOverlay{
  position:fixed;z-index:3100!important;isolation:isolate;
}
@media(max-width:700px){
  body .realm-corner-shortcut{top:9px!important;min-height:40px!important;height:40px!important;padding:6px 9px!important;gap:6px!important;font-size:12px!important;}
  body #goldShopButton.realm-corner-shortcut{left:8px!important;right:auto!important;}
  body #globalInventoryButton.realm-corner-shortcut{right:8px!important;left:auto!important;}
  body .realm-corner-shortcut img.currency-icon,
  body .realm-corner-shortcut img.bag-button-icon{width:23px!important;height:23px!important;flex-basis:23px!important;}
}

/* V0.30.28 — clear contrast for Necromancer skin label. */
.maxwell-class-name[data-class="necromancer"]{
 color:#f0e9f2!important;text-shadow:0 1px 2px #000!important;
 border:1px solid #8e8494!important;background:#35313d!important;
}
/* Greying unfillable empty roster bars preserves all four visible slots. */
body.mode-selecting #homePartySummary .home-party-add-square:disabled,
.world-map-party-queue .world-map-queue-add:disabled{
 background:linear-gradient(96deg,#383b3e,#2b2e32)!important;
 color:#9fa3a8!important;border-color:#666974!important;
 opacity:.85!important;box-shadow:none!important;pointer-events:none;
}
/* Rows already contain numbered bracket glyphs; never double the brackets with CSS. */
body.mode-selecting #homePartySummary .home-party-chip-order::before,
body.mode-selecting #homePartySummary .home-party-chip-order::after,
.world-map-party-queue .world-map-queue-slot::before,
.world-map-party-queue .world-map-queue-slot::after{content:none!important;}
.rf-battle-map-icon{display:block;width:28px;height:28px;object-fit:contain;image-rendering:pixelated;}
#combatMapButton:not(.hidden){display:inline-flex;align-items:center;justify-content:center;min-width:40px;min-height:40px;padding:5px;}

.realm-book-nav .realm-book-tab[data-book-tab="crafting"] img{
 max-width:none!important;object-fit:contain!important;
 object-position:center center!important;image-rendering:pixelated;
}

/* V0.30.28 — portrait of first queued Realm Walker on Character tab; mail for Friends. */
.realm-book-nav .realm-book-tab img.realm-book-tab-first-portrait{
 width:32px!important;height:32px!important;max-height:32px!important;
 object-fit:contain!important;image-rendering:pixelated;object-position:center;
}
.realm-book-friends{display:flex;flex-direction:column;gap:12px;padding:17px;min-height:250px;}
.realm-book-friends h3{margin:15px 0 2px;color:#ecd4fa;font-size:20px;}
.realm-book-friend-add,.realm-book-friend-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap;}
.realm-book-friend-add input{flex:1;min-width:170px;min-height:39px;padding:8px;background:#181122;color:#f9edff;border:1px solid #806692;border-radius:6px;}
.realm-book-friend-row{justify-content:space-between;padding:10px;border:1px solid #715983;border-radius:7px;background:#31233e;}
.realm-book-friend-list{display:grid;gap:7px;}
.realm-book-friend-row .mode-button{min-height:32px;padding:5px 12px;}

/* V0.30.28 — use the SAME X sprite (including small party/remove controls). */
button.rf-ui-zip-button.rf-ui-zip-icon-only::before,
button.rf-ui-zip-button.rf-ui-zip-icon-only::after{content:none!important;display:none!important;}
.home-party-remove-button.rf-ui-zip-button,
.inventory-roster-remove-button.rf-ui-zip-button,
.world-map-queue-remove.rf-ui-zip-button,
.map-party-kick.rf-ui-zip-button{
 display:inline-flex!important;align-items:center!important;justify-content:center!important;
 padding:1px!important;overflow:hidden;
}
.home-party-remove-button.rf-ui-zip-button>.rf-ui-zip-sprite,
.inventory-roster-remove-button.rf-ui-zip-button>.rf-ui-zip-sprite,
.world-map-queue-remove.rf-ui-zip-button>.rf-ui-zip-sprite,
.map-party-kick.rf-ui-zip-button>.rf-ui-zip-sprite{
 width:19px!important;height:19px!important;flex:0 0 19px!important;
 background-size:19px 19px!important;margin:0!important;
}

/* V0.30.28 — six saved deck buttons, clear button, visible 0–5 copy slider. */
.realm-book-embedded .inventory-deck-header{display:flex;align-items:center;flex-wrap:wrap;justify-content:flex-start;gap:8px!important;}
.inventory-deck-loadout-bar{display:flex;flex-wrap:wrap;align-items:center;gap:5px;flex:0 0 auto;}
.inventory-deck-loadout-bar .inventory-deck-loadout{min-width:36px!important;min-height:34px!important;padding:5px 9px!important;font:800 15px/1 system-ui,sans-serif!important;}
.inventory-deck-loadout.is-active,.inventory-deck-class-filter.is-active{
 background:#705095!important;border-color:#e2bfff!important;color:#fff!important;
 box-shadow:inset 0 0 0 1px #bda0e4;
}
.inventory-deck-clear{border-color:#72637d!important;background:#2b2533!important;color:#e9dfee!important;}
.inventory-deck-class-filters{display:flex;flex-wrap:wrap;gap:6px;padding:8px 5px;align-items:center;}
.inventory-deck-class-filters.hidden{display:none!important;}
.inventory-deck-class-filter{min-height:31px!important;padding:5px 8px!important;font:700 12px/1.1 system-ui,sans-serif!important;}
.realm-book-panel .realm-book-embedded .inventory-deck-copy-caption{display:inline!important;font:600 11px system-ui,sans-serif;color:#d7bfe9;}
.realm-book-panel .realm-book-embedded .inventory-deck-range{
 display:flex!important;justify-content:space-between!important;width:100%;margin-top:2px;
 font:600 10px system-ui,sans-serif;color:#c6bad7;
}
.realm-book-panel .realm-book-embedded .inventory-deck-controls label{display:flex!important;flex-direction:row;align-items:center;gap:4px;flex-wrap:wrap;justify-content:center;}
.realm-book-panel .realm-book-embedded .inventory-deck-controls output{min-width:14px;text-align:center;}
.realm-book-panel .realm-book-embedded .inventory-deck-controls input[type="range"]{flex:1 1 100%;width:100%;min-width:0;}
@media(max-width:700px){.inventory-deck-loadout-bar .inventory-deck-loadout{min-width:32px!important;padding:4px 7px!important;}}

/* V0.30.28 — six saved deck buttons, clear button, visible 0–5 copy slider. */
.realm-book-embedded .inventory-deck-header{display:flex;align-items:center;flex-wrap:wrap;justify-content:flex-start;gap:8px!important;}
.inventory-deck-loadout-bar{display:flex;flex-wrap:wrap;align-items:center;gap:5px;flex:0 0 auto;}
.inventory-deck-loadout-bar .inventory-deck-loadout{min-width:36px!important;min-height:34px!important;padding:5px 9px!important;font:800 15px/1 system-ui,sans-serif!important;}
.inventory-deck-loadout.is-active,.inventory-deck-class-filter.is-active{
 background:#705095!important;border-color:#e2bfff!important;color:#fff!important;
 box-shadow:inset 0 0 0 1px #bda0e4;
}
.inventory-deck-clear{border-color:#72637d!important;background:#2b2533!important;color:#e9dfee!important;}
.inventory-deck-class-filters{display:flex;flex-wrap:wrap;gap:6px;padding:8px 5px;align-items:center;}
.inventory-deck-class-filters.hidden{display:none!important;}
.inventory-deck-class-filter{min-height:31px!important;padding:5px 8px!important;font:700 12px/1.1 system-ui,sans-serif!important;}
.realm-book-panel .realm-book-embedded .inventory-deck-copy-caption{display:inline!important;font:600 11px system-ui,sans-serif;color:#d7bfe9;}
.realm-book-panel .realm-book-embedded .inventory-deck-range{
 display:flex!important;justify-content:space-between!important;width:100%;margin-top:2px;
 font:600 10px system-ui,sans-serif;color:#c6bad7;
}
.realm-book-panel .realm-book-embedded .inventory-deck-controls label{display:flex!important;flex-direction:row;align-items:center;gap:4px;flex-wrap:wrap;justify-content:center;}
.realm-book-panel .realm-book-embedded .inventory-deck-controls output{min-width:14px;text-align:center;}
.realm-book-panel .realm-book-embedded .inventory-deck-controls input[type="range"]{flex:1 1 100%;width:100%;min-width:0;}
@media(max-width:700px){.inventory-deck-loadout-bar .inventory-deck-loadout{min-width:32px!important;padding:4px 7px!important;}}

/* V0.30.29: display the real online party code on the main stage-panel card. */
.world-map-front-room-code{
 display:flex;align-items:center;gap:8px;min-width:0;box-sizing:border-box;
 margin:6px 0 10px;padding:8px 10px;border-radius:6px;
 border:1px solid #8f78ad;background:rgba(19,13,31,.78);
 font:600 13px/1.35 system-ui,sans-serif;color:#d5c6e4;
}
.world-map-front-room-code strong{font:800 16px/1.1 ui-monospace,SFMono-Regular,Consolas,monospace;letter-spacing:.16em;color:#f9e7aa;}

/* V0.30.29: restore Welcome roster's established horizontal layout. */
body.mode-selecting #homePartySummary.home-party-summary{
  display:flex;flex-direction:row!important;flex-wrap:nowrap!important;
  align-items:stretch;gap:7px;width:100%;overflow-x:auto;overflow-y:visible;
  padding:6px 2px 9px;box-sizing:border-box;
}
body.mode-selecting #homePartySummary .home-party-entry[data-class]{
  flex:1.8 1 155px;width:auto;max-width:none;min-width:127px;height:49px;
  padding:4px 5px;white-space:nowrap;
}
body.mode-selecting #homePartySummary .home-party-entry .home-party-chip[data-class]{gap:5px;font-size:13px;}
body.mode-selecting #homePartySummary .home-party-entry .home-party-chip-order{
  flex:0 0 26px;width:26px;min-width:26px;height:28px;
}
body.mode-selecting #homePartySummary .home-party-add-square{
  flex:1 1 65px;min-width:52px;max-width:none;width:auto;height:49px;min-height:49px;
  display:flex;justify-content:center;align-items:center;text-align:center;padding:3px;
  border:1px solid #76b78a;border-radius:6px;
}
body.mode-selecting #homePartySummary .home-party-add-square>span{
 display:grid;place-items:center;font:800 28px/1 system-ui,sans-serif;
}
.world-map-party-queue .world-map-queue-add>.world-map-add-plus{
  display:grid;place-items:center;width:29px;height:29px;
  background:rgba(13,47,27,.45);border:1px solid #84c897;border-radius:5px;
  font:800 26px/1 system-ui,sans-serif;
}
/* All currency tiles are equal height; silver transfer shares the ICON row. */
.realm-book-currencies{align-items:stretch;}
.realm-book-currency{display:flex;flex-direction:column;gap:3px;justify-content:space-between;min-height:86px;}
.realm-book-currency-top{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:3px;min-height:31px;}
.realm-book-currency-top>span{display:flex;min-width:25px;align-items:center;justify-content:flex-start;}
.realm-book-currency.currency-silver .realm-book-transfer-silver{
 min-width:0;width:auto;min-height:27px;height:27px;
 font-size:12px;line-height:1;padding:3px 6px;margin:0;white-space:nowrap;
}
.realm-book-currency>strong{margin-top:0;}
@media(max-width:700px){
 .realm-book-currency{min-height:69px;}
 .realm-book-currency-top{gap:1px;min-height:26px;}
 .realm-book-currency-top>span{min-width:20px;}
 .realm-book-currency.currency-silver .realm-book-transfer-silver{
  font-size:10px;padding:2px 4px;height:24px;min-height:24px;
 }
 body.mode-selecting #homePartySummary .home-party-entry[data-class]{min-width:112px;flex-basis:124px;}
 body.mode-selecting #homePartySummary .home-party-add-square{min-width:46px;}
}
/* Only the backpack, no Bag/Inventory text on top-right launcher. */
#globalInventoryButton.realm-corner-shortcut{padding:6px 9px!important;width:45px!important;min-width:45px!important;gap:0!important;}
#globalInventoryButton.realm-corner-shortcut .bag-button-icon{margin:0!important;}
/* Actual pixel sprite centered inside Crafting tab; never stretch/crop. */
.realm-book-nav .realm-book-tab[data-book-tab="crafting"] img{
 display:block!important;position:static!important;width:32px!important;height:32px!important;
 max-width:32px!important;max-height:32px!important;object-position:center!important;
 object-fit:contain!important;margin:auto!important;image-rendering:pixelated!important;
}
/* Single globally-consistent X symbol is centered across all close controls. */
.home-party-remove-button.rf-ui-zip-button,.inventory-roster-remove-button.rf-ui-zip-button,
.world-map-queue-remove.rf-ui-zip-button,.map-party-kick.rf-ui-zip-button,
.realm-settings-close,.realm-book-close,.gold-shop-close{
 display:inline-flex!important;align-items:center!important;justify-content:center!important;
}
.home-party-remove-button.rf-ui-zip-button>.rf-ui-zip-sprite,
.inventory-roster-remove-button.rf-ui-zip-button>.rf-ui-zip-sprite,
.world-map-queue-remove.rf-ui-zip-button>.rf-ui-zip-sprite,
.map-party-kick.rf-ui-zip-button>.rf-ui-zip-sprite{margin:0!important;vertical-align:middle!important;transform:none!important;}

/* V0.30.29: Hack3r Man's 11 filters never consume the entire deck grid. */
.realm-book-embedded .inventory-deck-class-filters{
 display:flex;flex-flow:row nowrap;overflow-x:auto;overflow-y:hidden;
 min-height:34px;width:100%;max-width:100%;gap:5px;padding:4px 0 8px;
 scrollbar-width:thin;scrollbar-color:#7d6396 #23172e;
}
.realm-book-embedded .inventory-deck-class-filters.hidden{display:none!important;}
.realm-book-embedded .inventory-deck-class-filter{flex:0 0 auto;white-space:nowrap;}
.realm-book-embedded .inventory-deck-grid{min-height:80px;}

/* V0.30.30: Settings lives inside the Character Book content, never above it. */
.realm-book-panel .world-map-inventory-character.realm-book-settings-content{overflow-y:auto;}
.realm-book-settings-page{
  box-sizing:border-box;min-height:100%;width:100%;
  padding:clamp(14px,2.3vw,28px);display:flex;flex-direction:column;
  color:#f3e6fc;background:transparent;
}
.realm-book-settings-page .realm-settings-controls{
  display:grid;grid-template-columns:minmax(0,1fr);gap:15px;
  max-width:660px;width:100%;margin:12px auto 0;
}
.realm-book-settings-page .realm-settings-controls label{font-size:17px;}
.realm-book-settings-page .realm-settings-controls input[type=range]{height:30px;margin:0 0 12px;}
.realm-book-settings-page .realm-settings-footer{
  width:100%;max-width:660px;margin:auto auto 0;padding-top:18px;
}
.realm-book-settings-page .realm-settings-quit-confirm{width:100%;max-width:660px;margin:auto auto 0;}
.realm-book-settings-page .realm-settings-quit{min-height:43px;}
@media(max-width:700px){
 .realm-book-settings-page{padding:12px 10px 16px;}
 .realm-book-settings-page .realm-settings-controls{margin-top:7px;gap:9px;}
 .realm-book-settings-page .realm-settings-controls label{font-size:14px;}
}

/* V0.30.31 — RESTORE established compact class-color party roster.
   Overrides the erroneous full-width green V0.30.28/29 declarations.
   Welcome uses horizontal 4-slot structure; map/Local/PvP stack compact rows. */
body.mode-selecting #homePartySummary.home-party-summary{
  display:flex!important;flex-direction:row!important;flex-wrap:nowrap!important;
  align-items:center!important;justify-content:flex-start!important;
  gap:8px!important;padding:5px 2px 8px!important;width:100%!important;
  margin:6px 0!important;overflow-x:auto!important;overflow-y:hidden!important;
}
body.mode-selecting #homePartySummary .home-party-entry[data-class]{
  display:inline-flex!important;align-items:center!important;justify-content:flex-start!important;
  flex:0 0 auto!important;width:auto!important;min-width:0!important;max-width:none!important;
  height:39px!important;min-height:0!important;
  padding:4px 5px 4px 4px!important;gap:2px!important;
  border:1px solid var(--class-rim-light,#a78bc3)!important;border-radius:4px!important;
  background:linear-gradient(145deg,color-mix(in srgb,var(--class-rim-mid,#654887) 58%,#191425),color-mix(in srgb,var(--class-rim-dark,#352145) 55%,#14111d))!important;
  box-shadow:inset 0 1px rgba(255,255,255,.12)!important;
}
body.mode-selecting #homePartySummary .home-party-entry .home-party-chip[data-class]{
  display:inline-flex!important;flex:0 1 auto!important;width:auto!important;min-width:0!important;
  align-items:center!important;justify-content:flex-start!important;gap:7px!important;
  padding:1px 4px 1px 2px!important;margin:0!important;
  border:0!important;border-radius:0!important;box-shadow:none!important;
  background:none!important;color:#fff!important;font:600 14px/1.25 system-ui,sans-serif!important;
}
body.mode-selecting #homePartySummary .home-party-entry .home-party-chip-order{
  flex:0 0 26px!important;width:26px!important;min-width:26px!important;
  height:26px!important;border-radius:3px!important;
  border:1px solid var(--class-rim-light,#aa8bc5)!important;
  background:var(--class-rim-dark,#352145)!important;
  font:700 13px/1 system-ui,sans-serif!important;color:#fff!important;
}
body.mode-selecting #homePartySummary .home-party-entry .home-party-chip-name{
  flex:0 1 auto!important;min-width:0!important;max-width:145px!important;
  white-space:nowrap!important;text-overflow:ellipsis!important;overflow:hidden!important;
}
body.mode-selecting #homePartySummary .home-party-add-square{
  display:grid!important;place-items:center!important;flex:0 0 41px!important;
  box-sizing:border-box!important;width:41px!important;min-width:41px!important;max-width:41px!important;
  height:41px!important;min-height:41px!important;padding:0!important;
  background:#21482f!important;color:#e5ffe9!important;border:1px solid #75bd88!important;
  border-radius:4px!important;text-align:center!important;
}
body.mode-selecting #homePartySummary .home-party-add-square:disabled,
.world-map-party-queue .world-map-queue-add:disabled{
  background:#303139!important;border-color:#62636a!important;color:#9d9ea7!important;
  opacity:.82!important;filter:none!important;cursor:default!important;pointer-events:none!important;
}
body.mode-selecting #homePartySummary .home-party-add-square>span{display:grid;place-items:center;font:800 25px/1 system-ui,sans-serif;}
@media(max-width:550px){body.mode-selecting #homePartySummary .home-party-entry .home-party-chip-name{max-width:90px!important}}
/* Compact Local Party and PvP: colored by each Realm Walker's class, not green. */
.world-map-party-queue .world-map-queue-list{align-items:flex-start!important;gap:6px!important;}
.world-map-party-queue .world-map-queue-row[data-class]{
  width:min(320px,100%)!important;max-width:100%!important;min-height:43px!important;
  gap:7px!important;padding:4px 31px 4px 6px!important;
  border-radius:5px!important;border:1px solid var(--class-rim-light,#9a84bc)!important;
  background:linear-gradient(115deg,color-mix(in srgb,var(--class-rim-mid,#654887) 56%,#191425),color-mix(in srgb,var(--class-rim-dark,#352145) 65%,#14111d))!important;
  color:#fff!important;box-shadow:inset 0 1px rgba(255,255,255,.1)!important;
}
.world-map-party-queue .world-map-queue-row[data-class] .world-map-queue-slot{
  border-color:var(--class-rim-light,#9a84bc)!important;
  background:var(--class-rim-dark,#352145)!important;color:white!important;
}
.world-map-party-queue .world-map-queue-row[data-class] .world-map-queue-identity small{color:#ddd2ed!important;}
.world-map-party-queue .world-map-queue-add{
  display:flex!important;align-items:center!important;justify-content:center!important;
  box-sizing:border-box!important;width:min(320px,100%)!important;max-width:100%!important;
  height:40px!important;min-height:40px!important;padding:4px!important;margin:0!important;
  border-radius:5px!important;background:#21482f!important;
}
.world-map-party-queue .world-map-queue-add>.world-map-add-plus{
  display:grid!important;place-items:center!important;width:27px!important;height:27px!important;
  font:800 25px/1 system-ui,sans-serif!important;
}
.world-map-party-queue .world-map-queue-row[data-class="Warrior"]{--class-rim-light:#c76868;--class-rim-mid:#8f2b2b;--class-rim-dark:#5a1717;}
.world-map-party-queue .world-map-queue-row[data-class="Paladin"]{--class-rim-light:#d5b46e;--class-rim-mid:#8b6a39;--class-rim-dark:#69502d;}
.world-map-party-queue .world-map-queue-row[data-class="Rogue"]{--class-rim-light:#ff7d13;--class-rim-mid:#e86408;--class-rim-dark:#843006;}
.world-map-party-queue .world-map-queue-row[data-class="Ranger"]{--class-rim-light:#b97845;--class-rim-mid:#855023;--class-rim-dark:#5a3217;}
.world-map-party-queue .world-map-queue-row[data-class="Mage"]{--class-rim-light:#6477ed;--class-rim-mid:#3249b2;--class-rim-dark:#1c286c;}
.world-map-party-queue .world-map-queue-row[data-class="Cleric"]{--class-rim-light:#f2df86;--class-rim-mid:#c9b85f;--class-rim-dark:#8f7e3f;}
.world-map-party-queue .world-map-queue-row[data-class="Bard"]{--class-rim-light:#84e4e6;--class-rim-mid:#35aebc;--class-rim-dark:#176875;}
.world-map-party-queue .world-map-queue-row[data-class="Necromancer"]{--class-rim-light:#787878;--class-rim-mid:#444444;--class-rim-dark:#191919;}
.world-map-party-queue .world-map-queue-row[data-class="Warlock"]{--class-rim-light:#8d58bd;--class-rim-mid:#642690;--class-rim-dark:#3b1558;}
.world-map-party-queue .world-map-queue-row[data-class="Druid"]{--class-rim-light:#4b7d55;--class-rim-mid:#2c6538;--class-rim-dark:#173f22;}
.world-map-party-queue .world-map-queue-row[data-class="Hacker"]{--class-rim-light:#daa83e;--class-rim-mid:#94520a;--class-rim-dark:#39211b;}

/* V0.30.31 — Right-hand book tabs are one evenly-spaced column, no divider/gap. */
.realm-book-panel .realm-book-nav{
  display:flex!important;flex-direction:column!important;align-items:center!important;
  justify-content:center!important;gap:7px!important;overflow-y:auto!important;
  padding:6px 5px!important;scrollbar-width:none!important;
}
.realm-book-panel .realm-book-tab-list{
  flex:0 1 auto!important;width:100%!important;gap:7px!important;
  padding:2px 0!important;overflow-y:auto!important;overflow-x:hidden!important;
  align-items:center!important;scrollbar-width:none!important;
}
.realm-book-panel .realm-book-sidebar-actions{
  flex:0 0 auto!important;width:100%!important;align-items:center!important;
  margin:0!important;padding:0!important;border:0!important;gap:7px!important;
}
.realm-book-panel .realm-book-nav .realm-book-tab{
  display:grid!important;place-items:center!important;padding:5px!important;
  box-sizing:border-box!important;overflow:hidden!important;transform:none!important;
}
.realm-book-panel .realm-book-nav .realm-book-tab img{
  display:block!important;position:static!important;max-width:100%!important;max-height:100%!important;
  width:100%!important;height:100%!important;object-fit:contain!important;object-position:center!important;
  margin:auto!important;image-rendering:pixelated!important;
}
.realm-book-panel .realm-book-nav .realm-book-tab[data-book-tab="crafting"] img{width:32px!important;height:32px!important;}
.realm-book-panel .world-map-inventory-head{flex:0 0 auto;}
.realm-book-bag-active .world-map-inventory-head{display:flex!important;}
/* Icon, balance and Transfer all on ONE row, equal-height currency squares. */
.realm-book-panel .realm-book-currencies{align-items:stretch!important;}
.realm-book-panel .realm-book-currency{
  display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:flex-start!important;
  box-sizing:border-box!important;min-height:52px!important;height:52px!important;
  padding:6px 9px!important;gap:0!important;
}
.realm-book-panel .realm-book-currency-inline{display:flex;align-items:center;justify-content:flex-start;gap:6px;width:100%;min-width:0;}
.realm-book-panel .realm-book-currency-icon{flex:0 0 auto!important;display:grid!important;place-items:center!important;min-width:0!important;min-height:0!important;}
.realm-book-panel .realm-book-currency-icon .rf-currency-icon{width:24px!important;height:24px!important;max-width:24px!important;max-height:24px!important;}
.realm-book-panel .realm-book-currency-inline>strong{
  font:700 19px/1.1 Georgia,serif!important;min-width:0!important;flex:1 1 auto!important;
  color:#f6e9ff!important;white-space:nowrap!important;text-align:left!important;margin:0!important;
}
.realm-book-panel .realm-book-transfer-currency{
  display:inline-flex!important;flex:0 0 auto!important;align-items:center!important;justify-content:center!important;
  min-width:0!important;width:auto!important;height:26px!important;min-height:26px!important;
  margin:0!important;padding:3px 7px!important;font:700 11px/1 system-ui,sans-serif!important;
  letter-spacing:0!important;white-space:nowrap!important;
}
.realm-book-panel .realm-book-transfer-currency:disabled{opacity:.48!important;cursor:not-allowed!important;}
@media(max-width:760px){
 .realm-book-panel .realm-book-currencies{gap:4px!important;}
 .realm-book-panel .realm-book-currency{height:42px!important;min-height:42px!important;padding:3px 4px!important;}
 .realm-book-panel .realm-book-currency-inline{gap:2px!important;}
 .realm-book-panel .realm-book-currency-icon .rf-currency-icon{width:17px!important;height:17px!important;}
 .realm-book-panel .realm-book-currency-inline>strong{font-size:12px!important;}
 .realm-book-panel .realm-book-transfer-currency{height:23px!important;min-height:23px!important;padding:2px 3px!important;font-size:9px!important;}
}
/* Exactly the same red close-square asset and geometry in Gold Shop and Book. */
#goldShopClose.gold-shop-close{
  display:grid!important;place-items:center!important;flex:0 0 50px!important;
  width:50px!important;height:50px!important;min-width:50px!important;min-height:50px!important;
  box-sizing:border-box!important;padding:5px!important;margin:0!important;
  border:1px solid #9b3f4e!important;border-radius:11px!important;
  background:#452332!important;color:transparent!important;font-size:0!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.09)!important;
}
#goldShopClose.gold-shop-close img{
  display:block!important;width:38px!important;height:38px!important;
  object-fit:contain!important;image-rendering:pixelated!important;
  margin:auto!important;padding:0!important;transform:none!important;
}
#goldShopClose.gold-shop-close:hover,#goldShopClose.gold-shop-close:focus-visible{
  background:#702b3d!important;border-color:#e98c93!important;
}
/* Back is one standalone arrow on a BLACK square, matched to close button geometry. */
button.rf-icon-back-only.rf-ui-zip-button,
button.pvp-hall-back.rf-icon-back-only.rf-ui-zip-button{
  display:grid!important;place-items:center!important;
  box-sizing:border-box!important;flex:0 0 44px!important;
  width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;
  padding:5px!important;border:1px solid #5d5566!important;border-radius:9px!important;
  background:linear-gradient(150deg,#19191d,#070709)!important;
  box-shadow:inset 0 1px rgba(255,255,255,.08)!important;
  color:transparent!important;font-size:0!important;
}
button.rf-icon-back-only.rf-ui-zip-button>.rf-ui-zip-sprite{
  display:block!important;place-self:center!important;
  width:28px!important;height:28px!important;margin:0!important;
  flex:0 0 28px!important;background-size:28px 28px!important;transform:none!important;
}
button.rf-icon-back-only.rf-ui-zip-button:hover{background:#25252c!important;border-color:#a7a0b1!important;}


/* V0.30.32: exact compact currency line. Silver alone has Transfer. */
.realm-book-panel .realm-book-currency-inline {display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:6px!important;}
.realm-book-panel .realm-book-currency-inline>.realm-book-transfer-currency {margin-left:auto!important;}
/* All red X controls use the same centered standalone sprite, no legacy text glyphs. */
.home-party-remove-button::before,
.inventory-roster-remove-button::before,
.world-map-queue-remove::before,
.map-party-kick::before {content:none!important;display:none!important;}
.home-party-remove-button.rf-ui-zip-button,
.inventory-roster-remove-button.rf-ui-zip-button,
.world-map-queue-remove.rf-ui-zip-button,
.map-party-kick.rf-ui-zip-button {
  display:grid!important;place-items:center!important;padding:0!important;
  line-height:0!important;text-indent:0!important;
}
.home-party-remove-button.rf-ui-zip-button>.rf-ui-zip-sprite,
.inventory-roster-remove-button.rf-ui-zip-button>.rf-ui-zip-sprite,
.world-map-queue-remove.rf-ui-zip-button>.rf-ui-zip-sprite,
.map-party-kick.rf-ui-zip-button>.rf-ui-zip-sprite {
  display:block!important;justify-self:center!important;align-self:center!important;
  width:18px!important;height:18px!important;flex:0 0 18px!important;
  background-position:center center!important;background-size:18px 18px!important;
  margin:0!important;padding:0!important;transform:none!important;
}
#worldMapInventoryClose.realm-book-close,
#goldShopClose.gold-shop-close {position:relative!important;display:grid!important;place-items:center!important;line-height:0!important;}
#worldMapInventoryClose.realm-book-close>img,
#goldShopClose.gold-shop-close>img {display:block!important;position:absolute!important;top:50%!important;left:50%!important;
  width:34px!important;height:34px!important;max-width:34px!important;max-height:34px!important;
  margin:0!important;padding:0!important;transform:translate(-50%,-50%)!important;
  object-fit:contain!important;object-position:center!important;image-rendering:pixelated!important;}
/* Keep the established black Back square; center its icon in both axes. */
button.rf-icon-back-only.rf-ui-zip-button,
button.pvp-hall-back.rf-icon-back-only.rf-ui-zip-button {display:grid!important;place-items:center!important;}
button.rf-icon-back-only.rf-ui-zip-button>.rf-ui-zip-sprite {
  display:block!important;justify-self:center!important;align-self:center!important;
  width:28px!important;height:28px!important;flex:0 0 28px!important;
  margin:0!important;padding:0!important;
  background-position:center center!important;background-size:28px 28px!important;
  transform:none!important;
}

/* V0.30.33: Deck numbers are actual tabs. Clear Deck is a momentary action. */
.realm-book-panel .realm-book-embedded .inventory-deck-header>.inventory-deck-loadout-bar{
  display:flex!important;flex:0 0 auto!important;align-items:center!important;
  gap:5px!important;visibility:visible!important;
}
.inventory-deck-loadout-bar .inventory-deck-loadout:not(.is-active){
  border-color:#6f627a!important;background:#2a2530!important;color:#e9dfee!important;box-shadow:none!important;
}
.inventory-deck-clear{border:1px solid #72637d!important;background:#2b2533!important;color:#e9dfee!important;box-shadow:none!important;outline:none;}
@media(hover:hover){
  .inventory-deck-clear:hover{border-color:#bd9fcc!important;background:#3f344a!important;color:#fff!important;}
}
@media(hover:none){
  .inventory-deck-clear:hover,.inventory-deck-clear:focus{border-color:#72637d!important;background:#2b2533!important;color:#e9dfee!important;box-shadow:none!important;}
}
.inventory-deck-clear:active{background:#4c344d!important;}
.inventory-deck-clear:focus-visible{outline:2px solid #ead4ff!important;outline-offset:2px;}
/* Compact 1–6 row stays above the cards, even on narrow phones. */
@media(max-width:700px){
  .realm-book-panel .realm-book-embedded .inventory-deck-header>.inventory-deck-loadout-bar{
    width:100%!important;order:-1;justify-content:center!important;flex-wrap:nowrap!important;
  }
  .inventory-deck-loadout-bar .inventory-deck-loadout{min-width:29px!important;padding:5px 6px!important;}
}

/* V0.30.33: Navvare Back returns to the top-right, icon-only. */
.navvare-interior{position:relative!important;}
.navvare-interior #navvareReturnMap{
  position:absolute!important;top:8px!important;right:8px!important;
  width:43px!important;height:43px!important;min-width:43px!important;min-height:43px!important;
  padding:7px!important;margin:0!important;align-self:auto!important;
  display:grid!important;place-items:center!important;
  box-sizing:border-box!important;border-radius:8px!important;
  background:#080808!important;border:1px solid #6f6177!important;
}
.navvare-interior #navvareReturnMap img{display:block;width:24px;height:24px;object-fit:contain;object-position:center;image-rendering:pixelated;}

/* The book's top-left title is sufficient for embedded progression. */
.realm-book-panel .realm-book-embedded .realm-progression-header h2{display:none!important;}
.realm-book-panel .realm-book-embedded .realm-progression-header{padding:5px 9px!important;}

/* V0.30.33: truly centered narrow book navigation and no split between tab groups. */
.realm-book-panel .realm-book-nav{
  display:flex!important;flex-direction:column!important;justify-content:center!important;
  align-items:center!important;gap:5px!important;padding:4px 3px!important;
  box-sizing:border-box!important;min-width:0!important;overflow-y:auto!important;
}
.realm-book-panel .realm-book-tab-list,
.realm-book-panel .realm-book-sidebar-actions{
  display:flex!important;flex-direction:column!important;align-items:center!important;
  justify-content:center!important;flex:0 0 auto!important;
  width:100%!important;gap:5px!important;padding:0!important;margin:0!important;
  border:0!important;overflow:visible!important;
}
.realm-book-panel .realm-book-nav .realm-book-tab{
  width:43px!important;height:43px!important;min-width:43px!important;min-height:43px!important;
  padding:5px!important;box-sizing:border-box!important;margin:0 auto!important;display:grid!important;place-items:center!important;
}
.realm-book-panel .realm-book-nav .realm-book-tab img{
  width:100%!important;height:100%!important;max-width:32px!important;max-height:32px!important;
  object-position:center center!important;object-fit:contain!important;
}
@media(max-width:700px){
 .realm-book-panel .realm-book-nav{padding:3px 2px!important;gap:4px!important;}
 .realm-book-panel .realm-book-tab-list,.realm-book-panel .realm-book-sidebar-actions{gap:4px!important;}
 .realm-book-panel .realm-book-nav .realm-book-tab{width:40px!important;height:40px!important;min-width:40px!important;min-height:40px!important;padding:4px!important;}
}
/* Geometric + sits at the center of its slot independent of font metrics. */
.world-map-party-queue .world-map-queue-add>.world-map-add-plus{
  position:relative!important;display:block!important;flex:0 0 auto!important;
  width:24px!important;height:24px!important;font-size:0!important;line-height:0!important;
}
.world-map-party-queue .world-map-queue-add>.world-map-add-plus:before,
.world-map-party-queue .world-map-queue-add>.world-map-add-plus:after{
  content:'';position:absolute;background:currentColor;left:50%;top:50%;transform:translate(-50%,-50%);border-radius:1px;
}
.world-map-party-queue .world-map-queue-add>.world-map-add-plus:before{width:18px;height:3px;}
.world-map-party-queue .world-map-queue-add>.world-map-add-plus:after{width:3px;height:18px;}

/* V0.30.35 — Hack3r Man's deck displays full-height cards on every class tab.
   The grid scrolls vertically; individual rows never shrink or clip to 20%. */
.realm-book-panel .realm-book-embedded .inventory-deck-grid,
.inventory-deck-modal .inventory-deck-grid{
  grid-auto-rows:max-content!important;
  align-content:start!important;
  align-items:start!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  scroll-padding-bottom:16px;
}
.realm-book-panel .realm-book-embedded .inventory-deck-entry,
.inventory-deck-modal .inventory-deck-entry{
  align-self:start!important;
  height:auto!important;
  min-height:max-content!important;
  overflow:visible!important;
  box-sizing:border-box!important;
}
.realm-book-panel .realm-book-embedded .inventory-deck-card,
.inventory-deck-modal .inventory-deck-card{
  height:auto!important;
  min-height:max-content!important;
  flex-shrink:0!important;
}
.realm-book-panel .realm-book-embedded .inventory-deck-card .realm-card-stage,
.inventory-deck-modal .inventory-deck-card .realm-card-stage{
  display:block!important;
  flex-shrink:0!important;
  overflow:hidden!important;
}
.realm-book-panel .realm-book-embedded .inventory-deck-controls,
.inventory-deck-modal .inventory-deck-controls{flex:0 0 auto!important;}

/* Character stats tab and its roster portrait retain their original first
   sidebar position. Friends remains a placeholder in the book. */
.realm-book-panel .realm-book-friends-symbol{font:800 27px/1 Georgia,serif;color:#e9d4ff;}

/* Every Back button now uses the same red X as Close/Quit (not a black arrow).
   Styles are applied after all legacy Back selectors and keep click geometry. */
button.rf-icon-back-only.rf-ui-zip-button,
button.pvp-hall-back.rf-icon-back-only.rf-ui-zip-button{
  display:grid!important;place-items:center!important;
  background:#452332!important;border:1px solid #9b3f4e!important;
  border-radius:9px!important;color:transparent!important;font-size:0!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.09)!important;
}
button.rf-icon-back-only.rf-ui-zip-button:hover:not(:disabled),
button.rf-icon-back-only.rf-ui-zip-button:focus-visible{
  background:#702b3d!important;border-color:#e98c93!important;
}
button.rf-icon-back-only.rf-ui-zip-button>.rf-ui-zip-sprite{
  width:30px!important;height:30px!important;flex:0 0 30px!important;
  background-size:30px 30px!important;background-position:center!important;
}
/* Navvare's hand-authored back button uses the exact same red X sprite. */
.navvare-interior #navvareReturnMap{
  background:#452332!important;border:1px solid #9b3f4e!important;
}
.navvare-interior #navvareReturnMap:hover:not(:disabled),
.navvare-interior #navvareReturnMap:focus-visible{
  background:#702b3d!important;border-color:#e98c93!important;
}
.navvare-interior #navvareReturnMap img{width:30px!important;height:30px!important;}

/* V0.30.36 — Character tab and stat page restored; in the book Inventory tab
   the equipped Skin label + drop slot now occupy the old portrait's upper-left
   position. Leave regular (non-book) inventory screens unchanged. */
.realm-book-panel .inventory-screen.inventory-book-only .inventory-hero{
  justify-content:flex-start!important;
}
.realm-book-panel .inventory-screen.inventory-book-only .inventory-hero-skin{
  margin-left:0!important;
  margin-right:auto!important;
}

/* V0.30.38 — single canonical Bag button next to Map during battle/results.
   Keep it above the battlefield, below the shared Character Book modal. */
body:not(.mode-selecting) .topbar-right > #globalInventoryButton.realm-corner-shortcut{
  position:relative!important;inset:auto!important;top:auto!important;
  left:auto!important;right:auto!important;bottom:auto!important;
  z-index:auto!important;height:40px!important;min-height:40px!important;
  padding:5px 10px!important;margin:0!important;border-radius:0!important;
  background:rgba(88,28,135,.25)!important;border:1px solid #000!important;
  box-shadow:none!important;
}
body:not(.mode-selecting) .topbar-right > #globalInventoryButton.realm-corner-shortcut:hover:not(:disabled){
  background:rgba(126,34,206,.35)!important;border-color:#000!important;
}
body:not(.mode-selecting) .topbar-right > #globalInventoryButton.realm-corner-shortcut img.bag-button-icon{
  width:28px!important;height:28px!important;flex-basis:28px!important;
}
/* V0.30.38 — old battle Bag overlay is gone. The Book remains modal. */
.world-map-inventory-modal{z-index:2900!important;}
/* Important: .realm-corner-shortcut uses !important display, so the hidden
   state needs matching specificity while logged out / between scenes. */
body #globalInventoryButton.realm-corner-shortcut.hidden{display:none!important;}

/* V0.30.39 — Clyde and number-drag parity. */
.battle-sprite.sprite-criminal-captain-clyde{--rf-sprite-size:161px!important;}
@media(max-width:850px){.battle-sprite.sprite-criminal-captain-clyde{--rf-sprite-size:136px!important;}}

/* Reuse the Main Menu's class rim on Map, Local Party and PvP numbers; do
   not temporarily paint them purple when a drag starts. */
.world-map-party-queue .world-map-queue-row[data-class] .world-map-queue-slot,
.world-map-party-queue .world-map-queue-row[data-class].is-dragging .world-map-queue-slot,
.world-map-party-queue.is-order-dragging .world-map-queue-row[data-class].is-dragging .world-map-queue-slot{
  background:var(--class-rim-dark,#352145)!important;
  border:1px solid var(--class-rim-light,#aa8bc5)!important;
  border-radius:3px!important;
  color:#fff!important;
  text-shadow:0 1px 2px rgba(0,0,0,.8)!important;
  box-shadow:none!important;
}
.world-map-party-queue.is-order-dragging .world-map-queue-row.is-dragging .world-map-queue-slot{opacity:.6;}
.world-map-party-queue.is-order-dragging .world-map-queue-row:not(.is-dragging),
.world-map-party-queue.is-order-dragging .world-map-queue-row.is-drop-target{
  outline:2px solid rgba(247,247,247,.7)!important;
  outline-offset:1px!important;
  box-shadow:0 0 0 1px color-mix(in srgb,var(--class-rim-light,#a579bc) 48%,transparent)!important;
}
.world-map-party-queue.is-order-dragging .world-map-queue-row.is-drop-target{
  outline:3px solid #f6f6f6!important;
  background:linear-gradient(115deg,
    color-mix(in srgb,var(--class-rim-mid,#654887) 68%,#191425),
    color-mix(in srgb,var(--class-rim-dark,#352145) 68%,#14111d))!important;
}
.world-map-party-queue.is-order-dragging .world-map-queue-row[data-class]:not(.is-dragging) .world-map-queue-slot,
.world-map-party-queue.is-order-dragging .world-map-queue-row[data-class].is-drop-target .world-map-queue-slot{
  background:var(--class-rim-dark,#352145)!important;
  border-color:var(--class-rim-light,#aa8bc5)!important;
  color:white!important;box-shadow:none!important;
}
.realm-party-number-ghost{
  width:36px!important;height:36px!important;
  background:var(--class-rim-dark,#352145)!important;
  color:white!important;
  border:1px solid var(--class-rim-light,#aa8bc5)!important;
  border-radius:3px!important;
  box-shadow:0 6px 16px rgba(0,0,0,.48),
             0 0 0 1px color-mix(in srgb,var(--class-rim-light,#a579bc) 32%,transparent)!important;
  text-shadow:0 1px 2px #000!important;
  transform:translate(-50%,-50%)!important;
  font:800 17px/1 system-ui,sans-serif!important;
}
/* Selected-by-tap reorder badges use the same neutral highlight, not purple. */
.world-map-party-queue .world-map-queue-row.is-slot-picked{
  outline:2px solid #f5f5f5!important;outline-offset:1px!important;
}
.world-map-party-queue .world-map-queue-row[data-class].is-slot-picked .world-map-queue-slot{
  outline:2px solid color-mix(in srgb,var(--class-rim-light,#a579bc) 80%,white)!important;
  outline-offset:2px!important;
}


/* V0.30.40 — combat header corrections: restore genuine Desert button; show
   Map and the one universal Inventory as equal, separate inline controls. */
body:not(.mode-selecting) .topbar-right{
  display:flex;align-items:center;gap:10px;
}
body:not(.mode-selecting) .topbar-right > #combatDesertButton.combat-desert-button{
  display:inline-flex;align-items:center;justify-content:center;
  flex:0 0 auto;box-sizing:border-box;
  min-width:90px;min-height:40px;padding:8px 15px;
  color:#ffe4e6!important;
  background:rgba(89,25,37,.88)!important;
  border:1px solid #000!important;border-radius:0!important;
  box-shadow:none!important;text-decoration:none!important;
  cursor:pointer;
}
body:not(.mode-selecting) .topbar-right > #combatDesertButton.combat-desert-button:hover:not(:disabled),
body:not(.mode-selecting) .topbar-right > #combatDesertButton.combat-desert-button:focus-visible{
  background:#853047!important;color:#fff!important;
}
body:not(.mode-selecting) .topbar-right > #combatDesertButton.combat-desert-button.hidden{
  display:none!important;
}
body:not(.mode-selecting) .topbar-right > #combatMapButton.combat-map-button,
body:not(.mode-selecting) .topbar-right > #globalInventoryButton.realm-corner-shortcut{
  position:static!important;
  inset:auto!important;top:auto!important;bottom:auto!important;
  left:auto!important;right:auto!important;
  transform:none!important;float:none!important;
  flex:0 0 44px!important;width:44px!important;min-width:44px!important;
  height:40px!important;min-height:40px!important;
  padding:5px 7px!important;margin:0!important;
  display:inline-flex!important;align-items:center!important;justify-content:center!important;
  border:1px solid #000!important;border-radius:0!important;
  background:rgba(88,28,135,.25)!important;box-shadow:none!important;
  z-index:auto!important;
}
body:not(.mode-selecting) .topbar-right > #combatMapButton.combat-map-button.hidden,
body:not(.mode-selecting) .topbar-right > #globalInventoryButton.realm-corner-shortcut.hidden{
  display:none!important;
}
body:not(.mode-selecting) .topbar-right > #combatMapButton.combat-map-button:hover:not(:disabled),
body:not(.mode-selecting) .topbar-right > #globalInventoryButton.realm-corner-shortcut:hover:not(:disabled){
  background:rgba(126,34,206,.35)!important;
}
body:not(.mode-selecting) .topbar-right > #combatMapButton .rf-battle-map-icon,
body:not(.mode-selecting) .topbar-right > #globalInventoryButton .bag-button-icon{
  display:block;width:28px!important;height:28px!important;flex:0 0 28px!important;
  object-fit:contain;image-rendering:pixelated;margin:0!important;
}
/* Small screens keep the buttons adjacent and clickable while the right-side
   actions may wrap onto a second header line. */
@media(max-width:650px){
  body:not(.mode-selecting) .topbar{height:auto;min-height:88px;row-gap:8px;
    padding:12px 14px;flex-wrap:wrap;}
  body:not(.mode-selecting) .topbar-right{flex:0 0 100%;width:100%;
    justify-content:flex-end;gap:8px;}
}

/* V0.30.43 — full-card transfer glow; skin targets; free 50-slot bag. */
.world-map-inventory-panel .inventory-roster-character-frame.inventory-transfer-target{
  outline:2px solid #ffe19a;outline-offset:2px;
  box-shadow:0 0 17px rgba(255,215,119,.35),inset 0 0 12px rgba(255,212,101,.14);
}
.world-map-inventory-panel .inventory-roster-character-frame.inventory-drag-over{
  outline:3px solid #ffe19a;outline-offset:2px;
  background:rgba(255,212,101,.20);
  box-shadow:0 0 22px rgba(255,215,119,.7),inset 0 0 12px rgba(255,212,101,.14);
}
.world-map-inventory-panel .inventory-roster-character-frame .world-map-inventory-character-button.inventory-transfer-target,
.world-map-inventory-panel .inventory-roster-character-frame .world-map-inventory-character-button.inventory-drag-over{
  outline:0!important;box-shadow:none!important;background:transparent!important;
}
.inventory-screen.inventory-drag-skin .inventory-skin-slot,
.inventory-screen.inventory-drag-skin .inventory-skin-bag-tile:not(.skin-class-locked){
  outline:2px solid #e9c4ff;outline-offset:1px;
  border-color:#f0d3ff!important;
  box-shadow:0 0 19px rgba(188,122,255,.60),inset 0 0 8px rgba(220,170,255,.15)!important;
}
.inventory-screen .inventory-bag-slots>[data-bag-index].inventory-swap-target{
  outline:2px solid #ffe19a!important;outline-offset:-3px;
  border-color:#ffe19a!important;
  box-shadow:0 0 14px rgba(255,215,119,.5),inset 0 0 12px rgba(255,212,101,.16)!important;
}
.inventory-screen .inventory-bag-slots>.inventory-bag-slot-empty{cursor:default;}

.inventory-screen.inventory-drag-skin .inventory-skin-transfer-targets .inventory-skin-transfer-chip{
  border-color:#e7bbff;
  box-shadow:0 0 12px rgba(190,125,255,.48);
}

/* V0.30.47 — Realm 1 Tiled world map: free pan, zoom, road-only progression.
   No drawn connections, no oversized landmark nameplates, zero-based battle labels. */
.world-map-viewer{position:relative;min-width:0;isolation:isolate;}
.world-map-viewer .world-map-scroll{
  width:100%;height:min(68vh,690px);max-height:none;min-height:430px;
  box-sizing:border-box;overflow:auto;scrollbar-width:none;touch-action:none;
  border:1px solid rgba(176,125,211,.52);border-radius:12px;
  background:#799d35;cursor:grab;overscroll-behavior:contain;
  user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;
}
.world-map-viewer .world-map-scroll::-webkit-scrollbar{display:none;}
.world-map-viewer .world-map-scroll.world-map-panning{cursor:grabbing;}
.world-map-viewer .world-map-size{position:relative;min-width:0;min-height:0;margin-inline:auto;}
.world-map-viewer .world-map-canvas{
  position:absolute;inset:0 auto auto 0;box-sizing:border-box;
  width:1120px!important;height:1206.154px!important;min-width:0!important;
  background-image:linear-gradient(rgba(6,7,10,.27),rgba(6,7,10,.27)),url('/static/realm1_overworld_realm1.png?v=0.31.59')!important;
  background-repeat:no-repeat!important;background-position:0 0!important;
  background-size:100% 100%!important;image-rendering:pixelated;
  transform-origin:top left;overflow:visible;
}
.world-map-viewer .world-map-canvas::before{display:none!important;}
.world-map-viewer .world-map-route{display:none!important;}
.world-map-viewer .world-map-stage{
  box-sizing:border-box;position:absolute;display:flex;align-items:center;justify-content:center;
  transform:translate(-50%,-50%);width:14px!important;height:14px!important;
  min-width:0!important;min-height:0!important;padding:0!important;
  border:1.5px solid #f0d69c!important;border-radius:2px!important;
  background:rgba(37,34,29,.95)!important;color:#fff1d3!important;
  box-shadow:0 2px 3px #19140dbb!important;
  font-family:Georgia,serif!important;font-variant-numeric:tabular-nums;
  cursor:pointer;z-index:4;
}
.world-map-viewer .world-map-stage-num{font:700 8px/1 Georgia,serif!important;color:inherit!important;}
.world-map-viewer .world-map-stage-dot{display:none!important;}
.world-map-viewer .world-map-boss-marker{
  width:auto!important;height:auto!important;min-width:72px!important;min-height:24px!important;
  padding:3px 8px 4px!important;border-radius:8px!important;border:2px solid #ffc3ba!important;
  background:#9e1f26!important;color:#fff4ef!important;box-shadow:0 0 5px rgba(255,42,51,.32),0 2px 3px #160b0ebb!important;
  display:flex!important;gap:7px;align-items:center;justify-content:center;
}
.world-map-viewer .world-map-boss-button-name{font:700 10px/1 Georgia,serif!important;white-space:nowrap;}
.world-map-viewer .world-map-boss-button-num{font:700 9px/1 Georgia,serif!important;opacity:.92;}
.world-map-viewer .world-map-scroll:not(.world-map-panning) .world-map-stage:hover,
.world-map-viewer .world-map-stage.is-selected,.world-map-viewer .world-map-current{
  transform:translate(-50%,-50%) scale(1.06)!important;
  outline:2px solid #fff6d9;outline-offset:1px;
}
.world-map-viewer .world-map-kingdom{
  position:absolute;z-index:6;box-sizing:border-box;transform:translate(-50%,-50%);
  width:20px!important;height:20px!important;min-width:0!important;min-height:0!important;
  padding:0!important;background:#463524dd!important;border:2px solid #ffe49a!important;
  border-radius:50%!important;color:#ffe7aa!important;box-shadow:0 1px 6px #000a!important;
  display:grid;place-items:center;cursor:pointer;
}
.world-map-viewer .world-map-castle{font:700 16px/1 Georgia,serif!important;}
.world-map-viewer .world-map-dungeon-marker{
  position:absolute;z-index:7;box-sizing:border-box;transform:translate(-50%,-50%);
  width:auto!important;height:auto!important;min-width:90px!important;min-height:26px!important;
  padding:4px 9px!important;border:2px solid #b8e6ff!important;border-radius:8px!important;
  background:#1356ad!important;color:#e9f8ff!important;
  box-shadow:0 1px 7px #10234baa!important;display:flex;align-items:center;justify-content:center;
  font:700 10px/1.1 Georgia,serif!important;cursor:pointer;
}
.world-map-viewer .world-map-dungeon-button-text{white-space:nowrap;}
.world-map-viewer .world-map-future-dungeon{
  position:absolute;z-index:7;box-sizing:border-box;transform:translate(-50%,-50%);
  width:18px!important;height:18px!important;min-width:0!important;min-height:0!important;
  padding:0!important;border:2px solid #b8e6ff!important;border-radius:50%!important;
  background:#325b88!important;color:#e9f8ff!important;
  box-shadow:0 1px 7px #10234baa!important;display:grid;place-items:center;
  font:700 11px/1 Georgia,serif!important;pointer-events:none;cursor:default;opacity:.74;
}
.world-map-viewer .world-map-dungeon-marker.is-locked{opacity:.8;cursor:pointer;}
.world-map-viewer .world-map-scroll:not(.world-map-panning) .world-map-dungeon-marker:hover,
.world-map-viewer .world-map-dungeon-marker.is-selected,
.world-map-viewer .world-map-scroll:not(.world-map-panning) .world-map-kingdom:hover,
.world-map-viewer .world-map-kingdom.is-selected{
  outline:2px solid #fff;outline-offset:2px;
}
.world-map-viewer .world-map-future-boss{
  position:absolute;transform:translate(-50%,-50%);z-index:5;pointer-events:none;
  width:19px;height:19px;display:grid;place-items:center;
  box-sizing:border-box;border-radius:50%;border:2px dashed #ffd3ce;
  color:#ffe4db;background:#842b36a8;font:700 11px/1 Georgia,serif!important;
}
.in-game-map-panel .world-map-viewer .world-map-scroll{height:min(68vh,780px)!important;max-height:none!important;}
.in-game-map-panel .world-map-stage,.in-game-map-panel .world-map-kingdom,
.in-game-map-panel .world-map-dungeon-marker{cursor:grab;pointer-events:none;}
@media(max-width:980px){
  .world-map-viewer .world-map-scroll{height:min(53vh,520px);min-height:285px;}
}
@media(max-width:580px){
  .world-map-viewer .world-map-scroll{height:45vh;min-height:300px;}
}

/* V0.30.48 — no text selection / hover flicker while freely panning Realm 1.
   Keep short labels entirely outside the castle and Bandit Blockade artwork. */
.world-map-viewer .world-map-scroll,.world-map-viewer .world-map-scroll *{
  user-select:none!important;-webkit-user-select:none!important;-webkit-touch-callout:none;
}
.world-map-viewer .world-map-scroll.world-map-panning .world-map-stage,
.world-map-viewer .world-map-scroll.world-map-panning .world-map-kingdom,
.world-map-viewer .world-map-scroll.world-map-panning .world-map-dungeon-marker{
  pointer-events:none!important;
}
.world-map-viewer .world-map-scroll.world-map-panning .world-map-stage:hover,
.world-map-viewer .world-map-scroll.world-map-panning .world-map-kingdom:hover,
.world-map-viewer .world-map-scroll.world-map-panning .world-map-dungeon-marker:hover{
  outline:none!important;
}
.world-map-viewer .world-map-landmark-label{
  position:absolute;z-index:2;top:calc(100% + 7px);left:50%;
  width:max-content;max-width:148px;min-width:0;
  padding:3px 7px;box-sizing:border-box;
  transform:translateX(-50%);
  border:1px solid rgba(229,197,128,.78);border-radius:5px;
  background:rgba(21,22,20,.85);color:#f6e7c2;
  font:700 9px/1.25 Georgia,serif!important;
  letter-spacing:0!important;white-space:nowrap;
  text-align:center;pointer-events:auto;
  box-shadow:0 1px 3px #0007;
}
.world-map-viewer .world-map-kingdom-label{top:calc(100% + 16px);left:calc(100% + 6px);transform:none;}
.world-map-viewer .world-map-bandit-label{
  border-color:rgba(140,196,241,.8);color:#dfebff;
  background:rgba(17,30,51,.87);top:calc(100% + 5px);
}


/* V0.30.50 — Realm 1 markers corrected to the source TMX road. Labels stay
   outside landmarks; boss markers remain square with a detached, small name. */
.world-map-viewer .world-map-boss-marker{
  box-sizing:border-box!important;
  width:16px!important;height:16px!important;
  min-width:16px!important;min-height:16px!important;
  max-width:16px!important;max-height:16px!important;
  padding:0!important;border:1.5px solid #ffd4c9!important;
  border-radius:3px!important;background:#a41e29!important;
  display:grid!important;place-items:center!important;
  overflow:visible!important;z-index:6;
}
.world-map-viewer .world-map-boss-button-num{
  font:700 8px/1 Georgia,serif!important;
  color:#fff9ee!important;
}
.world-map-viewer .world-map-boss-button-name{
  position:absolute;bottom:calc(100% + 6px);left:50%;
  transform:translateX(-50%);
  font:700 9px/1.1 Georgia,serif!important;
  color:#fff5ed!important;white-space:nowrap;
  text-shadow:0 1px 2px #1a0505,-1px 0 #1a0505,1px 0 #1a0505,0 -1px #1a0505;
  pointer-events:none;
}
/* The old Navvare icon is replaced by its caption: one centered clickable name
   beneath the castle, not a plate covering its gate or stonework. */
.world-map-viewer .world-map-kingdom{
  width:auto!important;height:auto!important;
  min-width:110px!important;min-height:21px!important;
  max-width:none!important;
  padding:3px 8px!important;border-radius:6px!important;
  display:flex!important;align-items:center;justify-content:center;
  background:rgba(35,30,26,.92)!important;
  border:1px solid #e9cd92!important;
  box-shadow:0 2px 5px rgba(0,0,0,.55)!important;
}
.world-map-viewer .world-map-kingdom-button-text{
  white-space:nowrap;font:700 9px/1.15 Georgia,serif!important;
  color:#fff2d4;
}
/* Bandit Blockade is itself the small blue button, moved below the tents. */
.world-map-viewer .world-map-dungeon-marker{
  width:auto!important;height:21px!important;min-height:21px!important;
  min-width:74px!important;padding:2px 6px!important;
  border:1.5px solid #b8e6ff!important;border-radius:6px!important;
  background:#1356ad!important;color:#eef7ff!important;
  box-shadow:0 2px 5px rgba(0,0,0,.48)!important;
}
.world-map-viewer .world-map-dungeon-button-text{
  font:700 9px/1.1 Georgia,serif!important;white-space:nowrap;
}

/* V0.30.56 — ordinary battle locations use compact squares, not circular pins.
   Keep the 13px footprint and all stage positions unchanged. */
.world-map-viewer .world-map-stage:not(.world-map-boss-marker){
  width:13px!important;height:13px!important;
  min-width:13px!important;min-height:13px!important;
  max-width:13px!important;max-height:13px!important;
  border-radius:2px!important;
}
.world-map-viewer .world-map-future-stage{
  border-color:#cbd3db!important;
  background:rgba(86,95,106,.96)!important;
  color:#f2f6fb!important;
  box-shadow:0 2px 3px rgba(18,22,27,.72)!important;
  cursor:default!important;
  pointer-events:none!important;
}
.world-map-viewer .world-map-future-stage .world-map-stage-num{font:700 7px/1 Georgia,serif!important;color:inherit!important;}
.world-map-viewer .world-map-branch-stage .world-map-stage-num{font-size:7px!important;opacity:.6!important;}
.world-map-viewer .world-map-future-boss-stage{
  width:18px!important;height:18px!important;
  min-width:18px!important;min-height:18px!important;
  max-width:18px!important;max-height:18px!important;
  border:2px dashed #ffd7ba!important;
  background:rgba(112,78,78,.96)!important;
  color:#fff2e8!important;
}

/* V0.30.52 — Themed unsaved-deck confirmation; backdrop never dismisses. */
.realm-deck-leave-overlay{
  position:fixed;inset:0;z-index:20000;display:grid;place-items:center;
  padding:18px;box-sizing:border-box;background:rgba(7,6,15,.82);backdrop-filter:blur(5px);
}
.realm-deck-leave-panel{
  box-sizing:border-box;width:min(440px,100%);padding:25px 24px;border:2px solid #ad82c7;
  border-radius:16px;background:linear-gradient(165deg,#34243d,#171421 90%);
  box-shadow:0 20px 75px #000c;text-align:center;color:#f4e4ff;
}
.realm-deck-leave-panel h2{
  margin:0 0 12px;font-family:'IM Fell English SC',Georgia,serif!important;
  font-size:29px;font-weight:400;color:#f8e7ff;
}
.realm-deck-leave-panel p{margin:0 0 20px;font-size:17px;line-height:1.35;color:#dccde8;}
.realm-deck-leave-actions{display:flex;gap:10px;justify-content:center;flex-wrap:wrap;}
.realm-deck-leave-actions button{min-height:43px;white-space:nowrap;}
.realm-deck-stay{background:#48345f!important;color:#fff!important;border-color:#ac8ac8!important;}
.realm-deck-leave{background:#802b3d!important;color:#fff!important;border-color:#dd7285!important;}
.realm-deck-leave-actions button:focus-visible{outline:2px solid #fff;outline-offset:2px;}


/* V0.30.53 — Lord Titus, compact market upgrades */
.merchant-hall-options{grid-template-columns:repeat(auto-fit,minmax(195px,1fr));}
.titus-products{display:grid;grid-template-columns:repeat(auto-fit,minmax(235px,1fr));gap:12px;margin:12px 0;}
.titus-product{display:flex;flex-direction:column;justify-content:space-between;gap:7px;padding:13px;background:rgba(22,17,35,.9);border:1px solid #76598d;border-radius:10px;min-height:105px;}
.titus-product strong{font-size:16px;color:#f4dfb9;}
.titus-product small{display:block;font-size:12px;color:#c3b2cf;}
.titus-product input{width:100%;min-height:34px;box-sizing:border-box;border-radius:5px;background:#151321;color:#fff;border:1px solid #82669b;padding:7px;}
.titus-product .titus-buy{min-height:35px;font-size:14px;}
.titus-product .titus-buy:disabled{opacity:.6;}
#titusFeedback{min-height:20px;color:#f7deb4;}


/* V0.30.55 — four merchants as a one-column, vertically scrollable choice list. */
body.mode-selecting .play-mode-card:has(.merchant-hall){max-height:94dvh;overflow:hidden;}
body.mode-selecting .merchant-hall{display:flex;flex-direction:column;max-height:calc(94dvh - 65px);width:min(800px,100%);min-height:0;overflow:hidden;}
body.mode-selecting .merchant-hall > .aldric-shop-head{flex-shrink:0;}
body.mode-selecting .merchant-hall-options{
  display:grid!important;grid-template-columns:minmax(0,1fr)!important;
  grid-auto-rows:minmax(82px,auto);gap:10px;min-height:0;
  overflow-y:auto;overscroll-behavior:contain;padding:4px 10px 8px;
  scrollbar-color:#815fa7 #181322;
}
body.mode-selecting .merchant-hall-options .merchant-choice{
  display:flex!important;flex-direction:row!important;text-align:left!important;
  min-width:0;min-height:90px!important;padding:10px 18px!important;gap:16px!important;
  align-items:center!important;justify-content:flex-start!important;
}
body.mode-selecting .merchant-choice-info{min-width:0;flex:1;align-items:flex-start;}
body.mode-selecting .merchant-choice-info strong{
  font-size:clamp(17px,2.6vw,24px)!important;
  line-height:1.22!important;overflow-wrap:anywhere;white-space:normal;
}
body.mode-selecting .merchant-choice-art{flex:0 0 76px!important;}
body.mode-selecting #merchantHallTitus img,
body.mode-selecting .titus-shop .merchant-portrait-sprite{transform:scaleX(-1)!important;}
@media(max-width:550px){
  body.mode-selecting .merchant-hall{max-height:calc(97dvh - 50px);}
  body.mode-selecting .merchant-hall-options .merchant-choice{min-height:76px!important;padding:7px 10px!important;gap:10px!important;}
  body.mode-selecting .merchant-choice-art{flex:0 0 55px!important;}
}
/* Atmospheric twilight tone stays below every clickable landmark and stage. */
.world-map-viewer .world-map-canvas::before{
  content:''!important;display:block!important;position:absolute;inset:0;
  background:rgba(38,18,51,.13)!important;pointer-events:none;z-index:1;
}
/* Home roster selection becomes a deliberate red-only delete interaction. */
.character-hall-foot{justify-content:space-between;gap:10px;flex-wrap:wrap;}
.home-delete-button{border:1px solid #d56c80!important;background:rgba(96,21,42,.82)!important;color:#ffe2e9!important;}
.home-delete-button.is-active{border-color:#ffabb7!important;background:#9b2339!important;}
.home-delete-hint{padding:9px 12px;border:1px solid #cc526a;border-radius:7px;color:#ffcad2;background:rgba(88,18,39,.76);font-size:15px;}
body.mode-selecting .character-roster.home-delete-active .character-roster-card{
  cursor:pointer!important;border-color:#b63e56!important;outline:1px solid #cd667c!important;
  box-shadow:0 0 9px rgba(236,51,89,.20)!important;
}
body.mode-selecting .character-roster.home-delete-active .character-roster-card:hover,
body.mode-selecting .character-roster.home-delete-active .character-roster-card:focus-visible{
  border-color:#ffd0d5!important;outline:3px solid #ff5f73!important;
  box-shadow:0 0 0 2px rgba(241,58,79,.42),0 0 30px rgba(241,58,79,.54)!important;
  background:linear-gradient(125deg,#50212f,#2a171f)!important;
}
body.mode-selecting .character-roster.home-delete-active .character-roster-card .roster-stat-trigger{pointer-events:none;}
.home-delete-modal{position:fixed;inset:0;z-index:99995;display:grid;place-items:center;padding:16px;background:rgba(6,4,12,.90);backdrop-filter:blur(4px);}
.home-delete-panel{box-sizing:border-box;width:min(530px,100%);padding:26px 23px;border:2px solid #b6465b;border-radius:15px;background:linear-gradient(165deg,#30212e,#170e1b);color:#ffedf1;box-shadow:0 16px 75px #000b;text-align:center;}
.home-delete-panel h2{margin:0 0 16px;color:#ffd1db;font-size:28px;}
.home-delete-panel p{font-size:17px;line-height:1.35;}
.home-delete-panel .home-delete-warning{color:#ff9fae;font-size:14px;}
.home-delete-panel label{display:block;margin:18px 0 9px;font-size:15px;}
.home-delete-panel input{box-sizing:border-box;width:100%;min-height:43px;padding:10px;background:#130f1b;border:1px solid #bd7989;border-radius:7px;color:white;font-size:16px;}
.home-delete-panel #homeDeleteFeedback{color:#ffc4ca;font-size:13px;min-height:24px;padding-top:5px;}
.home-delete-actions{display:flex;justify-content:center;gap:10px;flex-wrap:wrap;margin-top:6px;}
.home-delete-actions button{min-height:42px;}
.home-delete-confirm{color:#fff!important;background:#a02842!important;border-color:#ed7991!important;}
.home-delete-confirm:disabled{opacity:.35;cursor:not-allowed;}
@media(max-width:710px){.character-hall-foot .mode-button{flex:1 1 175px;}}

/* Hack3r Man is an undeletable test Realm Walker, not a valid deletion target. */
body.mode-selecting .character-roster.home-delete-active .character-roster-card.home-delete-protected{
  pointer-events:none!important;opacity:.58;outline:1px solid #70676f!important;
  border-color:#70676f!important;box-shadow:none!important;cursor:not-allowed!important;
}

/* V0.30.57 — compact modern Gold Store. Four coin packs + a featured Supporter row. */
#goldShopModal.gold-shop-overlay{background:rgba(5,8,14,.84);backdrop-filter:blur(10px);}
#goldShopModal .gold-shop-panel{
  width:min(1040px,calc(100vw - 30px));max-height:min(90dvh,920px);
  padding:clamp(18px,3vw,32px);border:1px solid rgba(203,190,218,.23);
  border-radius:20px;background:linear-gradient(152deg,#26202c 0%,#191a26 54%,#11151d 100%);
  box-shadow:0 20px 90px #000b, inset 0 1px 0 #ffffff12;
}
#goldShopModal .gold-shop-heading{align-items:center;margin:0 0 22px;}
#goldShopModal .gold-shop-heading h2{font-size:clamp(30px,3vw,40px);margin:3px 0 0;}
#goldShopModal .gold-shop-kicker{color:#c7b7ca;font:700 10px/1.1 system-ui,sans-serif;letter-spacing:.18em;}
#goldShopModal .gold-shop-topline{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:20px;flex-wrap:wrap;}
#goldShopModal .gold-shop-test-note{
  display:inline-flex;align-items:center;padding:7px 11px;margin:0;box-shadow:none;
  border:1px solid #86678e72;border-radius:100px;background:#33293c9e;
  color:#e2d4e9;font:650 11px/1.3 system-ui,sans-serif;letter-spacing:.02em;
}
#goldShopModal .gold-shop-wallet{
  display:flex;align-items:center;gap:8px;margin:0;padding:9px 14px;
  border:1px solid #b6a07050;border-radius:12px;background:#10131a9e;
  color:#cccad3;font:650 12px system-ui,sans-serif;
}
#goldShopModal .gold-shop-wallet strong{font:800 18px/1 system-ui,sans-serif;color:#f8dd90;font-variant-numeric:tabular-nums;}
#goldShopModal .gold-shop-wallet .rf-currency-icon{width:20px;height:20px;image-rendering:pixelated;}
#goldShopModal .gold-shop-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;}
#goldShopModal .gold-pack{
  position:relative;display:flex;flex-direction:column;align-items:stretch;
  gap:0;min-height:264px;min-width:0;padding:18px 15px 15px;
  border:1px solid #ffffff24;border-radius:16px;
  background:linear-gradient(165deg,#33303c 0%,#242633 55%,#1c212a 100%);
  box-shadow:inset 0 1px 0 #ffffff0c,0 3px 11px #0004;
  transition:border-color .16s,transform .16s,box-shadow .16s;
}
#goldShopModal .gold-pack:hover{transform:translateY(-2px);border-color:#e4c88c80;box-shadow:0 10px 25px #0005;}
#goldShopModal .gold-pack-art{display:flex;justify-content:center;align-items:center;gap:5px;min-height:57px;margin:0 0 14px;}
#goldShopModal .gold-pack-art .rf-currency-icon{width:clamp(20px,2.1vw,31px);height:clamp(20px,2.1vw,31px);object-fit:contain;image-rendering:pixelated;flex-shrink:0;filter:drop-shadow(0 3px 5px #fbbf2430);}
#goldShopModal .gold-pack-header{min-height:0;display:flex;flex-direction:column;align-items:center;gap:7px;}
#goldShopModal .gold-pack-label{font:700 16px/1.2 'IM Fell English SC',Georgia,serif!important;margin:0;color:#f4edf8;text-align:center;}
#goldShopModal .gold-pack-bonus{font:750 10px/1 system-ui,sans-serif!important;color:#f4d889;border:1px solid #ccaa655c;background:#5e4d2d63;padding:5px 7px;border-radius:20px;}
#goldShopModal .gold-pack-amount{display:flex;align-items:baseline;justify-content:center;gap:5px;margin:8px 0 15px;color:#f9e0a1;}
#goldShopModal .gold-pack-amount strong{font:800 clamp(18px,2.3vw,27px)/1 system-ui,sans-serif!important;letter-spacing:-.04em;font-variant-numeric:tabular-nums;}
#goldShopModal .gold-pack-amount>span{font:650 12px/1 system-ui,sans-serif!important;color:#e7d3ab;}
#goldShopModal .gold-pack-footer{display:flex;flex-direction:column;gap:9px;margin-top:auto;}
#goldShopModal .gold-pack-price{font:780 23px/1.1 system-ui,sans-serif!important;color:#fff;text-align:center;}
#goldShopModal .gold-shop-buy{min-height:39px;border-radius:9px;border:1px solid #dbb98066;background:linear-gradient(160deg,#d1a657,#a97a31);color:#20160b;font:800 12px/1.2 system-ui,sans-serif!important;box-shadow:inset 0 1px #ffe7b566;}
#goldShopModal .gold-shop-buy:hover:not(:disabled){background:#eed08c;border-color:#f2d99c;}
#goldShopModal .gold-shop-buy:disabled{opacity:.62;}
#goldShopModal .gold-shop-supporter-row{margin-top:14px;}
#goldShopModal .gold-pack-supporter{
  min-height:125px;padding:16px 22px;display:grid;align-items:center;
  grid-template-columns:78px minmax(0,1fr) 130px;column-gap:18px;
  border:1px solid #d4b2776f;background:linear-gradient(108deg,#4c3c31,#292839 44%,#1e2430 100%);
}
#goldShopModal .gold-pack-supporter .gold-pack-art{margin:0;min-height:0;}
#goldShopModal .gold-shop-crown{width:55px;height:55px;object-fit:contain;image-rendering:pixelated;filter:drop-shadow(0 4px 8px #0009);}
#goldShopModal .gold-pack-supporter .gold-pack-header{align-items:flex-start;}
#goldShopModal .gold-pack-supporter .gold-pack-label{font-size:20px!important;text-align:left;}
#goldShopModal .gold-pack-supporter .gold-pack-amount{justify-content:flex-start;margin:6px 0 4px;}
#goldShopModal .gold-pack-supporter .gold-pack-footer{margin:0;}
#goldShopModal .gold-supporter-perks{display:flex;flex-wrap:wrap;gap:5px 16px;color:#e7def2;font:700 clamp(19px,2vw,23px)/1.12 system-ui,sans-serif!important;}
#goldShopModal .gold-supporter-perks span+span:before{content:'•';margin-right:10px;color:#d4aa69;}
#goldShopModal .gold-shop-feedback{margin:14px 0 0;min-height:18px;font:650 12px/1.4 system-ui,sans-serif;}
@media(max-width:760px){
  #goldShopModal .gold-shop-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
  #goldShopModal .gold-pack{min-height:232px;}
  #goldShopModal .gold-pack-supporter{grid-template-columns:64px minmax(0,1fr);row-gap:12px;}
  #goldShopModal .gold-pack-supporter .gold-pack-footer{grid-column:1/-1;display:flex;flex-direction:row;align-items:center;justify-content:space-between;}
  #goldShopModal .gold-pack-supporter .gold-pack-footer .gold-shop-buy{width:min(200px,65%);}
}
@media(max-width:400px){
  #goldShopModal .gold-shop-panel{width:calc(100vw - 12px);padding:14px;}
  #goldShopModal .gold-shop-grid{gap:9px;}
  #goldShopModal .gold-pack{padding:13px 8px 12px;min-height:222px;}
  #goldShopModal .gold-pack-art{gap:2px;}
  #goldShopModal .gold-pack-art .rf-currency-icon{width:20px;height:20px;}
  #goldShopModal .gold-pack-label{font-size:14px!important;}
  #goldShopModal .gold-pack-amount strong{font-size:20px!important;}
  #goldShopModal .gold-pack-supporter{padding:12px;}
  #goldShopModal .gold-supporter-perks{font-size:clamp(15px,4.3vw,19px)!important;}
  #goldShopModal .gold-supporter-perks span+span:before{display:none;}
}


/* V0.30.58 — Shadow Realm confirmation without redundant instructions. */
.home-delete-panel{position:relative;padding-top:55px;}
.home-delete-panel .home-delete-close{
  position:absolute;top:10px;right:10px;display:grid;place-items:center;
  width:38px;height:38px;padding:3px;border:1px solid #aa4b5d;border-radius:8px;
  background:#3a1d2b;cursor:pointer;
}
.home-delete-panel .home-delete-close img{width:30px;height:30px;object-fit:contain;image-rendering:pixelated;}
.home-delete-panel .home-delete-close{background-image:none!important;}
.home-delete-panel .home-delete-close::before,.home-delete-panel .home-delete-close::after{content:none!important;display:none!important;}

.home-delete-panel .home-delete-close:hover,.home-delete-panel .home-delete-close:focus-visible{background:#702d3f;border-color:#f1a4aa;}
.home-delete-panel h2{font-size:clamp(20px,3vw,26px);line-height:1.25;margin:0 0 18px;}
.home-delete-panel .home-delete-actions{justify-content:center;}
.home-delete-panel .home-delete-actions .home-delete-confirm{width:min(320px,100%);min-height:46px;}
.home-delete-panel.home-banishment-success{padding:38px 23px 30px;}
.home-banishment-success .home-banishment-ok{min-width:130px;min-height:42px;margin-top:5px;}

/* V0.30.58 — Gold Shop: compact wallet, original PvP crown, staggered coins, bonus ribbons. */
#goldShopModal .gold-shop-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;}
#goldShopModal .gold-shop-heading-actions{display:flex;align-items:center;justify-content:flex-end;gap:10px;flex:0 0 auto;}
#goldShopModal .gold-shop-wallet{display:flex;align-items:center;justify-content:center;gap:6px;padding:6px 10px;min-height:38px;white-space:nowrap;}
#goldShopModal .gold-shop-wallet .rf-currency-icon{width:24px;height:24px;object-fit:contain;}
#goldShopModal .gold-shop-test-note,#goldShopModal .gold-shop-topline{display:none!important;}
#goldShopModal .gold-pack-art{gap:0!important;}
#goldShopModal .gold-pack-art .rf-currency-icon{position:relative;width:clamp(29px,3vw,42px);height:clamp(29px,3vw,42px);}
#goldShopModal .gold-pack-art .rf-currency-icon+.rf-currency-icon{margin-left:-13px;}
#goldShopModal .gold-pack-art .rf-currency-icon:nth-child(2){z-index:2;transform:translateY(3px) rotate(8deg);}
#goldShopModal .gold-pack-art .rf-currency-icon:nth-child(3){z-index:3;transform:translateY(-2px) rotate(-7deg);}
#goldShopModal .gold-pack-art .rf-currency-icon:nth-child(4){z-index:4;transform:translateY(4px) rotate(5deg);}
#goldShopModal .gold-pack-bonus{
  position:absolute;top:12px;right:-20px;z-index:6;display:block;
  width:105px;max-width:none;padding:5px 2px;border:1px solid #f5d794;
  border-radius:3px;transform:rotate(36deg);transform-origin:center;
  background:linear-gradient(160deg,#f6d888,#aa7b2b);color:#261a0a;
  text-align:center;white-space:nowrap;
  font:800 10px/1.1 system-ui,sans-serif!important;
  box-shadow:0 2px 6px #0007;
}
#goldShopModal .gold-pack:has(.gold-pack-bonus){isolation:isolate;}
#goldShopModal .gold-pack-supporter{
  border-color:#a68ad8a6;
  background:linear-gradient(110deg,#47305e 0%,#312341 48%,#1c182f 100%);
}
#goldShopModal .gold-pack-supporter .gold-shop-buy{
  background:linear-gradient(160deg,#c4a4f5,#8d68cc)!important;
  border-color:#cdb6f0!important;color:#1c1433!important;
}
#goldShopModal .gold-pack-supporter .gold-shop-buy:hover:not(:disabled){background:#e2d0ff!important;}
#goldShopModal .gold-pack-supporter .gold-pack-amount,#goldShopModal .gold-pack-supporter .gold-pack-amount>span{color:#eddbff;}
#goldShopModal .gold-pack-supporter .gold-supporter-perks span+span:before{color:#bca0f2;}
#goldShopModal .gold-shop-crown{width:64px;height:64px;image-rendering:pixelated;}
@media(max-width:400px){
  #goldShopModal .gold-shop-heading{gap:7px;}
  #goldShopModal .gold-shop-heading-actions{gap:5px;}
  #goldShopModal .gold-shop-wallet{gap:3px;padding:5px;min-height:34px;}
  #goldShopModal .gold-shop-wallet strong{font-size:14px!important;}
  #goldShopModal .gold-shop-wallet .rf-currency-icon{width:18px;height:18px;}
  #goldShopModal .gold-pack-art .rf-currency-icon{width:27px;height:27px;}
  #goldShopModal .gold-pack-art .rf-currency-icon+.rf-currency-icon{margin-left:-10px;}
  #goldShopModal .gold-pack-bonus{width:89px;top:12px;right:-21px;font-size:9px!important;}
  #goldShopModal .gold-shop-crown{width:53px;height:53px;}
}

/* V0.30.6 hotfix — use the same gold coin symbol as other currencies in Titus's wallet. */
.titus-shop .titus-wallet{gap:6px;}
.titus-shop .titus-wallet .rf-currency-icon{width:23px;height:23px;flex:0 0 23px;object-fit:contain;image-rendering:pixelated;}

/* V0.30.6 map transfer — Covenant Cottage occupies the revised Witch Hut object.
   The short marker is clickable; its label floats above the art, without blocking it. */
.world-map-viewer .world-map-coven-marker{
  position:absolute;z-index:8;box-sizing:border-box;transform:translate(-50%,-50%);
  width:19px!important;height:19px!important;min-width:19px!important;min-height:19px!important;
  padding:0!important;display:grid;place-items:center;overflow:visible;
  background:#47253d!important;border:2px solid #f3bded!important;border-radius:50%!important;
  box-shadow:0 1px 7px #160b1bcc!important;color:#f6d2fa;cursor:pointer;
}
.world-map-viewer .world-map-coven-button-text{
  position:absolute;bottom:calc(100% + 5px);left:50%;transform:translateX(-50%);
  display:block;min-width:76px;white-space:nowrap;text-align:center;
  padding:3px 5px;border-radius:5px;border:1px solid #c89aca;
  background:rgba(48,25,53,.94);color:#f9e1fa;
  font:700 9px/1.1 Georgia,serif!important;box-shadow:0 2px 5px #130b15b0;
  pointer-events:none;
}
.world-map-viewer .world-map-coven-marker.is-selected,
.world-map-viewer .world-map-scroll:not(.world-map-panning) .world-map-coven-marker:hover{
  outline:2px solid #fff;outline-offset:2px;
}
.world-map-viewer .world-map-scroll.world-map-panning .world-map-coven-marker{pointer-events:none!important;}
.world-map-coven-boss-roster{display:grid;gap:7px;margin:8px 0 13px;}
.world-map-coven-boss-slot{display:flex;align-items:center;gap:10px;min-height:43px;
  padding:5px 8px;border-radius:6px;background:rgba(54,37,64,.78);
  border:1px solid #765384;color:#f4def8;font:700 13px Georgia,serif;}
.world-map-coven-boss-emblem{display:grid;place-items:center;width:29px;height:29px;
  border:1px solid #ad79ae;border-radius:4px;background:#23182b;color:#cd9fd1;}

/* V0.30.6 Hotfix 9: ease the Bandit Blockade tag down slightly from its
   authored dungeon point. The actual Bandit Blockade TMX coordinates are unchanged. */
.world-map-viewer .world-map-dungeon-marker{
  transform:translate(-50%,calc(-50% + 10px))!important;
}

/* V0.30.6 Hotfix 9: individual Coven witch portraits supplied by the creator. */
.world-map-coven-boss-portrait{width:50px;height:50px;flex:0 0 50px;object-fit:contain;image-rendering:pixelated;}
.world-map-coven-boss-slot{min-height:55px;}

/* Hotfix 9: boss captions sit closer to their numbered markers. The markers
   themselves and the authored stage coordinates remain unchanged. */
.world-map-viewer .world-map-boss-button-name{bottom:calc(100% + 2px)!important;}

/* Map dungeon details: readable location title with a compact type marker.
   The Coven entrance shares the Bandit Blockade visual language and layout. */
.world-map-details .world-map-dungeon-heading{
  display:flex;align-items:flex-start;justify-content:space-between;
  column-gap:8px;row-gap:5px;flex-wrap:wrap;margin:4px 0 14px;
}
.world-map-details .world-map-dungeon-heading h3{margin:3px 0 0;flex:1 1 auto;min-width:0;}
.world-map-details .world-map-dungeon-type{
  flex:0 0 auto;display:inline-block;margin-top:9px;
  padding:4px 7px;border:1px solid rgba(178,197,232,.50);
  border-radius:5px;background:rgba(34,45,69,.64);
  color:#d4e4fa;font:700 10px/1.1 Georgia,serif;
  letter-spacing:.03em;white-space:nowrap;
}
.world-map-details .world-map-dungeon-heading+.world-map-enemies-heading{margin-top:4px;}
.world-map-details .world-map-dungeon-heading+.world-map-encounter-facts{margin-top:3px;}

/* V0.30.67 — animated pixel-effect overlay. Only PD/basic strikes keep a leap. */
.battle-sprite-layer .rf-combat-animation{display:block;position:absolute;pointer-events:none!important;
  image-rendering:pixelated!important;mix-blend-mode:normal;filter:drop-shadow(0 1px 3px rgba(0,0,0,.27));}
.battle-sprite.rf-fx-leap-basic{animation:rf-classic-leap-aimed .82s cubic-bezier(.2,.75,.25,1) both!important;}
.battle-sprite.rf-fx-leap-ability{animation:rf-classic-leap-aimed .74s ease both!important;}
@keyframes rf-classic-leap-aimed{
  0%,100%{transform:translate(0,0) scale(1)}
  48%{transform:translate(var(--rf-leap-to-x,148px),var(--rf-leap-to-y,-7px)) scale(1.08)}
}

/* V0.31.2: DoT ticks pulse ON the affected character. Never replay the cast
   projectile or leap during Curse, Bleed, Burn, Poison, etc. */
.rf-periodic-tick{
  --rf-tick:#b98bef; position:absolute; z-index:38; pointer-events:none;
  width:32px;height:32px; box-sizing:border-box; border:3px solid var(--rf-tick);
  border-radius:3px; background:color-mix(in srgb,var(--rf-tick) 22%,transparent);
  box-shadow:0 0 0 2px #15131bc9,0 0 12px var(--rf-tick);
  transform:translate(-50%,-50%) scale(.5);
  animation:rf-periodic-tick 315ms steps(5,end) both;
}
.rf-periodic-tick::before{
  content:'';position:absolute;inset:7px;border:2px solid var(--rf-tick);
}
.rf-periodic-curse{--rf-tick:#b58af9;}
.rf-periodic-poison{--rf-tick:#88dc70;}
.rf-periodic-burn{--rf-tick:#ff9e4e;}
.rf-periodic-bleed{--rf-tick:#ec626e;}
.rf-periodic-frost{--rf-tick:#75cfe8;}
.rf-periodic-heal{--rf-tick:#82f2ba;}
@keyframes rf-periodic-tick{
  0%{opacity:0;transform:translate(-50%,-50%) scale(.35);}
  25%{opacity:1;}
  65%{opacity:.85;transform:translate(-50%,-50%) scale(1);}
  100%{opacity:0;transform:translate(-50%,-50%) scale(1.3);}
}

/* V0.31.3 — Region themes and consistent stage/encounter badges.  Special
   campaign bosses are gold; branch markers match their hideout tags. */
.world-map-viewer .world-map-boss-marker{
  border:1.5px solid #ffdf86!important;
  background:#aa771d!important;color:#fff3ca!important;
  box-shadow:0 0 5px rgba(255,205,91,.50),0 2px 3px #281908bb!important;
}
.world-map-viewer .world-map-boss-button-num{color:#fff7da!important;}
.world-map-viewer .world-map-boss-button-name{
  color:#ffdf86!important;text-shadow:0 1px 2px #271700,-1px 0 #271700,1px 0 #271700,0 -1px #271700;
}
.world-map-viewer .world-map-future-boss-stage{
  border:2px dashed #ffdb88!important;
  background:#977024!important;color:#fff4ce!important;
}
.world-map-viewer .world-map-branch-bandit{
  border-color:#ffa4aa!important;background:#9f2734!important;color:#fff0f1!important;
  box-shadow:0 2px 3px #381016bb!important;
}
/* V0.31.6: The road BEYOND Bandit Blockade is unreleased. Grey only its
   continuation tiles; the seven markers leading INTO the camp stay red. */
.world-map-viewer .world-map-branch-bandit-after{
  border-color:#b9c2cc!important;
  background:#555e68!important;
  color:#e2e6eb!important;
  box-shadow:0 2px 3px rgba(18,22,27,.65)!important;
  opacity:.75!important;
  cursor:default!important;
  pointer-events:none!important;
}
.world-map-viewer .world-map-branch-coven{
  border-color:#edb5ff!important;background:#752d91!important;color:#ffeaff!important;
  box-shadow:0 2px 3px #230c32bb!important;
}
.world-map-viewer .world-map-dungeon-marker{
  border-color:#ffadb6!important;background:#a12838!important;color:#fff0f2!important;
  box-shadow:0 2px 5px rgba(54,10,19,.72)!important;
}
/* Same compact click-target badge used at both camps. The Coven label stays
   above its cottage so the text doesn't cover the cottage sprite. */
.world-map-viewer .world-map-coven-marker{
  display:flex!important;align-items:center!important;justify-content:center!important;
  box-sizing:border-box!important;width:auto!important;height:21px!important;
  min-width:84px!important;min-height:21px!important;max-width:none!important;
  border:1.5px solid #e6b5f9!important;border-radius:6px!important;
  background:#75318f!important;color:#fbe8ff!important;padding:2px 6px!important;
  box-shadow:0 2px 5px rgba(35,12,48,.70)!important;
  transform:translate(-50%,calc(-50% - 25px))!important;
  cursor:pointer;
}
.world-map-viewer .world-map-coven-button-text{
  position:static!important;display:block!important;min-width:0!important;
  transform:none!important;padding:0!important;border:0!important;
  background:none!important;box-shadow:none!important;
  font:700 9px/1.1 Georgia,serif!important;color:#ffeaff!important;
  white-space:nowrap;
}
/* Stage preview: every enemy gets its own evenly spaced and highlighted slot.
   A 4-hero vs 5-enemy preview now fits on one row without wrapping 4+1. */
.world-map-details .world-map-enemy-icons{
  display:grid!important;grid-template-columns:repeat(var(--enemy-count,4),minmax(0,1fr));
  gap:5px!important;align-items:center;justify-items:stretch;
  width:100%;margin:10px 0 16px;
}
.world-map-details .world-map-enemy-icon{
  box-sizing:border-box;min-width:0;width:100%;height:auto;aspect-ratio:1;
  max-height:55px;justify-self:center;
  border:2px solid rgba(228,178,246,.82);
  box-shadow:inset 0 0 0 1px rgba(35,20,45,.85),0 1px 5px rgba(14,9,22,.50);
}
.world-map-details .world-map-enemy-icon img{
  box-sizing:border-box;display:block;width:calc(100% - 4px);height:calc(100% - 4px);
  max-width:49px;max-height:49px;min-width:0;object-fit:contain;
}


/* V0.31.6: Live numbered Blockade battles use the same compact marker as
   Realm 1's other stages, with red tint and clear 1..7 numerals. */
.world-map-viewer .world-map-branch-bandit .world-map-stage-num{
  opacity:1!important;font:700 9px/1 Georgia,serif!important;
}
.world-map-viewer button.world-map-branch-bandit:hover,
.world-map-viewer button.world-map-branch-bandit.is-selected{
  border-color:#ffd0d2!important;background:#bd3647!important;
}
/* The Boss and Dungeon encounter-type labels use exactly one shared style. */
.world-map-details .world-map-boss-type{
  display:inline-block;padding:4px 7px;border:1px solid rgba(178,197,232,.50);
  border-radius:5px;background:rgba(34,45,69,.64);
  color:#d4e4fa;font:700 10px/1.1 Georgia,serif;
  letter-spacing:.03em;white-space:nowrap;
}
.world-map-details .world-map-encounter-facts .world-map-boss-type{margin-top:-1px;}

/* V0.31.7: Real, numbered purple trail battles and compact purple Boss/Dungeon tags. */
.world-map-viewer .world-map-branch-coven .world-map-stage-num{
  opacity:1!important;font:700 9px/1 Georgia,serif!important;
}
.world-map-viewer button.world-map-branch-coven:hover,
.world-map-viewer button.world-map-branch-coven.is-selected{
  background:#9541b0!important;border-color:#f6d8ff!important;
}
.world-map-details .world-map-dungeon-heading{
  flex-direction:column!important;flex-wrap:nowrap!important;align-items:flex-start!important;
  justify-content:flex-start!important;gap:3px!important;margin:3px 0 5px!important;
}
.world-map-details .world-map-dungeon-heading h3{flex:none!important;margin:0!important;}
.world-map-details .world-map-dungeon-type,
.world-map-details .world-map-boss-type{
  background:rgba(113,44,139,.66)!important;border-color:#bb7ee2!important;
  color:#f5dafe!important;margin:0!important;
}
.world-map-details .world-map-dungeon-heading+.world-map-enemy-icons{margin-top:7px!important;}
.world-map-details .world-map-dungeon-heading+.world-map-encounter-facts{margin-top:2px!important;}
.world-map-details .world-map-encounter-facts{margin:4px 0 7px!important;}
.world-map-details .world-map-enemy-icons{margin-bottom:9px!important;}

/* V0.31.18 — account-owned stage progression locks; previews stay selectable. */
.world-map-stage.is-progression-locked{filter:grayscale(1) brightness(.64);opacity:.63;}
.world-map-coven-marker.is-progression-locked{filter:grayscale(1) brightness(.64);opacity:.7;}
.world-map-stage.is-progression-locked:hover,.world-map-stage.is-progression-locked.is-selected{opacity:.84;}

/* V0.31.21 — Grey means server-locked, including the red Blockade approach
   and its dungeon entrance. Unlocked Blockade markers remain red. */
.world-map-viewer .world-map-branch-bandit.is-progression-locked,
.world-map-viewer button.world-map-branch-bandit.is-progression-locked:hover,
.world-map-viewer button.world-map-branch-bandit.is-progression-locked.is-selected,
.world-map-viewer .world-map-branch-coven.is-progression-locked,
.world-map-viewer button.world-map-branch-coven.is-progression-locked:hover,
.world-map-viewer button.world-map-branch-coven.is-progression-locked.is-selected{
  background:#49525d!important; border-color:#a0aab5!important;
  color:#e1e5e9!important; box-shadow:0 2px 3px #1e252c99!important;
  filter:none!important;opacity:.65;
}
.world-map-viewer .world-map-dungeon-marker.is-locked,
.world-map-viewer .world-map-dungeon-marker.is-locked:hover,
.world-map-viewer .world-map-dungeon-marker.is-locked.is-selected{
  background:#49525d!important;border-color:#a0aab5!important;
  color:#e1e5e9!important;box-shadow:0 2px 3px #1e252c99!important;
  opacity:.72!important;filter:none!important;
}
/* Future Slime Swamp route is identified by green placeholder tiles.
   This is a visual plan only; these markers have no playable encounters yet. */
.world-map-viewer .world-map-branch-swamp{
  background:#245f34!important;border-color:#a3e6a4!important;
  color:#e8ffe5!important;box-shadow:0 2px 3px #112918bb!important;
  opacity:.92!important;cursor:default!important;pointer-events:none!important;
}
.world-map-viewer .world-map-swamp-dungeon{
  width:auto!important;height:23px!important;min-width:91px!important;
  padding:3px 7px!important;border:1.5px solid #a3e6a4!important;
  border-radius:6px!important;background:#245f34!important;color:#e8ffe5!important;
  box-shadow:0 2px 5px #112918bb!important;opacity:.96!important;
  font:700 10px/1.1 Georgia,serif!important;white-space:nowrap;
}
.world-map-viewer .world-map-swamp-dungeon-label{display:block;}

/* V0.31.21 — RealmGuardians monthly row, matching the Supporter Bundle. */
#goldShopModal .gold-shop-guardian-row{margin-top:12px;}
#goldShopModal .gold-pack-guardian{
  border-color:#73be9ca6;
  background:linear-gradient(110deg,#23483d 0%,#263d43 48%,#1c2631 100%);
}
#goldShopModal .gold-pack-guardian .gold-shop-buy{
  background:linear-gradient(160deg,#b0e1cc,#6eaa93)!important;
  border-color:#c0edda!important;color:#102b24!important;
}
#goldShopModal .gold-pack-guardian .gold-shop-buy:hover:not(:disabled){background:#d3f2e4!important;}
#goldShopModal .gold-pack-guardian .gold-pack-amount,
#goldShopModal .gold-pack-guardian .gold-pack-amount>span{color:#d6f5e5;}
#goldShopModal .gold-pack-guardian .gold-supporter-perks span+span:before{color:#94d9b5;}
#goldShopModal .gold-pack-guardian .gold-pack-price small{font-size:.58em;opacity:.8;margin-left:3px;}
#goldShopModal .gold-guardian-status{font:700 12px/1.5 system-ui,sans-serif;color:#b2ebcf;margin-top:4px;}
.character-hall-user .realm-guardian-title{display:inline-flex;align-items:center;padding:3px 9px;
 border:1px solid #66c9a5;border-radius:100px;color:#c0f4de;background:#20513e;
 font:750 11px/1.2 system-ui,sans-serif;letter-spacing:.03em;}
.character-hall-user .realm-guardian-title.hidden{display:none!important;}

/* V0.31.21 — eliminate unused Get Gold bottom gutter, without altering pack spacing. */
#goldShopModal .gold-shop-panel{padding-bottom:12px;}
#goldShopModal .gold-shop-feedback:empty{display:none;}
#goldShopModal .gold-pack-guardian .gold-pack-label{font-size:clamp(16px,1.9vw,20px)!important;line-height:1.15;}
@media(max-width:400px){#goldShopModal .gold-shop-panel{padding-bottom:9px;}}

/* V0.31.21 — Ringmaster-style Barnaby: same battlefield scale as a companion. */
.battle-sprite.sprite-bard-companion{--rf-sprite-size:152px!important}
@media(max-width:1180px){.battle-sprite.sprite-bard-companion{--rf-sprite-size:138px!important}}
@media(max-width:650px){.battle-sprite.sprite-bard-companion{--rf-sprite-size:118px!important}}

/* V0.31.23: castle destinations are hotspots on the persistent world map. */
.world-map-viewer .world-map-kingdom{pointer-events:none!important;opacity:.85;}
.world-map-viewer .world-map-castle-building{position:absolute;z-index:12;transform:translate(-50%,-110%);border:0;background:transparent;padding:0;cursor:pointer;pointer-events:auto;}
.world-map-viewer .world-map-castle-building span{display:block;white-space:nowrap;background:rgba(22,22,28,.88);border:1px solid #f2d9a5;border-radius:4px;padding:3px 5px;color:#ffeac1;font:700 9px Georgia,serif;box-shadow:0 2px 4px #0009;}
.world-map-viewer .world-map-castle-building:hover span{background:#55406b;outline:1px solid #e6c0ff;}
.world-map-viewer .world-map-realmwalker{position:absolute;z-index:8;transform:translate(-50%,-115%);font-size:17px;filter:drop-shadow(0 1px 2px #000);pointer-events:none;}
.world-map-coven-boss-roster{display:flex!important;flex-direction:column!important;align-items:stretch!important;}

/* V0.31.24: RealmWalker feet aligned with the active numbered battle tile. */
.world-map-viewer .world-map-realmwalker{z-index:25;transform:translate(-50%,-91%);width:30px;height:30px;display:flex;align-items:flex-end;justify-content:center;filter:drop-shadow(0 2px 1px #000a)}
.world-map-viewer .world-map-realmwalker img{display:block;width:30px;height:30px;object-fit:contain;image-rendering:pixelated}

/* V0.31.25: character stands ON the numbered tile, not above it. */
.world-map-viewer .world-map-realmwalker{
  transform:translate(-50%,-50%)!important;
  width:27px!important;height:27px!important;
}
.world-map-viewer .world-map-realmwalker img{width:27px!important;height:27px!important;}

/* Highlight map artwork rather than the floating destination captions.
   Transparent hit/selection areas are anchored to the actual structures. */
.world-map-viewer .world-map-castle-building,
.world-map-viewer .world-map-dungeon-marker,
.world-map-viewer .world-map-coven-marker{overflow:visible!important;isolation:isolate;}
.world-map-viewer .world-map-castle-building::before,
.world-map-viewer .world-map-dungeon-marker::before,
.world-map-viewer .world-map-coven-marker::before{
  content:"";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);
  width:var(--building-w,44px);height:var(--building-h,39px);
  border-radius:5px;border:2px solid transparent;
  background:transparent;pointer-events:none;z-index:-1;
}
.world-map-viewer .world-map-castle-building:hover::before,
.world-map-viewer .world-map-castle-building:focus-visible::before,
.world-map-viewer .world-map-castle-building.is-selected::before,
.world-map-viewer .world-map-dungeon-marker:hover::before,
.world-map-viewer .world-map-dungeon-marker.is-selected::before,
.world-map-viewer .world-map-coven-marker:hover::before,
.world-map-viewer .world-map-coven-marker.is-selected::before{
  border-color:#ffe9a8;background:rgba(255,227,119,.24);
  box-shadow:0 0 16px 5px rgba(255,216,99,.55),inset 0 0 12px rgba(255,236,142,.30);
}
/* Labels stay visually unchanged on hover and selection. */
.world-map-viewer .world-map-castle-building:hover span,
.world-map-viewer .world-map-castle-building:focus-visible span,
.world-map-viewer .world-map-castle-building.is-selected span{
  background:rgba(22,22,28,.88)!important;outline:none!important;
}
.world-map-viewer .world-map-castle-building[data-building="merchant"]{--building-w:58px;--building-h:44px;}
.world-map-viewer .world-map-castle-building[data-building="pvp"]{--building-w:68px;--building-h:55px;}
.world-map-viewer .world-map-castle-building[data-building="quest"]{--building-w:39px;--building-h:35px;}
.world-map-viewer .world-map-castle-building[data-building="craft"]{--building-w:44px;--building-h:42px;}
.world-map-viewer .world-map-dungeon-marker{--building-w:95px;--building-h:68px;}
.world-map-viewer .world-map-coven-marker{--building-w:60px;--building-h:57px;}
/* Prevent the previous badge highlight from overriding the artwork highlight. */
.world-map-viewer .world-map-dungeon-marker.is-selected,
.world-map-viewer .world-map-coven-marker.is-selected{outline:none!important;}
/* Artwork offsets: castle labels sit above roofs; camp label sits below tents. */
.world-map-viewer .world-map-castle-building::before{top:calc(100% + 18px)!important;}
.world-map-viewer .world-map-dungeon-marker::before{top:calc(50% - 53px)!important;}
.world-map-viewer .world-map-coven-marker::before{top:calc(50% + 18px)!important;}

/* V0.31.26: show each boss's existing battle sprite directly over its stage number. */
.world-map-viewer .world-map-boss-marker{isolation:isolate!important;}
.world-map-viewer .world-map-boss-sprite{position:absolute!important;left:50%!important;bottom:calc(100% - 2px)!important;transform:translateX(-50%)!important;width:38px!important;height:38px!important;object-fit:contain!important;image-rendering:pixelated!important;pointer-events:none!important;z-index:2!important;filter:drop-shadow(0 2px 2px #000b)!important;}
.world-map-viewer .world-map-boss-button-name{bottom:calc(100% + 39px)!important;}

/* V0.31.27 — Character and boss sprites cover their numbered battle tiles. */
.world-map-viewer .world-map-realmwalker{transform:translate(-50%,-50%)!important;z-index:30!important;width:36px!important;height:36px!important;}
.world-map-viewer .world-map-realmwalker img{width:36px!important;height:36px!important;object-fit:contain!important;}
.world-map-viewer .world-map-boss-sprite{bottom:auto!important;top:50%!important;left:50%!important;transform:translate(-50%,-50%)!important;width:42px!important;height:42px!important;z-index:5!important;}
.world-map-viewer .world-map-boss-button-name{bottom:calc(100% + 27px)!important;}
/* Kingdom destination captions: purple with black lettering, no badge hover glow. */
.world-map-viewer .world-map-castle-building span,
.world-map-viewer .world-map-castle-building:hover span,
.world-map-viewer .world-map-castle-building:focus-visible span,
.world-map-viewer .world-map-castle-building.is-selected span{background:#9872cf!important;color:#100b18!important;border:1px solid #3d265d!important;outline:none!important;box-shadow:0 2px 3px #0008!important;}

/* V0.31.28: purple location tabs, white lettering with a strong black outline.
   Preserve building-only highlight feedback, not label hover highlights. */
.world-map-viewer .world-map-castle-building span,
.world-map-viewer .world-map-castle-building:hover span,
.world-map-viewer .world-map-castle-building:focus-visible span,
.world-map-viewer .world-map-castle-building.is-selected span {
 background:#9872cf!important;color:#fff!important;
 -webkit-text-stroke:0!important;
 text-shadow:-1px -1px 0 #09040d,1px -1px 0 #09040d,-1px 1px 0 #09040d,1px 1px 0 #09040d!important;
 border:1px solid #3d265d!important;outline:none!important;
 box-shadow:0 2px 3px #0008!important;
}

/* V0.31.30: sprites anchored to the exact numbered tile DOM node. */
.world-map-viewer .world-map-walker-anchor{display:none!important;position:absolute!important;inset:0!important;pointer-events:none!important;z-index:30!important;overflow:visible!important;align-items:center!important;justify-content:center!important;}
.world-map-viewer .world-map-stage[data-walker="true"] .world-map-walker-anchor{display:flex!important;}
.world-map-viewer .world-map-walker-anchor img{position:absolute!important;left:50%!important;top:50%!important;transform:translate(-50%,-50%)!important;width:33px!important;height:33px!important;max-width:none!important;object-fit:contain!important;image-rendering:pixelated!important;filter:drop-shadow(0 2px 1px #000b)!important;}
.world-map-viewer .world-map-boss-marker .world-map-boss-sprite{position:absolute!important;left:50%!important;top:50%!important;bottom:auto!important;transform:translate(-50%,-50%)!important;width:42px!important;height:42px!important;object-fit:contain!important;z-index:20!important;}
/* Gold polygon outlines follow roof silhouettes, never a rectangular box. */
.world-map-viewer .world-map-castle-building::before,.world-map-viewer .world-map-dungeon-marker::before,.world-map-viewer .world-map-coven-marker::before{border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;clip-path:none!important;}
.world-map-viewer .world-map-castle-building::after,.world-map-viewer .world-map-dungeon-marker::after,.world-map-viewer .world-map-coven-marker::after{content:"";position:absolute;left:50%;top:calc(100% + 18px);transform:translate(-50%,-50%);width:var(--building-w,44px);height:var(--building-h,39px);pointer-events:none;opacity:0;z-index:-1;background:#ffcf44;clip-path:polygon(50% 0%,98% 30%,98% 94%,79% 94%,79% 100%,21% 100%,21% 94%,2% 94%,2% 30%,50% 0%,50% 9%,10% 35%,10% 87%,90% 87%,90% 35%,50% 9%);filter:drop-shadow(0 0 3px #ffd54f);}
.world-map-viewer .world-map-dungeon-marker::after{top:calc(50% - 53px);clip-path:polygon(4% 75%,15% 36%,32% 40%,43% 9%,57% 9%,68% 40%,85% 36%,96% 75%,96% 95%,4% 95%,4% 75%,12% 75%,12% 88%,88% 88%,88% 75%,80% 48%,64% 52%,53% 19%,47% 19%,36% 52%,20% 48%,12% 75%);}
.world-map-viewer .world-map-coven-marker::after{top:calc(50% + 18px);}
.world-map-viewer .world-map-castle-building:hover::after,.world-map-viewer .world-map-castle-building:focus-visible::after,.world-map-viewer .world-map-castle-building.is-selected::after,.world-map-viewer .world-map-dungeon-marker:hover::after,.world-map-viewer .world-map-dungeon-marker:focus-visible::after,.world-map-viewer .world-map-dungeon-marker.is-selected::after,.world-map-viewer .world-map-coven-marker:hover::after,.world-map-viewer .world-map-coven-marker:focus-visible::after,.world-map-viewer .world-map-coven-marker.is-selected::after{opacity:1;}

/* V0.31.31: retain the actual numbered square, with the sprite's feet standing over its center. */
.world-map-viewer .world-map-stage[data-walker="true"]{overflow:visible!important;}
.world-map-viewer .world-map-stage[data-walker="true"] .world-map-stage-num{display:inline!important;visibility:visible!important;opacity:1!important;}
.world-map-viewer .world-map-stage[data-walker="true"] .world-map-walker-anchor{overflow:visible!important;}
.world-map-viewer .world-map-stage[data-walker="true"] .world-map-walker-anchor img{top:auto!important;bottom:50%!important;left:50%!important;transform:translateX(-50%)!important;width:33px!important;height:33px!important;}
/* Boss feet moved downward from the earlier hovering position, leaving the square intact. */
.world-map-viewer .world-map-boss-marker{overflow:visible!important;}
.world-map-viewer .world-map-boss-marker .world-map-boss-sprite{top:calc(50% + 12px)!important;bottom:auto!important;left:50%!important;transform:translate(-50%,-50%)!important;}
.world-map-viewer .world-map-boss-marker .world-map-boss-button-num{display:inline!important;visibility:visible!important;opacity:1!important;}

/* V0.31.32: restore numbered tiles and position sprite FEET over the tile,
   rather than centering the full sprite on the tile or shifting it downward. */
.world-map-viewer .world-map-boss-marker{overflow:visible!important;isolation:auto!important;}
.world-map-viewer .world-map-boss-marker .world-map-boss-sprite{
  position:absolute!important;left:50%!important;top:auto!important;
  bottom:5px!important;transform:translateX(-50%)!important;
  width:42px!important;height:42px!important;max-width:none!important;
  object-fit:contain!important;image-rendering:pixelated!important;
  z-index:5!important;pointer-events:none!important;
}
.world-map-viewer .world-map-boss-marker .world-map-boss-button-name{
  bottom:calc(100% + 48px)!important;z-index:7!important;
}
.world-map-viewer .world-map-boss-marker .world-map-boss-button-num{
  display:inline!important;visibility:visible!important;opacity:1!important;z-index:1!important;
}
.world-map-viewer .world-map-stage[data-walker="true"] .world-map-walker-anchor img{
  top:auto!important;bottom:4px!important;left:50%!important;
  transform:translateX(-50%)!important;width:33px!important;height:33px!important;
  object-fit:contain!important;
}
/* Use an actual SVG path instead of the old offset pseudo-element rectangles.
   Each path is attached to the corresponding building hotspot. */
.world-map-viewer .world-map-castle-building::before,
.world-map-viewer .world-map-castle-building::after{display:none!important;content:none!important;}
.world-map-viewer .world-map-castle-building .rf-roof-outline{
  position:absolute;left:50%;top:calc(100% + 18px);
  transform:translate(-50%,-50%);width:var(--building-w,44px);
  height:var(--building-h,39px);overflow:visible;
  pointer-events:none;opacity:0;z-index:2;
  filter:drop-shadow(0 0 3px #f9c43b);
}
.world-map-viewer .world-map-castle-building .rf-roof-outline path{
  fill:rgba(255,209,56,.08);stroke:#ffd23c;stroke-width:4;
  stroke-linejoin:round;vector-effect:non-scaling-stroke;
}
.world-map-viewer .world-map-castle-building:hover .rf-roof-outline,
.world-map-viewer .world-map-castle-building:focus-visible .rf-roof-outline,
.world-map-viewer .world-map-castle-building.is-selected .rf-roof-outline{opacity:1;}

/* V0.31.33: real party leader centered over intact numbered tiles. */
.world-map-viewer .world-map-stage[data-walker="true"] .world-map-walker-anchor img{
 left:50%!important;top:50%!important;bottom:auto!important;
 transform:translate(-50%,-50%)!important;width:32px!important;height:32px!important;
 z-index:30!important;
}
.world-map-viewer .world-map-boss-marker .world-map-boss-sprite{
 width:29px!important;height:29px!important;bottom:4px!important;
 top:auto!important;transform:translateX(-50%)!important;
}


/* V0.31.34: art-first hit regions, legible castle labels, and tile-bound sprites.
   The map SVG is in the SAME 1120x1206.154 coordinate system as the tiles.
   A purple label is NOT the hover target of a highlight. */
.world-map-viewer .rf-map-art-hotspots{
  position:absolute;left:0;top:0;width:1120px;height:1206.154px;
  z-index:17;overflow:visible;pointer-events:none;
}
.world-map-viewer .rf-map-art-hotspot{
  pointer-events:visiblePainted;fill:#f4c546;fill-opacity:.001;
  stroke:transparent;stroke-width:1.25px;stroke-linejoin:round;
  cursor:pointer;outline:none;
}
.world-map-viewer .rf-map-art-hotspot:hover,
.world-map-viewer .rf-map-art-hotspot:focus-visible,
.world-map-viewer .rf-map-art-hotspot.is-selected{
  fill-opacity:.065;stroke:#ffca32;stroke-width:1.8px;
  filter:drop-shadow(0 0 2px #ffe68a);
}
.world-map-viewer .world-map-scroll.world-map-panning .rf-map-art-hotspot{pointer-events:none!important;}
/* Disable outdated marker-shaped highlighting on camp/cottage tabs. */
.world-map-viewer .world-map-dungeon-marker::before,
.world-map-viewer .world-map-dungeon-marker::after,
.world-map-viewer .world-map-coven-marker::before,
.world-map-viewer .world-map-coven-marker::after {display:none!important;content:none!important;}
.world-map-viewer .world-map-dungeon-marker:hover,
.world-map-viewer .world-map-dungeon-marker:focus-visible,
.world-map-viewer .world-map-dungeon-marker.is-selected,
.world-map-viewer .world-map-coven-marker:hover,
.world-map-viewer .world-map-coven-marker:focus-visible,
.world-map-viewer .world-map-coven-marker.is-selected{
  outline:0!important;outline-offset:0!important;
}
/* No old roof outline glued under the name tags. */
.world-map-viewer .world-map-castle-building::before,
.world-map-viewer .world-map-castle-building::after,
.world-map-viewer .world-map-castle-building .rf-roof-outline{display:none!important;}
.world-map-viewer .world-map-castle-building{z-index:19!important;}
.world-map-viewer .world-map-castle-building > span,
.world-map-viewer .world-map-castle-building:hover > span,
.world-map-viewer .world-map-castle-building:focus-visible > span,
.world-map-viewer .world-map-castle-building.is-selected > span{
  background:#9872cf!important;color:#fff!important;
  font:700 10px/1.14 Georgia,serif!important;
  -webkit-text-stroke:.22px #100818!important;
  text-shadow:0 1px 0 #100818!important;
  border:1px solid #3d265d!important;outline:none!important;
  box-shadow:0 2px 3px #0008!important;
}
/* Native numbered squares remain visible; feet align with the tile center.
   The drawn sprite is not a replacement for the tile's HTML button. */
.world-map-viewer .world-map-stage[data-walker="true"] .world-map-walker-anchor img{
  top:auto!important;bottom:50%!important;left:50%!important;
  transform:translateX(-50%)!important;
  width:29px!important;height:29px!important;object-fit:contain!important;
  pointer-events:none!important;z-index:22!important;
}
.world-map-viewer .world-map-boss-marker .world-map-boss-sprite,
.world-map-viewer .world-map-branch-bandit .world-map-branch-boss-sprite{
  position:absolute!important;top:auto!important;bottom:50%!important;left:50%!important;
  transform:translateX(-50%)!important;width:25px!important;height:25px!important;
  object-fit:contain!important;image-rendering:pixelated!important;
  pointer-events:none!important;z-index:18!important;filter:drop-shadow(0 1px 1px #0008)!important;
}
.world-map-viewer .world-map-boss-marker .world-map-boss-button-name{display:none!important;}
.world-map-viewer .world-map-boss-marker .world-map-boss-button-num,
.world-map-viewer .world-map-branch-bandit .world-map-stage-num{
  position:relative!important;z-index:3!important;
}
.world-map-viewer .world-map-branch-bandit:has(.world-map-branch-boss-sprite){overflow:visible!important;}


/* V0.31.37 — nudge all map character feet upward so they land in the
   bottom quarter of the numbered square, centered horizontally. */
.world-map-viewer .world-map-stage[data-walker="true"] .world-map-walker-anchor img,
.world-map-viewer .world-map-boss-marker .world-map-boss-sprite,
.world-map-viewer .world-map-branch-bandit .world-map-branch-boss-sprite{
  top:auto!important;
  bottom:3px!important;
  left:50%!important;
  transform:translateX(-50%)!important;
  object-fit:contain!important;
  pointer-events:none!important;
}
/* Preserve V0.31.34 sizing. Never hide the number/square or overlay a boss name. */
.world-map-viewer .world-map-stage[data-walker="true"] .world-map-walker-anchor img{width:29px!important;height:29px!important;}
.world-map-viewer .world-map-boss-marker .world-map-boss-sprite,
.world-map-viewer .world-map-branch-bandit .world-map-branch-boss-sprite{width:25px!important;height:25px!important;}

/* V0.31.39 — Cottage bosses preview together in one horizontal row.
   Override the old V0.31.23 forced vertical flex layout. */
.world-map-details .world-map-coven-boss-roster{
  display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;
  align-items:stretch!important;gap:6px!important;min-width:0!important;
  width:100%!important;margin:9px 0 14px!important;
}
.world-map-details .world-map-coven-boss-slot{
  display:flex!important;flex-direction:column!important;align-items:center!important;
  justify-content:flex-start!important;min-width:0!important;min-height:0!important;
  gap:5px!important;padding:7px 3px!important;text-align:center!important;
}
.world-map-details .world-map-coven-boss-portrait{
  display:block!important;width:48px!important;height:48px!important;
  max-width:100%!important;flex:0 0 48px!important;
  object-fit:contain!important;image-rendering:pixelated!important;
}
.world-map-details .world-map-coven-boss-slot>span{
  display:block!important;max-width:100%!important;overflow-wrap:anywhere!important;
  font:700 11px/1.2 Georgia,serif!important;
}


/* V0.31.40 — Navvare destination tabs use a crisp outline, not the old shadowed text plate. */
.world-map-viewer .world-map-castle-building > span,
.world-map-viewer .world-map-castle-building:hover > span,
.world-map-viewer .world-map-castle-building:focus-visible > span,
.world-map-viewer .world-map-castle-building.is-selected > span{
  background:#9872cf!important;
  color:#fff!important;
  -webkit-text-stroke:0!important;
  text-shadow:none!important;
  border:1px solid #3d265d!important;
  outline:none!important;
  box-shadow:none!important;
}

/* Ambient Realm 1 details layered above the static map art. */
.world-map-viewer .world-map-ambient-layer{
  position:absolute;inset:0;pointer-events:none;z-index:4;
}
.world-map-viewer .world-map-ambient-flag,
.world-map-viewer .world-map-pvp-duel{
  position:absolute;transform:translate(-50%,-50%);pointer-events:none;
}
.world-map-viewer .world-map-bridge-patch{
  position:absolute;display:block;transform:none;pointer-events:none;
  object-fit:fill;image-rendering:pixelated;z-index:2;
}
.world-map-viewer .world-map-ambient-flag{
  width:16px;height:16px;
  background-image:url('/static/map_fx/FarmerHold_Animation_Banner_3.png');
  background-repeat:no-repeat;
  background-size:128px 176px;
  image-rendering:pixelated;
  z-index:4;
  transform:translate(-50%,-50%) scale(var(--flag-scale,1));
  animation:rf-map-flag-wave .8s steps(8) infinite;
  filter:none!important;
}
.world-map-viewer .world-map-ambient-flag-purple{ background-position:0 -32px; }
@keyframes rf-map-flag-wave{ from{background-position-x:0;} to{background-position-x:-128px;} }

.world-map-viewer .world-map-pvp-duel{
  width:66px;height:40px;z-index:5;overflow:visible;
}
.world-map-viewer .world-map-pvp-fighter{
  position:absolute;bottom:2px;width:24px;height:24px;object-fit:contain;
  image-rendering:pixelated;filter:drop-shadow(0 1px 1px rgba(0,0,0,.45));
}
.world-map-viewer .world-map-pvp-fighter.fighter-left{
  left:8px;animation:rf-map-pvp-left 2.4s ease-in-out infinite;
}
.world-map-viewer .world-map-pvp-fighter.fighter-right{
  right:8px;animation:rf-map-pvp-right 2.4s ease-in-out infinite;
}
.world-map-viewer .world-map-pvp-slash{
  position:absolute;top:9px;width:16px;height:10px;border-top:2px solid rgba(255,245,214,.92);
  border-radius:999px;opacity:0;filter:drop-shadow(0 0 2px rgba(255,245,214,.92));
}
.world-map-viewer .world-map-pvp-slash.slash-left{
  left:26px;transform:rotate(-20deg);animation:rf-map-pvp-slash-left 2.4s linear infinite;
}
.world-map-viewer .world-map-pvp-slash.slash-right{
  right:26px;transform:scaleX(-1) rotate(-20deg);animation:rf-map-pvp-slash-right 2.4s linear infinite;
}
@keyframes rf-map-pvp-left{
  0%,18%,100%{transform:translate(0,0)}
  22%{transform:translate(5px,-1px)}
  28%{transform:translate(10px,-2px)}
  36%,48%{transform:translate(0,0)}
}
@keyframes rf-map-pvp-right{
  0%,52%,100%{transform:translate(0,0)}
  58%{transform:translate(-5px,-1px)}
  64%{transform:translate(-10px,-2px)}
  72%,82%{transform:translate(0,0)}
}
@keyframes rf-map-pvp-slash-left{
  0%,20%,100%{opacity:0}
  24%,28%{opacity:1}
  34%,52%{opacity:0}
}
@keyframes rf-map-pvp-slash-right{
  0%,56%,100%{opacity:0}
  60%,64%{opacity:1}
  70%,88%{opacity:0}
}

/* Fine-tune specific map bosses after the global feet-centering pass. */
.world-map-viewer .world-map-branch-bandit[data-stage="Bandit 7"] .world-map-branch-boss-sprite{
  bottom:1px!important;
}
.world-map-viewer .world-map-boss-marker[data-stage="1.70"] .world-map-boss-sprite{
  left:52%!important;
}


/* V0.31.41 — Forest Gnome Lord uses left-facing source art and should read
   as a compact boss rather than the oversized default placeholder scale. */
.world-map-details .world-map-enemy-icon img.preview-forest-gnome-lord{
  max-width:45px!important;max-height:45px!important;
}
.world-map-details .world-map-enemy-icon:has(img.preview-forest-gnome-lord){
  align-items:end!important;
}
.battle-sprite.sprite-forest-gnome-lord{--rf-sprite-size:112px!important}
@media(max-width:1180px){.battle-sprite.sprite-forest-gnome-lord{--rf-sprite-size:98px!important}}
@media(max-width:650px){.battle-sprite.sprite-forest-gnome-lord{--rf-sprite-size:77px!important}}


/* V0.31.51 — readable, inward-facing Covenant Skeletons and precise targets.
   Generic .battle-sprite.team-2 img { transform:none } used to override the
   lower-specificity summon rule, leaving right-side skeletons facing outward. */
.battle-sprite.team-2 > img.battle-summon-sprite.summon-skeleton{
  /* Independent scale keeps the mirrored facing during lunge animations. */
  scale:-1 1!important;
}
.battle-sprite.team-1 > img.battle-summon-sprite.summon-skeleton{
  scale:1 1!important;
}
/* Make the summoned Skeleton independently selectable in the witch encounter.
   Other fighters' target outlines and plates remain unchanged. */
body.battlefield-targeting .battle-summon-target-control.summon-skeleton-target-control{
  pointer-events:auto!important;
  cursor:crosshair;
  border:2px solid rgba(251,113,133,.55)!important;
  border-radius:8px!important;
  background:rgba(251,113,133,.04)!important;
  z-index:260!important;
}
body.battlefield-targeting .battle-summon-target-control.summon-skeleton-target-control.target-friendly{
  border-color:rgba(74,222,128,.65)!important;
}
body.battlefield-targeting .battle-summon-target-control.summon-skeleton-target-control .battle-summon-target-label{
  display:block!important;
  visibility:visible!important;
  position:absolute!important;
  top:auto!important;
  bottom:calc(100% + 4px)!important;
  background:rgba(13,17,20,.94)!important;
  border:1px solid rgba(251,113,133,.85)!important;
  color:#ffdfdf!important;
  padding:3px 8px!important;
  font-size:11px!important;
  line-height:1.1!important;
  white-space:nowrap!important;
}
/* The old centered target-prompt overlay covered the skeleton's hitbox.
   Put it above the fight when skeletons can be selected. */
@media(min-width:901px){
  body.team-planning.battlefield-targeting:has(.summon-skeleton-target-control) #promptPanel{
    top:8px!important;
    bottom:auto!important;
    transform:translateX(-50%)!important;
    width:min(510px,calc(100% - 36px))!important;
  }
}


/* V0.31.52: original Tiled banner and torch animations, exact tile positions. */
.world-map-viewer .world-map-animated-tiles{
  display:block;position:absolute;transform:none;pointer-events:none;
  object-fit:fill;image-rendering:pixelated;z-index:4;
}
/* Keep the knights large enough to actually read in the pixel-map arena. */
.world-map-viewer .world-map-pvp-duel{width:79px!important;height:47px!important;}
.world-map-viewer .world-map-pvp-fighter{
  width:29px!important;height:36px!important;bottom:2px!important;
  image-rendering:pixelated!important;object-fit:contain!important;
}
.world-map-viewer .world-map-pvp-fighter.fighter-left{left:4px!important;}
.world-map-viewer .world-map-pvp-fighter.fighter-right{right:4px!important;}
.world-map-viewer .world-map-pvp-slash{top:14px!important;}
/* No old window-covering fade between scene loads. */
.scene-curtain{display:none!important;}


/* Keep banner shafts and torch handles painted beneath the animated fabric/flames. */
.world-map-viewer .world-map-animated-fixture{
  display:block;position:absolute;transform:none;pointer-events:none;
  object-fit:fill;image-rendering:pixelated;z-index:3;
}

/* V0.31.53 — Gnome Lord source art natively faces LEFT, toward the player.
   A dedicated no-flip rule prevents inherited enemy mirroring from rotating it. */
.world-map-details .world-map-enemy-icon img.preview-forest-gnome-lord{
  transform:none!important;scale:1 1!important;
}
.battle-sprite.sprite-forest-gnome-lord.team-2 > img{
  transform:none!important;scale:1 1!important;
}
/* PvP arena: lower the duel slightly, shrink the fighters, and slow the rhythm. */
.world-map-viewer .world-map-pvp-duel{width:74px!important;height:44px!important;}
.world-map-viewer .world-map-pvp-fighter{
  width:18px!important;height:24px!important;bottom:-6px!important;
  animation-duration:3.35s!important;
}
.world-map-viewer .world-map-pvp-fighter.fighter-left{left:11px!important;}
.world-map-viewer .world-map-pvp-fighter.fighter-right{right:11px!important;}
.world-map-viewer .world-map-pvp-slash{
  width:11px!important;height:6px!important;top:20px!important;
  animation-duration:3.35s!important;
}
/* Raise the PvP destination label slightly, but keep it lower than the original placement. */
.world-map-viewer .world-map-castle-building[data-building="pvp"]{
  transform:translate(-50%,calc(-110% + 5px))!important;
}


/* 0.31.58 — arena sparring position + slower strikes with recovery time. */
.world-map-viewer .world-map-pvp-duel{width:74px!important;height:44px!important;}
.world-map-viewer .world-map-pvp-fighter{width:14px!important;height:19px!important;bottom:-8px!important;animation-duration:4.8s!important;}
.world-map-viewer .world-map-pvp-fighter.fighter-left{left:13px!important;}
.world-map-viewer .world-map-pvp-fighter.fighter-right{right:13px!important;}
.world-map-viewer .world-map-pvp-slash{width:9px!important;height:6px!important;top:27px!important;animation-duration:4.8s!important;}
/* Slightly above 0.31.57 label, still below its original placement. */
.world-map-viewer .world-map-castle-building[data-building="pvp"]{transform:translate(-50%,calc(-110% + 3px))!important;}
/* Arena sprites use original nearest-neighbor pixel artwork; prevent fuzzy upscaling. */
.world-map-viewer .world-map-pvp-fighter{image-rendering:pixelated!important;}
/* The full APNG frames contain their poles/handles. Do not layer extra supports. */
.world-map-viewer .world-map-animated-tiles{filter:none!important;image-rendering:pixelated!important;}


/* V0.31.59 — final Navvare polish fixes. */
.world-map-viewer .world-map-castle-building > span,
.world-map-viewer .world-map-castle-building:hover > span,
.world-map-viewer .world-map-castle-building:focus-visible > span,
.world-map-viewer .world-map-castle-building.is-selected > span{
  -webkit-text-stroke:0!important;
  text-shadow:none!important;
}
/* Forest Gnome Lord must face inward toward the player in preview + combat. */
.world-map-details .world-map-enemy-icon img.preview-forest-gnome-lord.preview-flip-left,
.world-map-details .world-map-enemy-icon img.preview-flip-left.preview-forest-gnome-lord{
  transform:scaleX(-1)!important;
}
.battle-sprite.sprite-forest-gnome-lord.team-2 > img{
  transform:scaleX(-1)!important;
}
.battle-sprite.sprite-forest-gnome-lord.team-1 > img{
  transform:none!important;
}
/* PvP arena: slightly higher tab label, lower/smaller fighters, slower rhythm, lower slash, visible hit reaction. */
.world-map-viewer .world-map-castle-building[data-building="pvp"]{transform:translate(-50%,calc(-110% + 1px))!important;}
.world-map-viewer .world-map-pvp-duel{width:74px!important;height:44px!important;}
.world-map-viewer .world-map-pvp-fighter{
  width:13px!important;height:18px!important;bottom:-10px!important;
  image-rendering:pixelated!important;object-fit:contain!important;
}
.world-map-viewer .world-map-pvp-fighter.fighter-left{left:14px!important;animation:rf-map-pvp-left-59 5.4s steps(1,end) infinite!important;}
.world-map-viewer .world-map-pvp-fighter.fighter-right{right:14px!important;animation:rf-map-pvp-right-59 5.4s steps(1,end) infinite!important;}
.world-map-viewer .world-map-pvp-slash{width:10px!important;height:6px!important;top:31px!important;opacity:0;}
.world-map-viewer .world-map-pvp-slash.slash-left{left:26px!important;animation:rf-map-pvp-slash-left-59 5.4s linear infinite!important;}
.world-map-viewer .world-map-pvp-slash.slash-right{right:26px!important;animation:rf-map-pvp-slash-right-59 5.4s linear infinite!important;}
@keyframes rf-map-pvp-left-59{
  0%,8%,12%,44%,48%,52%,100%{transform:translateX(0) scaleX(1);} 
  10%{transform:translateX(5px) scaleX(1);} 
  14%{transform:translateX(0) scaleX(1);} 
  50%{transform:translateX(4px) scaleX(1);} 
}
@keyframes rf-map-pvp-right-59{
  0%,8%,12%,44%,48%,52%,100%{transform:translateX(0) scaleX(1);filter:drop-shadow(0 1px 1px rgba(0,0,0,.45));}
  14%,16%{transform:translateX(2px) translateY(-1px) scaleX(1);filter:drop-shadow(0 0 2px rgba(255,230,160,.95)) brightness(1.1);} 
  50%{transform:translateX(-4px) scaleX(1);} 
  54%,56%{transform:translateX(-1px) translateY(-1px) scaleX(1);filter:drop-shadow(0 0 2px rgba(255,230,160,.95)) brightness(1.08);} 
}
@keyframes rf-map-pvp-slash-left-59{
  0%,8%,12%,100%{opacity:0;transform:rotate(-20deg) scale(0.9);} 
  9%,11%{opacity:1;transform:translateY(1px) rotate(-20deg) scale(1);} 
}
@keyframes rf-map-pvp-slash-right-59{
  0%,46%,50%,100%{opacity:0;transform:scaleX(-1) rotate(-20deg) scale(0.9);} 
  47%,49%{opacity:1;transform:translateY(1px) scaleX(-1) rotate(-20deg) scale(1);} 
}

/* V0.31.62 — Realm 1 overworld is the whole viewport, not a menu card.
   Scope every override to the campaign-world screen: the in-combat view-only
   map, merchants, inventory, login and PvP setup retain their own layouts. */
body.mode-selecting .play-mode-overlay:has(.world-map-screen){
  position:fixed!important;inset:0!important;
  width:100vw!important;height:100dvh!important;
  padding:0!important;margin:0!important;
  display:block!important;overflow:hidden!important;
  background:#799d35!important;backdrop-filter:none!important;
}
body.mode-selecting .play-mode-card:has(.world-map-screen){
  position:absolute!important;inset:0!important;
  box-sizing:border-box!important;
  width:100vw!important;max-width:none!important;
  height:100dvh!important;min-height:0!important;max-height:none!important;
  margin:0!important;padding:0!important;
  border:0!important;border-radius:0!important;
  background:transparent!important;box-shadow:none!important;
  backdrop-filter:none!important;overflow:hidden!important;
}
body.mode-selecting .play-mode-card:has(.world-map-screen) > .play-mode-brand-row{
  display:none!important;
}
body.mode-selecting .play-mode-card:has(.world-map-screen) > #modeContent{
  position:relative!important;
  display:block!important;
  width:100%!important;height:100%!important;max-width:none!important;
  min-width:0!important;min-height:0!important;overflow:hidden!important;
}
body.mode-selecting .world-map-screen{
  position:relative!important;isolation:isolate;
  width:100%!important;height:100%!important;min-height:0!important;
  margin:0!important;padding:0!important;box-sizing:border-box!important;
  overflow:hidden!important;
}
/* The global Gold Shop remains at top-left and the global Bag at top-right.
   The old RealmFall heading is unnecessary and would overlap those buttons. */
body.mode-selecting .world-map-screen > .world-map-top{display:none!important;}
body.mode-selecting .world-map-screen > .world-map-launch-error{
  position:absolute;top:64px;left:50%;transform:translateX(-50%);
  z-index:45;width:min(480px,calc(100vw - 40px));pointer-events:none;
}
body.mode-selecting .world-map-screen > .world-map-launch-error:empty{display:none!important;}
body.mode-selecting .world-map-screen > .world-map-body{
  position:absolute!important;inset:0!important;display:block!important;
  width:100%!important;height:100%!important;min-height:0!important;
  margin:0!important;padding:0!important;overflow:hidden!important;
}
body.mode-selecting .world-map-screen .world-map-viewer{
  position:absolute!important;inset:0!important;
  width:100%!important;height:100%!important;min-width:0!important;
  margin:0!important;padding:0!important;border:0!important;border-radius:0!important;
  overflow:hidden!important;
}
body.mode-selecting .world-map-screen .world-map-viewer > .world-map-scroll{
  display:block!important;width:100%!important;height:100%!important;
  min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;
  box-sizing:border-box!important;margin:0!important;
  border:0!important;border-radius:0!important;
  box-shadow:none!important;outline:0!important;
  background:#799d35!important;overflow:auto!important;
  scrollbar-width:none!important;
}
/* Float the existing stage preview and Party pane over the map on the right,
   leaving the rest of the map free to pan all the way to the screen edges. */
body.mode-selecting .world-map-screen .world-map-right-rail{
  position:absolute!important;right:18px!important;top:72px!important;bottom:18px!important;
  z-index:35!important;width:clamp(248px,23vw,310px)!important;
  max-width:calc(100vw - 32px)!important;min-height:0!important;
  display:flex!important;flex-direction:column!important;
  gap:12px!important;align-self:auto!important;
  overflow-y:auto!important;overscroll-behavior:contain;
  scrollbar-width:thin;
  filter:drop-shadow(0 8px 20px rgba(0,0,0,.50));
}
body.mode-selecting .world-map-screen .world-map-right-rail > .world-map-details{
  flex:0 0 auto;position:relative!important;top:auto!important;
  min-height:0!important;width:100%!important;
  background:linear-gradient(160deg,rgba(43,31,57,.94),rgba(16,15,26,.97))!important;
  backdrop-filter:blur(5px);
}
body.mode-selecting .world-map-screen .world-map-right-rail > .world-map-party-queue{
  flex:0 0 auto;background:linear-gradient(160deg,rgba(43,31,57,.94),rgba(16,15,26,.97))!important;
  backdrop-filter:blur(5px);
}
/* Keep the launchers above the map and panels, with their existing actions. */
body.mode-selecting:has(.world-map-screen) #goldShopButton.realm-corner-shortcut,
body.mode-selecting:has(.world-map-screen) #globalInventoryButton.realm-corner-shortcut{
  z-index:2850!important;
}
@media(max-width:700px){
  body.mode-selecting .world-map-screen .world-map-right-rail{
    right:8px!important;top:64px!important;bottom:8px!important;
    width:min(244px,calc(100vw - 24px))!important;gap:8px!important;
  }
  body.mode-selecting .world-map-screen .world-map-right-rail > .world-map-details{
    padding:10px!important;
  }
  body.mode-selecting .world-map-screen .world-map-right-rail > .world-map-party-queue{
    padding:10px 8px!important;
  }
}


/* V0.31.66 — true split-screen map: no map art beneath the sidebar. */
body.mode-selecting .world-map-screen > .world-map-body{
  display:grid!important;grid-template-columns:minmax(0,1fr) clamp(286px,27vw,380px)!important;
  gap:0!important;position:absolute!important;inset:0!important;
  width:100%!important;height:100%!important;align-items:stretch!important;
}
body.mode-selecting .world-map-screen .world-map-viewer{
  position:relative!important;inset:auto!important;grid-column:1!important;
  min-width:0!important;width:100%!important;height:100%!important;
}
body.mode-selecting .world-map-screen .world-map-right-rail{
  position:relative!important;grid-column:2!important;inset:auto!important;
  top:auto!important;right:auto!important;bottom:auto!important;
  box-sizing:border-box!important;width:100%!important;max-width:none!important;
  min-height:0!important;height:100%!important;
  padding:64px 10px 10px!important;overflow:hidden!important;
  display:grid!important;grid-template-rows:minmax(0,32%) minmax(0,31%) minmax(0,1fr)!important;
  align-content:stretch!important;gap:9px!important;
  background:#171721!important;border-left:2px solid #8665a1!important;
  filter:none!important;z-index:35!important;
}
body.mode-selecting .world-map-screen .world-map-right-rail > .world-map-details,
body.mode-selecting .world-map-screen .world-map-right-rail > .world-map-party-queue,
body.mode-selecting .world-map-screen .world-map-right-rail > .world-map-chat{
  box-sizing:border-box!important;width:100%!important;min-width:0!important;
  min-height:0!important;margin:0!important;overflow-y:auto!important;
  position:relative!important;top:auto!important;bottom:auto!important;
  border-radius:9px!important;
  background:linear-gradient(160deg,#352440,#171522)!important;
  border:1px solid #604c76!important;filter:none!important;
}
body.mode-selecting .world-map-screen .world-map-right-rail > .world-map-details{
  max-height:none!important;padding:10px!important;
}
body.mode-selecting .world-map-screen .world-map-right-rail > .world-map-party-queue{
  max-height:none!important;padding:9px!important;
}
.world-map-chat{display:flex;flex-direction:column;padding:10px;gap:6px;color:#f1e5fc;font-family:system-ui,sans-serif;}
.world-map-chat h3{font:700 14px/1.2 Georgia,serif;letter-spacing:.08em;color:#e9cbff;margin:0 0 3px;}
.world-map-chat-messages{flex:1;min-height:40px;overflow-y:auto;overscroll-behavior:contain;display:flex;flex-direction:column;gap:5px;scrollbar-width:thin;font:12px/1.4 system-ui,sans-serif;}
.world-map-chat-message{overflow-wrap:anywhere;white-space:pre-wrap;}
.world-map-chat-message strong{color:#c8a3f6;}
.world-map-chat-form{display:flex;gap:5px;flex-shrink:0;}
.world-map-chat-form input{min-width:0;flex:1;max-width:none;padding:8px 7px;border-radius:5px;border:1px solid #9478a4;background:#0d0d18;color:white;font:12px system-ui,sans-serif;}
.world-map-chat-form button{padding:7px 10px;border:1px solid #ad8dd4;border-radius:5px;background:#674184;color:white;cursor:pointer;font:12px system-ui,sans-serif;}
.world-map-chat-form button:disabled{opacity:.6;cursor:wait;}
.world-map-chat-status{font:11px/1.2 system-ui,sans-serif;color:#e9b4b4;min-height:0;}
/* Preserve approved banner animation: all APNG assets and their positions unchanged. */
/* Restore slightly higher arena fighters and left-shifted Navvare caption locations. */
/* Cottage shows clean side-by-side portraits with names underneath, never outlined cards. */
.world-map-details .world-map-coven-boss-roster{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:6px!important;}
.world-map-details .world-map-coven-boss-slot{
  display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:start!important;
  min-height:0!important;border:0!important;outline:0!important;box-shadow:none!important;
  background:transparent!important;padding:4px 1px!important;gap:4px!important;text-align:center!important;
}
.world-map-details .world-map-coven-boss-portrait{width:45px!important;height:45px!important;object-fit:contain!important;image-rendering:pixelated!important;}
.world-map-details .world-map-coven-boss-slot > span{display:block!important;position:static!important;order:2!important;font:700 11px/1.1 Georgia,serif!important;color:#f4defe!important;text-shadow:none!important;}
/* Covenant road markers use the requested GRAY palette, not the old purple. */
.world-map-viewer .world-map-branch-coven{
  border-color:#c4c8cf!important;background:#626a73!important;color:#fff!important;
  box-shadow:0 2px 3px rgba(15,18,24,.62)!important;
}
@media(max-width:800px){
  body.mode-selecting .world-map-screen > .world-map-body{grid-template-columns:minmax(0,1fr) clamp(210px,42vw,286px)!important;}
  body.mode-selecting .world-map-screen .world-map-right-rail{padding:59px 6px 6px!important;gap:6px!important;grid-template-rows:minmax(0,32%) minmax(0,31%) minmax(0,1fr)!important;}
  body.mode-selecting .world-map-screen .world-map-right-rail > .world-map-details,
  body.mode-selecting .world-map-screen .world-map-right-rail > .world-map-party-queue{padding:7px!important;}
  .world-map-chat{padding:7px;}
}

body.mode-selecting .world-map-screen .world-map-right-rail > .world-map-chat{overflow:hidden!important;display:flex!important;flex-direction:column!important;}

/* Permanent headings for the three right-sidebar regions. */
body.mode-selecting .world-map-screen .world-map-right-rail > .world-map-details::before,
body.mode-selecting .world-map-screen .world-map-right-rail > .world-map-party-queue::before{
  display:block;position:relative;content:"BATTLE PREVIEW";margin:0 0 9px;
  padding-bottom:7px;border-bottom:1px solid rgba(191,160,213,.35);
  font:700 13px/1.2 Georgia,serif;letter-spacing:.05em;color:#d9bae9;
}
body.mode-selecting .world-map-screen .world-map-right-rail > .world-map-party-queue::before{
  content:"YOUR PARTY";
}


/* V0.31.67 — scoped world-map fixes; keep Questing, Merchants and Crafting unchanged. */
/* Keep Bag on the MAP alongside Get Gold rather than atop the right rail. */
body.mode-selecting:has(.world-map-screen) #globalInventoryButton.realm-corner-shortcut{
  position:fixed!important;left:128px!important;right:auto!important;top:14px!important;
  z-index:2851!important;
}
/* Start the right sidebar at the top edge; keep the party completely visible,
   granting remaining height only to All Chat (which alone may scroll messages). */
body.mode-selecting .world-map-screen .world-map-right-rail{
  padding:0 10px 10px!important;
  grid-template-rows:max-content max-content minmax(0,1fr)!important;
  gap:8px!important;
}
body.mode-selecting .world-map-screen .world-map-right-rail > .world-map-details,
body.mode-selecting .world-map-screen .world-map-right-rail > .world-map-party-queue{
  overflow:visible!important;overflow-y:visible!important;
  min-height:0!important;max-height:none!important;
}
body.mode-selecting .world-map-screen .world-map-right-rail > .world-map-chat{
  min-height:70px!important;overflow:hidden!important;
}
/* Preview header remains on row one. The Boss/Dungeon label belongs across
   from BATTLE PREVIEW in the header's upper-right, not next to Battle 35. */
body.mode-selecting .world-map-screen .world-map-right-rail > .world-map-details{
  position:relative!important;padding:9px 10px 10px!important;
}
body.mode-selecting .world-map-screen .world-map-right-rail > .world-map-details::before{
  margin:0 0 6px!important;padding-bottom:7px!important;min-height:18px!important;
}
body.mode-selecting .world-map-screen .world-map-details .world-map-dungeon-heading{
  display:block!important;flex-direction:row!important;flex-wrap:nowrap!important;
  width:100%!important;margin:0 0 6px!important;min-width:0!important;
}
body.mode-selecting .world-map-screen .world-map-details .world-map-dungeon-heading h3{
  display:block!important;width:100%!important;max-width:100%!important;
  white-space:nowrap!important;word-break:normal!important;overflow:visible!important;
  line-height:1.15!important;margin:0!important;font-size:19px;
  letter-spacing:-.02em!important;
}
body.mode-selecting .world-map-screen .world-map-details .world-map-dungeon-heading .world-map-dungeon-type{
  display:block!important;position:absolute!important;right:10px!important;top:7px!important;
  margin:0!important;padding:3px 7px!important;z-index:1;
  font-size:10px!important;line-height:1.1!important;
}
/* Cottage portraits are regular world-map enemy preview icons; no names or
   separately styled borders under the three witch portraits. */
body.mode-selecting .world-map-screen .world-map-details .world-map-enemy-icons{
  margin:5px 0 8px!important;
}
/* Covenant approach tiles match main-road tile palette, including hover. */
.world-map-viewer .world-map-stage.world-map-branch-coven,
.world-map-viewer .world-map-stage.world-map-branch-coven:not(.is-progression-locked){
  background:rgba(37,34,29,.95)!important;border-color:#f0d69c!important;
  color:#fff1d3!important;box-shadow:0 2px 3px #19140dbb!important;
}
.world-map-viewer button.world-map-stage.world-map-branch-coven:hover,
.world-map-viewer button.world-map-stage.world-map-branch-coven.is-selected{
  background:#514b43!important;border-color:#fff0c4!important;color:#fff1d3!important;
}
/* PvP fight stays higher on the arena floor. The label position itself is
   centered between the north/south arena walls by the map-coordinate update. */
.world-map-viewer .world-map-pvp-fighter{bottom:-4px!important;}
@media(max-width:800px){
  body.mode-selecting .world-map-screen .world-map-right-rail{
    padding:0 6px 6px!important;
    grid-template-rows:max-content max-content minmax(0,1fr)!important;
    gap:6px!important;
  }
  body.mode-selecting .world-map-screen .world-map-right-rail > .world-map-details{padding:7px!important;}
  body.mode-selecting .world-map-screen .world-map-details .world-map-dungeon-heading .world-map-dungeon-type{right:7px!important;top:6px!important;}
  body.mode-selecting:has(.world-map-screen) #globalInventoryButton.realm-corner-shortcut{left:114px!important;top:9px!important;}
}


/* V0.31.68 — sidebar is NOT part of map; Bag hugs the top RIGHT corner of the map. */
body.mode-selecting:has(.world-map-screen) #globalInventoryButton.realm-corner-shortcut{
  position:fixed!important;left:auto!important;
  right:calc(clamp(286px,27vw,380px) + 12px)!important;
  top:12px!important;z-index:2851!important;
}
@media(max-width:800px){
  body.mode-selecting:has(.world-map-screen) #globalInventoryButton.realm-corner-shortcut{
    left:auto!important;right:calc(clamp(210px,42vw,286px) + 6px)!important;top:8px!important;
  }
}
/* Covenant Cottage: PURPLE when unlocked; gray only when truly locked. */
.world-map-viewer button.world-map-stage.world-map-branch-coven:not(.is-progression-locked),
.world-map-viewer button.world-map-stage.world-map-branch-coven:not(.is-progression-locked):hover,
.world-map-viewer button.world-map-stage.world-map-branch-coven:not(.is-progression-locked).is-selected{
  background:#752d91!important;border-color:#e8b9fc!important;color:#fff2ff!important;
  filter:none!important;opacity:1!important;box-shadow:0 2px 4px #230c32bb!important;
}
.world-map-viewer button.world-map-stage.world-map-branch-coven.is-progression-locked{
  background:#555e68!important;border-color:#b9c2cc!important;color:#e2e6eb!important;
}
.world-map-viewer .world-map-coven-marker:not(.is-progression-locked){
  background:#75318f!important;border-color:#e8b9fc!important;filter:none!important;opacity:1!important;
}
.world-map-viewer .world-map-coven-marker.is-progression-locked{
  background:#555e68!important;border-color:#b9c2cc!important;
}
.rf-cottage-victory-overlay{
  position:fixed;inset:0;z-index:50000;display:grid;place-items:center;
  padding:20px;background:rgba(3,2,13,.78);box-sizing:border-box;
}
.rf-cottage-victory-card{
  width:min(460px,100%);padding:25px 22px;box-sizing:border-box;text-align:center;
  border:2px solid #ba88e9;border-radius:10px;
  background:linear-gradient(155deg,#3d2854,#151525);box-shadow:0 18px 65px #000c;
  color:#f5e7ff;
}
.rf-cottage-victory-card h2{font:700 32px/1.15 Georgia,serif;color:#edc8ff;margin:0 0 12px;}
.rf-cottage-victory-card p{font:700 21px/1.3 Georgia,serif;color:#fff;margin:0 0 10px;}
.rf-cottage-victory-card div{font:13px/1.4 system-ui,sans-serif;margin:0 0 18px;}
.rf-cottage-victory-card button{min-width:135px;}

/* V0.31.69: the right-hand sparring fighter recoils when hit, but NEVER glows yellow. */
.world-map-viewer .world-map-pvp-fighter.fighter-right {
  filter:none!important;
  animation:rf-map-pvp-right-clean 5.4s steps(1,end) infinite!important;
}
@keyframes rf-map-pvp-right-clean {
  0%,8%,12%,44%,48%,52%,100%{transform:translate(0,0) scaleX(1)}
  14%,16%{transform:translate(2px,-1px) scaleX(1)}
  50%{transform:translate(-4px,0) scaleX(1)}
  54%,56%{transform:translate(-1px,-1px) scaleX(1)}
}
/* Standalone full-frame banner sheets avoid APNG dispose/blend flicker. */
.world-map-viewer .world-map-animated-tiles.world-map-banner-frames{
  background-repeat:no-repeat!important;
  image-rendering:pixelated!important;
  object-fit:unset!important;
  z-index:4;
  filter:none!important;
}
.world-map-viewer .world-map-banner-seven{
  background-size:700% 100%!important;
  animation:rf-navvare-banner-seven .84s steps(1,end) infinite!important;
}
.world-map-viewer .world-map-banner-eight{
  background-size:800% 100%!important;
  animation:rf-navvare-banner-eight .96s steps(1,end) infinite!important;
}
@keyframes rf-navvare-banner-seven{
  0%,14.28%{background-position:0% 0}
  14.29%,28.56%{background-position:16.6667% 0}
  28.57%,42.85%{background-position:33.3333% 0}
  42.86%,57.13%{background-position:50% 0}
  57.14%,71.42%{background-position:66.6667% 0}
  71.43%,85.70%{background-position:83.3333% 0}
  85.71%,100%{background-position:100% 0}
}
@keyframes rf-navvare-banner-eight{
  0%,12.49%{background-position:0% 0}
  12.50%,24.99%{background-position:14.2857% 0}
  25%,37.49%{background-position:28.5714% 0}
  37.50%,49.99%{background-position:42.8571% 0}
  50%,62.49%{background-position:57.1429% 0}
  62.50%,74.99%{background-position:71.4286% 0}
  75%,87.49%{background-position:85.7143% 0}
  87.50%,100%{background-position:100% 0}
}

/* V0.31.69: Party / Entire Realm selector fits inside the existing chat sidebar. */
.world-map-chat-top{display:flex;align-items:center;justify-content:space-between;gap:5px;flex-wrap:wrap;flex-shrink:0;}
.world-map-chat-filters{display:flex;gap:4px;min-width:0;}
.world-map-chat-filters button{
  appearance:none;border:1px solid #7f6a99;border-radius:5px;
  background:#211a2b;color:#e9d8f5;font:600 10px/1.2 system-ui,sans-serif;
  padding:4px 6px;cursor:pointer;white-space:nowrap;
}
.world-map-chat-filters button.is-active{background:#714899;border-color:#d2a9f9;color:#fff;}
.world-map-chat-filters button:focus-visible{outline:2px solid #f0ceff;outline-offset:1px;}


/* V0.31.70 — Goals icon is a bright yellow pixel-style exclamation mark. */
.realm-book-panel .realm-book-nav .realm-book-tab[data-book-tab="goals"] .realm-book-goals-icon{
  display:grid!important;place-items:center!important;
  width:32px!important;height:32px!important;min-width:32px!important;
  box-sizing:border-box!important;
  color:#ffe144!important;
  font:bold 29px/1 ui-monospace,monospace!important;
  text-shadow:1px 1px 0 #6f4a09!important;
  image-rendering:pixelated!important;
}
.realm-book-panel .realm-book-nav .realm-book-tab[data-book-tab="goals"].is-active .realm-book-goals-icon{
  color:#fff27a!important;
}
/* V0.31.70 — Banners are two independent layers: fixed support, purple fabric.
   The sprite strips contain no non-purple colors; no static white ghost outline
   can be left behind when cloth moves. Unlike APNG, no frame disposal or
   partial frame restoration is involved. */
.world-map-viewer .world-map-animated-tiles.world-map-banner-frames{
  position:absolute!important;display:block!important;overflow:visible!important;
  background:none!important;animation:none!important;filter:none!important;
  image-rendering:pixelated!important;
}
.world-map-viewer .world-map-banner-frames > .world-map-banner-support,
.world-map-viewer .world-map-banner-frames > .world-map-banner-fabric{
  position:absolute!important;inset:0!important;display:block!important;
  pointer-events:none!important;image-rendering:pixelated!important;
  background-repeat:no-repeat!important;
}
.world-map-viewer .world-map-banner-frames > .world-map-banner-support{
  z-index:1!important;background-size:100% 100%!important;
}
.world-map-viewer .world-map-banner-frames > .world-map-banner-fabric{z-index:2!important;}
.world-map-viewer .world-map-banner-seven > .world-map-banner-fabric{
  background-size:700% 100%!important;
  animation:rf-navvare-banner-seven .98s steps(1,end) infinite!important;
}
.world-map-viewer .world-map-banner-eight > .world-map-banner-fabric{
  background-size:800% 100%!important;
  animation:rf-navvare-banner-eight 1.12s steps(1,end) infinite!important;
}

/* V0.31.73 - Slime Swamp: eleven playable GREEN path squares; no dungeon yet.
   Keep the exact compact dimension, number typography and grey locked-state
   behavior of the neighboring purple and red unlock branches. */
.world-map-viewer button.world-map-stage.world-map-branch-swamp:not(.is-progression-locked),
.world-map-viewer .world-map-stage.world-map-branch-swamp:not(.is-progression-locked){
  background:#245f34!important;border-color:#a3e6a4!important;
  color:#e8ffe5!important;box-shadow:0 2px 3px #112918bb!important;
  opacity:1!important;filter:none!important;cursor:pointer!important;pointer-events:auto!important;
}
.world-map-viewer button.world-map-stage.world-map-branch-swamp:not(.is-progression-locked):hover,
.world-map-viewer button.world-map-stage.world-map-branch-swamp:not(.is-progression-locked).is-selected{
  background:#347d43!important;border-color:#dcffd4!important;
}
.world-map-viewer .world-map-branch-swamp .world-map-stage-num{
  font:700 9px/1 Georgia,serif!important;opacity:1!important;
}
.world-map-viewer button.world-map-stage.world-map-branch-swamp.is-progression-locked{
  background:#49525d!important;border-color:#a0aab5!important;
  color:#e1e5e9!important;box-shadow:0 2px 3px #1e252c99!important;
  opacity:.65!important;filter:none!important;cursor:pointer!important;pointer-events:auto!important;
}
/* Full-size and 35-HP offspring have the same artwork, but different sizes. */
.battle-sprite.sprite-slime-large{--rf-sprite-size:112px!important;}
.battle-sprite.sprite-slime-small{--rf-sprite-size:64px!important;}
@media(max-width:1180px){
  .battle-sprite.sprite-slime-large{--rf-sprite-size:96px!important;}
  .battle-sprite.sprite-slime-small{--rf-sprite-size:55px!important;}
}
@media(max-width:650px){
  .battle-sprite.sprite-slime-large{--rf-sprite-size:77px!important;}
  .battle-sprite.sprite-slime-small{--rf-sprite-size:44px!important;}
}
/* Slimes can split into a ten-unit enemy formation (five full-size -> ten small). */
.battle-sprite.team-2:is(.slot-8,.slot-9){right:2%!important;left:auto!important;}

/* Slain slime parents vanish once their two real offspring are present. */
.battle-sprite.sprite-slime-large.dead{opacity:0!important;pointer-events:none!important;}

/* V0.31.73: In-battle map closes with the standard red X, no visible label. */
#inGameMapClose.rf-ui-zip-icon-only{
  box-sizing:border-box!important;display:grid!important;place-items:center!important;
  width:44px!important;height:44px!important;min-width:44px!important;
  padding:5px!important;flex:0 0 44px!important;
}
#inGameMapClose.rf-ui-zip-icon-only > .rf-ui-zip-sprite{
  display:block!important;width:28px!important;height:28px!important;
  flex:0 0 28px!important;margin:0!important;
  background-size:28px 28px!important;
}

/* V0.31.74: Slime Swamp is a playable, seven-floor green dungeon. */
.world-map-viewer button.world-map-swamp-dungeon{
  pointer-events:auto!important;cursor:pointer!important;
  font-family:Georgia,serif!important;
}
.world-map-viewer button.world-map-swamp-dungeon:hover,
.world-map-viewer button.world-map-swamp-dungeon.is-selected{
  background:#347d43!important;border-color:#dcffd4!important;
  outline:2px solid #e2ffe0;outline-offset:2px;
}
.world-map-viewer button.world-map-swamp-dungeon.is-progression-locked,
.world-map-viewer button.world-map-swamp-dungeon.is-progression-locked:hover{
  background:#49525d!important;border-color:#a0aab5!important;
  color:#e1e5e9!important;opacity:.7!important;filter:none!important;
  pointer-events:auto!important;cursor:pointer!important;
}
.in-game-map-panel .world-map-swamp-dungeon{pointer-events:none!important;}

/* V0.31.80: organic Slime Swamp is the selected/hovered region, not its sign. */
.world-map-viewer .rf-map-art-hotspot[data-hotspot="swamp"]{
  fill:#b8f39f;fill-opacity:.001;stroke:transparent;stroke-width:2.5px;
  stroke-linejoin:round;
}
.world-map-viewer .rf-map-art-hotspot[data-hotspot="swamp"]:hover,
.world-map-viewer .rf-map-art-hotspot[data-hotspot="swamp"].is-selected,
.world-map-viewer .rf-map-art-hotspot[data-hotspot="swamp"].is-name-hovered,
.world-map-viewer .rf-map-art-hotspot[data-hotspot="swamp"]:focus-visible{
  fill-opacity:.07;stroke:#ffe064;stroke-width:3px;
  filter:drop-shadow(0 0 3px #ffdf64);
}
.world-map-viewer button.world-map-swamp-dungeon:hover,
.world-map-viewer button.world-map-swamp-dungeon.is-selected,
.world-map-viewer button.world-map-swamp-dungeon:focus-visible{
  background:#245f34!important;border-color:#a3e6a4!important;
  color:#e8ffe5!important;outline:none!important;box-shadow:0 2px 5px #112918bb!important;
}
.in-game-map-panel .rf-map-art-hotspot[data-hotspot="swamp"]{pointer-events:none!important;}
/* V0.31.81: six distinctly styled slime impacts. Square-edged particles
   match the eight-bit enemy sprites. Visual-only; damage remains server-owned. */
.rf-slime-splash{--goo:#a7d84c;--rim:#385628;--spark:#dafa7d;
  position:absolute;width:65px;height:47px;z-index:35;pointer-events:none;
  transform:translate(-50%,-50%);animation:rf-slime-splash-pop 420ms steps(6,end) both;
  image-rendering:pixelated;}
.rf-slime-splash .rf-slime-drop{position:absolute;display:block;image-rendering:pixelated;
  background:var(--goo);border:3px solid var(--rim);box-shadow:inset 4px 0 var(--spark);}
.rf-slime-splash .drop1{left:25px;top:17px;width:18px;height:14px;}
.rf-slime-splash .drop2{left:6px;top:12px;width:11px;height:11px;transform:rotate(-14deg);}
.rf-slime-splash .drop3{left:47px;top:6px;width:12px;height:12px;transform:rotate(18deg);}
.rf-slime-splash .drop4{left:18px;top:0;width:9px;height:9px;}
.rf-slime-splash .drop5{left:40px;top:30px;width:9px;height:9px;}
.rf-slime-splash:before,.rf-slime-splash:after{content:'';position:absolute;display:block;pointer-events:none;}
.rf-slime-normal:before{left:15px;top:13px;width:33px;height:20px;border:4px solid #89b943;opacity:.5;}
.rf-slime-hydro{--goo:#40bad2;--rim:#0c5779;--spark:#a5faff;}
.rf-slime-hydro:before{left:4px;top:0;width:48px;height:37px;border:5px solid #7bebf5;
  border-radius:50%;animation:rf-slime-ring 420ms steps(5,end) both;}
.rf-slime-hydro .rf-slime-drop{border-radius:45% 45% 40% 40%;}
.rf-slime-elixir{--goo:#bc579c;--rim:#542451;--spark:#ff9acd;}
.rf-slime-elixir:before{left:25px;top:-14px;width:8px;height:8px;background:#ffb8dc;
  box-shadow:-15px 11px 0 #fa91c7,18px 9px 0 #df65be,6px -12px 0 #ffb8dc;
  animation:rf-slime-fizz 420ms steps(5,end) both;}
.rf-slime-mushroom{--goo:#c2b492;--rim:#65654d;--spark:#f9e8bc;}
.rf-slime-mushroom .rf-slime-drop{border-radius:50% 50% 25% 25%;}
.rf-slime-mushroom:before{left:5px;top:-13px;width:5px;height:5px;background:#efe3be;
  box-shadow:17px 6px 0 #f8e9ca,40px -3px 0 #d9c7a7,53px 10px 0 #e5d9b6;
  animation:rf-slime-fizz 420ms steps(4,end) both;}
.rf-slime-thorned{--goo:#a6463e;--rim:#612323;--spark:#f18e69;}
.rf-slime-thorned .rf-slime-drop{border-radius:0;transform:rotate(45deg);}
.rf-slime-thorned:before{left:29px;top:-3px;width:8px;height:8px;background:#f3a277;
  box-shadow:-26px 12px 0 #ce634e,27px 14px 0 #f3a277,3px 36px 0 #cd5b4d;
  transform:rotate(45deg);}
.rf-slime-cat-tail{--goo:#9bad4b;--rim:#37492b;--spark:#e2ee90;}
.rf-slime-cat-tail:before{left:15px;top:-10px;width:4px;height:36px;background:#a1b852;
  box-shadow:22px 5px 0 #bed06e,34px 14px 0 #788a3b;
  animation:rf-slime-reeds 420ms steps(4,end) both;}
@keyframes rf-slime-splash-pop{
  0%{opacity:0;scale:.55;translate:0 10px;}
  35%{opacity:1;scale:1.08;translate:0 -6px;}
  75%{opacity:1;scale:1;translate:0 0;}
  100%{opacity:0;scale:1.04;translate:0 -2px;}
}
@keyframes rf-slime-ring{0%{opacity:0;scale:.5}50%{opacity:.85;scale:1}100%{opacity:0;scale:1.4}}
@keyframes rf-slime-fizz{0%{opacity:0;translate:0 10px}50%{opacity:1;translate:0 -8px}100%{opacity:0;translate:0 -18px}}
@keyframes rf-slime-reeds{0%{opacity:0;scale:.6}40%{opacity:1;scale:1}100%{opacity:0;translate:0 -8px}}

/* V0.31.80 — lone Forest Gnome Lord stands on purple Battle 11 like
   Clyde and the main-road bosses. The number and click target remain visible. */
.world-map-viewer .world-map-branch-coven:has(.world-map-branch-boss-sprite){overflow:visible!important;}
.world-map-viewer .world-map-branch-coven .world-map-branch-boss-sprite{
  position:absolute!important;top:auto!important;bottom:3px!important;left:50%!important;
  transform:translateX(-50%)!important;width:25px!important;height:25px!important;
  object-fit:contain!important;image-rendering:pixelated!important;
  pointer-events:none!important;z-index:18!important;filter:drop-shadow(0 1px 1px #0008)!important;
}
.world-map-viewer .world-map-branch-coven:has(.world-map-branch-boss-sprite) .world-map-stage-num{
  position:relative!important;z-index:3!important;
}

/* V0.31.82 — Goblin Casino slums are LIGHT green; Slime Swamp stays DARK.
   Locked markers retain the standard grey progression treatment. */
.world-map-viewer button.world-map-stage.world-map-branch-goblin:not(.is-progression-locked),
.world-map-viewer .world-map-stage.world-map-branch-goblin:not(.is-progression-locked){
  background:#67ab58!important;border-color:#d5e6a1!important;color:#172b16!important;
  box-shadow:0 2px 5px #13231cbb!important;opacity:1!important;filter:none!important;
  cursor:pointer!important;pointer-events:auto!important;
}
.world-map-viewer button.world-map-stage.world-map-branch-goblin:hover:not(.is-progression-locked),
.world-map-viewer button.world-map-stage.world-map-branch-goblin.is-selected:not(.is-progression-locked){
  background:#8bcb70!important;border-color:#ffda78!important;outline:1px solid #f5d58a;
}
.world-map-viewer .world-map-branch-goblin .world-map-stage-num{font:700 9px/1 Georgia,serif!important;opacity:1!important;}
.world-map-viewer button.world-map-stage.world-map-branch-goblin.is-progression-locked{
  background:#49525d!important;border-color:#a0aab5!important;color:#e1e5e9!important;
  box-shadow:0 2px 3px #1e252c99!important;opacity:.65!important;filter:none!important;
  cursor:pointer!important;pointer-events:auto!important;
}
.world-map-viewer button.world-map-stage.world-map-branch-swamp:not(.is-progression-locked){
  background:#143b2a!important;border-color:#638e71!important;color:#d4f1dd!important;
}
.world-map-viewer button.world-map-stage.world-map-branch-swamp:hover:not(.is-progression-locked),
.world-map-viewer button.world-map-stage.world-map-branch-swamp.is-selected:not(.is-progression-locked){
  background:#1d5435!important;border-color:#b3dba8!important;
}
.world-map-viewer button.world-map-swamp-dungeon:not(.is-progression-locked){
  background:#143b2a!important;border-color:#638e71!important;color:#d4f1dd!important;
}
.world-map-viewer button.world-map-swamp-dungeon:hover:not(.is-progression-locked){background:#1d5435!important;}
/* Realm tabs sit on top of the road, but do not obstruct the end tile. */
.world-map-viewer .world-map-casino-realm{
  position:absolute;z-index:13;transform:translate(-50%,-50%);
  box-sizing:border-box;display:flex;flex-direction:column;align-items:center;justify-content:center;
  min-width:98px;width:max-content;padding:3px 9px 1px;
  border:2px solid #ebc768;border-radius:5px;
  background:#3c8354;color:#ffeac0;cursor:pointer;
  box-shadow:0 2px 5px #102015c9,inset 0 1px #b9dfa577;
  font:700 11px/1.2 Georgia,serif;text-shadow:0 1px #19301f;
}
.world-map-viewer .world-map-casino-realm .world-map-casino-label{white-space:nowrap;}
.world-map-viewer .world-map-casino-realm .world-map-casino-arrow{
  font:900 13px/1 Georgia,serif;color:#ffdf70;margin-top:1px;
}
.world-map-viewer button.world-map-casino-realm:hover,
.world-map-viewer button.world-map-casino-realm.is-selected{
  background:#4d9c5d;border-color:#ffe39e;outline:1px solid #ffdf70;outline-offset:1px;
}
.world-map-viewer .world-map-casino-realm.is-progression-locked{
  filter:grayscale(.75);opacity:.75;cursor:pointer;
}
.in-game-map-panel .world-map-casino-realm{pointer-events:none!important;}
.battle-sprite.sprite-goblin-slum{--rf-sprite-size:102px!important;}
@media(max-width:1180px){.battle-sprite.sprite-goblin-slum{--rf-sprite-size:91px!important;}}
@media(max-width:650px){.battle-sprite.sprite-goblin-slum{--rf-sprite-size:73px!important;}}

/* V0.31.83 — Realm 2 sign above Battle 105 matches the Casino realm styling.
   Put the upward arrow ABOVE its title, pointing off the northern map edge. */
.world-map-viewer .world-map-realm-two .world-map-casino-arrow{
  margin-top:0;margin-bottom:1px;
}

/* V0.31.84: district return shows the same personal Realm Walker on the
   castle floor beside the shop or PvP well, never over a fake battle tile. */
.world-map-viewer .world-map-city-walker{
  position:absolute;width:18px;height:18px;transform:translate(-50%,-50%);
  pointer-events:none!important;z-index:24;overflow:visible;
}
.world-map-viewer .world-map-city-walker .world-map-walker-anchor{
  display:block!important;position:absolute!important;inset:0!important;
  overflow:visible!important;pointer-events:none!important;
}
.world-map-viewer .world-map-city-walker .world-map-walker-anchor img{
  position:absolute!important;left:50%!important;bottom:3px!important;top:auto!important;
  transform:translateX(-50%)!important;width:29px!important;height:29px!important;
  max-width:none!important;object-fit:contain!important;image-rendering:pixelated!important;
  filter:drop-shadow(0 1px 1px #000b)!important;pointer-events:none!important;
}
/* Location previews reuse battle-preview sizing without suggesting an enemy fight. */
.world-map-details .world-map-location-icons .world-map-enemy-icon{
  border-color:rgba(224,191,119,.72)!important;
}


/* V0.31.86 — post-victory Continue directly below the dark-purple Battle
   Rewards panel: matching palette, full pill shape, no square-button override.
   This only styles the finished PvE continue control, not other UI buttons. */
.center-column #pveContinueButton.pve-continue-button {
  box-sizing:border-box;
  border-radius:999px !important;
  border:1px solid rgba(176,132,244,.78) !important;
  background:linear-gradient(155deg,rgba(43,29,70,.97),rgba(26,20,46,.98)) !important;
  color:#e9d5ff !important;
  box-shadow:0 6px 18px rgba(0,0,0,.35),0 0 14px rgba(139,92,246,.15) !important;
  padding:10px 20px;
  min-height:44px;
  line-height:1.3;
  white-space:normal;
  cursor:pointer;
}
.center-column #pveContinueButton.pve-continue-button:hover:not(:disabled) {
  background:linear-gradient(155deg,rgba(63,40,101,.98),rgba(36,26,64,.98)) !important;
  border-color:#c4a3ff !important;
  box-shadow:0 8px 23px rgba(0,0,0,.39),0 0 17px rgba(167,139,250,.27) !important;
}
.center-column #pveContinueButton.pve-continue-button:focus-visible{
  outline:2px solid #d7bdff !important;
  outline-offset:3px;
}

/* V0.31.88 — Keep the four-portrait preview's precise height/spacing while
   leaving Navvare Merchants' preview art area blank. PvP keeps its crown. */
.world-map-details .world-map-location-merchants .world-map-enemy-icon {
  visibility:hidden!important;
  pointer-events:none!important;
}

/* Match loading can briefly clear the title/body before the first prompt.
   The old decorated panel looked like a giant dark, empty pill. Never show
   an empty battle prompt; as soon as content is added it appears normally. */
#promptPanel:has(#promptTitle:empty):not(:has(#promptBody > *)) {
  display:none!important;
}


/* v0.31.90 anti-mana chip moved directly under mana chip */
.fighter-head-actions{
  align-items:flex-start;
}
.fighter-resource-stack{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:4px;
  min-width:0;
}
.fighter-resource-stack .mana-chip,
.fighter-resource-stack .anti-mana-chip{
  position:static !important;
  right:auto !important;
  top:auto !important;
  min-width:64px;
  height:auto;
  padding:4px 7px;
  box-shadow:none;
  text-align:center;
  justify-content:center;
  line-height:1.1;
}
.fighter-resource-stack .mana-chip{
  display:grid;
  place-items:center;
}
.fighter-resource-stack .anti-mana-chip{
  display:grid;
  place-items:center;
  font-size:10px;
  border-radius:999px;
  background:linear-gradient(180deg,#581c87,#3b0764);
  color:#f3e8ff;
  border:1px solid #d8b4fe;
}
.fighter-resource-stack .anti-mana-chip::before{
  content:'ANTI ';
  font-size:9px;
  letter-spacing:.03em;
  opacity:.92;
}
.fighter-resource-stack .anti-mana-chip[hidden]{
  display:none !important;
}
.team-column .fighter-head > .fighter-head-actions{
  display:flex;
  align-items:flex-start;
  justify-content:flex-end;
  gap:4px;
}
.team-column .fighter-head > .fighter-head-actions .fighter-resource-stack{
  gap:3px;
}
.team-column .fighter-head > .fighter-head-actions .mana-chip,
.team-column .fighter-head > .fighter-head-actions .anti-mana-chip{
  min-width:58px;
  padding:3px 5px !important;
  font-size:10px !important;
}
@media(max-width:1120px){
  .fighter-resource-stack .mana-chip,
  .fighter-resource-stack .anti-mana-chip{
    min-width:54px;
    padding:3px 5px;
    font-size:9.5px;
  }
}


/* v0.31.91: Ether premium currency (previously Gold). */
.currency-row .currency-gold,
.realm-book-currencies .currency-gold,
.currency-tile.currency-gold{
  background:linear-gradient(180deg,rgba(88,34,137,.34),rgba(42,18,70,.24));
  border-color:rgba(187,116,255,.38);
}
#goldShopModal .gold-shop-wallet strong {color:#ead3ff;}
#goldShopModal .gold-pack-art .rf-currency-icon{filter:drop-shadow(0 2px 6px rgba(172,87,243,.42));}
#goldShopModal .gold-shop-buy:not(:disabled){background:linear-gradient(160deg,#c09af2,#8953cc);border-color:#d9adff77;color:#1c0c2c;box-shadow:inset 0 1px #f0dbff66;}
#goldShopModal .gold-shop-buy:hover:not(:disabled){background:#d4b4ff;border-color:#ebd3ff;}


/* V0.31.96 — in-place stat sheet ↔ six-piece equipment flip */
.fighter-stat-sheet .fighter-stat-page[hidden]{display:none!important}
.fighter-stat-head-tools{display:flex;align-items:center;gap:7px;flex:0 0 auto}
.fighter-stat-flip{width:30px;height:29px;display:grid;place-items:center;flex:0 0 auto;
  border:1px solid rgba(207,169,248,.48);border-radius:8px;cursor:pointer;
  background:linear-gradient(160deg,#4b345f,#261d37);color:#f2dcff;
  font:900 18px/1 Inter,ui-sans-serif,system-ui,sans-serif;
  box-shadow:inset 0 1px rgba(255,255,255,.08);transition:border-color .12s,background .12s}
.fighter-stat-flip:hover,.fighter-stat-flip:focus-visible{border-color:#e4baff;background:#5a3971;outline-offset:2px}
.fighter-stat-flip:focus-visible{outline:2px solid #efd2ff}
.sheet-gear-summary{display:flex;justify-content:space-between;align-items:center;
  font-size:10px;font-weight:800;color:#e9d8ff;padding:9px 12px 5px}
.sheet-gear-summary span{color:#e9c47a;font-variant-numeric:tabular-nums}
.sheet-gear-list{display:flex;flex-direction:column;gap:5px;padding:4px 9px 11px}
.sheet-gear-row{display:grid;grid-template-columns:30px 30px minmax(0,1fr);align-items:center;
  min-height:47px;gap:6px;padding:6px;border-radius:9px;
  background:linear-gradient(145deg,rgba(13,14,23,.85),rgba(29,24,37,.8));
  border:1px solid rgba(185,159,202,.24);min-width:0}
.sheet-gear-row.empty{border-style:dashed;opacity:.67}
.sheet-gear-slot{font-size:9px;font-weight:900;letter-spacing:.02em;color:#c9aada}
.sheet-gear-icon{height:30px;width:30px;display:grid;place-items:center;border-radius:8px;
  background:#241c32;border:1px solid rgba(197,152,237,.3);color:#d6b6ea}
.sheet-gear-icon .rf-gear-emblem{height:25px;width:25px;object-fit:contain;image-rendering:pixelated}
.sheet-gear-detail{min-width:0;display:flex;flex-direction:column;gap:2px}
.sheet-gear-name{color:#f9ebd7;font-size:10.5px;line-height:1.22;white-space:normal;overflow-wrap:anywhere}
.sheet-gear-meta{color:#ac9abf;font-size:9px}
.sheet-gear-bonuses{display:flex;flex-wrap:wrap;gap:3px 6px;line-height:1.2;margin-top:2px}
.sheet-gear-bonus{font-size:9px;font-weight:650}
.sheet-gear-no-stats,.sheet-gear-empty{color:#9c8cab;font-size:10px}
.sheet-gear-row.gear-tier-legendary{border-color:rgba(245,197,106,.65)}
.sheet-gear-row.gear-tier-ultrarare{border-color:rgba(192,132,252,.65)}
.sheet-gear-row.gear-tier-rare{border-color:rgba(96,165,250,.48)}
.sheet-gear-row.gear-tier-uncommon{border-color:rgba(74,222,128,.43)}
.realm-book-stat-sheet .sheet-gear-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;padding:10px 14px 15px}
.realm-book-stat-sheet .sheet-gear-row{grid-template-columns:46px 40px minmax(0,1fr);min-height:76px;padding:12px}
.realm-book-stat-sheet .sheet-gear-name{font-size:13px}
.realm-book-stat-sheet .sheet-gear-meta,.realm-book-stat-sheet .sheet-gear-bonus{font-size:11px}
.realm-book-stat-sheet .sheet-gear-icon{width:40px;height:40px}
.realm-book-stat-sheet .sheet-gear-icon .rf-gear-emblem{width:34px;height:34px}
.realm-book-stat-sheet .sheet-gear-summary{font-size:14px;padding:14px 16px 0}
@media(max-width:620px){
  .realm-book-stat-sheet .sheet-gear-list{grid-template-columns:1fr;gap:6px}
  .realm-book-stat-sheet .sheet-gear-row{min-height:58px;padding:7px}
  .realm-book-stat-sheet .sheet-gear-name{font-size:11px}
}


/* V0.31.97: one inspected face at a time, in the existing battle/lobby popup. */
.fighter-stat-sheet > .fighter-stat-page{min-width:0}
.fighter-stat-flip{cursor:pointer}
.world-map-party-queue .world-map-queue-row{position:relative;padding-right:62px!important}
.world-map-party-queue .world-map-queue-stat-trigger{
  position:absolute;right:34px;top:50%;transform:translateY(-50%);
  z-index:3;width:23px;height:24px;min-width:23px;padding:0;
  background:#372747;border-color:#a68bc6;color:#ead8fc;
}
.world-map-party-queue .world-map-queue-row:not(:has(.world-map-queue-remove)) .world-map-queue-stat-trigger{right:7px}
.world-map-party-queue .world-map-queue-stat-trigger:hover,
.world-map-party-queue .world-map-queue-stat-trigger[aria-expanded="true"]{background:#674a83;border-color:#dcbaff}

/* V0.32.00 credential-based login / registration */
.realm-auth-note{margin:0 0 20px;font-size:14px;line-height:1.6;color:#d8c9ef;text-align:left}
.realm-auth-hint{font-size:12px;color:#bba6d6;margin:0;line-height:1.5}
.realm-auth-required{font-family:inherit;color:#bba6d6;font-size:13px}
.realm-login-panel .realm-auth-secondary{width:100%;margin-top:14px;background:transparent;border:1px solid rgba(192,132,252,.43);color:#dfc4f7;font-size:16px}
.realm-login-panel .realm-auth-secondary:hover{background:rgba(168,85,247,.16)}
.realm-login-panel .hall-error{margin-top:12px;min-height:18px}
.realm-login-panel input:focus-visible{outline:2px solid #d8b4fe;outline-offset:2px}

/* V0.32.01 — Mandatory first Realm Walker onboarding. No empty home or Back. */
body.mode-selecting .play-mode-card:has(.first-realmwalker-setup){width:min(1020px,96vw);max-width:1020px}
.first-realmwalker-setup{max-width:960px;margin:0 auto;color:#f0ddff}
.first-realmwalker-setup > h2{text-align:center;font-family:"IM Fell English SC",Georgia,serif;font-size:clamp(27px,4vw,40px);font-weight:400;color:#e6b8ff}
.first-realmwalker-intro{text-align:center;color:#c9b8d4;font-size:14px;margin:10px 0 18px}
.first-realmwalker-setup .creation-page-head{text-align:center;margin-bottom:10px}
.first-realmwalker-setup .creation-page-head h3{font-family:"IM Fell English SC",Georgia,serif;color:#f1d4ff;font-size:24px;font-weight:400;margin:0}
.first-realmwalker-setup .creation-form{padding:18px;border:1px solid rgba(192,132,252,.24);border-radius:16px;background:rgba(16,11,26,.84)}
.first-realmwalker-setup .creation-footer{justify-content:flex-end}
.realm-setup-error{max-width:540px;margin:35px auto;text-align:center;color:#ead9f5}
.realm-setup-error p{font-size:13px;color:#fca5a5;line-height:1.5;margin:16px 0}
@media(max-width:700px){.first-realmwalker-setup .creation-form{padding:10px}.first-realmwalker-setup .class-choice-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
/* Keep the Ether shortcut genuinely hidden on login and first-walker setup.
   The later !important shortcut layout otherwise overrides generic .hidden. */
body #goldShopButton.realm-corner-shortcut.hidden{display:none!important}

.first-realmwalker-setup .creation-page-head{display:flex;align-items:center;justify-content:center}

/* V0.32.03 — Compact signup, single square inspector arrow, bag-style gear hover. */
body.mode-selecting .play-mode-card:has(.realm-create-panel){padding:clamp(8px,2vh,18px);max-height:none;overflow:visible;}
body.mode-selecting .play-mode-overlay:has(.realm-create-panel){overflow:hidden;}
.realm-create-panel{margin:0 auto;padding:clamp(10px,2vh,20px) 24px;}
.realm-create-panel h2{font-size:clamp(24px,5vh,38px);margin:0 0 12px;}
.realm-create-panel .realm-login-form{gap:5px;}
.realm-create-panel .realm-login-form label{font-size:15px;line-height:1.15;}
.realm-create-panel .realm-login-form input{padding:7px 10px;min-height:34px;box-sizing:border-box;}
.realm-create-panel .realm-login-form button{margin-top:3px;min-height:36px;padding:7px 10px;}
.realm-create-panel .realm-auth-secondary{margin-top:7px;min-height:34px;padding:6px 10px;}
.realm-create-panel .hall-error{margin-top:5px;min-height:0;}
.realm-create-panel .hall-error:empty{display:none;}
@media(max-height:540px) and (min-width:600px){
 body.mode-selecting .play-mode-card:has(.realm-create-panel){width:min(740px,96vw);max-width:740px;}
 .realm-create-panel{width:100%;}
 .realm-create-panel .realm-login-form{grid-template-columns:minmax(120px,1fr) minmax(0,2fr);align-items:center;}
 .realm-create-panel .realm-auth-hint,.realm-create-panel .realm-login-form button{grid-column:1/-1;}
}
/* Keep fields accessible on exceptionally short phone/keyboard viewports. */
@media(max-height:460px) and (max-width:599px){
 body.mode-selecting .play-mode-card:has(.realm-create-panel){max-height:96dvh;overflow:auto;}
}
.fighter-stat-flip{box-sizing:border-box;width:30px;height:30px;min-width:30px;min-height:30px;padding:0;}
.fighter-stat-head-tools{gap:0;}
.sheet-gear-row:not(.empty){cursor:help;border-color:var(--gear-border,rgba(207,169,248,.3));}
.sheet-gear-row:not(.empty):hover,.sheet-gear-row:not(.empty):focus-visible{outline:1px solid var(--gear-color,#d8b4fe);outline-offset:1px;}
.inventory-gear-floating.sheet-gear-floating{z-index:5200;}

/* Test-only Set Level lives in the Character identity header. */
.realm-book-stats-identity{flex-wrap:wrap;}
.realm-book-set-level{margin-left:auto;display:flex;flex-direction:column;gap:4px;min-width:145px;align-self:center;}
.realm-book-set-level label{font-size:12px;color:#dec9f1;}
.realm-book-level-controls{display:flex;align-items:center;gap:6px;}
.realm-book-level-controls input{width:66px;min-height:34px;padding:5px 6px;box-sizing:border-box;color:#f8e9ff;background:#21182d;border:1px solid #85669e;border-radius:5px;}
.realm-book-level-controls .mode-button{width:auto;min-height:34px;padding:6px 12px;font-size:12px;white-space:nowrap;}
.realm-book-level-feedback{font-size:11px;color:#e7d4f4;max-width:230px;}
@media(max-width:620px){.realm-book-set-level{margin-left:0;flex-basis:100%;}}

/* V0.32.05 — occupied gear tokens never disappear when artwork is unavailable. */
.rf-gear-fallback{display:grid;place-items:center;width:100%;height:100%;min-width:20px;min-height:20px;color:var(--gear-color,#d8b4fe);font-size:22px;line-height:1;}
.rf-gear-fallback[hidden],img.rf-gear-emblem[hidden]{display:none!important;}
.sheet-gear-row{flex-shrink:0;}
