/*
Theme Name: Quiz Totem Honda
Theme URI: https://example.com/
Author: Antigravity
Description: Tema WordPress estático para o Quiz Totem Honda. Carrega as perguntas e configurações diretamente dos arquivos locais.
Version: 5.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: quiz-totem-honda
*/

/* ── Variáveis ── */
:root {
  --bg:             #F4F6F4;
  --bg-card:        #FFFFFF;
  --bg-card2:       #FAFAFA;
  --accent:         #73a839;
  --accent-glow:    rgba(115, 168, 57, 0.25);
  --honda-red:      #CC0000;
  --honda-red-glow: rgba(204, 0, 0, 0.25);
  --green:          #00C853;
  --green-glow:     rgba(0, 200, 83, 0.25);
  --red:            #FF1744;
  --red-glow:       rgba(255, 23, 68, 0.25);
  --text:           #1A1A1A;
  --text-muted:     #555555;
  --border:         rgba(0, 0, 0, 0.1);
  --font-display:   'Sora','Helvetica Neue',Arial,sans-serif;
  --font-body:      'DM Sans','Helvetica Neue',Arial,sans-serif;
  --radius-sm:      4px;
  --radius-md:      8px;
  --radius-lg:      16px;
  --radius:         8px;

  /* Bordas personalizáveis pelo editor */
  --border-question: #CC0000;   /* borda esquerda do balão de pergunta */
  --border-answer:   #73a839;   /* borda esquerda dos botões de resposta */

  /* Zonas do totem */
  --zone-top:     40vh;   /* Área de branding/leitura  */
  --zone-bottom:  60vh;   /* Área de toque/interação   */
}

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  touch-action: manipulation;
}

/* Remove estilos padrão do WordPress */
body { touch-action: pan-x pan-y; }
a, a:hover, a:visited { text-decoration: none; color: inherit; }
img { display: block; }
button { border: none; background: none; cursor: pointer; }
.wp-toolbar-placeholder,
#wpadminbar { display: none !important; }
html { margin-top: 0 !important; }

/* ── Canvas de partículas (overlay) ── */
#particle-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
}

/* ── Gradientes de fundo da campanha ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(ellipse at 15% 100%, rgba(0,102,51,0.28) 0%, transparent 55%),
    radial-gradient(ellipse at 85%   0%, rgba(115,168,57,0.16) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: url('assets/bg-waves.jpg') center center / cover no-repeat;
  opacity: 0.05;
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: luminosity;
}

/* ══════════════════════════════════════
   ESTRUTURA BASE DAS TELAS
   Layout de 2 zonas para totem vertical
   ══════════════════════════════════════ */
.screen {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-rows: var(--zone-top) var(--zone-bottom);
  z-index: 10;
  /* GPU-only transition: opacity + transform evitam repaints */
  opacity: 0;
  transform: translateZ(0);
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.32s ease, transform 0.32s ease, visibility 0.32s ease;
  will-change: opacity, transform;
  backface-visibility: hidden;
}
.screen.active {
  opacity: 1;
  transform: translateZ(0);
  visibility: visible;
  pointer-events: all;
}
/* Saída com slide sutil para GPU — evita layout shift */
.screen.screen-exit {
  opacity: 0;
  transform: translateY(-12px) translateZ(0);
  pointer-events: none;
}

/* Zona superior: branding, logos, leitura */
.zone-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 48px 16px;
  position: relative;
  z-index: 1;
}

/* Zona inferior: todos os elementos de toque */
.zone-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 48px 56px;
  position: relative;
  z-index: 1;
  /* Sutil separador visual */
  border-top: 1px solid rgba(0,0,0,0.06);
}

/* ══════════════════════════════════════
   TELA IDLE
   Top 40%: logos e branding
   Bottom 60%: orb, CTA, instrução
   ══════════════════════════════════════ */
#screen-idle {
  cursor: pointer;
}

/* ── ZONA SUPERIOR: branding ── */
.idle-brand-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.idle-honda-wing {
  height: clamp(60px, 7vh, 100px);
  width: auto;
  filter: drop-shadow(0 0 14px rgba(204,0,0,0.5));
  animation: wing-pulse 3s ease-in-out infinite;
}

@keyframes wing-pulse {
  0%,100% { filter: drop-shadow(0 0 10px rgba(204,0,0,0.4)); }
  50%      { filter: drop-shadow(0 0 26px rgba(204,0,0,0.65)); }
}

.idle-campaign-label {
  font-family: var(--font-body);
  font-size: clamp(11px, 1.4vh, 18px);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.idle-50anos {
  height: clamp(70px, 10vh, 130px);
  width: auto;
  filter: brightness(0) invert(0) drop-shadow(0 0 10px rgba(115,168,57,0.55));
  animation: logo-glow 3s ease-in-out infinite;
  margin-top: 8px;
}

@keyframes logo-glow {
  0%,100% { filter: brightness(0) drop-shadow(0 0 8px rgba(115,168,57,0.4)); }
  50%      { filter: brightness(0) drop-shadow(0 0 22px rgba(115,168,57,0.75)); }
}

/* ── ZONA INFERIOR: orb + CTA ── */
.idle-orb {
  width: clamp(140px, 18vh, 220px);
  height: clamp(140px, 18vh, 220px);
  background: #FFFFFF;
  border: 3px solid var(--honda-red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08), inset 0 0 15px rgba(204,0,0,0.05);
  animation: orb-float 3s ease-in-out infinite, orb-glow 3s ease-in-out infinite;
  margin-bottom: 28px;
}

.idle-orb-icon {
  font-size: clamp(3rem, 6vh, 5rem);
  color: var(--honda-red);
}

@keyframes orb-float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-14px); }
}

@keyframes orb-glow {
  0%, 100% { box-shadow: 0 10px 30px rgba(0,0,0,0.08), 0 0 40px var(--honda-red-glow); }
  50%       { box-shadow: 0 10px 30px rgba(0,0,0,0.08), 0 0 70px rgba(204,0,0,0.35); }
}

.idle-cta {
  font-family: var(--font-display);
  font-size: var(--fs-idle-title, clamp(28px, 4.5vh, 58px));
  font-weight: 800;
  font-style: italic;
  text-align: center;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}

.idle-sub {
  font-size: var(--fs-idle-sub, clamp(16px, 2.2vh, 26px));
  color: var(--text-muted);
  text-align: center;
  font-weight: 500;
}

/* ══════════════════════════════════════
   TELA DE PERGUNTA — TOTEM 43" (1080×1920)
   Layout em coluna única: pergunta + respostas em cascata
   Sem divisão rígida de zonas — fluxo vertical total
   ══════════════════════════════════════ */
#screen-question {
  position: fixed;
  inset: 0;
  /* Sobrescreve o grid de 2 zonas: coluna única flexível */
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(32px, 4vh, 64px) clamp(32px, 4vw, 72px);
  gap: clamp(20px, 2.5vh, 36px);
  overflow-y: auto;
  z-index: 10;
}

/* Remove o comportamento de zona dentro da tela de pergunta */
#screen-question .zone-top,
#screen-question .zone-bottom {
  display: contents; /* dissolve o container, filhos entram no flex pai */
}

.question-enter {
  animation: screen-zoom-in 0.38s cubic-bezier(0.22,1,0.36,1) both;
  will-change: transform, opacity;
}

@keyframes screen-zoom-in {
  /* translateZ(0) mantém no mesmo compositor layer o tempo todo */
  from { transform: scale(0.94) translateZ(0); opacity: 0; }
  to   { transform: scale(1) translateZ(0);    opacity: 1; }
}

/* ── Badge de pergunta ── */
.question-header {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 900px;
}

.question-badge {
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(13px, 1.6vh, 18px);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 8px 28px;
  border-radius: 100px;
}

/* ── Balão da pergunta — mesmo estilo visual dos botões de opção ── */
#question-text {
  font-family: var(--font-display);
  font-size: var(--fs-q-text, clamp(24px, 3.2vh, 48px));
  font-weight: 800;
  text-align: left;
  line-height: 1.3;
  width: 100%;
  max-width: 900px;
  letter-spacing: -0.01em;
  transition: opacity 0.3s ease;
  color: var(--text);

  /* Card estilo balão — borda esquerda personalizável pelo editor */
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-left: 6px solid var(--border-question);
  border-radius: var(--radius-md);
  padding: clamp(24px, 3vh, 44px) clamp(24px, 2.8vw, 40px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

/* ── Coluna única de opções ── */
#options-grid {
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 1.8vh, 26px);
  width: 100%;
  max-width: 900px;
  /* filter:blur() força repaint pesado — substituído por opacity (GPU-only) */
  transition: opacity 0.3s ease;
  will-change: opacity;
}

/* Leve desfoque visual sem custo de GPU: reduz opacidade em vez de blur */
#options-grid.answered {
  opacity: 0.55;
}

/* ── Botão de opção — coluna única, totem 43" ── */
.option-btn {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.5vw, 32px);
  width: 100%;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-left: 6px solid var(--border-answer);
  border-radius: var(--radius-md);
  padding: clamp(22px, 2.8vh, 40px) clamp(24px, 3vw, 40px);
  cursor: pointer;
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-ans-text, clamp(20px, 2.4vh, 32px));
  font-weight: 500;
  text-align: left;
  min-height: clamp(90px, 10vh, 140px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.04);
  /* Apenas transform e opacity: executam no compositor, não bloqueiam JS */
  transition: transform 0.18s ease, opacity 0.25s ease;
  opacity: 0;
  transform: translateY(20px) translateZ(0);
  position: relative;
  overflow: hidden;
  will-change: transform, opacity;
  backface-visibility: hidden;
}

.option-btn.slide-in {
  animation: opt-in 0.32s cubic-bezier(0.22,1,0.36,1) forwards;
  will-change: transform, opacity;
}
@keyframes opt-in {
  to { opacity: 1; transform: translateY(0) translateZ(0); }
}

.option-btn:not(.disabled):hover,
.option-btn:not(.disabled):focus-visible {
  background: var(--bg-card2);
  border-color: var(--accent);
  border-left-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow), 0 8px 32px rgba(0,0,0,0.15);
  transform: translateY(-3px) scale(1.01) translateZ(0);
  outline: none;
}

.option-btn:not(.disabled):active {
  transform: scale(0.98) translateZ(0);
}

.option-letter {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.8vh, 36px);
  font-weight: 800;
  color: var(--accent);
  background: rgba(115, 168, 57, 0.1);
  border: 1px solid rgba(115, 168, 57, 0.3);
  border-radius: var(--radius-sm);
  min-width: clamp(52px, 6vh, 72px);
  height: clamp(52px, 6vh, 72px);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: color 0.2s, background 0.2s;
  flex-shrink: 0;
}

.option-text {
  flex: 1;
  line-height: 1.3;
  color: var(--text);
}

/* ── Pulso ao selecionar ── */
.option-btn.selected-pulse {
  animation: pulse-select 0.45s cubic-bezier(0.22,1,0.36,1) both;
}
@keyframes pulse-select {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.06); }
  70%  { transform: scale(0.97); }
  100% { transform: scale(1.03); }
}

/* ── Correto (verde) ── */
button.option-btn.correct {
  background-color: rgba(74, 222, 128, 0.15) !important;
  border: 2px solid #4ade80 !important;
  border-left: 5px solid #4ade80 !important;
  box-shadow: 0 0 25px rgba(74, 222, 128, 0.4) !important;
  opacity: 1 !important;
  filter: none !important;
  transform: scale(1.02) !important;
  color: #4ade80 !important;
  animation: correct-pop 0.55s cubic-bezier(0.22,1,0.36,1) both;
}
button.option-btn.correct .option-letter {
  background-color: #4ade80 !important;
  color: #000 !important;
  border-color: #4ade80 !important;
}
button.option-btn.correct .option-text {
  color: #4ade80 !important;
  font-weight: bold !important;
}
@keyframes correct-pop {
  0%   { transform: scale(1.02); }
  45%  { transform: scale(1.08); }
  100% { transform: scale(1.02); }
}

/* ── Errado (vermelho) ── */
button.option-btn.wrong {
  background-color: rgba(248, 113, 113, 0.15) !important;
  border: 2px solid #f87171 !important;
  border-left: 5px solid #f87171 !important;
  box-shadow: 0 0 25px rgba(248, 113, 113, 0.4) !important;
  opacity: 1 !important;
  filter: none !important;
  color: #f87171 !important;
  animation: shake 0.45s ease both;
}
button.option-btn.wrong .option-letter {
  background-color: #f87171 !important;
  color: #000 !important;
  border-color: #f87171 !important;
}
button.option-btn.wrong .option-text {
  color: #f87171 !important;
}
@keyframes shake {
  0%, 100% { transform: translateX(0) scale(1); }
  15%       { transform: translateX(-10px); }
  30%       { transform: translateX(10px); }
  45%       { transform: translateX(-6px); }
  60%       { transform: translateX(6px); }
  75%       { transform: translateX(-3px); }
}

/* ── Escurecido ── */
.option-btn.dimmed {
  opacity: 0.25;
  filter: grayscale(0.4);
}

/* ══════════════════════════════════════
   OVERLAY DE RESULTADO
   Flutua sobre a zona de pergunta
   Posicionado no topo da zona inferior
   ══════════════════════════════════════ */
.result-overlay {
  position: absolute;
  /* Âncora no início da zona inferior (top 40%) */
  top: var(--zone-top);
  left: 0; right: 0;
  height: 28vh;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 100;
}

.result-overlay.hidden { display: none; }

.result-overlay-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 56px;
  border-radius: 28px;
  /* backdrop-filter: blur() é MUITO pesado em Android — substituído por fundo sólido semiopaco */
  /* backdrop-filter: blur(16px); */
  animation: overlay-pop 0.42s cubic-bezier(0.22,1,0.36,1) both;
  will-change: transform, opacity;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.result-overlay-inner.correct-bg {
  background: rgba(10, 30, 15, 0.88);
  border: 2px solid rgba(74,222,128,0.5);
  box-shadow: 0 0 80px rgba(74,222,128,0.25), 0 24px 64px rgba(0,0,0,0.4);
}

.result-overlay-inner.wrong-bg {
  background: rgba(30, 10, 10, 0.88);
  border: 2px solid rgba(248,113,113,0.4);
  box-shadow: 0 0 80px rgba(248,113,113,0.2), 0 24px 64px rgba(0,0,0,0.4);
}

@keyframes overlay-pop {
  0%   { transform: scale(0.5) translateY(20px); opacity: 0; }
  60%  { transform: scale(1.06) translateY(-4px); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.result-overlay.leaving .result-overlay-inner {
  animation: overlay-out 0.4s ease forwards;
}
@keyframes overlay-out {
  to { transform: scale(0.85) translateY(-20px); opacity: 0; }
}

#result-icon {
  font-size: clamp(42px, 6vh, 80px);
  line-height: 1;
  animation: icon-spin-in 0.5s 0.05s cubic-bezier(0.22,1,0.36,1) both;
}
@keyframes icon-spin-in {
  from { transform: rotate(-20deg) scale(0.4); opacity: 0; }
  to   { transform: rotate(0deg) scale(1);    opacity: 1; }
}

#result-message {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.8vh, 52px);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: center;
  white-space: nowrap;
  animation: fade-up 0.4s 0.12s ease both;
}
#result-message.correct { color: var(--green); text-shadow: 0 0 30px var(--green-glow); }
#result-message.wrong   { color: var(--red);   text-shadow: 0 0 30px var(--red-glow); }

@keyframes fade-up {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ── Flash de cor na tela inteira ── */
.screen-flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
  opacity: 0;
}
.screen-flash.hidden { display: none; }
.screen-flash.flash-green {
  background: radial-gradient(ellipse at center,
    rgba(74,222,128,0.18) 0%, rgba(74,222,128,0.04) 50%, transparent 70%);
  animation: flash-in 0.6s ease both;
}
.screen-flash.flash-red {
  background: radial-gradient(ellipse at center,
    rgba(248,113,113,0.16) 0%, rgba(248,113,113,0.04) 50%, transparent 70%);
  animation: flash-in 0.6s ease both;
}
@keyframes flash-in {
  0%   { opacity: 0; }
  25%  { opacity: 1; }
  100% { opacity: 0.6; }
}

/* ══════════════════════════════════════
   MODAL DE EXPLICAÇÃO
   Centralizado na zona inferior
   ══════════════════════════════════════ */
.explanation-modal {
  position: fixed;
  inset: 0;
  /* Blur removido — muito custoso em Android. Fundo opaco compensa visualmente */
  background: rgba(0, 0, 0, 0.72);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 0;
  opacity: 1;
  transition: opacity 0.28s ease;
  will-change: opacity;
}

.explanation-modal.hidden {
  opacity: 0;
  pointer-events: none;
}

.explanation-content {
  background: var(--bg-card);
  width: 100%;
  max-width: 1080px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow: hidden;
  box-shadow: 0 -20px 60px rgba(0,0,0,0.2);
  transform: translateY(0) translateZ(0);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  height: 52vh;
  will-change: transform;
  backface-visibility: hidden;
}

.explanation-modal.hidden .explanation-content {
  transform: translateY(100%);
}

/* Linha indicadora de sheet */
.explanation-content::before {
  content: '';
  display: block;
  width: 48px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 16px auto 0;
  flex-shrink: 0;
}

.explanation-image {
  background: linear-gradient(135deg, #e8f0e8, #f0f4f0);
  height: clamp(120px, 14vh, 180px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-weight: bold;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.explanation-text-area {
  padding: 24px 36px 16px;
  flex: 1;
  overflow-y: auto;
}

.explanation-text-area h3 {
  color: var(--accent);
  margin-bottom: 10px;
  font-family: var(--font-display);
  font-size: var(--fs-expl-title, clamp(1.2rem, 2.5vh, 1.8rem));
  font-weight: 700;
}

#explanation-text {
  color: var(--text);
  font-size: var(--fs-expl-text, clamp(1rem, 1.8vh, 1.3rem));
  line-height: 1.6;
}

/* Botão "Entendi" — grande para totem */
.btn-close-modal {
  margin: 0 36px 36px;
  padding: clamp(18px, 2.5vh, 26px) 24px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2vh, 1.5rem);
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: transform 0.15s, box-shadow 0.15s;
  flex-shrink: 0;
}

.btn-close-modal:active {
  transform: scale(0.97);
}

/* Barra de tempo */
.timer-bar {
  height: 6px;
  background: #eee;
  width: 100%;
  flex-shrink: 0;
}

.timer-progress {
  height: 100%;
  background: var(--accent);
  width: 100%;
  transform-origin: left;
}

.timer-progress.animate {
  animation: shrinkTimer 10s linear forwards;
}

@keyframes shrinkTimer {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

/* ══════════════════════════════════════
   BOTÃO DE SOM — canto superior esquerdo
   ══════════════════════════════════════ */
.sound-toggle {
  position: fixed;
  top: 28px;
  left: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: clamp(56px, 6vh, 72px);
  height: clamp(56px, 6vh, 72px);
  font-size: clamp(1.4rem, 2.5vh, 2rem);
  cursor: pointer;
  z-index: 100;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sound-toggle.muted {
  opacity: 0.5;
  filter: grayscale(100%);
}

/* ══════════════════════════════════════
   PAINEL ADMIN
   ══════════════════════════════════════ */
#admin-panel {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  /* backdrop-filter removido — desnecessário no painel admin */
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}
#admin-panel.visible {
  opacity: 1;
  pointer-events: all;
  visibility: visible;
}

.admin-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 56px;
  min-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
}

.admin-box h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
}

#admin-summary {
  font-size: 16px;
  color: var(--text-muted);
  text-align: center;
}

.admin-btn {
  width: 100%;
  padding: clamp(16px, 2vh, 22px) 24px;
  border-radius: var(--radius-md);
  border: none;
  font-family: var(--font-body);
  font-size: clamp(15px, 1.8vh, 20px);
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.admin-btn:active { transform: scale(0.97); }
.admin-btn.primary   { background: var(--accent); color: #fff; }
.admin-btn.danger    { background: rgba(248,113,113,0.15); color: var(--red); border: 1px solid var(--red-glow); }
.admin-btn.secondary { background: var(--bg-card2); color: var(--text-muted); }
.admin-btn.editor-btn {
  background: rgba(30, 41, 59, 0.08);
  color: #1e293b;
  border: 1px solid rgba(30, 41, 59, 0.2);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: clamp(15px, 1.8vh, 20px);
  font-weight: 600;
}
.admin-btn.editor-btn:hover {
  background: rgba(30, 41, 59, 0.14);
}

/* Gatilho admin invisível */
#admin-trigger {
  position: fixed;
  top: 0; right: 0;
  width: 100px; height: 100px;
  z-index: 200;
  cursor: default;
}

/* Contador de progresso oculto */
#progress-count { display: none !important; }

/* ══════════════════════════════════════
   INDICADOR DE ZONA (apenas para debug)
   Remova em produção
   ══════════════════════════════════════ */
/* .zone-debug-line {
  position: fixed;
  top: var(--zone-top);
  left: 0; right: 0;
  height: 2px;
  background: red;
  z-index: 9999;
  pointer-events: none;
} */

/* Variante do botão admin para configurações */
.admin-btn.settings-btn {
  background: rgba(115, 168, 57, 0.1);
  color: var(--accent);
  border: 1px solid rgba(115, 168, 57, 0.35);
}
.admin-btn.settings-btn:hover {
  background: rgba(115, 168, 57, 0.18);
}

/* ══════════════════════════════════════
   BARRA DE TIMER DA PERGUNTA
   Exibida no topo da tela de pergunta
   ══════════════════════════════════════ */
#question-timer-wrapper {
  width: 100%;
  max-width: 900px;
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 24px);
}

#question-timer-track {
  flex: 1;
  height: clamp(14px, 1.8vh, 22px);
  background: rgba(0, 0, 0, 0.07);
  border-radius: 100px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.06);
}

/* Preenchimento da barra de tempo */
.question-timer-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #4ade80, #22c55e);
  border-radius: 100px;
  transform-origin: left;
  /* a largura é animada via JS com transition linear */
}

/* Barra no estado de alerta (≤33% do tempo) */
.question-timer-fill.warning {
  background: linear-gradient(90deg, #fb923c, #f97316);
}

/* Barra no estado crítico (≤15% do tempo) — pulsa */
.question-timer-fill.danger {
  background: linear-gradient(90deg, #f87171, #ef4444);
  animation: timer-danger-pulse 0.5s ease-in-out infinite;
}

@keyframes timer-danger-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}

#question-timer-label {
  font-family: var(--font-display);
  font-size: clamp(18px, 2.5vh, 30px);
  font-weight: 800;
  color: var(--text);
  min-width: clamp(40px, 5vw, 60px);
  text-align: right;
  letter-spacing: -0.02em;
  transition: color 0.3s ease;
}

/* ══════════════════════════════════════
   TELA DE PARABÉNS (COMPLETE)
   Exibida ao concluir N perguntas
   ══════════════════════════════════════ */
#screen-complete {
  /* Sobrescreve o grid de zonas para layout de coluna centralizada */
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow-y: auto;
  padding: clamp(32px, 4vh, 64px) clamp(32px, 5vw, 80px);
}

.complete-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 2.8vh, 40px);
  width: 100%;
  max-width: 900px;
  text-align: center;
}

/* Troféu animado */
.complete-trophy {
  font-size: clamp(80px, 14vh, 160px);
  line-height: 1;
  filter: drop-shadow(0 0 36px rgba(255, 215, 0, 0.55));
  animation: trophy-bounce 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes trophy-bounce {
  0%   { transform: scale(0) translateY(60px); opacity: 0; }
  60%  { transform: scale(1.18) translateY(-12px); opacity: 1; }
  80%  { transform: scale(0.95); }
  100% { transform: scale(1) translateY(0); }
}

.complete-title {
  font-family: var(--font-display);
  font-size: var(--fs-complete-title, clamp(52px, 9vh, 108px));
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--accent) 0%, #22c55e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fade-up 0.5s 0.2s ease both;
}

.complete-message {
  font-size: var(--fs-complete-msg, clamp(18px, 2.4vh, 30px));
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1.4;
  animation: fade-up 0.5s 0.35s ease both;
}

/* Cards de estatísticas */
.complete-stats {
  display: flex;
  gap: clamp(14px, 2.5vw, 36px);
  animation: fade-up 0.5s 0.5s ease both;
  width: 100%;
  justify-content: center;
}

.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(8px, 1vh, 14px);
  padding: clamp(20px, 2.8vh, 40px) clamp(24px, 3.5vw, 52px);
  border-radius: var(--radius-lg);
  flex: 1;
  max-width: 240px;
}

.stat-card.stat-total {
  background: rgba(115, 168, 57, 0.1);
  border: 2px solid rgba(115, 168, 57, 0.35);
}
.stat-card.stat-correct {
  background: rgba(74, 222, 128, 0.1);
  border: 2px solid rgba(74, 222, 128, 0.4);
}
.stat-card.stat-wrong {
  background: rgba(248, 113, 113, 0.1);
  border: 2px solid rgba(248, 113, 113, 0.35);
}

.stat-number {
  font-family: var(--font-display);
  font-size: clamp(44px, 7vh, 88px);
  font-weight: 800;
  line-height: 1;
}
.stat-card.stat-total   .stat-number { color: var(--accent); }
.stat-card.stat-correct .stat-number { color: #4ade80; }
.stat-card.stat-wrong   .stat-number { color: #f87171; }

.stat-label {
  font-size: clamp(12px, 1.6vh, 18px);
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Botão de reiniciar */
.btn-restart {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: clamp(20px, 2.8vh, 40px) clamp(40px, 7vw, 96px);
  font-family: var(--font-display);
  font-size: clamp(20px, 2.6vh, 34px);
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 28px rgba(115, 168, 57, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  animation: fade-up 0.5s 0.65s ease both;
}
.btn-restart:active {
  transform: scale(0.97);
  box-shadow: 0 4px 12px rgba(115, 168, 57, 0.25);
}

.complete-sub {
  font-size: clamp(14px, 1.8vh, 22px);
  color: var(--text-muted);
  animation: blink-subtle 2s 1.2s ease-in-out infinite;
}

@keyframes blink-subtle {
  0%, 100% { opacity: 0.8; }
  50%       { opacity: 0.35; }
}

/* ══════════════════════════════════════
   PAINEL DE CONFIGURAÇÕES
   Overlay igual ao Admin Panel
   ══════════════════════════════════════ */
#settings-panel {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

#settings-panel.visible {
  opacity: 1;
  pointer-events: all;
  visibility: visible;
}

.settings-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(36px, 5vh, 64px);
  width: min(700px, 92vw);
  display: flex;
  flex-direction: column;
  gap: clamp(24px, 3vh, 40px);
  box-shadow: 0 24px 80px rgba(0,0,0,0.4);
}

.settings-title {
  font-family: var(--font-display);
  font-size: clamp(18px, 2.4vh, 26px);
  font-weight: 700;
  text-align: center;
  color: var(--text);
}

/* Grupo de configuração individual */
.setting-group {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: clamp(20px, 2.5vh, 32px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.setting-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.setting-icon {
  font-size: clamp(24px, 3.2vh, 38px);
  flex-shrink: 0;
}

.setting-info {
  flex: 1;
  min-width: 0;
}

.setting-label {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(15px, 1.9vh, 22px);
  font-weight: 700;
  color: var(--text);
}

.setting-desc {
  font-size: clamp(11px, 1.4vh, 15px);
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.4;
}

/* Valor atual destacado */
.setting-value {
  font-family: var(--font-display);
  font-size: clamp(22px, 3vh, 34px);
  font-weight: 800;
  color: var(--accent);
  flex-shrink: 0;
  min-width: 60px;
  text-align: right;
}

/* Slider personalizado */
.setting-slider {
  width: 100%;
  height: 10px;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 100px;
  outline: none;
  cursor: pointer;
  /* background é setado via JS para mostrar preenchimento */
  background: rgba(0,0,0,0.08);
}

.setting-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: clamp(32px, 4.5vh, 44px);
  height: clamp(32px, 4.5vh, 44px);
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 2px 10px rgba(115, 168, 57, 0.45);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border: 3px solid #fff;
}

.setting-slider::-webkit-slider-thumb:active {
  transform: scale(1.2);
  box-shadow: 0 4px 18px rgba(115, 168, 57, 0.55);
}

.setting-slider::-moz-range-thumb {
  width: clamp(32px, 4.5vh, 44px);
  height: clamp(32px, 4.5vh, 44px);
  background: var(--accent);
  border-radius: 50%;
  border: 3px solid #fff;
  cursor: pointer;
}

/* Marcações do slider */
.slider-marks {
  display: flex;
  justify-content: space-between;
  font-size: clamp(11px, 1.4vh, 14px);
  color: var(--text-muted);
  font-weight: 600;
  padding: 0 4px;
}

/* Botões do painel de config */
.settings-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ══════════════════════════════════════
   IMAGEM DA PERGUNTA
   Exibida acima do balão, abaixo do timer
   Auto-redimensionável, não ultrapassa a zona
   ══════════════════════════════════════ */
#question-img-wrapper {
  width: auto;
  aspect-ratio: 1 / 1;
  /* Limite de altura — nunca estoura a zona */
  height: clamp(160px, 22vh, 350px);
  max-width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;          /* não encolhe, mas respeita o max-height */
  box-shadow: 0 4px 20px rgba(0,0,0,0.10);
  border: 2px solid var(--border);
  display: none;           /* oculto por padrão */
}

#question-img-wrapper.visible {
  display: block;
}

#question-img-el {
  width: 100%;
  height: 100%;
  object-fit: cover;       /* recorta sem distorcer */
  display: block;
}

/* ══════════════════════════════════════
   IDLE — Container do Logotipo (substitui .idle-orb)
   Aceita emoji (padrão) ou imagem carregada pelo editor
   ══════════════════════════════════════ */

/* Override zone-bottom para suportar posicionamento livre */
#screen-idle .zone-bottom {
  justify-content: flex-start !important;
  gap: clamp(16px, 2.2vh, 32px) !important;
  padding-top:    clamp(20px, 3.5vh, 56px) !important;
  padding-bottom: clamp(20px, 3.5vh, 56px) !important;
}

#idle-logo-container {
  width:  clamp(120px, 16vh, 210px);
  height: clamp(120px, 16vh, 210px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #FFFFFF;
  border: 3px solid var(--honda-red);
  box-shadow: 0 10px 30px rgba(0,0,0,0.08), inset 0 0 15px rgba(204,0,0,0.05);
  animation: orb-float 3s ease-in-out infinite, orb-glow 3s ease-in-out infinite;
  transition: border-color 0.4s ease, box-shadow 0.4s ease, border-radius 0.3s ease;
  flex-shrink: 0;
}

/* Imagem do logotipo — ocupa 100% do container, mantém proporção */
#idle-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
  padding: 10%;       /* respiro interno para logos com borda */
}

/* Quando há imagem: exibe a img, esconde o emoji */
#idle-logo-container.has-image #idle-logo-img { display: block; }
#idle-logo-container.has-image .idle-orb-icon { display: none; }

/* ══════════════════════════════════════
   UTILITÁRIOS DE BORDA
   .brd-none | .brd-solid | .brd-double
   Aplicados a: #idle-logo-container, #question-img-wrapper
   ══════════════════════════════════════ */

.brd-none {
  /* mantém o estilo padrão de cada elemento */
}

.brd-solid {
  border: 4px solid var(--theme-border-color, #73a839) !important;
  border-radius: var(--radius-md) !important;
  outline: none !important;
}

.brd-double {
  border: 3px solid var(--theme-border-color, #73a839) !important;
  outline: 3px solid var(--theme-border-color, #73a839) !important;
  outline-offset: 5px !important;
  border-radius: var(--radius-md) !important;
}

/* ══════════════════════════════════════
   UTILITÁRIOS DE SOMBRA
   .shd-none | .shd-soft | .shd-dramatic
   ══════════════════════════════════════ */

.shd-none {
  box-shadow: none !important;
  animation: none !important;
}

.shd-soft {
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.28) !important;
  animation: none !important;
}

.shd-dramatic {
  animation: none !important;
  box-shadow:
    0 16px 52px rgba(0, 0, 0, 0.55),
    0 0 0 3px var(--theme-border-color, #73a839),
    0 0 32px var(--theme-border-color-alpha, rgba(115, 168, 57, 0.4)) !important;
}

/* ══════════════════════════════════════
   POSICIONAMENTO — TELA IDLE
   Funciona com justify-content: flex-start no zone-bottom
   .idle-pos-top | .idle-pos-center | .idle-pos-bottom
   ══════════════════════════════════════ */

.idle-pos-top {
  order: 1 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.idle-pos-center {
  order: 5 !important;
  margin-top: auto !important;
  margin-bottom: auto !important;
}

.idle-pos-bottom {
  order: 10 !important;
  margin-top: auto !important;
  margin-bottom: 0 !important;
}

/* ══════════════════════════════════════
   BRAND LABEL IMAGE (topo da tela idle)
   Aparece no lugar do texto "Semana da Segurança"
   ══════════════════════════════════════ */
.idle-brand-img {
  display: none;
  max-height: clamp(24px, 4vh, 52px);
  max-width: 80%;
  width: auto;
  object-fit: contain;
}

/* ══════════════════════════════════════
   FORMAS DO LOGOTIPO (idle-logo-container)
   .shape-circle | .shape-rect | .shape-none
   ══════════════════════════════════════ */

/* Círculo (padrão, como idle-orb) */
#idle-logo-container.shape-circle {
  border-radius: 50% !important;
  width:  clamp(120px, 16vh, 210px) !important;
  height: clamp(120px, 16vh, 210px) !important;
  overflow: hidden;
}

/* Retangular — auto-redimensiona com a imagem */
#idle-logo-container.shape-rect {
  border-radius: 12px !important;
  /* O container se ajusta à imagem dentro dele */
  width: auto !important;
  height: auto !important;
  max-width: min(800px, 88%) !important;
  max-height: clamp(200px, 40vh, 500px) !important;
  overflow: hidden;
  animation: none !important;   /* sem float para formas não-circulares */
}

#idle-logo-container.shape-rect #idle-logo-img {
  width: auto !important;
  height: auto !important;
  max-width: min(800px, 88%) !important;
  max-height: clamp(200px, 40vh, 500px) !important;
  object-fit: contain !important;
  padding: 4% !important;
}

/* Oculto — sem placeholder */
#idle-logo-container.shape-none {
  display: none !important;
}


/* ══════════════════════════════════════
   MODOS DE PERFORMANCE — aplicados via data-perf no <html>
   Definidos no editor → aba Performance → Modo do Dispositivo
   ══════════════════════════════════════ */

/* ──────────────────────────────────────
   DISPOSITIVO FRACO  (data-perf="light")
   Remove animações contínuas do idle e blur de GPU.
   Mantém animações de feedback (shake, pulse, zoom).
   ────────────────────────────────────── */
html[data-perf="light"] .idle-honda-wing {
  animation: none;
  filter: drop-shadow(0 0 10px rgba(204,0,0,0.4));
}
html[data-perf="light"] .idle-50anos {
  animation: none;
  filter: brightness(0) drop-shadow(0 0 8px rgba(115,168,57,0.4));
}
html[data-perf="light"] .idle-orb,
html[data-perf="light"] #idle-logo-container { animation: none; }

/* Remove gradientes de fundo pesados */
html[data-perf="light"] body::before,
html[data-perf="light"] body::after { display: none; }

/* Substitui backdrop-filter por fundo sólido semitransparente */
html[data-perf="light"] .result-overlay-inner {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
html[data-perf="light"] .result-overlay-inner.correct-bg {
  background: rgba(10, 30, 15, 0.97);
}
html[data-perf="light"] .result-overlay-inner.wrong-bg {
  background: rgba(30, 10, 10, 0.97);
}
html[data-perf="light"] .explanation-modal {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: rgba(0, 0, 0, 0.82);
}


/* ──────────────────────────────────────
   DISPOSITIVO LEGADO  (data-perf="legacy")
   Zero animações e transições. Máxima performance.
   Apenas cor verde/vermelha nas respostas.
   ────────────────────────────────────── */
html[data-perf="legacy"] *,
html[data-perf="legacy"] *::before,
html[data-perf="legacy"] *::after {
  animation: none !important;
  transition: none !important;
}

/* Remove gradientes de fundo */
html[data-perf="legacy"] body::before,
html[data-perf="legacy"] body::after { display: none !important; }

/* Botões aparecem imediatamente (sem animação slide-in que os tornaria invisíveis) */
html[data-perf="legacy"] .option-btn {
  opacity: 1 !important;
  transform: none !important;
}

/* Remove todos os blurs de GPU */
html[data-perf="legacy"] .result-overlay-inner,
html[data-perf="legacy"] .explanation-modal {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
html[data-perf="legacy"] .result-overlay-inner.correct-bg {
  background: rgba(10, 30, 15, 0.97) !important;
}
html[data-perf="legacy"] .result-overlay-inner.wrong-bg {
  background: rgba(30, 10, 10, 0.97) !important;
}
html[data-perf="legacy"] .explanation-modal {
  background: rgba(0, 0, 0, 0.85) !important;
}

/* Sem embaçamento no grid de respostas ao responder */
html[data-perf="legacy"] #options-grid.answered {
  filter: none !important;
}

/* Screen flash não aparece (opacity 0 sem animação que o tornaria visível — OK) */
/* Garante que telas com .active apareçam instantaneamente */
html[data-perf="legacy"] .screen {
  transition: none !important;
}
