/* Realm of Auto-Blades — dark fantasy theme around the Dungeon Crawl tiles. */
:root {
  --bg: #0f0e13;
  --bg2: #15131b;
  --panel: #1c1922;
  --panel2: #25212d;
  --panel3: #2e2938;
  --border: #3b3446;
  --border-hi: #5c4f6b;
  --text: #ece4d3;
  --muted: #9a8fa6;
  --gold: #e8bd57;
  --gold-dim: #a8853a;
  --accent: #c7954a;
  --primary: #8c5a1e;
  --primary-hi: #b27a32;
  --hp: #c8403c;
  --mp: #3f6fd1;
  --shield: #d6d6d6;
  --good: #6bcf7f;
  --bad: #e2655f;
  --warrior: #e39a5a;
  --rogue: #76d68f;
  --mage: #ab8cff;
  --set: #f0d23c;
  --heading: 'Cinzel', Georgia, 'Times New Roman', serif;
}
* { box-sizing: border-box; }
:root { color-scheme: dark; }
body {
  margin: 0;
  background: radial-gradient(ellipse at top, #241c2c 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, 'Segoe UI', sans-serif;
  min-height: 100vh;
}
h1, h2, h3, .card-title, .section-title, .panel-title, .tabs button span, .div-name { font-family: var(--heading); letter-spacing: 0.02em; }
button {
  font: inherit;
  color: var(--text);
  background: linear-gradient(#302a39, #231f2a);
  border: 1px solid var(--border-hi);
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}
button:hover:not(:disabled) { border-color: var(--gold); color: #fff; }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.primary { background: linear-gradient(var(--primary-hi), var(--primary)); border-color: #d9a557; color: #fff7e6; text-shadow: 0 1px 0 #0006; }
button.small { padding: 3px 9px; font-size: 12px; }
button.tiny { padding: 1px 7px; font-size: 11px; }
input, select {
  min-width: 0;
  font: inherit;
  color: var(--text);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
}
select { padding: 3px 6px; font-size: 12px; }
input:focus, select:focus { outline: 1px solid var(--gold-dim); }

.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(#211b28, #17141c);
  box-shadow: 0 2px 12px #0008;
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand h1 { font-size: 19px; margin: 0; color: var(--gold); text-shadow: 0 0 10px #e8bd5740; white-space: nowrap; }
#resources { display: flex; gap: 14px; flex: 1; justify-content: center; flex-wrap: wrap; }
.res { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-variant-numeric: tabular-nums; }
#account { display: flex; gap: 8px; align-items: center; color: var(--muted); }
.mode-tag { font-size: 11px; border: 1px solid var(--border-hi); border-radius: 10px; padding: 1px 8px; color: var(--muted); }
main { padding: 16px; max-width: 1700px; margin: 0 auto; }
.panel {
  background: linear-gradient(var(--panel), #18151e);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 4px 18px #0006, inset 0 1px 0 #ffffff08;
}
.panel h2, .panel h3 { margin: 0 0 8px; }
.panel h2 { font-size: 17px; }
.panel h3 { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.card { background: var(--panel2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
.card-title, .section-title, .panel-title { font-weight: 700; margin-bottom: 8px; color: var(--gold); display: flex; align-items: center; gap: 8px; }
.section-title { margin: 14px 0 8px; font-size: 15px; }
.muted { color: var(--muted); }
.gold { color: var(--gold); }
.good { color: var(--good); }
.bad { color: var(--bad); }
.row { display: flex; gap: 8px; align-items: center; }
.grow { flex: 1; min-width: 0; }
.spacer { flex: 1; }
.hidden { display: none !important; }
.small { font-size: 12px; }
.wrap { flex-wrap: wrap; }

/* sprites */
.spr { display: inline-block; flex: none; background-image: url(assets/sprites.png); background-repeat: no-repeat; image-rendering: pixelated; vertical-align: middle; }
.spr.none { background: none; }
.doll-stack { position: relative; display: inline-block; flex: none; }
.doll-stack .spr { position: absolute; left: 0; top: 0; }
.spr.mon { filter: drop-shadow(0 2px 2px #000a); }
.spr.done { opacity: 0.35; filter: grayscale(0.6); }
.boss-spr { filter: drop-shadow(0 0 4px #e8bd57aa); }
.item-label { display: inline-flex; align-items: center; gap: 3px; }

/* Painted art (hosted edition, ui.js): smooth scaling; portraits of heroes
   and monsters in rounded frames, a hero's main-hand weapon as a badge.
   Enhancement auras (.spr.aura-*) glow around the whole frame. */
.spr.painted { image-rendering: auto; }
.spr.unit-frame {
  position: relative; overflow: hidden; border-radius: 18%; image-rendering: auto;
  background: radial-gradient(circle at 50% 32%, #54493b, #1d1813 72%);
  box-shadow: inset 0 0 0 1px #d9b46a55, inset 0 -10px 16px -8px #000c;
}
.spr.unit-frame > .face { position: absolute; inset: 0; background-repeat: no-repeat; }
.spr.unit-frame > .badge {
  position: absolute; right: 4%; bottom: 4%; border-radius: 50%;
  background-color: #100d0bdd; box-shadow: 0 0 0 1px #d9b46a99, 0 1px 3px #000;
}
.spr.unit-frame.boss-spr, .unit.boss .spr.unit-frame { box-shadow: inset 0 0 0 2px #e8bd57cc, inset 0 -10px 16px -8px #000c; }
.spr.unit-frame.mon { filter: drop-shadow(0 2px 3px #000a); }
.team-B .spr.unit-frame > .face { transform: scaleX(-1); } /* monsters and arena foes face the heroes */
.art-painted .tile .token .spr.unit-frame { box-shadow: 0 0 0 2px #fff, 0 0 8px #000; }
.modal.wide.credits-modal { max-width: 720px; }
.credits pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; line-height: 1.45; max-height: 64vh; overflow: auto; }
/* Text over paintings: a heavier shadow and lighter grey. */
.art-painted .zone, .art-painted .dungeon-card { text-shadow: 0 1px 2px #000, 0 0 5px #000, 0 0 10px #000c; }
.art-painted .zone .muted, .art-painted .dungeon-card .muted { color: #d4cdbf; }

/* auth & class select */
.center { max-width: 420px; margin: 60px auto; display: grid; gap: 10px; text-align: center; }
.auth-art { display: flex; justify-content: center; gap: 12px; }
.auth .hint { text-align: left; }
.class-select { max-width: 1150px; margin: 0 auto; }
.class-select > h2 { text-align: center; font-size: 24px; color: var(--gold); }
.name-row { justify-content: center; margin-bottom: 16px; }
.classes { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.class-card { cursor: pointer; transition: transform 0.12s, border-color 0.12s; }
.class-card:hover { transform: translateY(-3px); border-color: var(--gold); }
.class-card h2 { font-size: 21px; margin-top: 8px; }
.class-portrait { display: grid; place-items: center; height: 120px; border-radius: 8px; border: 1px solid var(--border); }
.hero-list { margin-bottom: 24px; }
.hero-list > h2 { text-align: center; font-size: 24px; color: var(--gold); }
.hero-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.hero-card { display: flex; gap: 12px; align-items: center; }
.hero-card .class-portrait { width: 88px; height: 88px; flex: none; }
.hero-card h3 { margin: 0; font-size: 18px; }
.test-tag { color: var(--gold); border-color: var(--gold); }
.scaling { width: 100%; border-collapse: collapse; font-size: 12px; margin: 8px 0; }
.scaling td { padding: 2px 4px; border-bottom: 1px solid var(--border); }
.scaling td:first-child { font-weight: 600; width: 40px; }

/* game layout */
.game { display: grid; grid-template-columns: 290px minmax(0, 1fr) 260px; gap: 16px; align-items: start; }
.game.wide { grid-template-columns: 270px minmax(0, 1fr) 220px; }
@media (max-width: 1150px) { .game, .game.wide { grid-template-columns: minmax(0, 1fr); } }
.cls-warrior { color: var(--warrior); }
.cls-rogue { color: var(--rogue); }
.cls-mage { color: var(--mage); }

.portrait-row { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.portrait { width: 104px; height: 104px; display: grid; place-items: center; border-radius: 10px; border: 2px solid var(--gold-dim); box-shadow: inset 0 0 18px #000c; flex: none; }
.portrait-row h2 { margin: 0; font-size: 19px; }

.bar { height: 10px; background: #0b0a0e; border-radius: 5px; overflow: hidden; position: relative; border: 1px solid #00000080; }
.bar > div { height: 100%; transition: width 0.2s; }
.bar.xp > div { background: linear-gradient(#f4d27a, var(--gold-dim)); }
.bar.hp > div.fill { background: linear-gradient(#e4605a, #9c2a26); }
.bar.hp > div.shield { background: var(--shield); position: absolute; top: 0; opacity: 0.7; }
.bar.mp > div { background: linear-gradient(#6b95ee, #2c4fa0); }

.attrs { display: grid; grid-template-columns: 1fr auto auto; gap: 4px 8px; align-items: center; margin: 8px 0; }
.stats { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; font-size: 13px; }
.stats .delta { color: var(--good); font-size: 11px; margin-left: 4px; }

.tabs { display: flex; gap: 4px; margin-bottom: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.tabs button { padding: 4px 10px 4px 6px; }
.tabs button.active { background: linear-gradient(#4a3720, #2e2316); border-color: var(--gold); color: var(--gold); }

/* zones */
.zones { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; margin-bottom: 12px; }
.zone, .dungeon-card { padding: 10px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; transition: border-color 0.12s, transform 0.12s; text-shadow: 0 1px 2px #000; }
.zone:hover, .dungeon-card:hover { border-color: var(--border-hi); }
.zone.locked, .dungeon-card.locked { opacity: 0.45; }
.zone.selected, .dungeon-card.selected { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold-dim), 0 0 14px #e8bd5733; }
.mons { display: flex; gap: 2px; align-items: flex-end; margin: 6px 0 2px; min-height: 40px; }

/* battle */
.battle-panel { margin-top: 12px; }
/* Speed, Skip and Recap; the last result wraps under them on phones. */
.battle-controls { flex-wrap: wrap; row-gap: 6px; }
.battle-controls button { white-space: nowrap; }
.battle-empty { padding: 30px; text-align: center; border: 1px dashed var(--border); border-radius: 10px; }
.stage { border: 1px solid var(--border-hi); border-radius: 10px; padding: 8px 10px 10px; box-shadow: inset 0 0 40px #000c; }
.battle { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; min-height: 150px; }
.team { display: grid; gap: 8px; }
.vs { font-size: 22px; color: var(--gold); font-family: var(--heading); text-shadow: 0 0 8px #000; }
.unit {
  position: relative; display: flex; gap: 8px; align-items: center;
  padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px;
  background: rgba(20, 17, 26, 0.82); transition: border-color 0.15s, opacity 0.3s, filter 0.3s;
}
.team-B .unit { flex-direction: row-reverse; }
.team-B .unit .pic { transform: scaleX(-1); }
.unit .pic { flex: none; display: grid; place-items: center; }
.unit .info { flex: 1; min-width: 0; }
.unit.acting { border-color: var(--gold); box-shadow: 0 0 10px rgba(232, 189, 87, 0.45); }
.unit.dead { opacity: 0.4; filter: grayscale(1); }
.unit.boss { border-color: #8a5a2b; }
.unit.hit .pic { animation: shake 0.25s; }
@keyframes shake { 0%, 100% { translate: 0; } 25% { translate: -3px; } 75% { translate: 3px; } }
.unit .name { font-weight: 600; display: flex; justify-content: space-between; gap: 6px; }
.unit .bars { display: grid; gap: 3px; margin: 4px 0; }
.unit .nums { font-size: 11px; color: var(--muted); }
.unit .statuses { min-height: 18px; font-size: 13px; }
.unit .statuses span { margin-right: 4px; }
.role-tag { display: inline-block; font-size: 11px; color: var(--gold); border: 1px solid var(--gold-dim); border-radius: 8px; padding: 0 6px; white-space: nowrap; }
.float { position: absolute; left: 45%; top: 0; font-weight: 800; pointer-events: none; animation: floatUp 0.9s ease-out forwards; text-shadow: 0 1px 2px #000; z-index: 2; }
.float.crit { color: var(--gold); font-size: 18px; }
.float.heal { color: var(--good); }
.float.dmg { color: #ff8a80; }
.float.miss { color: var(--muted); }
.float.dot { color: #d7b25a; }
.float.special { color: #ff9b3d; font-size: 15px; top: -14px; }
@keyframes floatUp { from { transform: translateY(10px); opacity: 1; } to { transform: translateY(-30px); opacity: 0; } }
.unit.summon { opacity: 0.85; border-style: dashed; }
.unit.summon .bars, .unit.summon .nums { display: none; }

.log { height: 200px; overflow-y: auto; font-size: 12px; background: #0b0a0e; border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; margin-top: 10px; }
.log div { padding: 1px 0; }
.log .crit { color: var(--gold); }
.log .sys { color: #d9a557; }
.result { font-size: 16px; font-weight: 700; margin-top: 8px; }
.loot { font-size: 13px; font-weight: 400; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.clock { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.bar.swing { height: 4px; }
.bar.swing > div { background: var(--gold); transition: none; }

/* lists & tables */
table.list { width: 100%; border-collapse: collapse; }
table.list td, table.list th { text-align: left; padding: 3px 6px; border-bottom: 1px solid var(--border); }
table.list td.who { display: flex; align-items: center; gap: 6px; }
table.list tr.me { color: var(--gold); }

/* chat */
.chat-log { height: 320px; overflow-y: auto; font-size: 12px; margin-bottom: 8px; background: #0b0a0e; border: 1px solid var(--border); border-radius: 6px; padding: 6px; }
.chat-log b { margin-right: 4px; }
.online { font-size: 12px; display: grid; gap: 2px; }
.online-row { display: flex; align-items: center; gap: 6px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #3a1f24; border: 1px solid var(--bad); padding: 8px 16px; border-radius: 8px; z-index: 10; max-width: 90vw; box-shadow: 0 4px 16px #000a; }
.toast.info { background: #2a2333; border-color: var(--gold-dim); }

.stamina { margin: 6px 0; font-size: 13px; }
.bar.stamina > div { background: linear-gradient(#5ee0a8, #2a8a62); }
.title-badge { display: inline-block; padding: 1px 8px; border-radius: 10px; background: #4a3a10; color: var(--gold); font-size: 12px; border: 1px solid #a07a20; }
.banner { padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border-hi); background: var(--panel3); margin-bottom: 10px; }
.banner.invite { border-color: var(--gold); }
.banner.good { border-color: var(--good); }
.banner.bad { border-color: var(--bad); }

/* rarities: white / green / blue / purple / yellow */
.r-common { color: #e4e4e4; }
.r-uncommon { color: #4fd16b; }
.r-rare { color: #4f9df0; }
.r-epic { color: #b56cf5; }
.r-set { color: var(--set); }
.r-border-common { border-color: #6a6a6a !important; }
.r-border-uncommon { border-color: #2f9a4a !important; }
.r-border-rare { border-color: #2f6fb5 !important; }
.r-border-epic { border-color: #8a4cc4 !important; box-shadow: 0 0 6px rgba(181, 108, 245, 0.45); }
.r-border-set { border-color: #c9a227 !important; box-shadow: 0 0 7px rgba(240, 210, 60, 0.45); }
.true-set { box-shadow: 0 0 10px rgba(255, 230, 120, 0.85) !important; }

/* ---- skill trees -------------------------------------------------------- */
.sp-badge { background: #4a3720; border: 1px solid var(--gold-dim); color: var(--gold); border-radius: 12px; padding: 2px 10px; font-weight: 600; }
.rotation { background: var(--panel2); border: 1px solid var(--border); border-radius: 8px; padding: 8px; margin-bottom: 10px; }
.rot-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.rot-chip { display: flex; align-items: center; gap: 6px; background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; padding: 4px 6px; font-size: 13px; }
.rot-n { background: var(--gold); color: #000; border-radius: 50%; width: 18px; height: 18px; display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.rot-btns { display: flex; gap: 2px; }
.rot-chip.off { opacity: 0.5; border-style: dashed; }
.rot-chip.off .rot-n { background: var(--muted); }
.rot-toggle { min-width: 30px; }
.rot-toggle.on { background: #2f6b3a; border-color: #4caf6a; color: #dff5e3; }
.skill-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 12px; align-items: start; }
@media (max-width: 900px) { .skill-layout { grid-template-columns: minmax(0, 1fr); } }
.tree-card { position: relative; background: linear-gradient(#221d29, #18151d); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; margin-bottom: 10px; }
.tree-card.chosen { border-color: var(--gold); }
.tree-card.sealed .pyramid { filter: grayscale(0.8) brightness(0.6); }
.tree-title { margin-bottom: 4px; }
.adv-header { margin: 4px 0 6px; }
.adv-trees { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 900px) { .adv-trees { grid-template-columns: 1fr; } }
.seal { position: absolute; left: 50%; top: 55%; transform: translate(-50%, -50%); background: rgba(10, 10, 14, 0.85); border: 1px solid var(--border); padding: 6px 12px; border-radius: 8px; white-space: nowrap; font-size: 13px; }
.pyramid { position: relative; margin: 0 auto; max-width: 520px; }
.pyramid svg.links { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.pyramid svg .pyr { fill: rgba(232, 189, 87, 0.05); stroke: rgba(232, 189, 87, 0.18); stroke-width: 1; vector-effect: non-scaling-stroke; }
.pyramid svg line { stroke: #3d3546; stroke-width: 3; }
.pyramid svg line.open { stroke: var(--gold); }
.row-lv { position: absolute; left: 0; transform: translateY(-50%); font-size: 10px; color: var(--muted); }
.snode {
  position: absolute; transform: translate(-50%, -50%); width: 54px; height: 54px; border-radius: 10px;
  display: grid; place-items: center; padding: 0; background: #0d0b10;
  border: 2px solid #3d3546; transition: transform 0.1s, box-shadow 0.15s;
}
.snode.passive { border-radius: 50%; }
@media (max-width: 480px) {
  .snode { width: 44px; height: 44px; }
  .snode .skill-ico { transform: scale(0.82); }
}
.snode .skill-ico { border-radius: 6px; }
.snode.passive .skill-ico { border-radius: 50%; }
.snode .rk { position: absolute; bottom: -9px; left: 50%; transform: translateX(-50%); font-size: 10px; background: #0d0b10; border: 1px solid #3d3546; border-radius: 8px; padding: 0 5px; white-space: nowrap; }
.snode .star { position: absolute; top: -10px; right: -7px; color: var(--gold); font-size: 15px; text-shadow: 0 0 4px #000; }
.snode .trig { position: absolute; top: -8px; left: -8px; width: 18px; height: 18px; line-height: 16px; text-align: center; font-size: 10px; background: #0d0b10; border: 1px solid #3d3546; border-radius: 50%; }
.snode .trig.atk { border-color: #d08a2e; }
.snode .trig.def { border-color: #4f8fd0; }
.snode.locked .skill-ico { filter: grayscale(1) brightness(0.55); }
.snode.can { border-color: #4f9df0; box-shadow: 0 0 10px rgba(79, 157, 240, 0.55); }
.snode.learned { border-color: #c79b3a; }
.snode.maxed { border-color: var(--gold); box-shadow: 0 0 8px rgba(232, 189, 87, 0.5); }
.snode.maxed .rk { color: var(--gold); border-color: var(--gold); }
.snode.sel { transform: translate(-50%, -50%) scale(1.12); box-shadow: 0 0 0 3px rgba(232, 189, 87, 0.6); }
.snode.sig { width: 62px; height: 62px; }
.node-detail { position: sticky; top: 64px; background: var(--panel2); border: 1px solid var(--border); border-radius: 10px; padding: 10px; font-size: 13px; }
.nd-head { display: flex; gap: 8px; align-items: center; }
.nd-rank { margin: 6px 0; color: var(--gold); }
.nd-label { margin-top: 6px; font-size: 11px; text-transform: uppercase; color: var(--muted); }

/* ---- gear ------------------------------------------------------------- */
.gear { display: grid; grid-template-columns: 300px minmax(0, 1fr) 300px; gap: 12px; align-items: start; }
@media (max-width: 1400px) { .gear { grid-template-columns: 300px minmax(0, 1fr); } .gear-right { grid-column: 1 / -1; } }
@media (max-width: 700px) { .gear { grid-template-columns: minmax(0, 1fr); } }
.doll {
  display: grid; grid-template-columns: 64px 1fr 64px; grid-auto-rows: 66px; gap: 4px;
  background: radial-gradient(ellipse at center, #2a2331, #141117); border: 1px solid var(--border); border-radius: 12px; padding: 8px;
}
.hero-frame { display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 10px; border: 1px solid var(--border); box-shadow: inset 0 0 30px #000; }
.hero-caption { font-size: 11px; color: var(--muted); margin-top: 6px; }
.doll-slot { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.slot-label { font-size: 9px; color: var(--muted); text-transform: uppercase; margin-top: 1px; }
.cell {
  position: relative; width: 50px; height: 50px; border-radius: 6px; border: 2px solid #3d3546; background: radial-gradient(#2a2430, #121016);
  display: grid; place-items: center; cursor: pointer; user-select: none;
}
.cell.empty { cursor: default; border-style: dashed; border-color: #2e2836; }
.cell.sel { outline: 2px solid var(--gold); outline-offset: 1px; }
.cell .ic.ghost { opacity: 0.16; filter: grayscale(1); }
.cell .enh { position: absolute; top: 0; right: 2px; font-size: 10px; font-weight: 700; color: #7ef0a0; text-shadow: 0 0 2px #000, 0 0 2px #000; }
.cell .tier { position: absolute; bottom: 0; left: 2px; font-size: 9px; color: var(--muted); text-shadow: 0 0 2px #000; }
.cell .true-star { position: absolute; top: -2px; left: 2px; font-size: 12px; color: var(--set); text-shadow: 0 0 3px #000; }
.cell.foreign .ic { opacity: 0.55; } /* opacity, not filter: the enhancement aura is a filter */
.cell .other-class { position: absolute; top: 0; left: 2px; font-size: 10px; text-shadow: 0 0 2px #000; }
.cell .cnt { position: absolute; bottom: 0; right: 3px; font-size: 11px; font-weight: 700; text-shadow: 0 0 2px #000, 0 0 2px #000; }

/* Enhancement auras (auraClass in ui.js): +1-3 a faint blue, +4-6 purple,
   +7-9 pulsing orange, +10 blazing gold. --ai: brightness within the band;
   --k: sprite size factor, so glows scale from bag icons to the hero doll. */
.aura-blue { --aura: 96, 172, 255; }
.aura-purple { --aura: 190, 104, 255; }
.aura-orange { --aura: 255, 142, 36; }
.aura-gold { --aura: 255, 206, 56; }
.aura-s1 { --ai: 0.55; }
.aura-s2 { --ai: 0.78; }
.aura-s3, .aura-gold { --ai: 1; }

.spr.aura-blue { filter: drop-shadow(0 0 calc(var(--k, 1) * 1.5px) rgba(var(--aura), var(--ai))); }
.spr.aura-purple {
  filter: drop-shadow(0 0 calc(var(--k, 1) * 1.5px) rgba(var(--aura), var(--ai))) drop-shadow(0 0 calc(var(--k, 1) * 3px) rgba(var(--aura), calc(var(--ai) * 0.7)));
}
.spr.aura-orange {
  filter: drop-shadow(0 0 calc(var(--k, 1) * 2px) rgba(var(--aura), var(--ai))) drop-shadow(0 0 calc(var(--k, 1) * 3.5px) rgba(var(--aura), calc(var(--ai) * 0.7)));
  animation: aura-orange 1.6s ease-in-out infinite;
}
.spr.aura-gold {
  filter: drop-shadow(0 0 calc(var(--k, 1) * 1px) #fff6d0) drop-shadow(0 0 calc(var(--k, 1) * 3px) #ffd23c) drop-shadow(0 0 calc(var(--k, 1) * 5px) #ffb000cc);
  animation: aura-gold 0.9s ease-in-out infinite alternate;
}
@keyframes aura-orange {
  50% { filter: drop-shadow(0 0 calc(var(--k, 1) * 2.5px) rgba(var(--aura), 1)) drop-shadow(0 0 calc(var(--k, 1) * 5.5px) rgba(var(--aura), var(--ai))); }
}
@keyframes aura-gold {
  to { filter: brightness(1.18) drop-shadow(0 0 calc(var(--k, 1) * 1.5px) #fffbe8) drop-shadow(0 0 calc(var(--k, 1) * 4px) #ffd23c) drop-shadow(0 0 calc(var(--k, 1) * 8px) #ffae00); }
}

/* Item frames: an outer and inner glow; +10 also turns the frame gold with a shine sweeping across. */
.cell.aura::after { content: ''; position: absolute; inset: -2px; border-radius: 7px; pointer-events: none; }
.cell.aura-blue::after { box-shadow: 0 0 calc(2px + 3px * var(--ai)) rgba(var(--aura), calc(0.25 + 0.4 * var(--ai))), inset 0 0 5px rgba(var(--aura), calc(0.3 * var(--ai))); }
.cell.aura-purple::after { box-shadow: 0 0 calc(5px + 4px * var(--ai)) rgba(var(--aura), calc(0.4 + 0.45 * var(--ai))), inset 0 0 8px rgba(var(--aura), calc(0.45 * var(--ai))); }
.cell.aura-orange::after {
  box-shadow: 0 0 calc(7px + 5px * var(--ai)) rgba(var(--aura), calc(0.5 + 0.45 * var(--ai))), inset 0 0 10px rgba(var(--aura), calc(0.55 * var(--ai)));
  animation: aura-breathe 1.6s ease-in-out infinite;
}
.cell.aura-gold { border-color: #ffd23c !important; }
.cell.aura-gold::after {
  box-shadow: 0 0 6px #fff3b0, 0 0 16px rgba(var(--aura), 1), 0 0 28px rgba(255, 160, 0, 0.7), inset 0 0 12px rgba(var(--aura), 0.75);
  animation: aura-breathe 0.9s ease-in-out infinite alternate;
}
.cell.aura-gold::before {
  content: ''; position: absolute; inset: 0; border-radius: 4px; pointer-events: none; z-index: 1; mix-blend-mode: screen;
  background: linear-gradient(115deg, transparent 38%, rgba(255, 244, 196, 0.7) 50%, transparent 62%) no-repeat;
  background-size: 300% 100%; animation: aura-shine 2.2s linear infinite;
}
@keyframes aura-breathe { 50% { opacity: 0.6; } }
@keyframes aura-shine { from { background-position: 150% 0; } to { background-position: -50% 0; } }
.cell.aura-blue .enh { color: #9fd0ff; }
.cell.aura-purple .enh { color: #dcaaff; }
.cell.aura-orange .enh { color: #ffb366; }
.cell.aura-gold .enh { color: #fff0a0; text-shadow: 0 0 3px #ff9d00, 0 0 2px #000, 0 0 2px #000; }
@media (prefers-reduced-motion: reduce) {
  .aura, .aura::before, .aura::after { animation: none !important; }
}
.bag-grid { display: grid; grid-template-columns: repeat(auto-fill, 50px); gap: 4px; background: #0e0c11; border: 1px solid var(--border); border-radius: 8px; padding: 6px; max-width: 336px; }
.item-card { background: #120f16; border: 2px solid var(--border); border-radius: 10px; padding: 10px; font-size: 13px; }
.tt-icon { background-color: #0008; border-radius: 6px; }
.it-name { font-weight: 700; font-size: 15px; }
.it-base { margin: 6px 0; font-weight: 600; }
.affix-line { margin: 2px 0; }
.compare { margin-top: 6px; }
.forge { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 8px; }
.forge-title { font-weight: 700; margin-bottom: 6px; }
.forge-box { background: var(--panel2); border: 1px solid var(--border); border-radius: 8px; padding: 8px; margin-bottom: 8px; display: grid; gap: 4px; }
.imbue-row { display: grid; grid-template-columns: 1fr auto auto; gap: 6px; align-items: center; border-top: 1px solid var(--border); padding-top: 6px; }
.set-summary { margin-top: 10px; display: grid; gap: 6px; }
.set-block { background: #1c1810; border: 1px solid #5a4a18; border-radius: 8px; padding: 6px 8px; margin-top: 6px; }
.set-block > div:first-child { font-weight: 700; }

/* ---- arena ------------------------------------------------------------ */
.division-banner { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: linear-gradient(90deg, #2b2433, #1b1720); }
.div-bronze { border-color: #8a5a2b; }
.div-silver { border-color: #9aa3b5; }
.div-gold { border-color: #c9a227; }
.div-master { border-color: #b56cf5; box-shadow: 0 0 10px rgba(181, 108, 245, 0.3); }
.div-icon { font-size: 36px; }
.div-name { font-size: 18px; font-weight: 700; }
.div-stats { display: flex; gap: 14px; text-align: center; }
.arena-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 10px; }
@media (max-width: 900px) { .arena-cols { grid-template-columns: 1fr; } .division-banner { grid-template-columns: 1fr; } }
.shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.shop-item { display: grid; grid-template-columns: 50px 1fr auto; gap: 8px; align-items: center; background: var(--panel2); border: 1px solid var(--border); border-radius: 8px; padding: 6px; }

/* ---- dungeons --------------------------------------------------------- */
.members { display: grid; gap: 6px; }
.member { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 8px; background: #16131b; }
.member.me { border-color: var(--gold-dim); }
.member.merc { border-style: dashed; }
.party-tools { display: grid; gap: 6px; margin-top: 8px; }
.roles-help { margin-top: 8px; }
.ready-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border); }
.merit { display: inline-flex; align-items: center; gap: 4px; color: var(--gold); font-size: 13px; }
.dungeon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin-bottom: 12px; }
.dungeon-detail { margin-top: 4px; }
.set-preview { margin: 10px 0; padding: 8px; border: 1px solid #5a4a18; border-radius: 8px; background: #1c1810; display: grid; gap: 4px; }
.set-pieces { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0; }
.set-piece { display: grid; justify-items: center; width: 56px; padding: 2px; border: 1px solid #c9a22780; border-radius: 6px; background: #0e0c11; }
.tiny-label { font-size: 9px; color: var(--muted); }
.run-layout { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 12px; align-items: start; }
@media (max-width: 800px) { .run-layout { grid-template-columns: minmax(0, 1fr); } }
.map { display: grid; gap: 3px; padding: 6px; border-radius: 10px; background: #08070a; border: 1px solid var(--border-hi); aspect-ratio: 1; max-width: 340px; }
.tile { position: relative; aspect-ratio: 1; border-radius: 4px; display: grid; place-items: center; overflow: hidden; border: 1px solid #00000080; }
.tile.fog { filter: brightness(0.5); }
.tile.move { cursor: pointer; outline: 2px solid #e8bd57aa; outline-offset: -2px; }
.tile.move:hover { outline-color: var(--gold); filter: brightness(1.25); }
.tile.here { outline: 2px solid #fff; outline-offset: -2px; }
.tile .spr { grid-area: 1 / 1; }
.tile .token { grid-area: 1 / 1; display: grid; place-items: center; z-index: 1; filter: drop-shadow(0 0 4px #000); }
.tile .mystery { grid-area: 1 / 1; font-family: var(--heading); font-size: 22px; color: #d9c7ff; text-shadow: 0 0 6px #7b5cff; }
.tile .tile-tag { position: absolute; bottom: 1px; left: 0; right: 0; text-align: center; font-size: 8px; font-weight: 800; color: var(--gold); text-shadow: 0 0 2px #000, 0 0 2px #000; }
.tile.boss-tile { box-shadow: inset 0 0 10px #c8403c99; }
.run-side { display: grid; gap: 8px; }
.run-title { flex-wrap: wrap; }
.run-acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-left: auto; }
.run-acts button { white-space: nowrap; }
.effects { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.run-log { font-size: 12px; background: #0b0a0e; border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; max-height: 260px; overflow-y: auto; }

@media (max-width: 600px) {
  .topbar { flex-wrap: wrap; gap: 6px 10px; position: static; }
  .brand { flex: 1; }
  #resources { order: 3; flex-basis: 100%; justify-content: flex-start; gap: 16px; }
  .brand h1 { font-size: 16px; }
  .battle { grid-template-columns: 1fr; }
  .vs { text-align: center; }
  .team-B .unit { flex-direction: row; }
}
.stamina .row span:first-child { white-space: nowrap; }

.table-scroll { overflow-x: auto; max-width: 100%; }
.modal-overlay { position: fixed; inset: 0; background: #000a; display: grid; place-items: center; z-index: 20; padding: 16px; }
.modal { background: var(--panel); border: 1px solid var(--gold-dim); border-radius: 10px; padding: 16px; max-width: 380px; width: 100%; box-shadow: 0 10px 40px #000; }
.modal p { margin: 0 0 14px; }
.modal-actions { justify-content: flex-end; }
.modal.wide { max-width: 440px; position: relative; max-height: calc(100vh - 32px); overflow-y: auto; }
.modal-x { position: absolute; top: 8px; right: 8px; }
.modal h3 { margin: 0 0 10px; color: var(--gold); }
.modal form, .auth form { display: grid; gap: 8px; }
.modal section + section { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 12px; }
.recovery-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 20px; letter-spacing: 0.08em; text-align: center; padding: 10px; border: 1px dashed var(--gold-dim); border-radius: 8px; background: #0006; user-select: all; margin: 8px 0; }
.link-btn { background: none; border: none; color: var(--gold); text-decoration: underline; cursor: pointer; padding: 0; font: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, .cell:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---- quests ------------------------------------------------------------ */
.quests { display: grid; gap: 10px; }
.story-note { font-size: 13px; color: var(--muted); border-left: 3px solid var(--gold-dim); padding: 4px 10px; background: #1c1810; border-radius: 0 8px 8px 0; }
.card.story { border-color: var(--gold-dim); background: linear-gradient(#2a2233, #1f1a26); }
.card.ready { border-color: var(--good); box-shadow: 0 0 12px #6bcf7f33; }
.card.claimed { opacity: 0.6; }
.eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.quest-text { font-style: italic; margin: 6px 0; max-width: 70ch; }
.quest-text .giver { font-style: normal; font-weight: 700; color: var(--gold); }
.objective { margin: 4px 0 6px; }
.qprogress { display: flex; align-items: center; gap: 8px; margin: 4px 0 8px; }
.qprogress .bar { flex: 1; max-width: 320px; }
.bar.quest > div { background: linear-gradient(#9fe3a8, #3e9b54); }
.rewards { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 8px; font-size: 13px; }
.rw { display: inline-flex; align-items: center; gap: 4px; }
.daily-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.daily-grid .card { margin: 0; display: grid; gap: 4px; align-content: start; }
.attrs.flash { animation: flash 1.2s ease-in-out 2; border-radius: 6px; }
@keyframes flash { 50% { box-shadow: 0 0 0 2px var(--gold), 0 0 16px #e8bd5766; } }
.keys { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.tile.sealed { filter: saturate(0.6); }
.tile .seal-ico { grid-area: 1 / 1; align-self: start; justify-self: end; font-size: 12px; margin: 2px; }
.bound-tag { display: inline-block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: #e2a65f; border: 1px solid #8a5a2b; border-radius: 6px; padding: 0 5px; margin-left: 6px; vertical-align: middle; }
.bound-tag.cooldown { color: #8fc4e8; border-color: #3d6a8a; text-transform: none; letter-spacing: 0; }
.cell .lock-dot { position: absolute; bottom: 1px; right: 2px; width: 6px; height: 6px; border-radius: 50%; background: #8fc4e8; box-shadow: 0 0 2px #000; }
.cell .keep-mark { position: absolute; bottom: 0; left: 1px; font-size: 10px; line-height: 1; filter: drop-shadow(0 0 1px #000); }
.quick-sell { max-width: 112px; }
.hunt-pick { display: inline-block; cursor: pointer; border-radius: 6px; border: 1px solid transparent; line-height: 0; }
.hunt-pick:hover { border-color: var(--gold-dim); }
.hunt-pick.on { border-color: var(--gold); box-shadow: 0 0 6px var(--gold); background: rgba(0, 0, 0, 0.35); }
.hunt-bar { margin: 4px 0 8px; color: var(--gold); }
.cell .bound-dot { position: absolute; bottom: 1px; right: 2px; width: 6px; height: 6px; border-radius: 50%; background: #e2a65f; box-shadow: 0 0 2px #000; }
.send-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.send-row input { width: 130px; }

/* ---- tooltips (hover and tap) ------------------------------------------------ */
[data-tip] { cursor: help; }
button[data-tip], .cell[data-tip], .tile[data-tip], .zone [data-tip], .snode[data-tip] { cursor: pointer; }
.tip {
  position: fixed; z-index: 30; max-width: min(320px, calc(100vw - 16px)); pointer-events: none;
  background: #0d0b10; color: var(--text); border: 1px solid var(--gold-dim); border-radius: 8px;
  padding: 6px 9px; font-size: 12px; line-height: 1.4; box-shadow: 0 6px 20px #000c;
}
.tip.rich { padding: 10px; max-width: min(340px, calc(100vw - 16px)); }
.item-tip .row { align-items: flex-start; }

/* ---- detail sheets on narrow screens ------------------------------------------ */
.sheet-close { display: none; }
@media (max-width: 1400px) {
  .gear-right:not(.sheet-open) { display: none; }
  .gear-right.sheet-open {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; max-height: 78vh; overflow-y: auto;
    padding: 10px 16px calc(14px + env(safe-area-inset-bottom, 0px)); background: var(--panel);
    border-top: 2px solid var(--gold-dim); box-shadow: 0 -10px 30px #000c; animation: sheetUp 0.18s ease-out;
  }
  .gear-right.sheet-open .sheet-close { display: inline-flex; margin: 0 0 8px auto; }
  .gear-right.sheet-open { display: flex; flex-direction: column; }
  .gear { padding-bottom: 8px; }
}
@media (max-width: 900px) {
  .node-detail.sheet-open {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 15; max-height: 70vh; overflow-y: auto;
    border-radius: 12px 12px 0 0; border-top: 2px solid var(--gold-dim); box-shadow: 0 -10px 30px #000c;
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); animation: sheetUp 0.18s ease-out;
  }
  .node-detail.sheet-open .sheet-close { display: inline-flex; float: right; }
}
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.cooldown-tag { color: #e2a65f; }

/* ---- market ----------------------------------------------------------------- */
.market { display: grid; gap: 8px; }
.market-head { gap: 6px; }
.pending { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--gold); }
.mk-list { display: grid; gap: 6px; }
.mk-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel2); flex-wrap: wrap; }
.mk-row.sold, .mk-row.cancelled, .mk-row.expired, .mk-row.returned, .mk-row.accepted { opacity: 0.7; }
.mk-row .grow { min-width: 160px; }
.mk-icon { width: 44px; height: 44px; flex: none; }
.mk-good { display: inline-flex; align-items: center; gap: 2px; margin-right: 6px; }
.mk-good .mk-icon { width: 34px; height: 34px; }
.mk-price { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--gold); min-width: 80px; }
.mk-price > div:first-child { display: inline-flex; align-items: center; gap: 4px; }
.rules { font-size: 13px; color: var(--muted); }
.rules summary { cursor: pointer; color: var(--text); }
.rules ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 3px; }
.trade-box { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 8px; display: grid; gap: 4px; }
.trade-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.trade-row b { min-width: 120px; }
.trade-row input { width: 120px; }
.trade-row input.num { width: 64px; }
.trade-row input.num.wide { width: 96px; }

/* Updates (changelog) */
.updates-btn { position: relative; white-space: nowrap; }
@media (max-width: 600px) { .updates-btn .lbl { display: none; } }
.updates-btn .new-dot { position: absolute; top: -3px; right: -3px; width: 9px; height: 9px; border-radius: 50%; background: #ff5a4f; box-shadow: 0 0 0 2px var(--bg, #15121a); }
.changelog { max-height: 70vh; overflow-y: auto; padding-right: 4px; }
.changelog h3 { margin-top: 0; }
.cl-entry { border-top: 1px solid var(--border); padding: 8px 0; }
.cl-entry.latest { border-top-color: var(--gold); }
.cl-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.cl-entry ul { margin: 6px 0 0; padding-left: 18px; }
.cl-entry li { margin: 2px 0; font-size: 13px; }

/* Combat recap (recapView.js): your side green, enemies red */
.modal.recap-modal { max-width: 940px; }
.recap h3 { margin: 0 34px 4px 0; }
.rc-A { --side: var(--good); }
.rc-B { --side: var(--bad); }
.bar.rc-A > div { background: linear-gradient(#93e3a2, #3e9b54); }
.bar.rc-B > div { background: linear-gradient(#e4605a, #9c2a26); }
.rc-sub { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; font-size: 13px; margin-bottom: 8px; }
.rc-table { display: grid; gap: 4px; }
.rc-team { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; margin: 6px 0 0; font-family: var(--heading); font-weight: 700; color: var(--side); }
.rc-row {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 2fr) 56px 84px 96px; gap: 10px; align-items: center;
  padding: 5px 8px; border: 1px solid var(--border); border-left: 3px solid var(--side); border-radius: 8px;
  background: #16131b; cursor: pointer; font-variant-numeric: tabular-nums;
}
.rc-row:hover { border-color: var(--border-hi); border-left-color: var(--side); }
.rc-row.sel { background: var(--panel3); border-color: var(--gold-dim); border-left-color: var(--side); }
.rc-row.dead .rc-pic { opacity: 0.5; filter: grayscale(1); }
.rc-row.rc-head { cursor: default; background: none; border-color: transparent; padding: 0 8px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.rc-who { display: flex; align-items: center; gap: 6px; min-width: 0; }
.rc-pic { flex: none; display: grid; place-items: center; }
/* Name, then level/role/fate: beside it when there is room, else on a second line. */
.rc-name { min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; }
.rc-name > * { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-name .nm { font-weight: 600; }
.rc-dmg { display: grid; grid-template-columns: minmax(0, 1fr) 72px; gap: 8px; align-items: center; }
.rc-num { text-align: right; white-space: nowrap; }
.rc-lbl { display: none; }
.rc-pct { font-size: 11px; }
.rc-detail { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--border); border-top: 3px solid var(--side); border-radius: 10px; background: var(--panel2); }
.rc-dhead { display: flex; align-items: center; gap: 8px; }
.rc-dhead .rc-name { font-size: 15px; }
.rc-side { color: var(--side); border: 1px solid var(--side); border-radius: 10px; padding: 0 8px; font-size: 12px; white-space: nowrap; }
.rc-fate { margin: 4px 0 8px; color: var(--muted); }
.rc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.rc-chip { background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; padding: 2px 8px; font-size: 12px; font-variant-numeric: tabular-nums; }
.rc-chip b { font-size: 14px; }
.rc-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.rc-sec + .rc-sec { margin-top: 12px; }
.rc-sec h4 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gold); }
.rc-line { margin-bottom: 7px; }
.rc-line-head { display: flex; align-items: baseline; gap: 6px; font-size: 13px; font-variant-numeric: tabular-nums; }
.rc-line-head .rc-pct { min-width: 30px; text-align: right; }
.rc-src-name { min-width: 0; overflow-wrap: anywhere; }
.rc-ico { flex: none; width: 18px; text-align: center; }
.rc-line .bar { height: 6px; margin: 2px 0 1px 24px; }
.rc-facts { margin-left: 24px; font-size: 11px; color: var(--muted); }
.rc-from { color: var(--side); }
.rc-kv { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; padding: 1px 0; font-variant-numeric: tabular-nums; }
.rc-sec .small + .small { margin-top: 3px; }
.rc-eff { margin-right: 6px; white-space: nowrap; }
@media (max-width: 760px) {
  .rc-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .modal.recap-modal { padding: 12px 10px; }
  .rc-row.rc-head { display: none; }
  .rc-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 8px; }
  .rc-who, .rc-dmg { grid-column: 1 / -1; }
  .rc-dmg { grid-template-columns: minmax(0, 1fr) auto; }
  .rc-row .rc-num { text-align: left; }
  .rc-dmg .rc-num { text-align: right; }
  .rc-dmg .rc-lbl { display: none; }
  .rc-lbl { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
}
