:root {
  color-scheme: dark;
  --background: #101413;
  --panel: #181e1b;
  --surface: #202823;
  --line: #303b33;
  --text: #f2eee3;
  --muted: #a9b5aa;
  --gold: #e8c786;
  --green: #8fc9a1;
  font: 16px/1.4 "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 300px; background: radial-gradient(ellipse at 50% 0, #212d25, transparent 54%), var(--background); color: var(--text); }
button, summary { cursor: pointer; }
button { font: inherit; color: inherit; }
button:focus-visible, summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
button:disabled { cursor: default; }
h1, h2, h3, p { margin: 0; }
h1, h2, .brand strong { font-family: Georgia, serif; font-weight: 600; }
h1 { font-size: clamp(1.8rem, 3.4vw, 3.05rem); line-height: 1.07; }
h2 { font-size: 1.3rem; }
.top { min-height: 76px; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 12px max(22px, calc((100% - 1440px) / 2)); border-bottom: 1px solid var(--line); background: #121815; }
.brand, .resources { display: flex; gap: 12px; align-items: center; }
.brand strong { font-size: 1.36rem; display: block; }
.brand small, .label { display: block; color: var(--muted); font-size: .75rem; font-weight: 700; letter-spacing: .13em; }
.sigil { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid #92794b; border-radius: 10px; color: var(--gold); background: #2e291d; font-size: 1.55rem; }
.gold, .save, .count, .status { padding: 5px 9px; border-radius: 6px; border: 1px solid var(--line); font-size: .82rem; white-space: nowrap; }
.gold { color: var(--gold); background: #28241a; border-color: #4c402a; }
.save { color: var(--muted); }
.dashboard { width: min(1440px, calc(100% - 44px)); margin: 24px auto 36px; display: grid; grid-template-columns: minmax(195px, .86fr) minmax(380px, 2.42fr) minmax(225px, 1fr); gap: 16px; align-items: start; }
.panel { border: 1px solid var(--line); border-radius: 13px; background: var(--panel); min-width: 0; }
.atlas, .character, .inventory, .journal { padding: 16px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 14px; }
.count { color: var(--gold); background: #25271f; }
#maps { display: grid; gap: 4px; }
.map { width: 100%; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 5px 6px; min-height: 40px; border-radius: 5px; border: 1px solid transparent; background: transparent; text-align: left; font-size: .88rem; font-weight: 600; color: var(--text); }
.map:hover:not(:disabled), .map[aria-current] { background: #28362b; border-color: #495f4c; }
.map:disabled { color: #95a299; }
.map-marker { font-size: .8rem; color: var(--green); }
.map:disabled .map-marker { filter: grayscale(1); opacity: .75; }
.expedition { overflow: hidden; }
.expedition-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 18px 18px 15px; }
.expedition-head .label { color: var(--gold); margin-bottom: 5px; }
.status { color: var(--muted); }
.status.active { color: var(--green); background: #24362b; border-color: #3b5744; }
.scene { isolation: isolate; position: relative; margin: 0 12px; background: #15251f; border-radius: 9px; border: 1px solid #3d5146; overflow: hidden; }
canvas { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.battle-name { position: absolute; top: 12px; left: 12px; padding: 5px 9px; background: #101914eb; border: 1px solid #52695a; border-radius: 5px; font-size: .82rem; }
.battle-name span { color: var(--gold); }
.units { position: absolute; inset: auto 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 30px 12px 12px; background: linear-gradient(transparent, #0d1413 68%); }
.unit-label, .objective > div { display: flex; justify-content: space-between; gap: 8px; font-size: .82rem; margin-bottom: 5px; }
.unit-label span, .objective span { color: var(--muted); white-space: nowrap; }
progress { display: block; width: 100%; height: 7px; overflow: hidden; border: 0; border-radius: 8px; background: #323c34; color: var(--green); accent-color: currentColor; }
progress::-webkit-progress-bar { background: #323c34; }
progress::-webkit-progress-value { background: currentColor; border-radius: 8px; }
progress::-moz-progress-bar { background: currentColor; border-radius: 8px; }
#enemy-bar { color: #e1877a; }
.combat-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 14px 16px; }
.primary, .secondary { border-radius: 7px; font-size: .9rem; font-weight: 700; min-height: 40px; padding: 7px 12px; }
.primary { color: #231b0e; background: var(--gold); border: 1px solid #f5d9a0; }
.primary:hover { background: #f4d79b; }
.secondary { background: #242d27; border: 1px solid #3b4a3e; }
.secondary:hover:not(:disabled) { background: #303e34; }
.journal { border-top: 1px solid var(--line); }
#journal { padding: 0; margin: 0; list-style: none; min-height: 104px; }
#journal li { display: flex; gap: 8px; padding: 7px 0; font-size: .86rem; color: var(--muted); border-top: 1px solid #2b352e; }
#journal li::before { content: "✦"; color: var(--gold); }
.right { display: grid; gap: 16px; }
.hero-card { display: flex; align-items: center; gap: 9px; }
.class-icon { display: grid; flex: 0 0 42px; height: 42px; place-items: center; border: 1px solid #52624d; border-radius: 8px; background: #29372b; color: #c8e3a9; font-size: 1.3rem; }
.hero-card h3 { font-size: 1rem; }
.hero-card p, details, .gear-row small { font-size: .82rem; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin: 0 0 12px; text-align: center; }
.stats div { padding: 5px 2px; background: var(--surface); border-radius: 6px; }
.stats dt { font-size: .78rem; color: var(--muted); }
.stats dd { margin: 0; font-weight: 700; color: var(--gold); }
.gear-row { display: grid; grid-template-columns: 27px minmax(0, 1fr); align-items: center; gap: 7px; padding: 7px; margin-bottom: 5px; border: 1px solid var(--line); border-radius: 6px; }
.gear-row span:first-child { color: var(--gold); text-align: center; }
.gear-row b, .gear-row small { display: block; overflow-wrap: anywhere; }
.gear-row b { font-size: .84rem; }
details { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 7px; }
summary { padding: 4px 0; }
#rarities div { display: flex; justify-content: space-between; }
dialog { padding: 18px; width: min(570px, calc(100% - 24px)); background: var(--panel); color: var(--text); border: 1px solid #536557; border-radius: 13px; }
dialog::backdrop { background: #0a0e0bc7; }
.close { min-width: 40px; font-size: 1.15rem; }
#class-options { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.class-option { display: flex; align-items: start; gap: 9px; padding: 9px; text-align: left; }
.class-option[aria-pressed="true"] { border-color: var(--green); }
.class-option small { display: block; margin-top: 3px; font-size: .82rem; font-weight: 400; color: var(--muted); }
@media (max-width: 1030px) {
  .dashboard { grid-template-columns: minmax(175px, .75fr) minmax(0, 2fr); }
  .right { grid-column: 2; grid-template-columns: 1fr 1fr; }
  .atlas { grid-row: span 2; }
}
@media (max-width: 650px) {
  .dashboard { width: calc(100% - 20px); margin: 10px auto; grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .expedition { grid-row: 1; }
  .right { grid-column: 1; grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .atlas { grid-row: auto; }
  #maps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top { padding: 8px 10px; min-height: 60px; }
  .brand { gap: 7px; }
  .brand strong { font-size: 1.04rem; }
  .sigil { width: 34px; height: 34px; }
  .save { display: none; }
  .units { position: static; background: #101914; gap: 8px; padding: 6px 8px 8px; }
  .battle-name { top: 6px; left: 6px; }
  .combat-controls { gap: 9px; }
  .journal .label { display: none; }
}
@media (max-width: 370px) {
  .combat-controls, #class-options { grid-template-columns: 1fr; }
  .map { gap: 4px; padding-inline: 3px; }
}

.pixel-icon, .monster-icon { display: block; object-fit: contain; image-rendering: pixelated; }
.pixel-icon { width: 21px; height: 21px; }
.gold { display: inline-flex; align-items: center; gap: 5px; }
.presence { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid #3c6351; border-radius: 999px; min-height: 36px; background: linear-gradient(135deg, #253d35, #182a27); color: #b8f2d2; white-space: nowrap; font-size: .79rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.presence .pixel-icon { width: 18px; height: 18px; }
@media (max-width: 720px) {
  .resources { flex-wrap: wrap; justify-content: flex-end; }
  .presence { min-height: 34px; gap: 4px; padding-inline: 7px; font-size: .73rem; }
  .presence .pixel-icon { width: 15px; height: 15px; }
}
.class-icon { flex-basis: 44px; height: 44px; border-color: color-mix(in srgb, var(--item-color, #89a880) 48%, #26352c); background: radial-gradient(ellipse at 50% 30%, color-mix(in srgb, var(--item-color, #89a880) 24%, #17221c), #19231e); }
.class-icon .pixel-icon { width: 32px; height: 32px; }
.map-marker .pixel-icon { width: 14px; height: 14px; }
.battle-name { display: flex; align-items: center; gap: 6px; padding: 3px 9px 3px 4px; border-radius: 7px; }
.enemy-icon .monster-icon { width: 30px; height: 30px; }
.market-button, .icon-button, .bag-button, .auto-button { display: inline-flex; justify-content: center; align-items: center; gap: 7px; }
.market-button { color: var(--gold); }
.bag-button { width: 100%; justify-content: flex-start; margin-top: 7px; min-height: 42px; }
.bag-button b { margin-left: auto; color: var(--gold); }
.combat-controls { row-gap: 10px; }
.route-controls { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 8px; }
.auto-button { justify-content: flex-start; min-height: 37px; padding: 5px 9px; background: #202923; text-align: left; }
.auto-button b { margin-left: auto; padding: 3px 8px; border-radius: 5px; background: #151d18; color: var(--muted); font-size: .78rem; }
.auto-button[aria-pressed="true"] { border-color: #5b8b68; }
.auto-button[aria-pressed="true"] b { color: #b2e4b9; background: #2d4835; }
.retreat-status { grid-column: 1 / -1; color: var(--gold); font-size: .84rem; }
.item-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 36px; border-radius: 7px; border: 1px solid color-mix(in srgb, var(--item-color) 55%, #26352c); background: radial-gradient(ellipse at 48% 45%, color-mix(in srgb, var(--item-color) 26%, #19231e), #19231e); }
.item-icon .pixel-icon { width: 27px; height: 27px; }
.gear-row { grid-template-columns: 32px minmax(0, 1fr) auto; background: #1c241f; }
.gear-row .item-icon { width: 32px; height: 32px; }
.gear-row .item-icon .pixel-icon { width: 24px; height: 24px; }
.stash-button { display: grid; place-items: center; padding: 2px; width: 27px; height: 30px; border: 1px solid #344137; border-radius: 5px; background: #26312a; }
.stash-button:disabled, .secondary:disabled { opacity: .6; }
.primary:disabled { opacity: .5; filter: grayscale(.5); cursor: not-allowed; }
.stash-button:hover:not(:disabled) { background: #37463b; }
.stash-button .pixel-icon { width: 18px; height: 18px; }
.buffs { padding: 16px; }
.buffs .section-head { margin-bottom: 8px; }
.text-button { border: 0; background: transparent; color: var(--gold); font-size: .82rem; padding: 4px; text-decoration: underline; text-underline-offset: 3px; }
.buff-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 7px; align-items: center; padding: 5px 0; border-top: 1px solid var(--line); font-size: .83rem; }
.buff-row .item-icon { width: 28px; height: 28px; }
.buff-row .pixel-icon { width: 22px; height: 22px; }
.buff-row > span:last-child { font-variant-numeric: tabular-nums; color: var(--muted); }
.better, .buff-row > .better:last-child { color: #a7dcb2; }
.worse { color: #f0a99d; }
.equal { color: var(--muted); }
dialog { max-height: min(86vh, 760px); box-shadow: 0 24px 85px #080d0ac9; }
.commerce-dialog { width: min(780px, calc(100% - 20px)); }
.dialog-title { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.dialog-heading { display: flex; gap: 10px; align-items: center; }
.dialog-heading > span { display: grid; place-items: center; width: 43px; height: 43px; background: #2e2b20; border: 1px solid #655536; border-radius: 8px; }
.dialog-heading .pixel-icon { width: 30px; height: 30px; }
.dialog-heading h2 { font-size: 1.6rem; }
.dialog-heading p, .shop-heading p, .item-meta { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.filter-row { display: flex; gap: 13px; flex-wrap: wrap; padding-bottom: 6px; }
.commerce-dialog label { display: inline-flex; align-items: center; gap: 6px; font-size: .86rem; color: var(--muted); }
select { color: var(--text); appearance: none; padding: 7px 25px 7px 8px; border: 1px solid #506056; border-radius: 6px; background: linear-gradient(45deg, transparent 50%, var(--muted) 50%) right 11px center / 5px 5px no-repeat, linear-gradient(135deg, var(--muted) 50%, transparent 50%) right 6px center / 5px 5px no-repeat, #232d26; font: inherit; }
select:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.shop-heading { margin: 16px 0 5px; padding-top: 13px; border-top: 1px solid var(--line); align-items: end; }
.shop-feedback { color: var(--green); font-size: .88rem; margin: 6px 0; }
.shop-feedback:empty { display: none; }
.item-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.potion-grid { margin-top: 7px; }
.item-card { display: grid; align-content: start; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: linear-gradient(155deg, #263029, #1b231e 68%); }
.item-head { display: flex; align-items: center; gap: 9px; min-width: 0; }
.item-details { display: grid; flex: 1; min-width: 0; }
.item-name { font-size: .93rem; line-height: 1.2; overflow-wrap: anywhere; }
.item-comparison { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 7px; padding: 7px; border-radius: 6px; background: #151c18; font-size: .82rem; }
.item-comparison small { grid-column: 1 / -1; color: var(--muted); font-size: .77rem; }
.item-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.item-actions button, .buy-button { min-height: 38px; padding: 5px 8px; font-size: .82rem; }
.buy-button { justify-self: start; color: var(--gold); }
.empty-trade { grid-column: 1 / -1; padding: 16px 0; color: var(--muted); }
@media (max-width: 650px) {
  .resources { gap: 6px; }
  .market-button { min-height: 36px; padding: 4px 6px; }
  .market-button .pixel-icon, .gold .pixel-icon { width: 16px; height: 16px; }
  .enemy-icon .monster-icon { width: 24px; height: 24px; }
  .buffs { padding: 14px; }
}
@media (max-width: 500px) {
  .item-grid { grid-template-columns: minmax(0, 1fr); }
  .shop-heading { align-items: flex-start; flex-direction: column; }
  .commerce-dialog { padding: 12px; }
}

/* Painted world and brass interfaces */
:root {
  --background: #0d121e;
  --panel: #151b29;
  --surface: #1e2838;
  --line: #30394b;
  --text: #f2eee7;
  --muted: #aab6c8;
  --gold: #edce91;
  --green: #a1d9b2;
  --area-accent: #a1d9b2;
}
[hidden] { display: none !important; }
body { background: radial-gradient(ellipse at 50% -20%, #293851, transparent 60%), #0d121e; }
.top { min-height: 70px; padding-inline: max(18px, calc((100% - 1530px) / 2)); flex-wrap: wrap; background: #0c111cf7; border-bottom-color: #3a4050; }
.top .brand { flex-shrink: 0; }
.top .brand strong { font-size: clamp(1.15rem, 2.15vw, 1.65rem); letter-spacing: -.02em; }
.brand small { font-size: .65rem; letter-spacing: .15em; color: #b2a182; }
.sigil { background: linear-gradient(145deg,#5e4f36,#211e28); border-color: #8f754f; box-shadow: inset 0 0 0 2px #1a1822; }
.top-nav { display: flex; align-items: center; gap: 6px; }
.nav-button, .mode-button { display: inline-flex; align-items: center; gap: 6px; background: #182133; border: 1px solid #38445b; border-radius: 7px; padding: 6px 10px; min-height: 36px; font-size: .84rem; font-weight: 700; color: #dfe8f6; }
.nav-button:hover, .mode-button:hover { background: #28364c; }
.mode-button { color: #bdcadf; white-space: nowrap; }
.gold { background: #282427; border-color: #5e4a37; min-height: 36px; }
.panel { border-color: #303a4d; background: linear-gradient(160deg,#192131,#121925 58%); box-shadow: 0 12px 26px #05081038; }
.dashboard { width: min(1530px, calc(100% - 32px)); grid-template-columns: minmax(190px,.82fr) minmax(365px,2.5fr) minmax(245px,1fr); margin-top: 18px; }
.atlas, .character, .inventory, .journal, .buffs, .familiar { padding: 14px; }
.expedition-head { padding: 17px 15px 13px; }
.expedition-head .label { color: var(--area-accent); font-size: .69rem; }
.expedition-head h1, .panel h2 { letter-spacing: -.025em; }
.expedition-head h1 { font-size: clamp(1.65rem,3.2vw,2.9rem); }
#regions { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 165px), 1fr)); gap: 5px; margin-bottom: 11px; }
.region-button { display: grid; grid-template-columns: 43px minmax(0, 1fr); align-items: center; gap: 8px; min-height: 44px; padding: 4px; border: 1px solid #414252; background: #232631; border-radius: 5px; color: var(--text); font-size: .82rem; font-weight: 750; text-align: left; }
.region-button[aria-pressed="true"] { background: color-mix(in srgb,var(--region-color) 22%,#171621); border-color: var(--region-color); color: var(--region-color); }
.region-button:hover { border-color: var(--region-color); }
.map-thumbnail { display: block; aspect-ratio: 1.18; background-color: #322932; background-image: url("assets/territorios-cartoon.png"); background-size: 300% 200%; border-radius: 6px; box-shadow: inset 0 0 0 1px #ffffff38; }
.map-entry-label { display: grid; gap: 1px; }
#maps { max-height: clamp(310px, 57vh, 630px); overflow-y: auto; padding-right: 3px; scrollbar-color: #536882 #172133; }
.map:disabled .map-thumbnail { filter: saturate(.35) brightness(.65); }
.map[aria-current] .map-thumbnail { outline: 1px solid var(--area-accent); }
.region-heading { font-size: .83rem; color: #d7dded; margin: 8px 0 6px; padding-bottom: 7px; border-bottom: 1px solid #343d4e; }
.map { color: #dbe3f0; min-height: 37px; }
.map:disabled { color: #95a1b5; }
.map:hover:not(:disabled), .map[aria-current] { background: #263850; border-color: #465b72; }
.scene { --skill-gutter: 87px; border-color: #5a5865; background: #111828; }
#scene { image-rendering: auto; width: calc(100% - var(--skill-gutter)); }
.battle-name { background: #0e1524e8; border-color: #65718b; }
.units { background: linear-gradient(transparent,#0c1423 78%); right: var(--skill-gutter); }
progress, progress::-webkit-progress-bar { background: #303a4d; }
.primary { background: linear-gradient(145deg,#f1d392,#d5a755); color: #271e15; box-shadow: inset 0 1px #ffedc1; border-color: #edc985; }
.secondary, .auto-button { background: #222c40; border-color: #3a4861; }
.secondary:hover:not(:disabled), .auto-button:hover { background: #314158; }
.auto-button b { background: #131b2b; }
.journal { border-top-color: #303c52; }
#journal li { border-top-color: #293449; }
.hero-card .class-icon { width: 48px; height: 48px; flex-basis: 48px; }
.hero-card .class-icon .pixel-icon { width: 40px; height: 40px; }
.stats div, .count { background: #253044; border-color: #3e4a60; }
#gear { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; }
.gear-row { grid-template-columns: 24px minmax(0,1fr); position: relative; background: #1b2536; border-color: #35415a; gap: 5px; margin: 0; padding: 5px; min-height: 44px; }
.gear-row b { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .74rem; line-height: 1.3; }
.gear-row small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .71rem; }
.gear-row:has(.stash-button) { padding-right: 20px; }
.gear-row .item-icon { width: 24px; height: 26px; }
.gear-row .item-icon .pixel-icon { width: 22px; height: 22px; }
.gear-row .stash-button { position: absolute; right: 2px; top: 3px; width: 17px; height: 20px; background: #26354b; border-color: #3c5270; }
.gear-row .stash-button .pixel-icon { width: 14px; height: 14px; }
.item-icon, .class-icon { filter: drop-shadow(0 2px 3px #060b1590); }
.item-icon .pixel-icon, .class-icon .pixel-icon, .nav-button .pixel-icon { image-rendering: auto; }
dialog { background: linear-gradient(155deg,#1b2436,#121926 76%); border-color: #536079; }
dialog::backdrop { background: #070a12b9; backdrop-filter: blur(3px); }
.commerce-dialog, .world-dialog { width: min(840px,calc(100% - 20px)); }
.dialog-heading > span { background: #222c42; border-color: #536689; }
.item-card { background: linear-gradient(155deg,#202e44,#161f30); border-color: #3a4965; }
.item-comparison { background: #111b2d; }
.item-stars { color: #e8c37f; font-size: .75rem; letter-spacing: .08em; }
#world-gate { display: grid; gap: 13px; justify-items: start; }
#world-gate p, .social-heading p { color: var(--muted); font-size: .91rem; }
#world-content { display: grid; gap: 10px; }
.social-form { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; margin: 5px 0 12px; }
.social-form label { display: grid; gap: 4px; min-width: min(100%,155px); }
.social-form input, .social-form select { min-height: 40px; max-width: min(100%,360px); border: 1px solid #435371; background-color: #121b2c; border-radius: 7px; color: var(--text); font: inherit; padding: 6px 9px; }
.social-form input:focus { outline: 2px solid #bda27b; outline-offset: 2px; }
.social-form select { padding-right: 22px; }
.social-list { display: grid; gap: 6px; padding: 0; list-style: none; }
.social-entry { padding: 9px; display: grid; gap: 4px; border: 1px solid #36435e; border-left-color: var(--region-color,#59779b); border-radius: 7px; background: #19253a; }
.social-entry button { justify-self: start; }
.social-entry strong { color: var(--region-color,var(--text)); }
.social-heading { border-top: 1px solid #34435b; padding-top: 12px; margin: 12px 0; }
#market-page { margin: 10px 0; }
#exit-world { margin-top: 12px; }
@media (max-width:1050px) {
  .dashboard { grid-template-columns: minmax(170px,.72fr) minmax(0,2fr); }
  .right { grid-column: 2; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .atlas { grid-row: span 2; }
}
@media (max-width:650px) {
  .dashboard { width: calc(100% - 16px); grid-template-columns: minmax(0,1fr); margin-top: 8px; }
  .right { grid-column: 1; grid-template-columns: minmax(0,1fr); }
  .atlas { grid-row: auto; }
  .top { gap: 6px; padding: 7px 9px; }
  .brand { width: 100%; }
  .top-nav { gap: 4px; }
  .nav-button, .mode-button, .market-button { min-height:34px; padding: 4px 6px; font-size: .76rem; }
  .nav-button .pixel-icon { width: 15px; height: 15px; }
  .resources { margin-left: auto; gap: 4px; }
  .gold { min-height:34px; gap: 3px; font-size:.73rem; padding: 3px 4px; }
  .units { background: #101a2b; }
  .social-form label { width: 100%; }
}

.diamond-balance { color: #b5e3ff; background: #182b3d; border-color: #3d6585; }
.stats div { display: flex; flex-direction: column; justify-content: space-between; }
.stats dt { font-size: .73rem; text-wrap: balance; }
.switch-bar { display: flex; flex-wrap: wrap; gap: 7px; margin: 9px 0; }
.switch-bar [aria-pressed="true"] { border-color: #87a9d2; color: #d6ebff; background: #2d4564; }
.collection-banner { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px; margin: 10px 0; border: 1px solid #405574; border-radius: 8px; background: radial-gradient(ellipse at 85% 45%, #37507766, transparent 68%), #172338; }
.collection-banner p { font-size: .88rem; color: #aebed2; }
.collection-banner button { flex-shrink: 0; }
.collectible-canvas { width: 60px; height: 60px; flex: 0 0 60px; border-radius: 7px; background: #141d2d; }
.collectible .secondary { justify-self: start; min-height: 36px; }
.draw-reveal { animation: reveal-collection .42s ease-out; }
@keyframes reveal-collection { from { opacity: .3; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.duel-entry { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
#arena-opponents { margin-top: 8px; }
.arena-meters { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin: 9px 0; }
.arena-meters progress { margin-top: 5px; }
.arena-meters > div:nth-child(2) progress { color: #f1a098; }
.arena-log { margin: 8px 0; padding-left: 19px; color: var(--muted); font-size: .85rem; }
@media (max-width:850px) { .diamond-label { display: none; } }
@media (max-width:650px) { .top-nav { flex-wrap: wrap; } .collection-banner { align-items: flex-start; flex-direction: column; } }
@media (prefers-reduced-motion: reduce) { .draw-reveal { animation: none; } }

.drop-info { position: absolute; z-index: 4; top: 8px; right: calc(var(--skill-gutter) + 8px); display: grid; place-items: center; width: 27px; height: 27px; padding: 0; color: #dce9fc; background: #111c2feb; border: 1px solid #6783a4; border-radius: 50%; font-size: 17px; line-height: 1; }
.drop-info:hover, .drop-info[aria-expanded="true"] { background: #315477; border-color: #b2d3ff; }
.drop-panel { position: absolute; z-index: 3; top: 42px; right: calc(var(--skill-gutter) + 8px); width: min(284px, calc(100% - var(--skill-gutter) - 16px)); max-height: calc(100% - 50px); overflow: auto; padding: 11px; color: #e8efff; background: #111b2aef; border: 1px solid #607d9f; border-radius: 8px; box-shadow: 0 10px 25px #040914c0; font-size: .79rem; }
.drop-panel h2 { font-size: 1rem; }
.drop-panel h3 { font-size: .8rem; margin-top: 8px; }
.drop-panel p { margin-top: 4px; color: #a9d4fb; }
.drop-panel dl { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 3px 10px; margin: 5px 0 0; }
.drop-panel dt { min-width: 0; }
.drop-panel dd { margin: 0; font-variant-numeric: tabular-nums; }
.collection-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
/* Pets e skins: resumo, combinação e cartas por raridade. */
.collection-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 8px; margin: 10px 0; }
.summary-card { display: grid; gap: 5px; align-content: start; padding: 10px 12px; border: 1px solid #405574; border-radius: 9px; background: linear-gradient(160deg, #1b2940, #141d2e); }
.summary-label { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.summary-card strong { font-size: .98rem; }
.collection-look-art { display: grid; place-items: center; min-height: 99px; margin-top: 3px; border-radius: 8px; background: radial-gradient(ellipse, color-mix(in srgb, var(--look-color, #b39bd7) 26%, #192638), #121b2a 70%); }
.collection-look-art[hidden] { display: none; }
.collection-look-art canvas { width: 92px; height: 92px; object-fit: contain; filter: drop-shadow(0 4px 6px #0008); }
#claim-all-missions { margin-top: 10px; }
.possession-card { border-color: #5b4f86; background: radial-gradient(ellipse at 90% 0%, #6d4fa83a, transparent 60%), linear-gradient(160deg, #1d2540, #151b2e); }
.possession-card .item-meta { margin: 0; font-size: .76rem; }
.buff-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.buff-chip { padding: 2px 7px; border: 1px solid #3b4a66; border-radius: 999px; background: #1a2438; color: #cdd8ee; font-size: .72rem; font-weight: 650; white-space: nowrap; }
.buff-chip.main { border-color: var(--item-color, #ffcb78); color: #10141f; background: var(--item-color, #ffcb78); }
.collection-fusion { padding: 10px 12px; border: 1px solid #405574; border-radius: 9px; background: #172338; }
.fusion-head h3 { margin-bottom: 2px; }
.fusion-head .item-meta { margin: 0 0 8px; font-size: .8rem; }
.fusion-tiers { display: grid; gap: 6px; }
.fusion-tier { display: grid; grid-template-columns: minmax(150px, 1.1fr) minmax(80px, 1fr) auto auto; align-items: center; gap: 10px; padding: 6px 9px; border: 1px solid #2f3c57; border-left: 3px solid var(--to-color); border-radius: 7px; background: #131b2b; }
.fusion-tier .item-meta { margin: 0; font-size: .78rem; white-space: nowrap; }
.fusion-tier button { min-height: 32px; padding: 4px 12px; }
.fusion-label { display: flex; align-items: center; gap: 6px; font-size: .86rem; }
.fusion-arrow { color: var(--muted); }
.fusion-bar { height: 8px; border-radius: 99px; background: #222d43; overflow: hidden; }
.fusion-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--from-color), var(--to-color)); }
.fusion-tier.to-mythic { border-color: #ff5fa255; background: linear-gradient(90deg, #ff5fa214, #131b2b 60%); }
.collection-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.collectible { position: relative; border: 1px solid color-mix(in srgb, var(--item-color) 35%, #2d3a55); border-left: 4px solid var(--item-color); }
.collectible.missing { opacity: .72; }
.collectible.missing .collectible-canvas { filter: grayscale(.75) brightness(.8); }
.collectible.rarity-3.owned { box-shadow: 0 0 12px color-mix(in srgb, var(--item-color) 22%, transparent); }
.collectible.rarity-4.owned { box-shadow: 0 0 16px color-mix(in srgb, var(--item-color) 32%, transparent); }
.collectible.rarity-5 { background: radial-gradient(ellipse at 15% 0%, #ff5fa22c, transparent 55%), radial-gradient(ellipse at 100% 100%, #7f6bff26, transparent 60%), #171f31; }
.collectible.rarity-5.owned { box-shadow: 0 0 20px #ff5fa255; animation: mythic-glow 3.2s ease-in-out infinite; }
@keyframes mythic-glow { 50% { box-shadow: 0 0 28px #b78bff66; } }
.collectible-portrait { position: relative; border-radius: 9px; padding: 2px; background: linear-gradient(145deg, var(--item-color), #1b2438 70%); }
.collectible-portrait .collectible-canvas { display: block; }
.collectible-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 3px; }
.rarity-badge, .profile-tag, .class-tag, .state-tag { padding: 1px 6px; border-radius: 5px; font-size: .68rem; font-weight: 700; letter-spacing: .02em; }
.rarity-badge { color: #10141f; background: var(--item-color); }
.profile-tag { color: #f2e2b8; background: #3a3220; border: 1px solid #6b5a33; }
.class-tag { color: #c9d6f0; background: #243149; }
.state-tag.bonus { color: #d7ffe2; background: #24583a; }
.state-tag.look { color: #d7ecff; background: #2b4260; }
.possession-line { font-size: .74rem; }
.possession-line.on { color: #c6b3ff; }
.mythic-lock { justify-self: start; padding: 5px 10px; border: 1px dashed #ff5fa288; border-radius: 7px; color: #ffb3d2; font-size: .78rem; }
.reveal-card.mythic { filter: drop-shadow(0 0 10px #ff5fa2aa); }
@media (max-width: 650px) { .fusion-tier { grid-template-columns: 1fr auto; } .fusion-bar { grid-column: 1 / -1; grid-row: 2; } }
.collectible-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.copy-count { color: #f0d493; }
.equipment-power { color: var(--gold); font-size: .79rem; font-weight: 750; }
.equipped-total { margin: 8px 0 5px; text-align: right; }
.ranking-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: space-between; }
#ranking-status { margin: 6px 0 8px; }
.ranking-content { margin: 10px 0 2px; }
.ranking-table { width: 100%; margin-top: 8px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.ranking-table :is(th, td) { padding: 8px; border-bottom: 1px solid var(--line); text-align: left; }
.ranking-table :is(th, td):nth-child(n+3) { text-align: right; }
.ranking-table th[aria-sort="descending"], .ranking-self { color: var(--gold); }
.ranking-self { background: #262b38; }
.account-dialog { width: min(418px, calc(100% - 24px)); padding: clamp(18px, 5vw, 30px); border: 1px solid #697583; background: linear-gradient(160deg, #202b3f, #121a28 70%); text-align: center; }
.account-dialog h2 { margin: 8px 0; font-size: clamp(1.5rem, 5vw, 2rem); }
.account-dialog p { margin: 8px 0 12px; color: var(--muted); }
.account-emblem { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto; border: 1px solid #ab8655; border-radius: 8px; background: #2b2930; }
.account-emblem .pixel-icon { width: 38px; height: 38px; }
.account-signin { display: block; text-decoration: none; }
.account-form { display: grid; gap: 8px; margin: 16px 0; text-align: left; }
.account-form input { width: 100%; }
.account-dialog [role="status"] { color: #ffc0ae; }
.collectible button[aria-pressed="true"] { border-color: #92badf; background: #2b4260; color: #d7ecff; }
.tier-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(126px,1fr)); gap: 6px; margin-block: 5px 12px; }
.tier-card { display: flex; flex-direction: column; padding: 6px 8px; border: 1px solid #334b68; background: #16253a; border-radius: 6px; }

.skill-rail { position: absolute; inset: 0 0 0 auto; width: var(--skill-gutter); padding: 8px; display: grid; align-content: center; gap: 6px; border-left: 1px solid #405270; background: #172338; }
.battle-skills { display: grid; gap: 4px; }
.skill-medallion {
  display: inline-grid; position: relative; place-items: start center; flex: 0 0 auto; width: 57px; height: 57px;
  border-radius: 50%; border: 2px solid color-mix(in srgb, var(--skill-accent) 77%, #ffe0a1);
  background: radial-gradient(ellipse at 50% 30%, color-mix(in srgb, var(--skill-accent) 36%, #263754), #131a2a 72%);
  box-shadow: inset 0 0 0 2px #10141f, inset 0 -5px 12px #090b12a6, 0 2px 5px #0009;
}
.skill-medallion .skill-artwork {
  width: 88%; height: 88%; margin-top: 1%; filter: drop-shadow(0 2px 2px #070911);
}
.skill-medallion b {
  position: absolute; inset: auto auto -1px 50%; transform: translateX(-50%); min-width: 1.5em;
  padding: 2px 3px; border: 1px solid color-mix(in srgb, var(--skill-accent) 71%, #ffe2a6);
  border-radius: 9px; background: #121827; color: #fff3d4; text-align: center; font: 800 .76rem/1 system-ui, sans-serif;
}
.territory-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 10px; }
.territory-card { border-top: 2px solid var(--region-color); overflow-wrap: anywhere; }
.territory-card .map-thumbnail { aspect-ratio: auto; height: 104px; margin-bottom: 8px; }
.territory-clock { font-weight: 700; color: #f3d695; font-variant-numeric: tabular-nums; }
.battle-skill, .quick-potion { display: inline-flex; align-items: center; justify-content: center; gap: 3px; min-width: 46px; min-height: 29px; padding: 3px 5px; color: #dceafa; background: #111c2bf4; border: 1px solid #557293; border-radius: 7px; }
.battle-skill .skill-medallion { width: 37px; height: 37px; }
.battle-skill .skill-medallion b { padding: 1px 3px; font-size: .62rem; }
.quick-potion .pixel-icon { width: 20px; height: 20px; }
.battle-skill.locked-skill { opacity: .61; border-style: dashed; }
.battle-skill.recharging { border-color: #e2bc7f; background: #2e2629; }
.battle-skill.recharging .skill-artwork { opacity: .65; }
.skill-status { font-size: .68rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.codex-items li { display: flex; align-items: center; gap: 6px; }
.codex-pagination { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 12px 0; font-size: .85rem; }
@media (max-width: 1080px) {
  .scene { --skill-gutter: 0px; }
  .skill-rail { position: static; width: auto; display: flex; flex-wrap: wrap; justify-content: space-between; padding: 6px 8px; border-left: 0; background: #101a2b; }
  .battle-skills { display: flex; flex-wrap: wrap; }
  .scene .units { position: static; background: #101a2b; padding: 6px 8px 8px; }
}
.quick-potion { min-width: 40px; font-size: .78rem; }
.quick-potion:disabled { opacity: .57; }
.shop-potion { margin-top: 12px; }
.shop-potion .switch-bar { margin: 0; }
.codex-items { margin: 0; padding-left: 20px; color: #bacce0; font-size: .8rem; }
.auto-sell-form { display: grid; gap: 11px; }
.auto-sell-form fieldset { margin: 0; min-width: 0; border: 1px solid #3c5677; border-radius: 7px; }
.auto-sell-form fieldset > div { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.auto-sell-form label { display: inline-flex; align-items: center; gap: 6px; }
.auto-sell-form input[type=number] { width: 62px; padding: 5px; color: #eaf3ff; background: #101927; border: 1px solid #4e6381; border-radius: 5px; font: inherit; }
.auto-sell-form .primary { justify-self: start; }
.reveal-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 9px; }
.reveal-grid:has(.reveal-card:only-child) { grid-template-columns: minmax(0,188px); justify-content: center; }
.reveal-card { perspective: 750px; min-height: 154px; padding: 0; text-align: center; color: #e9f3ff; background: transparent; border: none; border-radius: 10px; }
.reveal-sides { display: grid; min-height: 100%; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.22,.68,.24,1.04) var(--reveal-delay,0ms); }
.reveal-card[aria-pressed=true] .reveal-sides { transform: rotateY(180deg); }
.reveal-face, .reveal-back { grid-area: 1 / 1; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; min-height: 154px; padding: 6px; backface-visibility: hidden; border-radius: 10px; border: 1px solid #6c83aa; }
.reveal-face { background: radial-gradient(circle at 50% 40%,#365486 0%,#22344f 41%,#101b2d 86%); box-shadow: inset 0 0 0 3px #172641; }
.reveal-face .pixel-icon { width: 42px; height: 42px; filter: drop-shadow(0 0 8px #72bbff); }
.reveal-back { transform: rotateY(180deg); border-color: var(--card-color); background: radial-gradient(ellipse at 50% 35%,color-mix(in srgb,var(--card-color) 22%,#172437),#111b2a 76%); }
.reveal-back strong { color: var(--card-color); font-size: .83rem; overflow-wrap: anywhere; }
.reveal-back small { font-size: .73rem; }
.reveal-back .collectible-canvas { width: 54px; height: 54px; flex-basis: 54px; }
#reveal-dialog > .switch-bar { justify-content: center; }
@media (max-width: 650px) {
  .reveal-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .reveal-card, .reveal-face, .reveal-back { min-height: 137px; }
}
@media (prefers-reduced-motion: reduce) { .reveal-sides { transition: none; } }

/* Personagem e mochila */
#gear.gear-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; }
.gear-cell, .inv-tile { position: relative; display: grid; place-items: center; aspect-ratio: 1; min-width: 0; padding: 3px; border: 1px solid color-mix(in srgb, var(--item-color) 62%, #2b3449); border-radius: 8px; background: radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--item-color) 24%, #1b2436), #141b29 78%); box-shadow: inset 0 0 0 1px #ffffff0d, 0 3px 8px #04081266; cursor: pointer; color: var(--text); }
.gear-cell .pixel-icon, .inv-tile .pixel-icon { width: 78%; height: 78%; image-rendering: auto; filter: drop-shadow(0 2px 2px #050a1499); }
.gear-cell:hover, .inv-tile:hover { border-color: var(--item-color); transform: translateY(-1px); }
.gear-cell:focus-visible, .inv-tile:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.gear-cell.empty, .inv-tile.empty { border-style: dashed; border-color: #3a4660; background: #141b29; }
.gear-cell.empty .pixel-icon, .inv-tile.empty .pixel-icon { opacity: .28; filter: grayscale(1); }
.inv-stars { position: absolute; right: 3px; bottom: 2px; font-size: .62rem; font-weight: 800; line-height: 1; color: #f1d08a; text-shadow: 0 1px 2px #000; }
.inv-level { position: absolute; left: 3px; bottom: 2px; font-size: .56rem; font-weight: 800; line-height: 1; color: #cfe0f5; text-shadow: 0 1px 2px #000; }
.inv-label { position: absolute; inset: auto 2px 3px; font-size: .58rem; font-weight: 700; color: #8391a8; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-up { position: absolute; left: 3px; top: 2px; font-size: .62rem; color: #8fe0a2; text-shadow: 0 1px 2px #000; }
.inv-codex { position: absolute; right: 3px; top: 2px; display: grid; place-items: center; width: 13px; height: 13px; border-radius: 50%; background: #6c4fb5; color: #f3ecff; font-size: .55rem; font-weight: 800; }
.inv-tile.blocked .pixel-icon { opacity: .4; filter: grayscale(.8); }
.inv-tile.blocked::after { content: ''; position: absolute; inset: 0; border-radius: 7px; background: repeating-linear-gradient(135deg, transparent 0 6px, #0a0f1a55 6px 9px); pointer-events: none; }
.inv-tile.selected { border-color: var(--gold); box-shadow: 0 0 0 2px #edce9166, 0 0 16px color-mix(in srgb, var(--item-color) 55%, transparent); }
.inventory-dialog { width: min(1080px, calc(100% - 20px)); max-height: min(92vh, 860px); }
.inventory-layout { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 14px; margin-top: 12px; align-items: start; }
.doll-panel, .bag-panel { padding: 12px; border: 1px solid #34405a; border-radius: 12px; background: linear-gradient(170deg, #1a2336, #111826 70%); }
.doll-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.doll-head h3 { margin: 0; font-size: 1.12rem; color: var(--gold); letter-spacing: -.01em; }
.doll-head p { margin: 2px 0 0; font-size: .75rem; }
.lens-button { display: grid; place-items: center; flex: 0 0 auto; width: 40px; height: 40px; padding: 0; border: 1px solid #8f754f; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #4b3e2b, #1e1a20); cursor: pointer; box-shadow: 0 0 0 3px #edce911a, 0 4px 10px #04081288; }
.lens-button svg, .lens-badge svg { width: 22px; height: 22px; fill: none; stroke: var(--gold); stroke-width: 2.1; stroke-linecap: round; }
.lens-button:hover { box-shadow: 0 0 0 3px #edce9140, 0 0 14px #edce9150; }
.lens-button:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.doll { display: grid; grid-template-columns: 58px minmax(0, 1fr) 58px; gap: 10px; margin-top: 10px; }
.doll-column { display: grid; align-content: start; gap: 4px; min-width: 0; }
.doll-group { font-size: .58rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #8d9bb2; text-align: center; line-height: 1.2; min-height: 2.4em; overflow-wrap: anywhere; }
.doll-slots { display: grid; gap: 6px; }
.doll-figure { position: relative; display: grid; place-items: end center; min-height: 340px; border-radius: 14px; background: radial-gradient(ellipse at 50% 62%, color-mix(in srgb, var(--gold) 14%, #1d2840), #10172400 70%), linear-gradient(180deg, #0f1626, #1a2338); box-shadow: inset 0 0 0 1px #ffffff12, inset 0 -30px 50px #070b1488; overflow: hidden; }
.doll-figure canvas { width: 100%; height: 100%; max-height: 380px; object-fit: contain; }
.doll-level { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); padding: 3px 10px; border: 1px solid #8f754f; border-radius: 999px; background: #1e1a20e6; color: var(--gold); font-size: .74rem; font-weight: 800; }
.doll-power { display: flex; width: 100%; justify-content: space-between; align-items: center; margin-top: 10px; padding: 7px 10px; border: 1px solid #3a4965; border-radius: 8px; background: #121a2a; font-size: .8rem; color: var(--muted); cursor: pointer; }
.doll-power:hover, .doll-power[aria-expanded="true"] { border-color: #95774b; background: #1a2234; }
.doll-power b { color: var(--gold); font-size: .98rem; }
.power-info { margin-left: 3px; color: #e5c285; }
.power-tip-list { display: grid; grid-template-columns: 1fr auto; gap: 5px 15px; margin: 2px 0; }
.power-tip-list dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; color: #ffe3a3; }
.doll-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; margin: 8px 0 0; }
.doll-stats div { padding: 5px 7px; border: 1px solid #323e56; border-radius: 7px; background: #182133; }
.doll-stats dt { font-size: .64rem; color: #8d9bb2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doll-stats dd { margin: 0; font-weight: 800; font-size: .9rem; }
.bag-panel { display: grid; gap: 8px; min-width: 0; }
.bag-filters { padding-bottom: 0; }
.bag-filters label { display: grid; gap: 3px; font-size: .74rem; color: var(--muted); flex: 1 1 150px; }
.bag-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.bag-tools button { flex: 1 1 auto; min-height: 38px; font-size: .82rem; }
.sell-all { border-color: #7c4d43; background: #3a2328; color: #ffd5c8; }
.sell-all:hover:not(:disabled) { background: #4d2c31 !important; }
.bag-panel .shop-feedback { margin: 0; min-height: 1.1em; font-size: .8rem; }
.bag-grid { position: relative; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 5px; max-height: 330px; overflow-y: auto; padding: 6px; border: 1px solid #2d3850; border-radius: 10px; background: #0e1420; scrollbar-color: #536882 #121a29; }
.inv-cell { aspect-ratio: 1; border: 1px solid #222c3e; border-radius: 8px; background: #121a28; box-shadow: inset 0 2px 5px #05091266; }
.bag-empty { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--muted); pointer-events: none; z-index: 1; }
.bag-detail { min-height: 120px; }
.detail-hint { margin: 0; padding: 14px; border: 1px dashed #3a4660; border-radius: 10px; color: var(--muted); font-size: .84rem; text-align: center; }
.detail-card { margin: 0; }
.equipped-effect { margin: 0; font-size: .84rem; font-weight: 700; }
.codex-note { margin: 0; font-size: .78rem; color: #cdb8ff; }
.stats-dialog { width: min(760px, calc(100% - 20px)); }
.lens-badge { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid #8f754f; border-radius: 50%; background: #1e1a20; }
.stats-table-wrap { overflow-x: auto; margin-top: 12px; border: 1px solid #34405a; border-radius: 10px; }
.stats-table { width: 100%; border-collapse: collapse; font-size: .82rem; font-variant-numeric: tabular-nums; }
.stats-table th, .stats-table td { padding: 7px 9px; text-align: right; border-bottom: 1px solid #263049; white-space: nowrap; }
.stats-table thead th { position: sticky; top: 0; background: #1c2538; color: #9fb0c8; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; }
.stats-table th:first-child { text-align: left; color: var(--text); font-weight: 700; }
.stats-table tbody tr:nth-child(even) { background: #ffffff05; }
.stats-table .muted { color: #56637b; }
.stats-total th, .stats-total td { border-bottom: 0; background: #2a2620; color: var(--gold); font-weight: 800; font-size: .9rem; }
.stats-subtitle { margin: 14px 0 6px; font-size: .9rem; color: var(--gold); }
.stats-effects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; margin: 0; padding: 0; list-style: none; }
.stats-effects li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 9px; border: 1px solid #2f3a52; border-radius: 7px; background: #161f30; font-size: .8rem; }
.stats-effects span { color: var(--muted); }
.stats-effects b { text-align: right; }
.stats-effects b.muted { color: #66728a; font-weight: 600; }
.confirm-dialog { width: min(430px, calc(100% - 24px)); }
.confirm-dialog h2 { margin: 0 0 8px; font-size: 1.2rem; }
.confirm-dialog p { margin: 0 0 10px; }
.check-row { display: flex; align-items: center; gap: 8px; margin: 4px 0 10px; font-size: .88rem; cursor: pointer; }
.check-row input { width: 18px; height: 18px; accent-color: #d5a755; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
@media (max-width: 820px) {
  .inventory-layout { grid-template-columns: 1fr; }
  .doll-panel { max-width: 440px; width: 100%; justify-self: center; }
  .bag-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); max-height: none; }
}
@media (max-width: 460px) {
  .bag-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .doll { grid-template-columns: 52px minmax(0, 1fr) 52px; gap: 6px; }
  .doll-group { font-size: .5rem; letter-spacing: .02em; }
  .doll-figure { min-height: 280px; }
  .stats-effects { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .gear-cell:hover, .inv-tile:hover { transform: none; } }
/* Combate automático: a barra de vitórias ocupa a linha inteira */
.combat-controls .objective { grid-column: 1 / -1; }

/* Guildas */
.guild-banner { --banner-field: #2a3550; --banner-color: #edce91; position: relative; display: inline-grid; place-items: center; flex: 0 0 auto; width: 34px; height: 40px; background: linear-gradient(160deg, color-mix(in srgb, var(--banner-field) 70%, #ffffff), var(--banner-field) 45%, color-mix(in srgb, var(--banner-field) 70%, #000000)); clip-path: polygon(0 0, 100% 0, 100% 72%, 50% 100%, 0 72%); filter: drop-shadow(0 3px 5px #04081299); }
.guild-banner::before { content: ''; position: absolute; inset: 0; background: linear-gradient(var(--banner-color), var(--banner-color)) top / 100% 3px no-repeat, linear-gradient(90deg, transparent 46%, #ffffff14 50%, transparent 54%); pointer-events: none; }
.guild-banner .pixel-icon { width: 64%; height: auto; margin-bottom: 18%; image-rendering: auto; filter: drop-shadow(0 1px 1px #000a); }
.guild-banner.medium { width: 50px; height: 60px; }
.guild-banner.large { width: 84px; height: 100px; }
.guild-hero { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 16px; border: 1px solid #3a4965; border-radius: 12px; background: radial-gradient(circle at 10% 30%, #edce9118, transparent 45%), linear-gradient(160deg, #1f2a40, #131a28); }
.guild-hero h3 { margin: 0 0 4px; font-size: 1.45rem; color: var(--gold); letter-spacing: -.02em; overflow-wrap: anywhere; }
.guild-hero p { margin: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.guild-hero-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.guild-hero-actions button { min-height: 34px; font-size: .8rem; }
.guild-bank { display: grid; gap: 2px; padding: 10px 14px; border: 1px solid #5e4a37; border-radius: 10px; background: #282427; text-align: right; }
.guild-bank span { font-size: .7rem; color: #c9b48f; text-transform: uppercase; letter-spacing: .06em; }
.guild-bank b { color: var(--gold); font-size: 1.1rem; white-space: nowrap; }
.guild-columns { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px; margin-top: 12px; align-items: start; }
.guild-card { padding: 12px; border: 1px solid #34405a; border-radius: 12px; background: #151d2c; min-width: 0; }
.guild-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.guild-card h4 { margin: 0; font-size: .98rem; }
.guild-subtitle { margin: 12px 0 6px; font-size: .8rem; color: var(--muted); font-weight: 700; }
.rank-chip { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .68rem; font-weight: 800; letter-spacing: .02em; white-space: nowrap; border: 1px solid; }
.rank-leader { color: #f2cf80; border-color: #8f754f; background: #2e271c; }
.rank-vice { color: #d4bfff; border-color: #6a56a0; background: #251f38; }
.rank-member { color: #a9dcff; border-color: #3f6688; background: #182a3b; }
.rank-novice { color: #b6c1d1; border-color: #4a5468; background: #1d2330; }
.guild-members { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.guild-member { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid #2f3a52; border-radius: 9px; background: #19233a; }
.guild-member.mine { border-color: #8f754f; background: linear-gradient(90deg, #2a2518, #19233a 60%); }
.guild-member-info { display: flex; align-items: center; gap: 8px; min-width: 0; }
.guild-member-name { font-weight: 700; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guild-member-tools { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.guild-member-tools .small, .secondary.small { min-height: 30px; padding: 3px 9px; font-size: .72rem; }
.secondary.promote { color: #a7dcb2; }
.secondary.demote { color: #d9c49b; }
.secondary.danger, .leave-button { color: #ffb4a6; border-color: #6b3c39; }
.confirm-pending { background: #5a2a2a !important; border-color: #c46a5e !important; color: #ffe2dc !important; }
.guild-rank-help { margin-top: 10px; font-size: .78rem; color: var(--muted); }
.guild-rank-help summary { cursor: pointer; }
.guild-rank-help ul { display: grid; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.guild-donate { margin: 0; }
.guild-donate label { flex: 1 1 120px; }
.guild-donations { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; max-height: 220px; overflow-y: auto; }
.guild-donations li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 8px; padding: 6px 8px; border-radius: 7px; background: #19233a; font-size: .8rem; }
.guild-donations b { color: var(--gold); }
.guild-donations small { grid-column: 1 / -1; color: #7f8ca3; font-size: .68rem; }
.guild-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border: 1px solid #34405a; border-radius: 10px; background: #111826; margin-bottom: 12px; }
.guild-tab { min-height: 38px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font: inherit; font-weight: 750; cursor: pointer; }
.guild-tab[aria-selected="true"] { background: linear-gradient(145deg, #2f3d58, #24304a); color: var(--gold); box-shadow: inset 0 0 0 1px #4a5d80; }
.guild-tab:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.guild-search { display: grid; gap: 4px; font-size: .78rem; color: var(--muted); }
.guild-search input, .guild-create-fields input { min-height: 40px; border: 1px solid #435371; background: #121b2c; border-radius: 8px; color: var(--text); font: inherit; padding: 6px 10px; }
#guild-directory-count { margin: 8px 0 6px; }
.guild-directory { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 8px; }
.guild-search input { width: 100%; }
.guild-entry { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px; border: 1px solid #34405a; border-radius: 11px; background: linear-gradient(160deg, #1d2840, #141b2a); }
.guild-entry:hover { border-color: #4f6286; }
.guild-entry-info { display: grid; gap: 3px; min-width: 0; }
.guild-entry-info strong { overflow-wrap: anywhere; line-height: 1.2; }
.guild-seats { display: flex; align-items: center; gap: 6px; }
.guild-seats progress { flex: 1; height: 6px; }
.guild-seats small { color: var(--muted); font-size: .7rem; }
.guild-entry button { min-height: 34px; padding: 4px 12px; font-size: .8rem; }
.guild-create { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 16px; align-items: start; }
.guild-create-preview { display: grid; justify-items: center; gap: 6px; padding: 16px 10px; border: 1px solid #34405a; border-radius: 12px; background: radial-gradient(circle at 50% 30%, #edce9118, transparent 60%), #131a28; text-align: center; }
.guild-create-preview strong { color: var(--gold); overflow-wrap: anywhere; }
.guild-create-fields { display: grid; gap: 10px; }
.guild-create-fields > label { display: grid; gap: 4px; font-size: .8rem; color: var(--muted); }
.banner-picker { display: grid; gap: 8px; }
.banner-group { margin: 0; padding: 0; border: 0; }
.banner-group legend { padding: 0; margin-bottom: 4px; font-size: .74rem; color: var(--muted); font-weight: 700; }
.banner-options { display: flex; flex-wrap: wrap; gap: 5px; }
.banner-option { display: grid; place-items: center; width: 34px; height: 34px; padding: 3px; border: 1px solid #3a4660; border-radius: 8px; background: #172033; cursor: pointer; }
.banner-option .pixel-icon { width: 24px; height: 24px; image-rendering: auto; }
.banner-option.swatch::after { content: ''; width: 20px; height: 20px; border-radius: 50%; background: var(--swatch); box-shadow: inset 0 0 0 1px #ffffff30; }
.banner-option[aria-pressed="true"] { border-color: var(--gold); box-shadow: 0 0 0 2px #edce9155; background: #2a3550; }
.banner-option:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.banner-dialog { width: min(520px, calc(100% - 24px)); }
.banner-dialog-body { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 700px) {
  .guild-hero { grid-template-columns: auto minmax(0, 1fr); }
  .guild-bank { grid-column: 1 / -1; text-align: left; }
  .guild-columns, .guild-create, .banner-dialog-body { grid-template-columns: 1fr; }
  .guild-create-preview, .banner-dialog-body > .guild-banner { justify-self: center; }
}
/* Precisão, evasão e nível do monstro */
.enemy-text { display: grid; line-height: 1.15; }
.battle-name .enemy-level { color: #b9c9e2; font-size: .72rem; font-weight: 700; letter-spacing: .02em; }
.battle-name .enemy-level[data-danger="medium"] { color: #f3c77a; }
.battle-name .enemy-level[data-danger="high"] { color: #ff8f7a; }
.battle-name .enemy-level[data-danger="low"] { color: #9fd8a8; }
.stats { grid-template-columns: repeat(4, 1fr); }
.quick-potion.auto { border-color: #6fcf8c; box-shadow: inset 0 0 0 1px #6fcf8c55; }
.quick-potion.auto::after { content: 'A'; margin-left: 2px; font-size: .62rem; font-weight: 800; color: #9ff0b2; }

/* Loja */
.shop-dialog { width: min(860px, calc(100% - 20px)); padding: 0; overflow: hidden auto; background: linear-gradient(180deg, #18213a, #121827 42%); }
.shop-top { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 14px 16px 12px; background: linear-gradient(180deg, #1b2540, #18213af2); border-bottom: 1px solid #34405a; }
.shop-top .dialog-heading > span { background: linear-gradient(150deg, #4a3c20, #2b2416); border-color: #8a7140; box-shadow: 0 0 18px #edce9133; }
.shop-top .item-meta { margin: 2px 0 0; }
.shop-wallet { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 8px; border: 1px solid #7a6538; border-radius: 999px; background: linear-gradient(145deg, #3a301b, #221c10); color: var(--gold); font-variant-numeric: tabular-nums; }
.shop-wallet .pixel-icon { width: 20px; height: 20px; }
.shop-wallet b { font-size: 1.05rem; }
.shop-wallet small { color: #cdb684; font-size: .75rem; }
.shop-dialog > .shop-feedback { margin: 6px 16px 0; }
.shop-pane { padding: 10px 16px 18px; }
.shop-subtitle { margin: 18px 0 8px; font-size: .95rem; color: #d9e2f0; }
.potion-shelf { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 14px; padding: 14px; border: 1px solid #4b5f52; border-radius: 12px; background: radial-gradient(circle at 12% 30%, #3c6b4a55, transparent 55%), linear-gradient(150deg, #1f3329, #152019); }
.potion-art { position: relative; display: grid; place-items: center; border-radius: 10px; background: radial-gradient(circle, #79e39a3d, #0d1712 70%); border: 1px solid #3f6a4c; min-height: 104px; }
.potion-art .pixel-icon { width: 64px; height: 64px; filter: drop-shadow(0 0 10px #6fe39466); }
.potion-art b { position: absolute; right: 7px; bottom: 6px; padding: 1px 7px; border-radius: 999px; background: #0d1712; border: 1px solid #4f8a62; color: #b9f5c8; font-size: .82rem; font-variant-numeric: tabular-nums; }
.potion-body { display: grid; gap: 7px; align-content: start; min-width: 0; }
.potion-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.potion-title h3 { font-size: 1.12rem; }
.price-tag { padding: 3px 9px; border-radius: 999px; background: #2a2414; border: 1px solid #7a6538; color: var(--gold); font-size: .8rem; font-weight: 750; white-space: nowrap; }
.potion-body .item-meta { margin: 0; }
.potion-meter, .elixir-meter { height: 7px; border-radius: 999px; background: #0c130f; border: 1px solid #355241; overflow: hidden; }
.potion-meter i, .elixir-meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #4fc677, #a6f3b9); transition: width .3s; }
.potion-buy { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.potion-buy button { min-height: 38px; padding: 5px 6px; font-size: .8rem; font-variant-numeric: tabular-nums; }
.auto-potion { margin-top: 10px; padding: 12px 14px; border: 1px solid #34405a; border-radius: 12px; background: #141c2e; }
.auto-potion-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.auto-potion-head h3 { font-size: .98rem; }
.auto-potion-head .item-meta { margin: 2px 0 0; }
.auto-buy-head { margin-top: 12px; padding-top: 12px; border-top: 1px solid #2a3449; }
.switch { flex: none; position: relative; width: 50px; height: 28px; border-radius: 999px; border: 1px solid #4a5672; background: #0f1524; }
.switch span { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #8b97ad; transition: transform .2s, background .2s; }
.switch[aria-checked="true"] { background: #1f4a31; border-color: #5fc884; }
.switch[aria-checked="true"] span { transform: translateX(22px); background: #a6f3b9; }
.threshold-chips, .rarity-chips, .category-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { min-height: 32px; padding: 4px 11px; border-radius: 999px; border: 1px solid #3b4762; background: #182033; color: var(--muted); font-size: .8rem; font-weight: 700; }
.chip[aria-checked="true"] { color: #15110a; background: var(--chip-color, var(--gold)); border-color: var(--chip-color, var(--gold)); }
.chip:disabled { opacity: .45; }
.rarity-chips .chip:not([aria-checked="true"]) { color: var(--chip-color, var(--muted)); }
.elixir-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.elixir-card { display: grid; gap: 9px; padding: 12px; border: 1px solid #3a4965; border-left: 3px solid var(--item-color); border-radius: 11px; background: linear-gradient(155deg, #202c45, #161f31); }
.elixir-card.active { box-shadow: 0 0 0 1px var(--item-color), 0 0 22px #0006; }
.elixir-card .elixir-meter i { background: linear-gradient(90deg, var(--item-color), #fff6); }
.elixir-card .buy-button, .shop-offer .buy-button { justify-self: stretch; }
.elixir-card .item-meta { margin: 0; }
.gear-filters { display: grid; gap: 2px; }
.gear-filters .rarity-chips { margin-top: 2px; }
#shop-tier { margin: 10px 0 8px; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.shop-offer { position: relative; display: grid; align-content: start; gap: 9px; padding: 12px; border: 1px solid #36425c; border-top: 3px solid var(--item-color); border-radius: 11px; background: linear-gradient(160deg, #1f2a42, #151d2e 70%); }
.shop-offer:hover { border-color: var(--item-color); }
.offer-badge { justify-self: start; padding: 2px 8px; border-radius: 999px; background: #1f4a31; border: 1px solid #5fc884; color: #b9f5c8; font-size: .7rem; font-weight: 800; }
.shop-offer .buy-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.shop-offer .coin-mark .pixel-icon { width: 18px; height: 18px; }
.shop-offer .offer-note { margin: 0; min-height: 0; }
.shop-offer .offer-note:empty { display: none; }
@media (max-width: 620px) {
  .shop-top { grid-template-columns: minmax(0, 1fr) auto; }
  .shop-wallet { grid-row: 2; grid-column: 1 / -1; justify-self: start; }
  .potion-shelf { grid-template-columns: 1fr; }
  .potion-art { min-height: 84px; }
  .potion-buy { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .elixir-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

/* ---- Dificuldades, nav e botões redondos ---- */
.nav-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #e25d4f; color: #fff; font-size: .7rem; line-height: 18px; text-align: center; }
.round-button { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid #38445b; background: #182133; color: #dfe8f6; font-weight: 800; }
.round-button:hover { background: #28364c; }
.round-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.round-button svg path:first-child { fill: currentColor; }
#sound-toggle .mute { display: none; }
#sound-toggle[aria-pressed="false"] .mute { display: inline; }
#sound-toggle[aria-pressed="false"] .wave { display: none; }
#sound-toggle[aria-pressed="false"] { color: #8b97ad; }
.difficulty-block { margin: 0 0 12px; padding: 10px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--difficulty-color, #9fe3a8) 40%, #303b33); background: linear-gradient(160deg, color-mix(in srgb, var(--difficulty-color, #9fe3a8) 10%, #1a2220), #161d1a); }
.difficulty-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.difficulty-head b { font-size: .86rem; }
.difficulty-bar { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin: 8px 0 6px; }
.difficulty-chip { min-height: 30px; border-radius: 7px; border: 1px solid color-mix(in srgb, var(--tier-color) 45%, #303b33); background: color-mix(in srgb, var(--tier-color) 12%, #161d1a); color: var(--tier-color); font-weight: 800; font-size: .8rem; }
.difficulty-chip[aria-checked="true"] { background: var(--tier-color); color: #15110a; box-shadow: 0 0 12px color-mix(in srgb, var(--tier-color) 55%, transparent); }
.difficulty-chip:disabled { opacity: .45; filter: grayscale(.6); }
.difficulty-pip { font-size: .76rem; }
#difficulty-note { font-size: .74rem; line-height: 1.3; }
.rebirth-button { margin-top: 8px; }
.rebirth-button.ready { border-color: #e8c786; color: var(--gold); box-shadow: 0 0 14px #e8c78644; animation: rebirth-glow 2.4s ease-in-out infinite; }
@keyframes rebirth-glow { 50% { box-shadow: 0 0 22px #e8c78677; } }

/* ---- Fadas ---- */
.fairy-active { cursor: pointer; }
.fairy-flock { display: flex; flex-wrap: wrap; gap: 6px; }
.fairy-team-effects { display: flex; flex-wrap: wrap; gap: 5px; padding: 0; margin: 0; list-style: none; font-size: .75rem; color: #e5dbfc; }
.fairy-emblem { position: relative; display: grid; place-items: center; width: 48px; height: 48px; flex: 0 0 48px; border-radius: 50%; border: 2px solid var(--rarity-color, #4a5672); background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--fairy-color, #a1a9ce) 38%, #172033), #121a2a 72%); box-shadow: 0 0 14px color-mix(in srgb, var(--rarity-color, #4a5672) 40%, transparent); }
.fairy-emblem .pixel-icon { width: 32px; height: 32px; }
.fairy-emblem.small { width: 38px; height: 38px; flex-basis: 38px; }
.fairy-emblem.small .pixel-icon { width: 25px; height: 25px; }
.fairy-emblem.large { width: 76px; height: 76px; flex-basis: 76px; }
.fairy-emblem.large .pixel-icon { width: 52px; height: 52px; }
.fairy-emblem.empty { border-style: dashed; opacity: .7; }
.fairy-emblem.radiant::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 1px solid var(--rarity-color); opacity: .6; animation: fairy-halo 2.6s ease-in-out infinite; }
@keyframes fairy-halo { 50% { transform: scale(1.12); opacity: .15; } }
.fairy-stars { display: block; color: #ffd36b; font-size: .78rem; letter-spacing: 1px; }
.fairy-rarity { display: block; font-size: .78rem; font-weight: 800; }
.fairy-active h3 small { display: inline; }
.fairy-dialog { width: min(900px, calc(100% - 20px)); }
.fusion-altar { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 14px; align-items: center; margin: 10px 0; padding: 14px; border-radius: 14px; border: 1px solid #4b3f6e; background: radial-gradient(ellipse at 80% 50%, #3a2a5c, #171a2e 65%); }
.fusion-copy h3 { font-family: Georgia, serif; }
.fusion-copy .item-meta { margin: 4px 0 8px; }
.fusion-preview { min-height: 1.3em; color: #e7c8ff; font-weight: 700; font-size: .88rem; }
.fusion-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.fusion-stage { position: relative; width: 200px; height: 200px; justify-self: center; border-radius: 50%; background: radial-gradient(circle, #6d4fa840, transparent 62%), repeating-conic-gradient(from 0deg, #ffffff08 0 10deg, transparent 10deg 30deg); border: 1px dashed #7d67b3; }
.fusion-stage::before { content: ''; position: absolute; inset: 22%; border-radius: 50%; border: 1px solid #b392ff55; animation: altar-spin 14s linear infinite; }
@keyframes altar-spin { to { transform: rotate(360deg); } }
.fusion-slot { position: absolute; display: grid; place-items: center; width: 50px; height: 50px; margin: -25px 0 0 -25px; border-radius: 50%; border: 1px dashed #8d78c7; background: #1b1830; transition: transform .9s cubic-bezier(.6,-0.2,.3,1.2), opacity .9s; }
.fusion-slot.filled { border-style: solid; border-color: #c9b1ff; }
.fusion-slot[data-slot="0"] { left: 50%; top: 14%; }
.fusion-slot[data-slot="1"] { left: 82%; top: 72%; }
.fusion-slot[data-slot="2"] { left: 18%; top: 72%; }
.fusion-core { position: absolute; left: 50%; top: 50%; display: grid; place-items: center; width: 0; height: 0; }
.fusion-stage.fusing .fusion-slot[data-slot="0"] { transform: translate(0, 72px) rotate(240deg) scale(.4); opacity: .2; }
.fusion-stage.fusing .fusion-slot[data-slot="1"] { transform: translate(-64px, -44px) rotate(240deg) scale(.4); opacity: .2; }
.fusion-stage.fusing .fusion-slot[data-slot="2"] { transform: translate(64px, -44px) rotate(240deg) scale(.4); opacity: .2; }
.fusion-stage.fusing { animation: altar-shake .25s linear 3 .6s; }
.fusion-stage.fusing::after { content: ''; position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px; border-radius: 50%; background: #fff; box-shadow: 0 0 40px 20px #d8b8ff; animation: altar-flash 1.1s ease-in forwards; }
@keyframes altar-flash { 0% { transform: scale(.2); opacity: 0; } 70% { opacity: .9; } 100% { transform: scale(9); opacity: 0; } }
@keyframes altar-shake { 25% { transform: translate(2px, -1px); } 75% { transform: translate(-2px, 1px); } }
.fusion-stage.born .fusion-core > * { animation: fairy-born .9s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes fairy-born { from { transform: scale(0) rotate(-90deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }
.fairy-filters { margin: 8px 0; }
.fairy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.fairy-card { display: grid; gap: 8px; padding: 11px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--rarity-color) 45%, #303b48); background: linear-gradient(160deg, color-mix(in srgb, var(--rarity-color) 10%, #1d2438), #151b2a 75%); }
.fairy-card.active { box-shadow: 0 0 0 2px var(--gold); }
.fairy-card.chosen { box-shadow: 0 0 0 2px #c9b1ff, 0 0 18px #8d6bff66; }
.fairy-card-head { display: flex; gap: 10px; align-items: center; }
.fairy-card-head > div { flex: 1; min-width: 0; }
.fairy-card .item-meta { margin: 0; font-size: .8rem; }
.fairy-badge { padding: 2px 8px; border-radius: 999px; background: var(--gold); color: #1a140a; font-size: .7rem; }
.fairy-codex { justify-self: start; padding: 1px 7px; border-radius: 999px; border: 1px solid #6c7fc9; color: #b6c6ff; font-size: .7rem; font-weight: 700; }
.fairy-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.fairy-actions button { min-height: 34px; padding: 4px 6px; font-size: .78rem; }

/* ---- Códice: mercado do registro ---- */
.codex-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.codex-actions > button { flex: 1; }
.item-card.market-target { box-shadow: 0 0 0 2px #87a9d2; }
.codex-market { margin: 8px 0 12px; padding: 12px; border-radius: 12px; border: 1px solid #4b6389; background: #142036; }
.codex-market-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.codex-market-list { display: grid; gap: 6px; }
.codex-offer { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 7px 9px; border-radius: 9px; background: #1b2944; border: 1px solid #2e4062; }
.codex-offer strong { display: block; font-size: .86rem; }
.secondary.small { min-height: 30px; padding: 3px 9px; font-size: .78rem; }

/* ---- Itens: etiquetas, forja e conjuntos ---- */
.item-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.item-tag { padding: 1px 7px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--tag-color, #8a99b8) 60%, transparent); color: var(--tag-color, #b6c3dc); font-size: .68rem; font-weight: 750; }
.item-tag.refine { --tag-color: #ffcf8a; }
.item-tag.trophy { --tag-color: #ff9d8a; }
.forge-panel { margin-top: 10px; padding: 10px; border-radius: 10px; border: 1px solid #6b5636; background: linear-gradient(160deg, #2c2418, #1b1912); }
.forge-title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 7px; color: #ffcf8a; }
.forge-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.forge-button { min-height: 36px; padding: 4px 6px; font-size: .76rem; }
.expand-button { margin-left: 8px; }

/* ---- Mochila, cupom, missões, renascimento, retorno, tutorial ---- */
.expand-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin: 10px 0; }
.expand-option { display: grid; gap: 2px; padding: 10px; border-radius: 10px; border: 1px solid #4c402a; background: #28241a; color: var(--gold); text-align: center; }
.expand-option b { font-size: 1.2rem; }
.expand-option span { font-size: .78rem; color: #e9dcc0; }
.expand-option:hover:not(:disabled) { background: #3a3223; }
.expand-option:disabled { opacity: .45; }
.coupon-form { display: flex; gap: 8px; margin: 10px 0; }
.coupon-form input { flex: 1; min-height: 42px; padding: 6px 12px; border-radius: 8px; border: 1px solid #3b4a3e; background: #101614; color: var(--text); font: inherit; text-transform: uppercase; letter-spacing: .08em; }
.coupon-used { margin: 0; padding-left: 18px; color: var(--muted); font-size: .82rem; }
.shop-feedback.worse { color: #ffb4a6; }
.login-reward { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 10px 0; padding: 12px; border-radius: 12px; border: 1px solid #4b6389; background: linear-gradient(150deg, #1f3354, #152035); }
.login-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 8px; }
.login-day { display: grid; place-items: center; padding: 4px 2px; border-radius: 7px; border: 1px solid #34466a; background: #121b2d; font-size: .68rem; color: var(--muted); }
.login-day b { font-size: .7rem; }
.login-day.done { background: #1f4a31; border-color: #5fc884; color: #c6f5d3; }
.login-day.today { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 10px #e8c78655; }
.mission-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.mission { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid #34405a; background: #161e30; }
.mission.ready { border-color: #5fc884; }
.mission.claimed { opacity: .6; }
.mission-info { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; }
.mission-info strong { grid-column: 1 / -1; font-size: .9rem; }
.mission-info progress { width: 100%; }
.rebirth-details { margin: 8px 0 10px; padding-left: 18px; color: #ffe3a8; }
.return-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 12px 0; }
.return-list div { padding: 8px 10px; border-radius: 9px; background: #1d2621; border: 1px solid #303b33; }
.return-list dt { font-size: .74rem; color: var(--muted); }
.return-list dd { margin: 0; font-weight: 800; color: var(--gold); }
.tutorial-dialog { text-align: center; }
.tutorial-art { display: grid; place-items: center; margin: 4px auto 10px; width: 86px; height: 86px; border-radius: 50%; border: 1px solid #655536; background: radial-gradient(circle, #3a3322, #1d1a12); }
.tutorial-art .pixel-icon { width: 52px; height: 52px; }
.tutorial-dialog h2 { margin: 4px 0 8px; }
.tutorial-dots { display: flex; justify-content: center; gap: 6px; margin: 12px 0; }
.tutorial-dots i { width: 8px; height: 8px; border-radius: 50%; background: #3b4a3e; }
.tutorial-dots i.on { background: var(--gold); }
.tutorial-dialog .confirm-actions { justify-content: center; }

/* ---- Mercado ---- */
.market-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin: 10px 0; padding: 4px; border: 1px solid #34405a; border-radius: 11px; background: #0f1524; }
.market-tab { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-weight: 750; font-size: .86rem; }
.market-tab .pixel-icon { width: 18px; height: 18px; }
.market-tab[aria-selected="true"] { background: linear-gradient(145deg, #33425f, #263350); color: var(--gold); box-shadow: inset 0 0 0 1px #50638a; }
.market-search { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px; }
.market-search input, .market-search select, .market-list-form input { min-height: 40px; padding: 6px 10px; border-radius: 8px; border: 1px solid #3a4861; background: #0f1524; color: var(--text); font: inherit; }
.market-filters { display: grid; gap: 0; margin-bottom: 10px; }
.market-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.market-card { display: grid; gap: 7px; padding: 11px; border-radius: 12px; border: 1px solid #36425c; border-top: 3px solid var(--item-color); background: linear-gradient(160deg, #1f2a42, #151d2e 70%); }
.market-card:hover { border-color: var(--item-color); }
.market-card-head { display: flex; gap: 10px; align-items: center; }
.market-card-head > div { display: grid; min-width: 0; }
.market-card-head .item-name { font-size: .9rem; }
.market-effect { margin: 0; font-size: .8rem; }
.market-seller { margin: 0; font-size: .72rem; color: #8592ab; }
.market-card-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.market-price { display: inline-flex; align-items: center; gap: 5px; color: var(--gold); font-weight: 800; }
.market-price .pixel-icon { width: 18px; height: 18px; }
.market-pages { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; }
.market-sell-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.market-sell-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(220px, 1fr); gap: 12px; margin-top: 10px; }
.market-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; max-height: 320px; overflow: auto; padding: 6px; border-radius: 10px; background: #0f1524; border: 1px solid #2b3650; }
.market-pick-tile { position: relative; display: grid; place-items: center; height: 52px; border-radius: 8px; border: 1px solid #2e3a55; background: #172036; }
.market-pick-tile[aria-selected="true"] { box-shadow: 0 0 0 2px var(--gold); }
.market-list-form { display: grid; gap: 8px; align-content: start; padding: 10px; border-radius: 10px; border: 1px solid #36425c; background: #151d2e; }
.market-list-form label { display: grid; gap: 4px; }
.market-history { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.market-history-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 7px 9px; border-radius: 9px; background: #172036; }
.market-history-row strong { display: block; font-size: .85rem; }
@media (max-width: 620px) {
  .fusion-altar { grid-template-columns: 1fr; }
  .market-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .market-search { grid-template-columns: 1fr 1fr; }
  .market-search input { grid-column: 1 / -1; }
  .market-sell-layout { grid-template-columns: 1fr; }
  .forge-actions { grid-template-columns: 1fr; }
  .return-list { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .fusion-slot, .fusion-stage::before, .fairy-emblem.radiant::after, .rebirth-button.ready { transition: none; animation: none; }
}
.codex-bulk { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; margin: .2rem 0 .4rem; }
.doll-sets { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 155px), 1fr)); gap: 7px; margin: 8px 0; }
.set-card {
  display: grid; align-content: start; gap: 6px; min-width: 0; padding: 8px;
  border: 1px solid #3a4558; border-radius: 8px; background: #131b2a;
}
.set-card.set-active { border-color: color-mix(in srgb, var(--region-color) 54%, #3a4558); }
.set-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 3px 7px; }
.set-head b { color: color-mix(in srgb, var(--region-color) 75%, #fff); font-size: .78rem; }
.set-count { color: #dce4f3; font-size: .7rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.set-meter { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 3px; }
.set-meter i { height: 4px; border-radius: 2px; background: #374257; }
.set-meter i:nth-child(2n):not(:last-child) { margin-right: 3px; }
.set-meter .filled { background: var(--region-color); }
.set-now, .set-next { margin: 0; font-size: .73rem; line-height: 1.3; }
.set-now { color: #edf0f8; font-weight: 700; }
.set-next { color: var(--muted); }
.item-details .set-card { margin-top: 8px; }
.set-tiers { list-style: none; display: grid; gap: 4px; margin: 0; padding: 0; }
.set-tiers li {
  display: grid; grid-template-columns: max-content minmax(0, 1fr) auto; align-items: center; gap: 5px;
  border: 1px solid transparent; border-radius: 5px; background: #1b2638; color: #b9c6dc; padding: 4px 5px; font-size: .72rem;
}
.set-tiers .set-tier-current {
  border-color: color-mix(in srgb, var(--region-color) 55%, #3a4558); color: #fff2d5;
  background: color-mix(in srgb, var(--region-color) 16%, #1b2638);
}
.set-status { font-size: .65rem; font-weight: 750; }

/* Novidades (notas de atualização). */
.patch-list { display: grid; gap: 10px; margin-top: 10px; }
.patch-section { padding: 10px 14px; border: 1px solid #3a4866; border-radius: 9px; background: #162036; }
.patch-section h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 1rem; }
.patch-tag { padding: 1px 7px; border-radius: 999px; font-size: .68rem; font-weight: 700; color: #10141f; background: #ff5fa2; }
.patch-section ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.patch-section li { font-size: .86rem; color: #cfd8ee; line-height: 1.4; }
.patch-section strong { color: #ffe3a3; }

/* Cartas reveladas: efeitos por raridade (r0 comum … r5 mítico). */
.reveal-card { position: relative; overflow: visible; }
.reveal-card.hint:not([aria-pressed=true]) .reveal-face { animation: card-hint 1.1s ease-in-out infinite; border-color: var(--card-color); }
@keyframes card-hint { 50% { box-shadow: 0 0 18px var(--card-color), inset 0 0 0 3px #172641; } }
.reveal-card.burst .reveal-back { animation: card-pop .5s cubic-bezier(.2,1.6,.4,1); }
@keyframes card-pop { 0% { scale: .9; } 60% { scale: 1.06; } 100% { scale: 1; } }
.reveal-card.r3.burst .reveal-back { box-shadow: 0 0 16px color-mix(in srgb, var(--card-color) 60%, transparent); }
.reveal-card.r4.burst .reveal-back { box-shadow: 0 0 24px #ffcb78aa, inset 0 0 18px #ffcb7844; }
.reveal-card.r5.burst .reveal-back { border: 2px solid transparent; background: linear-gradient(#171f31, #171f31) padding-box, conic-gradient(from var(--spin, 0deg), #ff5fa2, #ffcb78, #7ff5ff, #9d7bff, #ff5fa2) border-box; animation: card-pop .5s cubic-bezier(.2,1.6,.4,1), mythic-border 3s linear infinite; box-shadow: 0 0 30px #ff5fa2aa; }
@property --spin { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes mythic-border { to { --spin: 360deg; } }
.reveal-burst { position: absolute; left: 50%; top: 45%; width: 0; height: 0; pointer-events: none; z-index: 3; }
.reveal-burst i { position: absolute; width: var(--s); height: var(--s); border-radius: 50%; background: var(--card-color); box-shadow: 0 0 6px var(--card-color); animation: spark 1.1s ease-out forwards; }
.reveal-card.r5 .reveal-burst i:nth-child(3n) { background: #7ff5ff; } .reveal-card.r5 .reveal-burst i:nth-child(3n+1) { background: #ffcb78; }
@keyframes spark { from { transform: rotate(var(--a)) translateX(0); opacity: 1; } to { transform: rotate(var(--a)) translateX(var(--d)); opacity: 0; } }
.reveal-rays { position: absolute; inset: -18px; z-index: -1; border-radius: 50%; pointer-events: none; background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--card-color) 55%, transparent) 0 8deg, transparent 8deg 24deg); mask: radial-gradient(circle, #000 25%, transparent 70%); animation: rays 6s linear infinite, rays-in .6s ease-out; }
@keyframes rays { to { rotate: 360deg; } }
@keyframes rays-in { from { opacity: 0; scale: .4; } }
#reveal-dialog.flash-legendary { animation: flash-gold .9s ease-out; }
#reveal-dialog.flash-mythic { animation: flash-mythic 1.4s ease-out, shake .45s ease-in-out; }
@keyframes flash-gold { 0% { box-shadow: 0 0 0 0 #ffcb78; } 20% { box-shadow: 0 0 90px 30px #ffcb78aa; } 100% { box-shadow: none; } }
@keyframes flash-mythic { 0% { box-shadow: 0 0 0 0 #ff5fa2; } 25% { box-shadow: 0 0 120px 40px #ff5fa2aa, 0 0 60px 10px #7ff5ff88; } 100% { box-shadow: none; } }
@keyframes shake { 20% { translate: -6px 2px; } 40% { translate: 5px -3px; } 60% { translate: -4px 1px; } 80% { translate: 3px 0; } }
.reveal-rarity { font-weight: 700; color: var(--card-color); text-transform: uppercase; letter-spacing: .06em; }
.reveal-actions { gap: 8px; flex-wrap: wrap; justify-content: center; }
@media (prefers-reduced-motion: reduce) { .reveal-card.hint .reveal-face, .reveal-rays, .reveal-card.r5.burst .reveal-back, #reveal-dialog.flash-legendary, #reveal-dialog.flash-mythic { animation: none; } }

/* Estrelas dos pets e botão Combinar o máximo. */
.pet-stars { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 3px; }
.pet-star-text { color: #ffd36b; letter-spacing: 1px; font-size: .9rem; }
.pet-star-max { font-size: .72rem; color: var(--muted); }
button.small { min-height: 28px; padding: 3px 9px; font-size: .74rem; }
.fusion-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.draw-lock { justify-self: start; padding: 5px 10px; border: 1px dashed #4a5a7a; border-radius: 7px; color: var(--muted); font-size: .78rem; }
.codex-power { padding: 4px 10px; border-radius: 999px; background: linear-gradient(90deg, #3b2f6b, #24345a); color: #e6dcff; font-size: .82rem; }

/* ---- Forja mítica ---- */
.mythic-button { border-color: #ff5fa2aa; color: #ffb3d4; }
.mythic-button:hover { box-shadow: 0 0 12px #ff5fa255; }
.mythic-dialog { width: min(640px, 94vw); }
.mythic-glyph { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; font-size: 1.3rem; color: #fff;
  background: radial-gradient(circle, #ff5fa2, #7a2bd1); box-shadow: 0 0 14px #ff5fa288; }
.mythic-steps { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.mythic-step { display: grid; grid-template-columns: 32px 1fr auto; gap: 12px; align-items: start; padding: 12px;
  border: 1px solid #ff5fa233; border-radius: 10px; background: linear-gradient(135deg, #ff5fa20f, transparent 60%); }
.mythic-step h3 { margin: 0 0 4px; font-size: 1rem; }
.step-number { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-weight: 700;
  background: #ff5fa2; color: #1a0b14; }
.mythic-stock { display: grid; justify-items: center; min-width: 76px; padding: 6px 10px; border-radius: 8px; background: #0006; }
.mythic-stock b { font-size: 1.4rem; color: #ff8cc0; }
.mythic-stock span { font-size: .75rem; opacity: .75; }
.mythic-meter { height: 8px; margin: 8px 0 4px; border-radius: 4px; background: #ffffff14; overflow: hidden; }
.mythic-meter span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #f2b33d, #ff5fa2); transition: width .3s; }
.mythic-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.mythic-odds { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin-top: 10px; }
.mythic-odd { position: relative; display: grid; justify-items: center; padding: 6px 2px 4px; border-radius: 6px; background: #ffffff0d; overflow: hidden; }
.mythic-odd::before { content: ''; position: absolute; inset: auto 0 0; height: var(--odd); background: #ff5fa233; }
.mythic-odd b, .mythic-odd small { position: relative; }
.mythic-odd.rare b { color: #ffd36b; text-shadow: 0 0 6px #ffd36b88; }
.mythic-result:empty { display: none; }
.mythic-result { display: grid; place-items: center; margin-top: 12px; }
.mythic-card { position: relative; display: grid; justify-items: center; gap: 4px; padding: 16px 28px; border-radius: 12px; overflow: hidden;
  border: 2px solid var(--item-color); background: #1a0b14; box-shadow: 0 0 24px #ff5fa266; animation: card-pop .5s ease-out both; }
.mythic-card b { color: var(--item-color); font-size: 1.05rem; position: relative; }
.mythic-card small, .mythic-card-stars { position: relative; }
.mythic-card-stars { color: #ffd36b; letter-spacing: 2px; }
.mythic-card-glow { position: absolute; inset: -50%; background: conic-gradient(from 0deg, transparent, #ff5fa255, transparent 30%); animation: mythic-spin 3s linear infinite; }
.mythic-card.s5, .mythic-card.s6 { box-shadow: 0 0 40px #ffd36b99, 0 0 80px #ff5fa255; }
@keyframes mythic-spin { to { transform: rotate(360deg); } }
@media (max-width: 560px) { .mythic-step { grid-template-columns: 28px 1fr; } .mythic-stock { grid-column: 2; justify-self: start; } }

/* ---- Habilidades ---- */
#skill-dialog { width: min(920px, 96vw); }
.skill-type { --type: #e8c786; display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .72rem; font-weight: 700;
  color: var(--type); border: 1px solid color-mix(in srgb, var(--type) 55%, transparent); background: color-mix(in srgb, var(--type) 14%, transparent); }
.t-power { --type: #ff9a6b; } .t-area { --type: #7fd3ff; } .t-vortex { --type: #c9a2ff; } .t-boost { --type: #8fe3a8; }
.skill-loadout { margin-top: 4px; padding: 12px; border: 1px solid #4c402a; border-radius: 12px; background: linear-gradient(180deg, #28241a, #1a1d18); }
.skill-loadout-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.skill-count { color: var(--gold); font-size: .85rem; font-weight: 700; }
.skill-slots { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.skill-slot { position: relative; display: grid; justify-items: center; align-content: center; gap: 4px; min-height: 92px; padding: 8px 4px;
  border: 1px dashed var(--line); border-radius: 10px; background: #0003; color: var(--muted); }
.skill-slot.filled { border: 1px solid color-mix(in srgb, var(--type) 60%, transparent); color: var(--text);
  background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--type) 22%, transparent), #0004 70%); }
.skill-slot.filled:hover { border-color: #ff8298; box-shadow: 0 0 0 1px #ff829866 inset; }
.skill-slot.filled:hover::after { content: '×'; position: absolute; top: 2px; right: 6px; color: #ff8298; font-weight: 700; }
.skill-slot small { font-size: .7rem; line-height: 1.15; text-align: center; overflow-wrap: anywhere; }
.skill-slot-number { position: absolute; top: 4px; left: 6px; font-size: .7rem; font-weight: 700; color: var(--gold); }
.skill-legend { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 6px 10px; align-items: center; margin: 12px 0 4px; font-size: .82rem; }
.skill-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 6px; }
.skill-filter button { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: .85rem; }
.skill-filter button[aria-checked="true"] { border-color: var(--gold); color: var(--gold); background: #2e291d; }
.skill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.skill-card { --type: #e8c786; position: relative; display: grid; gap: 8px; align-content: start; padding: 12px; border-radius: 12px;
  border: 1px solid var(--line); background: linear-gradient(160deg, color-mix(in srgb, var(--type) 10%, var(--surface)), var(--panel) 65%);
  transition: transform .15s, border-color .15s, box-shadow .15s; }
.skill-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--type) 60%, transparent); }
.skill-card.active { border-color: var(--gold); box-shadow: 0 0 0 1px #e8c78655 inset, 0 0 14px #e8c78622; }
.skill-card.locked { filter: saturate(.35); opacity: .78; }
.skill-card-head { display: flex; align-items: center; gap: 10px; }
.skill-card-title { display: grid; gap: 3px; flex: 1; min-width: 0; }
.skill-badge { padding: 2px 7px; border-radius: 6px; font-size: .7rem; font-weight: 700; color: #1a1408; background: var(--gold); white-space: nowrap; }
.skill-desc { font-size: .88rem; color: var(--text); }
.skill-stats { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 0; font-size: .8rem; }
.skill-stats dt { color: var(--muted); }
.skill-stats dd { margin: 0; text-align: right; font-weight: 600; }
.skill-lock { padding: 5px 8px; border-radius: 6px; font-size: .8rem; color: #ffd36b; background: #0005; }
.skill-empty { grid-column: 1 / -1; text-align: center; padding: 18px; }
@media (max-width: 620px) { .skill-slots { grid-template-columns: repeat(3, minmax(0, 1fr)); } .skill-legend { grid-template-columns: auto 1fr; } }

/* ---- Polimento geral ---- */
button.primary, button.secondary { transition: filter .15s, transform .1s, box-shadow .15s, border-color .15s; }
button.primary:hover:not(:disabled), button.secondary:hover:not(:disabled) { filter: brightness(1.12); box-shadow: 0 2px 10px #0006; }
button.primary:active:not(:disabled), button.secondary:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .55; }
dialog[open] { animation: dialog-in .18s ease-out; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@media (prefers-reduced-motion: reduce) { dialog[open], .mythic-card, .mythic-card-glow { animation: none; } }
.forge-warning { margin-top: 6px; color: #ffc27a; }
#fusion-all.danger { color: #ffd0c6; border-color: #b4574c; background: #4a2420; }

/* Cabeçalho ilustrado: panorama dos territórios (web/banner.js), logotipo dourado e botões de bronze em Cinzel. */
.top { position: relative; isolation: isolate; overflow: hidden; min-height: 128px; padding-block: 14px; row-gap: 12px; background: #0b0f1a; border-bottom: 2px solid #6d5430; box-shadow: 0 1px 0 #1d1408, 0 6px 18px #0008; }
.top::after { content: ''; position: absolute; inset: auto 0 0; height: 2px; background: linear-gradient(90deg, transparent, #f3d38c 30%, #fff1c9 50%, #f3d38c 70%, transparent); opacity: .55; z-index: -1; }
.banner-art { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; pointer-events: none; }
.map-level-required { color: #ffd099; font-size: .72rem; }
.rare-announcement[hidden] { display: none; }
.rare-announcement {
  --notice-accent: #f0c578;
  position: fixed; inset: 12px 12px auto auto; z-index: 2000; margin: 0;
  box-sizing: border-box; width: min(340px, calc(100vw - 24px)); padding: 10px 12px;
  display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 2px 9px;
  align-items: center; color: #fff4db; background: linear-gradient(135deg, #35271b, #161824 70%);
  border: 1px solid var(--notice-accent); border-radius: 10px; box-shadow: 0 6px 22px #0009;
  pointer-events: none; overflow-wrap: anywhere; font-size: .82rem;
}
.rare-announcement.mythic { --notice-accent: #ff86bd; background: linear-gradient(135deg, #3b2036, #171827 70%); }
.rare-announcement .pixel-icon { width: 24px; height: 24px; }
.rare-announcement-items { grid-column: 2; display: flex; flex-wrap: wrap; gap: 2px 8px; }
.terrain-footer {
  position: relative; isolation: isolate; overflow: hidden; min-height: clamp(110px, 13vw, 200px);
  display: grid; place-items: center; border-top: 1px solid #a17d46;
  background: #151527 url("assets/territorios-cartoon.png") center 38% / cover;
}
.terrain-footer::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, #0c101b75, #0c101b10 42%, #0c101bea), radial-gradient(ellipse at center, #21193780, transparent 55%);
}
.terrain-footer-mark {
  display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
  border: 1px solid #e7bd73; background: radial-gradient(circle, #45314e, #151624);
  box-shadow: 0 0 0 5px #13111c90, 0 6px 18px #0009;
}
.terrain-footer-mark .pixel-icon { width: 34px; height: 34px; }

/* Painéis de aventura */
.right > .panel {
  min-width: 0;
  border-color: color-mix(in srgb, var(--card-accent) 32%, #293248);
  background: radial-gradient(ellipse at 90% 0, color-mix(in srgb, var(--card-accent) 15%, #181f30), transparent 62%), linear-gradient(#161e2e, #111824);
}
.right > .character { --card-accent: #cba876; }
.right > .familiar { --card-accent: #b49be8; }
.right > .inventory { --card-accent: #dbab61; }
.right > .buffs { --card-accent: #76bdb3; }
.right .section-head button.text-button {
  font-size: .73rem; text-decoration: none; padding: 4px 8px; border: 1px solid #ffffff26;
  border-radius: 7px; background: #0e1426a6;
}
.character .hero-card { margin-bottom: 10px; padding: 8px; border-radius: 9px; background: #0c1322a8; border: 1px solid #bd9b6433; }
.character .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.character .stats > div {
  justify-content: space-between; gap: 3px; min-width: 0; padding: 6px 3px;
  border: 1px solid #35435a; background: linear-gradient(#243047, #1a2437);
}
.character .stats dt { display: grid; justify-items: center; gap: 2px; font-size: .69rem; }
.character .stats dt .pixel-icon { display: block; width: 16px; height: 16px; }
.character .stats dd { font-size: .94rem; overflow-wrap: anywhere; }
.hero-actions, .equipment-actions { display: grid; gap: 5px; }
.hero-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.equipment-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hero-actions .secondary, .equipment-actions .bag-button { min-width: 0; margin: 0; padding-inline: 6px; font-size: .75rem; text-wrap: balance; }
.hero-actions .secondary { min-height: 60px; display: grid; grid-template-rows: 18px 1fr; place-items: center; gap: 3px; padding-inline: 3px; line-height: 1.15; font-size: .7rem; }
.hero-actions .pixel-icon { display: block; width: 17px; height: 17px; }
.equipment-actions .bag-button { flex-wrap: wrap; justify-content: center; }
.equipment-actions .bag-button b { margin-left: 0; font-size: .73rem; }
.familiar .fairy-team { display: grid; gap: 9px; width: 100%; }
.fairy-team-effects li { padding: 3px 6px; border: 1px solid #a88dec44; border-radius: 5px; background: #211a39; }
.right .gear-cell { border-radius: 7px; padding: 2px 2px 8px; }
.right .gear-cell .pixel-icon { width: 100%; height: 100%; }
.right .gear-cell .inv-level, .right .gear-cell .inv-stars { font-size: clamp(.44rem, .58vw, .63rem); }
.right .equipped-total {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 8px;
  margin: 8px 0; padding: 6px 8px; text-align: left; border: 1px solid #ab874455; border-radius: 7px; background: #211c1a;
}
.right .equipped-total b { font-variant-numeric: tabular-nums; }
.right .equipped-total small { grid-column: 1 / -1; color: #c6b99f; font-weight: 500; }
.buffs #active-buffs { display: grid; gap: 5px; }
.buffs .buff-row { border: 1px solid #344053; border-radius: 7px; padding: 5px 6px; background: #111b2d; }
.buffs .buff-row.buff-active { border-color: #62ad84; background: #1b302d; }
.buffs .buff-row > span:last-child { border-radius: 5px; padding: 3px 5px; background: #0e1521; font-size: .72rem; }
@media (max-width: 430px) {
  .right .gear-cell .inv-level, .right .gear-cell .inv-stars { font-size: .55rem; }
}
.top .brand { gap: 12px; }
.top .sigil { width: 50px; height: 54px; border: 0; border-radius: 0; background: none; box-shadow: none; filter: drop-shadow(0 3px 4px #000c) drop-shadow(0 0 10px #f0c56a40); }
.top .sigil svg { width: 100%; height: 100%; }
.logo-title { font-family: 'Cinzel Decorative', 'Cinzel', Georgia, serif !important; font-weight: 900 !important; font-size: clamp(1.25rem, 2.2vw, 1.8rem) !important; letter-spacing: .01em !important; line-height: 1.05; color: #f6d68a;
  background: linear-gradient(180deg, #fffbe8 0%, #ffe6a3 30%, #e7a93f 58%, #b8701f 78%, #f5cf7c 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 0 #3a1c05) drop-shadow(0 -1px 0 #3a1c05) drop-shadow(1px 0 0 #3a1c05) drop-shadow(-1px 0 0 #3a1c05) drop-shadow(0 3px 4px #000d); }
.top .brand small { font-family: 'Cinzel', Georgia, serif; font-weight: 700; font-size: .68rem; letter-spacing: .24em; color: #e2cfa4; text-shadow: 0 1px 2px #000, 0 0 8px #000a; margin-top: 3px; }
.top .top-nav { gap: 5px; flex-wrap: wrap; }
.top .nav-button { white-space: nowrap; }
.top .nav-button, .top .mode-button, .top .market-button { font-family: 'Cinzel', Georgia, serif; font-weight: 700; font-size: .78rem; letter-spacing: 0; padding: 5px 9px; gap: 5px; color: #f6e2b3; text-shadow: 0 1px 1px #000c;
  background: linear-gradient(180deg, #4a3522 0%, #2b1d12 55%, #1e140c 100%); border: 1px solid #a98149; border-radius: 6px;
  box-shadow: inset 0 1px 0 #ffe2a04d, inset 0 -2px 0 #0007, 0 2px 4px #0009; transition: filter .15s, transform .15s, border-color .15s; }
.top .nav-button:hover, .top .mode-button:hover, .top .market-button:hover:not(:disabled) { background: linear-gradient(180deg, #6a4b2c 0%, #3c2816 60%, #24180d 100%); border-color: #f1c977; filter: brightness(1.08); transform: translateY(-1px); }
.top .nav-button:active, .top .mode-button:active, .top .market-button:active { transform: translateY(1px); }
.top .market-button { color: #ffd98a; border-color: #d3a14f; background: linear-gradient(180deg, #7a3a1f 0%, #4b2010 60%, #2d1209 100%); }
.top .market-button:hover:not(:disabled) { background: linear-gradient(180deg, #96492a 0%, #5d2a15 60%, #36160b 100%); }
.top .nav-badge { font-family: 'Segoe UI', system-ui, sans-serif; }
.top .gold, .top .presence { background: #0d1220c4; backdrop-filter: blur(3px); box-shadow: 0 2px 6px #0007; }
.top .gold { border-color: #8a6a3e; }
.top .round-button { background: radial-gradient(circle at 50% 35%, #4a3522, #1e140c); border-color: #a98149; color: #f6e2b3; box-shadow: inset 0 1px 0 #ffe2a04d, 0 2px 4px #0009; }
.top .round-button:hover { background: radial-gradient(circle at 50% 35%, #6a4b2c, #2b1d12); border-color: #f1c977; }
@media (max-width: 650px) {
  .top { min-height: 0; padding-block: 9px; row-gap: 8px; }
  .top .sigil { width: 38px; height: 42px; }
  .logo-title { font-size: 1.22rem !important; }
  .top .brand small { font-size: .58rem; letter-spacing: .18em; }
  .top .nav-button, .top .mode-button, .top .market-button { font-size: .7rem; letter-spacing: 0; padding: 4px 7px; min-height: 32px; }
  .top .top-nav { gap: 4px; }
}
@media (prefers-reduced-motion: reduce) { .top .nav-button, .top .mode-button, .top .market-button { transition: none; } .top .nav-button:hover, .top .mode-button:hover, .top .market-button:hover:not(:disabled) { transform: none; } }

/* Menu e painel do jogador */
.top { z-index: 5; overflow: visible; }
.player-hud {
  display: grid; grid-template-columns: minmax(115px, auto) minmax(130px, 190px) auto;
  align-items: center; gap: 12px; padding: 8px 10px; min-width: 0;
  border: 1px solid #80613c; border-radius: 12px;
  background: linear-gradient(135deg, #222332f5, #121824f5); box-shadow: 0 4px 18px #0009;
}
.hud-identity {
  display: flex; gap: 8px; align-items: center; max-width: 208px; min-width: 0;
  border: 0; background: transparent; color: #f5dfad; padding: 0; text-align: left; cursor: pointer;
}
.hud-identity > span:last-child { display: grid; gap: 2px; min-width: 0; }
.hud-identity strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hud-identity small { color: #bad5ec; }
.player-portrait {
  display: inline-grid; place-items: center; width: 45px; height: 45px; flex: 0 0 auto;
  border: 1px solid #be9455; border-radius: 50%; overflow: hidden;
  background: radial-gradient(ellipse at 50% 40%, #48506b, #141927 75%);
  box-shadow: inset 0 0 0 2px #131927, 0 2px 5px #0008;
}
.player-portrait canvas { width: 100%; height: 100%; }
.hud-bars { display: grid; gap: 5px; min-width: 0; }
.hud-meter { display: grid; gap: 2px; }
.hud-meter span { display: flex; justify-content: space-between; gap: 6px; font-size: .72rem; }
.hud-meter b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.hud-meter progress { width: 100%; height: 6px; border-radius: 5px; }
.hud-meter progress::-webkit-progress-value { background: #df7d78; }
.hud-meter progress::-moz-progress-bar { background: #df7d78; }
#hud-xp-bar::-webkit-progress-value { background: #e8bd68; }
#hud-xp-bar::-moz-progress-bar { background: #e8bd68; }
.hud-wallet { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.top .hud-wallet :is(.gold, .presence) { min-height: 25px; padding: 2px 6px; font-size: .71rem; }
.hud-wallet .pixel-icon { width: 14px; height: 14px; }
.hud-wallet .presence { order: -1; }
.top .bruma-nav { width: 100%; gap: 7px; }
.bruma-nav details { position: relative; }
.bruma-nav summary { cursor: pointer; display: flex; align-items: center; gap: 6px; list-style: none; }
.bruma-nav summary::-webkit-details-marker { display: none; }
.bruma-nav summary::after { content: '▾'; margin-left: .18em; color: #cbb68c; }
.bruma-nav details[open] > summary { border-color: #f1c977; }
.nav-panel {
  position: absolute; top: calc(100% + 5px); left: 0; z-index: 7; min-width: 235px;
  width: max-content; max-width: min(310px, 92vw); padding: 6px; border: 1px solid #80613c;
  border-radius: 10px; background: #161d2a; box-shadow: 0 12px 30px #000b;
}
.nav-panel button {
  display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 9px; min-height: 46px;
  border: 1px solid transparent; border-radius: 6px; background: transparent; color: #f8e8c4; text-align: left;
}
.nav-panel button:hover, .nav-panel button:focus-visible { border-color: #695234; background: #2a2730; }
.nav-panel button small { display: block; margin-top: 2px; font-size: .73rem; color: #b5c2d5; font-weight: 400; }
.nav-panel button [data-icon] { flex: 0 0 23px; }
.nav-panel .nav-badge { position: static; margin-left: auto; }
.profile-dialog { width: min(610px, 94vw); }
.profile-summary { display: flex; align-items: center; gap: 12px; margin: 8px 0; }
.profile-summary .player-portrait { width: 62px; height: 62px; }
.profile-summary strong { overflow-wrap: anywhere; }
.profile-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 123px), 1fr)); gap: 7px; }
.profile-choice { display: grid; place-items: center; gap: 7px; padding: 8px; border: 1px solid var(--line); border-radius: 9px; background: #161e2d; color: #ede2cf; font-size: .77rem; }
.profile-choice[aria-pressed="true"] { border-color: #ceb47a; background: #2b2a34; color: #ffeac5; }
.ranking-player { display: inline-flex; align-items: center; gap: 8px; }
.ranking-player .player-portrait { width: 35px; height: 35px; }
.ranking-podium { background: #27232b; }
.ranking-podium td:first-child { font-weight: 800; }
.podium-1 td:first-child { color: #f6cf79; }
.podium-2 td:first-child { color: #c9dcf1; }
.podium-3 td:first-child { color: #e4a87b; }
.ranking-self { background: #242d3a; }
@media (max-width: 720px) {
  .player-hud { width: 100%; grid-template-columns: minmax(98px, .85fr) minmax(120px, 1fr); gap: 7px; }
  .hud-wallet { grid-column: 1 / -1; }
  .hud-identity .player-portrait { width: 36px; height: 36px; }
  .bruma-nav details { position: static; }
  .nav-panel { top: calc(100% - 3px); left: 9px; right: 9px; width: auto; max-width: none; min-width: 0; max-height: 48vh; overflow-y: auto; }
  .ranking-content { overflow-x: auto; }
}

/* Escolha de classe: cartões com o herói animado (BrumaArt.classPreview). */
#class-dialog { width: min(980px, calc(100vw - 24px)); }
#class-dialog h2 { font-family: 'Cinzel', Georgia, serif; }
#class-options { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 10px; }
.class-card { display: flex; flex-direction: column; gap: 7px; padding: 10px; border: 1px solid color-mix(in srgb, var(--class-color) 35%, #2d3547); border-radius: 12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--class-color) 14%, #182031), #121826 70%); box-shadow: inset 0 1px 0 #ffffff10; transition: transform .18s, border-color .18s, box-shadow .18s; }
.class-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--class-color) 70%, #2d3547); box-shadow: 0 8px 22px #0008, 0 0 0 1px color-mix(in srgb, var(--class-color) 30%, transparent); }
.class-card.current { border-color: var(--class-color); box-shadow: 0 0 0 1px var(--class-color), 0 0 18px color-mix(in srgb, var(--class-color) 30%, transparent); }
.class-preview { width: 100%; aspect-ratio: 300 / 190; border-radius: 9px; background: radial-gradient(ellipse at 50% 85%, color-mix(in srgb, var(--class-color) 22%, #1d2638), #0e131f 75%); border: 1px solid #ffffff12; }
.class-card-title { display: flex; align-items: center; gap: 8px; }
.class-card-title b { font-family: 'Cinzel', Georgia, serif; font-size: 1.08rem; color: var(--class-color); }
.class-card-title .class-icon { flex-basis: 32px; width: 32px; height: 32px; --item-color: var(--class-color); }
.class-card-title .class-icon .pixel-icon { width: 24px; height: 24px; }
.class-current { margin-left: auto; padding: 2px 7px; border-radius: 999px; font-size: .68rem; font-weight: 800; color: #10160f; background: var(--class-color); }
.class-role { font-size: .76rem; font-weight: 700; color: color-mix(in srgb, var(--class-color) 70%, #e9eef7); }
.class-stats { display: grid; gap: 4px; }
.class-stat { display: grid; grid-template-columns: 52px 1fr 28px; align-items: center; gap: 6px; font-size: .72rem; color: var(--muted); }
.class-bar { height: 6px; border-radius: 99px; background: #0b101a; overflow: hidden; }
.class-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, color-mix(in srgb, var(--class-color) 60%, #000), var(--class-color)); }
.class-stat-value { text-align: right; color: #e6ebf3; font-variant-numeric: tabular-nums; }
.class-ability { flex: 1; font-size: .76rem; color: var(--muted); line-height: 1.35; }
.class-card > button { width: 100%; }
@media (max-width: 900px) { #class-options { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { #class-options { grid-template-columns: 1fr; } .class-preview { aspect-ratio: 300 / 150; } }
@media (prefers-reduced-motion: reduce) { .class-card { transition: none; } .class-card:hover { transform: none; } }
/* Dica do item ao passar o mouse e lista de atributos (principal, bônus e extras da raridade). */
.item-tip {
  position: fixed;
  inset: auto;
  margin: 0;
  z-index: 9999;
  width: min(290px, calc(100vw - 16px));
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: none;
  display: none;
}
.item-tip.open { display: block; }
.item-tip-body {
  display: grid;
  gap: 4px;
  padding: 11px 13px;
  border: 1px solid var(--item-color);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(24, 30, 48, .98), rgba(12, 16, 28, .98));
  box-shadow: 0 10px 28px rgba(0, 0, 0, .55), 0 0 0 1px rgba(0, 0, 0, .4), inset 0 0 18px color-mix(in srgb, var(--item-color) 16%, transparent);
  color: #dfe5f2;
  font-size: .8rem;
  line-height: 1.3;
}
.item-tip-name { font-size: .95rem; font-family: Cinzel, Georgia, serif; }
.item-tip-meta, .item-tip-note { color: #9aa6c2; }
.item-tip-note { font-size: .72rem; }
.item-tip-stars { color: #ffd36e; letter-spacing: 1px; }
.item-tip-power { color: #ffe3a3; font-weight: 700; }
.item-tip-class.worse, .item-tip-compare.worse { color: #ff8f8f; }
.item-tip-compare.better { color: #8ee59b; }
.item-tip-compare.equal { color: #c3cbe0; }
.item-stat-list { list-style: none; margin: 2px 0; padding: 0; display: grid; gap: 1px; }
.item-stat { display: flex; align-items: baseline; gap: 2px; }
.item-stat b { color: #f4f6fb; }
.item-stat.main b { color: #ffe3a3; }
.item-stat.extra b { color: var(--item-color, #c9b2ff); }
.item-stat small {
  margin-left: auto;
  padding: 0 5px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .07);
  color: #9aa6c2;
  font-size: .66rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.item-details .item-stat-list { font-size: .8rem; }
.fairy-traits { margin: 0; color: #c7b8f2; font-size: .76rem; }

/* Layout idle: o mapa ocupa a tela; painéis em gavetas; habilidades e poção numa barra central. */
:root { --header-h: 120px; }
.top { padding-block: 8px; row-gap: 6px; min-height: 0; }
.top .brand small { display: none; }
.top .sigil { width: 40px; height: 44px; }
@media (min-width: 1240px) {
  .top { flex-wrap: wrap; }
  .top .bruma-nav { width: auto; flex: 1 1 520px; justify-content: flex-end; }
}
.terrain-footer { display: none; }
.dashboard.idle-stage { display: block; width: 100%; max-width: none; margin: 0; padding: 8px 10px 10px; box-sizing: border-box; }
.idle-stage .expedition { border: 0; background: none; box-shadow: none; overflow: visible; }
.idle-stage .scene {
  --skill-gutter: 0px; margin: 0 auto; aspect-ratio: 16 / 9;
  width: min(100%, calc((100vh - var(--header-h) - 20px) * 16 / 9));
  width: min(100%, calc((100dvh - var(--header-h) - 20px) * 16 / 9));
  min-width: min(100%, 640px); border-radius: 12px; box-shadow: 0 10px 30px #0009;
}
.idle-stage #scene { display: block; width: 100%; height: 100%; }
.idle-stage .battle-name { top: 10px; left: 10px; z-index: 3; max-width: min(46%, 300px); }
.enemy-hp-line { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.enemy-hp-line progress { width: 120px; height: 7px; border-radius: 5px; }
.enemy-hp-line progress::-webkit-progress-value { background: #e0645c; }
.enemy-hp-line progress::-moz-progress-bar { background: #e0645c; }
.battle-name .enemy-hp-line span { color: #f2d9d5; font-size: .7rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stage-title {
  position: absolute; z-index: 2; top: 10px; left: 50%; transform: translateX(-50%);
  width: max-content; max-width: min(40%, 430px); display: grid; gap: 4px; padding: 6px 14px 8px;
  border: 1px solid #ffffff1f; border-radius: 12px; background: #0b1120c4; backdrop-filter: blur(3px); text-align: center;
}
.stage-title .expedition-head { padding: 0; justify-content: center; gap: 10px; }
.stage-title .expedition-head .label { margin-bottom: 1px; }
.stage-title .expedition-head h1 { font-size: clamp(1rem, 1.7vw, 1.45rem); }
.stage-title .status { font-size: .72rem; padding: 2px 8px; }
.stage-title .objective > div { margin-bottom: 2px; font-size: .74rem; }
.stage-title .objective progress { width: 100%; height: 6px; }
.stage-title .retreat-status { margin: 0; font-size: .74rem; }
.idle-stage .drop-info { top: 10px; right: 10px; }
.idle-stage .drop-panel { top: 44px; right: 10px; z-index: 6; }
.stage-tools { position: absolute; z-index: 3; top: 46px; right: 10px; display: grid; gap: 6px; width: 140px; }
.stage-tools button {
  display: flex; align-items: center; gap: 7px; min-height: 36px; padding: 4px 9px; text-align: left;
  border: 1px solid #5d6a84; border-radius: 9px; background: #0d1424d9; color: #e8eef8; font-size: .78rem; backdrop-filter: blur(3px);
}
.stage-tools button:hover { border-color: #d6b46f; background: #1a2134e6; }
.stage-tools button[aria-pressed="true"] { border-color: #e2bf76; box-shadow: inset 0 0 0 1px #e2bf7655; }
.stage-tools .pixel-icon { width: 18px; height: 18px; }
.stage-tools .auto-button { flex-wrap: wrap; row-gap: 2px; }
.stage-tools .auto-button b { margin-left: auto; font-size: .66rem; padding: 2px 6px; }
.action-bar {
  position: absolute; z-index: 4; bottom: 10px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; max-width: calc(100% - 20px); padding: 6px 8px;
  border: 1px solid #7a6440; border-radius: 14px; background: #0a0f1cd9; backdrop-filter: blur(4px); box-shadow: 0 6px 18px #000a;
}
.action-bar .battle-skills { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.action-bar .battle-skill { min-height: 46px; }
.potion-dock { position: relative; display: flex; align-items: center; gap: 5px; padding-left: 8px; border-left: 1px solid #ffffff22; }
.action-bar .quick-potion { min-height: 46px; min-width: 54px; font-size: .86rem; }
.action-bar .quick-potion .pixel-icon { width: 24px; height: 24px; }
.potion-gear { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid #5d6a84; border-radius: 9px; background: #121a2c; color: #e9d7ae; }
.potion-gear[aria-expanded="true"], .potion-gear:hover { border-color: #e2bf76; }
.gear-glyph { font-size: 1.05rem; line-height: 1; }
.potion-popover {
  position: absolute; right: 0; bottom: calc(100% + 12px); z-index: 8; width: min(340px, 92vw);
  max-height: 62vh; overflow-y: auto; display: grid; gap: 8px; padding: 10px;
  border: 1px solid #7a6440; border-radius: 12px; background: #111827f7; box-shadow: 0 12px 30px #000c;
}
.potion-popover[hidden] { display: none; }
.potion-popover .auto-potion { margin-top: 0; }
.potion-popover #potion-shop { display: flex; align-items: center; justify-content: center; gap: 6px; }
.idle-stage .drawer {
  position: fixed; top: 0; bottom: 0; z-index: 60; width: min(420px, 94vw); margin: 0; box-sizing: border-box;
  overflow-y: auto; overscroll-behavior: contain; border-radius: 0; padding: 14px;
  background: linear-gradient(180deg, #161d2d, #0e1422); box-shadow: 0 0 40px #000c;
  visibility: hidden; transition: transform .24s ease, visibility .24s;
}
.idle-stage .drawer-left { left: 0; transform: translateX(-104%); border-right: 1px solid #7a6440; }
.idle-stage .drawer-right { right: 0; transform: translateX(104%); border-left: 1px solid #7a6440; }
.idle-stage .drawer.open { transform: none; visibility: visible; }
.idle-stage .drawer:focus { outline: none; }
.idle-stage .right.drawer { display: grid; grid-template-columns: minmax(0, 1fr); grid-column: auto; align-content: start; gap: 12px; }
.idle-stage .atlas.drawer { grid-row: auto; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.drawer-close { position: absolute; top: 10px; right: 10px; z-index: 1; }
.idle-stage .atlas.drawer > .section-head, .idle-stage .journal-drawer .section-head { padding-right: 52px; }
.idle-stage .journal-drawer .journal { border-top: 0; padding: 0; }
.drawer-scrim { position: fixed; inset: 0; z-index: 59; background: #04070e99; }
.drawer-scrim[hidden] { display: none; }
/* Botões laterais só com ícone (o nome aparece ao passar o mouse) para não cobrir os monstros. */
.stage-tools { width: auto; gap: 5px; }
.stage-tools button { justify-content: center; width: 38px; min-height: 38px; padding: 0; opacity: .88; }
.stage-tools button:hover, .stage-tools button:focus-visible { opacity: 1; }
.stage-tools button > span:not([data-icon]), .stage-tools .auto-button b { display: none; }
.stage-tools .auto-button[aria-pressed="true"] { background: #1f3b2b; border-color: #6fcf8c; }
@media (max-width: 900px) {
  .stage-title { max-width: 44%; }
}
@media (max-width: 720px) {
  .dashboard.idle-stage { padding: 6px; }
  .idle-stage .scene { width: 100%; min-width: 0; aspect-ratio: auto; display: flex; flex-direction: column; overflow: visible; background: #101a2b; }
  .idle-stage #scene { height: auto; aspect-ratio: 16 / 9; border-radius: 12px 12px 0 0; }
  .stage-title, .action-bar, .stage-tools { position: static; transform: none; max-width: none; width: auto; }
  .stage-title { order: 1; margin: 6px; }
  .action-bar { order: 2; margin: 0 6px 6px; flex-wrap: wrap; justify-content: center; }
  .stage-tools { order: 3; display: flex; flex-wrap: wrap; justify-content: center; margin: 0 6px 8px; }
  .stage-tools button { width: auto; padding: 4px 10px; justify-content: flex-start; opacity: 1; }
  .stage-tools button > span:not([data-icon]) { display: inline; }
  .idle-stage .battle-name { max-width: 62%; }
  .enemy-hp-line progress { width: 80px; }
}
@media (prefers-reduced-motion: reduce) { .idle-stage .drawer { transition: none; } }
/* Dica das habilidades da barra central. */
.action-bar .battle-skill { position: relative; }
.action-bar .battle-skill[data-tip]:hover::after, .action-bar .battle-skill[data-tip]:focus-visible::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%);
  width: max-content; max-width: 240px; padding: 7px 10px; border: 1px solid #7a6440; border-radius: 9px;
  background: #111827f7; color: #f1e6cc; font-size: .74rem; line-height: 1.3; text-align: left; white-space: normal;
  box-shadow: 0 8px 20px #000b; pointer-events: none; z-index: 9;
}.bag-tools .auto-drops b { color: var(--muted); font-weight: 700; }
.bag-tools .auto-drops[aria-pressed="true"] { border-color: #6fcf8c; }
.bag-tools .auto-drops[aria-pressed="true"] b { color: #9ff0b2; }/* Celular: os sete menus ficam atrás de um botão Menu para sobrar mais tela para o mapa. */
.nav-toggle { display: none; }
@media (max-width: 720px) {
  .top .nav-toggle {
    display: inline-flex; align-items: center; gap: 6px; margin-left: auto; padding: 6px 12px; min-height: 36px;
    font-family: 'Cinzel', Georgia, serif; font-weight: 700; font-size: .8rem; color: #f6e2b3;
    border: 1px solid #a98149; border-radius: 8px; background: linear-gradient(180deg, #4a3522, #24180d);
  }
  .top .brand { width: auto; }
  .top:not(.nav-open) .bruma-nav { display: none; }
  .top .player-hud { order: 3; }
  .top .bruma-nav { order: 4; }
}

/* ---- Correções da auditoria (v34) ---- */
/* Rótulos da boneca não quebram no meio da palavra. */
.doll-group { overflow-wrap: normal; word-break: keep-all; letter-spacing: .02em; }
/* Nível e estrelas dos itens com no mínimo 10px. */
.inv-level, .inv-stars { font-size: 10px; }
/* Gavetas abrem abaixo do cabeçalho: HP, XP e ouro continuam visíveis. */
.idle-stage .drawer { top: var(--header-h, 0px); }
.drawer-scrim { top: var(--header-h, 0px); }
/* Barra de habilidades com tamanho fixo: o tempo de recarga aparece sobre o ícone. */
.action-bar .battle-skill { width: 50px; height: 50px; min-width: 0; padding: 0; }
.action-bar .battle-skill .skill-status {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 1px 4px; border-radius: 6px;
  background: #0a0f1ccc; color: #ffe2a8; font-size: .74rem; font-weight: 800; pointer-events: none;
}
.action-bar .battle-skill .skill-status:empty { display: none; }
.action-bar .battle-skill.locked-skill .skill-status { top: auto; bottom: 1px; transform: translateX(-50%); font-size: .62rem; color: #dbe5f3; }
/* Cartão da fase em uma linha só. */
.stage-title { max-width: min(48%, 560px); }
.stage-title .expedition-head { flex-wrap: nowrap; }
.stage-title .expedition-head .label, .stage-title .expedition-head h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-title .expedition-head > div:first-child { min-width: 0; }
/* Cabeçalho mais baixo no computador: sobra mais altura para o mapa. */
@media (min-width: 721px) {
  .top { row-gap: 4px; padding-top: 6px; padding-bottom: 6px; }
  .top .nav-button { min-height: 32px; padding-top: 3px; padding-bottom: 3px; }
}
/* Avisos "!" de melhoria nos botões do campo e no Menu do celular. */
.stage-tools button, .top .nav-toggle { position: relative; }
.tool-alert {
  position: absolute; top: -5px; right: -5px; display: grid; place-items: center; width: 16px; height: 16px;
  border-radius: 50%; background: #e2524a; color: #fff; font-size: .68rem; font-weight: 900; line-height: 1;
  box-shadow: 0 0 0 2px #0d1424; animation: alert-pulse 1.6s ease-in-out infinite;
}
.tool-alert[hidden] { display: none; }
@keyframes alert-pulse { 50% { transform: scale(1.18); } }
.stage-tools .optimize-button { border-color: #b5924f; background: linear-gradient(180deg, #3a2c17e6, #1b1409e6); }
/* Aviso curto sobre o campo. */
.stage-toast {
  position: absolute; z-index: 5; left: 50%; bottom: 76px; transform: translateX(-50%); margin: 0; padding: 7px 14px;
  border: 1px solid #b5924f; border-radius: 10px; background: #111827ee; color: #f6e2b3; font-size: .82rem; font-weight: 700;
  box-shadow: 0 8px 20px #000b; pointer-events: none; white-space: nowrap;
}
.stage-toast[hidden] { display: none; }
.stage-toast.show { animation: toast-in 3.2s ease forwards; }
@keyframes toast-in { 0% { opacity: 0; transform: translate(-50%, 8px); } 8%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }
/* Nível das fases no mapa: verde no nível do herói, amarelo até 3 acima, vermelho mais forte. */
.map-level[data-gap="low"] { color: #8fdca0; }
.map-level[data-gap="medium"] { color: #f2cf7a; }
.map-level[data-gap="high"] { color: #ff9a8a; }
@media (prefers-reduced-motion: reduce) { .tool-alert, .stage-toast.show { animation: none; } }
/* Celular: cabeçalho compacto (HUD em uma linha), barra de habilidades numa linha só e cartão da fase inteiro. */
@media (max-width: 720px) {
  .stage-title { max-width: none; }
  .stage-title .expedition-head { flex-wrap: wrap; }
  /* Nome e linha da fase cortam com "…" em vez de alargar a página (que deslocava as janelas para a direita). */
  .stage-title, .stage-title .expedition-head { min-width: 0; max-width: 100%; }
  .stage-title .expedition-head > div:first-child { flex: 1 1 100%; max-width: 100%; }
  .top { padding: 6px 10px; row-gap: 6px; }
  .top .brand { font-size: .95rem; }
  .top .brand .sigil, .top .brand .sigil svg { width: 28px; height: 30px; }
  .top .brand > :not(.sigil) { font-size: 1.02rem; }
  .top .player-hud { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; row-gap: 4px; align-items: center; }
  .top .hud-identity { grid-column: 1; grid-row: 1; }
  .top .hud-wallet { grid-column: 1; grid-row: 2; flex-wrap: nowrap; }
  .top .hud-bars { grid-column: 2; grid-row: 1 / span 2; }
  .top .player-hud { padding: 6px 8px; }
  .top .hud-identity .player-portrait { width: 30px; height: 30px; }
  .top .hud-wallet .presence { display: none; }
  .action-bar { flex-wrap: nowrap; gap: 6px; padding: 6px; }
  .action-bar .battle-skills { flex-wrap: nowrap; gap: 4px; }
  .action-bar .battle-skill { width: 44px; height: 44px; }
  .action-bar .battle-skill .skill-medallion { width: 34px; height: 34px; }
  .potion-dock { padding-left: 6px; }
  .action-bar .quick-potion { min-width: 50px; min-height: 44px; }
  .stage-toast { bottom: auto; top: 8px; white-space: normal; width: max-content; max-width: 90%; }
}
/* Janelas: o × nunca sai da tela; o título encolhe e quebra linha no lugar dele. */
.dialog-title > :first-child { min-width: 0; flex: 1 1 auto; }
.dialog-title .close { flex: none; }
@media (max-width: 720px) {
  .dialog-heading { flex-wrap: wrap; min-width: 0; }
  .dialog-heading h2 { font-size: 1.15rem; }
  .inventory-dialog .expand-button { order: 3; }
}
/* Cartão do item: Equipar/Vender ficam presos no rodapé visível, sem precisar rolar. */
.detail-card .item-actions { position: sticky; bottom: 0; z-index: 2; padding: 8px 0 4px; background: linear-gradient(180deg, #111a2900, #111a29 30%); }
/* Venda automática: filtros em chips, atalhos e prévia do que seria vendido. */
.auto-sell-form fieldset > div { gap: 6px; padding: 2px 0 4px; }
.auto-sell-form legend { display: flex; align-items: center; gap: 8px; padding: 0 4px; color: #d8e6f7; font-weight: 700; font-size: .85rem; }
.auto-sell-form .chip { min-height: 30px; padding: 3px 10px; font-size: .78rem; cursor: pointer; }
.auto-sell-form .link-button { padding: 0 4px; border: 0; background: none; color: var(--gold); font: inherit; font-size: .76rem; font-weight: 700; text-decoration: underline; cursor: pointer; }
.auto-sell-power { padding: 8px 10px; border: 1px solid #3c5677; border-radius: 8px; background: #121c2c; font-weight: 700; }
.auto-sell-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.auto-sell-presets > span { color: var(--muted); font-size: .78rem; font-weight: 700; }
.auto-sell-presets > div { display: flex; flex-wrap: wrap; gap: 6px; }
.auto-sell-preview { display: grid; gap: 3px; padding: 9px 11px; border-radius: 8px; border: 1px solid #5a4a26; background: #1d1a12; color: #d8cfb8; font-size: .8rem; }
.auto-sell-preview b { color: #f3d58e; }
.auto-sell-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.auto-sell-form .auto-sell-actions .primary { justify-self: auto; }

/* Entrada no Mundo online: vantagens, nick com sugestão, conexão, outra aba e versão nova. */
.account-perks { display: grid; gap: 5px; margin: 4px 0 14px; padding: 10px 12px; list-style: none; border: 1px solid #3c4c66; border-radius: 8px; background: #131c2b; text-align: left; font-size: .84rem; color: #c9d6e8; }
.account-perks li { position: relative; padding-left: 18px; }
.account-perks li::before { content: '✦'; position: absolute; left: 0; color: var(--gold); }
.account-perks b { color: #f1dfb4; }
.account-signin { min-height: 46px; display: grid; place-items: center; font-size: 1rem; }
.account-retry { width: 100%; margin-bottom: 10px; }
.account-guest-note { margin-top: 2px !important; font-size: .74rem; }
.account-name-row { display: flex; gap: 6px; }
.account-name-row input { flex: 1; min-width: 0; }
.account-name-row button { flex: 0 0 auto; min-width: 44px; font-size: 1.1rem; padding: 0 10px; }
.account-rules { margin: 0 !important; font-size: .74rem; }
.account-dialog [role="status"].ok { color: #a9e6b6; }
.account-dialog > .primary, .account-dialog > button.primary { width: 100%; min-height: 44px; }
.account-spinner { border-radius: 50%; border: 3px solid #3a4558; border-top-color: var(--gold); width: 46px; height: 46px; animation: account-spin 1s linear infinite; background: none; }
@keyframes account-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .account-spinner { animation-duration: 3s; } }
.app-outdated { border-color: var(--gold); box-shadow: 0 0 0 1px #6b5427, 0 0 40px #e8c78633; }
.app-outdated::backdrop { background: rgba(5, 8, 14, .82); backdrop-filter: blur(3px); }
.profile-account { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 10px; margin: 10px 0; padding: 9px 11px; border: 1px solid #3c4c66; border-radius: 8px; background: #131c2b; }
.profile-account strong { color: #f1dfb4; font-size: .86rem; }
.profile-account span { grid-column: 1; color: var(--muted); font-size: .78rem; }
.profile-account button { grid-column: 2; grid-row: 1 / span 2; }
.profile-account.online strong::before { content: '● '; color: #74d68b; }
@media (max-width: 480px) {
  .account-dialog { width: calc(100% - 16px); max-height: calc(100dvh - 16px); overflow-y: auto; padding: 18px 14px; }
  .account-dialog p { margin: 6px 0 10px; }
  .account-perks { font-size: .8rem; }
  .profile-account { grid-template-columns: 1fr; }
  .profile-account button { grid-column: 1; grid-row: auto; width: 100%; }
}

/* Tela de entrada (login, criar conta, código) e criação do herói: tela cheia, no estilo de abertura de jogo. */
.title-screen { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; padding: clamp(10px, 3vh, 28px) 12px; border: 0; overflow-y: auto;
  background: radial-gradient(ellipse at 50% 20%, #2a3a5aee, #0c1220f5 65%), #0c1220; color: var(--text, #e9eef7); display: none; }
.title-screen[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.title-screen::backdrop { background: #070b14; }
.title-heroes { display: flex; justify-content: center; gap: clamp(0px, 2vw, 18px); margin-bottom: -18px; pointer-events: none; }
.title-heroes .title-hero canvas { width: clamp(70px, 17vw, 140px); height: auto; filter: drop-shadow(0 6px 10px #0009); }
.title-panel { width: min(400px, 100%); padding: 22px clamp(16px, 4vw, 26px) 18px; border: 1px solid #6b5427; border-radius: 14px;
  background: linear-gradient(165deg, #202b3fef, #111826f5 75%); box-shadow: 0 0 0 1px #00000066, 0 18px 50px #000a, inset 0 1px 0 #ffffff12; text-align: center; }
.title-logo { margin: 0; font-family: 'Cinzel Decorative', 'Cinzel', serif; font-size: clamp(1.55rem, 6vw, 2.2rem); color: #f3d58e; text-shadow: 0 2px 0 #5a3d12, 0 0 22px #e8c78655; letter-spacing: .02em; }
.title-tagline { margin: 4px 0 14px; color: var(--muted); font-size: .8rem; }
.title-tabs { display: grid; grid-template-columns: 1fr 1fr; margin: 0 0 12px; border: 1px solid #3c4c66; border-radius: 9px; overflow: hidden; }
.title-tabs[hidden] { display: none; }
.title-tabs button { min-height: 40px; border: 0; background: #141d2c; color: var(--muted); font-weight: 800; font-family: 'Cinzel', serif; cursor: pointer; }
.title-tabs button[aria-selected="true"] { background: linear-gradient(180deg, #e8c786, #b98a3e); color: #1b1407; }
.title-form { display: grid; gap: 10px; margin: 0; text-align: left; }
.title-form[hidden], #code-reset[hidden] { display: none; }
.title-form label { display: grid; gap: 4px; font-size: .8rem; font-weight: 700; color: #d8e3f2; }
.title-form input { min-height: 42px; padding: 8px 11px; border: 1px solid #4e6381; border-radius: 8px; background: #0e1624; color: #eef4ff; font: inherit; font-size: 1rem; }
.title-form input:focus { outline: 2px solid #e8c786; outline-offset: 1px; }
.title-form .primary { min-height: 46px; font-size: 1rem; }
.title-form .text-button { justify-self: center; }
.title-step { margin: 0; text-align: center; font-size: 1.15rem; color: #f1dfb4; }
.title-hint { margin: 0; color: var(--muted); font-size: .8rem; text-align: center; }
.title-links { display: flex; justify-content: center; align-items: center; gap: 4px 14px; flex-wrap: wrap; margin-top: 8px; }
.title-wide { width: 100%; margin-bottom: 10px; }
.code-input { text-align: center; font-size: 1.6rem !important; letter-spacing: .45em; font-weight: 800; font-variant-numeric: tabular-nums; }
#login-feedback, #hero-feedback { color: #ffc0ae; margin: 0 0 10px; }
#login-feedback.ok, #hero-feedback.ok { color: #a9e6b6; }
#code-dev { margin: 0; color: #9ad9fb; text-align: center; }
.hero-panel { width: min(560px, 100%); }
.hero-classes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.hero-classes .title-hero { display: grid; justify-items: center; gap: 2px; padding: 6px 4px 8px; border: 2px solid #33415a; border-radius: 10px; background: #121a28; color: #d8e3f2; cursor: pointer;
  transition: transform .15s, border-color .15s, box-shadow .15s; }
.hero-classes .title-hero canvas { width: 100%; max-width: 120px; height: auto; }
.hero-classes .title-hero b { font-family: 'Cinzel', serif; font-size: .8rem; }
.hero-classes .title-hero:hover { transform: translateY(-2px); }
.hero-classes .title-hero[aria-checked="true"] { border-color: var(--hero-color); box-shadow: 0 0 0 1px var(--hero-color), 0 0 18px color-mix(in srgb, var(--hero-color) 45%, transparent); background: #1a2436; }
.hero-classes .title-hero[aria-checked="true"] b { color: var(--hero-color); }
.hero-class-info { min-height: 2.4em; margin-bottom: 10px; }
@media (max-width: 480px) {
  .title-heroes { margin-bottom: -12px; }
  .hero-classes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .title-panel { padding: 18px 14px 14px; }
}
@media (prefers-reduced-motion: reduce) { .hero-classes .title-hero { transition: none; } }

/* ---- HUD no canto (v36) ----
   Herói (retrato, nível, HP, XP, ouro, diamantes, online) num cartão no canto superior esquerdo do mapa;
   fase e alvo num quadro só no canto superior direito; dicas explicativas na lateral; tamanhos ajustáveis. */
.idle-stage .scene { --rail-space: 58px; }
.player-hud {
  position: absolute; z-index: 3; top: 10px; left: 10px; display: grid; gap: 6px; width: 244px; padding: 8px 9px;
  grid-template-columns: minmax(0, 1fr); border: 1px solid #80613c; border-radius: 12px;
  background: linear-gradient(135deg, #1d2030ee, #10151fee); backdrop-filter: blur(3px); box-shadow: 0 6px 18px #000a;
}
.player-hud .hud-identity { display: flex; align-items: center; gap: 9px; width: 100%; max-width: none; padding: 0; border-radius: 9px; }
.player-hud .hud-identity:hover .player-portrait, .player-hud .hud-identity:focus-visible .player-portrait { border-color: #f1c977; box-shadow: inset 0 0 0 2px #131927, 0 0 0 2px #f1c97755; }
.hud-avatar { position: relative; flex: none; display: grid; justify-items: center; }
.player-hud .player-portrait { width: 50px; height: 50px; }
.player-hud .hud-level {
  position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); padding: 0 6px; white-space: nowrap;
  border: 1px solid #be9455; border-radius: 999px; background: #1b1409; color: #f6e2b3; font-size: .64rem; font-weight: 800; line-height: 1.45;
}
.player-hud .hud-main { display: grid; gap: 3px; min-width: 0; flex: 1; }
.player-hud .hud-main strong { color: #f5dfad; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-hud .hud-meter { display: grid; gap: 1px; }
.player-hud .hud-meter > span { display: flex; justify-content: space-between; gap: 6px; color: #c9d4e6; font-size: .66rem; font-weight: 700; }
.player-hud .hud-meter b { color: #eef3fb; }
.player-hud .hud-meter progress { height: 6px; }
.player-hud .hud-wallet { display: flex; flex-wrap: wrap; gap: 4px; padding-top: 6px; border-top: 1px solid #ffffff14; }
.player-hud .hud-wallet :is(.gold, .presence) { display: inline-flex; align-items: center; gap: 4px; min-height: 22px; padding: 1px 7px; font-size: .7rem; border-radius: 999px; background: #0b101bcc; }
.player-hud .hud-wallet .presence { order: 0; margin-left: auto; color: #a9c4dd; border: 1px solid #ffffff14; }
.player-hud .hud-wallet .pixel-icon { width: 13px; height: 13px; }
/* Fase + alvo no canto direito, ao lado da lateral de botões. */
.idle-stage .stage-title {
  top: 10px; right: var(--rail-space); left: auto; transform: none; width: 286px; max-width: calc(100% - 244px - var(--rail-space) - 30px);
  gap: 5px; padding: 8px 10px; text-align: left; border-color: #80613c66; background: #0b1120dd; box-shadow: 0 6px 18px #0009;
}
.idle-stage .stage-title .expedition-head { justify-content: space-between; align-items: flex-start; gap: 8px; }
.idle-stage .stage-title .expedition-head .label { font-size: .6rem; letter-spacing: .08em; white-space: normal; line-height: 1.25; }
.idle-stage .stage-title .expedition-head h1 { font-size: clamp(.95rem, 1.35vw, 1.2rem); }
.idle-stage .stage-title .status { flex: none; font-size: .66rem; }
.idle-stage .stage-title .objective > div { font-size: .7rem; }
.idle-stage .stage-title .battle-name {
  position: static; max-width: none; display: flex; align-items: center; gap: 8px; margin-top: 2px; padding: 6px 0 0;
  border: 0; border-top: 1px solid #ffffff17; border-radius: 0; background: none; font-size: .8rem;
}
.idle-stage .stage-title .battle-name .enemy-icon .monster-icon { width: 30px; height: 30px; }
.idle-stage .stage-title .enemy-text { flex: 1; min-width: 0; }
.idle-stage .stage-title .enemy-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.idle-stage .stage-title .enemy-hp-line progress { flex: 1; width: auto; min-width: 60px; }
.target-label { color: #9fb1c9 !important; font-size: .58rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
/* Dica explicativa dos botões da lateral. */
.rail-tip {
  position: absolute; z-index: 7; width: 240px; display: grid; gap: 3px; padding: 9px 11px; pointer-events: none;
  border: 1px solid #b5924f; border-radius: 10px; background: #0f1626f7; color: #dfe7f3; font-size: .76rem; line-height: 1.35;
  box-shadow: 0 10px 24px #000c;
}
.rail-tip[hidden] { display: none; }
.rail-tip strong { color: #f3d58e; font-family: 'Cinzel', Georgia, serif; font-size: .86rem; }
.rail-tip em { font-style: normal; font-weight: 800; font-size: .72rem; }
.rail-tip em.on { color: #8fe0a2; }
.rail-tip em.off { color: #a9b6c9; }
.rail-tip em.alert { color: #ffb08a; }
.rail-tip::after { content: ''; position: absolute; top: 50%; right: -6px; width: 10px; height: 10px; transform: translateY(-50%) rotate(45deg); background: #0f1626; border: solid #b5924f; border-width: 1px 1px 0 0; }
/* Menu Ajustes e janela de Configurações. */
.menu-glyph { display: inline-grid; place-items: center; width: 22px; font-size: 1.05rem; line-height: 1; }
.nav-panel #sound-toggle[aria-pressed="false"] small { color: #ffb08a; }
.settings-dialog { width: min(440px, 94vw); }
.settings-glyph { font-size: 1.5rem; color: #f3d58e; }
.settings-group { display: grid; gap: 10px; margin-top: 12px; padding: 12px; border: 1px solid #ffffff14; border-radius: 10px; background: #0d1322; }
.settings-group h3 { margin: 0; font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; color: #e8c786; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.settings-row p { margin: 2px 0 0; }
.settings-range { display: grid; gap: 4px; font-size: .84rem; font-weight: 700; }
.settings-range > span { display: flex; justify-content: space-between; }
.settings-range output { color: #f3d58e; font-variant-numeric: tabular-nums; }
.settings-range input { width: 100%; accent-color: #e8c786; }
.settings-range input:disabled { opacity: .45; }
.settings-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.settings-actions [hidden] { display: none; }
/* Tamanhos escolhidos nas Configurações. */
.top, .player-hud, .idle-stage .stage-title, .stage-tools, .idle-stage .drop-info, .idle-stage .drop-panel, .action-bar, .rail-tip, .stage-toast { zoom: var(--ui-scale, 1); }
@media (min-width: 721px) {
  .idle-stage .scene {
    width: calc(min(100%, calc((100vh - var(--header-h) - 20px) * 16 / 9)) * var(--map-scale, 1));
    width: calc(min(100%, calc((100dvh - var(--header-h) - 20px) * 16 / 9)) * var(--map-scale, 1));
    min-width: min(100%, 560px);
  }
  /* Cabeçalho só com o logo e os menus, numa linha: sobra mais altura para o mapa. */
  .top { flex-wrap: wrap; }
  .top .bruma-nav { width: auto; flex: 1 1 auto; justify-content: flex-end; }
}
@media (min-width: 721px) {
  .top .brand .logo-title { font-size: clamp(1rem, 1.5vw, 1.5rem) !important; }
  .top .bruma-nav { gap: 5px; flex-wrap: wrap; }
  /* Menus do fim da linha abrem para a esquerda (não saem da tela). */
  .top .bruma-nav > details:nth-last-child(-n+3) > .nav-panel { left: auto; right: 0; }
}
@media (min-width: 721px) and (max-width: 1240px) {
  .top { flex-wrap: wrap; }
  .top .bruma-nav { flex-wrap: wrap; }
  .top .bruma-nav { width: 100%; justify-content: flex-start; }
}
@media (min-width: 721px) and (max-width: 860px) {
  .player-hud { width: 214px; }
  .idle-stage .stage-title { width: 250px; max-width: calc(100% - 214px - var(--rail-space) - 30px); }
}
/* Celular: o cartão do herói fica acima do mapa e o quadro de fase + alvo logo abaixo. */
@media (max-width: 720px) {
  .player-hud { position: static; order: -1; width: auto; margin: 0 0 6px; grid-template-columns: minmax(0, 1fr); }
  .idle-stage #scene { border-radius: 12px; }
  .idle-stage .stage-title { position: static; width: auto; max-width: none; right: auto; }
  .idle-stage .stage-title .battle-name { max-width: none; }
  .rail-tip { display: none; }
}

/* ---- War of Demons (v37): logo de fogo, sigilo com chifres e tela de entrada carmesim ---- */
.logo-title, .title-logo {
  background: linear-gradient(180deg, #fff4d8 0%, #ffd27a 38%, #f0702e 70%, #a3161a 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent !important; -webkit-text-fill-color: transparent;
  text-shadow: none !important; filter: drop-shadow(0 2px 0 #2c0606) drop-shadow(0 0 12px #ff4a1c55);
  text-transform: uppercase; letter-spacing: .04em !important;
}
.top .sigil { filter: drop-shadow(0 3px 4px #000c) drop-shadow(0 0 10px #ff4a1c55); }
.top::after { background: linear-gradient(90deg, transparent, #c4302b 25%, #ffcf7a 50%, #c4302b 75%, transparent); }
.title-screen { background: radial-gradient(ellipse at 50% 18%, #5a1626ee, #1a0812f5 60%, #0b0509), #0b0509; }
.title-screen::backdrop { background: #0b0509; }
.title-screen::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; opacity: .55;
  background: radial-gradient(circle at 20% 85%, #ff4a1c33, transparent 35%), radial-gradient(circle at 82% 78%, #ff7a2a2b, transparent 32%);
}
.title-panel { position: relative; border-color: #8c2a2a; background: linear-gradient(165deg, #2a1220ef, #140a12f5 75%); }
.title-tabs { border-color: #5c2a34; }
.title-tabs button { background: #1c0d14; }
.title-form input { border-color: #6b3a46; background: #12080d; }
.title-form input:focus { outline-color: #ff9a4a; }
.hero-classes .title-hero { border-color: #4a2630; background: #170b11; }
.hero-classes .title-hero[aria-checked="true"] { background: #24121a; }

/* Nuvens ao concluir o login ou o cadastro: fecham a tela e depois se abrem para os lados. */
.cloud-gate { position: fixed; inset: 0; z-index: 2147483000; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; overflow: hidden; pointer-events: auto; }
.cloud-gate[hidden], .cloud-gate:not(.closing):not(.covered):not(.opening) { display: none; }
.cloud-gate::backdrop { background: transparent; }
.cloud-bank { position: absolute; top: -10%; bottom: -10%; width: 70%; will-change: transform; }
.cloud-bank.left { left: -8%; }
.cloud-bank.right { right: -8%; transform: scaleX(-1); }
.cloud-bank i {
  position: absolute; left: var(--x); top: var(--y); width: var(--s); height: calc(var(--s) * .62); transform: translateY(-30%);
  background:
    radial-gradient(22% 38% at 24% 58%, #fffdfd 0%, #ece3e7 50%, #ece3e700 100%),
    radial-gradient(27% 46% at 47% 40%, #ffffff 0%, #f1e9ec 48%, #f1e9ec00 100%),
    radial-gradient(23% 40% at 72% 54%, #fffbfc 0%, #e8dde2 50%, #e8dde200 100%),
    radial-gradient(18% 30% at 88% 66%, #f6eff2 0%, #ddd0d6 50%, #ddd0d600 100%),
    radial-gradient(40% 34% at 52% 74%, #d6c6ce 0%, #b49fab 55%, #b49fab00 100%);
  filter: blur(1.5px);
}
.cloud-mist { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 42%, #f3ecee 0%, #d9cbd1 45%, #a58b98 85%, #7a5566 100%); opacity: 0; }
.cloud-title {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); white-space: nowrap; opacity: 0;
  font-family: 'Cinzel Decorative', 'Cinzel', Georgia, serif; font-weight: 900; font-size: clamp(1.8rem, 7vw, 4.4rem); letter-spacing: .05em; text-transform: uppercase;
  background: linear-gradient(180deg, #fff4d8 0%, #ffd27a 38%, #f0702e 70%, #a3161a 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 #2c0606) drop-shadow(0 0 22px #ff4a1c88);
}
.cloud-gate.closing .cloud-bank.left { animation: cloud-in-left .65s cubic-bezier(.2,.7,.3,1) both; }
.cloud-gate.closing .cloud-bank.right { animation: cloud-in-right .65s cubic-bezier(.2,.7,.3,1) both; }
.cloud-gate.closing .cloud-mist { animation: cloud-fade-in .45s ease-in .2s both; }
.cloud-gate.closing .cloud-title { animation: cloud-title-in .4s ease-out .3s both; }
.cloud-gate.covered .cloud-mist, .cloud-gate.covered .cloud-title { opacity: 1; }
.cloud-gate.opening { pointer-events: none; }
.cloud-gate.opening .cloud-bank.left { animation: cloud-out-left 1.3s cubic-bezier(.55,0,.35,1) both; }
.cloud-gate.opening .cloud-bank.right { animation: cloud-out-right 1.3s cubic-bezier(.55,0,.35,1) both; }
.cloud-gate.opening .cloud-mist { animation: cloud-fade-out .7s ease-out both; }
.cloud-gate.opening .cloud-title { animation: cloud-title-out .6s ease-in both; }
@keyframes cloud-in-left { from { transform: translateX(-105%); } to { transform: none; } }
@keyframes cloud-in-right { from { transform: translateX(105%) scaleX(-1); } to { transform: scaleX(-1); } }
@keyframes cloud-out-left { from { transform: none; opacity: 1; } 80% { opacity: 1; } to { transform: translateX(-118%) scale(1.25); opacity: 0; } }
@keyframes cloud-out-right { from { transform: scaleX(-1); opacity: 1; } 80% { opacity: 1; } to { transform: translateX(118%) scaleX(-1.25) scaleY(1.25); opacity: 0; } }
@keyframes cloud-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes cloud-fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes cloud-title-in { from { opacity: 0; transform: translate(-50%, -50%) scale(.85); } to { opacity: 1; transform: translate(-50%, -50%); } }
@keyframes cloud-title-out { from { opacity: 1; transform: translate(-50%, -50%); } to { opacity: 0; transform: translate(-50%, -50%) scale(1.3); } }
@media (prefers-reduced-motion: reduce) {
  .cloud-gate .cloud-bank { display: none; }
  .cloud-gate.closing .cloud-mist, .cloud-gate.closing .cloud-title { animation: cloud-fade-in .2s both; }
  .cloud-gate.opening .cloud-mist, .cloud-gate.opening .cloud-title { animation: cloud-fade-out .3s both; }
}

/* Ícone do jogo (demônio com chifres): o mesmo arquivo da aba do navegador, na frente do nome. */
.top .sigil img { display: block; width: 100%; height: 100%; }
.top .sigil { width: 44px; height: 44px; filter: drop-shadow(0 3px 4px #000c) drop-shadow(0 0 10px #ff4a1c55); }
@media (max-width: 720px) { .top .brand .sigil { width: 32px; height: 32px; } }

/* ---- Chat dos jogadores (v38): canto inferior esquerdo do mapa ---- */
.chat-box { position: absolute; z-index: 4; left: 10px; bottom: 10px; display: grid; justify-items: start; gap: 6px; zoom: var(--ui-scale, 1); }
.chat-toggle {
  position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 4px 12px;
  border: 1px solid #80613c; border-radius: 999px; background: #0d1222e6; color: #f6e2b3; font-weight: 800; font-size: .8rem;
  backdrop-filter: blur(3px); box-shadow: 0 4px 14px #0009; cursor: pointer;
}
.chat-toggle:hover { border-color: #f1c977; }
.chat-box[data-state="open"] .chat-toggle { display: none; }
.chat-unread { min-width: 18px; padding: 0 5px; border-radius: 999px; background: #e2524a; color: #fff; font-size: .68rem; line-height: 18px; text-align: center; }
.chat-unread[hidden] { display: none; }
.chat-panel {
  order: -1; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; width: min(320px, 34vw); min-width: 250px; height: min(250px, 38vh);
  border: 1px solid #80613c99; border-radius: 12px; background: #0b0f1ad9; backdrop-filter: blur(4px); box-shadow: 0 8px 22px #000a; overflow: hidden;
}
.chat-panel[hidden] { display: none; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 5px 6px 4px 8px; border-bottom: 1px solid #ffffff14; }
.chat-tabs { display: flex; gap: 4px; }
.chat-tabs button { min-height: 24px; padding: 1px 10px; border: 1px solid #3c4c66; border-radius: 999px; background: #121a2a; color: #a9b6c9; font-size: .7rem; font-weight: 800; cursor: pointer; }
.chat-tabs button[aria-selected="true"] { border-color: #e8c786; background: linear-gradient(180deg, #e8c786, #b98a3e); color: #1b1407; }
.chat-close { width: 26px; height: 24px; padding: 0; border: 1px solid #3c4c66; border-radius: 7px; background: #121a2a; color: #e8eef8; font-weight: 900; line-height: 1; cursor: pointer; }
.chat-close:hover { border-color: #e8c786; }
.chat-log { margin: 0; padding: 6px 8px; list-style: none; overflow-y: auto; overscroll-behavior: contain; display: grid; align-content: start; gap: 3px; font-size: .76rem; line-height: 1.32; scrollbar-width: thin; }
.chat-line { position: relative; padding: 1px 22px 1px 4px; border-radius: 6px; color: #e3e9f3; overflow-wrap: anywhere; }
.chat-line:hover { background: #ffffff0d; }
.chat-line.mine { background: #e8c78612; }
.chat-line.mention { background: #ff7a2a24; box-shadow: inset 2px 0 0 #ff9a4a; }
.chat-line time { margin-right: 5px; color: #7f8ca2; font-size: .64rem; font-variant-numeric: tabular-nums; }
.chat-name { padding: 0; border: 0; background: none; font: inherit; font-weight: 800; cursor: pointer; }
.chat-name::after { content: ':'; color: #7f8ca2; margin-right: 4px; }
.chat-name:hover { text-decoration: underline; }
.chat-mute { position: absolute; top: 0; right: 2px; padding: 0 2px; border: 0; background: none; font-size: .7rem; opacity: 0; cursor: pointer; }
.chat-line:hover .chat-mute, .chat-mute:focus-visible { opacity: .8; }
.chat-empty { color: #8b97ad; font-style: italic; padding: 6px 2px; }
.chat-note { margin: 0; padding: 3px 8px; color: #ffb08a; font-size: .7rem; border-top: 1px solid #ffffff10; }
.chat-note[hidden] { display: none; }
.chat-note .text-button { font-size: .7rem; }
.chat-form { display: flex; gap: 5px; padding: 6px; border-top: 1px solid #ffffff14; }
.chat-form input { flex: 1; min-width: 0; min-height: 30px; padding: 4px 9px; border: 1px solid #3c4c66; border-radius: 8px; background: #080c16; color: #eef3fb; font: inherit; font-size: .8rem; }
.chat-form input:focus { outline: 2px solid #e8c78699; outline-offset: 0; border-color: #e8c786; }
.chat-form input:disabled { opacity: .5; }
.chat-form button { min-height: 30px; min-width: 36px; padding: 0 10px; }
@media (max-width: 720px) {
  .chat-box { position: static; order: 4; margin: 0 6px 8px; justify-items: stretch; }
  .chat-toggle { justify-content: center; }
  .chat-panel { width: auto; min-width: 0; height: 260px; }
}

/* ---- Painel do alvo (v39) ----
   Vida do monstro e vitórias no mapa num quadro no canto inferior direito; a barra de vida mostra os números,
   deixa um rastro claro do dano de cada golpe e o golpe aparece ao lado do nome. A fase fica sozinha no alto. */
@media (min-width: 721px) {
  .idle-stage .stage-title { width: auto; min-width: 210px; max-width: min(300px, calc(100% - 244px - var(--rail-space) - 30px)); gap: 3px; }
  .idle-stage .stage-title .expedition-head { align-items: center; }
}
.idle-stage .target-hud {
  position: absolute; z-index: 3; right: 10px; bottom: 10px; width: 272px; display: grid; gap: 7px; padding: 9px 11px 10px;
  border: 1px solid #8a3a2a; border-radius: 12px; zoom: var(--ui-scale, 1);
  background: linear-gradient(160deg, #2b1216f0, #0d111cee 62%); backdrop-filter: blur(3px);
  box-shadow: 0 6px 18px #000a, inset 0 1px 0 #ffffff12;
}
.idle-stage .target-hud .battle-name {
  position: relative; top: auto; left: auto; z-index: auto; display: flex; align-items: center; gap: 9px; max-width: none;
  margin: 0; padding: 0; border: 0; border-radius: 0; background: none; font-size: .82rem;
}
.target-hud .enemy-icon {
  flex: none; display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid #a8553f; border-radius: 10px;
  background: radial-gradient(circle at 50% 38%, #4f1e1e, #150b0e 72%); box-shadow: inset 0 0 10px #000c;
}
.target-hud .enemy-icon .monster-icon { width: 34px; height: 34px; }
.target-hud .enemy-text { flex: 1; min-width: 0; display: grid; line-height: 1.2; }
.target-hud .enemy-text strong { color: #ffe2c4; font-size: .94rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.target-hud .target-label { color: #d79a86 !important; }
.target-hud .enemy-hit {
  position: absolute; right: 0; top: 0; color: #ffd27a; font-size: 1.05rem; font-weight: 900; font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 0 #3a0a0a, 0 0 8px #ff5a2a99; opacity: 0; pointer-events: none;
}
.target-hud .enemy-hit.show { animation: target-hit .7s ease-out; }
@keyframes target-hit {
  0% { opacity: 0; transform: translateY(6px) scale(1.35); }
  15% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-14px); }
}
.enemy-hp-bar {
  position: relative; height: 17px; overflow: hidden; border: 1px solid #6a2c27; border-radius: 999px;
  background: #1a0c0f; box-shadow: inset 0 2px 5px #000b;
}
.enemy-hp-trail, .enemy-hp-fill { position: absolute; top: 0; bottom: 0; left: 0; border-radius: inherit; }
.enemy-hp-trail { width: var(--trail, 100%); background: linear-gradient(180deg, #fff1cf, #f2b36b); transition: width .45s ease-out; }
.enemy-hp-fill {
  width: var(--hp, 100%); transition: width .12s linear;
  background: linear-gradient(180deg, #ff8a70 0%, #d6312e 55%, #8e1a1f 100%); box-shadow: inset 0 1px 0 #ffffff40;
}
.enemy-hp-bar[data-low="true"] .enemy-hp-fill { background: linear-gradient(180deg, #ffbf6a 0%, #e05a1e 55%, #9a2a12 100%); }
.enemy-hp-text {
  position: relative; display: block; color: #fff; font-size: .7rem; font-weight: 800; line-height: 15px; text-align: center;
  font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px #000, 0 0 3px #000;
}
.enemy-hp-bar.struck { animation: target-shake .22s; }
@keyframes target-shake { 30% { transform: translateX(-2px); } 70% { transform: translateX(2px); } }
.target-hud .objective { padding-top: 7px; border-top: 1px solid #ffffff14; }
.target-hud .objective > div { margin-bottom: 4px; font-size: .74rem; }
.target-hud .objective b { color: #e8c786; }
.target-hud .objective span { color: #f1e6cf; font-weight: 800; font-variant-numeric: tabular-nums; }
.target-hud .objective progress { width: 100%; height: 7px; }
/* Telas menores: o quadro sobe acima da barra de habilidades e se afasta da lateral de botões. */
@media (min-width: 721px) and (max-width: 1040px), (min-width: 721px) and (max-height: 640px) {
  .idle-stage .target-hud { bottom: 78px; right: var(--rail-space); width: 244px; }
}
@media (max-width: 720px) {
  .idle-stage .target-hud { position: static; order: 1; width: auto; margin: 0 6px 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .target-hud .enemy-hit.show, .enemy-hp-bar.struck { animation: none; }
  .target-hud .enemy-hit.show { opacity: 1; }
  .enemy-hp-trail, .enemy-hp-fill { transition: none; }
}

/* ---- Fase dentro do painel do alvo (v40) ----
   O quadro do alto saiu: região, fase e estado do combate ficam numa linha pequena no topo do painel do alvo. */
.target-hud .target-phase { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 6px; border-bottom: 1px solid #ffffff14; }
.target-hud .target-phase-text { display: grid; min-width: 0; line-height: 1.15; }
.target-hud .target-phase .label { overflow: hidden; color: #c9a98a; font-size: .6rem; font-weight: 700; letter-spacing: .04em; text-overflow: ellipsis; white-space: nowrap; }
.target-hud .target-phase h1 { margin: 0; overflow: hidden; color: #f3e2c2; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.target-hud .target-phase .status { flex: none; padding: 1px 7px; font-size: .6rem; }
.target-hud .retreat-status { margin: 0; color: var(--gold); font-size: .68rem; }
.target-hud .retreat-status[hidden] { display: none; }
.settings-split { margin-top: 4px; padding-top: 10px; border-top: 1px solid #ffffff14; }
.item-tip-sum { display: block; font-size: .78em; opacity: .8; font-weight: 400; }

/* Cinco poções (5% a 25%): prateleiras na loja, atalho com a porcentagem e escolha da poção automática. */
.potion-shop-note { margin: -4px 0 8px; }
.potion-shelves { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin-bottom: 14px; }
.potion-shelves .potion-shelf { grid-template-columns: 88px minmax(0, 1fr); gap: 10px; padding: 10px; border-color: color-mix(in srgb, var(--potion-color) 45%, #34433a);
  background: radial-gradient(circle at 14% 30%, color-mix(in srgb, var(--potion-color) 22%, transparent), transparent 60%), linear-gradient(150deg, #211a24, #15131b); }
.potion-shelves .potion-shelf.chosen { border-color: #8fe0a6; box-shadow: 0 0 0 1px #8fe0a655, 0 0 18px #6fcf8c22; }
.potion-shelves .potion-art { min-height: 86px; border-color: color-mix(in srgb, var(--potion-color) 55%, #2d3a33); background: radial-gradient(circle, color-mix(in srgb, var(--potion-color) 30%, transparent), #120f15 72%); cursor: help; }
.potion-shelves .potion-art .pixel-icon { width: 50px; height: 50px; filter: drop-shadow(0 0 9px color-mix(in srgb, var(--potion-color) 60%, transparent)); }
.potion-percent { position: absolute; left: 6px; top: 5px; padding: 0 6px; border-radius: 999px; background: #0c0a10dd; color: #fff3e2; font-weight: 800; font-size: .78rem; border: 1px solid color-mix(in srgb, var(--potion-color) 70%, #fff0); }
.potion-shelves .potion-title h3 { font-size: 1rem; }
.potion-shelves .potion-meter i { background: linear-gradient(90deg, color-mix(in srgb, var(--potion-color) 80%, #000), var(--potion-color)); }
.potion-shelves .potion-buy { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.potion-shelves .potion-buy button { min-height: 32px; font-size: .76rem; }
.potion-shelves .potion-pick { grid-column: 1 / -1; justify-content: center; min-height: 30px; }
.potion-shelves .potion-pick[aria-pressed="true"] { color: #b9f5c8; border-color: #6fcf8c; background: #173022; }
.quick-potion { position: relative; }
.potion-dock-icon { display: inline-grid; }
.potion-dock-icon .pixel-icon { width: 24px; height: 24px; filter: drop-shadow(0 0 5px color-mix(in srgb, var(--potion-color, #e5645f) 60%, transparent)); }
.potion-tier-badge { position: absolute; left: -5px; top: -7px; padding: 0 4px; border-radius: 999px; background: #0c0a10; border: 1px solid var(--potion-color, #e5645f); color: #fff1df; font-size: .6rem; font-weight: 800; line-height: 1.35; }
.potion-pick-title { margin: 8px 0 4px; font-size: .78rem; color: #cfd8ea; font-weight: 700; }
.potion-tier-chips .chip { display: inline-flex; align-items: center; gap: 3px; }
.potion-tier-chips .chip .pixel-icon { width: 16px; height: 16px; }
.potion-tier-chips .chip small { opacity: .75; font-size: .68rem; }
/* Dica de informação (poções, buffs, habilidades, perfis). */
.info-tip-body { min-width: 210px; max-width: 300px; }
.info-tip-list { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 4px 0 2px; font-size: .82rem; }
.info-tip-list dt { color: #aab6cc; }
.info-tip-list dd { margin: 0; color: #f2ead8; font-weight: 600; text-align: right; }
.item-tip-note.good { color: #9ff0b2; }
.item-tip-note.warn { color: #ffcf7a; }
@media (max-width: 720px) { .potion-shelves { grid-template-columns: 1fr; } }

/* Cartão de habilidade no estilo "golpe": etiquetas de tipo de dano/alcance e caixas de Recarga, Força e Alvos. */
.skill-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.skill-chip { padding: 1px 8px; border-radius: 999px; font-size: .7rem; font-weight: 700; color: #e9eef8; background: #ffffff14; border: 1px solid #ffffff24; }
.skill-chip.main { color: #17121a; background: var(--damage-color, #e8c786); border-color: transparent; }
.skill-boxes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.skill-box { display: grid; gap: 1px; padding: 5px 6px; border-radius: 8px; text-align: center; background: #0b1220cc; border: 1px solid color-mix(in srgb, var(--damage-color, #e8c786) 35%, #2a3550); }
.skill-box small { font-size: .66rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.skill-box b { font-size: .92rem; color: #f6ecd6; font-variant-numeric: tabular-nums; }
.skill-card.d-physical { --type: #ff9b6b; }
.skill-card.d-special { --type: #a99bff; }
.skill-card.d-mixed { --type: #ffd36b; }
.skill-card.d-support { --type: #8fe0a6; }
.skill-card { border-top: 3px solid color-mix(in srgb, var(--damage-color, #e8c786) 80%, transparent); }
.potion-shelves { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.potion-shelves .potion-shelf { grid-template-columns: 74px minmax(0, 1fr); align-items: start; }
.potion-shelves .potion-art { min-height: 0; height: 96px; }
.potion-shelves .potion-art .potion-flask { width: 56px; height: 56px; }
.potion-shelves .potion-buy button { white-space: nowrap; padding: 4px; }
.potion-flask { overflow: visible; }
.skill-type.d-physical { --type: #ff9b6b; }
.skill-type.d-special { --type: #a99bff; }
.skill-type.d-mixed { --type: #ffd36b; }
.skill-type.d-support { --type: #8fe0a6; }
.skill-legend-note { grid-column: 1 / -1; }

/* ---- v40: carteira em linhas, barra de efeitos, tag Celestial, jogadores, amigos e chat novo ---- */
/* Carteira: ouro em cima, diamantes no meio e online embaixo, com rótulo explicativo. */
.player-hud .hud-wallet { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; padding-top: 6px; }
.player-hud .hud-wallet .wallet-row { display: grid; grid-template-columns: 18px auto minmax(0, 1fr); align-items: center; gap: 6px; min-height: 24px; margin: 0;
  padding: 2px 9px; border: 1px solid #ffffff12; border-radius: 8px; background: linear-gradient(90deg, #0b101bdd, #141b2bcc); font-size: .78rem; }
.player-hud .hud-wallet .wallet-row small { color: #9fb0c8; font-size: .62rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.player-hud .hud-wallet .wallet-row b { justify-self: end; color: #f6e2b3; font-size: .86rem; font-variant-numeric: tabular-nums; }
.player-hud .hud-wallet .diamond-balance b { color: #a7e6ff; }
.player-hud .hud-wallet .presence { order: 0; margin: 0; color: #a9c4dd; }
.player-hud .hud-wallet .presence b { color: #b8f0c4; font-size: .74rem; }
.player-hud .hud-wallet .wallet-row .pixel-icon { width: 17px; height: 17px; }
@media (max-width: 720px) {
  .player-hud .hud-wallet { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .player-hud .hud-wallet .wallet-row { grid-template-columns: 16px minmax(0, 1fr); padding: 2px 6px; }
  .player-hud .hud-wallet .wallet-row small { display: none; }
}

/* Barra de efeitos ativos: quebra em mais linhas sem cobrir nada (fica dentro do cartão do herói). */
.hud-buffs { display: flex; flex-wrap: wrap; gap: 5px; padding: 2px 0 0; }
.hud-buffs[hidden] { display: none; }
.hud-buff { --buff-color: #f2cf80; --buff-left: 1; position: relative; display: grid; place-items: center; width: 30px; height: 30px; padding: 0;
  border: 1px solid color-mix(in srgb, var(--buff-color) 55%, #0000); border-radius: 8px; background: radial-gradient(circle at 50% 35%, #26304a, #0c111c); cursor: help; }
.hud-buff-ring { position: absolute; inset: -1px; border-radius: 8px; pointer-events: none;
  background: conic-gradient(var(--buff-color) calc(var(--buff-left) * 360deg), #ffffff10 0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; padding: 2px; }
.hud-buff:not(.timed) .hud-buff-ring { background: color-mix(in srgb, var(--buff-color) 70%, #0000); }
.hud-buff-icon { display: grid; place-items: center; }
.hud-buff-icon .pixel-icon { width: 18px; height: 18px; filter: drop-shadow(0 0 3px color-mix(in srgb, var(--buff-color) 60%, #0000)); }
.hud-buff-time { position: absolute; right: -4px; bottom: -5px; min-width: 16px; padding: 0 3px; border-radius: 6px; background: #080b13ee;
  color: #eef3fb; font-size: .56rem; font-weight: 900; line-height: 1.35; font-variant-numeric: tabular-nums; }
.hud-buff-time:empty { display: none; }
.hud-buff.ending { animation: buff-ending .8s ease-in-out infinite; }
.hud-buff.renewed { animation: buff-renew .45s ease-out; }
.hud-buff.celestial { border-color: #ffe27a; background: radial-gradient(circle at 50% 35%, #6b4a10, #1c1306); box-shadow: 0 0 8px #ffd85a77; }
.hud-buff.celestial .hud-buff-icon { animation: celestial-flicker 2.4s steps(1) infinite; }
.hud-buff:focus-visible { outline: 2px solid #f1c977; outline-offset: 2px; }
@keyframes buff-ending { 50% { opacity: .55; } }
@keyframes buff-renew { from { transform: scale(1.25); box-shadow: 0 0 12px var(--buff-color); } }
@keyframes celestial-flicker { 0%, 46%, 52%, 100% { filter: none; } 48% { filter: brightness(1.8); } }
@media (prefers-reduced-motion: reduce) { .hud-buff, .hud-buff .hud-buff-icon { animation: none !important; } }

/* Tag Celestial (chat, ranking, perfil, amigos). */
.celestial-badge { display: inline-flex; align-items: center; gap: 3px; padding: 0 7px 0 4px; border: 1px solid #ffe9a3; border-radius: 999px;
  background: linear-gradient(90deg, #5a3d0c, #b9862a, #5a3d0c); color: #fff6cf; font-size: .62rem; font-weight: 900; letter-spacing: .06em;
  text-transform: uppercase; line-height: 1.5; vertical-align: middle; box-shadow: 0 0 6px #ffd85a55; white-space: nowrap; }
.celestial-badge .pixel-icon { width: 11px; height: 11px; }
.celestial-badge.compact { padding: 0 3px; margin-right: 3px; }
.celestial-badge.compact span:empty { display: none; }
.profile-celestial { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; align-items: center; margin: 8px 0; padding: 9px 11px;
  border: 1px solid #c9a24d; border-radius: 10px; background: linear-gradient(135deg, #2a2210, #141019); }
.profile-celestial[hidden] { display: none; }
.profile-celestial > :not(.celestial-badge) { grid-column: 2; }
.profile-celestial .celestial-badge { grid-row: 1 / span 3; }
.celestial-explain { border-left: 3px solid #c9a24d; padding-left: 8px; }

/* Cartão e menu do jogador. */
.player-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; align-items: center; min-width: 220px; }
.player-card .player-portrait { width: 52px; height: 52px; grid-row: 1 / span 2; }
.player-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-width: 0; }
.player-card-name { font-size: .95rem; }
.player-card-head .item-meta { flex-basis: 100%; margin: 0; }
.player-card-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin: 0; }
.player-card-facts div { padding: 3px 6px; border-radius: 7px; background: #0b101bcc; text-align: center; }
.player-card-facts dt { color: #8f9db4; font-size: .6rem; font-weight: 800; text-transform: uppercase; }
.player-card-facts dd { margin: 0; color: #eef3fb; font-weight: 800; font-size: .82rem; }
.player-card-celestial, .player-card-online { grid-column: 1 / -1; color: #f2d58a; font-size: .7rem; }
.player-card-online { color: #8f9db4; }
.player-card-online.on { color: #8fe0a2; }
.player-tip { min-width: 250px; }
.player-menu { position: fixed; inset: auto; margin: 0; z-index: 60; min-width: 210px; padding: 7px; border: 1px solid #80613c; border-radius: 11px;
  background: linear-gradient(160deg, #1d2131, #0f131d); color: var(--text); box-shadow: 0 10px 28px #000c; }
.player-menu-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 2px 5px 6px; border-bottom: 1px solid #ffffff14; }
.player-menu-title .item-meta { flex-basis: 100%; margin: 0; font-size: .68rem; }
.player-menu-list { display: grid; gap: 2px; padding-top: 5px; }
.player-menu-item { min-height: 32px; padding: 4px 9px; border: 0; border-radius: 7px; background: none; color: #e8eef8; font: inherit; font-size: .8rem; font-weight: 700; text-align: left; cursor: pointer; }
.player-menu-item:hover:not(:disabled), .player-menu-item:focus-visible { background: #e8c78622; color: #fff2cc; outline: none; }
.player-menu-item:disabled { color: #7f8ca2; cursor: default; }
.player-menu-item.danger { color: #ff9d8a; }
.player-dialog { width: min(460px, calc(100% - 20px)); }
.player-body { display: grid; gap: 12px; }
.player-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.player-actions .danger, .friend-tools .danger { color: #ffb0a0; border-color: #8a3f37; }
.stage-toast.bad { border-color: #b3554a; color: #ffd0c6; }

/* Amigos. */
.friends-body { display: grid; gap: 12px; }
.friends-section h3 { margin: 0 0 6px; font-size: .9rem; color: #f2d9a5; }
.friends-section h3 small { color: #8f9db4; font-weight: 700; }
.friends-list { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
.friend-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 6px 8px; border: 1px solid #2d3a52; border-radius: 10px; background: #111827; }
.friend-row.invite, .friend-row.muted { grid-template-columns: minmax(0, 1fr) auto; }
.friend-row.muted { color: #9aa7bc; }
.friend-row .player-portrait { width: 38px; height: 38px; }
.friend-info { display: grid; gap: 1px; min-width: 0; }
.friend-info .item-meta { margin: 0; font-size: .7rem; }
.friend-top { display: flex; align-items: center; gap: 5px; min-width: 0; }
.friend-name { padding: 0; border: 0; background: none; font: inherit; font-weight: 800; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend-name:hover { text-decoration: underline; }
.friend-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: #4a566c; }
.friend-row.online .friend-dot { background: #5fe08a; box-shadow: 0 0 6px #5fe08a; }
.friend-tools { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.friend-tools button.small, .guild-invite-card button { min-height: 30px; padding: 2px 10px; font-size: .74rem; }
@media (max-width: 560px) {
  .friend-row { grid-template-columns: auto minmax(0, 1fr); }
  .friend-tools { grid-column: 1 / -1; justify-content: flex-start; }
}

/* Guilda: membros com nível, poder e Códice; convites. */
.guild-member-name { padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 800; cursor: pointer; }
.guild-member-name:hover { text-decoration: underline; }
.guild-member-stats { flex-basis: 100%; color: #95a3ba; font-size: .7rem; }
.guild-member-info { flex-wrap: wrap; }
.guild-invites { display: grid; gap: 6px; margin-bottom: 10px; }
.guild-invites[hidden] { display: none; }
.guild-invite-card { border-color: #c9a24d; background: linear-gradient(135deg, #2a2210, #121827); }
.ranking-name { padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; text-align: left; }
.ranking-name:hover { text-decoration: underline; }
.ranking-player { flex-wrap: wrap; }

/* Chat: quatro canais, conversa privada, item linkado e tag Celestial. */
.chat-tabs { flex-wrap: wrap; }
.chat-tabs button { position: relative; padding: 1px 8px; }
.chat-tab-badge { position: absolute; top: -6px; right: -5px; min-width: 15px; padding: 0 3px; border-radius: 999px; background: #e2524a; color: #fff; font-size: .58rem; line-height: 15px; }
.chat-tab-badge[hidden] { display: none; }
.chat-line { padding-right: 4px; }
.chat-line.celestial { box-shadow: inset 2px 0 0 #e6c15a; }
.chat-item { padding: 0 3px; border: 0; border-radius: 4px; background: color-mix(in srgb, var(--item-color) 16%, #0000); color: var(--item-color);
  font: inherit; font-weight: 800; cursor: pointer; text-shadow: 0 0 6px color-mix(in srgb, var(--item-color) 40%, #0000); }
.chat-item:hover, .chat-item:focus-visible { background: color-mix(in srgb, var(--item-color) 30%, #0000); outline: none; }
.chat-dm-bar { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 4px 8px; border-bottom: 1px solid #ffffff10; color: #c9d4e6; font-size: .72rem; }
.chat-dm-bar[hidden] { display: none; }
.chat-dm-bar b { color: #f5dfad; }
.chat-dm-bar .text-button { font-size: .72rem; }
.chat-conversation { list-style: none; }
.chat-conversation-open { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 7px; width: 100%; padding: 5px 7px; border: 1px solid #2d3a52;
  border-radius: 8px; background: #111827; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.chat-conversation-open:hover { border-color: #e8c786; }
.chat-conversation-open small { color: #8b97ad; font-size: .64rem; }
.chat-conversation.unread .chat-conversation-open { border-color: #e2524a; box-shadow: inset 3px 0 0 #e2524a; }
.chat-attachment { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-top: 1px solid #ffffff10; font-size: .72rem; }
.chat-attachment[hidden] { display: none; }
.chat-attachment small { color: #8b97ad; }
.chat-attachment-remove { margin-left: auto; padding: 0 6px; border: 1px solid #3c4c66; border-radius: 6px; background: #121a2a; color: #e8eef8; cursor: pointer; }
.chat-form[hidden] { display: none; }
.item-actions .chat-link-button { border-color: #4f6aa0; }
/* v40 · Modo Soneca, grupos da lupa e ícone de drop */
.drop-info .pixel-icon { width: 17px; height: 17px; }
.nap-toggle { position: absolute; z-index: 4; top: 41px; right: calc(var(--skill-gutter) + 8px); display: grid; place-items: center; width: 27px; height: 27px; padding: 0; color: #dce9fc; background: #111c2feb; border: 1px solid #6783a4; border-radius: 50%; line-height: 1; }
.nap-toggle .pixel-icon { width: 17px; height: 17px; }
.nap-toggle:hover { background: #315477; border-color: #b2d3ff; }
.nap-toggle.sleeping { background: #233f6b; border-color: #bfe3ff; box-shadow: 0 0 0 2px #bfe3ff40, 0 0 12px #8fc7ff99; animation: nap-glow 2.4s ease-in-out infinite; }
@keyframes nap-glow { 50% { box-shadow: 0 0 0 3px #bfe3ff55, 0 0 18px #8fc7ffcc; } }
.idle-stage .stage-tools { top: 10px; right: 10px; grid-auto-rows: 32px; gap: 4px; }
.idle-stage .stage-tools button {
  position: relative; inset: auto; box-sizing: border-box; display: grid; place-items: center;
  width: 32px; height: 32px; min-height: 32px; padding: 0; border-radius: 8px; zoom: 1;
}
.idle-stage .stage-tools button > span:not([data-icon]) { display: none; }
.idle-stage .stage-tools .tool-alert { top: 1px; right: 1px; transform: none; pointer-events: none; }
.idle-stage .drop-panel { right: 52px; top: 10px; }
.potion-wait { position: absolute; bottom: -5px; right: 0; padding: 0 4px; border-radius: 5px; background: #101628; color: #f6dd99; font-size: .65rem; }
.quick-potion.recharging { opacity: .7; cursor: wait; }
@media (max-width: 720px) {
  .idle-stage .stage-tools { display: flex; }
  .idle-stage .drop-panel { right: 8px; top: 48px; }
}
@media (min-width: 721px) and (max-height: 650px) {
  .idle-stage .stage-tools { grid-template-columns: repeat(2, 28px); grid-auto-rows: 28px; }
  .idle-stage .stage-tools button { width: 28px; height: 28px; min-height: 28px; }
  .idle-stage .drop-panel { right: 76px; }
}
.nap-dialog { width: min(470px, calc(100% - 20px)); }
.nap-badge { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #4a77b8, #1b2f52); color: #e6f3ff; font: 800 18px/1 system-ui, sans-serif; box-shadow: 0 0 10px #8fc7ff77; }
.nap-body { display: grid; gap: 8px; padding-top: 6px; }
.nap-lead { margin: 0 0 4px; color: #e5eefb; line-height: 1.45; }
.nap-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 10px; border-radius: 8px; background: #0f1a2b; border: 1px solid #23344f; font-size: 13px; }
.nap-row span { color: #a9bad3; }
.nap-row b { color: #f1f6ff; text-align: right; }
.nap-pick { display: grid; gap: 4px; font-size: 13px; color: #a9bad3; }
.nap-pick select { width: 100%; padding: 7px 9px; border-radius: 8px; background: #0f1a2b; color: #f1f6ff; border: 1px solid #3a5278; }
.nap-progress { width: 100%; height: 10px; accent-color: #8fc7ff; }
.nap-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.stats-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); align-items: start; gap: 10px; margin-top: 12px; }
.stats-group { padding: 8px 10px; border-radius: 10px; background: #0f1a2bcc; border: 1px solid #23344f; }
.stats-group .stats-subtitle { margin: 0 0 6px; }
.stats-group .stats-effects { display: grid; grid-template-columns: 1fr; gap: 4px; margin: 0; padding: 0; list-style: none; }
.stats-group .stats-effects li { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 5px 8px; font-size: 12.5px; }
.stats-group .stats-effects li span { flex: 1 1 auto; min-width: 0; }
.stats-group .stats-effects li b { flex: 0 1 auto; max-width: 58%; }
.stats-group .stats-effects li span { color: #a9bad3; }
.stats-group .stats-effects li b { color: #f1f6ff; text-align: right; }
.stats-group .stats-effects li b.muted { color: #6f809a; font-weight: 500; }
/* v40 · fundo da página com o panorama do cabeçalho */
.page-backdrop { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.page-backdrop .banner-art { position: absolute; inset: 0; width: 100%; height: 100%; }
/* v40 · celular: o baú de drop e o Z ficam numa coluna à direita do painel do herói, sem cobrir HP e XP */
@media (max-width: 720px) {
  .idle-stage .player-hud { padding-right: 42px; }
}
