/* =============================
   Customização para todos os botões circulares .pill
   ============================= */
button.pill {
  background: #2563eb;
  color: #fff;
  border: 2px solid #1e40af;

  /* Efeito alto relevo: sombra externa e luz interna */
  box-shadow: 0 4px 16px 0 rgba(30, 64, 175, 0.28), 0 2px 4px 0 rgba(0,0,0,0.18), 0 1.5px 0 #fff8 inset, 0 -2px 8px 0 rgba(255,255,255,0.10) inset;
  /* Adicione outras propriedades conforme desejar */
}
/* Borda azul fina persistente para cards do humano durante o diálogo */
.card.card-mic-persist {
  border-color: #00b7ff !important;
  border-width: 1.5px;
  box-shadow: 0 0 0 3px rgba(0,183,255,0.22);
  outline: 1px solid #00b7ff;
  z-index: 9;
  transition: border-color 0.18s, box-shadow 0.18s, outline 0.18s;
}
/* Borda azul vibrante para vez do humano no microfone */
.card.card-mic-active {
  border-color: #00b7ff !important;
  border-width: 3px;
  box-shadow:
    0 0 0 6px rgba(0,183,255,0.45),
    0 0 16px 3px rgba(0,183,255,0.35),
    0 0 0 2px #00b7ff inset;
  outline: 2px solid #00b7ff;
  z-index: 11;
  transition: border-color 0.18s, box-shadow 0.18s, outline 0.18s;
}
/* Destaque visual para botões do card 1 em modo diálogo */
.modo-dialogo-ativo {
  transform: scale(1.4);
  z-index: 2;
  transition: transform 0.18s cubic-bezier(.4,2,.6,1);
}
/* Borda persistente após pronúncia (metade da grossura) */
.card.card-spoken {
  border-color: #ff9800;
  border-width: 1px;
  box-shadow: 0 0 0 3px rgba(255,152,0,0.22);
  outline: 1px solid #ff9800;
  z-index: 9;
  transition: border-color 0.18s, box-shadow 0.18s, outline 0.18s;
}
/* Destaque forte ao falar (pronúncia ativa) */
.card.card-speaking {
  border-color: #ff9800;
  border-width: 3px;
  box-shadow:
    0 0 0 6px rgba(255,152,0,0.45),
    0 0 16px 3px rgba(255,152,0,0.35),
    0 0 0 2px #f97316 inset;
  outline: 2px solid #ff9800;
  z-index: 10;
  transition: border-color 0.18s, box-shadow 0.18s, outline 0.18s;
}
/* bundle.css - Unificação de style.css e stylecard.css para performance */

/* ======================================================================
   bundle.css — Versão legível, organizada e identada
   Unificação de style.css + stylecard.css
   ====================================================================== */

/* =========================================================
   RESET / BASE
   ========================================================= */
* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: #0b1220;
  color: #e5e7eb;
}

/* =========================================================
   TOPBAR / HEADER
   ========================================================= */
#topWrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 9999;
}

.topbar {
  width: 100%;
  padding: 6px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.topbar-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

topbar-main::before,
topbar-main::after {
  content: none !important;
}
/* Novo: círculo de fundo do ícone do card */
/* ================================
   Círculo de fundo do ícone do card
   Para ajustar o tamanho, altere --icon-circle-size
   ================================ */
:root {
  --icon-circle-size: 80px; /* Altere aqui para aumentar/diminuir o círculo */
}
.card-icon-wrapper {
  position: relative;
  width: var(--icon-circle-size);
  height: var(--icon-circle-size);
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-icon-circle-bg {
  display: none;
  position: absolute;
  left: 0;
  top: 0;
  width: var(--icon-circle-size);
  height: var(--icon-circle-size);
  border-radius: 50%;
  background: var(--icon-bg, rgba(0,0,0,0.08));
  box-shadow: none !important;
  border: 2.5px solid #1e293b;
  transition: background 0.18s, border 0.18s;
  z-index: 0;
}
body.show-card-icon-circle .card-icon-circle-bg {
  display: block;
}
.card-icon {
  width: calc(var(--icon-circle-size) * 0.85);
  height: calc(var(--icon-circle-size) * 0.85);
  object-fit: contain;
  display: block;
  position: relative;
  z-index: 1;
}

#btnResetTop {
  font-size: clamp(14px, 3.5vw, 26px);
  font-weight: 900;
  margin: 0;
  white-space: nowrap;
}

.stats {
  white-space: nowrap;
  font-size: 16px;
}

.menu-button {
  display: none;
  font-size: 32px;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 2px 8px;
}

.btn-home-cards {
  margin-left: auto;
  margin-right: 32px;
  margin-top: 10px;
  padding: 6px 10px;
  font-size: 14px;
  font-weight: 900;
  color: #1a263a;
  background: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 8px;
  cursor: pointer;
  transition: 0.15s;
}

.btn-home-cards:hover {
  background: #e8f0ff;
  color: #001b38;
}

/* =========================================================
   CONTROLES
   ========================================================= */
.controls {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 5px;
  padding: 0 22px 16px;
}

.controls.open {
  display: flex;
}

.controls-group {
  width: 100%;
  padding: 6px 16px;
  background: #012f6c;
  border: 1px solid #0d366b;
  border-radius: 18px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  box-shadow: 0 0 6px rgba(29, 111, 216, 0.25);
}

.controls-group > * {
  white-space: nowrap;
  flex: 0 0 auto;
}

/* =========================================================
   SWITCH
   ========================================================= */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  background: #020617;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid #1f2937;
}

.switch input {
  appearance: none;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: #4b5563;
  position: relative;
  cursor: pointer;
}

.switch input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e5e7eb;
  transition: 0.16s;
}

.switch input:checked {
  background: #16a34a;
}

.switch input:checked::after {
  left: 20px;
}

/* Cor do texto do span dentro do switch */
.switch span {
  color: #e5e7eb;
}
body[data-theme="light"] .switch span {
  color: #222;
}

/* ===============================
   SWITCH - TEMA CLARO
   =============================== */
body[data-theme="light"] .switch {
  background: #fff;
  border-color: #ccc;
}
body[data-theme="light"] .switch span {
  color: #222;
}

/* =========================================================
   CAMPOS / BOTÕES
   ========================================================= */
.field {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.field select {
  height: 30px;
  padding: 2px 6px;
  border-radius: 8px;
  border: 1px solid #4b5563;
  background: #020617;
  color: #e5e7eb;
}

.btn {
  height: 34px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid #1d4ed8;
  background: #1d4ed8;
  color: #e5e7eb;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn:hover {
  background: #2563eb;
}

/* =========================================================
   OVERLAY DE ESPERA
   ========================================================= */
.wait-overlay {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.85);
  padding: 25px 40px;
  border-radius: 12px;
  color: #ffffff;
  font-size: 32px;
  font-weight: bold;
  z-index: 99999;
  display: none;
  text-shadow: 0 0 6px #000;
  border: 2px solid #ffffff;
}

/* =========================================================
   LAYOUT PRINCIPAL
   ========================================================= */
main {
  padding-top: calc(var(--top-height) + 16px);
  padding-left: 18px;
  padding-right: 18px;
  padding-bottom: 120px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

/* =========================================================
   CARD
   ========================================================= */
.card {
  background: #020617;
  border-radius: 16px;
  padding: 16px 18px 50px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  min-height: 150px;
  border: 2px solid transparent;
  /* Alto relevo para aparência de cartão */
  /* Alto relevo mais intenso para aparência de cartão */
  /* Alto relevo e sombra lateral direita */
  /* Auto-relevo máximo + sombra escura definida para destaque dos cards */
  box-shadow:
    0 -24px 64px -8px rgba(0,0,0,0.44),    /* sombra muito maior acima */
    48px 0 160px -8px rgba(0,0,0,0.52),    /* sombra muito maior à direita */
    0 16px 64px 0 rgba(0,0,0,0.82),        /* sombra escura principal mais intensa */
    0 60px 200px 0 rgba(30,64,175,0.48),   /* azul mais visível */
    0 40px 120px 0 rgba(0,0,0,0.56),
    64px 0 180px -4px rgba(0,0,0,0.62);
  position: relative;
  transition: background 0.18s, border-color 0.18s, transform 0.08s;
}

/* Efeito de dobra na borda superior esquerda */
/* fim do bloco .card */

.card:hover {
  transform: translateY(-1px);
}

.card.hit {
  background: #14532d;
  border-color: #22c55e;
}

.card.blue {
  background: #1d4ed8;
  border-color: #93c5fd;
}

.card.spoken {
  border: 3px solid #f59e42 !important;
  box-shadow: 0 0 0 2px #f59e421a;
}

.card.card-erro {
  background: #ffeaea !important; /* vermelho claro desbotado para erro */
  border-color: #ff6b6b !important;
  transition: background 0.2s, border-color 0.2s;
}

.card.ignored {
  opacity: 0.45;
  filter: grayscale(0.3);
  border-style: dashed;
  border-color: #b91c1c;
}

/* =========================================================
   BADGE
   ========================================================= */
.badge {
  position: absolute;
  top: 10px;
  right: 12px;
  display: none;
  background: #22c55e;
  color: #022c22;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
}

.card.hit .badge {
  display: inline-block;
}

/* =========================================================
   CONTEÚDO DO CARD
   ========================================================= */
.card-icon {
  width: 80px;
  height: 80px;
  object-fit: contain;
  display: block;
  position: relative;
  z-index: 1;
}

.card-icon-circle {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--icon-bg, #c4c3c3);
  box-shadow: none !important;
  transition: background 0.2s;
  flex-direction: column;
}

.icon-label {
  margin-top: 4px;
  font-size: 13px;
  color: #444;
  font-weight: 600;
  text-align: center;
  line-height: 1.1;
  word-break: break-word;
}

.card-texts {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-word {
  font-size: 26px;
  font-weight: 800;
  color: #f9fafb;
}

.card-pt {
  font-size: 18px;
  font-weight: 600;
  color: #e5e7eb;
}

.card-info {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 700;
  color: #9ca3af;
  line-height: 1.2;
}

.card-info:empty {
  display: none;
}

.card-pt.hidden {
  display: none;
}

.card-word.hidden {
  visibility: hidden;
}

.card-recognized {
  min-height: 18px;
  font-size: 13px;
  color: #bfdbfe;
}

/* =========================================================
   AÇÕES DO CARD
   ========================================================= */
.card-actions {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 10px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.pill {
  width: 41px;
  height: 41px;
  border-radius: 50%;
  background: #111827;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-sizing: border-box;
  margin: 0 2px;
  /* box-shadow removido para permitir alto relevo nos button.pill */
}

/* =========================================================
   CONTADOR
   ========================================================= */
:root {
  --counter-size: 32px;
  --counter-border-color: #000;
  --counter-border-width: 2px;
  --counter-bg-color: rgba(255, 255, 255, 0.35);
  --counter-text-color: #000;
}

.card-counter {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: var(--counter-size);
  height: var(--counter-size);
  display: flex;
  align-items: center;
  justify-content: center;
  border: var(--counter-border-width) solid var(--counter-border-color);
  border-radius: 50%;
  background: var(--counter-bg-color);
  color: var(--counter-text-color);
  font-weight: bold;
  font-size: 15px;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

/* =========================================================
   MICROFONE FLUTUANTE
   ========================================================= */
#micFloating {
  position: absolute;
  top: 37px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 43.2px;
  z-index: 9999;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  background: rgba(255,255,255,0.04);
  border: 3px solid #3b3b3b;
  border-radius: 2em;
  padding: 0.691em 0.605em;
  box-sizing: border-box;
  /* Alto relevo mais alto */
  box-shadow: 0 8px 32px 0 rgba(30,64,175,0.32), 0 4px 16px 0 rgba(0,0,0,0.22), 0 2px 0 #fff8 inset, 0 -4px 16px 0 rgba(255,255,255,0.13) inset;
}

#micIcon {
  opacity: 1;
}

#micX {
  opacity: 1;
  transition: 0.25s ease;
}

#micFloating.mic-on #micX {
  opacity: 0;
}

#micFloating.mic-off #micX {
  opacity: 1;
}

/* =========================================================
   HEARDBAR
   ========================================================= */
.heardbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  min-height: 40px;
  display: grid;
  place-items: center;
  background: #020617;
  border-top: 1px solid #111827;
}

/* =========================================================
   DESATIVA ÍCONES DUPLICADOS
   ========================================================= */
.mic-icon,
.card-mic-icon,
.mic-x {
  display: none !important;
}

/* =========================================================
   RESPONSIVO
   ========================================================= */
@media (max-width: 900px) {
  .stats {
    display: none;
  }

  .menu-button {
    display: block !important;
  }

  .controls {
    display: none;
  }

  .controls-group {
    flex-wrap: wrap;
    gap: 14px;
  }

  .controls-group > * {
    flex: 1 1 48%;
    min-width: 120px;
    max-width: 48%;
    text-align: center;
    margin-bottom: 0;
  }

  .btn {
    width: 100%;
    min-width: 0;
  }

  #controls.controls {
    margin-top: 60px;
    display: none;
  }
  #controls.controls.open {
     display: flex;
     flex-direction: column;
     max-height: 80vh;
     overflow-y: auto;
     overscroll-behavior: contain;
  }
  #micFloating {
    top: 55px;
    font-size: 32px;
    padding: 0.4em 1.2em;
    border-radius: 2em;
  }
  .cards-grid {
    margin-top: 60px;
  }
  .controls-group.group2 {
    flex-direction: column !important;
    align-items: flex-start !important;
  }
  .controls-group.group2 .field {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    text-align: left !important;
    width: 100%;
    gap: 10px !important;
    margin-bottom: 8px;
  }
  .controls-group.group2 .field label {
    margin-bottom: 0 !important;
    min-width: 90px;
    flex-shrink: 0;
  }
  .controls-group.group2 .field select {
    width: 100%;
    min-width: 0;
    text-align: left;
  }
  /* Aumentar largura dos selects de idioma */
  #selLangFrom, #selLangTo {
    min-width: 180px;
    max-width: 100%;
  }
}
@media (min-width: 901px) {
  #micFloating {
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%, 0);
    font-size: 48px;
    z-index: 10001;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 4px;
    height: 100%;
  }
  .topbar-main {
    position: relative;
  }
}

.btn,
.icon-btn,
.circle-btn,
button,
input[type="button"],
input[type="submit"],
[role="button"],
[tabindex]:not([tabindex="-1"]),
[onclick],
a[href],
.card,
[class*="btn"],
[class*="icon"] {
  cursor: pointer !important;
}
