:root {
  --bg: #0f172a;
  --card: #1e293b;
  --card-border: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --green: #22c55e;
  --red: #ef4444;
  --yellow: #eab308;
  --input-bg: #0f172a;
}

html[data-theme="light"] {
  --bg: #f8fafc;
  --card: #ffffff;
  --card-border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --green: #16a34a;
  --red: #dc2626;
  --yellow: #ca8a04;
  --input-bg: #f1f5f9;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background-color 0.2s ease, color 0.2s ease;
  overflow-wrap: break-word;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--card-border);
  flex-wrap: wrap;
  gap: 10px;
}
.brand { color: var(--text); font-weight: 700; text-decoration: none; font-size: 1.1rem; }
.brand-group { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.nav-wallet {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  background: rgba(99,102,241,0.1);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}
.nav-wallet:hover { border-color: var(--primary); }
.nav-wallet-item { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.topbar nav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.topbar nav a { color: var(--muted); text-decoration: none; }
.topbar nav a:hover { color: var(--text); }

.nav-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  line-height: 1;
  text-decoration: none;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.nav-icon-link:hover { color: var(--text); }
.nav-icon-link.logout-btn:hover { color: var(--red); }

.theme-switcher { position: relative; }
.theme-toggle-btn {
  background: none; border: none; color: var(--muted);
  font-size: 1.15rem; cursor: pointer; padding: 0; line-height: 1;
}
.theme-toggle-btn:hover { color: var(--text); }
.theme-menu {
  position: absolute;
  top: 130%;
  right: 0;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 8px;
  min-width: 150px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  z-index: 20;
}
.theme-menu-title {
  font-size: 0.72rem;
  color: var(--muted);
  padding: 4px 8px 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.theme-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: none;
  border: none;
  color: var(--text);
  text-align: left;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
}
.theme-option:hover { background: rgba(148, 163, 184, 0.15); }
.theme-option.active { background: var(--primary); color: white; }

.presence-wrap { position: relative; }
.presence-pill {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  font-family: inherit;
}
.presence-pill:hover { color: var(--text); }
.presence-dropdown {
  position: absolute;
  top: 130%;
  right: 0;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 8px;
  min-width: 160px;
  max-height: 220px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  z-index: 20;
}
.presence-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  font-size: 0.85rem;
  color: var(--text);
  border-radius: 6px;
  white-space: nowrap;
}
.presence-item.presence-empty { color: var(--muted); }
.presence-avatar { flex-shrink: 0; }

.toast-stack {
  position: fixed;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 50;
  max-width: 320px;
}
.toast {
  background: var(--card);
  border: 1px solid var(--card-border);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  font-size: 0.9rem;
  opacity: 0;
  transform: translateX(16px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast-visible { opacity: 1; transform: translateX(0); }

.who-link { display: flex; align-items: center; text-decoration: none; }
.who-link:hover .avatar { outline: 2px solid var(--primary); }
.link-btn { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 0.95rem; padding: 0; }
.link-btn:hover { color: var(--red); }
.inline { display: inline; }

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--card-border);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 28px; height: 28px; }
.avatar-md { width: 40px; height: 40px; }
.avatar-lg { width: 88px; height: 88px; }

.avatar-frame-wrap { position: relative; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.avatar-frame-wrap .avatar { position: relative; z-index: 1; }
.avatar-frame-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
  pointer-events: none;
}
.avatar-frame-wrap-sm .avatar-frame-ring {
  inset: -3px;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
}
.avatar-frame-wrap-lg .avatar-frame-ring {
  inset: -7px;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 5px));
}
.avatar-frame-charm {
  position: absolute;
  top: -4px;
  right: -4px;
  font-size: 0.85rem;
  line-height: 1;
  filter: drop-shadow(0 0 2px rgba(0,0,0,0.7));
  z-index: 2;
}
.avatar-frame-charm-sm { font-size: 0.65rem; top: -3px; right: -3px; }
.avatar-frame-charm-lg { font-size: 1.7rem; top: -8px; right: -8px; }

.avatar-frame-img {
  position: absolute;
  inset: -9%;
  width: 118%;
  height: 118%;
  max-width: none;
  object-fit: contain;
  pointer-events: none;
  z-index: 2;
}

/* comum */
.avatar-frame-bronze {
  background: conic-gradient(from 0deg, #78350f, #b45309, #92400e, #b45309, #78350f);
  box-shadow: 0 0 8px rgba(180,83,9,0.5);
}
/* raro */
.avatar-frame-prata {
  background: conic-gradient(from 0deg, #94a3b8, #f8fafc, #cbd5e1, #f8fafc, #94a3b8);
  box-shadow: 0 0 10px rgba(203,213,225,0.55);
}
/* epico */
.avatar-frame-ouro {
  background: conic-gradient(from 0deg, #a16207, #fde047, #eab308, #fde047, #a16207);
  box-shadow: 0 0 12px rgba(234,179,8,0.6);
  animation: avatar-frame-spin 10s linear infinite;
}
.avatar-frame-gelo {
  background: conic-gradient(from 0deg, #0e7490, #ecfeff, #67e8f9, #cffafe, #0e7490);
  box-shadow: 0 0 12px rgba(103,232,249,0.6);
  animation: avatar-frame-spin 9s linear infinite reverse;
}
/* lendario */
.avatar-frame-diamante {
  background: conic-gradient(from 0deg, #0369a1, #ffffff, #38bdf8, #e0f2fe, #0369a1);
  box-shadow: 0 0 16px rgba(56,189,248,0.75);
  animation: avatar-frame-spin 5s linear infinite, avatar-frame-glow-pulse 2s ease-in-out infinite;
}
.avatar-frame-fogo {
  background: conic-gradient(from 0deg, #7c2d12, #f97316, #fde047, #f97316, #7c2d12);
  box-shadow: 0 0 16px rgba(249,115,22,0.75);
  animation: avatar-frame-spin 3s linear infinite, avatar-frame-glow-pulse 1.2s ease-in-out infinite;
}
@keyframes avatar-frame-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes avatar-frame-glow-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.4); }
}

.rarity-badge { padding: 2px 8px; border-radius: 999px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.rarity-comum { background: rgba(148,163,184,0.15); color: var(--muted); }
.rarity-raro { background: rgba(59,130,246,0.15); color: #3b82f6; }
.rarity-epico { background: rgba(168,85,247,0.15); color: #a855f7; }
.rarity-lendario { background: linear-gradient(90deg, rgba(249,115,22,0.2), rgba(234,179,8,0.2)); color: #f97316; }

.perfil-current { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.perfil-name { font-weight: 700; font-size: 1.05rem; }
.perfil-name-form { display: flex; gap: 8px; margin-bottom: 4px; }
.perfil-name-form input {
  font-weight: 700;
  font-size: 1.05rem;
  padding: 4px 8px;
  border: 1px solid var(--card-border);
  border-radius: 6px;
  background: var(--input-bg);
  color: var(--text);
  max-width: 220px;
}
.avatar-preset-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.avatar-preset-form { margin: 0; }
.avatar-preset-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.avatar-preset-btn.selected { border-color: var(--primary); }
.avatar-upload-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.avatar-upload-form input[type="file"] { color: var(--text); font-size: 0.85rem; }

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.container-wide { max-width: 1100px; }

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 20px;
}
.card h3 { margin-top: 0; }

.section-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.section-head h3 { margin: 0; }
.btn-secondary {
  background: none; border: 1px solid var(--card-border); color: var(--text);
  padding: 8px 14px; border-radius: 8px; font-weight: 600; cursor: pointer; font-size: 0.85rem;
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }

.period-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.period-card {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  border-radius: 12px;
  padding: 16px 10px;
  text-align: center;
}
.period-medal { font-size: 1.8rem; line-height: 1; }
.period-points { font-size: 1.3rem; font-weight: 700; margin-top: 4px; }
.period-label { font-size: 0.85rem; opacity: 0.9; margin-top: 2px; }
.period-rank { font-size: 0.78rem; margin-top: 4px; opacity: 0.85; }
@media (max-width: 480px) {
  .period-cards { grid-template-columns: 1fr; }
}

.tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}
.tab.active { background: var(--primary); color: white; border-color: var(--primary); }

.month-filter { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.month-filter-field { display: flex; align-items: center; gap: 6px; }
.month-filter label { display: inline-block; margin: 0; font-size: 0.85rem; white-space: nowrap; }
.month-filter select,
.month-filter input[type="date"] {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: var(--input-bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
}
.month-filter .btn-secondary { margin: 0; }

.muted { color: var(--muted); }

textarea, input[type="text"], input[type="email"], input[type="password"], input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: var(--input-bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
}
.field-select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: var(--input-bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
}
label { display: block; margin: 12px 0 6px; font-size: 0.9rem; color: var(--muted); }
.hint { font-size: 0.8rem; }

.btn-primary {
  margin-top: 16px;
  background: var(--primary);
  color: white;
  border: none;
  padding: 11px 18px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary:disabled:hover { background: var(--primary); }

.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.auth-card { background: var(--card); border: 1px solid var(--card-border); border-radius: 14px; padding: 32px; width: 100%; max-width: 380px; }
.auth-card h1 { margin: 0 0 4px; font-size: 1.3rem; }
.subtitle { color: var(--muted); margin: 0 0 10px; }
.alt-link { text-align: center; margin-top: 16px; color: var(--muted); }
.alt-link a { color: var(--primary); }
.error { color: var(--red); background: rgba(239,68,68,0.1); padding: 8px 12px; border-radius: 8px; }
.success { color: var(--green); background: rgba(34,197,94,0.1); padding: 8px 12px; border-radius: 8px; }

.submission-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.submission { position: relative; border: 1px solid var(--card-border); border-radius: 10px; padding: 12px 34px 12px 14px; }
.cancel-x-form { position: absolute; top: 8px; right: 8px; margin: 0; }
.cancel-x-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.cancel-x-btn:hover { color: white; background: var(--red); }
.submission-client { font-size: 0.85rem; color: var(--muted); margin-bottom: 4px; }
.submission-desc { margin-bottom: 6px; }
.submission-meta { display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; }
.date { color: var(--muted); }
.badge { padding: 3px 9px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; }
.badge-pendente { background: rgba(234,179,8,0.15); color: var(--yellow); }
.badge-aprovado { background: rgba(34,197,94,0.15); color: var(--green); }
.badge-rejeitado { background: rgba(239,68,68,0.15); color: var(--red); }
.badge-refazer { background: rgba(249,115,22,0.15); color: #f97316; }
.badge-cancelado { background: rgba(148,163,184,0.15); color: var(--muted); }
.badge-disponivel { background: rgba(99,102,241,0.15); color: var(--primary); }
.review-note { margin-top: 6px; font-size: 0.85rem; color: var(--muted); }

.review-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.review-actions form { display: flex; gap: 6px; align-items: center; }
.note-input { width: 160px; }
.points-input { width: 64px; text-align: center; }
.btn-approve, .btn-reject, .btn-rework {
  border: none; padding: 8px 14px; border-radius: 8px; font-weight: 600; cursor: pointer; color: white;
}
.btn-approve { background: var(--green); }
.btn-reject { background: var(--red); }
.btn-rework { background: #f97316; }

.ranking-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.ranking-row {
  display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap;
  border: 1px solid var(--card-border); border-radius: 10px; padding: 10px 14px;
}
.ranking-row.me { border-color: var(--primary); background: rgba(99,102,241,0.08); }
.pos { color: var(--muted); width: 32px; }
.rank-emoji { font-size: 1.3rem; }
.rank-name { flex: 1; font-weight: 600; }
.rank-points { font-weight: 700; }

.level-tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  background: rgba(99,102,241,0.12);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.level-card { display: flex; flex-direction: column; gap: 10px; }
.level-card-compact { padding: 16px 20px; }
.level-card-top { display: flex; align-items: center; gap: 14px; }
.level-card h3 { margin: 0 0 2px; }
.level-badge {
  flex-shrink: 0;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 8px 14px;
  border-radius: 10px;
  white-space: nowrap;
}
.level-card-compact .level-card-top { gap: 12px; }
.level-card-compact .level-progress-track { flex: 1; margin: 0; }
.level-progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  overflow: hidden;
}
.level-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #7c3aed);
  border-radius: 999px;
  transition: width 0.3s ease;
}
.level-progress-label { margin: 0; font-size: 0.82rem; }

.section-sub { margin-top: 22px; font-size: 1rem; }

.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}
.badge-item {
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
  background: rgba(99,102,241,0.06);
}
.badge-item.locked { opacity: 0.5; background: none; }
.badge-emoji { font-size: 1.8rem; line-height: 1; margin-bottom: 6px; }
.badge-label { font-weight: 600; font-size: 0.85rem; }
.badge-info { font-size: 0.78rem; color: var(--primary); font-weight: 700; margin-top: 2px; }
.badge-desc { font-size: 0.72rem; margin-top: 4px; }

.reward-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.reward-card {
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 14px;
  background: rgba(99,102,241,0.06);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.reward-preview { display: flex; justify-content: center; margin-bottom: 2px; }
.reward-cost { font-weight: 700; color: var(--primary); }
.reward-title { font-weight: 600; }
.reward-desc { font-size: 0.82rem; }
.reward-card form { margin-top: auto; }
.reward-use-form { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.reward-use-form input { flex: 1; min-width: 180px; }
.reward-kind-choice { display: flex; flex-direction: column; gap: 6px; font-weight: 400; font-size: 0.9rem; }
.reward-kind-choice label { display: flex; align-items: center; gap: 6px; }
.frame-choice-list { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; align-items: flex-start; }
.frame-choice-list button:disabled { opacity: 0.6; cursor: default; border-color: var(--primary); color: var(--primary); }
.frame-owned-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 14px 12px;
  min-width: 120px;
  background: rgba(99,102,241,0.06);
}
.frame-owned-label { font-weight: 600; font-size: 0.85rem; text-align: center; }

.activity-feed { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.activity-item {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--card-border); padding-bottom: 8px; font-size: 0.9rem;
}
.activity-item:last-child { border-bottom: none; padding-bottom: 0; }
.activity-who { display: flex; align-items: center; gap: 8px; }

.kb-search { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.kb-search input[type="text"] { flex: 1; min-width: 180px; }
.kb-search select {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: var(--input-bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
}
.kb-search .btn-secondary { white-space: nowrap; }

.kb-group { margin-bottom: 22px; }
.kb-group:last-child { margin-bottom: 0; }
.kb-category {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0 0 10px;
}
.kb-list { display: flex; flex-direction: column; gap: 10px; }
.kb-item {
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 12px 14px;
}
.kb-item summary {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  list-style: none;
}
.kb-item summary::-webkit-details-marker { display: none; }
.kb-title { font-weight: 600; }
.kb-meta { font-size: 0.78rem; white-space: nowrap; }
.kb-content { margin-top: 10px; white-space: pre-wrap; line-height: 1.5; }
.kb-actions { display: flex; gap: 8px; margin-top: 12px; }

.typing-result-banner p { margin: 0; font-size: 1.05rem; }
.typing-result-banner.typing-result-prova { border-color: var(--primary); background: rgba(99, 102, 241, 0.08); }

.typing-header-actions { display: flex; align-items: center; gap: 8px; }
.typing-header-actions .btn-primary { margin-top: 0; }
.typing-mode-note { margin: -4px 0 14px; }

.typing-stats { display: flex; gap: 28px; margin-bottom: 16px; }
.typing-stat { display: flex; flex-direction: column; align-items: center; }
.typing-stat span { font-size: 1.4rem; font-weight: 700; color: var(--text); }
.typing-stat label { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }

.typing-text {
  font-family: 'Courier New', monospace;
  font-size: 1.1rem;
  line-height: 1.8;
  white-space: pre-wrap;
  padding: 16px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: var(--input-bg);
  margin-bottom: 14px;
}
.typing-char { color: var(--muted); }
.typing-char.correct { color: var(--text); }
.typing-char.incorrect { color: var(--red); background: rgba(239, 68, 68, 0.15); border-radius: 2px; }
.typing-char.current { outline: 2px solid var(--primary); border-radius: 2px; }

.typing-input-row input#typing-input {
  font-family: 'Courier New', monospace;
  font-size: 1rem;
}

.typing-history { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 6px; }
.typing-history li { display: flex; justify-content: space-between; border-bottom: 1px solid var(--card-border); padding-bottom: 6px; font-size: 0.9rem; }
.typing-history li:last-child { border-bottom: none; padding-bottom: 0; }

.quiz-admin-bar { display: flex; justify-content: flex-end; margin-bottom: 16px; }

.difficulty-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
}
.difficulty-badge.difficulty-facil { color: var(--green); background: rgba(34, 197, 94, 0.14); }
.difficulty-badge.difficulty-medio { color: #f59e0b; background: rgba(245, 158, 11, 0.14); }
.difficulty-badge.difficulty-dificil { color: var(--red); background: rgba(239, 68, 68, 0.14); }

.quiz-question { margin: 14px 0; }
.quiz-question-text { font-size: 1.1rem; font-weight: 600; margin: 10px 0 0; }

.quiz-options { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.quiz-option {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: var(--input-bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}
button.quiz-option:hover { border-color: var(--primary); }
.quiz-option-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--card-border);
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}
.quiz-option-review { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; }
.quiz-option-review-correct { color: var(--green); font-weight: 600; }

.quiz-option-input { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.quiz-option-input-label { display: inline-block; margin: 0; width: 20px; text-align: center; font-weight: 700; color: var(--text); }
.quiz-option-input input[type="text"] { flex: 1; }
.quiz-option-input input[type="radio"] { width: auto; }

.broadcast-video-wrap { position: relative; margin-bottom: 12px; }
.broadcast-video {
  width: 100%;
  max-height: 80vh;
  min-height: 320px;
  border-radius: 12px;
  background: #000;
  display: block;
}
.broadcast-fullscreen-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: rgba(15, 23, 42, 0.65);
  color: white;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.broadcast-fullscreen-btn:hover { background: rgba(15, 23, 42, 0.85); }
.broadcast-viewer-count { font-size: 0.85rem; color: var(--muted); margin: 0 0 12px; }
.broadcast-hint { margin-top: 16px; font-size: 0.8rem; }

@media (max-width: 600px) {
  .container { padding: 14px; gap: 14px; }
  .topbar { padding: 12px 14px; }
  .topbar nav { gap: 12px; }
  .card { padding: 16px; }

  .note-input { width: auto; flex: 1; min-width: 0; }
  .points-input { width: 56px; }
  .review-actions form { flex-wrap: wrap; }

  .auth-card { padding: 22px; }

  .typing-stats { gap: 18px; }
  .perfil-current { gap: 12px; }

  .level-card-compact { padding: 14px; }

  .month-filter { flex-direction: column; align-items: stretch; }
  .month-filter-field { width: 100%; }
  .month-filter-field select,
  .month-filter-field input[type="date"] { flex: 1; min-width: 0; }
  .month-filter > .btn-secondary { width: 100%; }
}

