/* Destruitor Idle — espacos de pocao do dock, janelinha de escolher a pocao, aviso de magia nova e a chave
   "Organizar a barra sozinho" (barra.js) */

/* ---- dois espacos de pocao: vida em cima, mana embaixo, entre as barras de vida/mana e a barra de acoes ---- */
.g-pots { display: grid; grid-template-columns: 34px; grid-auto-rows: 34px; gap: 3px; align-content: center; }
.g-pots:empty { display: none; }
.g .as.pot { border-width: 1px; }
.g .as.pot-hp { border-color: #6b2f2c; background: radial-gradient(circle at 50% 60%, #3a1614 0%, #0a0c13 72%); }
.g .as.pot-mp { border-color: #2c3f6b; background: radial-gradient(circle at 50% 60%, #14213d 0%, #0a0c13 72%); }
.g .as.pot:hover { border-color: var(--gold); }
.g .as.pot.vazio { box-shadow: inset 0 0 0 1px #0007; }
.pot-mais { font-size: 16px; font-weight: 800; line-height: 1; }
.pot-hp .pot-mais { color: #c0564e; }
.pot-mp .pot-mais { color: #5b84d6; }
.g .as.pot em { font-size: 7px; }

/* o Inventario a esquerda da pocao de vida (a municao, com arco/besta, fica na coluna da direita) */
.g-pots:has(.inv-dock) { grid-template-columns: 34px 34px; grid-template-rows: 34px 34px; grid-auto-flow: row; }
.g .as.inv-dock { grid-column: 1; grid-row: 1; border-color: #5a4a2a; background: radial-gradient(circle at 50% 55%, #2a2110 0%, #0a0c13 75%); }
.g .as.inv-dock:hover { border-color: var(--gold); }
.g-pots:has(.inv-dock) .pot-hp { grid-column: 2; grid-row: 1; }
.g-pots:has(.inv-dock) .pot-mp { grid-column: 2; grid-row: 2; }
.g-pots:has(.inv-dock):has(.mun-dock) { grid-template-columns: 34px 34px 34px; }
.g-pots:has(.inv-dock) .as.mun-dock { grid-column: 3; grid-row: 1 / span 2; }

/* celular: o dock quebra em linhas; os dois espacos ficam a esquerda dos 20 slots, do tamanho de um slot */
@media (max-width: 759px) {
  .g-dock { --pw: calc((100vw - 55px) / 11); }
  .g-pots { width: var(--pw); grid-template-columns: 1fr; grid-auto-rows: auto; align-content: start; }
  .g-pots .as { aspect-ratio: 1; }
  .g-pots:has(.inv-dock) { grid-template-columns: 1fr; grid-template-rows: none; }
  .g-pots:has(.inv-dock) .as.inv-dock, .g-pots:has(.inv-dock) .pot-hp, .g-pots:has(.inv-dock) .pot-mp, .g-pots:has(.inv-dock) .as.mun-dock { grid-column: 1; grid-row: auto; }
  .g-pots:not(:empty) + .g-actions { width: calc(100% - var(--pw) - 6px); }
}

/* ---- janelinha: escolher a pocao do espaco e a regra ---- */
.bp-pop { position: fixed; z-index: 30; width: 340px; max-width: calc(100vw - 16px); max-height: min(560px, calc(100vh - 120px)); overflow: auto;
  background: #10131d; border: 1px solid #3a4258; border-radius: 8px; box-shadow: 0 18px 50px #000c; color: var(--txt); font-size: 13px;
  animation: bpEntra .18s ease-out; }
.bp-pop.bp-hp { border-top: 2px solid #b4453d; }
.bp-pop.bp-mp { border-top: 2px solid #4a76d0; }
@keyframes bpEntra { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.bp-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid #2c3346; background: #151a29; }
.bp-h b { color: var(--gold-2); display: block; }
.bp-h small { color: var(--dim); font-size: 11px; }
.bp-pop button { font: inherit; color: inherit; cursor: pointer; }
.bp-h button { width: 28px; height: 28px; border-radius: 5px; border: 0; background: none; color: var(--dim); }
.bp-h button:hover { background: #262b3c; color: var(--txt); }
.bp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; padding: 10px; }
.bp-op { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 4px 5px; border-radius: 6px;
  background: #121624; border: 1px solid #2c3346; font-size: 11px; line-height: 1.15; text-align: center; }
.bp-op:hover:not(:disabled) { border-color: #6b5626; }
.bp-op.on { border-color: var(--gold); background: #1d1a10; box-shadow: 0 0 0 1px var(--gold) inset; }
.bp-op.trava { opacity: .45; cursor: not-allowed; }
.bp-ic { width: 32px; height: 32px; image-rendering: pixelated; }
.bp-op em { font-style: normal; font-weight: 800; font-size: 10px; color: #ffe08a; }
.bp-op em.gratis { color: #8fe08f; }
.bp-regra { padding: 2px 10px 6px; border-top: 1px solid #222838; }
.bp-cond { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 8px; }
.bp-cond > span:first-child { color: var(--dim); min-width: 62px; }
.bp-pop .bp-cond select { width: auto; flex: none; padding: 5px 4px; font-size: 12.5px; border-radius: 4px; background: #0a0c13; border: 1px solid #2a3044; }
.bp-step { display: inline-flex; align-items: center; gap: 2px; }
.bp-step button { width: 26px; height: 28px; border-radius: 4px; background: #0a0c13; border: 1px solid #2a3044; font-weight: 800; }
.bp-pop .bp-step input { width: 52px; padding: 5px; font-size: 12.5px; text-align: center; border-radius: 4px; background: #0a0c13; border: 1px solid #2a3044; color: var(--txt); }
.bp-pct { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; }
.bp-del { margin-left: auto; width: 26px; height: 26px; border-radius: 4px; border: 1px solid #2a3044; background: #0a0c13; color: var(--dim); }
.bp-mais { margin-top: 8px; padding: 5px 10px; border-radius: 5px; border: 1px solid #2c3346; background: #151a29; font-size: 12px; }
.bp-nada { color: var(--dim); font-size: 12px; margin: 8px 0 0; }
.bp-nota { margin: 6px 10px; color: var(--dim); font-size: 11.5px; line-height: 1.4; }
.bp-f { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-top: 1px solid #2c3346; background: #121624; position: sticky; bottom: 0; }
.bp-tirar { padding: 6px 10px; border-radius: 5px; border: 1px solid #4a2e2e; background: #1c1214; color: #ffb4aa; font-size: 12px; }
.bp-on { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; margin-left: auto; }
.bp-salvar { padding: 7px 16px; border-radius: 5px; border: 1px solid #8a611c; background: linear-gradient(#f0c46a, #c8902e); color: #1d1606; font-weight: 800; }
.bp-salvar:disabled { opacity: .5; cursor: default; }
.bp-fundo { position: fixed; inset: 0; z-index: 29; background: #0008; }
@media (max-width: 759px) {
  .bp-pop { left: 8px !important; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)) !important; top: auto !important; width: auto; max-height: 72vh; }
  .bp-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---- chave "Organizar a barra sozinho" ---- */
.bp-auto { display: flex; align-items: flex-start; gap: 8px; margin: 4px 0 10px; padding: 8px 10px; border-radius: 6px; border: 1px solid #3b3220; background: #17140d; cursor: pointer; }
.bp-auto input { margin-top: 3px; accent-color: var(--gold); }
.bp-auto b { color: var(--gold-2); font-size: 13.5px; }
.bp-auto small { display: block; color: var(--dim); font-size: 12px; line-height: 1.4; margin-top: 2px; }
.bp-auto.curto { margin: 10px 0 0; padding: 6px 8px; }

/* ---- aviso "Você desbloqueou uma nova magia!" (no topo, empilha, nao bloqueia o jogo) ---- */
.nm-pilha { position: fixed; z-index: 8500; top: 60px; left: 50%; transform: translateX(-50%); width: min(400px, calc(100vw - 16px));
  display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.nm-grupo { position: relative; pointer-events: auto; overflow: hidden; border-radius: 12px; padding: 0 0 4px;
  background: linear-gradient(180deg, #1d1a12 0%, #12141d 38%, #0e1018 100%); border: 1px solid #8a6a2c;
  box-shadow: 0 14px 40px #000d, 0 0 0 1px #000 inset, 0 0 34px rgba(240, 180, 80, .28);
  animation: nmEntra .75s cubic-bezier(.18, .9, .25, 1.25) both; }
.nm-grupo.sai { animation: nmSai .45s ease-in forwards; }
@keyframes nmEntra { 0% { opacity: 0; transform: translateY(-18px) scale(.86); filter: brightness(2.2) blur(3px); } 60% { opacity: 1; filter: brightness(1.25) blur(0); } 100% { transform: none; filter: none; } }
@keyframes nmSai { to { opacity: 0; transform: translateY(-14px) scale(.96); } }
.nm-cab { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 38px 9px; text-align: center;
  background: radial-gradient(ellipse at 50% -40%, rgba(255, 200, 90, .42), transparent 70%); border-bottom: 1px solid #3a3020; }
.nm-cab b { font: 800 16px/1.2 Verdana, sans-serif; letter-spacing: .03em;
  background: linear-gradient(100deg, #f0c46a 0%, #fff3c4 45%, #f0c46a 55%, #d8a64a 100%); background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: nmTexto 2.6s ease-in-out infinite; text-shadow: 0 0 18px rgba(255, 190, 80, .25); }
@keyframes nmTexto { 0%, 100% { background-position: 100% 0; } 50% { background-position: 0 0; } }
.nm-cab span { color: #cdbf9c; font-size: 12px; }
.nm-fora { color: #ffb347; font-weight: 700; font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; }
.nm-brilho { position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 240, 200, .35) 50%, transparent 70%);
  transform: translateX(-120%); animation: nmVarre 1.3s .35s ease-out both; pointer-events: none; }
@keyframes nmVarre { to { transform: translateX(120%); } }
.nm-x { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border: 0; border-radius: 5px; background: none; color: #a99a78; cursor: pointer; font: inherit; }
.nm-x:hover { background: #2a2416; color: #fff3c4; }
.nm-card { position: relative; display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: start; margin: 8px 10px 0; padding: 10px;
  border-radius: 9px; background: #151824e6; border: 1px solid #2f3448; cursor: pointer;
  animation: nmCarta .6s cubic-bezier(.2, .9, .3, 1.2) both; animation-delay: calc(.25s + var(--i) * .14s); }
.nm-card:hover { border-color: #6b5626; }
.nm-card.sai { animation: nmSai .3s ease-in forwards; }
@keyframes nmCarta { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
.nm-ic { position: relative; width: 64px; height: 64px; display: grid; place-items: center; }
.nm-raios { position: absolute; inset: -26px; border-radius: 50%; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, rgba(255, 210, 110, .55) 0deg 7deg, rgba(255, 210, 110, 0) 7deg 22deg);
  -webkit-mask: radial-gradient(circle, #000 18%, transparent 68%); mask: radial-gradient(circle, #000 18%, transparent 68%);
  animation: nmGira 7s linear infinite, nmRaio 2.2s ease-in-out infinite; }
@keyframes nmGira { to { transform: rotate(360deg); } }
@keyframes nmRaio { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.nm-img { position: relative; width: 56px; height: 56px; border-radius: 9px; image-rendering: pixelated; border: 1px solid #f0c46a; background: #0a0c13;
  box-shadow: 0 0 0 2px #000, 0 0 22px rgba(255, 179, 71, .75); animation: nmPulsa 1.8s ease-in-out infinite; }
.nm-img.it { padding: 6px; }
.nm-letra { display: grid; place-items: center; font-weight: 800; color: var(--gold-2); }
@keyframes nmPulsa { 0%, 100% { box-shadow: 0 0 0 2px #000, 0 0 16px rgba(255, 179, 71, .55); } 50% { box-shadow: 0 0 0 2px #000, 0 0 30px rgba(255, 200, 90, .95); } }
.nm-txt { position: relative; z-index: 1; min-width: 0; }
.nm-img { z-index: 1; }
.nm-txt > b { color: #fff3c4; font-size: 15px; }
.nm-txt > i { display: block; color: #b8a77f; font-size: 12px; margin-top: 1px; }
.nm-txt p { margin: 4px 0 0; color: #c9cfdc; font-size: 12.5px; line-height: 1.35; }
.nm-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.nm-chips span { padding: 1px 6px; border-radius: 9px; background: #0d1018; border: 1px solid #2f3650; color: #aab3c6; font-size: 10.5px; white-space: nowrap; }
.nm-chips .nm-tipo { color: #f0c46a; border-color: #5a4a2a; }
.nm-acao { margin-top: 6px; font-size: 12px; font-weight: 700; }
.nm-acao.ok { color: #8fe08f; }
.nm-acao.info { color: #a9c2ff; }
.nm-acao.aviso { color: #ffb4aa; }
.nm-acao small { color: var(--dim); font-weight: 400; }
.nm-bt { margin-top: 7px; padding: 5px 12px; border-radius: 5px; border: 1px solid #8a611c; background: linear-gradient(#f0c46a, #c8902e); color: #1d1606;
  font: 800 11.5px/1.2 system-ui, sans-serif; letter-spacing: .03em; text-transform: uppercase; cursor: pointer; }
.nm-bt:disabled { opacity: .6; cursor: default; }
.nm-resto { margin: 8px 12px 0; color: #cdbf9c; font-size: 12px; }
.nm-tempo { display: block; height: 2px; margin: 10px 10px 4px; background: #ffffff14; border-radius: 2px; overflow: hidden; }
.nm-tempo i { display: block; height: 100%; background: linear-gradient(90deg, #c8902e, #fff3c4); transform-origin: left; animation: nmTempo var(--dur, 8000ms) linear forwards; }
.nm-grupo.pausa .nm-tempo i { animation-play-state: paused; }
@keyframes nmTempo { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (max-width: 759px) {
  .nm-pilha { top: 50px; width: calc(100vw - 16px); gap: 8px; }
  .nm-cab { padding: 10px 34px 8px; }
  .nm-cab b { font-size: 14.5px; }
  .nm-card { grid-template-columns: 48px 1fr; gap: 10px; margin: 6px 8px 0; padding: 8px; }
  .nm-ic { width: 48px; height: 48px; }
  .nm-img { width: 44px; height: 44px; }
  .nm-raios { inset: -18px; }
  .nm-txt p { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .nm-grupo, .nm-card, .nm-raios, .nm-img, .nm-cab b, .nm-brilho, .bp-pop { animation: none !important; }
  .nm-brilho { display: none; }
}

/* ---- runas e poções no Configurar ação (app.js): o que falta para usar, e o "Sem gold" no slot da barra ---- */
.g .acho .acho-req { display: block; color: #ffb4aa; font-size: 10px; font-weight: 700; line-height: 1.15; }
.g .acho:disabled { cursor: not-allowed; }
.g .as em.sem-gold { color: #ff9a8a; }

/* ---- relogio da espera no slot (barra_magia.js), como o do Tibia e o do Huntera: a parte que ja passou fica clara,
   no sentido horario; a espera so do grupo escurece menos. Os marcadores ("!", "Sem gold", custo) ficam por cima ---- */
.g .as .as-cd { position: absolute; inset: 0; z-index: 1; pointer-events: none; border-radius: inherit; display: grid; place-items: center;
  background: conic-gradient(transparent 0deg calc(var(--cd, 0) * 360deg), rgba(5, 7, 12, .78) calc(var(--cd, 0) * 360deg) 360deg); }
.g .as .as-cd.grupo { background: conic-gradient(transparent 0deg calc(var(--cd, 0) * 360deg), rgba(5, 7, 12, .55) calc(var(--cd, 0) * 360deg) 360deg); }
.g .as .as-cd b { font: 800 11px/1 Verdana, Tahoma, sans-serif; color: #fff; text-shadow: 0 0 2px #000, 0 1px 2px #000, 0 0 4px #000; letter-spacing: -.02em; }
.g .as .as-cd.grupo b { font-size: 9.5px; color: #d9dee8; }
.g .as .as-warn, .g .as em { z-index: 3; }
/* disparou: o slot acende (o mesmo instante do efeito na tela) */
.g .as .as-fl { position: absolute; inset: 0; z-index: 2; pointer-events: none; border-radius: inherit; animation: asAcende .5s ease-out forwards; }
@keyframes asAcende {
  0% { box-shadow: inset 0 0 0 2px #ffe08a, inset 0 0 12px 3px #ffcf4a; background: rgba(255, 246, 214, .45); }
  100% { box-shadow: inset 0 0 0 2px rgba(255, 224, 138, 0), inset 0 0 12px 3px rgba(255, 207, 74, 0); background: rgba(255, 246, 214, 0); }
}
@media (max-width: 759px) {
  .g .as .as-cd b { font-size: 10px; }
  .g .as .as-cd.grupo b { font-size: 8.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .g .as .as-fl { animation-duration: .2s; }
}

/* ---- Configurar ação: "Não usar contra" e o elemento contra a caçada atual (barra_magia.js) ---- */
.bm { margin-top: 12px; padding-top: 10px; border-top: 1px solid #2c3346; }
.bm .spread small { font-variant-numeric: tabular-nums; }
.bm > p { margin: 4px 0 8px; }
.bm-cac { margin-bottom: 10px; padding: 8px 10px; border-radius: 6px; background: #0b0e16; border: 1px solid #262c3d; }
.bm-cac p { margin: 2px 0; }
.bm-el { margin-left: 6px; }
.bm-el b { font-weight: 700; }
.bm-el.im b { color: #ff8a7a; }
.bm-el.rs b { color: #e8c46a; }
.bm-el.fr b { color: #7fe08a; }
.bm-el i { font-style: normal; color: var(--dim); }
.bm-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; align-items: center; }
.bm-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 9px; border-radius: 999px; background: #3a1c1c; border: 1px solid #6b2f2c; font-size: 12.5px; }
.g .bm-chip button { width: 20px; height: 20px; border-radius: 50%; border: 0; background: #0006; color: #ffb4aa; font-size: 11px; line-height: 1; padding: 0; }
.bm-add { display: flex; gap: 6px; }
.bm-add input { flex: 1; min-width: 0; padding: 6px 8px; font-size: 13px; }
.g .bm-mais { padding: 3px 9px; border-radius: 999px; border: 1px dashed #4a5370; background: transparent; color: var(--txt); font-size: 12px; }
.g .bm-mais:hover { border-color: var(--gold); }
