@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --bg-deep: #060812;
  --bg-gradient: radial-gradient(circle at 50% 10%, #efbf04 0%, #ff6600 80%);
  --panel-bg: rgba(22, 28, 52, 0.65);
  --panel-border: rgba(255, 255, 255, 0.12);
  --accent-yellow: #fbbf24;
  --accent-yellow-dark: #d97706;
  --accent-blue: #3b82f6;
  --accent-blue-dark: #1d4ed8;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --gold-glow: 0 0 25px rgba(251, 191, 36, 0.4);
  --blue-glow: 0 0 25px rgba(59, 130, 246, 0.4);

  /* Duotone Variables */
  --dark-amaranth: #8b1e3fff;
  --midnight-violet: #3c153bff;
  --muted-teal: #89bd9eff;
  --apricot-cream: #f0c987ff;
  --cinnabar: #db4c40ff;
  
  --duotone-bg-pure: #FB4D3D;
  --duotone-text-pure: #EAC435;

  --color-artigo: var(--apricot-cream);
  --color-substantivo: var(--cinnabar);
  --color-preposicao: var(--muted-teal);
  --color-adjetivo: var(--dark-amaranth);
  --color-adjetivo-bright: #ff5e97;
  
  --gradient-radial: radial-gradient(#8b1e3fff, #3c153bff, #89bd9eff, #f0c987ff, #db4c40ff);
}

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

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg-deep);
  background-image: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ====================================================
   GERAL E CABEÇALHO TEATRAL
   ==================================================== */
header.app-header {
  padding: 1.2rem 1rem;
  text-align: center;
  position: relative;
  z-index: 10;
  border-bottom: 1px solid var(--panel-border);
  background: rgba(10, 13, 26, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.theater-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent-yellow);
  background: rgba(251, 191, 36, 0.15);
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(251, 191, 36, 0.3);
  margin-bottom: 6px;
}

header.app-header h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff 0%, #fbbf24 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

main.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

/* ====================================================
   CONTAINERS & TELAS (SCREENS)
   ==================================================== */
.screen {
  display: none;
  width: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.4s ease forwards;
}

.screen.active {
  display: flex;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.glass-panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  padding: 2rem 1.5rem;
  width: 100%;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  text-align: center;
}

/* ====================================================
   TELA 1: LOGIN (ENTRADA)
   ==================================================== */
#screen-login .glass-panel {
  background: #FFFFFF;
}

#screen-login .glass-panel h2 {
  color: #0f172a;
}

#screen-login .glass-panel p {
  color: #334155;
}

#screen-login .input-group input {
  background: #F8F9FA;
  border: 2px solid #E5E7EB;
  color: #111827;
}

#screen-login .input-group input::placeholder {
  color: #9CA3AF;
}

#screen-login .input-group input:focus {
  border-color: #3B82F6;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

.login-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.2rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.2) 0%, transparent 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(251, 191, 36, 0.4);
  font-size: 2.2rem;
  box-shadow: var(--gold-glow);
}

.glass-panel h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.glass-panel p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.8rem;
  line-height: 1.5;
}

.input-group {
  margin-bottom: 1.5rem;
  width: 100%;
}

.input-group input {
  width: 100%;
  padding: 1rem 1.2rem;
  border-radius: 16px;
  background: rgba(11, 15, 28, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.15);
  color: var(--text-main);
  font-size: 1.1rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
  text-align: center;
  outline: none;
  transition: all 0.3s ease;
}

.input-group input:focus {
  border-color: var(--accent-yellow);
  box-shadow: 0 0 15px rgba(251, 191, 36, 0.25);
}

.input-group input::placeholder {
  color: #475569;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-yellow) 0%, var(--accent-yellow-dark) 100%);
  color: #0f172a;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  padding: 1rem 2rem;
  border-radius: 16px;
  border: none;
  width: 100%;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(245, 158, 11, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  touch-action: manipulation;
}

.btn-primary:active {
  transform: scale(0.97);
  box-shadow: 0 5px 15px rgba(245, 158, 11, 0.3);
}

/* ====================================================
   TELA 2: LOBBY
   ==================================================== */
#screen-lobby .glass-panel,
#screen-game-lobby .glass-panel,
#screen-result .glass-panel {
  background: #FFFFFF !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35) !important;
  color: #1e293b !important;
}

#screen-lobby .glass-panel h2,
#screen-game-lobby .glass-panel h2,
#screen-result .glass-panel h3 {
  color: #0f172a !important;
}

#screen-lobby .glass-panel p,
#screen-lobby #lobby-welcome-text,
#screen-game-lobby .glass-panel p,
#screen-result .glass-panel p,
#screen-result .glass-panel span {
  color: #334155 !important;
}

#screen-lobby #lobby-welcome-text strong {
  color: #d97706 !important;
}

#screen-lobby .player-tag {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
}

#screen-lobby .player-tag.seat-badge {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  border: 1px solid #bfdbfe !important;
}

.lobby-status-pulse {
  width: 100px;
  height: 100px;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.15);
  border: 2px solid var(--accent-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  position: relative;
  box-shadow: var(--blue-glow);
  animation: pulseRotate 4s infinite linear;
}

@keyframes pulseRotate {
  0% {
    transform: scale(1);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
  }

  50% {
    transform: scale(1.06);
    box-shadow: 0 0 40px rgba(59, 130, 246, 0.7);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
  }
}

.player-tag {
  background: rgba(255, 255, 255, 0.08);
  padding: 6px 16px;
  border-radius: 999px;
  font-weight: 700;
  color: var(--accent-yellow);
  display: inline-block;
  margin-top: 10px;
}

.player-tag.seat-badge {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.4);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.25);
}

.how-to-play-card {
  margin-top: 1.8rem;
  padding: 1.5rem 1.2rem;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.12) 0%, rgba(15, 23, 42, 0.85) 100%);
  border: 2px solid var(--accent-yellow);
  border-radius: 20px;
  box-shadow: var(--gold-glow);
  width: 100%;
  text-align: center;
}

.how-to-play-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 1.2rem;
  border-bottom: 1px solid rgba(251, 191, 36, 0.3);
  padding-bottom: 0.8rem;
}

.how-to-play-header h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--accent-yellow);
  letter-spacing: 1px;
}

.how-to-play-steps {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
}

.step-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(0, 0, 0, 0.35);
  padding: 0.8rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.step-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  line-height: 1.2;
}

.step-item p {
  color: #e2e8f0;
  font-size: 0.95rem;
  line-height: 1.4;
  margin: 0;
}

/* ====================================================
   TELA 3: JOGO EM ANDAMENTO (ARENA)
   ==================================================== */
.game-stats-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #FFFFFF;
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 0.8rem 1.2rem;
  border-radius: 16px;
  margin-bottom: 1rem;
  backdrop-filter: none;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #334155;
}

.stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
}

.timer-pill {
  background: rgba(239, 68, 68, 0.15);
  border: 1.5px solid #ef4444;
  padding: 6px 14px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.timer-pill.warning {
  animation: timerWarningPulse 0.5s infinite alternate;
}

@keyframes timerWarningPulse {
  from {
    background: rgba(239, 68, 68, 0.2);
    transform: scale(1);
  }

  to {
    background: rgba(239, 68, 68, 0.5);
    transform: scale(1.08);
  }
}

.timer-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 900;
  color: #ef4444;
}

/* ====================================================
   A MATRIZ DO JOGO (GRID & 3D FLIP CARDS)
   ==================================================== */
.grid-container {
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 440px;
  margin: 0 auto;
  display: grid;
  gap: 10px;
  padding: 12px;
  background: rgba(11, 15, 28, 0.6);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.6);
}

.tile {
  perspective: 800px;
  cursor: pointer;
  touch-action: manipulation;
}

.tile-inner {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  transform-style: preserve-3d;
  transition: transform 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tile.flipped .tile-inner {
  transform: rotateY(180deg);
}

.tile-front,
.tile-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Frente = Quadrado AZUL ou AMARELO antes do clique */
.tile-front.yellow {
  background: linear-gradient(135deg, #fcd34d 0%, #f59e0b 60%, #d97706 100%);
  border: 2px solid rgba(255, 255, 255, 0.45);
  box-shadow: inset 0 2px 5px rgba(255, 255, 255, 0.6), 0 4px 12px rgba(245, 158, 11, 0.3);
}

.tile-front.yellow::after {
  content: '★';
  font-size: clamp(1rem, 4vw, 1.8rem);
  color: rgba(255, 255, 255, 0.3);
}

.tile-front.blue {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 60%, #1d4ed8 100%);
  border: 2px solid rgba(255, 255, 255, 0.25);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.3), 0 4px 10px rgba(37, 99, 235, 0.2);
  opacity: 0.85;
}

/* Verso = Revela a face azul ou a foto do galo Afonso! */
.tile-back {
  transform: rotateY(180deg);
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
  border: 2px solid rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.6), 0 4px 15px rgba(59, 130, 246, 0.5);
}

.tile-back.is-afonso {
  background: radial-gradient(circle, #fbbf24 0%, #f59e0b 50%, #b45309 100%);
  border: 3px solid #ffffff;
  box-shadow: 0 0 30px rgba(251, 191, 36, 0.8);
  animation: afonsoCelebration 0.6s ease;
}

@keyframes afonsoCelebration {
  0% {
    transform: rotateY(180deg) scale(0.8);
  }

  50% {
    transform: rotateY(180deg) scale(1.15);
  }

  100% {
    transform: rotateY(180deg) scale(1);
  }
}

.tile-back.is-afonso img {
  width: 85%;
  height: 85%;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

/* ====================================================
   TELA 4: RESULTADO DO JOGO (GAME OVER)
   ==================================================== */
.result-trophy {
  width: 120px;
  height: 120px;
  margin: 0 auto 1.5rem;
  position: relative;
}

.result-trophy img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));
  animation: floatWinner 3s infinite ease-in-out;
}

@keyframes floatWinner {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-10px) rotate(3deg);
  }
}

.winner-banner {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.2) 0%, rgba(217, 119, 6, 0.3) 100%);
  border: 2px solid var(--accent-yellow);
  border-radius: 20px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--gold-glow);
}

.winner-banner h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--accent-yellow);
  margin-bottom: 0.5rem;
}

.other-banner {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.other-banner h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.final-score-badge {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-blue);
  margin-top: 10px;
}

/* ====================================================
   ESTILOS ESPECÍFICOS DO PAINEL ADMIN (/admin)
   ==================================================== */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  padding: 1.2rem 1.8rem;
  border-radius: 20px;
  margin-bottom: 1.5rem;
  width: 100%;
}

.admin-controls {
  display: flex;
  gap: 15px;
}

.btn-admin-start {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  padding: 1rem 2.5rem;
  border-radius: 16px;
  border: none;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.4);
  transition: all 0.2s ease;
}

.btn-admin-start:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(16, 185, 129, 0.6);
}

.btn-admin-reset {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1.5px solid #ef4444;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  padding: 1rem 1.8rem;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-admin-reset:hover {
  background: #ef4444;
  color: white;
}

.leaderboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  width: 100%;
}

.player-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.player-card.is-top {
  border-color: var(--accent-yellow);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, rgba(15, 23, 42, 0.8) 100%);
}

.player-info h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.player-info span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.player-score-box {
  background: rgba(255, 255, 255, 0.08);
  padding: 8px 14px;
  border-radius: 12px;
  text-align: center;
}

.player-score-box .points {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent-yellow);
}

/* ====================================================
   ESTILOS DA PÁGINA DO VENCEDOR (/vencedor)
   ==================================================== */
.winner-showcase-panel {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.12) 0%, rgba(15, 23, 42, 0.85) 100%);
  border: 2px solid rgba(251, 191, 36, 0.4);
  border-radius: 28px;
  padding: 3rem 2rem;
  margin-bottom: 2.5rem;
  width: 100%;
  text-align: center;
  box-shadow: 0 0 50px rgba(251, 191, 36, 0.25), 0 25px 60px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.winner-showcase-panel.is-celebrating {
  border-color: #fbbf24;
  box-shadow: 0 0 80px rgba(251, 191, 36, 0.5), 0 30px 80px rgba(0, 0, 0, 0.8);
  animation: winnerPulse 2s infinite alternate;
}

@keyframes winnerPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 60px rgba(251, 191, 36, 0.4);
  }

  100% {
    transform: scale(1.015);
    box-shadow: 0 0 100px rgba(251, 191, 36, 0.65);
  }
}

.winner-trophy-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.winner-trophy-icon {
  display: inline-block;
  font-size: 4rem;
  filter: drop-shadow(0 0 20px rgba(251, 191, 36, 0.6));
  animation: bounceTrophy 1.8s infinite ease-in-out;
}

@keyframes bounceTrophy {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-10px) rotate(5deg);
  }
}

.winner-banner-subtitle {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #fbbf24;
  margin-bottom: 0.8rem;
}

.winner-giant-name {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  font-weight: 900;
  line-height: 1.1;
  background: linear-gradient(135deg, #ffffff 0%, #fbbf24 60%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1.2rem;
  word-break: break-word;
  filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.5));
}

.winner-stats-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(251, 191, 36, 0.2);
  border: 1px solid rgba(251, 191, 36, 0.5);
  color: #fef08a;
  padding: 10px 24px;
  border-radius: 999px;
  font-size: 1.3rem;
  font-weight: 800;
  box-shadow: 0 5px 20px rgba(251, 191, 36, 0.2);
}

.winner-stats-badge span.highlight {
  color: #ffffff;
  font-size: 1.5rem;
}

/* ====================================================
   MÓDULO 1: SLIDESHOW TEATRAL (YELLOWBAG)
   ==================================================== */
#screen-slideshow,
#screen-terrivel {
  position: relative;
  width: 100vw;
  height: 100vh;
  margin: -1rem;
  overflow: hidden;
  background: #000000;
  display: none;
}

#screen-slideshow.active,
#screen-terrivel.active {
  display: block;
}

.slideshow-container {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
  overflow: hidden;
}

.slide-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
  z-index: 1;
}

.slide-image.active {
  opacity: 1;
  z-index: 2;
}

.slideshow-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: rgba(255, 255, 255, 0.8);
  font-family: 'Outfit', sans-serif;
  font-size: 1.3rem;
  font-weight: 600;
  z-index: 0;
  text-align: center;
  background: rgba(0, 0, 0, 0.6);
  padding: 1rem 2rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

/* ====================================================
   SELETOR DE MÓDULOS (ABAS NO PAINEL ADMIN)
   ==================================================== */
.module-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 1.8rem;
  background: var(--panel-bg);
  padding: 10px;
  border-radius: 20px;
  border: 1px solid var(--panel-border);
  flex-wrap: wrap;
}

.module-tab-btn {
  flex: 1;
  min-width: 200px;
  background: rgba(15, 23, 42, 0.6);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  padding: 1rem 1.2rem;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.module-tab-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

.module-tab-btn.active {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.25) 0%, rgba(217, 119, 6, 0.35) 100%);
  color: var(--accent-yellow);
  border-color: var(--accent-yellow);
  box-shadow: var(--gold-glow);
  transform: translateY(-2px);
}

/* ====================================================
   GRID DE IMAGENS DO SLIDESHOW (ADMIN)
   ==================================================== */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.2rem;
  margin-top: 1.5rem;
}

.image-card {
  background: rgba(15, 23, 42, 0.8);
  border-radius: 16px;
  border: 2.5px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.image-card:hover {
  transform: translateY(-5px) scale(1.03);
  border-color: rgba(96, 165, 250, 0.6);
  box-shadow: 0 12px 25px rgba(59, 130, 246, 0.3);
}

.image-card.active {
  border-color: var(--accent-yellow);
  box-shadow: 0 0 25px rgba(251, 191, 36, 0.6);
  transform: scale(1.04);
}

.image-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}

.image-card .name {
  padding: 10px 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: rgba(0, 0, 0, 0.4);
}

/* ====================================================
   MÓDULO: EM ESPERA E MODO ESCURO
   ==================================================== */
#screen-espera {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 9999 !important;
  max-width: none !important;
  margin: 0 !important;
  border-radius: 0 !important;
  background-image: linear-gradient(135deg, rgba(59, 130, 246, 0.4), rgba(16, 185, 129, 0.4), rgba(245, 158, 11, 0.4)) !important;
  background-color: #060812 !important;
  background-size: 400% 400% !important;
  animation: gradientBG 15s ease infinite !important;
  overflow: hidden;
}

@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.floating-emojis {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none;
}

.floating-emojis .emoji {
  position: absolute;
  font-size: 4rem;
  opacity: 0.8;
}

.e1 { top: 10%; left: 10%; animation: move1 12s ease-in-out infinite alternate; }
.e2 { top: 20%; left: 70%; animation: move2 15s ease-in-out infinite alternate; font-size: 3rem; }
.e3 { top: 70%; left: 15%; animation: move3 10s ease-in-out infinite alternate; font-size: 5rem; }
.e4 { top: 60%; left: 80%; animation: move1 14s ease-in-out infinite alternate-reverse; }
.e5 { top: 40%; left: 45%; animation: move2 18s ease-in-out infinite alternate; font-size: 4.5rem; }
.e6 { top: 85%; left: 50%; animation: move3 13s ease-in-out infinite alternate-reverse; font-size: 3.5rem; }

@keyframes move1 {
  0% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(80px, 60px) rotate(20deg); }
  100% { transform: translate(-40px, 120px) rotate(-10deg); }
}

@keyframes move2 {
  0% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(-100px, 50px) rotate(-15deg); }
  100% { transform: translate(-50px, -80px) rotate(15deg); }
}

@keyframes move3 {
  0% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(50px, -100px) rotate(25deg); }
  100% { transform: translate(120px, 20px) rotate(-5deg); }
}

#screen-escuro {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 9999 !important;
  max-width: none !important;
  margin: 0 !important;
  border-radius: 0 !important;
  background: #000000 !important;
  color: #ffffff;
}

.dark-mode-content {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 500;
  opacity: 0.4;
}

/* ====================================================
   OVERRIDE TEXT MODULE (GSAP)
   ==================================================== */
#screen-override-text {
  display: none;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 10000 !important;
  max-width: none !important;
  margin: 0 !important;
  border-radius: 0 !important;
  background: var(--midnight-violet) !important; /* ROXO SÓLIDO */
  display: none; /* overrides the .screen active flex display if controlled by JS */
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#screen-override-text.active {
  display: flex !important;
}

#screen-override-text[data-scheme="duotone-2color"] {
  background: var(--duotone-bg-pure) !important;
}

.duotone-phrase {
  font-family: 'Bungee', cursive, sans-serif;
  font-size: clamp(2rem, 8vw, 8rem);
  line-height: 1.2;
  text-transform: uppercase;
  max-width: 90vw;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: clamp(0.5rem, 2vw, 2rem);
}

.word-wrapper {
  display: inline-block;
  white-space: nowrap;
}

.char {
  display: inline-block;
  position: relative;
  transform-style: preserve-3d;
}

/* Grammatical Colors */
.tag-artigo { color: var(--color-artigo); }
.tag-substantivo { color: var(--color-substantivo); }
.tag-preposicao { color: var(--color-preposicao); }
.tag-adjetivo { color: var(--color-adjetivo-bright); }

/* 2-Color Pure Mode */
/* Chromatic Gradient */
.duotone-phrase:not([data-scheme="duotone-2color"]) .tag-artigo {
  background: linear-gradient(135deg, var(--apricot-cream), #ffffff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 6px 18px rgba(240, 201, 135, 0.45));
}
.duotone-phrase:not([data-scheme="duotone-2color"]) .tag-substantivo {
  background: linear-gradient(135deg, var(--cinnabar), #ff9a8f);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 6px 18px rgba(219, 76, 64, 0.45));
}
.duotone-phrase:not([data-scheme="duotone-2color"]) .tag-preposicao {
  background: linear-gradient(135deg, var(--muted-teal), #d2fcee);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 6px 18px rgba(137, 189, 158, 0.45));
}
.duotone-phrase:not([data-scheme="duotone-2color"]) .tag-adjetivo {
  background: linear-gradient(135deg, #ff5e97, var(--dark-amaranth));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 6px 18px rgba(139, 30, 63, 0.45));
}

/* 2-Color Pure Mode */
.duotone-phrase[data-scheme="duotone-2color"] .word-wrapper {
  background: linear-gradient(135deg, var(--duotone-text-pure), #fff5b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 8px 20px rgba(150, 25, 15, 0.6));
}