/* ==========================================================================
   BARALHO DO CONCURSEIRO PRF - DESIGN SYSTEM TÁTICO POLICIAL
   ========================================================================== */

:root {
  --bg-main: #07090E;
  --bg-card: #0E1522;
  --bg-card-subtle: #141C2E;
  --bg-card-hover: #1A253C;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-gold: rgba(245, 184, 0, 0.35);
  --border-blue: rgba(59, 130, 246, 0.4);

  /* Identidade Visual PRF */
  --prf-gold: #F5B800;
  --prf-gold-light: #FFD233;
  --prf-gold-glow: rgba(245, 184, 0, 0.28);
  --prf-blue: #2563EB;
  --prf-blue-dark: #1E3A8A;
  --prf-blue-glow: rgba(37, 99, 235, 0.35);

  /* Status */
  --certo-green: #10B981;
  --certo-green-bg: rgba(16, 185, 129, 0.15);
  --errado-red: #EF4444;
  --errado-red-bg: rgba(239, 68, 68, 0.15);

  /* Texto */
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-dim: #64748B;

  /* Fontes */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Plus Jakarta Sans', sans-serif;

  /* Sombras & Efeitos */
  --shadow-tactical: 0 10px 30px -10px rgba(0, 0, 0, 0.7), 0 0 0 1px var(--border-subtle);
  --shadow-gold: 0 0 25px var(--prf-gold-glow);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(37, 99, 235, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(245, 184, 0, 0.08) 0%, transparent 45%),
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   HEADER & ESTATÍSTICAS DO ALUNO (ESTILO GAME / PATENTE)
   ========================================================================== */

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 9, 14, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 18px;
}

.header-container {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.police-crest {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--prf-gold), #B45309);
  display: grid;
  place-items: center;
  box-shadow: 0 0 15px var(--prf-gold-glow);
  color: #000;
  font-weight: 900;
  font-size: 16px;
}

.brand-info h1 {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge-official {
  background: rgba(245, 184, 0, 0.15);
  color: var(--prf-gold);
  border: 1px solid rgba(245, 184, 0, 0.4);
  font-size: 9.5px;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 800;
}

.brand-info p {
  font-size: 11px;
  color: var(--text-dim);
}

.player-stats {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.stat-chip.rank-chip {
  border-color: rgba(245, 184, 0, 0.3);
  color: var(--prf-gold);
}

.stat-chip.streak-chip {
  color: #F97316;
}

.stat-chip.xp-chip {
  color: #38BDF8;
}

/* ==========================================================================
   CONTAINER PRINCIPAL
   ========================================================================== */

.main-content {
  flex: 1;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 16px 80px;
}

/* ==========================================================================
   BARRA DE CONTROLE: BARALHOS & CARREIRAS (TRACK SELECTOR TÁTICO)
   ========================================================================== */

.deck-selector-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.deck-bar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.deck-bar-label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.deck-badge-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(245, 184, 0, 0.12);
  border: 1px solid rgba(245, 184, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.deck-label-texts {
  display: flex;
  flex-direction: column;
}

.deck-title-main {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-main);
}

.deck-title-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.btn-deck-action-mini {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-deck-action-mini:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
}

/* GRID DE TRILHAS (2 COLUNAS NO DESKTOP, RESPONSIVO) */
.deck-track-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.deck-track-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  text-align: left;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  color: inherit;
  position: relative;
  outline: none;
  min-height: 52px;
}

.deck-track-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.track-card-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.track-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.track-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.track-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-sub {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-sub b {
  color: var(--text-muted);
}

.track-status-badge {
  flex-shrink: 0;
}

.status-active-pill {
  font-size: 10.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.3px;
}

.status-inactive-pill {
  font-size: 10.5px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ESTILO ATIVO POLICIAL (DOURADO TÁTICO) */
.deck-track-card.track-policial.active {
  background: linear-gradient(135deg, rgba(245, 184, 0, 0.15) 0%, rgba(245, 184, 0, 0.05) 100%);
  border: 1.5px solid var(--prf-gold);
  box-shadow: 0 0 15px rgba(245, 184, 0, 0.2);
}

.deck-track-card.track-policial.active .track-name {
  color: var(--prf-gold-light);
}

.deck-track-card.track-policial.active .status-active-pill {
  background: rgba(245, 184, 0, 0.2);
  color: var(--prf-gold-light);
  border: 1px solid var(--prf-gold);
}

/* ESTILO ATIVO ADMINISTRATIVO (AZUL TÁTICO) */
.deck-track-card.track-admin.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.15) 0%, rgba(56, 189, 248, 0.05) 100%);
  border: 1.5px solid #38BDF8;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.2);
}

.deck-track-card.track-admin.active .track-name {
  color: #7DD3FC;
}

.deck-track-card.track-admin.active .status-active-pill {
  background: rgba(56, 189, 248, 0.2);
  color: #38BDF8;
  border: 1px solid #38BDF8;
}

.btn-tactical {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card-subtle);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-tactical:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.btn-tactical.primary {
  background: linear-gradient(135deg, var(--prf-gold), #D97706);
  color: #000;
  border: none;
  box-shadow: 0 4px 15px var(--prf-gold-glow);
}

.btn-tactical.primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 6px 20px rgba(245, 184, 0, 0.45);
}

.btn-tactical.btn-blue {
  background: linear-gradient(135deg, var(--prf-blue), #1E40AF);
  color: #fff;
  border: none;
  box-shadow: 0 4px 15px var(--prf-blue-glow);
}

/* ==========================================================================
   NAVEGAÇÃO POR ABAS (MODOS DE JOGO)
   ========================================================================== */

.game-mode-tabs {
  display: flex;
  gap: 6px;
  background: rgba(14, 21, 34, 0.7);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  margin-bottom: 22px;
}

.tab-btn {
  flex: 1;
  padding: 10px 12px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
  background: var(--bg-card-subtle);
  color: var(--prf-gold);
  border: 1px solid var(--border-gold);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   PROGRESS BAR & TOP BAR DO SIMULADO
   ========================================================================== */

.quiz-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.counter-badge {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-muted);
}

.counter-badge b {
  color: var(--prf-gold);
  font-size: 15px;
}

.timer-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-family: monospace;
  font-weight: 700;
  color: var(--text-muted);
}

.timer-box.warning {
  border-color: var(--errado-red);
  color: var(--errado-red);
  animation: pulse-red 1s infinite alternate;
}

@keyframes pulse-red {
  from { box-shadow: 0 0 4px var(--errado-red-bg); }
  to { box-shadow: 0 0 12px rgba(239, 68, 68, 0.4); }
}

.progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 24px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--prf-blue), var(--prf-gold));
  border-radius: 999px;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   MODO 1: QUIZ SIMULADO CEBRASPE (CERTO OU ERRADO)
   ========================================================================== */

.quiz-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-tactical);
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.quiz-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--prf-blue), var(--prf-gold));
}

.card-meta-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.meta-pill {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 3px 10px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

.meta-pill.materia {
  background: rgba(37, 99, 235, 0.15);
  color: #60A5FA;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.meta-pill.banca {
  background: rgba(245, 184, 0, 0.12);
  color: var(--prf-gold);
  border: 1px solid rgba(245, 184, 0, 0.3);
}

.question-text {
  font-size: 17px;
  line-height: 1.65;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 28px;
}

/* Ações Certo ou Errado */
.answer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}

.btn-cebraspe {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 2px solid transparent;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  background: var(--bg-card-subtle);
  color: var(--text-main);
}

.btn-cebraspe.btn-certo {
  border-color: rgba(16, 185, 129, 0.3);
  color: #34D399;
}

.btn-cebraspe.btn-certo:hover:not(:disabled) {
  background: var(--certo-green-bg);
  border-color: var(--certo-green);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.35);
  transform: translateY(-2px);
}

.btn-cebraspe.btn-errado {
  border-color: rgba(239, 68, 68, 0.3);
  color: #F87171;
}

.btn-cebraspe.btn-certo.selected-correct {
  background: #10B981 !important;
  color: #000000 !important;
  border-color: #10B981 !important;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.6) !important;
  font-weight: 900;
}

.btn-cebraspe.btn-errado.selected-correct {
  background: #10B981 !important;
  color: #000000 !important;
  border-color: #10B981 !important;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.6) !important;
  font-weight: 900;
}

.btn-cebraspe.selected-wrong {
  background: #EF4444 !important;
  color: #FFFFFF !important;
  border-color: #EF4444 !important;
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.6) !important;
  font-weight: 900;
}

.key-hint {
  display: inline-block;
  font-size: 10px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  padding: 1.5px 6px;
  font-family: inherit;
  font-weight: 800;
  margin-left: 6px;
  letter-spacing: 0;
  vertical-align: middle;
}

/* Feedback Status Pill no Card */
.feedback-status-pill {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.feedback-status-pill.status-correct {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid #10B981;
  color: #34D399;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.25);
}

.feedback-status-pill.status-wrong {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #EF4444;
  color: #F87171;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.25);
}

.feedback-status-pill.status-timeout {
  background: rgba(245, 184, 0, 0.15);
  border: 1px solid #F5B800;
  color: #FFCC00;
}

.simulado-feedback-zone {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
  animation: slideDown 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.resposta-inner {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.simulado-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 auto 16px auto;
  gap: 10px;
  width: 100%;
  max-width: 480px;
}

.simulado-counter-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-exit-simulado {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
}

.btn-exit-simulado:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #F87171;
}

.meta-pill-box {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   MODO FOCO TOTAL DO SIMULADOR (EXIBE SOMENTE O CARD E O STATUS)
   ========================================================================== */

body.simulado-focus-mode .app-header,
body.simulado-focus-mode .deck-selector-bar,
body.simulado-focus-mode .game-mode-tabs,
body.simulado-focus-mode #simulado-progress-track {
  display: none !important;
}

body.simulado-focus-mode .main-content {
  padding-top: 24px;
  max-width: 700px;
}

body.simulado-focus-mode .prf-card-stage {
  padding: 4px 0 20px;
}

.feedback-box.correct .feedback-title {
  color: #34D399;
}

.feedback-box.wrong .feedback-title {
  color: #F87171;
}

.gabarito-tag {
  font-size: 11px;
  font-weight: 800;
  background: #000;
  padding: 3px 8px;
  border-radius: 4px;
  color: var(--prf-gold);
}

.feedback-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.law-reference {
  font-size: 12px;
  font-weight: 700;
  color: var(--prf-gold);
  display: flex;
  align-items: center;
  gap: 6px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  padding-top: 10px;
}

.next-action-bar {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

/* ==========================================================================
   MODO 2: BARALHO 3D (FLASHCARD COM REPETIÇÃO ESPAÇADA)
   ========================================================================== */

.flashcard-scene {
  perspective: 1200px;
  margin: 10px auto 26px;
  max-width: 580px;
  min-height: 360px;
}

.flashcard-3d {
  width: 100%;
  min-height: 360px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
}

.flashcard-3d.flipped {
  transform: rotateY(180deg);
}

.flashcard-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--border-gold);
}

.flashcard-front {
  background: linear-gradient(145deg, #101826, #0A0F1A);
}

.flashcard-front::after {
  content: "🔄 Clique para ver a resposta";
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 600;
  margin-top: 14px;
}

.flashcard-back {
  background: linear-gradient(145deg, #0F1D33, #091222);
  transform: rotateY(180deg);
  border-color: rgba(59, 130, 246, 0.5);
}

.card-number-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.card-badge-gold {
  background: rgba(245, 184, 0, 0.15);
  color: var(--prf-gold);
  border: 1px solid rgba(245, 184, 0, 0.4);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.card-flip-prompt {
  font-size: 11px;
  color: var(--text-dim);
}

.card-body-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.flashcard-rating-bar {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
}

.btn-rating {
  flex: 1;
  padding: 12px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.btn-rating small {
  font-size: 10px;
  color: var(--text-dim);
}

.btn-rating.hard:hover {
  background: var(--errado-red-bg);
  border-color: var(--errado-red);
  color: #F87171;
}

.btn-rating.medium:hover {
  background: rgba(245, 184, 0, 0.15);
  border-color: var(--prf-gold);
  color: var(--prf-gold);
}

.btn-rating.easy:hover {
  background: var(--certo-green-bg);
  border-color: var(--certo-green);
  color: #34D399;
}

/* ==========================================================================
   MODAL DE EXPANSÃO / IMPORTAÇÃO DE QUESTÕES
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 26px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), var(--shadow-gold);
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 14px;
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--prf-gold);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}

.modal-close-btn:hover {
  color: #fff;
}

.expansion-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 18px;
}

.expansion-box h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-main);
}

.expansion-box p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 14px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  background: #080B12;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s ease;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--prf-gold);
}

.form-textarea {
  min-height: 80px;
  resize: vertical;
}

/* ==========================================================================
   TELA FINAL / RESULTADOS DO SIMULADO
   ========================================================================== */

.results-card {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 34px 24px;
  text-align: center;
  box-shadow: var(--shadow-tactical);
  animation: slideDown 0.4s ease;
}

.results-badge-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 184, 0, 0.2), transparent);
  border: 2px solid var(--prf-gold);
  display: grid;
  place-items: center;
  font-size: 38px;
  margin: 0 auto 16px;
  box-shadow: var(--shadow-gold);
}

.results-card h2 {
  font-size: 24px;
  font-weight: 900;
  color: var(--text-main);
  margin-bottom: 6px;
}

.results-card p.subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 480px;
  margin: 0 auto 26px;
}

.score-box {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  padding: 14px 10px;
  border-radius: var(--radius-md);
}

.score-num {
  font-size: 24px;
  font-weight: 900;
}

.score-num.green { color: var(--certo-green); }
.score-num.red { color: var(--errado-red); }
.score-num.gold { color: var(--prf-gold); }

.score-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-top: 4px;
}

.upsell-banner {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.15), rgba(245, 184, 0, 0.1));
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 16px;
  max-width: 500px;
  margin: 0 auto 24px;
  text-align: left;
}

.upsell-banner h4 {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--prf-gold);
  margin-bottom: 4px;
}

.upsell-banner p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ==========================================================================
   DASHBOARD / QG TÁTICO DO CONCURSEIRO PRF
   ========================================================================== */

.dashboard-view {
  display: block;
  animation: fadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Badge de Notificação de Erros no Menu */
.badge-error-count {
  background: var(--errado-red);
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 900;
  padding: 1px 6px;
  border-radius: 999px;
  margin-left: 4px;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
}

/* 1. Hero do Operador */
.dash-hero-card {
  background: linear-gradient(135deg, #090E1A 0%, #0F172A 50%, #172554 100%);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 0 20px rgba(245, 184, 0, 0.12);
  position: relative;
  overflow: hidden;
}

.dash-hero-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--prf-gold), var(--prf-blue), var(--prf-gold));
}

.dash-hero-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dash-user-badge {
  display: flex;
  align-items: center;
  gap: 14px;
}

.dash-crest {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #FFCC00, #B45309);
  color: #000;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 900;
  font-size: 20px;
  display: grid;
  place-items: center;
  box-shadow: 0 0 18px rgba(245, 184, 0, 0.45);
}

.dash-subtitle {
  font-size: 11px;
  font-weight: 800;
  color: var(--prf-gold);
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.dash-title {
  font-size: 20px;
  font-weight: 900;
  color: #FFFFFF;
  letter-spacing: -0.3px;
}

.dash-rank-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 14px;
  max-width: 480px;
}

.dash-rank-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.dash-rank-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--prf-gold);
}

.dash-rank-badge {
  font-size: 11px;
  font-weight: 800;
  background: rgba(245, 184, 0, 0.15);
  color: var(--prf-gold);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(245, 184, 0, 0.3);
}

.dash-rank-bar {
  width: 100%;
  height: 7px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 5px;
}

.dash-rank-fill {
  height: 100%;
  background: linear-gradient(90deg, #F5B800, #38BDF8);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.dash-rank-xp-info {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
}

.btn-hero-start {
  padding: 16px 24px;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

/* 2. Grid de Métricas Principais */
.dash-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.dash-metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.dash-metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.dash-metric-card.highlight-gold {
  border-color: rgba(245, 184, 0, 0.4);
}
.dash-metric-card.highlight-gold:hover {
  border-color: var(--prf-gold);
}

.dash-metric-card.highlight-blue {
  border-color: rgba(59, 130, 246, 0.4);
}
.dash-metric-card.highlight-blue:hover {
  border-color: #38BDF8;
}

.dash-metric-card.highlight-green {
  border-color: rgba(16, 185, 129, 0.4);
}

.dash-metric-card.highlight-red {
  border-color: rgba(239, 68, 68, 0.4);
}

.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.metric-icon {
  font-size: 22px;
}

.metric-trend {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.metric-trend.up {
  background: rgba(245, 184, 0, 0.15);
  color: var(--prf-gold);
  border: 1px solid rgba(245, 184, 0, 0.3);
}

.metric-trend.alert {
  background: rgba(239, 68, 68, 0.15);
  color: var(--errado-red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.metric-value {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 28px;
  font-weight: 900;
  color: #FFFFFF;
  line-height: 1.1;
  margin-bottom: 4px;
}

.highlight-gold .metric-value { color: var(--prf-gold); }
.highlight-blue .metric-value { color: #38BDF8; }
.highlight-green .metric-value { color: var(--certo-green); }
.highlight-red .metric-value { color: var(--errado-red); }

.metric-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 3px;
}

.metric-desc {
  font-size: 11px;
  color: var(--text-dim);
}

/* 3. Duas Colunas da Dashboard */
.dash-two-cols {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
  margin-bottom: 30px;
}

.dash-col-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px 22px;
}

.dash-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.dash-col-header h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
}

.badge-tag {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.15);
  color: #60A5FA;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-tag.gold {
  background: rgba(245, 184, 0, 0.15);
  color: var(--prf-gold);
  border-color: rgba(245, 184, 0, 0.3);
}

.dash-col-sub {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 16px;
}

/* Lista Radar de Matérias */
.materia-radar-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.radar-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.radar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
}

.radar-materia-name {
  font-weight: 700;
  color: var(--text-main);
}

.radar-stats-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
}

.radar-fraction {
  color: var(--text-dim);
}

.radar-pct {
  font-weight: 800;
  color: var(--prf-gold);
}

.radar-bar {
  width: 100%;
  height: 7px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.radar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.radar-fill.green { background: linear-gradient(90deg, #10B981, #34D399); }
.radar-fill.yellow { background: linear-gradient(90deg, #F5B800, #FBBF24); }
.radar-fill.red { background: linear-gradient(90deg, #EF4444, #F87171); }

/* Lista de Missões Diárias */
.missions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.mission-item {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color 0.2s ease;
}

.mission-item.completed {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.05);
}

.mission-icon {
  font-size: 20px;
}

.mission-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.mission-name {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-main);
}

.mission-desc {
  font-size: 11px;
  color: var(--text-dim);
}

.mission-bar {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 2px;
}

.mission-fill {
  height: 100%;
  background: var(--prf-gold);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.mission-status {
  font-size: 10px;
  color: var(--prf-gold);
  font-weight: 700;
  margin-top: 2px;
}

.mission-reward {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 5px;
  background: rgba(245, 184, 0, 0.12);
  color: var(--prf-gold);
  border: 1px solid rgba(245, 184, 0, 0.25);
  white-space: nowrap;
}

.mission-item.completed .mission-reward {
  background: rgba(16, 185, 129, 0.15);
  color: var(--certo-green);
  border-color: rgba(16, 185, 129, 0.3);
}

/* Atalhos Rápidos da Dashboard */
.dash-shortcuts-box {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  padding-top: 16px;
}

.dash-shortcut-btn {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  color: var(--text-main);
}

.dash-shortcut-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--prf-gold);
  transform: translateY(-1px);
}

.sc-icon {
  font-size: 18px;
}

.sc-text b {
  display: block;
  font-size: 11.5px;
  color: #FFFFFF;
}

.sc-text small {
  font-size: 10px;
  color: var(--text-dim);
}

/* ==========================================================================
   RESPONSIVIDADE (MOBILE-FIRST POLISH)
   ========================================================================== */

@media (max-width: 640px) {
  .app-header {
    padding: 10px 14px;
  }

  .header-container {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  
  .player-stats {
    justify-content: space-between;
    gap: 6px;
  }

  .stat-chip {
    flex: 1;
    justify-content: center;
    padding: 5px 8px;
    font-size: 11px;
    white-space: nowrap;
  }

  .main-content {
    padding: 12px 10px 70px;
  }

  .deck-selector-bar {
    padding: 10px 12px;
    gap: 10px;
    margin-bottom: 14px;
  }

  .deck-bar-top {
    flex-wrap: nowrap;
  }

  .deck-badge-icon {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  .deck-title-main {
    font-size: 11.5px;
  }

  .deck-title-sub {
    font-size: 10px;
  }

  .btn-deck-action-mini {
    padding: 5px 9px;
    font-size: 11px;
  }

  .deck-track-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .deck-track-card {
    padding: 9px 12px;
    min-height: 48px;
  }

  .track-icon {
    font-size: 18px;
  }

  .track-name {
    font-size: 12.5px;
  }

  .track-sub {
    font-size: 10.5px;
  }

  .status-active-pill {
    font-size: 10px;
    padding: 3px 8px;
  }

  .status-inactive-pill {
    font-size: 10px;
    padding: 3px 7px;
  }

  /* Abas de navegação no celular */
  .game-mode-tabs {
    gap: 4px;
    padding: 3px;
    margin-bottom: 16px;
  }

  .tab-btn {
    padding: 9px 6px;
    font-size: 11px;
    gap: 4px;
    touch-action: manipulation;
    user-select: none;
  }

  /* Top bar do simulado */
  .simulado-top-bar {
    margin-bottom: 10px;
    gap: 6px;
  }

  .counter-badge {
    font-size: 12px;
  }

  .timer-box {
    padding: 4px 8px;
    font-size: 12px;
  }

  .meta-pill {
    font-size: 10px;
    padding: 2.5px 7px;
  }

  /* Palco e Card Físico PRF no Smartphone */
  .prf-card-stage {
    padding: 0 0 16px;
  }

  .prf-pdf-card {
    max-width: 100%;
    border-radius: 16px;
    border-width: 1.5px;
  }

  .prf-pdf-card .card-header-bar {
    padding: 7px 12px;
    min-height: 44px;
  }

  .prf-pdf-card .header-brand {
    font-size: 26px;
  }

  .prf-pdf-card .header-org-title span {
    font-size: 8.5px;
    letter-spacing: 0.5px;
  }

  .prf-pdf-card .header-card-badge {
    padding: 3px 10px 3px 14px;
    min-width: 52px;
  }

  .prf-pdf-card .header-card-badge .badge-label {
    font-size: 7.5px;
  }

  .prf-pdf-card .header-card-badge .badge-num {
    font-size: 17px;
  }

  /* Banner tático proporcional para caber na tela do celular sem rolar muito */
  .prf-pdf-card .card-media {
    height: 150px;
  }

  .prf-pdf-card .card-content {
    padding: 10px 12px 14px;
    gap: 7px;
  }

  .prf-pdf-card .block-tag {
    font-size: 10px;
    padding: 2px 7px;
  }

  .prf-pdf-card .block-box {
    padding: 7px 9px;
    font-size: 12.5px;
    line-height: 1.4;
  }

  .prf-pdf-card .block-box.pergunta-box {
    font-size: 13.5px;
    line-height: 1.45;
  }

  .prf-pdf-card .text-res {
    font-size: 13px;
  }

  /* Botões táticos CERTO e ERRADO no celular */
  .answer-actions {
    gap: 8px;
    margin: 10px 0 6px;
  }

  .btn-cebraspe {
    padding: 14px 10px;
    font-size: 14.5px;
    border-radius: 10px;
    gap: 6px;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
  }

  /* Oculta os atalhos de teclado no mobile pois a tela é touch */
  .key-hint {
    display: none !important;
  }

  /* Rodapé do Card */
  .prf-pdf-card .card-footer-bar {
    padding: 6px 12px 8px;
  }

  .prf-pdf-card .footer-motto {
    font-size: 8.5px;
    letter-spacing: 0.5px;
  }

  .prf-pdf-card .footer-slashes {
    font-size: 16px;
  }

  /* Galeria Completa em Coluna Única */
  .cards-grid-container {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .score-grid {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
  }

  .score-box {
    padding: 10px 6px;
  }

  .score-num {
    font-size: 20px;
  }

  /* Dashboard no celular */
  .dash-hero-card {
    flex-direction: column;
    align-items: stretch;
    padding: 18px 16px;
    gap: 16px;
  }

  .btn-hero-start {
    width: 100%;
    justify-content: center;
    padding: 14px 18px;
    font-size: 14px;
  }

  .dash-metrics-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 18px;
  }

  .dash-metric-card {
    padding: 14px 12px;
  }

  .metric-value {
    font-size: 22px;
  }

  .dash-two-cols {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .dash-col-card {
    padding: 16px 14px;
  }

  .dash-shortcuts-box {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

@media (max-width: 380px) {
  .player-stats {
    gap: 4px;
  }

  .stat-chip {
    padding: 4px 6px;
    font-size: 10px;
  }

  .tab-btn {
    font-size: 10px;
    padding: 7px 4px;
  }

  .prf-pdf-card .header-brand {
    font-size: 22px;
  }

  .prf-pdf-card .header-org-title span {
    font-size: 7.5px;
  }

  .btn-cebraspe {
    padding: 12px 6px;
    font-size: 13.5px;
  }
}

/* ==========================================================================
   MODELO VISUAL FIEL AO PDF DO BARALHO PRF (CARTAS FÍSICAS)
   ========================================================================== */

.card-fiel-view {
  display: block;
  width: 100%;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Barra de Controles Táticos Acima da Carta */
.card-tactical-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 440px;
  margin: 0 auto 12px;
  gap: 10px;
  flex-wrap: wrap;
}

.controls-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-pagination-badge {
  background: var(--bg-card);
  border: 1px solid rgba(255, 204, 0, 0.3);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.card-pagination-badge b {
  color: #FFCC00;
  font-size: 14px;
}

.btn-control {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-main);
  padding: 6px 12px;
  font-size: 11.5px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: #FFCC00;
  color: #FFCC00;
}

/* Palco Central */
.prf-card-stage {
  display: flex;
  justify-content: center;
  padding: 4px 0 24px;
}

/* Estrutura Exata do Card Físico */
.prf-pdf-card {
  width: 100%;
  max-width: 440px;
  background: #090E1A;
  border-radius: 20px;
  border: 2px solid #1C2D47;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.88), 0 0 0 1px rgba(255, 255, 255, 0.05);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  color: #FFFFFF;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.prf-pdf-card:hover {
  box-shadow: 0 30px 65px rgba(0, 0, 0, 0.95), 0 0 25px rgba(255, 204, 0, 0.15);
}

/* 1. Topo / Cabeçalho */
.prf-pdf-card .card-header-bar {
  background: #070B14;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px 9px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  min-height: 48px;
}

.prf-pdf-card .header-brand {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 32px;
  font-weight: 900;
  color: #FFCC00;
  letter-spacing: -1.5px;
  line-height: 1;
  text-shadow: 0 0 14px rgba(255, 204, 0, 0.35);
}

.prf-pdf-card .header-org-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1px;
}

.prf-pdf-card .header-org-title span {
  font-family: 'Inter', sans-serif;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #FFFFFF;
  text-transform: uppercase;
  line-height: 1.1;
}

/* Badge amarela chanfrada da CARTA XX */
.prf-pdf-card .header-card-badge {
  background: #FFCC00;
  color: #000000;
  padding: 4px 14px 4px 18px;
  border-radius: 4px;
  clip-path: polygon(14px 0%, 100% 0%, 100% 100%, 0% 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 60px;
}

.prf-pdf-card .header-card-badge .badge-label {
  font-size: 8.5px;
  font-weight: 900;
  letter-spacing: 0.5px;
  line-height: 1;
}

.prf-pdf-card .header-card-badge .badge-num {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  margin-top: 1px;
}

/* 2. Foto Temática */
.prf-pdf-card .card-media {
  width: 100%;
  height: 185px;
  position: relative;
  overflow: hidden;
  background: #0D1626;
}

.prf-pdf-card .card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.prf-pdf-card:hover .card-media img {
  transform: scale(1.02);
}

.prf-pdf-card .card-media-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50px;
  background: linear-gradient(to bottom, transparent, #090E1A);
  pointer-events: none;
}

/* 3. Corpo e os 4 Blocos Oficiais */
.prf-pdf-card .card-content {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.prf-pdf-card .content-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Tag Amarela Oficial do Bloco */
.prf-pdf-card .block-tag {
  align-self: flex-start;
  background: #FFCC00;
  color: #000000;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11px;
  font-weight: 900;
  padding: 2.5px 8px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  letter-spacing: 0.4px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.prf-pdf-card .block-tag svg {
  width: 13px;
  height: 13px;
}

/* Caixas de Texto */
.prf-pdf-card .block-box {
  background: #0D1524;
  border: 1px solid #1C2D47;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.45;
  color: #F1F5F9;
}

.prf-pdf-card .block-box.pergunta-box {
  font-weight: 600;
  color: #FFFFFF;
  font-size: 13.5px;
}

.prf-pdf-card .block-box.resposta-box {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border-color: rgba(16, 185, 129, 0.35);
}

.prf-pdf-card .check-circle {
  width: 18px;
  height: 18px;
  min-width: 18px;
  border-radius: 50%;
  background: #10B981;
  color: #000;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 900;
  margin-top: 2px;
}

.prf-pdf-card .text-res {
  font-weight: 700;
  color: #FFFFFF;
  font-size: 13.5px;
}

.prf-pdf-card .block-box.porque-box {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: #CBD5E1;
}

.prf-pdf-card .book-icon {
  font-size: 15px;
  line-height: 1.2;
}

.prf-pdf-card .block-box.macete-box {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(255, 204, 0, 0.05);
  border: 1px solid rgba(255, 204, 0, 0.35);
  color: #FEF08A;
  font-weight: 600;
  font-size: 12px;
}

.prf-pdf-card .bulb-icon {
  font-size: 15px;
  line-height: 1.2;
}

/* Modo Estudo Ocultar/Revelar */
.study-mode-active #fiel-reveal-zone {
  display: none;
}

.study-mode-active #btn-reveal-answer {
  display: flex !important;
}

.btn-reveal-tactical {
  width: 100%;
  padding: 14px;
  margin-top: 6px;
  background: linear-gradient(135deg, rgba(255, 204, 0, 0.15), rgba(37, 99, 235, 0.15));
  border: 1px dashed #FFCC00;
  border-radius: 8px;
  color: #FFCC00;
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-reveal-tactical:hover {
  background: linear-gradient(135deg, rgba(255, 204, 0, 0.25), rgba(37, 99, 235, 0.25));
  transform: translateY(-1px);
}

/* 4. Rodapé da Carta */
.prf-pdf-card .card-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px 10px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: #070B14;
}

.prf-pdf-card .footer-motto {
  font-family: 'Inter', sans-serif;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #8F9EB2;
  text-transform: uppercase;
}

.prf-pdf-card .footer-slashes {
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: #FFCC00;
  font-weight: 900;
  font-size: 18px;
  letter-spacing: -2px;
  font-style: italic;
}

/* ==========================================================================
   GALERIA DE CARTAS (GRADE IDÊNTICA À PÁGINA DO PDF)
   ========================================================================== */

.grid-view {
  width: 100%;
  margin-bottom: 30px;
}

.grid-header-info {
  text-align: center;
  margin-bottom: 20px;
}

.grid-header-info h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
}

.grid-header-info p {
  font-size: 12.5px;
  color: var(--text-dim);
  margin-top: 4px;
}

.cards-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  width: 100%;
}

@media (min-width: 1280px) {
  .cards-grid-container {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ==========================================================================
   TELA DE AUTENTICAÇÃO / LOGIN & CADASTRO (SUPABASE AUTH)
   ========================================================================== */

body.auth-locked {
  overflow: hidden !important;
}

body.auth-locked .main-content,
body.auth-locked .app-header {
  filter: blur(8px) brightness(0.4);
  pointer-events: none;
  user-select: none;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(5, 7, 12, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: authFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authFadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: linear-gradient(180deg, #101726 0%, #0B101D 100%);
  border: 1px solid rgba(245, 184, 0, 0.35);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.9), 0 0 35px rgba(245, 184, 0, 0.15);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #2563EB 0%, #F5B800 50%, #2563EB 100%);
}

.auth-brand {
  text-align: center;
  margin-bottom: 24px;
}

.auth-crest {
  margin: 0 auto 12px;
  width: 48px;
  height: 48px;
  font-size: 16px;
  box-shadow: 0 0 20px rgba(245, 184, 0, 0.4);
}

.auth-brand h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.5px;
}

.auth-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.auth-alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 18px;
  animation: authAlertSlide 0.25s ease-out;
}

@keyframes authAlertSlide {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-alert.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #FCA5A5;
}

.auth-alert.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6EE7B7;
}

.auth-form .form-group {
  margin-bottom: 16px;
}

.auth-form label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #CBD5E1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.auth-form .form-input {
  width: 100%;
  background: rgba(5, 7, 12, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14px;
  color: #fff;
  outline: none;
  transition: all 0.2s ease;
}

.auth-form .form-input:focus {
  border-color: var(--prf-gold);
  box-shadow: 0 0 0 3px rgba(245, 184, 0, 0.18);
  background: rgba(5, 7, 12, 0.95);
}

.btn-auth-submit {
  width: 100%;
  padding: 14px;
  font-size: 14px;
  font-weight: 800;
  justify-content: center;
  margin-top: 8px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.auth-link-forgot {
  font-size: 11.5px;
  color: var(--prf-gold);
  text-decoration: none;
  transition: color 0.15s;
}

.auth-link-forgot:hover {
  text-decoration: underline;
  color: var(--prf-gold-light);
}

.auth-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-dim);
}

.auth-link-switch {
  color: var(--prf-gold);
  font-weight: 700;
  text-decoration: none;
  transition: color 0.15s;
}

.auth-link-switch:hover {
  color: #fff;
  text-decoration: underline;
}

.auth-info-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}

.auth-footer-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  color: var(--text-dim);
}

.btn-link-config {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 11px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s;
}

.btn-link-config:hover {
  color: var(--prf-gold);
  background: rgba(245, 184, 0, 0.1);
}

/* User chip e logout no header */
.user-chip {
  background: rgba(37, 99, 235, 0.15);
  border: 1px solid rgba(37, 99, 235, 0.35);
  color: #93C5FD;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.btn-logout-mini {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #FCA5A5;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-logout-mini:hover {
  background: #EF4444;
  color: #fff;
}

/* ==========================================================================
   CADERNO DE ERROS - BANNER & BLOCO DE RELEMBRANÇA / ESTUDO
   ========================================================================== */

.error-mode-guide {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(14, 21, 34, 0.9) 100%);
  border: 1.5px solid rgba(239, 68, 68, 0.4);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.15);
  animation: fadeIn 0.3s ease;
}

.guide-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.guide-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.guide-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #F87171;
}

.guide-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.guide-desc b {
  color: #34D399;
}

/* CAIXA DE ESTUDO & RELEMBRANÇA NO PRÓPRIO CARD */
.error-study-cue-box {
  background: linear-gradient(135deg, rgba(245, 184, 0, 0.08) 0%, rgba(14, 21, 34, 0.9) 100%);
  border: 1.5px solid rgba(245, 184, 0, 0.35);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 18px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  animation: fadeIn 0.35s ease;
}

.cue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.cue-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.cue-badge {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--prf-gold);
}

.cue-assunto {
  font-size: 13.5px;
  font-weight: 700;
  color: #F8FAFC;
  line-height: 1.3;
}

.btn-toggle-cue {
  background: rgba(245, 184, 0, 0.15);
  border: 1px solid rgba(245, 184, 0, 0.4);
  color: var(--prf-gold-light);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-family: inherit;
  flex-shrink: 0;
}

.btn-toggle-cue:hover {
  background: rgba(245, 184, 0, 0.25);
  border-color: var(--prf-gold);
  transform: translateY(-1px);
}

.cue-body {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(245, 184, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: fadeIn 0.25s ease;
}

.cue-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
}

.cue-row.cue-highlight {
  background: rgba(245, 184, 0, 0.08);
  border-left: 3px solid var(--prf-gold);
  padding: 6px 10px;
  border-radius: 0 6px 6px 0;
}

.cue-label {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--prf-gold);
}

.cue-val {
  color: #E2E8F0;
  line-height: 1.45;
  font-size: 12px;
}

@media (max-width: 640px) {
  .error-mode-guide {
    padding: 10px 12px;
    gap: 10px;
    margin-bottom: 12px;
  }
  .guide-icon {
    font-size: 20px;
  }
  .guide-title {
    font-size: 12px;
  }
  .guide-desc {
    font-size: 11px;
  }
  .cue-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .btn-toggle-cue {
    align-self: flex-start;
    padding: 5px 10px;
    font-size: 10.5px;
  }
  .cue-assunto {
    font-size: 12.5px;
  }
}

