:root {
  --bg: #0d1b2a;
  --panel: rgba(12, 24, 42, 0.94);
  --panel-2: #13263d;
  --slot: #1b3352;
  --slot-edge: #3b5f8a;
  --ink: #fff;
  --muted: rgba(255, 255, 255, 0.66);
  --accent: #ffd23f;
  --good: #4cd964;
  --bad: #ff5a4f;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: system-ui, -apple-system, sans-serif; overflow: hidden; }
canvas { display: block; }
button { font: inherit; color: inherit; }
.muted { color: var(--muted); }

/* ---------- overlays e cartões ---------- */
.overlay { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(5, 12, 22, 0.55); backdrop-filter: blur(3px); padding: 16px; }
.overlay[hidden] { display: none; }
.card { background: var(--panel); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 18px; padding: 22px 24px; width: min(460px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45); }
.card.wide { width: min(940px, 100%); }
.card.lobby { width: min(820px, 100%); }
h1 { margin: 0; font-size: 30px; font-weight: 900; letter-spacing: -0.5px; }
h1 span { color: var(--accent); }
h2 { margin: 0; font-size: 22px; font-weight: 800; }
fieldset { border: 0; padding: 0; margin: 0 0 14px; }
legend { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 0.08em; margin-bottom: 6px; }
label { font-size: 12px; color: var(--muted); }
select { width: 100%; padding: 9px; border-radius: 10px; background: var(--panel-2); color: var(--ink); border: 1px solid rgba(255, 255, 255, 0.15); font-size: 15px; margin-top: 4px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row2 label { display: flex; flex-direction: column; }

button.primary, #start { padding: 13px 18px; border: 0; border-radius: 12px; background: var(--accent); color: #1b1300; font-size: 17px; font-weight: 800; cursor: pointer; }
button.primary:hover:not(:disabled) { filter: brightness(1.08); }
button:disabled, button.off { opacity: 0.5; cursor: not-allowed; }
button.ghost { padding: 13px 18px; border-radius: 12px; background: transparent; border: 1px solid rgba(255, 255, 255, 0.28); font-weight: 700; cursor: pointer; }

.opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; color: var(--ink); font-size: 15px; }
.opt:hover { background: rgba(255, 255, 255, 0.06); }
.opt:has(input:checked) { border-color: rgba(255, 210, 63, 0.6); background: rgba(255, 210, 63, 0.08); }
.opt small { display: block; color: var(--muted); font-size: 12px; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--panel-2); border: 1px solid rgba(255, 255, 255, 0.12); font-weight: 800; font-size: 15px; }
.chip b { color: var(--muted); font-weight: 700; font-size: 12px; }
.chip.gold { color: var(--accent); }
.ico { width: 20px; height: 20px; }

/* ---------- saguão ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.chips { display: flex; gap: 8px; }
.lobby-body { display: grid; grid-template-columns: 240px 1fr; gap: 20px; }
.hero { display: flex; flex-direction: column; align-items: center; gap: 8px; }
#look-preview, #bag-preview { width: 220px; height: 270px; border-radius: 14px; background: radial-gradient(ellipse at 50% 85%, #7fc3e8 0%, #3c7fb0 55%, #23507a 100%); }
.hero-info { text-align: center; font-size: 14px; display: flex; flex-direction: column; gap: 2px; }
.lvl-row { display: flex; align-items: center; gap: 8px; width: 220px; margin-bottom: 4px; }
.xp { flex: 1; text-align: left; }
.xp-bar { height: 10px; border-radius: 6px; background: rgba(0, 0, 0, 0.4); overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.15); }
.xp-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #4cd964, #b6ff6b); transition: width 0.6s; }
.xp small { font-size: 11px; }
.levelup { color: var(--good); font-weight: 900; font-size: 18px; }
.lobby-nav { display: grid; grid-template-columns: repeat(3, 1fr) 1.4fr; gap: 10px; margin-top: 16px; }
.nav-btn { padding: 13px 10px; border-radius: 12px; border: 1px solid var(--slot-edge); background: linear-gradient(#21406a, #172f4f); font-weight: 800; cursor: pointer; }
.nav-btn:hover { filter: brightness(1.15); }
@media (max-width: 640px) {
  .lobby-body { grid-template-columns: 1fr; }
  .lobby-nav { grid-template-columns: 1fr 1fr; }
}

/* ---------- painéis ---------- */
.panel-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.panel-head h2 { margin-right: auto; }
.close { width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.25); background: transparent; font-size: 22px; line-height: 1; cursor: pointer; }
.tabs { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.tabs button { padding: 7px 12px; border-radius: 9px; border: 1px solid rgba(255, 255, 255, 0.15); background: var(--panel-2); font-weight: 700; font-size: 13px; cursor: pointer; }
.tabs button.active { background: var(--accent); color: #1b1300; border-color: var(--accent); }
.tabs.small { margin: 0; }
.hint { font-size: 12px; color: var(--muted); margin: 8px 0 0; }

/* slots e grades */
.slot { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 84px; height: 84px; border-radius: 14px; border: 2px solid var(--slot-edge); background: radial-gradient(circle at 50% 40%, #27466f, var(--slot)); cursor: pointer; padding: 4px; }
.slot canvas { width: 56px; height: 56px; }
.slot span { font-size: 10px; color: var(--muted); font-weight: 700; }
.slot:hover { border-color: var(--accent); }
.slot.filled span { display: none; }
.slot.big { width: 132px; height: 132px; }
.slot.big canvas { width: 104px; height: 104px; }
.plus { position: absolute; right: 6px; top: 4px; font-style: normal; font-weight: 900; font-size: 14px; color: var(--accent); text-shadow: 0 1px 2px #000; }
.plus:empty { display: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; align-content: start; min-height: 260px; padding: 10px; border-radius: 12px; background: rgba(0, 0, 0, 0.22); }
.cell { position: relative; aspect-ratio: 1; border-radius: 12px; border: 2px solid var(--slot-edge); background: radial-gradient(circle at 50% 40%, #27466f, var(--slot)); cursor: pointer; padding: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.cell canvas { width: 100%; height: auto; }
.cell:hover { border-color: var(--accent); }
.cell.on { border-color: var(--good); box-shadow: 0 0 0 2px rgba(76, 217, 100, 0.35) inset; }
.cell .count { position: absolute; right: 5px; bottom: 3px; font-size: 12px; font-weight: 900; text-shadow: 0 1px 2px #000; }
.cell .name { font-size: 10px; color: var(--muted); text-align: center; line-height: 1.1; margin-top: 2px; }
.tier1 { border-color: #3b5f8a; }
.tier2 { border-color: #36d1e0; box-shadow: 0 0 10px rgba(54, 209, 224, 0.35); }
.tier3 { border-color: #ffd23f; box-shadow: 0 0 12px rgba(255, 210, 63, 0.45); }

/* mochila */
.bag-body, .forge-body { display: grid; grid-template-columns: 360px 1fr; gap: 20px; }
@media (max-width: 760px) { .bag-body, .forge-body { grid-template-columns: 1fr; } }
.equip-stage { display: grid; grid-template-columns: 84px 1fr 84px; grid-template-rows: auto auto auto; gap: 10px; align-items: center; justify-items: center; }
.equip-stage #bag-preview { grid-column: 2; grid-row: 1 / span 3; width: 170px; height: 220px; }
.slot-hair { grid-column: 1; grid-row: 1; }
.slot-weapon { grid-column: 1; grid-row: 2; }
.slot-outfit { grid-column: 3; grid-row: 1; }
.slot-body { grid-column: 3; grid-row: 2; }
.stats { width: 100%; margin-top: 14px; border-collapse: collapse; font-size: 14px; }
.stats td { padding: 5px 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
.stats td:last-child { text-align: right; font-weight: 800; }
.stats tr.power td { color: var(--accent); font-size: 16px; }

/* ferreiro */
.anvil { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 16px; border-radius: 16px; background: radial-gradient(ellipse at 50% 60%, rgba(255, 160, 60, 0.18), rgba(0, 0, 0, 0.25)); }
.stone-row, .anvil-row { display: flex; gap: 14px; align-items: center; }
.forge-info { text-align: center; display: flex; flex-direction: column; gap: 4px; }
.forge-title { font-weight: 800; font-size: 16px; }
.rate { font-size: 15px; }
.rate b { font-size: 26px; color: var(--accent); margin-left: 6px; }
.result { min-height: 28px; font-weight: 900; font-size: 20px; text-align: center; }
.result.ok { color: var(--good); }
.result.fail { color: var(--bad); }
.test { font-size: 12px; display: flex; gap: 6px; align-items: center; }
.anvil.flash { animation: flash 0.5s; }
@keyframes flash { 0% { box-shadow: 0 0 0 0 rgba(255, 210, 63, 0.9); } 100% { box-shadow: 0 0 0 30px rgba(255, 210, 63, 0); } }
#forge-go { width: 100%; }

/* loja */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.good { border-radius: 14px; background: var(--panel-2); border: 1px solid rgba(255, 255, 255, 0.1); padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.good > canvas { width: 72px; height: 72px; }
.good .price canvas { width: 20px; height: 20px; }
.good .gname { font-weight: 800; font-size: 14px; }
.good .gdesc { font-size: 12px; color: var(--muted); min-height: 30px; }
.good .price { color: var(--accent); font-weight: 900; display: flex; gap: 4px; align-items: center; }
.good .buy { display: flex; gap: 6px; width: 100%; }
.good .buy button { flex: 1; padding: 8px 4px; font-size: 13px; white-space: nowrap; border-radius: 9px; border: 0; background: var(--accent); color: #1b1300; font-weight: 800; cursor: pointer; }
.good .owned { font-size: 12px; color: var(--muted); }

/* fim de partida: cartas */
.over-card { width: min(640px, 100%); text-align: center; }
#over-title { font-size: 30px; margin: 0 0 4px; }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 16px 0 8px; perspective: 800px; }
.rcard { aspect-ratio: 3 / 4; position: relative; cursor: pointer; transform-style: preserve-3d; transition: transform 0.6s; border: 0; padding: 0; background: none; }
.rcard.flipped { transform: rotateY(180deg); cursor: default; }
.rcard .face { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-weight: 800; font-size: 13px; }
.rcard .back { background: repeating-linear-gradient(45deg, #1e3a66 0 10px, #234476 10px 20px); border: 3px solid var(--accent); }
.rcard .back canvas { width: 100%; height: 100%; border-radius: 9px; }
.rcard .front { transform: rotateY(180deg); background: #f6efe0; color: #2a1d08; border: 3px solid var(--accent); }
.rcard .front canvas { width: 56%; height: auto; }
.rcard.mine .front { box-shadow: 0 0 0 4px var(--good); }
.rcard:not(.flipped):hover { transform: translateY(-4px); }
.reward-msg { min-height: 22px; font-weight: 800; color: var(--accent); }
.over-card .row2 { margin-top: 10px; }

/* ajuda em batalha */
#help { position: fixed; right: 12px; top: 12px; background: rgba(10, 20, 35, 0.72); border-radius: 12px; padding: 10px 14px; font-size: 12px; line-height: 1.7; color: var(--muted); }
#help b { color: var(--ink); }

/* ---------- Mochila no layout clássico ---------- */
.bag2 { display: grid; grid-template-columns: 400px minmax(0, 1fr); gap: 16px; }
@media (max-width: 860px) { .bag2 { grid-template-columns: 1fr; } }
.profile { padding: 14px; border-radius: 14px; background: rgba(0, 0, 0, 0.22); display: flex; flex-direction: column; gap: 10px; }
.prof-name { display: flex; align-items: center; gap: 8px; font-size: 17px; }
.prof-name .pw { margin-left: auto; font-size: 13px; }
.prof-name .pw b { color: #c0392b; font-size: 17px; }
.equip-grid { display: grid; grid-template-columns: 76px 1fr 76px; grid-template-areas: "a p e" "b p f" "c p g" "d p h"; gap: 8px; align-items: center; justify-items: center; }
.equip-grid .slot { width: 70px; height: 70px; }
.equip-grid .slot canvas { width: 50px; height: 50px; }
.equip-grid #bag-preview { width: 200px; height: 300px; }
.slot.locked { opacity: 0.55; cursor: default; }
.xp-line { display: flex; flex-direction: column; gap: 3px; }
.xp-line .xp-bar { height: 12px; }
.xp-line .xp-bar i { display: block; height: 100%; background: linear-gradient(90deg, #4cd964, #b6ff6b); }
.xp-line small { font-size: 11px; }
.attr-grid { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 6px 8px; align-items: center; font-size: 13px; font-weight: 700; }
.attr-grid .v { padding: 3px 8px; border-radius: 6px; background: rgba(0, 0, 0, 0.25); text-align: right; font-weight: 900; }
.bars { display: grid; grid-template-columns: auto 1fr; gap: 5px 8px; align-items: center; font-size: 12px; font-weight: 800; }
.bar { position: relative; height: 16px; border-radius: 8px; background: rgba(0, 0, 0, 0.35); overflow: hidden; }
.bar i { position: absolute; inset: 0 auto 0 0; border-radius: 8px; }
.bar b { position: relative; display: block; text-align: center; font-size: 11px; line-height: 16px; color: #fff; text-shadow: 0 1px 2px #000; }
.inv { display: flex; flex-direction: column; gap: 8px; }
.inv-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.inv-head .tabs { margin: 0; }
.inv-head .count { font-weight: 900; color: #2e8b3a; }
.inv-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; padding: 8px; border-radius: 12px; background: rgba(0, 0, 0, 0.18); }
.inv-grid .cell { padding: 4px; }
.inv-grid .cell.empty { cursor: default; }
.inv-grid .cell .name { display: none; }
.inv-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.inv-foot .chip { margin-right: auto; }
button.small { padding: 8px 16px; font-size: 14px; }

/* ---------- Pele de madeira e ouro (quando as imagens carregam) ---------- */
body.skinned .skin-window {
  background: none; box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5); border-radius: 0;
  border-style: solid; border-width: 52px 44px 52px 44px;
  border-image-source: var(--skin-janela); border-image-slice: var(--slice-janela); border-image-repeat: stretch;
  padding: 0 6px 4px; color: #4a2a12;
}
body.skinned .skin-window h2 { color: #5a2e0e; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4); }
body.skinned .skin-window .muted, body.skinned .skin-window .hint, body.skinned .skin-window label { color: rgba(74, 42, 18, 0.75); }
body.skinned .skin-window .close { color: #5a2e0e; border-color: rgba(90, 46, 14, 0.5); background: rgba(255, 255, 255, 0.35); }
/* Área do ferreiro: sem moldura, só um brilho quente de forja. */
body.skinned .skin-window .anvil { border: 0; border-radius: 16px; background: radial-gradient(ellipse at 50% 45%, rgba(255, 170, 60, 0.22), rgba(255, 170, 60, 0) 70%); }
body.skinned .skin-window .anvil.flash { animation: forgeflash 0.6s; }
@keyframes forgeflash { 0% { background-color: rgba(255, 220, 120, 0.6); } 100% { background-color: rgba(255, 220, 120, 0); } }
body.skinned .skin-panel {
  background: none; border-radius: 0;
  border-style: solid; border-width: 26px 24px;
  border-image-source: var(--skin-painel); border-image-slice: var(--slice-painel); border-image-repeat: stretch;
  padding: 2px 4px;
}
body.skinned .skin-window .slot, body.skinned .skin-window .cell {
  background: none; border-radius: 0; box-shadow: none;
  border-style: solid; border-width: 9px;
  border-image-source: var(--skin-slot); border-image-slice: var(--slice-slot); border-image-repeat: stretch;
  color: #4a2a12;
}
body.skinned .skin-window .slot span, body.skinned .skin-window .cell .name { color: rgba(74, 42, 18, 0.7); }
body.skinned .skin-window .cell.on { filter: drop-shadow(0 0 4px #2ecc40) drop-shadow(0 0 2px #2ecc40); }
body.skinned .skin-window .tier2 { filter: drop-shadow(0 0 4px #36d1e0); }
body.skinned .skin-window .tier3 { filter: drop-shadow(0 0 5px #ffb300); }
body.skinned .skin-window .slot:hover, body.skinned .skin-window .cell:hover:not(.empty) { filter: brightness(1.08) drop-shadow(0 0 3px #ffd23f); }
body.skinned .skin-window .tabs button {
  background: none; border-radius: 0; color: #f6e3c0; font-weight: 800;
  border-style: solid; border-width: 10px 14px; padding: 0 6px;
  border-image-source: var(--skin-aba); border-image-slice: var(--slice-aba); border-image-repeat: stretch;
}
body.skinned .skin-window .tabs button.active { color: #ffd23f; filter: brightness(1.2); }
body.skinned .skin-window .tabs button:disabled { opacity: 0.45; }
body.skinned .skin-window button.primary, body.skinned .skin-window .good .buy button {
  background: none; border-radius: 0; color: #4a2205;
  border-style: solid; border-width: 12px 16px; padding: 0 8px;
  border-image-source: var(--skin-botao); border-image-slice: var(--slice-botao); border-image-repeat: stretch;
}
body.skinned .skin-window button.primary:disabled { filter: grayscale(0.7); }
body.skinned .skin-window .inv-grid, body.skinned .skin-window .grid { background: rgba(120, 70, 30, 0.12); }
body.skinned .skin-window .attr-grid .v { background: rgba(255, 255, 255, 0.55); color: #4a2a12; }
body.skinned .skin-window .chip { background: rgba(90, 46, 14, 0.85); color: #ffd23f; }
body.skinned .skin-window .good { background: rgba(255, 255, 255, 0.35); border-color: rgba(90, 46, 14, 0.25); }
body.skinned .skin-window .good .gdesc, body.skinned .skin-window .good .owned { color: rgba(74, 42, 18, 0.75); }
body.skinned .skin-window .good .price { color: #9a5b00; }
body.skinned .skin-window .forge-title, body.skinned .skin-window .rate { color: #4a2a12; }
body.skinned .skin-window .rate b { color: #c0392b; }
body.skinned .skin-window .result.ok { color: #1e8a2e; }
body.skinned .skin-window .result.fail { color: #c0392b; }
body.skinned .skin-window .panel-head { margin: 6px 4px 12px; }
body.skinned .skin-window .slot span { font-size: 9px; }
body.skinned .skin-window .grid .cell .name { display: none; }
body.skinned .skin-window .grid { grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); }
body.skinned .skin-window .good .buy { flex-direction: column; gap: 4px; }
body.skinned .skin-window .good .buy button { width: 100%; min-width: 0; border-width: 9px 12px; padding: 0 4px; font-size: 13px; }
/* Loja: quantidade com − / + e um botão Comprar */
.good .qty { display: flex; align-items: center; gap: 8px; }
.good .qty .step { width: 30px; height: 30px; border-radius: 50%; border: 2px solid rgba(90, 46, 14, 0.6); background: rgba(255, 255, 255, 0.6); color: #5a2e0e; font-size: 18px; font-weight: 900; line-height: 1; cursor: pointer; padding: 0; }
.good .qty .step:hover { background: #ffd23f; }
.good .qty .n { min-width: 34px; text-align: center; font-weight: 900; font-size: 18px; }
.good .buy .buy-go { width: 100%; }
body.skinned .skin-window .good .buy { flex-direction: row; }
body.skinned .skin-window .good .buy .buy-go { font-size: 15px; }
body.skinned .skin-window .good .buy .buy-go:disabled, body.skinned .skin-window .good .buy .buy-go.off { filter: grayscale(0.8); opacity: 0.6; }
/* Mochila: só os slots que existem (Cabelo, Roupa | Arma, Corpo) e personagem menor. */
.equip-grid { grid-template-columns: 70px 1fr 70px; grid-template-areas: "a p e" "b p s" "c p h"; grid-template-rows: 1fr 1fr 1fr; gap: 10px 8px; }
.equip-grid #bag-preview { width: 170px; height: 226px; }
.equip-grid .slot { width: 66px; height: 66px; }
.equip-grid .slot canvas { width: 46px; height: 46px; }
.profile { overflow: hidden; }

/* Janelas com tamanho fixo e igual (Mochila, Ferreiro, Loja). */
.card.wide {
  width: min(960px, 100%);
  height: min(720px, calc(100vh - 32px));
  display: flex; flex-direction: column; overflow: hidden;
}
.card.wide > .panel-head { flex: none; }
.card.wide > .bag2, .card.wide > .forge-body, .card.wide > .shop-grid { flex: 1; min-height: 0; overflow-y: auto; }
.card.wide > .shop-body { flex: 1; min-height: 0; }
.card.wide > #shop-msg { flex: none; }
.shop-grid { align-content: start; }
/* Compactação para caber sem rolagem no tamanho fixo. */
.profile { gap: 7px; }
.equip-grid { gap: 8px; }
.inv-grid { gap: 4px; padding: 6px; }
.inv { gap: 6px; }
.card.wide > .shop-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 860px) { .card.wide > .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.equip-grid #bag-preview { height: 206px; width: 160px; }
.attr-grid { gap: 4px 8px; }
.bars { gap: 3px 8px; }
.bar { height: 15px; }
.bar b { line-height: 15px; }
.inv-grid { grid-auto-rows: 52px; }
.inv-grid .cell { aspect-ratio: auto; height: 52px; }
.inv-grid .cell canvas { width: auto; height: 100%; max-width: 100%; }
.equip-grid #bag-preview { height: 240px; width: 180px; }
.equip-grid { gap: 14px 8px; }

/* ---------- Cidade (tela inicial) ---------- */
.town { position: fixed; inset: 0; overflow: hidden; background: #8cc3e8; }
.town[hidden] { display: none; }
/* O palco mantém 2:1 e cobre a tela; os prédios ficam presos à praça. */
.town-stage { position: absolute; left: 50%; top: 50%; width: max(100vw, 200vh); aspect-ratio: 2 / 1; transform: translate(-50%, -50%); }
.town-bg { width: 100%; height: 100%; display: block; user-select: none; pointer-events: none; }
.building { position: absolute; transform: translate(-50%, -50%); background: none; border: 0; padding: 0; cursor: pointer; transition: transform 0.15s, filter 0.15s; }
.building img { width: 100%; display: block; filter: drop-shadow(0 10px 10px rgba(0, 0, 0, 0.35)); }
.building:hover, .building:focus-visible { transform: translate(-50%, -52%) scale(1.04); filter: brightness(1.1) drop-shadow(0 0 14px rgba(255, 215, 80, 0.95)); outline: none; }
.plate { position: absolute; left: 50%; bottom: -6%; transform: translateX(-50%); white-space: nowrap; padding: 6px 18px; font-weight: 900; font-size: clamp(14px, 1.3vw, 20px); color: #ffe7a6; text-shadow: 0 2px 0 #3a1c06; background: linear-gradient(#8a4f22, #5e3214); border: 2px solid #e0a940; border-radius: 10px; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4); }
body.skinned .plate { background: none; border-radius: 0; border-style: solid; border-width: 10px 16px; padding: 0 6px; border-image-source: var(--skin-aba); border-image-slice: var(--slice-aba); border-image-repeat: stretch; }

.town-top { position: absolute; left: 12px; right: 12px; top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; pointer-events: none; }
.town-top > * { pointer-events: auto; }
.town-top .logo { margin: 0; font-size: 34px; text-shadow: 0 3px 0 rgba(0, 0, 0, 0.45); }
.who { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 14px; background: rgba(40, 20, 6, 0.78); border: 2px solid #e0a940; min-width: 230px; }
.who-name { font-size: 16px; }
.who .xp-bar { width: 150px; height: 9px; margin: 4px 0 2px; }
.who small { font-size: 11px; color: rgba(255, 255, 255, 0.75); }
.town-top .chip { background: rgba(40, 20, 6, 0.78); border: 2px solid #e0a940; }

.town-bar { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; gap: 14px; padding: 8px 18px; border-radius: 18px; background: rgba(40, 20, 6, 0.8); border: 2px solid #e0a940; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45); }
.menu-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: 0; cursor: pointer; padding: 0; color: #ffe7a6; font-weight: 800; font-size: 13px; text-shadow: 0 1px 0 #000; }
.menu-btn img { width: 62px; height: 62px; object-fit: contain; transition: transform 0.12s; }
.menu-btn:hover img { transform: translateY(-4px) scale(1.06); }
.town-loading { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 10px 18px; border-radius: 12px; background: rgba(0, 0, 0, 0.6); font-weight: 800; }
.town-loading[hidden] { display: none; }
@media (max-width: 640px) {
  .town-top .logo { display: none; }
  .menu-btn img { width: 48px; height: 48px; }
}

/* ---------- Janela da Arena ---------- */
.arena-body { display: grid; grid-template-columns: 340px 1fr; gap: 18px; }
@media (max-width: 860px) { .arena-body { grid-template-columns: 1fr; } }
.arena-body .hero { align-items: center; justify-content: center; }
.arena-body #look-preview { width: 240px; height: 300px; border-radius: 14px; }
.hero-line { font-weight: 800; text-align: center; }
.arena-opts { display: flex; flex-direction: column; gap: 10px; }
.arena-opts #start { margin-top: auto; font-size: 20px; }
body.skinned .skin-window .opt { color: #4a2a12; }
body.skinned .skin-window .opt small { color: rgba(74, 42, 18, 0.7); }
body.skinned .skin-window .opt:hover { background: rgba(255, 255, 255, 0.35); }
body.skinned .skin-window .opt:has(input:checked) { background: rgba(255, 210, 63, 0.35); border-color: #c98a1a; }
body.skinned .skin-window select { background: rgba(255, 255, 255, 0.7); color: #4a2a12; border-color: rgba(90, 46, 14, 0.4); }
.card.wide > .arena-body { flex: 1; min-height: 0; overflow-y: auto; }
body.skinned .skin-window #start { background: none; border-radius: 0; color: #4a2205; border-style: solid; border-width: 14px 20px; padding: 0 8px; border-image-source: var(--skin-botao); border-image-slice: var(--slice-botao); border-image-repeat: stretch; }
/* Mais folga dentro da moldura da janela: os painéis internos não encostam nela. */
body.skinned .skin-window { border-width: 52px 50px 70px 50px; }
.inv-grid { grid-auto-rows: 49px; }
.inv-grid .cell { height: 49px; }

/* ---------- Caixa de informações do item ---------- */
.tip { position: fixed; z-index: 2147483500; /* acima de qualquer janela */ pointer-events: none; min-width: 210px; max-width: 280px; padding: 10px 12px; border-radius: 10px; background: rgba(28, 16, 6, 0.94); border: 2px solid #c98a1a; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 215, 120, 0.18); color: #f3e3c3; font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.tip[hidden] { display: none; }
.tip-title { font-weight: 900; font-size: 16px; margin-bottom: 2px; color: #fff; }
.tip-title.t2 { color: #5fe8ff; text-shadow: 0 0 8px rgba(54, 209, 224, 0.6); }
.tip-title.t3 { color: #ffd23f; text-shadow: 0 0 10px rgba(255, 179, 0, 0.7); }
.tip-row { display: flex; justify-content: space-between; gap: 12px; }
.tip-row span { color: #e0b56a; }
.tip-row b { color: #fff; }
.tip-row em { color: #4cd964; font-style: normal; font-weight: 800; }
.tip-line.muted { color: rgba(243, 227, 195, 0.65); font-size: 12px; }
.tip-line.gold { color: #ffd23f; font-weight: 800; }
.tip-line.equipped { margin-top: 4px; align-self: flex-start; padding: 2px 8px; border-radius: 6px; background: #c0392b; color: #fff; font-weight: 900; font-size: 11px; letter-spacing: 0.06em; }
.tip-plus { margin-top: 4px; display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: #e0b56a; }
.tip-bar { height: 7px; border-radius: 4px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.tip-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ff9f0a, #ffd23f); }
/* Margem interna em todas as janelas: nada encosta na moldura de madeira. */
body.skinned .skin-window { padding: 6px 16px 18px 16px; }
body.skinned .skin-window .panel-head { margin: 4px 0 10px; }
.inv-grid { grid-auto-rows: 46px; }
.inv-grid .cell { height: 46px; }
.arena-body #look-preview { width: 220px; height: 280px; }
body.skinned .skin-window { padding: 8px 24px 26px 24px; }
body.skinned .skin-window legend { color: rgba(74, 42, 18, 0.75); }
.inv-grid { grid-auto-rows: 44px; gap: 3px; }
.inv-grid .cell { height: 44px; }
.equip-grid #bag-preview { height: 220px; width: 170px; }
#toggle-body span { display: block !important; font-size: 10px; font-weight: 800; color: #5a2e0e; }
#toggle-body canvas { width: 36px !important; height: 36px !important; }
#toggle-body { gap: 0; }


/* Loja: abas e cartões compactos para os itens de batalha (descrição fica no balão). */
.card.wide > .shop-tabs { flex: none; }
.card.wide > .shop-grid.compact { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.shop-grid.compact .good { padding: 10px 8px; gap: 6px; }
.shop-grid.compact .good > canvas { width: 56px; height: 56px; }
.shop-grid.compact .good .gdesc { display: none; }
.good .gdesc { min-height: 44px; }

/* ===== HUD da batalha (layout do DDTank) ===== */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; font-family: system-ui, sans-serif; color: #fff; }
#hud[hidden] { display: none; }
#hud button, #hud canvas, #hud .h-slot { pointer-events: auto; }
#hud .txt { text-shadow: 0 1px 2px #000; }

/* Canto de cima à esquerda: retrato de quem joga + mensagens */
.h-tl { position: absolute; left: 10px; top: 8px; width: 420px; }
.h-me { position: relative; width: 120px; height: 150px; }
/* Sem disco fixo atrás do retrato: só aparece a aura do up da arma (+5/+10/+12). */
#h-portrait { position: relative; display: block; width: 120px; height: 153px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.45)); }
#h-lv { position: absolute; left: -4px; top: -4px; }
#h-lv canvas { display: block; }
#h-name { position: absolute; left: 124px; top: 8px; font-weight: 900; font-size: 15px; text-shadow: 0 1px 2px #000, 0 0 3px #000; white-space: nowrap; }
#h-log { margin-top: 6px; font-size: 13px; font-weight: 700; line-height: 1.45; text-shadow: 0 1px 2px #000, 0 0 3px #000; }
#h-log div { transition: opacity 1s; }
#h-log div.old { opacity: 0; }

/* Topo: vento entre os retratos dos times, contagem e PASS */
.h-top { position: absolute; left: 50%; top: 6px; transform: translateX(-50%); display: grid; grid-template-columns: auto 170px auto; column-gap: 12px; align-items: start; justify-items: center; }
.h-team { display: flex; gap: 6px; }
#h-team-l { justify-self: end; }
#h-team-r { justify-self: start; }
.h-mate { width: 58px; }
.h-mate canvas { width: 58px; height: 58px; display: block; border-radius: 8px; border: 3px solid #c9ced6; background: linear-gradient(#f4f7fa, #b9c6d3); box-shadow: 0 2px 4px rgba(0,0,0,.4); }
.h-mate .hp { height: 7px; margin-top: 3px; border-radius: 4px; background: rgba(0,0,0,.55); overflow: hidden; }
.h-mate .hp i { display: block; height: 100%; background: linear-gradient(#ff7468, #d1281c); }
.h-mate.turn canvas { border-color: #ffd23f; box-shadow: 0 0 10px #ffd23f; }
.h-mate.dead { filter: grayscale(1) brightness(.6); }
.h-wind { text-align: center; }
.h-wind .lbl { font-size: 13px; font-weight: 800; text-shadow: 0 1px 2px #000; }
.h-wind-row { margin-top: 2px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 4px 14px; border-radius: 22px; background: linear-gradient(#eef3f8, #b8c7d6); border: 2px solid #6f8193; color: #2a3b52; }
#h-wind-arrow { font-size: 22px; font-weight: 900; color: #3e7bd6; transition: transform .2s; display: inline-block; }
#h-wind-arrow.strong { color: #e24a2b; }
#h-wind-v { font-size: 20px; font-weight: 900; min-width: 34px; }
#h-timer { grid-column: 2; margin-top: 4px; font-size: 64px; font-weight: 900; line-height: 1; color: #ffb02e; -webkit-text-stroke: 2px #8a4a00; text-shadow: 0 3px 0 #7a3c00, 0 4px 8px rgba(0,0,0,.4); }
#h-timer.low { color: #ff4b3a; -webkit-text-stroke-color: #7a0d00; }
#h-pass { grid-column: 2; margin-top: 4px; padding: 6px 26px; font-size: 18px; font-weight: 900; color: #fff; border-radius: 8px; border: 2px solid #2d4d6e; background: linear-gradient(#6f9cc6, #3b6690); text-shadow: 0 1px 2px #000; cursor: pointer; }
#h-pass:hover { filter: brightness(1.15); }

/* Canto de cima à direita: botões + minimapa */
.h-tr { position: absolute; right: 8px; top: 8px; width: 244px; }
.h-btns { display: flex; justify-content: flex-end; gap: 4px; padding: 3px; background: rgba(60, 80, 105, .8); border-radius: 6px 6px 0 0; }
.h-btns button { width: 26px; height: 22px; border-radius: 5px; border: 1px solid rgba(255,255,255,.4); background: linear-gradient(#5a8fd0, #2f5f9a); color: #fff; font-weight: 900; font-size: 13px; cursor: pointer; padding: 0; }
#h-quit { background: linear-gradient(#ff6b5a, #c22b1c); }
#h-mini { display: block; width: 244px; height: 122px; border: 2px solid rgba(60, 80, 105, .8); border-top: 0; background: rgba(0,0,0,.2); }

/* Espaços de item (1–8, F/R, bandeja, Z/X/C) */
.h-slot { position: relative; width: 46px; height: 46px; padding: 0; border-radius: 8px; border: 2px solid #9a8a6a; background: linear-gradient(#fff8e6, #d8c7a0); cursor: pointer; box-shadow: 0 2px 3px rgba(0,0,0,.4); }
.h-slot canvas { display: block; width: 100%; height: 100%; }
.h-slot .k { position: absolute; right: 2px; top: -1px; font-size: 12px; font-weight: 900; color: #fff; text-shadow: 0 0 3px #000, 0 0 2px #000; }
.h-slot .n { position: absolute; right: 2px; bottom: 0; font-size: 11px; font-weight: 900; color: #fff; text-shadow: 0 0 3px #000, 0 0 3px #000; }
.h-slot .lock { position: absolute; inset: 0; display: grid; place-items: center; font-size: 16px; opacity: .8; }
.h-slot:hover:not(:disabled) { border-color: #ffd23f; filter: brightness(1.1); }
.h-slot:disabled { cursor: default; filter: grayscale(1) brightness(.7); }
.h-slot.used { filter: none; border-color: #4cd964; box-shadow: 0 0 8px #4cd964; }
.h-slot.locked { background: linear-gradient(#cfd5dc, #8d97a3); }

/* Coluna da direita: itens básicos 1–8 */
.h-props { position: absolute; right: 8px; top: 170px; display: flex; flex-direction: column; gap: 4px; padding: 6px 5px; border-radius: 10px; background: linear-gradient(90deg, rgba(150,170,195,.85), rgba(110,130,160,.85)); border: 2px solid #5d708a; }

/* Faixa de baixo */
.h-bottom { position: absolute; left: 0; right: 0; bottom: 18px; height: 94px; background: linear-gradient(#e6d3ad, #b89766); border-top: 3px solid #7a5530; box-shadow: 0 -2px 6px rgba(0,0,0,.35); }
#h-ruler { position: absolute; bottom: 0; height: 18px; background: repeating-linear-gradient(90deg, #f4e3c4 0 1px, transparent 1px 10%), linear-gradient(#d9814f, #b5562a); border-top: 2px solid #7a3a18; }
#h-ruler .mark { position: absolute; top: 1px; transform: translateX(-50%); font-size: 11px; font-weight: 800; color: #fff3df; text-shadow: 0 1px 1px #5a2a0a; }
#h-ruler .mark:first-child { transform: none; }
#h-ruler .mark:last-child { transform: translateX(-100%); }
#h-auto { position: absolute; left: 18px; bottom: 154px; padding: 6px 14px; border-radius: 8px; border: 2px solid #7a5530; background: linear-gradient(#ffe2a8, #e0a24f); color: #5a2e0e; font-weight: 900; font-size: 14px; cursor: pointer; }
#h-auto.on { background: linear-gradient(#a8ffb4, #3fbf56); border-color: #1d6b2a; color: #0d3a14; }
#h-dial { position: absolute; left: 6px; bottom: -6px; width: 150px; height: 150px; pointer-events: none !important; filter: drop-shadow(0 3px 4px rgba(0,0,0,.5)); }
.h-fr { position: absolute; left: 168px; bottom: 100px; display: flex; gap: 4px; padding: 4px; border-radius: 9px; background: rgba(70, 85, 105, .8); border: 2px solid #4b5a6d; }
.h-tray { position: absolute; left: 290px; bottom: 100px; display: flex; gap: 4px; padding: 4px; border-radius: 9px; background: rgba(70, 85, 105, .8); border: 2px solid #4b5a6d; }
.h-more { width: 18px; border-radius: 5px; border: 0; background: rgba(255,255,255,.25); color: #fff; font-weight: 900; cursor: pointer; padding: 0; }
.h-more[hidden] { display: none; }
.h-force { position: absolute; left: 168px; right: 440px; bottom: 10px; height: 72px; }
.h-force .ticks { position: relative; height: 16px; margin: 0 10px 0 64px; }
.h-force .ticks span { position: absolute; transform: translateX(-50%); font-size: 11px; font-weight: 800; color: #4a2c10; }
.h-force .track { position: relative; height: 28px; margin: 4px 10px 0 64px; border-radius: 5px; border: 2px solid #4a2c10; background: repeating-linear-gradient(90deg, rgba(255,255,255,.18) 0 1px, transparent 1px 2%), #3a3f46; overflow: visible; }
.h-force .track i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(#ff8c6e, #d6301c 55%, #9e1a0c); border-radius: 3px; }
#h-force-mark { position: absolute; top: -12px; width: 0; height: 0; transform: translateX(-7px); border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 11px solid #2f8cff; }
#h-force-mark[hidden] { display: none; }
.h-force .lbl { position: absolute; left: 0; bottom: 6px; font-size: 18px; font-weight: 900; font-style: italic; color: #fff; -webkit-text-stroke: 1px #4a2c10; text-shadow: 0 2px 0 #4a2c10; }
.h-zxc { position: absolute; right: 300px; bottom: 30px; display: flex; gap: 4px; }
.h-stats { position: absolute; right: 136px; bottom: 14px; width: 160px; display: flex; flex-direction: column; gap: 6px; }
.h-stat { position: relative; height: 26px; border-radius: 6px; border: 2px solid #4a2c10; background: #2b2f35; overflow: hidden; }
.h-stat i { position: absolute; left: 0; top: 0; bottom: 0; }
#h-energy i { background: linear-gradient(#a5ff6a, #3fa51c); }
#h-life i { background: linear-gradient(#ff8070, #d02a1a); }
.h-stat b { position: relative; display: block; text-align: center; line-height: 22px; font-size: 14px; font-weight: 900; text-shadow: 0 1px 2px #000; }
.h-stat span { position: absolute; right: 4px; top: 4px; font-size: 10px; font-weight: 800; opacity: .85; text-shadow: 0 1px 2px #000; }
#h-pow { position: absolute; right: 4px; bottom: -4px; width: 128px; height: 128px; cursor: pointer; filter: drop-shadow(0 3px 4px rgba(0,0,0,.5)); }
#h-pow.full { animation: powpulse 0.9s ease-in-out infinite; }
#h-pow.active { filter: drop-shadow(0 0 14px #ffd23f); }
@keyframes powpulse { 50% { filter: drop-shadow(0 0 12px #ffd23f); } }
#hud.waiting .h-bottom { filter: saturate(.85); }

/* Telas estreitas: esconde o que não cabe */
@media (max-width: 900px) {
  .h-zxc { display: none; }
  .h-force { right: 300px; }
  .h-tl { width: 260px; }
}
#h-pass.art { width: 128px; height: 50px; padding: 0; border: 0; background: center / contain no-repeat; color: transparent; text-shadow: none; font-size: 0; }
#h-pass.art:hover { filter: brightness(1.12); }

/* Mochila: 4 abas numa linha só (as células não encolhem). */
.inv-head .tabs { flex-wrap: nowrap; gap: 4px; }
body.skinned .skin-window .inv-head .tabs button { border-width: 9px 8px; padding: 0 2px; font-size: 11px; white-space: nowrap; }
/* Mochila: moldura das células mais fina para o ícone ficar maior. */
body.skinned .skin-window .inv-grid .cell { border-width: 6px; padding: 0; }

/* ===== Tela de carregamento ===== */
#loading { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; overflow: hidden; background: linear-gradient(#5fb4f0 0%, #9fd6f7 55%, #ffe3a6 100%); transition: opacity .6s ease; }
#loading[hidden] { display: none; }
#loading.out { opacity: 0; pointer-events: none; }
#loading img[data-art] { display: none; }
#loading.has-fundo .ld-art-bg { display: block; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#loading.has-fundo .ld-sky { display: none; }
#loading.has-logo .ld-art-logo { display: block; width: min(520px, 80vw); margin: 0 auto 10px; filter: drop-shadow(0 6px 10px rgba(0,0,0,.35)); animation: ldfloat 3s ease-in-out infinite; }
#loading.has-logo .ld-logo { display: none; }

/* Nuvens passando (sem arte de fundo) */
.ld-sky i { position: absolute; width: 220px; height: 70px; border-radius: 50px; background: #fff; opacity: .85; filter: blur(1px); animation: ldcloud linear infinite; }
.ld-sky i::before, .ld-sky i::after { content: ""; position: absolute; background: #fff; border-radius: 50%; }
.ld-sky i::before { width: 100px; height: 100px; left: 30px; top: -50px; }
.ld-sky i::after { width: 80px; height: 80px; left: 110px; top: -36px; }
.ld-sky i:nth-child(1) { top: 12%; animation-duration: 38s; animation-delay: -6s; }
.ld-sky i:nth-child(2) { top: 30%; transform: scale(.7); animation-duration: 52s; animation-delay: -30s; }
.ld-sky i:nth-child(3) { top: 62%; transform: scale(1.2); animation-duration: 45s; animation-delay: -18s; opacity: .6; }
.ld-sky i:nth-child(4) { top: 80%; transform: scale(.8); animation-duration: 60s; animation-delay: -44s; opacity: .7; }
@keyframes ldcloud { from { left: -260px; } to { left: 110%; } }

.ld-center { position: relative; width: min(620px, 92vw); text-align: center; }
.ld-logo { margin: 0 0 18px; font: 900 italic clamp(54px, 11vw, 104px)/1 system-ui, sans-serif; letter-spacing: -2px; color: #ffd23f; -webkit-text-stroke: 4px #6b3200; text-shadow: 0 6px 0 #6b3200, 0 10px 18px rgba(0,0,0,.35); animation: ldfloat 3s ease-in-out infinite; }
.ld-logo span { color: #ff5a3c; }
@keyframes ldfloat { 50% { transform: translateY(-8px) rotate(-1deg); } }

/* Barra de madeira + bomba com faísca */
.ld-bar { position: relative; height: 34px; margin: 0 22px; }
.ld-track { position: absolute; inset: 0; border-radius: 18px; border: 4px solid #6b3a14; background: linear-gradient(#4a2a12, #2c180a); box-shadow: inset 0 3px 6px rgba(0,0,0,.5), 0 4px 0 #3c1f08, 0 8px 14px rgba(0,0,0,.3); overflow: hidden; }
.ld-fill { width: 0; height: 100%; border-radius: 12px; background: repeating-linear-gradient(-45deg, rgba(255,255,255,.22) 0 12px, transparent 12px 24px), linear-gradient(#ffd23f, #ff8a00 60%, #e05a00); background-size: 34px 100%, 100% 100%; animation: ldstripes .8s linear infinite; }
@keyframes ldstripes { to { background-position: 34px 0, 0 0; } }
.ld-bomb { position: absolute; top: 50%; left: 0; width: 46px; height: 46px; transform: translate(-50%, -54%); }
.ld-bomb b { position: absolute; inset: 6px 4px 2px 4px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #7d8794, #222831 60%, #0d1014); border: 3px solid #111; animation: ldroll 1s linear infinite; }
.ld-bomb b::after { content: ""; position: absolute; width: 10px; height: 8px; left: 50%; top: -7px; transform: translateX(-50%); background: #555; border: 2px solid #111; border-radius: 2px; }
.ld-bomb i { position: absolute; width: 12px; height: 12px; left: 62%; top: -4px; border-radius: 50%; background: radial-gradient(#fff, #ffd23f 40%, #ff5a00 70%, transparent 72%); animation: ldspark .25s steps(2) infinite; }
@keyframes ldroll { to { transform: rotate(360deg); } }
@keyframes ldspark { 50% { transform: scale(1.6); opacity: .7; } }

.ld-row { display: flex; justify-content: space-between; margin: 14px 26px 0; font-weight: 900; font-size: 17px; color: #fff; text-shadow: 0 2px 0 #6b3a14, 0 0 6px rgba(0,0,0,.4); }
.ld-tip { min-height: 2.8em; margin: 18px auto 0; max-width: 520px; padding: 10px 16px; border-radius: 12px; background: rgba(40, 22, 8, .55); color: #ffeccc; font-weight: 700; font-size: 14px; line-height: 1.4; opacity: 0; transition: opacity .25s; }
.ld-tip.show { opacity: 1; }

/* ===== Menu: botão sem arte + bolinha vermelha ===== */
.menu-btn { position: relative; }
.menu-btn.no-art img { display: none; }
.menu-btn.no-art::before { content: attr(data-emoji); display: grid; place-items: center; width: 62px; height: 62px; font-size: 42px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.5)); transition: transform .12s; }
.menu-btn.no-art:hover::before { transform: translateY(-4px) scale(1.06); }
.menu-btn .dot { position: absolute; right: 2px; top: 0; width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ff8a7a, #e0261a); border: 2px solid #fff; box-shadow: 0 0 6px #ff3b30; animation: dotpulse 1s ease-in-out infinite; }
.menu-btn .dot[hidden] { display: none; }
@keyframes dotpulse { 50% { transform: scale(1.2); } }

/* ===== Missões ===== */
.quests-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 340px 1fr; gap: 18px; }
.q-list { display: flex; flex-direction: column; min-height: 0; }
.q-items { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 4px; }
.q-row { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 10px; border: 2px solid rgba(90, 46, 14, .35); background: rgba(255, 255, 255, .45); color: #4a2a12; font-weight: 800; font-size: 14px; text-align: left; cursor: pointer; }
.q-row:hover { background: rgba(255, 255, 255, .7); }
.q-row.sel { border-color: #c77d1a; background: #fff3d6; box-shadow: 0 0 0 2px rgba(255, 210, 63, .6); }
.q-row .q-mark { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #b9a483; color: #fff; font-size: 13px; }
.q-row.ready .q-mark { background: #e0261a; animation: dotpulse 1s ease-in-out infinite; }
.q-row.claimed { opacity: .6; }
.q-row.claimed .q-mark { background: #3aa64a; }
.q-row .q-prog { font-size: 12px; color: #8a5a20; }
.q-row.ready .q-prog { color: #d0301e; }
.q-detail { min-height: 0; overflow-y: auto; padding: 14px 18px; border-radius: 14px; background: rgba(255, 255, 255, .45); border: 2px solid rgba(90, 46, 14, .3); color: #4a2a12; display: flex; flex-direction: column; gap: 8px; }
.q-detail h3 { margin: 0; font-size: 22px; }
.q-kind { font-size: 12px; font-weight: 800; color: #a0661c; text-transform: uppercase; letter-spacing: .5px; }
.q-desc { margin: 0; font-size: 15px; line-height: 1.45; }
.q-sub { margin-top: 6px; font-weight: 900; font-size: 13px; color: #7a4a18; }
.q-bar { position: relative; height: 24px; border-radius: 12px; background: #3a2a1a; overflow: hidden; border: 2px solid #6b3a14; }
.q-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(#a5ff6a, #3fa51c); }
.q-bar b { position: relative; display: block; text-align: center; line-height: 20px; color: #fff; font-size: 13px; text-shadow: 0 1px 2px #000; }
.rw-row { display: flex; flex-wrap: wrap; gap: 10px; }
.rw { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 13px; }
.rw b { color: #4a2a12; }
.rw-xp .xp-ico { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 15px; color: #fff; background: radial-gradient(circle at 35% 30%, #8fd0ff, #2a6fd6); border: 3px solid #f6c453; box-shadow: 0 2px 3px rgba(0,0,0,.3); }
.q-claim { margin-top: auto; align-self: flex-start; font-size: 16px; }

/* ===== Diário ===== */
.d-sub { margin: 0 0 12px; font-weight: 800; color: #4a2a12; font-size: 15px; }
.d-days { display: grid; grid-template-columns: repeat(6, 1fr) 1.6fr; gap: 10px; align-items: stretch; }
.d-day { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 190px; padding: 10px 6px; border-radius: 14px; background: rgba(255, 255, 255, .45); border: 3px solid rgba(90, 46, 14, .3); color: #4a2a12; }
.d-day .rw-row { justify-content: center; }
.d-n { font-weight: 900; font-size: 15px; }
.d-day.now { background: #fff3d6; border-color: #f0a020; box-shadow: 0 0 14px rgba(255, 190, 40, .9); animation: daypulse 1.4s ease-in-out infinite; }
@keyframes daypulse { 50% { transform: translateY(-4px); } }
.d-day.got { opacity: .55; }
.d-day .d-check { position: absolute; inset: 0; display: grid; place-items: center; font-size: 64px; color: #3aa64a; text-shadow: 0 2px 0 #fff; }
.d-day.big { background: linear-gradient(#fff7e0, #ffe2a0); border-color: #d08a10; }
.d-foot { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.d-claim { font-size: 17px; }

/* ===== Aviso flutuante ===== */
.q-toast { position: fixed; left: 50%; top: 18px; transform: translateX(-50%); z-index: 90; padding: 12px 22px; border-radius: 14px; background: linear-gradient(#ffe7a0, #f0b030); border: 3px solid #8a4a00; color: #4a2200; font-weight: 900; font-size: 16px; box-shadow: 0 8px 20px rgba(0,0,0,.35); }
.q-toast[hidden] { display: none; }
.q-toast.show { animation: toastin .35s ease-out; }
@keyframes toastin { from { transform: translate(-50%, -30px); opacity: 0; } }
.over-quests { margin-top: 8px; font-weight: 800; color: #ffd23f; }
/* Diário: cartões maiores ocupando a janela */
#daily .card { display: flex; flex-direction: column; }
#daily .d-days { flex: 1; min-height: 0; max-height: 360px; margin: 8px 0; }
#daily .d-day { min-height: 0; }
#daily .d-foot { justify-content: center; }
.d-chest { width: 110px; height: 110px; filter: drop-shadow(0 4px 6px rgba(120, 70, 0, .35)); animation: ldfloat 2.4s ease-in-out infinite; }

/* ===== Ferreiro: Compor e Fundir ===== */
#forge .anvil[hidden] { display: none; }
.comp-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 4px 0; }
.comp-stat { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 8px; background: rgba(255,255,255,.5); border: 2px solid rgba(90,46,14,.25); color: #4a2a12; font-size: 13px; font-weight: 800; }
.comp-stat b { font-size: 15px; }
.comp-stat i { font-style: normal; font-size: 11px; opacity: .7; }
.comp-stat.s-atk { border-left: 6px solid #d9442e; }
.comp-stat.s-def { border-left: 6px solid #3a4aa8; }
.comp-stat.s-agi { border-left: 6px solid #2fa04e; }
.comp-stat.s-luk { border-left: 6px solid #d4ad2a; }
.comp-stat.target { background: #fff3c4; box-shadow: 0 0 0 2px #f0b030; }
.fuse-grid { display: grid; grid-template-columns: 64px 64px 30px 110px; grid-template-rows: 64px 64px; gap: 8px 10px; align-items: center; justify-content: center; margin: 6px 0 4px; }
.fuse-grid [data-fuse="0"] { grid-column: 1; grid-row: 1; }
.fuse-grid [data-fuse="1"] { grid-column: 2; grid-row: 1; }
.fuse-grid [data-fuse="2"] { grid-column: 1; grid-row: 2; }
.fuse-grid [data-fuse="3"] { grid-column: 2; grid-row: 2; }
.fuse-arrow { grid-column: 3; grid-row: 1 / span 2; font-size: 26px; font-weight: 900; color: #8a4a10; text-align: center; }
#fuse-out { grid-column: 4; grid-row: 1 / span 2; }
#fuse-out.mixed::after { content: "?"; position: absolute; right: 6px; top: 2px; font-weight: 900; font-size: 20px; color: #c4281a; }
body.skinned .skin-window .compose-panel.flash, body.skinned .skin-window .fuse-panel.flash { animation: forgeflash 0.6s; }
#forge .items .tabs[hidden] { display: none; }
.shop-grid.compact .good .gname { min-height: 2.5em; display: flex; align-items: center; justify-content: center; line-height: 1.2; }
/* Balão: composição */
.tip-line.tip-sub { margin-top: 6px; padding-top: 5px; border-top: 1px solid rgba(255, 220, 150, .25); color: #ffd23f; font-weight: 900; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.tip-row.comp { align-items: baseline; }
.tip-row.comp.on b { color: #4cd964; }
.tip-row.comp.off b { color: rgba(243, 227, 195, .4); font-weight: 600; }
.tip-row.comp.off span { opacity: .6; }
.tip-row.comp i { margin-left: auto; font-style: normal; font-size: 11px; color: rgba(243, 227, 195, .6); }
.tip-row.comp b { order: 2; min-width: 34px; text-align: right; }

/* ===== Ferreiro: Transferir ===== */
.tr-row { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 6px 0; }
.tr-swap { font-size: 34px; font-weight: 900; color: #8a4a10; }
.tr-preview { display: flex; flex-direction: column; gap: 6px; }
.tr-line { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 6px 10px; border-radius: 8px; background: rgba(255,255,255,.5); border: 2px solid rgba(90,46,14,.25); color: #4a2a12; font-size: 13px; }
.tr-line b { font-size: 14px; }
.tr-line span { font-weight: 900; color: #2e8b3a; }
.tr-line i { grid-column: 1 / -1; font-style: normal; font-size: 12px; opacity: .8; }
body.skinned .skin-window .transfer-panel.flash { animation: forgeflash 0.6s; }

/* ===== Cidade viva ===== */
.town-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.building .flagfx { position: absolute; left: 0; top: 0; width: 100%; height: auto; pointer-events: none; }

/* ===== Salão de Jogos ===== */
.lobby-win .panel-head .tabs { margin: 0 auto 0 18px; }
.lb-channel { margin-right: 10px; font-size: 13px; color: #6b3a14; }
.lb-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 230px; gap: 14px; }
.lb-main { display: flex; flex-direction: column; min-height: 0; gap: 8px; }
.lb-rooms { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 66px; gap: 8px; }
.lb-room { position: relative; display: grid; grid-template-columns: 44px 1fr auto; grid-template-rows: 1fr 1fr; align-items: center; column-gap: 8px; padding: 6px 12px 6px 8px; text-align: left; border-radius: 10px; border: 2px solid #5b7a3a; background: linear-gradient(#5f7d47, #3f5a2c); color: #fff; cursor: pointer; box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 2px 4px rgba(0,0,0,.3); }
.lb-room.inst { border-color: #3a5a7a; background: linear-gradient(#4f6f8f, #2c4560); }
.lb-room:hover:not(:disabled) { filter: brightness(1.12); box-shadow: 0 0 0 2px #ffd23f; }
.lb-room.full { opacity: .55; cursor: default; }
.lr-icon { grid-row: 1 / span 2; width: 44px; height: 44px; display: grid; place-items: center; font-size: 24px; border-radius: 8px; background: rgba(0,0,0,.25); }
.lr-name { font-weight: 900; font-size: 14px; text-shadow: 0 1px 1px #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lr-sub { grid-column: 2; font-size: 12px; color: #d8e8c8; }
.lb-room.inst .lr-sub { color: #cfe2f5; }
.lr-count { grid-column: 3; grid-row: 2; font-weight: 900; font-size: 16px; color: #ffd23f; text-shadow: 0 1px 1px #000; }
.lr-num { grid-column: 3; grid-row: 1; font-size: 11px; opacity: .7; text-align: right; }
.lb-pager { display: flex; align-items: center; gap: 8px; }
.lb-ticker { flex: 1; font-size: 12px; color: #8a4a10; font-weight: 700; padding: 4px 10px; border-radius: 6px; background: rgba(255,255,255,.4); }
.lb-pager button { padding: 6px 14px; border-radius: 8px; border: 2px solid #6b3a14; background: linear-gradient(#7bbf5a, #3f8a2c); color: #fff; font-weight: 900; cursor: pointer; }
.lb-pager button:disabled { filter: grayscale(1); opacity: .5; cursor: default; }
.lb-bottom { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 300px; gap: 10px; }
.lb-chat { display: flex; flex-direction: column; min-height: 0; border-radius: 10px; background: rgba(40, 30, 15, .78); border: 2px solid #6b3a14; }
.lb-chat-log { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 10px; font-size: 13px; color: #f3e3c3; line-height: 1.45; }
.lb-chat-log b { color: #ffd23f; }
.lb-chat-log .me b { color: #7fe3ff; }
.lb-chat-log .sys { color: #9fe88a; font-weight: 700; }
.lb-chat-log .warn { color: #ff9f7a; }
.lb-chat-in { display: flex; gap: 6px; padding: 6px; border-top: 1px solid rgba(255,255,255,.12); }
.lb-chat-in input { flex: 1; padding: 6px 10px; border-radius: 6px; border: 0; background: rgba(255,255,255,.9); font: inherit; }
.lb-chat-in button { padding: 0 12px; border-radius: 6px; border: 0; background: #ffd23f; font-weight: 900; cursor: pointer; }
.lb-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 1fr auto; gap: 8px; padding: 10px; border-radius: 12px; background: rgba(90, 60, 25, .35); border: 2px solid rgba(107,58,20,.5); }
.lb-act { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; background: none; cursor: pointer; color: #4a2a12; font-weight: 900; font-size: 15px; }
.lb-act b { font-size: 40px; line-height: 1; filter: drop-shadow(0 3px 2px rgba(0,0,0,.3)); transition: transform .12s; }
.lb-act:hover b { transform: translateY(-3px) scale(1.08); }
.lb-act.big b { font-size: 46px; }
.lb-act.small { grid-column: 1 / -1; flex-direction: row; font-size: 13px; padding: 4px; border-radius: 8px; background: rgba(255,255,255,.35); }
.lb-act.small b { font-size: 18px; }
.lb-side { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.lb-me { padding: 8px; border-radius: 12px; background: linear-gradient(#fff4dc, #f0d9a8); border: 2px solid #c98a3a; text-align: center; }
.lb-me-head { display: flex; align-items: center; gap: 6px; font-weight: 900; color: #4a2a12; }
.lb-me canvas { width: 140px; height: 168px; }
.lb-me-stats { display: flex; justify-content: space-around; font-size: 12px; color: #6b3a14; }
.lb-me-stats b { color: #c0392b; }
.lb-online { flex: 1; min-height: 0; display: flex; flex-direction: column; border-radius: 12px; background: rgba(255,255,255,.4); border: 2px solid rgba(107,58,20,.4); }
.lb-online-head { display: flex; justify-content: space-between; padding: 6px 10px; font-weight: 900; color: #4a2a12; border-bottom: 1px solid rgba(107,58,20,.3); }
.lb-online-head b { color: #2e8b3a; }
.lb-online-list { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 6px; }
.lo-row { display: flex; align-items: center; gap: 6px; padding: 3px 4px; border-radius: 6px; font-size: 13px; font-weight: 700; color: #4a2a12; }
.lo-row:nth-child(odd) { background: rgba(255,255,255,.35); }
.lo-row span { flex: 1; }
.lo-row i { font-style: normal; color: #3f8ce9; }

/* ===== Sala ===== */
.room-motto { margin: 0 auto 0 14px; padding: 4px 14px; border-radius: 8px; background: linear-gradient(#ffe28a, #f0b030); color: #6b3200; font-weight: 900; font-size: 13px; }
.room-win { display: flex; flex-direction: column; }
.room-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 300px 1fr 230px; gap: 12px; }
.room-slots { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 8px; padding: 8px; border-radius: 12px; background: rgba(107, 58, 20, .35); }
.rs-slot { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 10px; background: repeating-linear-gradient(90deg, #f1e0bf 0 6px, #ead5ae 6px 12px); border: 2px solid #b98a4a; overflow: hidden; }
.rs-free { font-size: 18px; font-weight: 900; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.rs-slot.on { background: linear-gradient(#ffe9b8, #f3c46a); }
.rs-slot.you { box-shadow: 0 0 0 3px #ffd23f inset; }
.rs-head { position: absolute; top: 4px; left: 6px; right: 6px; display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 900; color: #4a2a12; }
.rs-head b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-slot canvas { width: 100px; height: 122px; margin-top: 16px; }
.rs-owner { position: absolute; left: 6px; bottom: 4px; padding: 1px 8px; border-radius: 6px; background: #6b3a14; color: #ffd23f; font-size: 11px; font-weight: 900; }
.rs-kick { position: absolute; right: 4px; top: 22px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: #c0392b; color: #fff; font-weight: 900; cursor: pointer; padding: 0; line-height: 1; }
.room-center { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.room-banner { position: relative; flex: 1; min-height: 0; border-radius: 12px; border: 3px solid #8a5a20; overflow: hidden; background: radial-gradient(circle at 60% 35%, #ffe6a0, #f08a3a 45%, #8a2a1a); display: flex; flex-direction: column; justify-content: space-between; }
.room-banner.inst { background: radial-gradient(circle at 50% 30%, #bfe8ff, #3a8ad0 50%, #1c3c6c); }
.room-banner.i-cogumelos { background: radial-gradient(circle at 50% 30%, #d4f7b0, #4f9d3a 50%, #234d1a); }
.room-banner.i-piratas { background: radial-gradient(circle at 50% 30%, #ffe9b8, #2fa3c9 50%, #134a6b); }
.room-banner.i-dragao { background: radial-gradient(circle at 50% 30%, #d8d2c4, #6e7a6a 50%, #2a302a); }
.rb-title { padding: 14px 16px; font: 900 italic 34px/1 system-ui, sans-serif; color: #fff; -webkit-text-stroke: 2px #6b1a00; text-shadow: 0 3px 0 #6b1a00, 0 6px 10px rgba(0,0,0,.4); }
.rb-drops { margin: 8px; padding: 6px 8px; border-radius: 10px; background: rgba(30, 20, 5, .7); border: 2px solid #e0a940; }
.rb-drops-head { font-weight: 900; color: #ffd23f; font-size: 14px; margin-bottom: 4px; }
.rb-drops-grid { display: grid; grid-template-columns: repeat(auto-fill, 44px); gap: 6px; }
.rb-drop { width: 44px; height: 44px; border-radius: 8px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); }
.rb-drop canvas { width: 100%; height: 100%; }
.rb-match { margin: 8px; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; align-items: center; column-gap: 14px; padding: 8px 14px; border-radius: 10px; background: rgba(20, 15, 5, .75); color: #fff; }
.rb-mode { grid-row: 1 / span 2; padding: 8px; border-radius: 8px; background: #2c4560; font-weight: 900; font-size: 13px; }
.rb-match b { font: 900 42px/1 system-ui, sans-serif; color: #ffd23f; }
.rb-match span:last-child { font-weight: 800; font-size: 16px; }
.room-info { position: relative; padding: 8px 12px; border-radius: 12px; background: linear-gradient(#f6e3bd, #e8c98c); border: 2px solid #b98a4a; color: #4a2a12; }
.ri-head { font-weight: 900; font-size: 13px; margin-bottom: 4px; }
.ri-row { display: flex; gap: 8px; font-size: 14px; }
.ri-row span { width: 90px; color: #8a5a20; font-weight: 700; }
.ri-gear { position: absolute; right: 8px; bottom: 8px; width: 40px; height: 40px; border-radius: 50%; border: 2px solid #8a5a20; background: #fff3d6; font-size: 20px; cursor: pointer; }
.ri-gear:disabled { opacity: .4; cursor: default; }
.room-right { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.rt-box { padding: 8px; border-radius: 12px; background: rgba(107, 58, 20, .35); border: 2px solid rgba(107,58,20,.5); }
.rt-head { font-weight: 900; color: #fff3d6; text-shadow: 0 1px 1px #000; font-size: 14px; margin-bottom: 6px; }
.rt-hint { font-size: 11px; color: #fff3d6; opacity: .8; margin-top: 4px; }
.rt-mine, .rt-buy { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.rt-buy { grid-template-columns: repeat(4, 1fr); }
.rt-slot, .rt-item { position: relative; aspect-ratio: 1; border-radius: 10px; border: 2px solid #6b3a14; background: linear-gradient(#5a6a7a, #2f3a46); cursor: pointer; padding: 2px; }
.rt-slot canvas, .rt-item canvas { width: 100%; height: 100%; display: block; }
.rt-slot:hover, .rt-item:hover { border-color: #ffd23f; }
.rt-key { position: absolute; left: 3px; top: 0; font-size: 11px; font-weight: 900; color: #ffd23f; text-shadow: 0 0 2px #000; }
.rt-n, .rt-have { position: absolute; right: 3px; bottom: 1px; font-size: 11px; font-weight: 900; color: #fff; text-shadow: 0 0 3px #000; }
.rt-price { position: absolute; left: 2px; bottom: 1px; font-size: 10px; font-weight: 900; color: #ffd23f; text-shadow: 0 0 3px #000; }
.room-actions { margin-top: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: end; }
.ra-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: none; cursor: pointer; font-weight: 900; color: #4a2a12; }
.ra-btn b { font-size: 30px; }
.ra-btn:disabled { opacity: .4; cursor: default; }
.ra-start { grid-column: 1 / -1; padding: 14px; border-radius: 16px; border: 3px solid #8a2a00; background: radial-gradient(circle at 40% 30%, #fff1a8, #ffb21e 50%, #e05a00); color: #fff; font: 900 italic 30px/1 system-ui, sans-serif; -webkit-text-stroke: 1.5px #6b1a00; text-shadow: 0 3px 0 #6b1a00; cursor: pointer; box-shadow: 0 6px 12px rgba(0,0,0,.35); }
.ra-start:hover { filter: brightness(1.08); transform: translateY(-1px); }
.ra-start.cancel { background: radial-gradient(circle at 40% 30%, #ffd0c0, #ff6a4a 50%, #b02a10); }
.room-chat { height: 92px; margin-top: 8px; border-radius: 10px; background: rgba(40, 30, 15, .78); border: 2px solid #6b3a14; display: flex; }

/* ===== Configuração da sala ===== */
.cfg-win { display: flex; flex-direction: column; }
.cfg-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; color: #4a2a12; }
.cfg-modes { display: flex; gap: 8px; }
.cfg-mode { padding: 8px 18px; border-radius: 10px; border: 2px solid #8a5a20; background: #fff3d6; font-weight: 900; cursor: pointer; }
.cfg-mode.on { background: linear-gradient(#ffe28a, #f0b030); }
.cfg-mode.locked { opacity: .5; cursor: default; }
.cfg-inst-top { display: grid; grid-template-columns: 1.3fr 1fr; gap: 10px; }
.cfg-banner { min-height: 130px; border-radius: 12px; display: flex; align-items: flex-end; padding: 10px; font: 900 italic 24px/1 system-ui, sans-serif; color: #fff; -webkit-text-stroke: 1px #2a1000; text-shadow: 0 2px 0 #2a1000; border: 3px solid #8a5a20; }
.cfg-banner.i-cogumelos, .cfg-inst.i-cogumelos { background: radial-gradient(circle at 50% 30%, #d4f7b0, #4f9d3a 55%, #234d1a); }
.cfg-banner.i-piratas, .cfg-inst.i-piratas { background: radial-gradient(circle at 50% 30%, #ffe9b8, #2fa3c9 55%, #134a6b); }
.cfg-banner.i-dragao, .cfg-inst.i-dragao { background: radial-gradient(circle at 50% 30%, #d8d2c4, #6e7a6a 55%, #2a302a); }
.cfg-desc { padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,.55); border: 2px solid rgba(107,58,20,.3); font-size: 13px; }
.cfg-desc p { margin: 6px 0 0; }
.cfg-insts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cfg-inst { min-height: 58px; border-radius: 10px; border: 3px solid #8a5a20; background: #5a3a1a; color: #fff; font-weight: 900; font-size: 14px; text-shadow: 0 1px 2px #000; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.cfg-inst.on { border-color: #ffd23f; box-shadow: 0 0 10px #ffd23f; }
.cfg-inst.locked { filter: grayscale(.8) brightness(.7); cursor: default; }
.cfg-inst small { font-size: 11px; opacity: .9; }
.cfg-row { display: flex; flex-direction: column; gap: 6px; }
.cfg-head { font: 900 18px/1 system-ui, sans-serif; color: #c0561a; }
.cfg-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.cfg-opt { min-width: 120px; padding: 10px 16px; border-radius: 10px; border: 2px solid #8a5a20; background: linear-gradient(#fffaf0, #e8d6b0); font-weight: 900; font-size: 15px; cursor: pointer; color: #4a2a12; }
.cfg-opt.on { background: linear-gradient(#ffe28a, #f0b030); box-shadow: 0 0 0 2px #fff inset; }
.cfg-opt:disabled { opacity: .45; cursor: default; }
.cfg-foot { display: flex; justify-content: flex-end; margin-top: 10px; }
.rb-match[hidden], .rb-drops[hidden] { display: none; }
/* Sala: chat embaixo das vagas e do centro; a coluna da direita vai até o Início. */
.room-body { grid-template-columns: 300px 1fr 230px; grid-template-rows: minmax(0, 1fr) 96px; grid-template-areas: "slots center right" "chat chat right"; }
.room-slots { grid-area: slots; }
.room-center { grid-area: center; }
.room-right { grid-area: right; overflow: hidden; }
.room-chat { grid-area: chat; height: auto; margin-top: 0; min-height: 0; }
.rt-box { padding: 6px; }
.rt-buy { gap: 4px; }
.rt-hint { display: none; }
.ra-start { padding: 10px; font-size: 26px; }
.ra-btn b { font-size: 24px; }
/* Sala: ícones das ferramentas encolhem para caber (nada passa da borda). */
.room-body { grid-template-columns: 280px minmax(0, 1fr) 250px; }
.rt-mine { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rt-buy { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rt-slot, .rt-item { min-width: 0; }
.rt-slot canvas, .rt-item canvas { width: 100%; height: auto; min-width: 0; }
.room-chat { flex-direction: column; }

/* Régua em unidades do mapa: traço grande a cada unidade, pequeno a cada meia. */
#h-ruler { background: repeating-linear-gradient(90deg, #f4e3c4 0 2px, transparent 2px var(--u, 10%)), repeating-linear-gradient(90deg, rgba(244,227,196,.55) 0 1px, transparent 1px calc(var(--u, 10%) / 2)), linear-gradient(#d9814f, #b5562a); }
#h-ruler .mark { transform: translateX(3px); }
#h-ruler .mark:first-child, #h-ruler .mark:last-child { transform: translateX(3px); }

.h-wind-prev { margin-top: 3px; padding: 1px 10px; border-radius: 10px; background: rgba(40, 60, 90, .75); color: #cfe6ff; font-size: 12px; font-weight: 800; display: inline-block; }
.h-wind-prev[hidden] { display: none; }

/* Mochila: espaço da arma secundária (3 linhas de espaços em volta do boneco). */
.equip-grid { grid-template-areas: "a p e" "b p s" "c p h"; grid-template-rows: 1fr 1fr 1fr; gap: 6px 8px; }

/* ===== Loja: provador e carrinho (como no DDTank) ===== */
.shop-body { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 12px; min-height: 0; }
.shop-body .shop-grid { min-height: 0; overflow-y: auto; align-content: start; padding-right: 4px; }
.shop-side { display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow-y: auto; }
.fitting, .cart { border-radius: 14px; background: rgba(255, 255, 255, 0.35); border: 2px solid rgba(90, 46, 14, 0.3); padding: 8px; }
.fit-head, .cart-head { display: flex; justify-content: space-between; align-items: center; font-size: 14px; color: #5a2e0e; }
.fit-reset { border: 0; border-radius: 8px; padding: 3px 8px; background: rgba(90, 46, 14, 0.15); color: #5a2e0e; font-weight: 800; font-size: 12px; cursor: pointer; }
.fit-reset:hover { background: #ffd23f; }
#shop-preview { display: block; width: auto; height: 150px; aspect-ratio: 200 / 230; margin-left: auto; margin-right: auto; margin-top: 4px; border-radius: 10px; background: radial-gradient(ellipse at 50% 85%, #7fc3e8 0%, #3c7fb0 55%, #23507a 100%); }
.fit-weapon { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.fit-weapon canvas { width: 40px; height: 40px; flex: none; }
.fit-weapon b { display: block; font-size: 13px; color: #4a2a12; }
.fit-weapon small { font-size: 12px; font-weight: 700; color: rgba(74, 42, 18, 0.8); }
.fit-weapon .up { color: #1f8a3a; } .fit-weapon .down { color: #c0392b; }
.cart { display: flex; flex-direction: column; gap: 6px; flex: 1; min-height: 0; }
.cart-list { flex: 1; min-height: 34px; max-height: 120px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.cart-empty { margin: 6px 0; font-size: 12px; color: rgba(74, 42, 18, 0.7); text-align: center; }
.cart-row { display: grid; grid-template-columns: 26px 1fr auto 20px; gap: 6px; align-items: center; font-size: 12px; font-weight: 700; color: #4a2a12; padding: 2px 4px; border-radius: 8px; background: rgba(255, 255, 255, 0.45); }
.cart-row canvas { width: 26px; height: 26px; }
.cart-row .cn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-row .cp { color: #9a5b00; font-weight: 900; }
.cart-row .cx { border: 0; background: none; color: #c0392b; font-size: 16px; font-weight: 900; cursor: pointer; padding: 0; }
.cart-total { display: flex; justify-content: space-between; align-items: center; font-weight: 900; color: #4a2a12; border-top: 2px dashed rgba(90, 46, 14, 0.3); padding-top: 6px; }
.cart-total .ct { display: flex; align-items: center; gap: 4px; color: #9a5b00; font-size: 17px; }
.cart-total canvas { width: 20px; height: 20px; }
.cart-after { text-align: right; font-weight: 800; color: #1f8a3a; min-height: 14px; }
.cart-after.down { color: #c0392b; }
.cart-buy { padding: 8px; flex: none; border-radius: 12px; border: 3px solid #8a4a00; background: linear-gradient(#ffe28a, #f0a020); color: #4a2200; font-weight: 900; font-size: 16px; cursor: pointer; }
.cart-buy.off { filter: grayscale(0.8); opacity: 0.6; cursor: not-allowed; }
.good.wear > canvas { cursor: pointer; }
.good.wear.trying { outline: 3px solid #ffd23f; outline-offset: -3px; background: rgba(255, 236, 160, 0.6); }
.good.wear.has .price { color: #1f8a3a; }
.good .buy.row { flex-direction: row !important; }
body.skinned .skin-window .good .buy.row .cart-go { flex: 0 0 44px; }
body.skinned .skin-window .good .buy .try-go { background: linear-gradient(#bfe6ff, #5aa8e8); color: #0d2f55; }
@media (max-width: 760px) { .shop-body { grid-template-columns: 1fr; } .shop-side { flex-direction: row; } .fitting, .cart { flex: 1; } }

.shop-search { margin: -2px 0 8px; padding: 8px 12px; border-radius: 10px; border: 2px solid rgba(90, 46, 14, 0.35); background: rgba(255, 255, 255, 0.7); font: 700 14px system-ui, sans-serif; color: #4a2a12; width: 100%; }
.shop-search:focus { outline: none; border-color: #c98a1a; background: #fff; }
.shop-tabs button.dim { opacity: 0.55; }
.shop-none { grid-column: 1 / -1; text-align: center; color: rgba(74, 42, 18, 0.75); font-weight: 700; }
/* Loja: 9 abas numa linha só */
body.skinned .skin-window .shop-tabs { flex-wrap: nowrap; gap: 3px; }
body.skinned .skin-window .shop-tabs button { border-width: 9px 8px; padding: 0 2px; font-size: 12px; white-space: nowrap; }

/* ===== Conta: Entrar / Criar conta ===== */
#account { z-index: 5000; }
.acc-card { width: min(420px, 100%); padding-bottom: 18px; }
.acc-card h2 { margin: 0 auto; font-size: 30px; }
.acc-tabs { justify-content: center; margin: 4px 0 10px; }
.acc-form { display: flex; flex-direction: column; gap: 10px; padding: 0 8px; }
.acc-form[hidden] { display: none; }
.acc-form label { display: flex; flex-direction: column; gap: 4px; font-weight: 800; font-size: 14px; color: #4a2a12; }
.acc-form input { padding: 10px 12px; border-radius: 10px; border: 2px solid rgba(90, 46, 14, 0.35); background: rgba(255, 255, 255, 0.85); font: 600 16px system-ui, sans-serif; color: #2a1608; }
.acc-form input:focus { outline: none; border-color: #c98a1a; background: #fff; }
.acc-form input.bad { border-color: #c0392b; background: #ffecea; }
.acc-err { margin: 0; min-height: 18px; color: #c0392b; font-weight: 800; font-size: 14px; }
.acc-go { padding: 12px; border-radius: 12px; border: 3px solid #8a4a00; background: linear-gradient(#ffe28a, #f0a020); color: #4a2200; font-weight: 900; font-size: 18px; cursor: pointer; }
.acc-go:disabled { opacity: 0.6; cursor: wait; }
.acc-out { cursor: pointer; border: 0; font-weight: 800; }

/* ===== Ficha do jogador ===== */
button.lo-row { width: 100%; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; border-radius: 8px; }
button.lo-row:hover { background: rgba(255, 210, 63, 0.35); }
.rs-slot.on { cursor: pointer; }
#pcard { z-index: 4000; }
.pc-card { width: min(640px, 100%); }
.pc-body { display: grid; grid-template-columns: 250px 1fr; gap: 16px; padding: 4px 6px 10px; color: #4a2a12; }
.pc-left { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.pc-preview { width: 200px; height: 250px; border-radius: 14px; background: radial-gradient(ellipse at 50% 85%, #7fc3e8 0%, #3c7fb0 55%, #23507a 100%); }
.pc-gear { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; width: 100%; }
.pc-slot { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px; border-radius: 10px; background: rgba(255, 255, 255, 0.45); border: 2px solid rgba(90, 46, 14, 0.25); font-size: 11px; font-weight: 800; }
.pc-slot canvas { width: 40px; height: 40px; }
.pc-slot.t1 { border-color: #f0c050; } .pc-slot.t2 { border-color: #ff9a3c; } .pc-slot.t3 { border-color: #00c8ff; box-shadow: 0 0 6px #00c8ff; }
.pc-plus { position: absolute; top: 2px; right: 4px; font-style: normal; color: #c0392b; font-weight: 900; }
.pc-right { display: flex; flex-direction: column; gap: 10px; }
.pc-level { display: flex; align-items: center; gap: 8px; font-size: 18px; }
.pc-power { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-radius: 12px; background: linear-gradient(#ffe28a, #f0a020); border: 2px solid #8a4a00; font-weight: 800; }
.pc-power b { font-size: 22px; color: #6b1a00; }
.pc-stats { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.4); font-weight: 700; }
.pc-stats b { text-align: right; font-weight: 900; }
.pc-record { display: flex; flex-wrap: wrap; gap: 8px; font-weight: 800; font-size: 13px; }
.pc-record span { padding: 4px 8px; border-radius: 8px; background: rgba(255, 255, 255, 0.45); }
@media (max-width: 620px) { .pc-body { grid-template-columns: 1fr; } }

/* ===== Amigos (estilo console do Habbo) ===== */
.friends-panel, .dm-win { position: fixed; right: 16px; bottom: 96px; z-index: 3000; width: min(330px, calc(100vw - 32px)); max-height: min(460px, 70vh); display: flex; flex-direction: column; padding: 10px; border-radius: 16px; background: #f3e0b0; border: 3px solid #8a5a20; box-shadow: 0 10px 30px rgba(0,0,0,.45); color: #4a2a12; }
.friends-panel[hidden], .dm-win[hidden] { display: none; }
.dm-win { right: calc(16px + min(330px, calc(100vw - 32px)) + 10px); height: min(380px, 60vh); }
@media (max-width: 760px) { .dm-win { right: 16px; bottom: 120px; } }
.fp-head { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.fp-head .fp-online { flex: 1; font-size: 12px; font-weight: 700; color: #1f8a3a; }
.fp-x { border: 0; background: none; font-size: 22px; font-weight: 900; color: #8a5a20; cursor: pointer; margin-left: auto; }
.fp-tabs { display: flex; gap: 4px; margin: 8px 0; }
.fp-tabs button { flex: 1; position: relative; padding: 6px 4px; border-radius: 9px; border: 2px solid rgba(90,46,14,.3); background: rgba(255,255,255,.5); font-weight: 800; font-size: 12px; color: #5a2e0e; cursor: pointer; }
.fp-tabs button.on { background: #ffd23f; border-color: #c98a1a; }
.fp-n { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #e0261a; color: #fff; font-size: 11px; font-style: normal; font-weight: 900; margin-left: 4px; }
.fp-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 5px; }
.fp-row { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 10px; background: rgba(255,255,255,.45); }
.fp-row:not(.on) .fp-head-ico canvas { filter: grayscale(1); opacity: .65; }
.fp-head-ico { position: relative; width: 34px; height: 34px; flex: none; }
.fp-head-ico canvas { width: 34px; height: 34px; border-radius: 50%; background: #cfe8ff; }
.fp-head-ico.on::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: #3ad16b; border: 2px solid #fff; }
.fp-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fp-info b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.fp-info small { font-size: 11px; font-weight: 700; color: rgba(74,42,18,.7); }
.fp-row.on .fp-info small { color: #1f8a3a; }
.fp-btn { position: relative; border: 2px solid rgba(90,46,14,.35); border-radius: 8px; background: #fff7dc; padding: 3px 7px; font-weight: 800; font-size: 12px; cursor: pointer; color: #4a2a12; }
.fp-btn:hover { background: #ffd23f; }
.fp-btn.ok { background: linear-gradient(#bff0a0, #5fc23a); border-color: #2f7a1a; }
.fp-btn.rm { color: #c0392b; }
.fp-btn .fp-n { position: absolute; top: -8px; right: -8px; margin: 0; }
.fp-empty { font-size: 12px; font-weight: 700; color: rgba(74,42,18,.75); text-align: center; margin: 10px 4px; }
.fp-add { display: flex; gap: 6px; }
.fp-add input, .dm-form input { flex: 1; min-width: 0; padding: 7px 10px; border-radius: 9px; border: 2px solid rgba(90,46,14,.35); font: 600 14px system-ui, sans-serif; }
.dm-tabs { display: flex; gap: 4px; overflow-x: auto; margin: 8px 0 6px; }
.dm-tab { display: flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 9px; border: 2px solid rgba(90,46,14,.3); background: rgba(255,255,255,.5); font-weight: 800; font-size: 12px; white-space: nowrap; cursor: pointer; }
.dm-tab.on { background: #ffd23f; }
.dm-tab-x { color: #c0392b; font-weight: 900; }
.dm-lines { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding: 6px; border-radius: 10px; background: rgba(255,255,255,.55); font-size: 13px; }
.dm-line b { color: #2a6fd6; }
.dm-line.me b { color: #c06a00; }
.dm-form { display: flex; gap: 6px; margin-top: 6px; }
.pc-friend { display: flex; gap: 8px; flex-wrap: wrap; }
.pc-fbtn { flex: 1; padding: 9px 10px; border-radius: 12px; border: 3px solid #2f7a1a; background: linear-gradient(#bff0a0, #5fc23a); color: #123d06; font-weight: 900; font-size: 14px; cursor: pointer; }
.pc-fbtn.done { border-color: rgba(90,46,14,.35); background: rgba(255,255,255,.6); color: #4a2a12; cursor: default; }

.fp-n[hidden] { display: none; }
.friends-panel, .dm-win { background: linear-gradient(#fbecc4, #f0d79c); border: 4px solid #8a5a20; outline: 2px solid #e8b04a; outline-offset: -8px; }
.fp-head b { white-space: nowrap; }

/* Itens usados na vez (acima da barra de força) */
.h-used { position: absolute; right: 6px; bottom: 74px; display: flex; gap: 4px; pointer-events: none; }
.h-used .hu-ico { width: 32px; height: 32px; border-radius: 8px; background: rgba(255, 248, 220, 0.92); border: 2px solid #8a5a20; box-shadow: 0 2px 4px rgba(0,0,0,.35); animation: hupop .35s cubic-bezier(.2,1.6,.4,1); }
@keyframes hupop { from { transform: scale(.2) translateY(10px); opacity: 0 } to { transform: scale(1); opacity: 1 } }

.h-mate.clickable { cursor: pointer; pointer-events: auto; }
.h-mate.clickable:hover canvas { filter: brightness(1.12) drop-shadow(0 0 4px #ffd23f); }
