/* ── Avatar da professora ── */
.professor-badge {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.professor-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, var(--primary, #00f5d4), var(--secondary, #7c3aed));
  box-shadow:
    0 0 12px rgba(0, 245, 212, 0.7),
    0 0 28px rgba(0, 245, 212, 0.4),
    0 0 52px rgba(124, 58, 237, 0.35);
  animation: neonPulse 2.8s ease-in-out infinite;
}

.professor-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: #0b1020;
}

.professor-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary, #00f5d4);
  text-shadow: 0 0 8px rgba(0, 245, 212, 0.8);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

@keyframes neonPulse {
  0%, 100% {
    box-shadow:
      0 0 10px rgba(0, 245, 212, 0.6),
      0 0 24px rgba(0, 245, 212, 0.35),
      0 0 48px rgba(124, 58, 237, 0.3);
  }
  50% {
    box-shadow:
      0 0 16px rgba(0, 245, 212, 0.95),
      0 0 36px rgba(0, 245, 212, 0.6),
      0 0 70px rgba(124, 58, 237, 0.55);
  }
}

@media (max-width: 700px) {
  .professor-avatar {
    width: 60px;
    height: 60px;
  }
  .professor-name {
    font-size: 0.72rem;
  }
}
/* ─────────────────────────── */

:root {
  --bg: #0b1020;
  --bg-soft: #11182d;
  --panel: rgba(12, 18, 38, 0.88);
  --panel-strong: rgba(10, 15, 32, 0.96);
  --text: #e6f1ff;
  --muted: #97a6c5;
  --primary: #00f5d4;
  --secondary: #7c3aed;
  --accent: #38bdf8;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --border: rgba(124, 58, 237, 0.28);
  --shadow: 0 0 18px rgba(0, 245, 212, 0.08), 0 0 28px rgba(124, 58, 237, 0.1);
  --radius: 22px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: Inter, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(circle at top, #10182f 0%, #090d18 50%, #05070f 100%);
  color: var(--text);
  overflow-x: hidden;
  overflow-y: auto;
}

canvas#bgCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.9;
}

.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
}

.screen {
  width: 100%;
  max-width: 1020px;
  max-height: calc(100vh - 48px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  overflow-y: auto;
  overflow-x: hidden;
  display: none;
}

.screen.active {
  display: block;
  animation: fadeIn 0.45s ease;
}

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

.hero {
  padding: 42px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(0, 245, 212, 0.08));
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(0, 245, 212, 0.1);
  border: 1px solid rgba(0, 245, 212, 0.18);
  color: var(--primary);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.1;
  margin-bottom: 12px;
  letter-spacing: 0.02em;
  text-shadow: 0 0 14px rgba(0, 245, 212, 0.14);
}

.subtitle {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
  max-width: 760px;
}

.content {
  padding: 32px 42px 42px;
}

.grid {
  display: grid;
  gap: 22px;
}

.input-group label {
  display: block;
  margin-bottom: 10px;
  color: var(--text);
  font-weight: 600;
}

.input-group input {
  width: 100%;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.85);
  color: var(--text);
  outline: none;
  font-size: 1rem;
  transition: 0.25s ease;
}

.input-group input:focus {
  border-color: rgba(0, 245, 212, 0.55);
  box-shadow: 0 0 0 3px rgba(0, 245, 212, 0.12);
}

.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  padding: 15px 20px;
  border-radius: 16px;
  font-weight: 700;
  font-size: 1rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

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

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  color: #041019;
  box-shadow: 0 10px 28px rgba(124, 58, 237, 0.25);
  width: fit-content;
  justify-self: center;
}

.btn-secondary {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.small-note {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.quiz-header {
  display: grid;
  gap: 18px;
  padding: 26px 30px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(9, 13, 24, 0.8);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.student-name {
  color: var(--primary);
  font-weight: 700;
}

.counter {
  color: var(--muted);
  font-weight: 600;
}

.progress-wrap {
  display: grid;
  gap: 8px;
}

.progress-bar {
  width: 100%;
  height: 14px;
  background: rgba(148, 163, 184, 0.12);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--secondary), var(--primary));
  box-shadow: 0 0 16px rgba(0, 245, 212, 0.35);
  transition: width 0.35s ease;
}

.progress-text {
  color: var(--muted);
  font-size: 0.95rem;
}

.quiz-body {
  padding: 28px 30px 30px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.quiz-body .question-card {
  flex: 1;
  min-width: 0;
}

.question-card {
  background: var(--panel-strong);
  border: 1px solid rgba(56, 189, 248, 0.12);
  border-radius: 22px;
  padding: 28px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.question-tag {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--accent);
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.16);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.85rem;
  font-weight: 700;
}

.question-text {
  font-size: clamp(1.03rem, 2vw, 1.2rem);
  line-height: 1.8;
  margin-bottom: 22px;
  white-space: pre-line;
}

.options {
  display: grid;
  gap: 14px;
}

.option {
  width: 100%;
  text-align: left;
  background: rgba(15, 23, 42, 0.92);
  color: var(--text);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  padding: 16px 18px;
  cursor: pointer;
  transition: 0.22s ease;
  font-size: 0.98rem;
  line-height: 1.6;
}

.option:hover:not(.locked) {
  border-color: rgba(0, 245, 212, 0.35);
  transform: translateY(-1px);
}

.option.correct {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.14);
}

.option.incorrect {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.14);
}

.option.locked {
  cursor: default;
}

.feedback {
  margin-top: 22px;
  padding: 18px 20px;
  border-radius: 16px;
  line-height: 1.75;
  display: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.feedback.show {
  display: block;
  animation: fadeIn 0.3s ease;
}

.feedback.correct {
  background: rgba(34, 197, 94, 0.12);
  color: #d7ffe3;
  border-color: rgba(34, 197, 94, 0.28);
}

.feedback.incorrect {
  background: rgba(239, 68, 68, 0.12);
  color: #ffe1e1;
  border-color: rgba(239, 68, 68, 0.24);
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
  width: 130px;
  position: sticky;
  top: 28px;
}

.center-actions {
  justify-content: center;
}

.results {
  text-align: center;
}

.score-circle {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  margin: 10px auto 24px;
  display: grid;
  place-items: center;
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  background: radial-gradient(circle, rgba(0, 245, 212, 0.12), rgba(124, 58, 237, 0.12));
  border: 1px solid rgba(0, 245, 212, 0.22);
  box-shadow: 0 0 30px rgba(0, 245, 212, 0.12);
}

.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 28px;
  text-align: left;
}

.summary-card {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 18px;
  padding: 18px;
}

.summary-card h3 {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 8px;
  font-weight: 600;
}

.summary-card p {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
}

.result-message {
  color: var(--muted);
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.7;
}

.capture-note {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.93rem;
  text-align: center;
}

.result-actions-wrap {
  padding-top: 0;
}

.result-visual-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 180px;
  margin: 8px 0 18px;
}

.result-floating-image {
  width: min(220px, 52vw);
  max-width: 220px;
  display: none;
  position: relative;
  z-index: 3;
  filter: drop-shadow(0 0 22px rgba(0, 245, 212, 0.28));
  animation: floatResult 3.8s ease-in-out infinite;
}

.result-floating-image.show {
  display: block;
}

.confetti-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 2;
}

.confetti-piece {
  position: absolute;
  top: -18px;
  width: 10px;
  height: 18px;
  border-radius: 4px;
  opacity: 0.92;
  animation: confettiFall linear forwards;
}

.confetti-piece.alt {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

@keyframes confettiFall {
  0% {
    transform: translateY(-20px) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  100% {
    transform: translateY(320px) rotate(540deg);
    opacity: 0;
  }
}

@keyframes floatResult {
  0%,
  100% {
    transform: translateY(0px) scale(1);
  }
  50% {
    transform: translateY(-10px) scale(1.02);
  }
}

@media (max-width: 700px) {
  html, body {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .app {
    align-items: flex-start;
    padding: 12px;
  }

  .hero,
  .content,
  .quiz-body,
  .quiz-header {
    padding-left: 18px;
    padding-right: 18px;
  }

  .question-card {
    padding: 18px;
  }

  .quiz-body {
    flex-direction: column;
  }

  .actions {
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
    position: static;
  }
}
