/* ═══════════════════════════════════════════════════════════
   enem.css — Modo ENEM styles
   Depende de style.css (variáveis CSS base)
   ═══════════════════════════════════════════════════════════ */

/* ── Area color variables ──────────────────────────────────── */
:root {
  --enem-linguagens: #FF6B9D;
  --enem-humanas:    #4ECDC4;
  --enem-natureza:   #45B7D1;
  --enem-matematica: #FFA726;
  --enem-misto:      #7B61FF;
}

/* ── Hero ENEM ─────────────────────────────────────────────── */
.enem-hero {
  text-align: center;
  padding: 3.5rem 1rem 2rem;
}

.enem-hero-badge {
  display: inline-block;
  background: linear-gradient(135deg, #7B61FF, #3A1B9E);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: .35rem .9rem;
  border-radius: 999px;
  margin-bottom: 1.2rem;
}

.enem-hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  margin: 0 0 .6rem;
  background: linear-gradient(135deg, #7B61FF, #FF6B9D);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.enem-hero p {
  color: var(--text-secondary, #aaa);
  font-size: 1.05rem;
  max-width: 520px;
  margin: 0 auto 2rem;
}

/* ── Mode cards ────────────────────────────────────────────── */
.enem-modes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.2rem;
  max-width: 900px;
  margin: 0 auto 3rem;
}

.enem-mode-card {
  background: var(--card-bg, rgba(255,255,255,.05));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  padding: 1.8rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.enem-mode-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(123,97,255,.25);
  border-color: #7B61FF;
}

.enem-mode-card .mode-icon {
  font-size: 2.8rem;
  margin-bottom: .7rem;
}

.enem-mode-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 .4rem;
}

.enem-mode-card p {
  font-size: .85rem;
  color: var(--text-secondary, #aaa);
  margin: 0;
}

/* ── Area grid ─────────────────────────────────────────────── */
.enem-areas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  max-width: 900px;
  margin: 0 auto 2.5rem;
}

.enem-area-card {
  border-radius: 16px;
  padding: 1.4rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
  text-decoration: none;
  color: #fff;
  display: block;
  position: relative;
  overflow: hidden;
}

.enem-area-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.15);
  opacity: 0;
  transition: opacity .2s;
}

.enem-area-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(0,0,0,.35);
}

.enem-area-card:hover::before { opacity: 1; }

.enem-area-card .area-icon {
  font-size: 2.4rem;
  display: block;
  margin-bottom: .5rem;
  position: relative;
}

.enem-area-card h4 {
  font-size: .95rem;
  font-weight: 700;
  margin: 0 0 .3rem;
  position: relative;
}

.enem-area-card small {
  font-size: .75rem;
  opacity: .85;
  position: relative;
}

/* ── Setup form ────────────────────────────────────────────── */
.enem-setup-card {
  max-width: 580px;
  margin: 2rem auto;
  background: var(--card-bg, rgba(255,255,255,.05));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 20px;
  padding: 2.2rem;
}

.enem-setup-card h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 1.6rem;
  text-align: center;
}

.setup-group {
  margin-bottom: 1.4rem;
}

.setup-group label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-secondary, #aaa);
  margin-bottom: .5rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.setup-options {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
}

.setup-options input[type=radio] { display: none; }

.setup-options label {
  background: rgba(255,255,255,.06);
  border: 2px solid rgba(255,255,255,.1);
  border-radius: 10px;
  padding: .55rem 1rem;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 600;
  transition: background .15s, border-color .15s;
  text-transform: none;
  letter-spacing: 0;
  color: inherit;
}

.setup-options input[type=radio]:checked + label {
  background: rgba(123,97,255,.25);
  border-color: #7B61FF;
  color: #a78bfa;
}

/* ── Play page ─────────────────────────────────────────────── */
.enem-play-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.enem-progress-bar {
  height: 6px;
  background: rgba(255,255,255,.1);
  border-radius: 999px;
  margin-bottom: 1.4rem;
  overflow: hidden;
}

.enem-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #7B61FF, #FF6B9D);
  border-radius: 999px;
  transition: width .4s ease;
}

.enem-q-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: .85rem;
  color: var(--text-secondary, #aaa);
}

.enem-timer {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  padding: .3rem .8rem;
  background: rgba(255,255,255,.08);
  border-radius: 8px;
  min-width: 3rem;
  text-align: center;
  transition: color .3s;
}

.enem-timer.urgent { color: #ff5757; }

.enem-q-card {
  background: var(--card-bg, rgba(255,255,255,.05));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  padding: 1.8rem;
  margin-bottom: 1.4rem;
}

.enem-q-topic {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-secondary, #aaa);
  margin-bottom: .9rem;
}

.enem-q-text {
  font-size: 1rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

.enem-options {
  display: flex;
  flex-direction: column;
  gap: .7rem;
}

.enem-option-btn {
  display: flex;
  align-items: flex-start;
  gap: .8rem;
  background: rgba(255,255,255,.05);
  border: 2px solid rgba(255,255,255,.1);
  border-radius: 12px;
  padding: .9rem 1.1rem;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font-size: .95rem;
  line-height: 1.5;
  transition: background .15s, border-color .15s, transform .1s;
  width: 100%;
  /* Equalise height so longer options don't betray correct answer */
  min-height: 4.5rem;
}

/* Clamp option text to a fixed number of lines — hides length bias */
.enem-option-btn .enem-option-text {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
  min-height: 4.5em;
}

.enem-option-btn:hover:not(:disabled) {
  background: rgba(123,97,255,.12);
  border-color: #7B61FF;
  transform: translateX(3px);
}

.enem-option-btn:disabled { cursor: not-allowed; opacity: .7; }

.enem-option-btn.correct {
  background: rgba(46,213,115,.15);
  border-color: #2ed573;
}

.enem-option-btn.wrong {
  background: rgba(255,87,87,.15);
  border-color: #ff5757;
}

.enem-option-btn.selected-correct {
  background: rgba(46,213,115,.25);
  border-color: #2ed573;
}

.enem-option-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  min-width: 1.8rem;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  font-weight: 800;
  font-size: .85rem;
  text-transform: uppercase;
}

.enem-option-btn.correct   .enem-option-badge { background: #2ed573; color: #000; }
.enem-option-btn.wrong     .enem-option-badge { background: #ff5757; color: #fff; }
.enem-option-btn.selected-correct .enem-option-badge { background: #2ed573; color: #000; }

/* ── Feedback box ──────────────────────────────────────────── */
.enem-feedback {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
  padding: 1.1rem 1.4rem;
  margin-top: 1rem;
  display: none;
  animation: fadeInUp .25s ease;
}

.enem-feedback.show { display: block; }
.enem-feedback.correct-fb { border-color: #2ed573; }
.enem-feedback.wrong-fb   { border-color: #ff5757; }

/* "Next question" skip button shown after answering */
.enem-skip-btn {
  display: none;
  margin-top: .85rem;
  background: rgba(123,97,255,.18);
  border: 1px solid #7B61FF;
  color: #c4b8ff;
  border-radius: 10px;
  padding: .55rem 1.2rem;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  float: right;
}
.enem-skip-btn:hover { background: rgba(123,97,255,.35); }
.enem-skip-btn.visible { display: inline-block; }

.enem-feedback-title {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: .4rem;
}

.enem-feedback-title.ok  { color: #2ed573; }
.enem-feedback-title.bad { color: #ff5757; }

.enem-explanation {
  font-size: .88rem;
  color: var(--text-secondary, #aaa);
  line-height: 1.6;
}

/* ── Loading spinner ───────────────────────────────────────── */
.enem-loading {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-secondary, #aaa);
}

.enem-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(255,255,255,.1);
  border-top-color: #7B61FF;
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Resultado ─────────────────────────────────────────────── */
.enem-result-hero {
  text-align: center;
  padding: 2.5rem 1rem 1.5rem;
}

.enem-score-circle {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  border: 5px solid;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.2rem;
  font-weight: 800;
}

.enem-score-circle .score-pct {
  font-size: 2.2rem;
  line-height: 1;
}

.enem-score-circle .score-label {
  font-size: .7rem;
  opacity: .7;
  margin-top: .15rem;
}

.enem-stats-row {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.enem-stat-box {
  background: var(--card-bg, rgba(255,255,255,.05));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  padding: 1rem 1.6rem;
  text-align: center;
  min-width: 100px;
}

.enem-stat-box .stat-val {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
}

.enem-stat-box .stat-lbl {
  font-size: .75rem;
  color: var(--text-secondary, #aaa);
  margin-top: .25rem;
}

.enem-topic-list {
  max-width: 640px;
  margin: 0 auto 2rem;
}

.enem-topic-row {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .65rem 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
  font-size: .9rem;
}

.enem-topic-bar-wrap {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,.1);
  border-radius: 999px;
  overflow: hidden;
}

.enem-topic-bar-fill {
  height: 100%;
  border-radius: 999px;
}

.enem-q-review {
  max-width: 760px;
  margin: 0 auto;
}

.enem-review-item {
  background: var(--card-bg, rgba(255,255,255,.05));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  margin-bottom: .8rem;
  overflow: hidden;
}

.enem-review-header {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: .9rem 1.2rem;
  cursor: pointer;
  user-select: none;
}

.enem-review-header:hover { background: rgba(255,255,255,.03); }

.enem-review-body {
  padding: 0 1.2rem 1rem;
  display: none;
  font-size: .88rem;
  line-height: 1.6;
  color: var(--text-secondary, #aaa);
}

.enem-review-body.open { display: block; }

/* ── Lobby ─────────────────────────────────────────────────── */
.enem-lobby-card {
  max-width: 680px;
  margin: 2rem auto;
  background: var(--card-bg, rgba(255,255,255,.05));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 20px;
  padding: 2rem;
}

.enem-player-list {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  margin: 1.2rem 0;
}

.enem-player-row {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .6rem .8rem;
  background: rgba(255,255,255,.04);
  border-radius: 10px;
  font-size: .9rem;
}

.enem-player-row img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

/* ── Multiplayer play ──────────────────────────────────────── */
.enem-sala-wrap {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 1.4rem;
  max-width: 1000px;
  margin: 1.5rem auto;
  padding: 0 1rem 3rem;
  align-items: start;
}

@media (max-width: 720px) {
  .enem-sala-wrap {
    grid-template-columns: 1fr;
  }
  .enem-sala-scoreboard {
    order: -1;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
  }
}

.enem-sala-scoreboard {
  background: var(--card-bg, rgba(255,255,255,.05));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  padding: 1.1rem;
  position: sticky;
  top: 80px;
}

.enem-sala-scoreboard h3 {
  font-size: .85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-secondary, #aaa);
  margin: 0 0 .8rem;
}

.enem-score-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .45rem 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
  font-size: .85rem;
}

.enem-score-row:last-child { border: none; }

.enem-score-row img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.enem-score-row .pts {
  margin-left: auto;
  font-weight: 700;
  color: #a78bfa;
}

/* ── Ranking resultado sala ────────────────────────────────── */
.enem-ranking {
  max-width: 600px;
  margin: 0 auto;
}

.enem-rank-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .9rem 1.2rem;
  background: var(--card-bg, rgba(255,255,255,.05));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  margin-bottom: .7rem;
}

.enem-rank-num {
  font-size: 1.3rem;
  font-weight: 800;
  width: 1.8rem;
  text-align: center;
}

.enem-rank-row img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.enem-rank-name { flex: 1; font-weight: 600; }

.enem-rank-score {
  font-size: 1.1rem;
  font-weight: 800;
  color: #a78bfa;
}

.enem-rank-row.first { border-color: #FFD700; background: rgba(255,215,0,.08); }
.enem-rank-row.second { border-color: #C0C0C0; background: rgba(192,192,192,.06); }
.enem-rank-row.third  { border-color: #CD7F32; background: rgba(205,127,50,.06); }

/* ── Share link ────────────────────────────────────────────── */
.enem-share-box {
  display: flex;
  gap: .5rem;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  padding: .5rem .8rem;
  margin: 1rem 0;
  font-size: .85rem;
  align-items: center;
}

.enem-share-box span {
  flex: 1;
  word-break: break-all;
  color: var(--text-secondary, #aaa);
}

.btn-enem {
  background: linear-gradient(135deg, #7B61FF, #3A1B9E);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: .75rem 1.8rem;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: transform .15s, box-shadow .15s;
}

.btn-enem:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(123,97,255,.45);
  color: #fff;
}

.btn-enem-outline {
  background: transparent;
  border: 2px solid #7B61FF;
  color: #a78bfa;
  border-radius: 12px;
  padding: .7rem 1.6rem;
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background .15s, color .15s;
}

.btn-enem-outline:hover {
  background: rgba(123,97,255,.15);
  color: #fff;
}

/* ── Waiting overlay (sala) ────────────────────────────────── */
.enem-waiting {
  text-align: center;
  padding: 4rem 1rem;
}

.enem-waiting-dots span {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: #7B61FF;
  border-radius: 50%;
  margin: 0 3px;
  animation: bounce 1.2s infinite;
}

.enem-waiting-dots span:nth-child(2) { animation-delay: .15s; }
.enem-waiting-dots span:nth-child(3) { animation-delay: .3s;  }

@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40%            { transform: translateY(-10px); }
}

/* ── Section title ─────────────────────────────────────────── */
.enem-section-title {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-secondary, #aaa);
  margin: 2rem 0 1rem;
  text-align: center;
}

/* ── Join by code ───────────────────────────────────────────── */
.enem-join-box {
  max-width: 680px;
  margin: 0 auto 2.5rem;
  padding: 1.25rem;
  border-radius: 18px;
  background: var(--card-bg, rgba(255,255,255,.05));
  border: 1px solid rgba(255,255,255,.08);
  text-align: center;
}

.enem-join-form {
  display: flex;
  gap: .75rem;
  justify-content: center;
}

.enem-join-input {
  flex: 1;
  min-width: 0;
  padding: .8rem 1rem;
  border-radius: 12px;
  border: 2px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.06);
  color: #fff;
  font-size: .95rem;
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  outline: none;
  transition: border-color .2s;
}

.enem-join-input::placeholder {
  text-transform: none;
  letter-spacing: 0;
  color: rgba(255,255,255,.35);
  font-size: .85rem;
}

.enem-join-input:focus {
  border-color: #7B61FF;
  background: rgba(123,97,255,.08);
}

.enem-join-submit {
  min-height: 45px;
  box-shadow: 0 4px 20px rgba(123,97,255,.35);
}
