:root {
  --bg: #2a1e16;
  --panel: #c6c6c6;
  --panel-light: #ffffff;
  --panel-dark: #555555;
  --ink: #3f3f3f;
  --slot: #8b8b8b;
  --slot-dark: #373737;
  --wood: #6e4a2a;
  --wood-dark: #3a2412;
  --wood-light: #9c6e40;
  --green: #4caf3a;
  --orange: #e0821e;
  --blue: #3b7fd0;
  --btn: #7a7a7a;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background-size: 64px 64px;
  image-rendering: pixelated;
  color: #fff;
  font-family: "Press Start 2P", monospace;
  font-size: 12px;
}

html { background-color: var(--bg); }

/* O jogo ocupa a tela: largura do mapa limitada pela largura e pela altura da janela (proporção 1120x544 + moldura). */
:root {
  --inv-w: 200px;
  --gap: 0px; /* painel colado no jogo */
  --chrome-h: 160px; /* logo + barra de cima + aba HERÓIS + respiros: o mapa é dimensionado para a página caber na tela */
  --stage-w: min(calc(100vw - 32px - var(--inv-w) - var(--gap)), calc((100vh - var(--chrome-h) - 34px) * 2.0588 + 34px));
}
#app { width: calc(var(--stage-w) + var(--inv-w) + var(--gap) + 32px); max-width: 100%; margin: 0 auto; padding: 8px 16px 8px; }
/* no desktop tudo cabe na janela: sem rolagem da página (painéis e modais rolam por dentro) */
@media (min-width: 901px) { html, body { height: 100%; overflow: hidden; } }

.logo {
  margin: 0 0 8px;
  text-align: center;
  font-size: clamp(20px, 3vw, 32px);
  color: #c8c8c8;
  letter-spacing: 2px;
  text-shadow: 3px 3px 0 #3a3a3a, 6px 6px 0 rgba(0,0,0,.4);
}
.logo span { color: #ff6a3a; text-shadow: 3px 3px 0 #7a1a0a, 6px 6px 0 rgba(0,0,0,.4); }
/* no computador o logo fica centralizado sobre o mapa (alinhado com a aba MINERS), não sobre mapa + inventário */
@media (min-width: 901px) { #app > .logo { width: var(--stage-w); } }

/* ---------- painel estilo inventário (bisel claro/escuro) ---------- */
.mc-panel {
  background: var(--panel);
  color: var(--ink);
  border: 3px solid #000;
  box-shadow: inset 4px 4px 0 var(--panel-light), inset -4px -4px 0 var(--panel-dark);
  border-radius: 4px;
}

/* ---------- top bar ---------- */
#topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px;
  background: repeating-linear-gradient(90deg, var(--wood) 0 30px, var(--wood-light) 30px 32px, var(--wood) 32px 64px);
  border: 4px solid var(--wood-dark);
  border-bottom: none;
}
.tb-left, .tb-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.stat { display: flex; align-items: center; gap: 6px; font-size: 16px; text-shadow: 2px 2px 0 #000; }
.biome-badge { font-size: 11px; padding: 8px 10px; background: rgba(0,0,0,.35); border: 2px solid rgba(0,0,0,.5); text-shadow: 2px 2px 0 #000; }
.muted-in { opacity: .7; }

.ico { display: inline-block; width: 24px; height: 24px; image-rendering: pixelated; background-size: contain; background-repeat: no-repeat; }
.ico.sm { width: 12px; height: 12px; vertical-align: middle; }

/* ---------- botões estilo pedra ---------- */
.pix-btn {
  font-family: inherit; font-size: 10px; color: #fff;
  padding: 9px 12px;
  background: var(--btn);
  border: 3px solid #000;
  cursor: pointer;
  text-shadow: 2px 2px 0 #3a3a3a;
  box-shadow: inset 3px 3px 0 rgba(255,255,255,.35), inset -3px -3px 0 rgba(0,0,0,.35);
}
.pix-btn:hover:not(:disabled) { filter: brightness(1.12); outline: 2px solid #fff; outline-offset: -5px; }
.pix-btn:active:not(:disabled) { transform: translateY(2px); }
.pix-btn:disabled { filter: grayscale(1) brightness(.8); opacity: .6; cursor: not-allowed; }
.pix-btn.green { background: var(--green); }
.pix-btn.orange { background: var(--orange); }
.pix-btn.blue { background: var(--blue); }
.pix-btn.purple { background: #8a4fc4; }
.pix-btn.teal { background: #1e9a8a; }

/* ---------- stage ---------- */
.play { display: flex; gap: var(--gap); align-items: flex-start; }
.main-col { flex: none; width: var(--stage-w); min-width: 0; }
#stage { position: relative; flex: none; width: var(--stage-w); padding: 10px; background: #3c3c40; border: 4px solid var(--wood-dark); }
#game { display: block; width: 100%; height: auto; image-rendering: pixelated; border: 3px solid #000; background: #68a548; }
#map-banner {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; gap: 14px; align-items: center; justify-content: center;
  font-size: clamp(16px, 3.6vw, 36px); text-align: center;
  text-shadow: 4px 4px 0 #000;
  background: rgba(0,0,0,.35);
  pointer-events: none;
  animation: pop .6s ease-out;
}
#map-banner small { font-size: .45em; color: #ffd23d; }
@keyframes pop { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- botão de som + mini mixer ---------- */
.sound-wrap { position: relative; }
#btn-sound { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 34px; padding: 0; font-size: 18px; line-height: 1; }
#mixer {
  position: absolute; z-index: 20; left: 0; top: calc(100% + 6px);
  width: 250px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 10px;
  background: #3a3a3a; color: #fff; text-shadow: 1px 1px 0 #000;
  border: 3px solid #000;
  box-shadow: inset 3px 3px 0 #1e1e1e, inset -3px -3px 0 #8b8b8b, 0 8px 20px rgba(0,0,0,.5);
}
.mix-row { display: grid; grid-template-columns: 1fr 42px; grid-template-rows: auto auto; gap: 6px 8px; align-items: center; font-size: 8px; cursor: pointer; }
.mix-row span { grid-column: 1 / -1; }
.mix-row b { font-weight: normal; font-size: 8px; color: #ffd23d; text-align: right; }
.mix-row input[type=range] { width: 100%; margin: 0; accent-color: #5fbf3a; cursor: pointer; }

/* ---------- inventário (coluna à direita) ---------- */
/* painel no estilo de inventário de jogo de blocos: cinza claro com bisel, slots afundados */
#inventory {
  flex: none; width: var(--inv-w);
  display: flex; flex-direction: column;
  padding: 12px 10px;
  background: var(--panel);
  color: var(--ink);
  border: 4px solid var(--wood-dark);
  border-left: none; /* divide a borda com o mapa */
  align-self: flex-start; /* altura só do conteúdo: termina no último minério */
  box-shadow: inset 0 0 0 3px #000, inset 6px 6px 0 var(--panel-light), inset -6px -6px 0 var(--panel-dark);
  overflow-y: auto;
}
.inv-title { font-size: 10px; color: #3f3f3f; margin: 2px 2px 10px; }
.balance {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; margin-bottom: 12px;
  background: #3a3a3a;
  box-shadow: inset 3px 3px 0 #1e1e1e, inset -3px -3px 0 #8b8b8b;
}
.balance .ico { width: 28px; height: 28px; flex: none; }
.bal-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
#ui-coins { font-size: 13px; color: #ffd23d; text-shadow: 2px 2px 0 #5a3a00; white-space: nowrap; }
.bal-text small { font-size: 7px; color: #c8c8c8; text-shadow: 1px 1px 0 #000; }
#hotbar { display: flex; flex-direction: column; gap: 2px; }
.inv-row { display: flex; align-items: center; gap: 8px; }
.inv-row .slot { margin: 0; flex: none; }
.inv-name { font-size: 10px; color: #3f3f3f; line-height: 1.4; }
.inv-name small { display: block; font-size: 8px; color: #7a5a00; margin-top: 4px; white-space: nowrap; }
.inv-row.empty .inv-name { color: #7a7a7a; }
.inv-sep { height: 2px; background: #8b8b8b; box-shadow: 0 2px 0 #fff; margin: 8px 2px 10px; }
.slot {
  position: relative;
  width: 60px; height: 60px;
  margin: 2px;
  background: var(--slot);
  box-shadow: inset 3px 3px 0 var(--slot-dark), inset -3px -3px 0 #fff;
  display: flex; align-items: center; justify-content: center;
}
.slot canvas { width: 48px; height: 48px; image-rendering: pixelated; }
.slot .qty { position: absolute; right: 4px; bottom: 3px; font-size: 10px; color: #fff; text-shadow: 2px 2px 0 #3f3f3f; pointer-events: none; }
.slot.empty canvas { opacity: .25; }
.slot.bump { animation: bump .25s; }
@keyframes bump { 50% { transform: scale(1.15); } }

/* aba "HERÓIS ▲": um botão só, pendurado embaixo do mapa (centralizado nele) */
/* abas embaixo do mapa (MINERS e HOUSES), centralizadas nele */
#bottom-tabs { display: flex; gap: 10px; width: max-content; margin: -4px 0 0 calc(var(--stage-w) / 2); transform: translateX(-50%); }
.tab-btn {
  display: flex; align-items: stretch;
  padding: 0; height: 36px;
  font-family: inherit; color: #fff; text-shadow: 2px 2px 0 #3a3a3a;
  background: var(--btn);
  border: 3px solid #000; border-top: none;
  box-shadow: inset 3px 0 0 rgba(255,255,255,.35), inset -3px -3px 0 rgba(0,0,0,.35);
  cursor: pointer;
}
.tab-btn .tab-label { display: flex; align-items: center; padding: 0 14px; font-size: 11px; }
.tab-btn .tab-arrow { display: flex; align-items: center; padding: 0 12px; font-size: 13px; border-left: 3px solid #000; background: rgba(0,0,0,.15); }
.tab-btn:hover { filter: brightness(1.12); }
.tab-btn.open { background: var(--green); }
#rest-toggle { background: #8a5a2a; }
#rest-toggle.open { background: #b8762e; }
.tab-btn.hidden { display: none; }

/* ---------- gaveta ---------- */
/* painel de heróis: sobe por cima do mapa, centralizado, da parte de baixo até ~1/4 do topo */
#drawer, #rest-panel {
  position: absolute; z-index: 5;
  left: 50%; bottom: 10px;
  transform: translateX(-50%);
  width: min(88%, 1400px); min-width: 320px;
  height: calc(100% - 20px); /* quase o mapa todo: os 15 ativos preenchem sem rolar */
  display: flex; flex-direction: column;
  padding: 14px 14px 12px;
  box-shadow: inset 4px 4px 0 var(--panel-light), inset -4px -4px 0 var(--panel-dark), 0 10px 40px rgba(0,0,0,.6);
  animation: slide-up .18s ease-out;
}
@keyframes slide-up { from { transform: translate(-50%, 30px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.drawer-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.drawer-head h2 { margin: 0; font-size: 12px; }
.drawer-close { background: none; border: none; color: var(--ink); font-family: inherit; font-size: 16px; cursor: pointer; padding: 2px 4px; }
.drawer-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.drawer-actions .pix-btn { font-size: 8px; padding: 7px 9px; }

/* unidade dos cards: cresce com a largura do mapa e com a altura visível da lista (cqh), o que for menor */
.hero-section, .hero-card { --cu: min(calc((var(--stage-w) - 250px) / 1250 * 1.3), calc((100cqh - 30px) / 560)); }
#hero-list { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding-right: 4px; container-type: size; }
/* 5 colunas x 3 linhas: os 15 ativos preenchem o painel assim que ele abre */
.hero-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: calc(var(--cu) * 8); }
/* a seção de ativos ocupa toda a altura visível da lista e as 3 linhas se esticam para preencher */
/* ativos: cada linha tem a altura de 1/3 da lista (--row-h, calculada no JS), então com 15 ativos a seção enche a
   tela e com menos ela encolhe e os que descansam sobem logo abaixo */
.hero-section.active { display: flex; flex-direction: column; }
.hero-section.active .hero-grid { grid-auto-rows: var(--row-h, auto); }
.hero-section.active .hero-grid.none { grid-auto-rows: auto; } /* ninguém minerando: só a frase, sem espaço vazio */
.hero-section + .hero-section { margin-top: 14px; padding-top: 12px; border-top: 2px solid #8b8b8b; box-shadow: inset 0 2px 0 #fff; }
.hero-section h3 { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 8px; margin: 0 0 calc(var(--cu) * 8); font-size: max(9px, calc(var(--cu) * 11)); color: #3f3f3f; }
.hero-section h3 .cnt { color: #6a6a6a; }
.hero-section h3 small { flex-basis: 100%; font-size: 7px; color: #7a7a7a; }
.hero-section.active h3 { color: #2a7a1e; }
.empty-note { margin: 0; font-size: 8px; color: #6a6a6a; }
.hero-card {
  display: grid; grid-template-columns: calc(var(--cu) * 68) 1fr; gap: calc(var(--cu) * 6) calc(var(--cu) * 10);
  padding: calc(var(--cu) * 10);
  background: var(--slot);
  color: #fff;
  text-shadow: 1px 1px 0 #3a3a3a;
  box-shadow: inset 3px 3px 0 var(--slot-dark), inset -3px -3px 0 #e0e0e0;
  font-size: calc(var(--cu) * 9); line-height: 1.6;
  min-width: 0;
  align-content: center;
}
.hero-card > div { min-width: 0; }
.hero-card .avatar { position: relative; width: calc(var(--cu) * 68); height: calc(var(--cu) * 68); }
.hero-card canvas { width: 100%; height: 100%; image-rendering: pixelated; background: #68a548; border: 2px solid #000; box-sizing: border-box; }
.hero-card .name { font-size: calc(var(--cu) * 11); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-card .rar { display: inline-block; padding: calc(var(--cu) * 2) calc(var(--cu) * 4); font-size: calc(var(--cu) * 8); color: #fff; text-shadow: 1px 1px 0 #000; border: 2px solid #000; margin: calc(var(--cu) * 4) 0; }
.hero-card .role { display: inline-block; padding: calc(var(--cu) * 2) calc(var(--cu) * 4); margin-left: calc(var(--cu) * 3); border: 2px solid #000; font-size: calc(var(--cu) * 8); color: #fff; text-shadow: 1px 1px 0 #000; }
.hero-card .skills { display: flex; flex-wrap: wrap; gap: calc(var(--cu) * 3); margin: calc(var(--cu) * 2) 0 calc(var(--cu) * 3); }
/* selo de skill: ícone em pixel art num slot escuro com borda na cor da skill */
.sk {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; padding: 1px;
  background: #24242a;
  border: 2px solid var(--skc, #000);
  box-shadow: inset 0 0 0 1px #000;
  cursor: help;
}
.sk img { width: 100%; height: 100%; image-rendering: pixelated; display: block; }
.hero-card .sk { width: calc(var(--cu) * 22); height: calc(var(--cu) * 22); }
.got .skills { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; max-width: 66px; }
.got .sk { width: 18px; height: 18px; border-width: 1px; padding: 0; }
/* balão com a explicação da skill */
#tip {
  position: fixed; z-index: 100; max-width: 260px;
  display: flex; flex-direction: column; gap: 5px;
  padding: 8px 10px;
  background: #1a1022; color: #fff;
  border: 2px solid #2a0a4a; box-shadow: 0 0 0 2px #5a2a8a, 0 6px 18px rgba(0,0,0,.5);
  font-size: 8px; line-height: 1.6; text-shadow: 1px 1px 0 #000;
  pointer-events: none;
}
#tip b { font-size: 9px; font-weight: normal; }
.hero-card .role.titular { background: #3fa02e; }
.hero-card .role.reserva { background: #5a6a8a; }
.hero-card .role.folga { background: #6a6a6a; }
.hero-card .stats { display: flex; flex-wrap: wrap; gap: 0 calc(var(--cu) * 8); white-space: nowrap; font-size: calc(var(--cu) * 8.5); }
.hero-card .stats b { color: #9dff7a; font-weight: normal; }
.hero-card .stats .eco { flex-basis: 100%; color: #fff6b0; }
.hero-card .stats .eco b { color: #ffd23d; }
.energy { grid-column: 1 / -1; height: calc(var(--cu) * 10); background: #2a2a2a; border: 2px solid #000; overflow: hidden; }
.energy > div { height: 100%; background: linear-gradient(#8ef06a, #3fae2e); transition: width .3s; }
.hero-card .row { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 4px; font-size: calc(var(--cu) * 9); }
.hero-card .row span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.hero-card .pix-btn { flex: none; font-size: calc(var(--cu) * 8); padding: calc(var(--cu) * 5) calc(var(--cu) * 8); }
/* quem está no mapa em destaque; quem descansa fica apagado */
.hero-card.active { background: #9fb59a; box-shadow: inset 3px 3px 0 #2e5a24, inset -3px -3px 0 #e6ffe0, 0 0 0 2px #3fa02e; }
.hero-card.resting { filter: saturate(.55) brightness(.9); opacity: .85; }
.hero-card .zzz { display: none; position: absolute; right: -4px; top: -6px; pointer-events: none; }
.hero-card.resting .zzz { display: block; }
.zzz i { position: absolute; right: 0; top: 0; font-style: normal; color: #fff; text-shadow: 2px 2px 0 #141010; opacity: 0; animation: zzz 2.4s linear infinite; }
.zzz i:nth-child(2) { animation-delay: .8s; }
.zzz i:nth-child(3) { animation-delay: 1.6s; }
@keyframes zzz {
  0%   { transform: translate(-10px, 22px); font-size: 7px; opacity: 0; }
  15%  { opacity: 1; }
  100% { transform: translate(4px, -6px); font-size: 13px; opacity: 0; }
}

/* ---------- loja de mineradores (BUY MINERS): centralizada sobre o mapa ---------- */
#mint-panel {
  position: absolute; z-index: 6;
  left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(760px, calc(100% - 20px)); max-height: calc(100% - 20px); overflow-y: auto;
  padding: 16px 18px;
  box-shadow: inset 4px 4px 0 var(--panel-light), inset -4px -4px 0 var(--panel-dark), 0 10px 40px rgba(0,0,0,.6);
  animation: pop-in .15s ease-out;
}
@keyframes pop-in { from { transform: translate(-50%, -50%) scale(.92); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
#mint-panel h2 { font-size: 14px; }
.mint-sub { margin: 0 0 14px; font-size: 8px; color: #5a5a5a; }
.mint-title { display: flex; align-items: center; gap: 12px; }
.droprate-wrap { position: relative; }
.pix-btn.droprate { display: inline-block; font-size: 8px; padding: 6px 9px; background: #5a6a8a; cursor: help; }
.droprate-wrap:hover .pix-btn.droprate { background: #3b7fd0; }
/* tabela aparece só com o mouse em cima do DROP RATE (fica no body, por cima de tudo, sem rolagem) */
#droprate {
  display: none;
  position: fixed; z-index: 60; left: 0; top: 0;
  width: min(900px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow-y: auto;
  grid-template-columns: 270px 1fr; gap: 0 18px;
  padding: 12px 14px;
  pointer-events: none;
  background: #3a3a3a; color: #fff; text-shadow: 1px 1px 0 #000;
  border: 3px solid #000;
  box-shadow: inset 3px 3px 0 #1e1e1e, inset -3px -3px 0 #8b8b8b, 0 8px 20px rgba(0,0,0,.5);
}
#droprate.show { display: grid; }
.dr-skills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; }
#droprate h3 small.dr-note { margin: 0 0 0 6px; color: #c8c8c8; font-size: 7px; }
.dr-skills .dr-skill { margin: 0; }
@media (max-width: 700px) { #droprate { grid-template-columns: 1fr; } .dr-skills { grid-template-columns: 1fr; } #droprate .dr-col + .dr-col { margin-top: 10px; } }
#droprate h3 { margin: 0 0 8px; font-size: 9px; color: #ffd23d; }
.dr-row { display: grid; grid-template-columns: 110px 1fr auto; align-items: center; gap: 12px; margin: 5px 0; }
.dr-sk { font-size: 7px; color: #c8c8c8; }
.dr-note { margin: 2px 0 8px; font-size: 7px; color: #c8c8c8; }
.dr-h { margin: 12px 0 2px !important; }
.dr-skill { display: grid; grid-template-columns: 26px 1fr; gap: 8px; align-items: start; margin: 6px 0; }
.dr-skill b { display: block; font-size: 8px; font-weight: normal; margin-bottom: 2px; }
.dr-skill span:not(.sk) { font-size: 7px; line-height: 1.5; color: #e0e0e0; }
.dr-tag { padding: 2px 5px; font-size: 7px; border: 2px solid #000; text-align: center; }
.dr-pct { font-size: 9px; text-align: right; }
#mint-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.mint-opt {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 10px 12px;
  background: var(--slot);
  box-shadow: inset 3px 3px 0 var(--slot-dark), inset -3px -3px 0 #e0e0e0;
  color: #fff; text-shadow: 2px 2px 0 #3a3a3a;
}
.mint-stack { display: flex; justify-content: center; height: 64px; }
.mint-stack { align-items: flex-end; }
.mint-stack canvas { width: 48px; height: 48px; image-rendering: pixelated; margin: 0 -6px; }
.mint-stack canvas:nth-child(even) { margin-bottom: 10px; }
.mint-qty { font-size: 22px; }
.mint-each { font-size: 7px; color: #e0e0e0; }
.mint-price { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #ffd23d; text-shadow: 2px 2px 0 #5a3a00; }
.mint-price img { width: 16px; height: 16px; image-rendering: pixelated; }
.mint-opt .pix-btn { width: 100%; font-size: 10px; }
#mint-result { margin-top: 14px; padding-top: 12px; border-top: 2px solid #8b8b8b; box-shadow: inset 0 2px 0 #fff; }
#mint-result h3 { margin: 0 0 10px; font-size: 10px; color: #2a7a1e; }
.mint-got { display: flex; flex-wrap: wrap; gap: 6px; }
.got { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px; background: var(--slot); border: 3px solid; }
.got canvas { width: 48px; height: 48px; image-rendering: pixelated; }
.got span { font-size: 6px; padding: 1px 3px; color: #fff; text-shadow: 1px 1px 0 #000; border: 1px solid #000; }

/* ---------- aldeão (TRADE): aldeão à esquerda e lista de trocas à direita ---------- */
.trade-btn { margin-top: 10px; width: 100%; font-size: 11px; }
#trade-panel {
  position: absolute; z-index: 6;
  left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(640px, calc(100% - 20px)); max-height: calc(100% - 20px); overflow-y: auto;
  padding: 16px 18px;
  box-shadow: inset 4px 4px 0 var(--panel-light), inset -4px -4px 0 var(--panel-dark), 0 10px 40px rgba(0,0,0,.6);
  animation: pop-in .15s ease-out;
}
#trade-panel h2 { font-size: 14px; }
.trade-body { display: grid; grid-template-columns: 170px 1fr; gap: 16px; align-items: start; }
.villager-box {
  display: flex; align-items: flex-end; justify-content: center;
  height: 250px; padding-bottom: 6px;
  background: linear-gradient(#7ec0ee 0 62%, #5d9b3a 62% 66%, #4a7d2c 66%);
  box-shadow: inset 3px 3px 0 var(--slot-dark), inset -3px -3px 0 #e0e0e0;
}
#villager { width: 132px; height: 216px; image-rendering: pixelated; }
.trade-side .mint-sub { margin-bottom: 10px; }
#trade-offers { display: flex; flex-direction: column; gap: 6px; }
.trade-offer {
  display: grid; grid-template-columns: 1fr 22px 44px auto; align-items: center; gap: 8px;
  padding: 6px 8px;
  background: var(--slot);
  box-shadow: inset 3px 3px 0 var(--slot-dark), inset -3px -3px 0 #e0e0e0;
  color: #fff; text-shadow: 2px 2px 0 #3a3a3a;
}
.trade-offer.short { opacity: .75; }
.to-give { display: flex; align-items: center; gap: 8px; min-width: 0; }
.to-give canvas, .to-get canvas { width: 36px; height: 36px; image-rendering: pixelated; flex: none; }
.to-give b { display: block; font-size: 10px; font-weight: normal; }
.to-give small { display: block; font-size: 6px; color: #e0e0e0; margin-top: 4px; }
.trade-offer.short .to-give small { color: #ffb0a0; }
.to-arrow { font-size: 16px; color: #e8e8e8; text-align: center; }
.to-get { display: flex; justify-content: center; }
.trade-offer .pix-btn { font-size: 8px; padding: 7px 10px; }

/* ---------- marketplace: abas Miners/Houses e modos Buy/Sell/My listings ---------- */
#market-panel {
  position: absolute; z-index: 6;
  left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(1180px, calc(100% - 20px)); height: calc(100% - 20px);
  display: flex; flex-direction: column;
  padding: 16px 18px;
  box-shadow: inset 4px 4px 0 var(--panel-light), inset -4px -4px 0 var(--panel-dark), 0 10px 40px rgba(0,0,0,.6);
  animation: pop-in .15s ease-out;
}
#market-panel h2 { font-size: 14px; }
.mk-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.mk-tabs, .mk-modes { display: flex; gap: 6px; }
.mk-tab, .mk-mode, .mk-chip {
  font-family: inherit; color: #fff; cursor: pointer;
  border: 3px solid #000; text-shadow: 2px 2px 0 #3a3a3a;
  box-shadow: inset 3px 3px 0 rgba(255,255,255,.3), inset -3px -3px 0 rgba(0,0,0,.35);
}
.mk-tab { font-size: 11px; padding: 9px 14px; background: #6a6a6a; }
.mk-tab.active { background: #8a4fc4; }
.mk-mode { font-size: 9px; padding: 7px 10px; background: #6a6a6a; }
.mk-mode.active { background: var(--green); }
#mk-filters { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
#mk-filters:empty { display: none; }
.mk-chip { font-size: 7px; padding: 5px 8px; background: var(--chip, #5a5a5a); opacity: .55; }
.mk-chip.active { opacity: 1; outline: 2px solid #fff; outline-offset: -5px; }
#mk-note { margin: 0 0 10px; }
#mk-list { flex: 1; min-height: 0; overflow-y: auto; padding-right: 4px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; align-content: start; }
#mk-list.houses { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.mk-empty { grid-column: 1 / -1; font-size: 9px; color: #5a5a5a; text-align: center; padding: 30px 0; }
.mk-card {
  display: grid; grid-template-columns: 56px 1fr; gap: 6px 10px; align-content: start;
  padding: 8px 10px;
  background: var(--slot);
  box-shadow: inset 3px 3px 0 var(--slot-dark), inset -3px -3px 0 #e0e0e0;
  border-left: 5px solid var(--rc, #555);
  color: #fff; text-shadow: 1px 1px 0 #3a3a3a; font-size: 8px; min-width: 0;
}
.mk-card canvas { width: 56px; height: 56px; image-rendering: pixelated; background: rgba(0,0,0,.18); border: 2px solid #000; }
.mk-card .mk-info { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.mk-card .mk-name { font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-card .rar { align-self: flex-start; font-size: 6px; padding: 2px 4px; border: 1px solid #000; }
.mk-card .skills { display: flex; flex-wrap: wrap; gap: 2px; }
.mk-card .skills .sk { width: 18px; height: 18px; }
.mk-card .stats { display: flex; flex-wrap: wrap; gap: 3px 8px; font-size: 7px; color: #e8e8e8; }
.mk-meta { font-size: 6px; color: #e0e0e0; }
.mk-card > .mk-meta { grid-column: 1 / -1; }
.mk-foot { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; justify-content: space-between; margin-top: 2px; }
.mk-price { display: flex; align-items: center; gap: 5px; font-size: 11px; color: #ffd23d; text-shadow: 2px 2px 0 #5a3a00; white-space: nowrap; }
.mk-price img { width: 14px; height: 14px; image-rendering: pixelated; }
.mk-foot .pix-btn { font-size: 8px; padding: 7px 10px; }
.mk-sell { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; align-items: center; }
.mk-sell input { width: 100%; font-family: inherit; font-size: 10px; padding: 6px; border: 3px solid #000; background: #222; color: #ffd23d; }
.mk-sell small { grid-column: 1 / -1; font-size: 6px; color: #e8e8e8; }
.mk-sell .pix-btn { font-size: 8px; padding: 7px 10px; }
.mk-house { grid-template-columns: 1fr; }
.mk-house > img { width: 100%; height: 90px; object-fit: contain; filter: drop-shadow(0 3px 3px rgba(0,0,0,.5)); }
.mk-house .mk-info { align-items: center; text-align: center; }
.mk-card.mine { background: #8f86a0; }

/* ---------- casas: painel centralizado sobre o mapa ---------- */
#house-panel {
  position: absolute; z-index: 6;
  left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(1180px, calc(100% - 20px)); max-height: calc(100% - 20px); overflow-y: auto;
  padding: 16px 18px;
  box-shadow: inset 4px 4px 0 var(--panel-light), inset -4px -4px 0 var(--panel-dark), 0 10px 40px rgba(0,0,0,.6);
  animation: pop-in .15s ease-out;
}
#house-panel h2 { font-size: 14px; }
#house-list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.house-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 10px 8px 12px;
  background: var(--slot);
  box-shadow: inset 3px 3px 0 var(--slot-dark), inset -3px -3px 0 #e0e0e0;
  color: #fff; text-shadow: 2px 2px 0 #3a3a3a; text-align: center;
}
.house-card.owned { background: #9fb59a; box-shadow: inset 3px 3px 0 #2e5a24, inset -3px -3px 0 #e6ffe0, 0 0 0 2px #3fa02e; }
.house-img { width: 100%; aspect-ratio: 3 / 2; display: flex; align-items: flex-end; justify-content: center;
  background: radial-gradient(ellipse at 50% 85%, rgba(255,210,120,.35), rgba(0,0,0,0) 70%); }
.house-img img { max-width: 100%; max-height: 100%; image-rendering: auto; filter: drop-shadow(0 4px 4px rgba(0,0,0,.45)); }
.house-name { font-size: 10px; }
.house-info { width: 100%; margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 6px; font-size: 8px; text-align: left; }
.house-info dt { color: #f0f0f0; }
.house-info dd { margin: 0; text-align: right; color: #ffd23d; text-shadow: 1px 1px 0 #5a3a00; white-space: nowrap; }
.house-info dd.gold { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.house-info dd img { width: 12px; height: 12px; image-rendering: pixelated; }
.house-boost { margin: 0; font-size: 7px; line-height: 1.5; color: #fff6b0; text-align: left; }
.house-outside { grid-column: 1 / -1; margin: 0 0 4px; font-size: 8px; color: #3f3f3f; }
.house-outside b { color: #b8281e; font-weight: normal; }
.house-card .pix-btn { width: 100%; font-size: 10px; margin-top: auto; } /* botão sempre no pé do card */
.house-owned { width: 100%; padding: 8px 4px; font-size: 8px; background: #2e5a24; border: 3px solid #000; }
@media (max-width: 1200px) { #house-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- painel "Resting in houses": uma seção por casa, no visual da própria casa ---------- */
/* altura automática: cresce com o número de casas até a altura do mapa, depois rola */
#rest-panel { height: auto; max-height: calc(100% - 20px); width: min(1000px, 88%); }
#rest-list { flex: 0 1 auto; min-height: 0; overflow-y: auto; padding-right: 4px; display: flex; flex-direction: column; gap: 10px; }
.rest-house {
  --t-bg: #6e4a2a; --t-line: #5a3a1e; --t-edge: #3a2412; --t-card: rgba(0,0,0,.28); --t-head: #fff;
  padding: 10px 12px 12px;
  background: repeating-linear-gradient(0deg, var(--t-bg) 0 14px, var(--t-line) 14px 16px);
  border: 4px solid var(--t-edge);
  box-shadow: inset 3px 3px 0 rgba(255,255,255,.18), inset -3px -3px 0 rgba(0,0,0,.3);
}
/* madeira */
.theme-cabin   { --t-bg: #8a5a2a; --t-line: #6e4420; --t-edge: #3a2412; }
/* pedra escura com detalhes de madeira */
.theme-manor   { --t-bg: #5a5a62; --t-line: #46464e; --t-edge: #6e4420; }
/* pedra clara */
.theme-stone   { --t-bg: #b8bcc4; --t-line: #9aa0a8; --t-edge: #5a5e66; --t-card: rgba(40,40,50,.35); }
/* ouro */
.theme-gold    { --t-bg: #e0b020; --t-line: #c89410; --t-edge: #7a5208; --t-card: rgba(90,50,0,.35); }
/* diamante */
.theme-diamond { --t-bg: #3ecfc4; --t-line: #2aa8a0; --t-edge: #0e5a58; --t-card: rgba(0,50,60,.35); }
.rh-head { display: grid; grid-template-columns: 96px 1fr auto; align-items: center; gap: 14px; color: var(--t-head); text-shadow: 2px 2px 0 rgba(0,0,0,.6); }
.rest-house.busy .rh-head { margin-bottom: 10px; }
.rh-head img.rh-img { width: 96px; height: 64px; object-fit: contain; filter: drop-shadow(0 3px 3px rgba(0,0,0,.5)); }
.rh-title b { display: block; font-size: 12px; font-weight: normal; margin-bottom: 6px; }
.rh-title span { display: block; font-size: 8px; line-height: 1.6; }
.rh-beds { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.rh-beds small { font-size: 8px; }
.rh-slots { display: grid; grid-template-columns: repeat(7, 18px); gap: 3px; justify-content: end; }
.rh-slot { width: 18px; height: 18px; image-rendering: pixelated; background: rgba(0,0,0,.35); border: 1px solid rgba(0,0,0,.6); }
.rh-slot.free { opacity: .35; filter: grayscale(1); }
.rh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.rest-card {
  display: grid; grid-template-columns: 48px 1fr; gap: 8px; align-items: center;
  padding: 6px 8px;
  background: var(--t-card);
  border: 2px solid rgba(0,0,0,.45);
  color: #fff; text-shadow: 1px 1px 0 #000;
  font-size: 8px; line-height: 1.5;
  min-width: 0;
}
.rest-card .rc-info { min-width: 0; }
.rest-card canvas { width: 48px; height: 48px; image-rendering: pixelated; background: rgba(0,0,0,.25); border: 2px solid #000; }
.rest-card .name { font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rest-card .rar { display: inline-block; padding: 1px 4px; font-size: 7px; border: 1px solid #000; margin: 2px 0 4px; }
.rest-card .energy { height: 7px; margin-bottom: 3px; }
.rc-time { font-size: 7px; }

/* animação de mint: cobre o painel da loja */
/* animação de mint: fundo (raios/brilho) na tela inteira; baú e revelação numa caixa central */
#mint-anim {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 40%, rgba(40,30,20,.88), rgba(10,8,6,.95) 70%);
  cursor: pointer;
}
#mint-anim .anim-bg { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.anim-box {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  width: min(760px, calc(100% - 32px)); max-height: calc(100% - 32px); overflow-y: auto;
  padding: 12px;
}
.anim-box > * { flex-shrink: 0; } /* não espremer os bonecos */
.anim-fx { width: min(480px, 92%); height: auto; image-rendering: pixelated; }
.anim-title { min-height: 16px; font-size: 12px; color: #fff; text-shadow: 2px 2px 0 #000; text-align: center; }
.anim-title b { font-weight: normal; }
.anim-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 100%; }
.anim-ok { cursor: pointer; }
.got.pop { animation: got-pop .38s cubic-bezier(.2, 1.7, .4, 1) both; }
@keyframes got-pop { from { transform: translateY(24px) scale(0); opacity: 0; } to { transform: none; opacity: 1; } }
.got.shine { box-shadow: 0 0 0 2px #fff, 0 0 18px 4px currentColor; animation: got-pop .38s cubic-bezier(.2, 1.7, .4, 1) both, shine 1.2s ease-in-out .4s infinite alternate; }
@keyframes shine { to { box-shadow: 0 0 0 2px #fff, 0 0 28px 8px currentColor; } }

/* ---------- modais ---------- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 10; }
.modal-box { position: relative; width: min(480px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 22px; line-height: 1.8; font-size: 10px; }
.modal-box.wide { width: min(720px, 100%); }
.modal-box h2 { margin-top: 0; font-size: 13px; }
.modal-close { position: absolute; right: 10px; top: 10px; background: none; border: none; color: var(--ink); font-size: 16px; cursor: pointer; font-family: inherit; }
.modal-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.small { font-size: 8px; line-height: 1.8; word-break: break-word; }

.tabs { display: flex; gap: 4px; margin-bottom: 12px; flex-wrap: wrap; padding-right: 30px; }
.tab { font-family: inherit; font-size: 9px; padding: 8px 10px; background: #8b8b8b; color: #e0e0e0; border: 3px solid #000; cursor: pointer; }
.tab.active { background: var(--panel); color: var(--ink); box-shadow: inset 3px 3px 0 #fff; }

.hero-pick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hero-pick select { font-family: inherit; font-size: 9px; padding: 6px; border: 3px solid #000; background: #8b8b8b; color: #fff; max-width: 100%; }
#craft-hero-stats { margin: 6px 0 10px; }

.recipe, .trade {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px;
  padding: 8px 10px; margin-bottom: 6px;
  background: var(--slot);
  color: #fff; text-shadow: 1px 1px 0 #3a3a3a;
  box-shadow: inset 3px 3px 0 var(--slot-dark), inset -3px -3px 0 #e0e0e0;
}
.recipe .title { font-size: 9px; }
.recipe .desc { color: #9dff7a; font-size: 8px; }
.ings { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.ing { display: inline-flex; align-items: center; gap: 3px; font-size: 8px; }
.ing canvas { width: 16px; height: 16px; image-rendering: pixelated; }
.ing.lack { color: #ff8080; }
.trade .pix-btn, .recipe .pix-btn { font-size: 8px; padding: 6px 8px; }
.trade-btns { display: flex; gap: 4px; }

.mini-inv { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 12px; padding-top: 10px; border-top: 2px solid #8b8b8b; }
.mini-inv .slot { width: 44px; height: 44px; }
.mini-inv .slot canvas { width: 32px; height: 32px; }
.mini-inv .slot .qty { font-size: 8px; }

#toast {
  position: fixed; left: 50%; bottom: 64px; transform: translateX(-50%); /* acima da aba HERÓIS */
  max-width: calc(100% - 32px);
  padding: 12px 16px;
  background: rgba(16,16,16,.92); color: #fff;
  border: 3px solid #5a5a5a;
  font-size: 10px; line-height: 1.6;
  z-index: 20;
}
/* no jogo o aviso fica no topo do mapa, abaixo dos painéis (z-index 5+), para nunca cobrir um menu aberto */
#stage > #toast { position: absolute; top: 12px; bottom: auto; z-index: 4; pointer-events: none; text-align: center; }

.hidden { display: none !important; }

/* telas médias: barra de cima mais compacta para os botões caberem numa linha só */
@media (max-width: 1500px) and (min-width: 901px) {
  #topbar { padding: 8px 10px; gap: 8px; }
  .tb-left, .tb-right { gap: 6px; }
  #topbar .pix-btn { font-size: 8px; padding: 7px 8px; }
  #topbar #btn-sound { width: 34px; height: 28px; padding: 0; font-size: 15px; }
  .biome-badge { font-size: 9px; padding: 7px 8px; }
}

@media (max-width: 900px) {
  :root { --stage-w: 100%; }
  /* no celular o mapa é pequeno: o painel vira uma folha fixa na parte de baixo da tela */
  #drawer, #rest-panel { position: fixed; left: 0; right: 0; bottom: 0; transform: none; width: auto; min-width: 0; height: 75vh; animation: none; }
  #rest-panel { height: auto; max-height: 75vh; }
  .hero-section, .hero-card { --cu: 0.85px; }
  .hero-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #mint-panel, #house-panel, #trade-panel, #market-panel { position: fixed; }
  #market-panel { height: calc(100vh - 20px); }
  #mk-list, #mk-list.houses { grid-template-columns: 1fr; }
  .trade-body { grid-template-columns: 1fr; }
  .villager-box { height: 170px; }
  #villager { width: 88px; height: 144px; }
  .trade-btn { margin-top: 8px; }
  #house-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #mint-options { grid-template-columns: 1fr; }
  #droprate { position: fixed; left: 16px; right: 16px; top: 120px; width: auto; max-width: none; }
  .dr-row { grid-template-columns: 100px 1fr auto; gap: 8px; }
  .hero-section.active { min-height: 0; }
  #app { width: auto; }
  .play { flex-direction: column; align-items: stretch; }
  .main-col { width: auto; }
  #inventory { width: auto; align-self: stretch; padding: 10px; border-left: 4px solid var(--wood-dark); border-top: none; }
  .inv-title { display: none; }
  .balance { margin-bottom: 8px; }
  #hotbar { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 4px; }
  .inv-name, .inv-sep { display: none; }
}

@media (max-width: 640px) {
  #app { padding: 8px 8px 60px; }
  .stat { font-size: 12px; }
  #stage { padding: 4px; }
  .slot { width: 44px; height: 44px; margin: 1px; }
  .slot canvas { width: 32px; height: 32px; }
  .slot .qty { font-size: 8px; }
}

/* ---------- pedido de saque (janela da carteira) ---------- */
.wd-box { margin-top: 14px; padding-top: 12px; border-top: 2px solid #8b8b8b; display: flex; flex-direction: column; gap: 8px; }
.wd-box h3 { margin: 0; font-size: 11px; }
.wd-field { display: flex; flex-direction: column; gap: 4px; font-size: 8px; }
.wd-field input { font-family: inherit; font-size: 10px; padding: 7px; border: 3px solid #000; background: #222; color: #ffd23d; }
#wd-list h4 { margin: 6px 0; font-size: 9px; }
.wd-item { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 8px; align-items: center; font-size: 7px; padding: 5px 6px; background: rgba(0,0,0,.08); margin-bottom: 3px; }
.wd-item b { font-weight: normal; }
.wd-item b.pending { color: #b06a00; }
.wd-item b.paid { color: #1e7a14; }

/* ---------- tela de conectar carteira: cobre o jogo inteiro até o login ---------- */
/* fica no lugar do mapa (o resto da tela do jogo aparece normal); até o login, os botões do jogo ficam travados */
#gate {
  position: absolute; inset: 10px; z-index: 7;
  display: flex; align-items: center; justify-content: center; padding: 16px; overflow-y: auto;
  background: repeating-linear-gradient(0deg, #2b2b30 0 30px, #24242a 30px 32px), #2b2b30;
}
body.locked #topbar .tb-right button:not(#btn-wallet), body.locked #bottom-tabs, body.locked #btn-trade { opacity: .45; pointer-events: none; }
.gate-box { width: min(460px, 100%); padding: 26px 24px; text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: stretch; }
.gate-box .logo { margin: 0 0 4px; padding: 12px 8px 10px; font-size: 26px; background: #2a1e14; border: 3px solid #000; } /* fundo escuro: o CRAFT branco aparece */
.gate-sub { margin: 0; font-size: 10px; line-height: 1.6; color: #3a3a3a; }
.gate-main { font-size: 13px; padding: 14px; }
#gate-wallets { display: flex; flex-direction: column; gap: 8px; }
.gate-wallet {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  font-family: inherit; font-size: 10px; color: #fff; text-decoration: none; cursor: pointer; text-align: left;
  background: #3a3a3a; border: 3px solid #000; box-shadow: inset 3px 3px 0 #5a5a5a, inset -3px -3px 0 #1e1e1e;
}
.gate-wallet:hover { background: #4a4a52; }
.gate-wallet img { width: 28px; height: 28px; border-radius: 6px; }
.gw-dot { width: 28px; height: 28px; border-radius: 6px; background: linear-gradient(135deg, #9945ff, #14f195); flex: none; }
#gate-msg { min-height: 1em; margin: 0; color: #3a3a3a; }
.gate-note { margin: 0; font-size: 7px; line-height: 1.6; color: #6a6a6a; }

/* ---------- indicação (janela da carteira) e campo na tela de conectar ---------- */
.ref-box { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.ref-box h3 { margin: 0; font-size: 11px; }
.ref-code { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; font-size: 8px; }
.ref-code b { font-weight: normal; font-size: 14px; letter-spacing: 2px; color: #ffd23d; background: #222; border: 3px solid #000; padding: 6px 8px; text-align: center; }
.ref-code .pix-btn { font-size: 8px; padding: 7px 9px; }
.ref-use { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.ref-use input, .gate-ref input { font-family: inherit; font-size: 10px; padding: 7px; border: 3px solid #000; background: #222; color: #ffd23d; text-transform: uppercase; }
.ref-use .pix-btn { font-size: 8px; padding: 7px 10px; }
#ref-msg:empty { display: none; }
.gate-ref { display: flex; flex-direction: column; gap: 4px; text-align: left; font-size: 8px; color: #3a3a3a; }
