/* Partida contra o boneco e telas da fatia (b): início, mão, cartas, Essência, cronômetro, avisos,
   detalhe da carta, gaveta do painel de teste e menus. Posições da mão em px vêm de src/ui/layout.js. */

/* ------------------------------------------------------------------ telas */
.game[data-screen="home"] .topbar,
.game[data-screen="home"] .hud {
  visibility: hidden;
}

.home {
  position: absolute;
  inset: 0;
  z-index: 11;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  background:
    radial-gradient(ellipse 80% 55% at 50% 42%, rgba(26, 16, 54, 0.35), rgba(10, 8, 22, 0.86)),
    linear-gradient(rgba(10, 8, 22, 0.2), rgba(10, 8, 22, 0.55));
}

.home-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(340px, 100%);
  text-align: center;
}

.logo {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(50px, 16vw, 76px);
  line-height: 1;
  letter-spacing: 1px;
  color: #f5efff;
  -webkit-text-stroke: 7px var(--outline);
  paint-order: stroke fill;
  text-shadow: 0 5px 0 var(--outline), 0 0 34px rgba(154, 102, 255, 0.85);
}

.tagline {
  margin: 0 0 18px;
  color: #d6ccf3;
  font-size: 15px;
  font-weight: 600;
  text-shadow: 0 1px 2px #000;
}

.home-note {
  margin: -2px 0 6px;
  color: #b9addb;
  font-size: 13px;
  text-shadow: 0 1px 2px #000;
}

/* Botões grandes de pedra (menus, pausa, resultado). */
.big-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  padding: 0 18px;
  border: 3px solid var(--outline);
  border-radius: 16px;
  background: linear-gradient(#5a5280, #3a3356);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.16), 0 4px 0 #0c0a16;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.4px;
  cursor: pointer;
  touch-action: manipulation;
}

.big-btn span {
  -webkit-text-stroke: 3px var(--outline);
  paint-order: stroke fill;
}

.big-btn:active {
  transform: translateY(3px);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.16), 0 1px 0 #0c0a16;
}

.big-btn:focus-visible {
  outline: 3px solid #d9c6ff;
  outline-offset: 2px;
}

.big-btn--primary {
  background: linear-gradient(#a57bff, #6a3ae0 55%, #5527c0);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.3), 0 4px 0 #0c0a16, 0 0 22px rgba(154, 102, 255, 0.55);
}

.big-btn--play {
  min-height: 64px;
  font-size: 30px;
}

.big-btn--danger {
  background: linear-gradient(#a8505c, #74303d);
}

/* Desligado (sem baú para abrir, revanche indisponível, pedido em curso): apagado e sem afundar. */
.big-btn:disabled {
  background: linear-gradient(#3e3858, #2c2742);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.06), 0 4px 0 #0c0a16;
  color: #a49cc4;
  cursor: default;
  transform: none;
}

.act-btn--primary {
  background: linear-gradient(#a57bff, #6a3ae0 55%, #5527c0);
}

/* Faixa de baixo na demonstração. */
.demo-bar {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 18px 12px 10px;
}

.demo-bar .act-btn {
  flex: 0 0 auto;
  min-width: 96px;
  height: 48px;
  font-size: 18px;
}

.demo-label {
  margin: 0;
  color: #b9addb;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

/* ------------------------------------------------------------------ cronômetro */
.clock {
  position: relative;
}

.clock-time {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  height: 34px;
  padding: 0 10px;
  border: 2px solid var(--outline);
  border-radius: 999px;
  background: rgba(18, 14, 34, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 2px 0 rgba(0, 0, 0, 0.35);
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  -webkit-text-stroke: 3px var(--outline);
  paint-order: stroke fill;
}

.clock.is-urgent .clock-time {
  color: #ff6b76;
  border-color: #5c1020;
  animation: urgent 1s ease-in-out infinite;
}

/* Fase do relógio dentro da própria pílula, acima dos números: "Essência ×2" no último minuto e
   "Prorrogação" depois. Nada pendura da barra sobre a arena (os números de vida das Sentinelas
   inimigas ficam logo abaixo dela nos celulares baixos). */
.clock-time {
  flex-direction: column;
  gap: 1px;
}

.clock-phase {
  font-size: 10px;
  letter-spacing: 0.3px;
  line-height: 1;
  white-space: nowrap;
  -webkit-text-stroke-width: 2px;
}

.clock.is-double .clock-time,
.clock.is-overtime .clock-time {
  padding: 0 9px;
  font-size: 16px;
}

.clock.is-double .clock-time {
  border-color: #2a1258;
  background: linear-gradient(#8a5cf0, #5a2cc4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 2px 0 rgba(0, 0, 0, 0.35), 0 0 12px rgba(154, 102, 255, 0.7);
}

.clock.is-double .clock-phase {
  color: #efe4ff;
}

.clock.is-overtime .clock-time {
  border-color: #4a1a08;
  background: linear-gradient(#e0773a, #a8401c);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 2px 0 rgba(0, 0, 0, 0.35), 0 0 12px rgba(255, 140, 70, 0.6);
}

.clock.is-overtime .clock-phase {
  color: #ffe2c4;
}

.rune-count.is-bump {
  animation: bump 0.45s cubic-bezier(0.2, 1.6, 0.4, 1);
}

@keyframes urgent {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

@keyframes bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.6); color: #ffe08a; }
  100% { transform: scale(1); }
}

/* ------------------------------------------------------------------ mão */
/* No desktop a faixa da mão é mais larga que a arena: vira uma bandeja com a moldura dela, em vez de
   um bloco escuro saindo pelos lados. */
.game.has-sides .hud {
  border-radius: 14px 14px 0 0;
  background: linear-gradient(rgba(34, 28, 58, 0.97), rgba(14, 11, 28, 0.99));
  box-shadow: 0 0 0 3px #3a3356, 0 0 0 6px #120e1f, 0 -12px 34px rgba(0, 0, 0, 0.5);
}

.hand {
  position: absolute;
  inset: 0;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

/* A carta inteira é o retrato do motor de arte (canvas): moldura de raridade, janela do Domínio e, na
   carta da mão, a placa do nome embaixo. O DOM só põe por cima o nome, o custo, os selos e o véu. */
.card {
  position: absolute;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: #1c1530;
  box-shadow: 0 3px 0 #0c0a16;
  color: var(--text);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  cursor: grab;
}

.card-art {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  width: 100%;
  border-radius: 6px;
  pointer-events: none;
}

/* Selos das palavras-chave na base da janela do retrato, encostados à direita (o custo fica no canto
   oposto). */
.card-icons {
  position: absolute;
  right: 6px;
  bottom: calc(30% + 4px);
  display: flex;
  gap: 2px;
  pointer-events: none;
}

.card-icon {
  display: block;
}

/* Nome sobre a placa pintada no retrato (30% de baixo, dentro da moldura). A caixa vai até a borda da
   moldura para as duas linhas caberem nas cartas menores (62 × 79 no celular baixo) sem cortar. */
.card-name {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 1px;
  top: 70%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1px 2px 0;
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 11px;
  line-height: 0.98;
  text-align: center;
  -webkit-hyphens: auto;
  hyphens: auto;
  pointer-events: none;
}

.card-name span {
  -webkit-text-stroke: 2.5px var(--outline);
  paint-order: stroke fill;
}

/* Cristal violeta do custo, no canto. */
.card-cost {
  position: absolute;
  left: -7px;
  top: -7px;
  width: clamp(22px, calc(var(--card-w, 70px) * 0.36), 32px);
  aspect-ratio: 0.88;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--outline);
  clip-path: polygon(50% 0, 100% 24%, 100% 76%, 50% 100%, 0 76%, 0 24%);
  pointer-events: none;
}

.card-cost::before {
  content: "";
  position: absolute;
  inset: 2px;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.55) 0 22%, transparent 23%),
    linear-gradient(#c7a6ff, #8b4dff 45%, #5b21b6);
  clip-path: polygon(50% 0, 100% 24%, 100% 76%, 50% 100%, 0 76%, 0 24%);
}

.card-cost b {
  position: relative;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(14px, calc(var(--card-w, 70px) * 0.24), 21px);
  line-height: 1;
  color: #fff;
  -webkit-text-stroke: 3px var(--outline);
  paint-order: stroke fill;
}

/* Falta Essência: retrato apagado e véu cobrindo de cima a fração que falta. */
.card-veil {
  position: absolute;
  inset: 0;
  border-radius: 6px;
  background: rgba(14, 10, 30, 0.6);
  transform: scaleY(0);
  transform-origin: top;
  pointer-events: none;
}

.card.is-poor .card-art {
  filter: grayscale(0.85) brightness(0.8);
}

.card.is-poor .card-cost::before {
  background: linear-gradient(#8f84ad, #5b5179);
}

/* Desconto pendente (reduceNextCost): o custo efetivo em verde-claro. */
.card.is-discounted .card-cost b {
  color: #b9ffcf;
}

.card--hand {
  transition: transform 0.12s ease-out, box-shadow 0.12s ease-out;
}

.card.is-selected {
  transform: translateY(-9px);
  box-shadow: 0 0 0 2px #efe4ff, 0 0 20px rgba(170, 120, 255, 0.95), 0 6px 0 #0c0a16;
}

.card.is-dragging {
  opacity: 0.32;
  filter: grayscale(0.6);
}

.card.is-pending {
  visibility: hidden;
}

/* Próxima carta: menor, ao lado da mão, sem interação. */
.next-card {
  position: absolute;
  pointer-events: none;
}

.next-label {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  transform: translateX(-50%);
  color: #b9addb;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.3px;
  white-space: nowrap;
  -webkit-text-stroke: 2px var(--outline);
  paint-order: stroke fill;
}

.card--next {
  position: relative;
  border-radius: 5px;
  opacity: 0.92;
  cursor: default;
  --card-w: 46px;
}

/* Na próxima carta o retrato basta: o nome não caberia legível. */
.card--next .card-name {
  display: none;
}

.card--next .card-art {
  border-radius: 5px;
}

.card--next .card-cost {
  left: -5px;
  top: -5px;
  width: 19px;
}

.card--next .card-cost b {
  font-size: 12px;
  -webkit-text-stroke-width: 2.5px;
}

/* Carta seguindo o dedo sobre a mão e carta voando ao jogar. */
.card--drag,
.card--fly {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 9;
  pointer-events: none;
  box-shadow: 0 0 0 2px #efe4ff, 0 10px 24px rgba(0, 0, 0, 0.55), 0 0 22px rgba(170, 120, 255, 0.8);
}

/* ------------------------------------------------------------------ Essência */
.essence-counter {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 2px solid var(--outline);
  border-radius: 999px;
  background: linear-gradient(#3a2a66, #22183f);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 2px 0 #0c0a16;
}

.essence-gem {
  width: 11px;
  height: 14px;
  background: linear-gradient(115deg, #f0e4ff 0 20%, #b58bff 21%, #7c3aed 70%);
  clip-path: polygon(50% 0, 100% 30%, 100% 70%, 50% 100%, 0 70%, 0 30%);
  filter: drop-shadow(0 0 3px rgba(180, 140, 255, 0.9));
}

.essence-counter b {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 19px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  -webkit-text-stroke: 3px var(--outline);
  paint-order: stroke fill;
}

.essence-bar {
  position: absolute;
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 2px solid var(--outline);
  border-radius: 9px;
  background: #130e24;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.55), 0 2px 0 #0c0a16;
}

.essence-seg {
  position: relative;
  flex: 1 1 0;
  overflow: hidden;
  border-radius: 4px;
  background: #2a2147;
}

.essence-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(#a98aff, #6f45d8);
  opacity: 0.55;
  transform: scaleX(0);
  transform-origin: left;
}

.essence-seg.is-full .essence-fill {
  opacity: 1;
  transform: none;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.5) 0 18%, transparent 19%),
    linear-gradient(#d2b8ff, #9157ff 45%, #6a2fd6);
  box-shadow: inset 0 -2px 0 rgba(40, 10, 90, 0.5);
}

.essence-seg.is-new {
  animation: seg-pop 0.4s ease-out;
}

.essence-bar.is-short,
.essence-counter.is-short {
  animation: shake 0.36s ease-in-out;
  border-color: #b02a3c;
}

@keyframes seg-pop {
  0% { filter: brightness(2.2); }
  100% { filter: brightness(1); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

/* ------------------------------------------------------------------ avisos */
.fx-layer {
  position: fixed;
  inset: 0;
  z-index: 7;
  pointer-events: none;
  overflow: hidden;
}

.enemy-chip {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px 2px 2px;
  border: 2px solid var(--outline);
  border-radius: 999px;
  background: linear-gradient(#ff7a84, #c9323f);
  box-shadow: 0 3px 0 rgba(12, 10, 22, 0.6);
  font-family: var(--font-display);
  font-size: 12px;
  white-space: nowrap;
  animation: chip 1.9s ease-out forwards;
}

/* Selo redondo da carta (render/card-art.js cardBadge), com o próprio contorno. */
.enemy-chip canvas {
  flex: 0 0 auto;
  display: block;
  border-radius: 50%;
}

.enemy-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-text-stroke: 2.5px var(--outline);
  paint-order: stroke fill;
}

.enemy-chip.is-compact {
  gap: 3px;
  padding: 1px 6px 1px 1px;
  font-size: 11px;
}

.enemy-chip.is-compact span {
  -webkit-text-stroke-width: 2px;
}

@keyframes chip {
  0% { opacity: 0; margin-top: 10px; }
  12% { opacity: 1; margin-top: 0; }
  80% { opacity: 1; }
  100% { opacity: 0; margin-top: -8px; }
}

/* Faixa de aviso no meio da metade inimiga (~27% da arena): longe do rio e das pontes, onde está a
   luta, e abaixo das Sentinelas inimigas; some em 2 s. */
.banner {
  position: absolute;
  z-index: 7;
  left: var(--column-x, 0);
  width: var(--column-w, 100%);
  top: calc(var(--arena-top, 0px) + var(--arena-h, 100vh) * 0.27);
  padding: 6px 12px 8px;
  background: linear-gradient(90deg, transparent, rgba(22, 12, 46, 0.78) 18%, rgba(22, 12, 46, 0.78) 82%, transparent);
  text-align: center;
  pointer-events: none;
  opacity: 0;
}

.banner.is-showing {
  animation: banner 2s ease-out forwards;
}

.banner p {
  margin: 0;
}

.banner-title {
  font-family: var(--font-display);
  font-size: clamp(26px, 8.5vw, 36px);
  line-height: 1.1;
  color: #e9dcff;
  -webkit-text-stroke: 5px var(--outline);
  paint-order: stroke fill;
  text-shadow: 0 0 22px rgba(154, 102, 255, 0.9);
}

.banner[data-kind="overtime"] .banner-title {
  color: #ffd2a0;
  text-shadow: 0 0 22px rgba(255, 130, 60, 0.9);
}

.banner-text {
  margin-top: 2px !important;
  color: #efe8ff;
  font-size: 14px;
  font-weight: 700;
  text-shadow: 0 1px 2px #000;
}

@keyframes banner {
  0% { opacity: 0; transform: scale(1.35); }
  10% { opacity: 1; transform: scale(1); }
  80% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1); }
}

.toast {
  position: absolute;
  z-index: 8;
  left: calc(var(--column-x, 0px) + var(--column-w, 100vw) / 2);
  top: calc(var(--hud-top, 80vh) - 52px);
  width: max-content;
  max-width: calc(var(--column-w, 100vw) - 24px);
  margin: 0;
  padding: 8px 14px;
  border: 2px solid var(--outline);
  border-radius: 999px;
  background: rgba(18, 14, 34, 0.94);
  color: #efe6ff;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
}

.toast[data-kind="error"] {
  border-color: #6a1424;
  background: rgba(70, 14, 28, 0.95);
  color: #ffd9de;
}

.toast.is-visible {
  animation: hint 2.2s ease forwards;
}

/* ------------------------------------------------------------------ detalhe da carta */
.card-detail {
  position: absolute;
  z-index: 9;
  left: calc(var(--column-x, 0px) + var(--column-w, 100vw) / 2);
  bottom: calc(var(--hud-bottom-gap, 160px) + 12px);
  width: min(340px, calc(var(--column-w, 100vw) - 20px));
  padding: 12px 12px 10px;
  border: 3px solid var(--outline);
  border-radius: 16px;
  background: linear-gradient(#3a3356, #211c36);
  box-shadow: inset 0 0 0 2px var(--domain, #8f9ab5), 0 6px 0 #0c0a16, 0 12px 30px rgba(0, 0, 0, 0.55);
  transform: translateX(-50%);
  animation: pop-in 0.18s ease-out;
  pointer-events: none;
  /* Nunca passa da barra do topo: o que sobrar (flavor, atributos) é cortado embaixo. */
  max-height: calc(var(--hud-top, 600px) - 60px);
  overflow: hidden;
}

.card-detail p {
  margin: 0;
}

.detail-head {
  position: relative;
  display: flex;
  gap: 10px;
}

/* O retrato já traz a moldura de raridade e a do Domínio. */
.detail-art {
  flex: 0 0 auto;
  border-radius: 6px;
  box-shadow: 0 2px 0 #0c0a16;
}

.detail-title {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  /* O cristal de custo ocupa o canto (34 px a −4 px): nome longo não encosta nele. */
  padding-right: 40px;
}

.detail-name {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.05;
  -webkit-text-stroke: 3px var(--outline);
  paint-order: stroke fill;
}

.detail-type {
  color: #d6ccf3;
  font-size: 13px;
  font-weight: 700;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
}

.detail-domain,
.detail-rarity {
  padding: 1px 7px;
  border-radius: 999px;
  border: 1.5px solid var(--outline);
  color: var(--outline);
}

.detail-domain {
  background: var(--domain-light, #e0dcea);
}

.detail-rarity {
  background: var(--rarity, #c3cbe0);
}

.card-cost.detail-cost {
  left: auto;
  right: -4px;
  top: -4px;
  width: 34px;
}

.detail-cost b {
  font-size: 22px;
}

.detail-facts {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  gap: 4px 8px;
  margin: 10px 0 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(10, 8, 22, 0.45);
  font-size: 13px;
}

.detail-facts dt {
  color: #a99fcb;
  font-weight: 600;
}

.detail-facts dd {
  margin: 0;
  color: #f3efff;
  font-weight: 700;
}

.detail-rules {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 10px 0 0;
  color: #f3efff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

/* Selos das palavras-chave da carta (ícone + texto curto com os parâmetros). */
.detail-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
}

.detail-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 9px 1px 2px;
  border: 1.5px solid var(--outline);
  border-radius: 999px;
  background: rgba(10, 8, 22, 0.55);
  color: #fff;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.2px;
}

/* Uma linha por efeito, com o ícone do gatilho. */
.detail-line,
.detail-tooltip {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.detail-icon {
  flex: 0 0 auto;
  display: block;
}

.detail-line .detail-icon,
.detail-tooltip .detail-icon {
  margin-top: 1px;
}

/* Glossário: o que cada palavra-chave usada quer dizer. */
.detail-glossary {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 8px 0 0;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(10, 8, 22, 0.35);
}

.detail-tooltip {
  color: #c9bfe6;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
}

.detail-tooltip b {
  color: #f3efff;
}

.detail-facts[hidden],
.detail-rules[hidden],
.detail-glossary[hidden] {
  display: none;
}

.detail-flavor {
  color: #c9bfe6;
  font-size: 13px;
  font-style: italic;
  text-align: center;
}

/* Celular baixo: ficha mais compacta para o texto de regras caber. */
@media (max-height: 680px) {
  .card-detail {
    padding: 9px 10px 8px;
  }

  .detail-name {
    font-size: 18px;
  }

  .detail-rules,
  .detail-chip {
    font-size: 12px;
  }

  .detail-tooltip,
  .detail-facts,
  .detail-flavor {
    font-size: 11px;
  }

  .detail-facts {
    margin: 6px 0 5px;
    padding: 5px 8px;
  }

  .detail-glossary {
    margin-top: 6px;
    padding: 4px 7px;
  }
}

/* ------------------------------------------------------------------ gaveta do painel de teste */
.drawer {
  position: absolute;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 0 6px 6px;
  pointer-events: none;
}

.drawer > * {
  pointer-events: auto;
}

.drawer-handle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 10px 0 8px;
  border: 2px solid var(--outline);
  border-radius: 999px;
  background: rgba(36, 30, 60, 0.88);
  color: #d8c8ff;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.3px;
  cursor: pointer;
  touch-action: manipulation;
}

.drawer-handle[aria-expanded="true"] {
  background: linear-gradient(#8f63f7, #5d34c4);
  color: #fff;
}

.icon-wrench {
  position: relative;
  width: 14px;
  height: 14px;
  border: 3px solid currentColor;
  border-radius: 50%;
  border-right-color: transparent;
  transform: rotate(-45deg);
}

/* ------------------------------------------------------------------ pausa */
.overlay-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(260px, 72vw);
  margin-top: 10px;
}

.overlay-card .progress-link {
  margin-top: 2px;
}
