/*
 * ISEKAI DE CLASSE (16/09) — o badge flutuante que avisa quando está
 * disponível. A tela de diálogo em si reaproveita `.nv`/`.nv__*` de
 * `/potato/novel/styles.css` (ver `index.js`); aqui só o que é NOVO.
 * Mesma paleta madeira+bronze já usada em `novel/styles.css` — cores
 * copiadas de lá de propósito, não reinventadas.
 */

.isc__badge {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  translate: -50% 0;
  z-index: 850; /* acima do HUD normal, abaixo de qualquer `.nv` (9000) */
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid #9c7c4e;
  border-radius: 999px;
  background: linear-gradient(180deg, #6b5a3f, #3f3120);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(138, 114, 85, 0.5);
  color: #ede1c8;
  font-family: 'Baloo 2', system-ui, sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  animation: isc-flutuar 2.4s ease-in-out infinite;
}

.isc__badge:hover {
  filter: brightness(1.15);
}

.isc__badge-icone {
  color: #e7c884;
  font-size: 1.05rem;
  animation: isc-brilhar 1.6s ease-in-out infinite;
}

@keyframes isc-flutuar {
  0%, 100% { translate: -50% 0; }
  50% { translate: -50% -4px; }
}

@keyframes isc-brilhar {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}

@media (max-width: 520px) {
  .isc__badge {
    font-size: 0.82rem;
    padding: 9px 13px;
  }
}

/*
 * CARTA DE PODER GUARDADO (16/09, pedido #49) — aparece junto da escolha de
 * classe: "uma carta com o Poder guardado esperando o jogador e com a
 * imagem do jogador antigo que deixou seu poder lá esperando pra fusão".
 */
.isc__carta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0;
  padding: 10px 14px;
  border: 1px solid #9c7c4e;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(107, 90, 63, 0.55), rgba(63, 49, 32, 0.55));
  box-shadow: inset 0 1px 0 rgba(138, 114, 85, 0.4);
}

.isc__carta-arte {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
}

.isc__carta-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.isc__carta-info b {
  color: #e7c884;
  font-size: 0.9rem;
}

.isc__carta-poder {
  color: #ede1c8;
  font-weight: 700;
  font-size: 1.05rem;
}

.isc__carta-info small {
  color: #c9b89a;
  font-size: 0.75rem;
  line-height: 1.3;
}

@media (max-width: 520px) {
  .isc__carta {
    padding: 8px 10px;
    gap: 9px;
  }
  .isc__carta-arte {
    width: 46px;
    height: 46px;
  }
}


/*
 * A EMBOSCADA (16/09) — cutscene que toca uma vez antes da Deusa entrar.
 * Reaproveita `.nv`/`.nv__palco`/`.nv__caixa` (grid: figura em cima, caixa
 * embaixo) so que a linha de cima vira DOIS bonecos lado a lado (Rei real do
 * mundo x heroi com a skin equipada) em vez de um so.
 */
.emb__duo {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6vw;
  min-height: 0;
  height: 100%;
}
.emb__figura {
  flex: 1;
  max-width: 46%;
  display: grid;
  place-items: end center;
  min-height: 0;
  overflow: hidden;
  animation: nv-subir 0.42s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
.emb__arte {
  width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
}
.emb__figura--rei {
  /* 16/09 (feedback do Zerg): o Rei cresce 20% e precisa vazar da caixa
     dele pra nao cortar a arte maior. */
  overflow: visible;
}
.emb__figura--rei .emb__arte {
  filter: drop-shadow(0 0 22px rgba(255, 70, 50, 0.4));
  /* 16/09: Rei virado pra ESQUERDA (de frente pro heroi, que ficou do lado
     esquerdo) + 20% maior, pedido do Zerg. O ator nasce olhando pra direita
     por padrao (mesma pose de quando ele estava do lado esquerdo, virado
     pro centro) - espelhar em X vira ele pra esquerda. Origem embaixo no
     centro pra crescer sem "flutuar" (pes ficam no chao). */
  transform: scale(-1.2, 1.2);
  transform-origin: 50% 100%;
}
.emb__figura--heroi .emb__arte {
  filter: drop-shadow(0 0 16px rgba(255, 255, 255, 0.18));
  /* 02/10 (Gabriel): o herói ficou grande demais na novel — 20% menor, para ficar menor que o Rei. */
  transform: scale(0.8);
  transform-origin: 50% 100%;
}

.emb__impacto {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 5;
}
.emb.is-hit .emb__impacto {
  animation: emb-flash 0.26s ease-out;
}
.emb.is-hit .emb__palco {
  animation: emb-tremor 0.26s ease-out;
}
@keyframes emb-flash {
  0% { opacity: 0; }
  15% { opacity: 0.85; }
  100% { opacity: 0; }
}
@keyframes emb-tremor {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-6px, 2px); }
  40% { transform: translate(5px, -2px); }
  60% { transform: translate(-4px, 1px); }
  80% { transform: translate(3px, -1px); }
}

@media (max-width: 560px) {
  .emb__duo {
    gap: 3vw;
  }
}

/* 02/10 (Gabriel): tela de escolha de classe do Isekai — as mesmas classes de cartão do começo do jogo, por cima do jogo. */
.isc-tela { position: fixed; inset: 0; z-index: 1200; overflow: auto; background: radial-gradient(120% 90% at 50% 20%, #14213a 0%, #060a14 70%); }
.isc-tela .klass { position: relative; }
.isc-tela .klass.isc-espera { cursor: not-allowed; }
.isc-tela .klass.isc-espera .klass__face > *:not(.isc-faixa) { filter: grayscale(1) brightness(0.62); opacity: 0.9; }
.isc-tela .klass .isc-faixa {
  position: absolute; z-index: 3; top: 36%; left: 50%;
  padding: 5px 14px; border: 2px solid #3fbf6a; border-radius: 6px; outline: 1px solid rgb(63 191 106 / 0.55); outline-offset: 2px;
  background: rgb(10 30 16 / 0.8); color: #7ff0a4; font: 900 clamp(14px, 1.8vw, 20px)/1.1 Cinzel, Georgia, serif; letter-spacing: 0.14em; text-transform: uppercase;
  text-shadow: 0 1px 0 #000; white-space: nowrap; box-shadow: 0 2px 10px rgb(0 0 0 / 0.6), inset 0 0 6px rgb(63 191 106 / 0.35);
  transform: translate(-50%, -50%) rotate(-14deg); pointer-events: none; filter: none;
}
.isc-tela .classes__confirm { display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; }

/* Mesmo contêiner do `.classes` do jogo, mas SEM esse nome: vários módulos (mangá, música, voltar) reagem a `.portal__content.classes` como "escolha inicial". */
.isc-classes { position: relative; display: flex; flex-direction: column; align-items: center; width: 100%; min-height: 100%; margin-inline: auto; gap: var(--sp-4, 16px); max-width: 1060px; padding: clamp(16px, 4vh, 40px) var(--sp-5, 20px) var(--sp-6, 28px); box-sizing: border-box; }

.isc-tela .classes__confirm { padding-block: 14px; min-height: 84px; }
.isc-tela .classes__confirm .hexbtn { flex: none; min-width: 190px; }

.isc-tela .classes__confirm { flex-wrap: nowrap; justify-content: flex-end; }
.isc-tela .classes__escolhida { flex: 1; text-align: left; }
.isc-tela .classes__confirm .hexbtn { min-width: 150px; }
.isc-tela .klass[aria-pressed="false"] .klass__selo { display: none; }

/* 02/10 (Gabriel): a novel do Isekai cobre o jogo — fundo opaco, sem monstros aparecendo atrás. */
.isc .nv__fundo, .isc.emb .nv__fundo { background: linear-gradient(180deg, rgba(0,0,0,.28), rgba(0,0,0,.5)), url('/potato/bg/trono/00.webp') center / cover no-repeat, #04050a !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; opacity: 1 !important; }

/* 03/10: névoa da vida nova — uma "aurora boreal escura": véu escuro + faixas de verde-azulado e violeta que derivam devagar. Acima da cena, abaixo do HUD (z 38 < 40). */
.isc-nevoa {
  /* 04/10 (Gabriel): dentro da cena, ATRÁS dos personagens (herói, pet, companions e inimigos) — sem z-index: a ordem no DOM (antes do canvas dos atores) decide. */
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  --nevoa: 0.24;
  background:
    radial-gradient(120% 90% at 50% 105%, rgba(14, 8, 34, calc(var(--nevoa) * 2.2)) 0%, transparent 62%),
    rgba(2, 2, 7, calc(var(--nevoa) * 1.35));
}
.isc-nevoa::before,
.isc-nevoa::after {
  content: '';
  position: absolute;
  left: -20%;
  width: 140%;
  height: 52%;
  filter: blur(34px);
  opacity: calc(var(--nevoa) * 2.4);
  will-change: transform;
}
.isc-nevoa::before {
  top: -6%;
  background: linear-gradient(95deg, transparent 6%, rgba(20, 150, 120, 0.5) 26%, rgba(45, 85, 190, 0.42) 48%, rgba(100, 45, 170, 0.46) 68%, transparent 92%);
  animation: isc-aurora-a 16s ease-in-out infinite alternate;
}
.isc-nevoa::after {
  top: 6%;
  height: 40%;
  background: linear-gradient(80deg, transparent 10%, rgba(85, 40, 160, 0.46) 30%, rgba(20, 140, 110, 0.36) 55%, rgba(30, 60, 150, 0.42) 75%, transparent 94%);
  animation: isc-aurora-b 21s ease-in-out infinite alternate;
}
@keyframes isc-aurora-a { from { transform: translateX(-6%) skewX(-8deg) scaleY(0.9); } to { transform: translateX(7%) skewX(6deg) scaleY(1.12); } }
@keyframes isc-aurora-b { from { transform: translateX(8%) skewX(7deg) scaleY(1.1); } to { transform: translateX(-7%) skewX(-6deg) scaleY(0.9); } }
@media (prefers-reduced-motion: reduce) { .isc-nevoa::before, .isc-nevoa::after { animation: none; } }

/* 03/10: com a névoa ligada, a barra de skills/companions (dock, z 3) e o retrato ficam ACIMA dela (z 14), como o resto do HUD. */
html[data-nevoa] .scene__dock { z-index: 14; }

/* 03/10 (Gabriel): detalhes de aurora boreal em verde e roxo escuros, suaves, na faixa de cima da cena (altura dos botões Loja/Mercado/...), só para dar um ar dark e místico. */
.isc-nevoa__fita { position: absolute; top: 1%; height: 15%; width: 46%; filter: blur(22px); opacity: .9; mix-blend-mode: screen; will-change: transform; }
.isc-nevoa__fita--verde { left: -6%; background: linear-gradient(95deg, transparent 4%, rgba(12, 90, 66, .55) 40%, rgba(18, 70, 80, .4) 70%, transparent 96%); animation: isc-fita-a 19s ease-in-out infinite alternate; }
.isc-nevoa__fita--roxa { left: 30%; top: 4%; background: linear-gradient(85deg, transparent 6%, rgba(58, 24, 104, .55) 38%, rgba(84, 36, 120, .4) 68%, transparent 94%); animation: isc-fita-b 24s ease-in-out infinite alternate; }
.isc-nevoa__fita--verde2 { left: 58%; top: 0; width: 44%; background: linear-gradient(100deg, transparent 8%, rgba(16, 80, 70, .5) 44%, rgba(40, 40, 110, .4) 72%, transparent 95%); animation: isc-fita-c 21s ease-in-out infinite alternate; }
@keyframes isc-fita-a { from { transform: translateX(-4%) scaleY(.9); } to { transform: translateX(14%) scaleY(1.15); } }
@keyframes isc-fita-b { from { transform: translateX(10%) scaleY(1.1); } to { transform: translateX(-12%) scaleY(.85); } }
@keyframes isc-fita-c { from { transform: translateX(-10%) scaleY(.95); } to { transform: translateX(8%) scaleY(1.2); } }
@media (prefers-reduced-motion: reduce) { .isc-nevoa__fita { animation: none; } }
