/* ============================================================
   Novo front (3 temas) — escolhido em Admin > Aparência.
   Sem classe tema-N no <body>, o visual original continua igual.
   ============================================================ */

body.tema-1 { --bg: 220 30% 4%; --card: 220 22% 7%; --secondary: 220 16% 13%; --muted: 220 15% 12%; --border: 220 12% 19%; --primary: 353 86% 50%; --ring: 353 86% 55%; --gold: 38 92% 58%; --gold-soft: 36 40% 16%; --glow: 353 86% 50%; }
body.tema-2 { --bg: 228 45% 4%; --card: 228 35% 7%; --secondary: 228 28% 14%; --muted: 228 25% 12%; --border: 226 28% 21%; --primary: 350 95% 56%; --ring: 208 100% 62%; --gold: 208 100% 64%; --gold-soft: 214 55% 16%; --glow: 208 100% 62%; }
body.tema-3 { --bg: 20 22% 4%; --card: 24 14% 7%; --secondary: 30 12% 13%; --muted: 30 10% 12%; --border: 38 16% 21%; --primary: 2 76% 47%; --ring: 42 80% 56%; --gold: 42 80% 56%; --gold-soft: 40 42% 15%; --glow: 42 80% 56%; }

body[class*="tema-"] {
  background-color: hsl(var(--bg));
  background-image:
    linear-gradient(90deg, hsl(var(--bg)) 0, hsl(var(--bg)) 48%, hsl(var(--bg) / 0.62) 66%, hsl(var(--bg) / 0.3)),
    var(--tema-art);
  background-size: auto, auto 100vh;
  background-position: center, right top;
  background-attachment: fixed, fixed;
  background-repeat: no-repeat, no-repeat;
}

/* conteúdo centralizado (o <main> do site original não tinha limite de largura) */
body[class*="tema-"] main#conteudo { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 22px 40px; }
@media (max-width: 900px) { body[class*="tema-"] main#conteudo { padding: 0 16px 32px; } }

/* cabeçalho */
body[class*="tema-"] .site-header {
  background: hsl(var(--bg) / 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid hsl(var(--glow) / 0.35);
  box-shadow: 0 10px 30px -22px hsl(var(--glow) / 0.8);
}
body[class*="tema-"] .site-header::before {
  content: ""; display: block; height: 3px;
  background: linear-gradient(90deg, #1d4ed8 0 33.3%, #f5b335 33.3% 66.6%, #e11d3a 66.6%);
}
body[class*="tema-"] .brand-mark {
  width: 46px; height: 46px; border-radius: 13px; overflow: hidden;
  background: var(--tema-logo) center/cover no-repeat;
  border: 1.5px solid hsl(var(--glow) / 0.7);
  box-shadow: 0 0 18px -4px hsl(var(--glow) / 0.8);
}
body[class*="tema-"] .brand-mark svg { display: none; }
body[class*="tema-"] .site-nav a.is-active { background: hsl(var(--glow) / 0.18); color: #fff; box-shadow: inset 0 0 0 1px hsl(var(--glow) / 0.5); }

/* início: banner com a caveira */
body[class*="tema-"] .hero { position: relative; min-height: 400px; padding: 52px 0 34px; grid-template-columns: 1fr; }
body[class*="tema-"] .hero-copy { position: relative; z-index: 2; max-width: 680px; }
body[class*="tema-"] .hero-title { font-size: clamp(34px, 4.8vw, 56px); }
body[class*="tema-"]:has(.hero-art) { background-image: none; }
body[class*="tema-"] .hero-preview { display: none; }
body[class*="tema-"] .hero-art {
  position: absolute; z-index: 1; top: 0; right: 0; bottom: 0; width: 52%;
  background: var(--tema-art) center 8% / cover no-repeat;
  border-radius: 24px; border: 1px solid hsl(var(--glow) / 0.4);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 42%), linear-gradient(180deg, #000 72%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent 0, #000 42%), linear-gradient(180deg, #000 72%, transparent);
  mask-composite: intersect;
  pointer-events: none;
}
body[class*="tema-"] .hero-title { text-shadow: 0 6px 30px #000; }
body[class*="tema-"] .hero-title span { color: hsl(var(--primary)); }
body[class*="tema-"] .pill, body[class*="tema-"] .chip { border-color: hsl(var(--glow) / 0.5); background: hsl(var(--glow) / 0.1); color: hsl(var(--gold)); }

/* cartões e painéis */
body[class*="tema-"] .subject-card,
body[class*="tema-"] .panel,
body[class*="tema-"] .topic-row,
body[class*="tema-"] .admin-row,
body[class*="tema-"] .admin-stat,
body[class*="tema-"] .status-card,
body[class*="tema-"] .stats {
  background: hsl(var(--card) / 0.82); backdrop-filter: blur(5px);
  border-color: hsl(var(--border));
}
body[class*="tema-"] .stats > div { background: hsl(var(--card) / 0.78); }
body[class*="tema-"] .stats dd { color: hsl(var(--gold)); }
body[class*="tema-"] .subject-card { overflow: hidden; }
body[class*="tema-"] .subject-card::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, hsl(var(--primary)), hsl(var(--gold)));
}
body[class*="tema-"] .subject-card:hover,
body[class*="tema-"] .topic-row:hover,
body[class*="tema-"] .admin-stat:hover {
  border-color: hsl(var(--glow) / 0.7);
  box-shadow: 0 0 0 1px hsl(var(--glow) / 0.25), 0 22px 44px -26px hsl(var(--glow) / 0.65);
}
body[class*="tema-"] .section-head h2,
body[class*="tema-"] .admin-head h1,
body[class*="tema-"] .topic-header h1 {
  font-family: 'Archivo Black', 'Inter', sans-serif; font-weight: 400; text-transform: uppercase; letter-spacing: -0.005em;
}
body[class*="tema-"] .section-head h2 { font-size: 24px; }
body[class*="tema-"] .progress { background: hsl(0 0% 100% / 0.1); }
body[class*="tema-"] .progress span { background: linear-gradient(90deg, hsl(var(--primary)), hsl(var(--gold))); }
body[class*="tema-"] .btn-primary { background: linear-gradient(180deg, hsl(var(--primary)), hsl(var(--primary) / 0.78)); box-shadow: 0 10px 26px -12px hsl(var(--primary) / 0.9); }
body[class*="tema-"] .btn-outline { border-color: hsl(var(--glow) / 0.45); }
body[class*="tema-"] .btn-outline:hover { background: hsl(var(--glow) / 0.14); border-color: hsl(var(--glow) / 0.8); }
body[class*="tema-"] .sync-banner { border-color: hsl(var(--glow) / 0.3); background: hsl(var(--card) / 0.7); }
body[class*="tema-"] .site-footer { border-top: 1px solid hsl(var(--glow) / 0.25); }

/* login e cadastro */
body.auth-body[class*="tema-"] { background-image: none; background-color: hsl(var(--bg)); }
body.auth-body[class*="tema-"] .auth-scene {
  background-color: hsl(var(--bg));
  background-image: radial-gradient(60rem 40rem at 50% 0%, hsl(var(--glow) / 0.16), transparent 70%), linear-gradient(hsl(var(--bg) / 0.93), hsl(var(--bg) / 0.93)), var(--tema-art);
  background-size: auto, auto, cover; background-position: center, center, center top; background-repeat: no-repeat;
}
body.auth-body[class*="tema-"] .auth-phone {
  background-image:
    linear-gradient(180deg, hsl(var(--bg) / 0.28) 0%, hsl(var(--bg) / 0.12) 30%, hsl(var(--bg) / 0.82) 66%, hsl(var(--bg) / 0.97) 100%),
    var(--tema-art);
  background-size: auto, cover; background-position: center, center top; background-repeat: no-repeat;
}
@media (min-width: 721px) {
  body.auth-body[class*="tema-"] .auth-phone {
    margin: 22px auto; min-height: calc(100dvh - 44px);
    border-radius: 28px; border: 1px solid hsl(var(--glow) / 0.5);
    box-shadow: 0 0 0 1px hsl(var(--bg)), 0 0 60px -12px hsl(var(--glow) / 0.6), 0 40px 90px -30px #000;
    overflow: hidden;
  }
}
body.auth-body[class*="tema-"] .auth-logo-skull {
  width: 46px; height: 46px; border-radius: 13px; overflow: hidden;
  background: var(--tema-logo) center/cover no-repeat;
  border: 1.5px solid hsl(var(--glow) / 0.8); box-shadow: 0 0 20px -4px hsl(var(--glow) / 0.8);
}
body.auth-body[class*="tema-"] .auth-logo.is-small .auth-logo-skull { width: 36px; height: 36px; }
body.auth-body[class*="tema-"] .auth-logo-skull svg { display: none; }
body.auth-body[class*="tema-"] .auth-logo-text small { color: hsl(var(--gold)); }
body.auth-body[class*="tema-"] .auth-vertical { color: hsl(var(--gold) / 0.7); }
body.auth-body[class*="tema-"] .auth-slogan { font-size: 2.9rem; }
body.auth-body[class*="tema-"] .auth-cta { background: linear-gradient(180deg, hsl(var(--primary)), hsl(var(--primary) / 0.78)); box-shadow: 0 16px 40px -14px hsl(var(--primary)); border: 1px solid hsl(0 0% 100% / 0.15); }
body.auth-body[class*="tema-"] .auth-login-link a,
body.auth-body[class*="tema-"] .auth-switch a { color: hsl(var(--gold)); }
body.auth-body[class*="tema-"] .auth-form-card {
  background: hsl(var(--bg) / 0.9); border: 1px solid hsl(var(--glow) / 0.45);
  box-shadow: 0 0 40px -16px hsl(var(--glow) / 0.6), 0 36px 90px -40px #000;
}
body.auth-body[class*="tema-"] .auth-form-card .field input:focus { border-color: hsl(var(--glow)); box-shadow: 0 0 0 3px hsl(var(--glow) / 0.2); }
body.auth-body[class*="tema-"] .auth-form-card .btn-primary { background: linear-gradient(180deg, hsl(var(--primary)), hsl(var(--primary) / 0.78)); }

/* ============================================================
   Layout do painel (igual aos modelos): menu lateral + cartões com borda
   ============================================================ */
@media (min-width: 1000px) {
  body[class*="tema-"]:not(.auth-body):not(.deck-body) { padding-left: 262px; }
  body[class*="tema-"]:not(.auth-body)::before {
    content: ""; position: fixed; z-index: 80; top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, #1d4ed8 0 33.3%, #f5b335 33.3% 66.6%, #e11d3a 66.6%);
  }
  body[class*="tema-"] .site-header {
    position: fixed; top: 0; left: 0; bottom: 0; width: 262px; z-index: 70;
    border-bottom: 0; border-right: 1px solid hsl(var(--glow) / 0.45);
    background: hsl(var(--bg) / 0.9); box-shadow: 14px 0 40px -28px hsl(var(--glow) / 0.8);
    padding-top: 4px;
  }
  body[class*="tema-"] .site-header::before { display: none; }
  body[class*="tema-"] .site-header .container.header-inner {
    max-width: none; height: 100%; padding: 26px 18px 22px;
    display: flex; flex-direction: column; align-items: stretch; gap: 0;
  }
  body[class*="tema-"] .brand { gap: 12px; margin-bottom: 28px; }
  body[class*="tema-"] .brand-mark { width: 54px; height: 54px; border-radius: 15px; }
  body[class*="tema-"] .brand-text strong { font-size: 15px; line-height: 1.1; }
  body[class*="tema-"] .brand-text small { color: hsl(var(--gold)); letter-spacing: 0.22em; margin-top: 3px; }
  body[class*="tema-"] .site-nav { flex-direction: column; align-items: stretch; gap: 4px; margin: 0; }
  body[class*="tema-"] .site-nav a {
    padding: 12px 16px; border-radius: 11px; font-size: 14px; border: 1px solid transparent;
  }
  body[class*="tema-"] .site-nav a:hover { background: hsl(var(--glow) / 0.1); color: #fff; }
  body[class*="tema-"] .site-nav a.is-active {
    background: hsl(var(--glow) / 0.16); color: hsl(var(--gold)); border-color: hsl(var(--glow) / 0.55); box-shadow: none;
  }
  body[class*="tema-"] .header-actions { margin-top: auto; flex-direction: column; align-items: stretch; gap: 10px; }
  body[class*="tema-"] .heard-chip { justify-content: center; border-color: hsl(var(--glow) / 0.4); }
  body[class*="tema-"] .account summary { border-radius: 14px; padding: 8px 10px; }
  body[class*="tema-"] .account-email { max-width: 130px; }
  body[class*="tema-"] .account-menu { right: auto; left: 0; top: auto; bottom: calc(100% + 8px); width: 100%; }
  body[class*="tema-"] .header-actions::after {
    content: "projejocaveira.online"; text-align: center; margin-top: 6px;
    font-size: 10px; letter-spacing: 0.14em; color: hsl(var(--muted-fg) / 0.75);
  }
  body[class*="tema-"]:not(.auth-body) .flash-wrap,
  body[class*="tema-"] main#conteudo { max-width: 1160px; margin-left: 0; margin-right: auto; padding-left: 44px; padding-right: 44px; }
  body[class*="tema-"] .player { left: 262px; }
  body[class*="tema-"] .site-footer .container { max-width: 1160px; margin-left: 0; padding-left: 44px; padding-right: 44px; }
}

/* painel de boas-vindas com borda, como nos modelos */
body[class*="tema-"] .hero {
  min-height: 330px; margin-top: 30px; padding: 40px 38px; overflow: hidden;
  border: 1px solid hsl(var(--glow) / 0.6); border-radius: 22px;
  background: linear-gradient(100deg, hsl(var(--bg) / 0.94) 42%, hsl(var(--bg) / 0.45));
  box-shadow: 0 0 44px -20px hsl(var(--glow) / 0.7);
}
body[class*="tema-"] .hero-art { width: 50%; border: 0; border-radius: 0; top: 0; bottom: 0; right: 0; }
body[class*="tema-"] .hero-copy { max-width: 560px; }
body[class*="tema-"] .hero-title { font-size: clamp(30px, 3.6vw, 46px); }
body[class*="tema-"] .hero-lead { font-size: 14px; }

/* quatro indicadores em cartões separados */
body[class*="tema-"] .stats {
  gap: 14px; border: 0; background: none; backdrop-filter: none; overflow: visible; margin-top: 20px;
}
body[class*="tema-"] .stats > div {
  border: 1px solid hsl(var(--border)); border-top: 2px solid hsl(var(--gold)); border-radius: 16px;
  background: hsl(var(--card) / 0.85); padding: 18px 20px;
}
body[class*="tema-"] .stats dd { font-family: 'Archivo Black', 'Inter', sans-serif; font-size: 26px; letter-spacing: -0.01em; }

body[class*="tema-"] .subject-card { border-radius: 18px; padding: 22px; }
body[class*="tema-"] .subject-card h3 { font-family: 'Archivo Black', 'Inter', sans-serif; font-weight: 400; font-size: 19px; text-transform: uppercase; letter-spacing: 0; }
body[class*="tema-"] .sync-banner { border-radius: 14px; }
body[class*="tema-"] .section { margin-top: 38px; }

/* celular */
@media (max-width: 900px) {
  body[class*="tema-"] {
    background-image: linear-gradient(180deg, hsl(var(--bg) / 0.74), hsl(var(--bg) / 0.92)), var(--tema-art);
    background-size: auto, cover; background-position: center, center top;
  }
  body[class*="tema-"] .hero { min-height: 0; padding-top: 0; }
  body[class*="tema-"] .hero-art { position: relative; width: 100%; height: 230px; margin-bottom: 18px; -webkit-mask-image: linear-gradient(180deg, #000 60%, transparent); mask-image: linear-gradient(180deg, #000 60%, transparent); }
  body[class*="tema-"] .brand-mark { width: 38px; height: 38px; }
}

/* ---- admin: escolha do tema, um ao lado do outro ---- */
.tema-form { display: block !important; max-width: none !important; }
.tema-grid { width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.tema-opt { position: relative; display: flex; flex-direction: column; gap: 8px; cursor: pointer; padding: 8px; border: 1px solid hsl(var(--border)); border-radius: 14px; background: hsl(var(--card) / 0.85); font-size: 12px; line-height: 1.35; transition: 0.2s; }
.tema-opt:hover { border-color: hsl(var(--gold) / 0.6); }
.tema-opt input { position: absolute; opacity: 0; pointer-events: none; }
.tema-opt img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 9px; }
.tema-opt span { display: flex; align-items: center; gap: 7px; font-weight: 600; }
.tema-opt span::before { content: ""; width: 13px; height: 13px; border-radius: 50%; border: 2px solid hsl(var(--muted-fg)); flex: 0 0 auto; }
.tema-opt:has(input:checked) { border-color: hsl(var(--gold)); box-shadow: 0 0 0 2px hsl(var(--gold) / 0.4); }
.tema-opt:has(input:checked) span::before { border-color: hsl(var(--gold)); background: hsl(var(--gold)); box-shadow: inset 0 0 0 2px hsl(var(--card)); }
.tema-opt:focus-within { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }
@media (max-width: 900px) { .tema-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ============================================================
   Menu do aluno + tela inicial compacta (tudo cabe em uma tela)
   ============================================================ */
.site-nav .nav-extra { display: none; }
body[class*="tema-"] .site-nav .nav-extra { display: flex; }
body[class*="tema-"] .site-nav .nav-base { display: none; }
body[class*="tema-"] .site-nav a { align-items: center; }

@media (min-width: 1000px) {
  body[class*="tema-"] main#conteudo { max-width: 1400px; margin: 0 auto; padding-left: 32px; padding-right: 32px; }
  body[class*="tema-"]:not(.auth-body) .flash-wrap { max-width: 1400px; margin: 0 auto; padding-left: 32px; padding-right: 32px; }
  body[class*="tema-"]:has(.hero-art) main#conteudo { max-width: none; padding-left: 30px; padding-right: 30px; }
  body[class*="tema-"] .site-footer .container { max-width: 1400px; margin: 0 auto; padding-left: 32px; padding-right: 32px; }

  body[class*="tema-"] .hero { min-height: 0; height: 216px; margin-top: 22px; padding: 26px 34px; display: flex; align-items: center; }
  body[class*="tema-"] .hero-copy { max-width: 620px; }
  body[class*="tema-"] .hero-title { font-size: clamp(26px, 2.6vw, 38px); line-height: 1.08; margin: 8px 0 0; }
  body[class*="tema-"] .hero-lead, body[class*="tema-"] .hero-note { display: none; }
  body[class*="tema-"] .hero-actions { margin-top: 16px; gap: 10px; }
  body[class*="tema-"] .hero-actions .btn-lg { height: 40px; padding: 0 18px; font-size: 13px; }

  body[class*="tema-"] .stats { margin-top: 14px; gap: 12px; }
  body[class*="tema-"] .stats > div { padding: 12px 18px; border-radius: 14px; }
  body[class*="tema-"] .stats dd { font-size: 22px; margin-top: 2px; }
  body[class*="tema-"] .sync-banner { display: none; }

  body[class*="tema-"] .section { margin-top: 18px; }
  body[class*="tema-"] .section-head { margin-bottom: 10px; }
  body[class*="tema-"] .section-head h2 { font-size: 19px; }
  body[class*="tema-"] .section-head .section-sub, body[class*="tema-"] .section-head .chip { display: none; }

  body[class*="tema-"] .subject-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; counter-reset: mat; }
  body[class*="tema-"] .subject-card { counter-increment: mat; display: flex; flex-direction: column; padding: 14px 20px; min-height: 0; border-radius: 16px; }
  body[class*="tema-"] .subject-card::before { display: none; }
  body[class*="tema-"] .subject-icon, body[class*="tema-"] .subject-arrow,
  body[class*="tema-"] .subject-desc, body[class*="tema-"] .subject-foot { display: none; }
  body[class*="tema-"] .subject-card h3 { order: 1; font-size: 16px; margin: 0; }
  body[class*="tema-"] .subject-card::after {
    content: "MATÉRIA 0" counter(mat); order: 0; font-size: 9.5px; letter-spacing: 0.18em; color: hsl(var(--gold)); margin-bottom: 4px;
  }
  body[class*="tema-"] .subject-tagline { order: 2; margin: 3px 0 0; font-size: 12.5px; }
  body[class*="tema-"] .subject-meta { order: 4; margin-top: 8px; font-size: 11.5px; }
  body[class*="tema-"] .subject-card .progress { order: 3; margin-top: 10px; height: 5px; }
  body[class*="tema-"]:has(.hero-art) #como-estudar { display: none; }
}

/* celular/tablet: menu horizontal rolável (o app.css esconde o nav ≤720px) */
@media (max-width: 999px) {
  body[class*="tema-"] .site-header .header-inner { flex-wrap: wrap; }
  body[class*="tema-"] .site-nav {
    display: flex !important; order: 5; flex: 0 0 100%; overflow-x: auto; gap: 6px; padding: 8px 0 4px; scrollbar-width: none;
  }
  body[class*="tema-"] .site-nav a { white-space: nowrap; padding: 8px 13px; font-size: 13px; border-radius: 999px; border: 1px solid hsl(var(--border)); }
  body[class*="tema-"] .site-nav a.is-active { border-color: hsl(var(--glow) / 0.6); color: hsl(var(--gold)); }
}
@media (min-width: 1000px) {
  body[class*="tema-"]:has(.hero-art) .site-footer { margin-top: 0; padding: 4px 0; }
  body[class*="tema-"]:has(.hero-art) .site-footer .container { padding-top: 0; padding-bottom: 0; }
}

/* ============================================================
   Tela inicial idêntica ao modelo (boina, indicadores, cartões)
   ============================================================ */
body[class*="tema-"] {
  background-image: linear-gradient(hsl(var(--bg) / 0.66), hsl(var(--bg) / 0.66)), var(--tema-art);
  background-size: auto, cover;
  background-position: center, center top;
  background-attachment: fixed, fixed;
}
body[class*="tema-"]:has(.hero-art) { background-image: linear-gradient(hsl(var(--bg) / 0.66), hsl(var(--bg) / 0.66)), var(--tema-art); }

body[class*="tema-"] .hero-eyebrow { display: block; color: hsl(var(--gold)); font-size: 11px; font-weight: 700; letter-spacing: 0.26em; text-transform: uppercase; }
body[class*="tema-"] .hero-title { font-family: 'Inter', 'Segoe UI', Arial, sans-serif; font-weight: 800; text-transform: uppercase; text-shadow: none; letter-spacing: -0.01em; }
body[class*="tema-"] .hero-title span { display: block; font-style: normal; color: hsl(var(--gold)); }
body[class*="tema-"] .hero-lead { display: block; color: hsl(var(--fg) / 0.72); font-size: 14px; line-height: 1.5; max-width: 430px; margin-top: 12px; }
body[class*="tema-"] .hero-cta {
  margin-top: 20px; height: auto; padding: 13px 26px; border-radius: 12px; font-weight: 800; font-size: 15px;
  background: linear-gradient(180deg, #f7c04a, #e9a21c); color: #101010; box-shadow: none; display: inline-flex; align-items: center; gap: 8px;
}
body[class*="tema-"] .hero-cta .icon { width: 14px; height: 14px; }

body[class*="tema-"] .stats > div { display: flex; flex-direction: column-reverse; gap: 4px; border: 1px solid rgba(255,255,255,0.12); border-radius: 14px; background: hsl(var(--card) / 0.8); backdrop-filter: blur(3px); padding: 16px 18px; }
body[class*="tema-"] .stats dt { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: hsl(var(--muted-fg)); margin: 0; }
body[class*="tema-"] .stats dd { font-family: 'Inter', 'Segoe UI', Arial, sans-serif; font-weight: 800; font-size: 28px; color: hsl(var(--gold)); margin: 0; line-height: 1.1; }

body[class*="tema-"] .subject-card { background: hsl(var(--card) / 0.8); border: 1px solid rgba(255,255,255,0.12); backdrop-filter: blur(3px); }
body[class*="tema-"] .subject-card h3 { font-family: 'Inter', 'Segoe UI', Arial, sans-serif; font-weight: 700; text-transform: none; font-size: 22px; letter-spacing: -0.01em; margin: 7px 0 3px; }
body[class*="tema-"] .subject-tagline { text-transform: none; letter-spacing: 0; font-size: 13px; color: hsl(var(--muted-fg)) !important; margin: 0; }
body[class*="tema-"] .subject-meta { display: flex; align-items: center; gap: 12px; font-size: 12px; color: hsl(var(--fg) / 0.8); }
body[class*="tema-"] .subject-meta b { color: hsl(var(--gold)); }
body[class*="tema-"] .subject-meta .go { margin-left: auto; color: hsl(var(--gold)); font-weight: 700; display: inline-flex; align-items: center; gap: 5px; }
body[class*="tema-"] .subject-meta .go .icon { width: 10px; height: 10px; }
body[class*="tema-"] .subject-card .progress { height: 6px; margin: 12px 0 9px; }

@media (min-width: 1000px) {
  body[class*="tema-"]:not(.auth-body):not(.deck-body) { padding-left: 250px; }
  body[class*="tema-"] .site-header { width: 250px; }
  body[class*="tema-"] .player { left: 250px; }
  body[class*="tema-"] .site-nav a { padding: 11px 16px; }

  body[class*="tema-"]:has(.hero-art) main#conteudo { padding: 0 44px; }
  body[class*="tema-"] .hero {
    height: clamp(290px, 37vh, 360px); margin-top: 34px; padding: 0 36px; display: flex; align-items: center;
    background: hsl(var(--bg)); border: 1px solid hsl(var(--glow) / 0.85); border-radius: 22px; box-shadow: none;
  }
  body[class*="tema-"] .hero-copy { max-width: 560px; }
  body[class*="tema-"] .hero-title { font-size: clamp(34px, 3.3vw, 48px); line-height: 1.02; margin: 8px 0 0; }
  body[class*="tema-"] .hero-lead { display: block; }
  body[class*="tema-"] .hero-note { display: none; }
  body[class*="tema-"] .hero-art {
    left: auto; right: 60px; top: 0; bottom: 0; width: clamp(440px, 32vw, 580px);
    background: var(--tema-art) center -20px / 100% auto no-repeat;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 28%, #000 72%, transparent), linear-gradient(180deg, #000 70%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 28%, #000 72%, transparent), linear-gradient(180deg, #000 70%, transparent);
  }
  body[class*="tema-"] .stats { margin-top: 20px; gap: 14px; }
  body[class*="tema-"] .stats > div { padding: 16px 18px; }
  body[class*="tema-"] .stats dd { font-size: 28px; }

  body[class*="tema-"] #materias.section { margin-top: 20px; }
  body[class*="tema-"] #materias .section-head { display: none; }
  body[class*="tema-"] .subject-grid { gap: 16px; }
  body[class*="tema-"] .subject-card { padding: 18px 22px; border-radius: 16px; }
  body[class*="tema-"] .subject-card h3 { font-size: 22px; }
  body[class*="tema-"] .subject-card::after { font-size: 11px; letter-spacing: 0.2em; margin-bottom: 0; }
  body[class*="tema-"] .subject-meta { margin-top: 0; font-size: 12px; }
}
body[class*="tema-"], body[class*="tema-"]:has(.hero-art) { background-image: linear-gradient(hsl(var(--bg) / 0.8), hsl(var(--bg) / 0.8)), var(--tema-art); }
@media (min-width: 1000px) {
  body[class*="tema-"] .hero { height: clamp(280px, 35vh, 340px); }
  body[class*="tema-"] .subject-card { padding: 14px 22px; }
  body[class*="tema-"] .subject-card .progress { margin: 10px 0 8px; }
  body[class*="tema-"] .stats > div { padding: 14px 18px; }
  body[class*="tema-"] .stats { margin-top: 18px; }
  body[class*="tema-"] #materias.section { margin-top: 18px; }
  body[class*="tema-"]:has(.hero-art) .site-footer { margin-top: 10px; }
}
@media (min-width: 1000px) { body[class*="tema-"] .hero-art { width: 470px; right: 6%; } }

/* celular: banner compacto (não ocupa a tela toda) */
@media (max-width: 999px) {
  body[class*="tema-"] .hero { display: block; height: auto; min-height: 0; margin-top: 14px; padding: 0 0 18px; border-radius: 18px; overflow: hidden; background: hsl(var(--bg)); border: 1px solid hsl(var(--glow) / 0.8); }
  body[class*="tema-"] .hero-art {
    position: relative; width: 100%; height: 120px; margin: 0; right: auto;
    background: var(--tema-art) center 18% / cover no-repeat;
    -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent); mask-image: linear-gradient(180deg, #000 55%, transparent);
  }
  body[class*="tema-"] .hero-copy { padding: 0 18px; margin-top: -26px; position: relative; z-index: 2; }
  body[class*="tema-"] .hero-eyebrow { font-size: 9.5px; letter-spacing: 0.2em; }
  body[class*="tema-"] .hero-title { font-size: 25px; line-height: 1.05; margin: 6px 0 0; }
  body[class*="tema-"] .hero-title span { display: inline; }
  body[class*="tema-"] .hero-lead { display: none; }
  body[class*="tema-"] .hero-cta { margin-top: 14px; padding: 10px 20px; font-size: 14px; }
  body[class*="tema-"] .stats { margin-top: 12px; gap: 10px; }
  body[class*="tema-"] .stats > div { padding: 11px 14px; border-radius: 13px; }
  body[class*="tema-"] .stats dd { font-size: 22px; }
  body[class*="tema-"] .stats dt { font-size: 9.5px; }
}
@media (max-width: 999px) {
  body[class*="tema-"] .hero { margin-top: 42px; }
  body[class*="tema-"] .sync-banner, body[class*="tema-"]:has(.hero-art) #como-estudar { display: none; }
  body[class*="tema-"] #materias.section { margin-top: 16px; }
  body[class*="tema-"] #materias .section-head { display: none; }
  body[class*="tema-"] .subject-grid { display: grid; grid-template-columns: 1fr; gap: 10px; counter-reset: mat; }
  body[class*="tema-"] .subject-card { counter-increment: mat; display: flex; flex-direction: column; padding: 13px 16px; border-radius: 14px; }
  body[class*="tema-"] .subject-card::before { display: none; }
  body[class*="tema-"] .subject-icon, body[class*="tema-"] .subject-arrow,
  body[class*="tema-"] .subject-desc, body[class*="tema-"] .subject-foot { display: none; }
  body[class*="tema-"] .subject-card::after { content: "MATÉRIA 0" counter(mat); order: 0; font-size: 10px; letter-spacing: 0.2em; color: hsl(var(--gold)); }
  body[class*="tema-"] .subject-card h3 { order: 1; font-size: 18px; margin: 4px 0 2px; }
  body[class*="tema-"] .subject-tagline { order: 2; font-size: 12.5px; }
  body[class*="tema-"] .subject-card .progress { order: 3; margin: 9px 0 7px; }
  body[class*="tema-"] .subject-meta { order: 4; margin: 0; }
}
@media (max-width: 999px) { body[class*="tema-"] .subject-card { min-height: 0 !important; height: auto; gap: 0; justify-content: flex-start; } }

/* ============================================================
   Celular: menu lateral deslizante (mesmos itens do computador)
   ============================================================ */
.nav-toggle, .nav-head, .nav-logout, .nav-domain, .nav-overlay { display: none; }
@media (max-width: 999px) {
  body[class*="tema-"] .site-header { backdrop-filter: none; -webkit-backdrop-filter: none; }
  body[class*="tema-"] .site-header .header-inner { flex-wrap: nowrap; height: 62px; gap: 12px; }
  body[class*="tema-"] .nav-toggle {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 5px; flex: 0 0 auto;
    width: 42px; height: 42px; padding: 0 11px; border-radius: 12px; cursor: pointer;
    border: 1px solid hsl(var(--glow) / 0.55); background: hsl(var(--glow) / 0.1);
  }
  body[class*="tema-"] .nav-toggle span { display: block; height: 2px; border-radius: 2px; background: hsl(var(--gold)); }
  body[class*="tema-"] .header-actions { margin-left: auto; }

  body[class*="tema-"] .site-nav {
    display: flex !important; flex-direction: column; flex: none; order: 0; overflow-x: hidden; overflow-y: auto;
    position: fixed; z-index: 220; top: 0; left: 0; bottom: 0; width: min(290px, 84vw); margin: 0; padding: 22px 16px 20px; gap: 4px;
    background: hsl(var(--bg) / 0.98); border-right: 1px solid hsl(var(--glow) / 0.5);
    box-shadow: 18px 0 50px -20px #000; transform: translateX(-106%); transition: transform 0.25s ease; visibility: hidden;
  }
  body[class*="tema-"].nav-open .site-nav { transform: none; visibility: visible; }
  body[class*="tema-"] .site-nav a {
    padding: 12px 16px; border-radius: 11px; font-size: 15px; white-space: normal;
    border: 1px solid transparent; background: none;
  }
  body[class*="tema-"] .site-nav a.is-active { background: hsl(var(--glow) / 0.16); color: hsl(var(--gold)); border-color: hsl(var(--glow) / 0.55); }
  body[class*="tema-"] .nav-head { display: flex; align-items: center; gap: 12px; padding: 0 4px 20px; }
  body[class*="tema-"] .nav-head .brand-mark { width: 50px; height: 50px; border-radius: 14px; flex: 0 0 auto; }
  body[class*="tema-"] .nav-head strong { display: block; font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; }
  body[class*="tema-"] .nav-head small { display: block; color: hsl(var(--gold)); letter-spacing: 0.22em; font-size: 10px; margin-top: 3px; }
  body[class*="tema-"] .site-nav .nav-logout { display: flex; margin-top: auto; color: hsl(var(--muted-fg)); border-color: hsl(var(--border)); }
  body[class*="tema-"] .nav-domain { display: block; text-align: center; margin-top: 12px; font-size: 10px; letter-spacing: 0.14em; color: hsl(var(--muted-fg) / 0.75); }
  body[class*="tema-"] .nav-overlay { display: block; position: fixed; inset: 0; z-index: 210; background: rgba(0,0,0,0.65); }
  body[class*="tema-"] .nav-overlay[hidden] { display: none; }
  body[class*="tema-"].nav-open { overflow: hidden; }
}
@media (max-width: 999px) {
  body[class*="tema-"] .site-nav { align-items: stretch; }
  body[class*="tema-"] .site-nav a { display: flex; justify-content: flex-start; text-align: left; width: 100%; }
}
@media (max-width: 999px) { body[class*="tema-"] .hero { margin-top: 14px; } }
