/* ============================================================
   Quiz — tema sunset (mesmo do QI), foco na pergunta/resposta.
   ============================================================ */

.sj-game-host:has(.qz) {
  --sj-text:           #2d2438;
  --sj-text-dim:       #5d5468;
  --sj-text-mute:      rgba(45, 36, 56, 0.42);
  --sj-bg-card:        rgba(255, 255, 255, 0.85);
  --sj-bg-elev:        rgba(255, 255, 255, 0.7);
  --sj-bg-card-hover:  rgba(255, 255, 255, 0.95);
  --sj-border:         rgba(255, 255, 255, 0.5);
  --sj-border-bright:  rgba(45, 36, 56, 0.18);
  --sj-accent:         #6b5bff;
  --sj-accent-hover:   #5347d6;
  --sj-accent-soft:    rgba(107, 91, 255, 0.12);
  --sj-gold:           #ffd93d;
  --sj-danger:         #ff3355;
  --sj-score-bg:       #fff;
  /* Cor por dificuldade — usada no pill da categoria */
  --qz-dif-1:          #22c55e;
  --qz-dif-2:          #f59e0b;
  --qz-dif-3:          #ef4444;
}
.sj-game-host:has(.qz),
body:has(.sj-game-stage) .sj-game-host:has(.qz) {
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.20), transparent 35%),
    radial-gradient(circle at 80% 80%, rgba(107,91,255,0.22), transparent 40%),
    linear-gradient(135deg, #ff7e5f 0%, #feb47b 45%, #ff6b95 100%);
}
.sj-game-stage-frame:has(.qz) {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.25);
}

/* ============ Wrapper ============ */
.qz {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 12px;
  height: 100%;
  width: 100%;
  box-sizing: border-box;
  overflow-y: auto;
}

/* ============ Stage card ============ */
.qz-stage {
  width: 100%;
  max-width: 640px;
  background: #fff;
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 12px 32px rgba(45, 36, 56, 0.18);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ============ Progress ============ */
.qz-progress {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--sj-font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--sj-text-dim);
  gap: 12px;
}
.qz-progress-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--sj-text);
  font-weight: 700;
}
/* Pill de dificuldade */
.qz-dif-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--qz-dif-1);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  line-height: 1.3;
}
.qz-dif-pill.dif-2 { background: var(--qz-dif-2); }
.qz-dif-pill.dif-3 { background: var(--qz-dif-3); }

.qz-progress-bar {
  height: 4px;
  background: rgba(45, 36, 56, 0.12);
  border-radius: 2px;
  overflow: hidden;
}
.qz-progress-fill {
  height: 100%;
  background: var(--sj-accent);
  width: 0%;
  transition: width .3s;
}

/* ============ Prompt ============ */
.qz-prompt {
  font-family: var(--sj-font-display);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.3;
  color: var(--sj-text);
  margin: 0;
}

/* ============ Choices ============ */
.qz-choices {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.qz-choice {
  background: #fff;
  border: 1.5px solid rgba(45, 36, 56, 0.12);
  border-radius: 10px;
  padding: 12px 14px;
  font-family: var(--sj-font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--sj-text);
  cursor: pointer;
  transition: all .15s;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 50px;
}
/* iOS Safari auto-linka URLs/emails/telefones no texto e aplica cor de :visited.
   O meta format-detection ajuda mas nem sempre pega — força cor consistente. */
.qz-choice a,
.qz-choice a:visited,
.qz-choice a:link {
  color: inherit !important;
  text-decoration: none !important;
  pointer-events: none;
}

/* Botão "Pular" — mostra resposta certa e avança sem ganhar pts nessa pergunta */
.qz-skip {
  align-self: center;
  margin-top: 4px;
  padding: 8px 20px;
  border: 1.5px solid rgba(45, 36, 56, 0.25);
  border-radius: 9999px;
  background: transparent;
  color: var(--sj-text-dim);
  font-family: var(--sj-font-display);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
  touch-action: manipulation;
}
@media (hover: hover) {
  .qz-skip:hover:not(:disabled) {
    background: rgba(45, 36, 56, 0.06);
    color: var(--sj-text);
    border-color: rgba(45, 36, 56, 0.4);
  }
}
.qz-skip:active:not(:disabled) { transform: scale(0.96); }
.qz-skip:disabled { opacity: 0.4; cursor: not-allowed; }
/* Hover só em dispositivos com mouse real — sem isso, mobile mantém o estado
   "hover" preso na última alternativa tocada (sticky hover), parecendo que
   ela está marcada/colorida sem motivo até o próximo tap em outro lugar. */
@media (hover: hover) {
  .qz-choice:hover:not(:disabled) {
    border-color: var(--sj-accent);
    background: var(--sj-accent-soft);
    transform: translateY(-1px);
  }
}
.qz-choice-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(45, 36, 56, 0.08);
  color: var(--sj-text-dim);
  font-family: var(--sj-font-mono);
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.qz-choice.is-right {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.12);
}
.qz-choice.is-right .qz-choice-letter { background: #22c55e; color: #fff; }
.qz-choice.is-wrong {
  border-color: var(--sj-danger);
  background: rgba(255, 51, 85, 0.12);
}
.qz-choice.is-wrong .qz-choice-letter { background: var(--sj-danger); color: #fff; }
.qz-choice:disabled { cursor: default; transform: none; }

/* ============ End screen ============ */
.qz-end {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 8px 16px 16px;
  text-align: center;
}
.qz-end-label {
  font-family: var(--sj-font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--sj-text-dim);
}
.qz-end-score {
  font-family: var(--sj-font-display);
  font-weight: 900;
  font-size: 64px;
  line-height: 1;
  color: var(--sj-accent);
}
.qz-end-band {
  font-family: var(--sj-font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--sj-text);
}
.qz-end-detail {
  font-family: var(--sj-font-mono);
  font-size: 13px;
  color: var(--sj-text-dim);
}

/* ============ Mobile ============ */
@media (max-width: 600px) {
  .qz { padding: 10px; gap: 8px; }
  .qz-stage { padding: 14px; gap: 10px; }
  .qz-prompt { font-size: 17px; }
  .qz-choices { grid-template-columns: 1fr; gap: 8px; }
  .qz-choice { padding: 10px 12px; font-size: 14px; min-height: 44px; }
  .qz-end-score { font-size: 52px; }
}

@media (max-width: 900px) and (orientation: landscape) {
  body:has(.sj-game-stage) .qz { padding: 6px; gap: 6px; }
  body:has(.sj-game-stage) .qz-stage { padding: 10px 14px; gap: 8px; }
  body:has(.sj-game-stage) .qz-prompt { font-size: 15px; }
  body:has(.sj-game-stage) .qz-choices { grid-template-columns: 1fr 1fr; gap: 6px; }
  body:has(.sj-game-stage) .qz-choice {
    padding: 7px 10px; font-size: 13px; min-height: 40px;
  }
}
