/* ==========================================================================
   R.R EDUCAÇÃO — Sistema de Planos de Fundo Temáticos (CSS + SVG Data URI)
   Ativação: <body data-bg="nome-do-tema"> (exceto em .game-page)
   REGRA: 'dark-default' (ou data-bg vazio/ausente) preserva 100% o fundo e grid
   nativo original definido no CSS de cada página.
   Camada decorativa isolada em body::before (z-index: 0, pointer-events: none)
   Animação 60fps: exclusivamente background-position linear (26s a 44s)
   ========================================================================== */

html:has(body:not(.game-page)[data-bg]:not([data-bg=""]):not([data-bg="dark-default"])) {
  background: transparent !important;
}

body:not(.game-page)[data-bg]:not([data-bg=""]):not([data-bg="dark-default"]) {
  position: relative;
  z-index: 0;
  background-color: var(--bg-primary) !important;
  background-image: var(--bg-gradient) !important;
  background-size: auto !important;
  background-attachment: fixed !important;
  color: var(--text-primary);
  transition: background-color 0.35s ease, color 0.35s ease;
}

/* Camada isolada: acima do fundo base do body (z-index: 1) e abaixo do conteúdo (z-index: 2).
   Importante: opacity fica apenas nas regras específicas de cada tema para não perder especificidade. */
body:not(.game-page)[data-bg]:not([data-bg=""]):not([data-bg="dark-default"])::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-repeat: repeat;
  background-position: 0 0;
  transition: opacity 0.35s ease;
}

/* Desativa grid/after nativo quando um fundo temático está ativo */
body:not(.game-page)[data-bg]:not([data-bg=""]):not([data-bg="dark-default"])::after {
  content: none !important;
  display: none !important;
}

/* Mantém dark-default e páginas sem data-bg sem ::before extra */
body:not(.game-page):not([data-bg])::before,
body:not(.game-page)[data-bg=""]::before,
body:not(.game-page)[data-bg="dark-default"]::before,
body.game-page::before {
  content: none !important;
  display: none !important;
}

/* Impede que containers/wrappers estruturais cubram os SVGs animados de body::before,
   preservando opacidade dos cards (#14161f), sidebar, topo, .cta-section e modais */
body:not(.game-page)[data-bg]:not([data-bg=""]):not([data-bg="dark-default"]) main,
body:not(.game-page)[data-bg]:not([data-bg=""]):not([data-bg="dark-default"]) section:not(.cta-section):not(.config-card):not(.config-section),
body:not(.game-page)[data-bg]:not([data-bg=""]):not([data-bg="dark-default"]) .app-container,
body:not(.game-page)[data-bg]:not([data-bg=""]):not([data-bg="dark-default"]) .dashboard-layout,
body:not(.game-page)[data-bg]:not([data-bg=""]):not([data-bg="dark-default"]) .content-wrapper,
body:not(.game-page)[data-bg]:not([data-bg=""]):not([data-bg="dark-default"]) .content-area,
body:not(.game-page)[data-bg]:not([data-bg=""]):not([data-bg="dark-default"]) .main-area,
body:not(.game-page)[data-bg]:not([data-bg=""]):not([data-bg="dark-default"]) .main-content,
body:not(.game-page)[data-bg]:not([data-bg=""]):not([data-bg="dark-default"]) .settings-container,
body:not(.game-page)[data-bg]:not([data-bg=""]):not([data-bg="dark-default"]) .config-workspace,
body:not(.game-page)[data-bg]:not([data-bg=""]):not([data-bg="dark-default"]) .workspace-content,
body:not(.game-page)[data-bg]:not([data-bg=""]):not([data-bg="dark-default"]) .config-container,
body:not(.game-page)[data-bg]:not([data-bg=""]):not([data-bg="dark-default"]) .setup-container,
body:not(.game-page)[data-bg]:not([data-bg=""]):not([data-bg="dark-default"]) .page-wrapper,
body:not(.game-page)[data-bg]:not([data-bg=""]):not([data-bg="dark-default"]) .hero,
body:not(.game-page)[data-bg]:not([data-bg=""]):not([data-bg="dark-default"]) .hero-wrapper,
body:not(.game-page)[data-bg]:not([data-bg=""]):not([data-bg="dark-default"]) .hero-bg,
body:not(.game-page)[data-bg]:not([data-bg=""]):not([data-bg="dark-default"]) .bg-grid,
body:not(.game-page)[data-bg]:not([data-bg=""]):not([data-bg="dark-default"]) .avatars-section,
body:not(.game-page)[data-bg]:not([data-bg=""]):not([data-bg="dark-default"]) .how-it-works-section,
body:not(.game-page)[data-bg]:not([data-bg=""]):not([data-bg="dark-default"]) .games-section,
body:not(.game-page)[data-bg]:not([data-bg=""]):not([data-bg="dark-default"]) .features-section,
body:not(.game-page)[data-bg]:not([data-bg=""]):not([data-bg="dark-default"]) .legal-hero,
body:not(.game-page)[data-bg]:not([data-bg=""]):not([data-bg="dark-default"]) .legal-layout {
  background-color: transparent !important;
  background-image: none !important;
}

/* Garante que containers principais fiquem acima da camada decorativa (z-index: 1)
   usando especificidade zero (:where) para não sobrescrever modais/sidebars/headers fixed */
:where(body > main, body > header, body > footer, body > section, body > .main-content, body > .sidebar, body > .page-wrapper, body > .app-container, body > .dashboard-layout, body > #app, body > #root, .rr-bg-content) {
  position: relative;
  z-index: 2;
}

/* ==========================================================================
   KEYFRAMES LINEARES (exclusivamente background-position, loop 100% contínuo)
   Deslocamentos são múltiplos inteiros exatos de background-size (240 / 320)
   ========================================================================== */

@keyframes rr-bg-diagonal-240 {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 240px 240px;
  }
}

@keyframes rr-bg-diagonal-rev-240 {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: -240px 240px;
  }
}

@keyframes rr-bg-float-up-240 {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 0 -240px;
  }
}

@keyframes rr-bg-rain-down-320 {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 0 320px;
  }
}

@keyframes rr-bg-drift-down-320 {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 320px 640px;
  }
}

@keyframes rr-bg-float-up-320 {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 0 -320px;
  }
}

/* ==========================================================================
   PLANO GRATUITO
   1. dark-default — Escuro Nativo Original (preserva CSS nativo de cada página)
   ========================================================================== */

/* ==========================================================================
   PLANO PRO — Áreas do Conhecimento (Opacidade 0.05–0.09, Animação Suave)
   ========================================================================== */

/* 3. pro-exatas — Exatas & Geometria (pi, sigma, raiz, delta, átomos, sólidos) */
body:not(.game-page)[data-bg="pro-exatas"] {
  --bg-primary: #0b1326;
  --bg-gradient: radial-gradient(circle at 20% 18%, rgba(56, 189, 248, 0.11) 0%, transparent 50%),
    radial-gradient(circle at 82% 82%, rgba(129, 140, 248, 0.1) 0%, transparent 52%);
  --bg-surface: rgba(20, 31, 56, 0.88);
  --bg-surface-elevated: rgba(34, 50, 84, 0.72);
  --border-subtle: rgba(125, 211, 252, 0.18);
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --accent-color: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.15);
  --accent-contrast: #082f49;
}

body:not(.game-page)[data-bg="pro-exatas"]::before {
  opacity: 0.16;
  background-size: 240px 240px;
  animation: rr-bg-diagonal-240 36s linear infinite;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' viewBox='0 0 240 240' fill='none' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg stroke='%237dd3fc'%3E%3Cpath d='M24 30 Q38 25 52 30 M33 29 L30 50 M43 29 L43 45 Q43 50 48 49'/%3E%3Cpath d='M96 80 L114 90 L114 110 L96 120 L78 110 L78 90 Z M78 90 L96 100 L114 90 M96 100 L96 120'/%3E%3Cpath d='M20 164 L26 164 L32 178 L42 148 L62 148 L62 152'/%3E%3Cpath d='M96 188 L113 218 L79 218 Z M94 192 L108 218'/%3E%3Cpath d='M99 34 H105 M102 31 V37' stroke-opacity='0.65'/%3E%3Ccircle cx='30' cy='108' r='1.8' fill='%237dd3fc' stroke='none' opacity='0.6'/%3E%3C/g%3E%3Cg stroke='%23a5b4fc'%3E%3Ccircle cx='158' cy='42' r='2.5' fill='%23a5b4fc' stroke='none'/%3E%3Cellipse cx='158' cy='42' rx='20' ry='7.5' transform='rotate(30 158 42)'/%3E%3Cellipse cx='158' cy='42' rx='20' ry='7.5' transform='rotate(-30 158 42)'/%3E%3Cellipse cx='158' cy='42' rx='20' ry='7.5' transform='rotate(90 158 42)'/%3E%3Cpath d='M216 86 L216 82 L192 82 L205 100 L192 118 L216 118 L216 114'/%3E%3Cpath d='M158 140 L138 174 L162 182 L178 168 Z M158 140 L162 182'/%3E%3Cpath d='M138 174 L178 168' stroke-dasharray='3 3' stroke-opacity='0.6'/%3E%3Cpath d='M204 184 L222 204 L204 224 L186 204 Z M204 184 L199 208 L204 224 M186 204 L199 208 L222 204'/%3E%3Cpath d='M155 106 H161 M158 103 V109' stroke-opacity='0.65'/%3E%3Ccircle cx='212' cy='32' r='1.8' fill='%23a5b4fc' stroke='none' opacity='0.6'/%3E%3Cpath d='M32 216 A11 11 0 0 1 48 216' stroke-opacity='0.65'/%3E%3C/g%3E%3C/svg%3E");
}

/* 4. pro-natureza — Natureza & Ciência (folhas, hexágonos orgânicos, gotas, brotos) */
body:not(.game-page)[data-bg="pro-natureza"] {
  --bg-primary: #071714;
  --bg-gradient: radial-gradient(circle at 22% 16%, rgba(52, 211, 153, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 84%, rgba(45, 212, 191, 0.09) 0%, transparent 52%);
  --bg-surface: rgba(13, 36, 31, 0.88);
  --bg-surface-elevated: rgba(22, 56, 48, 0.72);
  --border-subtle: rgba(110, 231, 183, 0.18);
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --accent-color: #34d399;
  --accent-soft: rgba(52, 211, 153, 0.15);
  --accent-contrast: #022c22;
}

body:not(.game-page)[data-bg="pro-natureza"]::before {
  opacity: 0.16;
  background-size: 240px 240px;
  animation: rr-bg-float-up-240 34s linear infinite;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' viewBox='0 0 240 240' fill='none' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg stroke='%236ee7b7'%3E%3Cpath d='M24 58 C24 38 38 24 58 24 C58 44 44 58 24 58 Z M20 62 L52 30 M34 48 L33 38 M42 40 L41 31 M38 44 L48 45 M31 51 L41 52'/%3E%3Cpath d='M188 120 Q204 116 220 120 M204 118 L204 99 M204 103 C196 103 188 96 189 88 C197 88 204 95 204 103 Z M204 99 C212 99 220 92 219 84 C211 84 204 91 204 99 Z'/%3E%3Cpath d='M26 184 Q42 164 56 146 M36 172 C26 170 23 162 27 156 C33 160 36 166 36 172 Z M44 162 C52 165 59 161 59 154 C52 154 46 157 44 162 Z M56 146 C54 139 59 134 65 135 C65 141 61 146 56 146 Z'/%3E%3Cpath d='M206 224 L206 202 M206 206 C198 204 194 198 196 192 C202 194 206 199 206 206 M206 202 C214 200 218 194 216 188 C210 190 206 195 206 202'/%3E%3Ccircle cx='100' cy='36' r='2' fill='%236ee7b7' stroke='none' opacity='0.6'/%3E%3Ccircle cx='38' cy='104' r='1.8' fill='%236ee7b7' stroke='none' opacity='0.6'/%3E%3C/g%3E%3Cg stroke='%235eead4'%3E%3Cpath d='M158 26 L172 34 L172 50 L158 58 L144 50 L144 34 Z M158 31 L167 36 M167 48 L158 53 M149 47 L149 37 M172 34 L181 28 M144 50 L135 56'/%3E%3Ccircle cx='183' cy='27' r='2'/%3E%3Ccircle cx='133' cy='57' r='2'/%3E%3Cpath d='M96 82 C96 82 110 98 110 108 A14 14 0 1 1 82 108 C82 98 96 82 96 82 Z M89 107 A7 7 0 0 0 95 116'/%3E%3Cpath d='M146 153 L157 160 V172 L146 179 L135 172 V160 Z M168 153 L179 160 V172 L168 179 L157 172 V160 Z'/%3E%3Ccircle cx='146' cy='166' r='5'/%3E%3Cpath d='M91 194 C91 194 99 204 99 210 A8 8 0 1 1 83 210 C83 204 91 194 91 194 Z M108 188 C108 188 113 195 113 199 A5 5 0 1 1 103 199 C103 195 108 188 108 188 Z'/%3E%3Ccircle cx='158' cy='108' r='1.8' fill='%235eead4' stroke='none' opacity='0.6'/%3E%3Ccircle cx='204' cy='42' r='2' fill='%235eead4' stroke='none' opacity='0.6'/%3E%3C/g%3E%3C/svg%3E");
}

/* 5. pro-humanas — Humanas & História (bússolas, globos, ampulhetas, colunas) */
body:not(.game-page)[data-bg="pro-humanas"] {
  --bg-primary: #141118;
  --bg-gradient: radial-gradient(circle at 18% 18%, rgba(245, 158, 11, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 82% 82%, rgba(234, 88, 12, 0.08) 0%, transparent 52%);
  --bg-surface: rgba(33, 27, 38, 0.88);
  --bg-surface-elevated: rgba(54, 44, 62, 0.72);
  --border-subtle: rgba(252, 211, 77, 0.18);
  --text-primary: #f8fafc;
  --text-secondary: #e2d9c8;
  --text-muted: #b0a392;
  --accent-color: #fbbf24;
  --accent-soft: rgba(251, 191, 36, 0.15);
  --accent-contrast: #1c1917;
}

body:not(.game-page)[data-bg="pro-humanas"]::before {
  opacity: 0.16;
  background-size: 240px 240px;
  animation: rr-bg-diagonal-rev-240 42s linear infinite;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' viewBox='0 0 240 240' fill='none' stroke-width='1.55' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg stroke='%23fcd34d'%3E%3Ccircle cx='42' cy='42' r='17'/%3E%3Ccircle cx='42' cy='42' r='3.5'/%3E%3Cpath d='M42 20 L46 38 L64 42 L46 46 L42 64 L38 46 L20 42 L38 38 Z M30 30 L35 35 M54 30 L49 35 M30 54 L35 49 M54 54 L49 49'/%3E%3Cpath d='M82 82 H110 M82 122 H110 M85 82 C85 95 94 98 96 102 C94 106 85 109 85 122 M107 82 C107 95 98 98 96 102 C98 106 107 109 107 122 M89 92 H103 M89 122 Q96 113 103 122 M96 105 V113'/%3E%3Ccircle cx='42' cy='164' r='17'/%3E%3Cpath d='M25 164 H59 M28 155 Q42 158 56 155 M28 173 Q42 170 56 173 M42 147 V181 M42 147 A10 17 0 0 1 42 181 M42 147 A10 17 0 0 0 42 181'/%3E%3Cpath d='M80 194 L96 186 L112 194 Z M84 197 H108 M87 197 V220 M105 197 V220 M93 199 V218 M99 199 V218 M82 220 H110'/%3E%3C/g%3E%3Cg stroke='%23fdba74'%3E%3Cpath d='M144 24 H172 V28 H144 Z M149 28 V54 M167 28 V54 M155 31 V52 M161 31 V52 M146 54 H170 V58 H146 Z M143 58 H173 V62 H143 Z'/%3E%3Ccircle cx='145' cy='31' r='3.5'/%3E%3Ccircle cx='171' cy='31' r='3.5'/%3E%3Ccircle cx='204' cy='98' r='14'/%3E%3Cpath d='M190 98 H218 M204 84 A7 14 0 0 1 204 112 M204 84 A7 14 0 0 0 204 112 M194 82 A19 19 0 0 1 214 114 M204 117 V123 M194 123 H214'/%3E%3Ccircle cx='158' cy='164' r='15' stroke-dasharray='3 3'/%3E%3Cpath d='M158 144 L161 161 L178 164 L161 167 L158 184 L155 167 L138 164 L155 161 Z'/%3E%3Cpath d='M192 190 H216 M192 224 H216 M195 190 L204 207 L195 224 M213 190 L204 207 L213 224 M199 224 L204 217 L209 224'/%3E%3Ccircle cx='100' cy='38' r='1.8' fill='%23fdba74' stroke='none' opacity='0.6'/%3E%3Ccircle cx='206' cy='40' r='1.8' fill='%23fdba74' stroke='none' opacity='0.6'/%3E%3Ccircle cx='38' cy='102' r='1.8' fill='%23fcd34d' stroke='none' opacity='0.6'/%3E%3C/g%3E%3C/svg%3E");
}

/* 6. pro-linguagens — Linguagens & Artes (livros, música, diálogo, pincéis, penas) */
body:not(.game-page)[data-bg="pro-linguagens"] {
  --bg-primary: #140f24;
  --bg-gradient: radial-gradient(circle at 20% 15%, rgba(244, 114, 182, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 82% 84%, rgba(192, 132, 252, 0.1) 0%, transparent 52%);
  --bg-surface: rgba(32, 23, 54, 0.88);
  --bg-surface-elevated: rgba(50, 36, 82, 0.72);
  --border-subtle: rgba(249, 168, 212, 0.18);
  --text-primary: #f8fafc;
  --text-secondary: #e2d9f3;
  --text-muted: #a799c4;
  --accent-color: #f472b6;
  --accent-soft: rgba(244, 114, 182, 0.15);
  --accent-contrast: #1e0b2b;
}

body:not(.game-page)[data-bg="pro-linguagens"]::before {
  opacity: 0.16;
  background-size: 240px 240px;
  animation: rr-bg-float-up-240 32s linear infinite;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' viewBox='0 0 240 240' fill='none' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg stroke='%23f9a8d4'%3E%3Cpath d='M42 32 C34 27 24 27 19 31 V54 C24 50 34 50 42 55 C50 50 60 50 65 54 V31 C60 27 50 27 42 32 Z M42 32 V55 M24 37 Q31 35 37 37 M24 43 Q31 41 37 43 M47 37 Q53 35 60 37 M47 43 Q53 41 60 43'/%3E%3Cpath d='M80 86 H112 A6 6 0 0 1 118 92 V108 A6 6 0 0 1 112 114 H92 L82 122 L84 114 H80 A6 6 0 0 1 74 108 V92 A6 6 0 0 1 80 86 Z'/%3E%3Ccircle cx='88' cy='100' r='1.4' fill='%23f9a8d4' stroke='none'/%3E%3Ccircle cx='96' cy='100' r='1.4' fill='%23f9a8d4' stroke='none'/%3E%3Ccircle cx='104' cy='100' r='1.4' fill='%23f9a8d4' stroke='none'/%3E%3Cpath d='M23 183 L42 162 L46 166 L25 185 Z M42 162 L46 166 L50 162 L46 158 Z M46 158 C50 150 58 148 61 144 C61 151 56 158 50 162'/%3E%3Cpath d='M96 192 C110 192 119 198 119 207 C119 216 110 222 96 222 L83 226 L86 218 C79 215 73 212 73 207 C73 198 82 192 96 192 Z M86 204 H106 M86 210 H100'/%3E%3C/g%3E%3Cg stroke='%23d8b4fe'%3E%3Cellipse cx='144' cy='53' rx='5' ry='3.5' transform='rotate(-20 144 53)'/%3E%3Cellipse cx='168' cy='49' rx='5' ry='3.5' transform='rotate(-20 168 49)'/%3E%3Cpath d='M148 51 V29 L172 25 V47 M148 34 L172 30'/%3E%3Cpath d='M186 122 Q200 100 222 80 M194 112 C192 98 202 84 222 80 C218 98 208 110 194 112 M206 90 L204 97 M212 96 L205 99'/%3E%3Cellipse cx='153' cy='177' rx='5.5' ry='4' transform='rotate(-20 153 177)'/%3E%3Cpath d='M158 175 V150 C164 152 169 156 168 164'/%3E%3Cg transform='rotate(-12 204 206)'%3E%3Cpath d='M204 196 C197 192 189 192 185 195 V215 C189 212 197 212 204 216 C211 212 219 212 223 215 V195 C219 192 211 192 204 196 Z M204 196 V216'/%3E%3C/g%3E%3Ccircle cx='100' cy='38' r='1.8' fill='%23d8b4fe' stroke='none' opacity='0.6'/%3E%3Ccircle cx='38' cy='104' r='1.8' fill='%23f9a8d4' stroke='none' opacity='0.6'/%3E%3Ccircle cx='158' cy='106' r='1.8' fill='%23d8b4fe' stroke='none' opacity='0.6'/%3E%3C/g%3E%3C/svg%3E");
}

/* ==========================================================================
   PLANO PREMIUM — Especiais & Sazonais (Opacidade 0.08–0.13, Tiles 320px)
   ========================================================================== */

/* 7. prem-gamer — Arcade & Controles (controles, triângulo/círculo/x/quadrado, pixel stars, raios) */
body:not(.game-page)[data-bg="prem-gamer"] {
  --bg-primary: #090d1f;
  --bg-gradient: radial-gradient(circle at 18% 15%, rgba(34, 211, 238, 0.12) 0%, transparent 48%),
    radial-gradient(circle at 84% 84%, rgba(244, 63, 94, 0.1) 0%, transparent 50%);
  --bg-surface: rgba(16, 23, 51, 0.88);
  --bg-surface-elevated: rgba(29, 40, 84, 0.74);
  --border-subtle: rgba(56, 189, 248, 0.22);
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --accent-color: #22d3ee;
  --accent-soft: rgba(34, 211, 238, 0.16);
  --accent-contrast: #082f49;
}

body:not(.game-page)[data-bg="prem-gamer"]::before {
  opacity: 0.22;
  background-size: 320px 320px;
  animation: rr-bg-rain-down-320 26s linear infinite;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='320' viewBox='0 0 320 320' fill='none' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg stroke='%2338bdf8'%3E%3Cpath d='M32 46 C32 38 38 34 45 34 H63 C70 34 76 38 76 46 L80 62 C81 68 74 71 70 66 L64 58 H44 L38 66 C34 71 27 68 28 62 Z M40 46 H46 M43 43 V49'/%3E%3Ccircle cx='65' cy='42' r='1.3' fill='%2338bdf8' stroke='none'/%3E%3Ccircle cx='65' cy='50' r='1.3' fill='%2338bdf8' stroke='none'/%3E%3Ccircle cx='61' cy='46' r='1.3' fill='%2338bdf8' stroke='none'/%3E%3Ccircle cx='69' cy='46' r='1.3' fill='%2338bdf8' stroke='none'/%3E%3Crect x='190' y='117' width='52' height='26' rx='12'/%3E%3Cpath d='M200 130 H208 M204 126 V134 M214 134 L217 130 M220 134 L223 130'/%3E%3Ccircle cx='230' cy='132' r='2.3'/%3E%3Ccircle cx='236' cy='127' r='2.3'/%3E%3Cpath d='M155 61 L165 71 M165 61 L155 71 M205 270 L215 280 M215 270 L205 280'/%3E%3C/g%3E%3Cpath d='M160 28 L167 40 H153 Z M54 192 L62 206 H46 Z' stroke='%234ade80'/%3E%3Ccircle cx='178' cy='48' r='6' stroke='%23fb7185'/%3E%3Ccircle cx='68' cy='214' r='6' stroke='%23fb7185'/%3E%3Crect x='136' y='42' width='11' height='11' rx='1.5' stroke='%23e879f9'/%3E%3Crect x='224' y='270' width='11' height='11' rx='1.5' stroke='%23e879f9'/%3E%3Cg stroke='%23facc15' fill='%23facc15' fill-opacity='0.14'%3E%3Cpath d='M262 38 H266 V42 H270 V46 H278 V50 H274 V54 H270 V58 H274 V62 H278 V66 H270 V62 H266 V58 H262 V62 H258 V66 H250 V62 H254 V58 H258 V54 H254 V50 H250 V46 H258 V42 H262 Z'/%3E%3Cpath d='M112 110 L95 132 H106 L100 152 L119 128 H108 Z'/%3E%3C/g%3E%3Cg stroke='%2322d3ee' fill='%2322d3ee' fill-opacity='0.14'%3E%3Cpath d='M158 196 H162 V200 H166 V204 H174 V208 H170 V212 H166 V216 H170 V220 H174 V224 H166 V220 H162 V216 H158 V220 H154 V224 H146 V220 H150 V216 H154 V212 H150 V208 H146 V204 H154 V200 H158 Z'/%3E%3C/g%3E%3Cpath d='M270 192 L253 214 H264 L258 234 L277 210 H266 Z' stroke='%23f472b6' fill='%23f472b6' fill-opacity='0.14'/%3E%3Cg stroke='%23c084fc' transform='rotate(-10 106 276)'%3E%3Cpath d='M84 270 C84 262 90 258 97 258 H115 C122 258 128 262 128 270 L132 286 C133 292 126 295 122 290 L116 282 H96 L90 290 C86 295 79 292 80 286 Z M92 270 H98 M95 267 V273'/%3E%3Ccircle cx='117' cy='266' r='1.3' fill='%23c084fc' stroke='none'/%3E%3Ccircle cx='117' cy='274' r='1.3' fill='%23c084fc' stroke='none'/%3E%3Ccircle cx='113' cy='270' r='1.3' fill='%23c084fc' stroke='none'/%3E%3Ccircle cx='121' cy='270' r='1.3' fill='%23c084fc' stroke='none'/%3E%3C/g%3E%3Cg fill='%2338bdf8' stroke='none' opacity='0.65'%3E%3Crect x='25' y='118' width='3' height='8' rx='1'/%3E%3Crect x='159' y='122' width='3' height='8' rx='1'/%3E%3Crect x='291' y='132' width='3' height='8' rx='1'/%3E%3Crect x='25' y='272' width='3' height='8' rx='1'/%3E%3Crect x='291' y='280' width='3' height='8' rx='1'/%3E%3C/g%3E%3C/svg%3E");
}

/* 8. prem-natal — Especial de Natal (flocos geométricos, estrelas, sinos, bengalas doces) */
body:not(.game-page)[data-bg="prem-natal"] {
  --bg-primary: #09161b;
  --bg-gradient: radial-gradient(circle at 20% 14%, rgba(56, 189, 248, 0.1) 0%, transparent 48%),
    radial-gradient(circle at 82% 84%, rgba(251, 113, 133, 0.09) 0%, transparent 50%);
  --bg-surface: rgba(15, 34, 41, 0.88);
  --bg-surface-elevated: rgba(25, 56, 66, 0.74);
  --border-subtle: rgba(186, 230, 253, 0.2);
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --accent-color: #fb7185;
  --accent-soft: rgba(251, 113, 133, 0.16);
  --accent-contrast: #ffffff;
}

body:not(.game-page)[data-bg="prem-natal"]::before {
  opacity: 0.22;
  background-size: 320px 320px;
  animation: rr-bg-drift-down-320 42s linear infinite;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='320' viewBox='0 0 320 320' fill='none' stroke-width='1.65' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg stroke='%23bae6fd'%3E%3Cpath d='M54 35 V73 M49 40 L54 45 L59 40 M49 68 L54 63 L59 68'/%3E%3Cpath d='M54 35 V73 M49 40 L54 45 L59 40 M49 68 L54 63 L59 68' transform='rotate(60 54 54)'/%3E%3Cpath d='M54 35 V73 M49 40 L54 45 L59 40 M49 68 L54 63 L59 68' transform='rotate(120 54 54)'/%3E%3Cpath d='M54 48 L59 51 V57 L54 60 L49 57 V51 Z'/%3E%3Cpath d='M216 115 V149 M212 120 L216 124 L220 120 M212 144 L216 140 L220 144'/%3E%3Cpath d='M216 115 V149 M212 120 L216 124 L220 120 M212 144 L216 140 L220 144' transform='rotate(60 216 132)'/%3E%3Cpath d='M216 115 V149 M212 120 L216 124 L220 120 M212 144 L216 140 L220 144' transform='rotate(120 216 132)'/%3E%3Cpath d='M160 197 V227 M160 197 V227'/%3E%3Cpath d='M160 197 V227' transform='rotate(60 160 212)'/%3E%3Cpath d='M160 197 V227' transform='rotate(120 160 212)'/%3E%3Ccircle cx='160' cy='212' r='4.5'/%3E%3Cpath d='M216 264 V292'/%3E%3Cpath d='M216 264 V292' transform='rotate(60 216 278)'/%3E%3Cpath d='M216 264 V292' transform='rotate(120 216 278)'/%3E%3Ccircle cx='26' cy='125' r='2' fill='%23e0f2fe' stroke='none'/%3E%3Ccircle cx='160' cy='126' r='2' fill='%23e0f2fe' stroke='none'/%3E%3Ccircle cx='292' cy='130' r='2' fill='%23e0f2fe' stroke='none'/%3E%3Ccircle cx='28' cy='280' r='2' fill='%23e0f2fe' stroke='none'/%3E%3Ccircle cx='292' cy='280' r='2' fill='%23e0f2fe' stroke='none'/%3E%3C/g%3E%3Cg stroke='%23fcd34d'%3E%3Cpath d='M160 36 C153 31 150 38 158 38 M160 36 C167 31 170 38 162 38 M150 61 C150 48 153 40 160 38 C167 40 170 48 170 61 L174 65 H146 L150 61 Z M157 65 A3 3 0 0 0 163 65'/%3E%3Cpath d='M266 196 C260 192 257 198 264 198 M266 196 C272 192 275 198 268 198 M257 219 C257 207 260 200 266 198 C272 200 275 207 275 219 L279 223 H253 L257 219 Z M263 223 A3 3 0 0 0 269 223'/%3E%3Cpath d='M106 113 L110 124 L122 125 L113 132 L116 144 L106 137 L96 144 L99 132 L90 125 L102 124 Z' fill='%23fde047' fill-opacity='0.14'/%3E%3Cpath d='M106 258 L110 274 L124 278 L110 282 L106 298 L102 282 L88 278 L102 274 Z'/%3E%3C/g%3E%3Cg stroke='%23fb7185'%3E%3Cpath d='M255 72 V44 A11 11 0 1 1 277 44 A3 3 0 0 1 271 44 A5 5 0 1 0 261 44 V72 A3 3 0 0 1 255 72 Z M255 50 L261 46 M255 58 L261 54 M255 66 L261 62 M262 34 L265 39'/%3E%3Cg transform='translate(54 212) rotate(-14) scale(-1 1)'%3E%3Cpath d='M-9 18 V-8 A10 10 0 1 1 11 -8 A2.8 2.8 0 0 1 5.4 -8 A4.4 4.4 0 1 0 -3.4 -8 V18 A2.8 2.8 0 0 1 -9 18 Z M-9 -2 L-3.4 -6 M-9 6 L-3.4 2 M-9 13 L-3.4 9'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* 9. prem-halloween — Noite de Halloween (abóboras simpáticas, morcegos, luas, estrelas) */
body:not(.game-page)[data-bg="prem-halloween"] {
  --bg-primary: #120c1d;
  --bg-gradient: radial-gradient(circle at 18% 18%, rgba(251, 146, 60, 0.1) 0%, transparent 48%),
    radial-gradient(circle at 82% 84%, rgba(168, 85, 247, 0.12) 0%, transparent 52%);
  --bg-surface: rgba(28, 19, 44, 0.88);
  --bg-surface-elevated: rgba(46, 32, 71, 0.74);
  --border-subtle: rgba(251, 146, 60, 0.22);
  --text-primary: #f8fafc;
  --text-secondary: #e2d9f3;
  --text-muted: #a799c4;
  --accent-color: #fb923c;
  --accent-soft: rgba(251, 146, 60, 0.16);
  --accent-contrast: #1c1008;
}

body:not(.game-page)[data-bg="prem-halloween"]::before {
  opacity: 0.22;
  background-size: 320px 320px;
  animation: rr-bg-float-up-320 38s linear infinite;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='320' viewBox='0 0 320 320' fill='none' stroke-width='1.65' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg stroke='%23fb923c'%3E%3Cpath d='M52 38 C52 33 56 31 59 32 M54 39 C40 39 34 48 35 58 C36 67 43 71 54 71 C65 71 72 67 73 58 C74 48 68 39 54 39 Z M48 40 C44 49 44 61 48 70 M60 40 C64 49 64 61 60 70 M44 50 L47 46 L50 50 Z M58 50 L61 46 L64 50 Z M45 58 Q54 64 63 58'/%3E%3Cpath d='M214 116 C214 111 218 109 221 110 M216 117 C202 117 196 126 197 136 C198 145 205 149 216 149 C227 149 234 145 235 136 C236 126 230 117 216 117 Z M210 118 C206 127 206 139 210 148 M222 118 C226 127 226 139 222 148 M205 129 Q208 125 211 129 M221 129 Q224 125 227 129 M207 136 Q216 142 225 136'/%3E%3Cpath d='M158 198 C158 194 161 192 164 193 M160 199 C148 199 143 207 144 216 C145 224 151 227 160 227 C169 227 175 224 176 216 C177 207 172 199 160 199 Z M151 209 L153 206 L155 209 Z M165 209 L167 206 L169 209 Z M152 216 Q160 221 168 216'/%3E%3C/g%3E%3Cg stroke='%23c084fc'%3E%3Cpath d='M155 44 L157 39 L160 43 L163 39 L165 44 C172 41 180 43 184 48 C179 51 177 56 177 59 C172 56 168 57 166 60 C164 58 162 57 160 57 C158 57 156 58 154 60 C152 57 148 56 143 59 C143 56 141 51 136 48 C140 43 148 41 155 44 Z'/%3E%3Ccircle cx='158' cy='48' r='1' fill='%23c084fc' stroke='none'/%3E%3Ccircle cx='162' cy='48' r='1' fill='%23c084fc' stroke='none'/%3E%3Cg transform='rotate(-8 106 130)'%3E%3Cpath d='M101 124 L103 119 L106 123 L109 119 L111 124 C118 121 126 123 130 128 C125 131 123 136 123 139 C118 136 114 137 112 140 C110 138 108 137 106 137 C104 137 102 138 100 140 C98 137 94 136 89 139 C89 136 87 131 82 128 C86 123 94 121 101 124 Z'/%3E%3C/g%3E%3Cpath d='M259 206 L261 201 L264 205 L267 201 L269 206 C276 203 284 205 288 210 C283 213 281 218 281 221 C276 218 272 219 270 222 C268 220 266 219 264 219 C262 219 260 220 258 222 C256 219 252 218 247 221 C247 218 245 213 240 210 C244 205 252 203 259 206 Z'/%3E%3C/g%3E%3Cg stroke='%23fde047'%3E%3Cpath d='M270 39 A15 15 0 1 0 274 66 A11 11 0 1 1 270 39 Z M278 46 L280 50 L284 52 L280 54 L278 58 L276 54 L272 52 L276 50 Z'/%3E%3Cpath d='M48 197 A15 15 0 1 1 44 224 A11 11 0 1 0 48 197 Z'/%3E%3Cpath d='M222 263 A14 14 0 1 0 226 289 A10.5 10.5 0 1 1 222 263 Z M230 270 L232 273 L235 275 L232 277 L230 280 L228 277 L225 275 L228 273 Z'/%3E%3Cpath d='M100 266 L102 272 L108 274 L102 276 L100 282 L98 276 L92 274 L98 272 Z M116 280 L118 284 L122 286 L118 288 L116 292 L114 288 L110 286 L114 284 Z'/%3E%3Ccircle cx='26' cy='130' r='1.8' fill='%23fde047' stroke='none'/%3E%3Ccircle cx='160' cy='126' r='1.8' fill='%23fde047' stroke='none'/%3E%3Ccircle cx='292' cy='130' r='1.8' fill='%23fde047' stroke='none'/%3E%3Ccircle cx='28' cy='278' r='1.8' fill='%23c084fc' stroke='none'/%3E%3Ccircle cx='292' cy='282' r='1.8' fill='%23fde047' stroke='none'/%3E%3C/g%3E%3C/svg%3E");
}

/* 10. prem-celebracao — Festa & Conquistas (confetes, troféus, estrelas douradas, serpentinas) */
body:not(.game-page)[data-bg="prem-celebracao"] {
  --bg-primary: #0e122b;
  --bg-gradient: radial-gradient(circle at 20% 14%, rgba(250, 204, 21, 0.1) 0%, transparent 48%),
    radial-gradient(circle at 84% 84%, rgba(244, 114, 182, 0.11) 0%, transparent 52%);
  --bg-surface: rgba(21, 27, 61, 0.88);
  --bg-surface-elevated: rgba(36, 46, 97, 0.74);
  --border-subtle: rgba(250, 204, 21, 0.22);
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --accent-color: #facc15;
  --accent-soft: rgba(250, 204, 21, 0.16);
  --accent-contrast: #1e1b4b;
}

body:not(.game-page)[data-bg="prem-celebracao"]::before {
  opacity: 0.22;
  background-size: 320px 320px;
  animation: rr-bg-drift-down-320 40s linear infinite;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='320' viewBox='0 0 320 320' fill='none' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cg stroke='%23facc15'%3E%3Cpath d='M42 36 H66 V47 C66 55 61 59 54 59 C47 59 42 55 42 47 Z M42 40 H36 C34 40 34 49 38 50 L42 50 M66 40 H72 C74 40 74 49 70 50 L66 50 M54 59 V66 M45 66 H63 V70 H45 Z'/%3E%3Cpath d='M204 118 H228 V129 C228 137 223 141 216 141 C209 141 204 137 204 129 Z M204 122 H198 C196 122 196 131 200 132 L204 132 M228 122 H234 C236 122 236 131 232 132 L228 132 M216 141 V148 M207 148 H225 V152 H207 Z'/%3E%3Cpath d='M254 196 H274 V206 C274 213 270 217 264 217 C258 217 254 213 254 206 Z M254 200 H249 C247 200 247 207 250 208 L254 208 M274 200 H279 C281 200 281 207 278 208 L274 208 M264 217 V223 M256 223 H272 V227 H256 Z'/%3E%3Cpath d='M264 38 L268 48 L279 49 L271 56 L273 67 L264 61 L255 67 L257 56 L249 49 L260 48 Z' fill='%23fde047' fill-opacity='0.16'/%3E%3Cpath d='M54 195 L58 205 L69 206 L61 213 L63 224 L54 218 L45 224 L47 213 L39 206 L50 205 Z' fill='%23facc15' fill-opacity='0.16'/%3E%3Cpath d='M216 263 L220 273 L231 274 L223 281 L225 292 L216 286 L207 292 L209 281 L201 274 L212 273 Z' fill='%23fde047' fill-opacity='0.16'/%3E%3Cpath d='M108 134 L113 139 L108 144 L103 139 Z M216 105 L218 109 L222 111 L218 113 L216 117 L214 113 L210 111 L214 109 Z'/%3E%3C/g%3E%3Cg stroke='%23f472b6'%3E%3Cpath d='M144 36 C154 38 148 50 158 52 C168 54 162 66 172 68'/%3E%3Cpath d='M96 120 L104 128 H92 Z M174 194 L181 200 L172 203 Z'/%3E%3Ccircle cx='197' cy='286' r='3.5'/%3E%3C/g%3E%3Cg stroke='%232dd4bf'%3E%3Cpath d='M144 196 C154 192 164 202 156 208 C150 212 148 202 158 202 C168 202 166 218 176 222'/%3E%3Crect x='138' y='56' width='8' height='4' rx='1' transform='rotate(-25 142 58)'/%3E%3Cpath d='M118 265 L123 270 L118 275 L113 270 Z'/%3E%3Crect x='232' y='268' width='7' height='4' rx='1' transform='rotate(20 235 270)'/%3E%3C/g%3E%3Cg stroke='%2338bdf8'%3E%3Cpath d='M175 40 L180 45 L175 50 L170 45 Z M234 282 L241 288 L232 291 Z'/%3E%3Ccircle cx='116' cy='124' r='4'/%3E%3Ccircle cx='282' cy='224' r='3'/%3E%3C/g%3E%3Cg stroke='%23a78bfa'%3E%3Cpath d='M92 264 C102 266 96 278 106 280 C116 282 110 292 118 295 M90 138 L98 143'/%3E%3Ccircle cx='28' cy='126' r='2' fill='%23facc15' stroke='none'/%3E%3Ccircle cx='292' cy='130' r='2' fill='%23f472b6' stroke='none'/%3E%3C/g%3E%3C/svg%3E");
}

/* ==========================================================================
   ACESSIBILIDADE — Redução de Movimento
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  body::before {
    animation: none !important;
  }
}