/*
 * Temas comemorativos.
 *
 * O servidor põe data-tema="<chave>" no <html> só nos dias do tema (e só em
 * quem está vendo a prévia). Cada tema redefine as variáveis de cor do Tailwind
 * (veja tailwind.config.js): botão, destaque, gradiente e fundo mudam juntos no
 * site inteiro. O verde de "comprar" não muda.
 *
 * Os valores vão como "R G B" — é o formato que deixa o Tailwind aplicar a
 * opacidade (bg-brand-500/20).
 *
 * As decorações (teia, morcego, neve...) são montadas pelo temas.js dentro de
 * .tema-camada, que não recebe clique: nada atrás dela deixa de funcionar.
 */

/* ============================================================== paletas */

html[data-tema="halloween"] {
  /* laranja de abóbora */
  --c-brand-50: 255 247 237;
  --c-brand-100: 255 237 213;
  --c-brand-200: 254 215 170;
  --c-brand-300: 253 186 116;
  --c-brand-400: 251 146 60;
  --c-brand-500: 249 115 22;
  --c-brand-600: 234 88 12;
  --c-brand-700: 194 65 12;
  --c-brand-800: 154 52 18;
  --c-brand-900: 124 45 18;
  /* âmbar de vela */
  --c-babyblue-100: 254 243 199;
  --c-babyblue-200: 253 230 138;
  --c-babyblue-300: 252 211 77;
  --c-babyblue-400: 251 191 36;
  --c-babyblue-500: 245 158 11;
  --c-babyblue-600: 217 119 6;
  /* roxo de bruxa */
  --c-accent-400: 192 132 252;
  --c-accent-500: 168 85 247;
  --c-accent-600: 147 51 234;
  /* noite com um fundo arroxeado */
  --c-surface-950: 10 7 14;
  --c-surface-900: 16 11 22;
  --c-surface-800: 23 17 31;
  --c-surface-700: 32 24 43;
  --c-surface-600: 45 34 59;
  --c-surface-500: 59 46 77;
}

html[data-tema="natal"] {
  --c-brand-50: 254 242 242;
  --c-brand-100: 254 226 226;
  --c-brand-200: 254 202 202;
  --c-brand-300: 252 165 165;
  --c-brand-400: 248 113 113;
  --c-brand-500: 239 68 68;
  --c-brand-600: 220 38 38;
  --c-brand-700: 185 28 28;
  --c-brand-800: 153 27 27;
  --c-brand-900: 127 29 29;
  /* Vermelho com BRANCO de neve (02/12/2026: o verde misturado ficou estranho). */
  --c-babyblue-100: 255 255 255;
  --c-babyblue-200: 248 250 252;
  --c-babyblue-300: 241 245 249;
  --c-babyblue-400: 226 232 240;
  --c-babyblue-500: 203 213 225;
  --c-babyblue-600: 148 163 184;
  --c-accent-400: 252 211 77;
  --c-accent-500: 251 191 36;
  --c-accent-600: 245 158 11;
  /* noite neutra puxando de leve para o vermelho (antes era esverdeada) */
  --c-surface-950: 10 8 9;
  --c-surface-900: 15 11 12;
  --c-surface-800: 22 16 18;
  --c-surface-700: 31 23 25;
  --c-surface-600: 43 32 35;
  --c-surface-500: 57 43 47;
}

html[data-tema="ano-novo"] {
  --c-brand-50: 254 252 232;
  --c-brand-100: 254 249 195;
  --c-brand-200: 254 240 138;
  --c-brand-300: 253 224 71;
  --c-brand-400: 250 204 21;
  --c-brand-500: 202 138 4;
  --c-brand-600: 161 98 7;
  --c-brand-700: 133 77 14;
  --c-brand-800: 113 63 18;
  --c-brand-900: 66 32 6;
  --c-babyblue-100: 248 250 252;
  --c-babyblue-200: 241 245 249;
  --c-babyblue-300: 226 232 240;
  --c-babyblue-400: 203 213 225;
  --c-babyblue-500: 148 163 184;
  --c-babyblue-600: 100 116 139;
  --c-accent-400: 253 224 71;
  --c-accent-500: 234 179 8;
  --c-accent-600: 202 138 4;
  --c-surface-950: 6 7 12;
  --c-surface-900: 10 12 20;
  --c-surface-800: 16 18 29;
  --c-surface-700: 24 27 41;
  --c-surface-600: 35 39 56;
  --c-surface-500: 48 53 73;
}

html[data-tema="carnaval"] {
  --c-brand-50: 253 244 255;
  --c-brand-100: 250 232 255;
  --c-brand-200: 245 208 254;
  --c-brand-300: 240 171 252;
  --c-brand-400: 232 121 249;
  --c-brand-500: 217 70 239;
  --c-brand-600: 192 38 211;
  --c-brand-700: 162 28 175;
  --c-brand-800: 134 25 143;
  --c-brand-900: 112 26 117;
  --c-babyblue-100: 207 250 254;
  --c-babyblue-200: 165 243 252;
  --c-babyblue-300: 103 232 249;
  --c-babyblue-400: 34 211 238;
  --c-babyblue-500: 6 182 212;
  --c-babyblue-600: 8 145 178;
  --c-accent-400: 250 204 21;
  --c-accent-500: 234 179 8;
  --c-accent-600: 202 138 4;
  --c-surface-950: 11 7 16;
  --c-surface-900: 17 11 25;
  --c-surface-800: 24 17 35;
  --c-surface-700: 34 24 48;
  --c-surface-600: 47 34 65;
  --c-surface-500: 62 47 84;
}

html[data-tema="pascoa"] {
  --c-brand-50: 245 243 255;
  --c-brand-100: 237 233 254;
  --c-brand-200: 221 214 254;
  --c-brand-300: 196 181 253;
  --c-brand-400: 167 139 250;
  --c-brand-500: 139 92 246;
  --c-brand-600: 124 58 237;
  --c-brand-700: 109 40 217;
  --c-brand-800: 91 33 182;
  --c-brand-900: 76 29 149;
  --c-babyblue-100: 252 231 243;
  --c-babyblue-200: 251 207 232;
  --c-babyblue-300: 249 168 212;
  --c-babyblue-400: 244 114 182;
  --c-babyblue-500: 236 72 153;
  --c-babyblue-600: 219 39 119;
  --c-accent-400: 251 191 36;
  --c-accent-500: 245 158 11;
  --c-accent-600: 217 119 6;
}

html[data-tema="namorados"] {
  --c-brand-50: 255 241 242;
  --c-brand-100: 255 228 230;
  --c-brand-200: 254 205 211;
  --c-brand-300: 253 164 175;
  --c-brand-400: 251 113 133;
  --c-brand-500: 244 63 94;
  --c-brand-600: 225 29 72;
  --c-brand-700: 190 18 60;
  --c-brand-800: 159 18 57;
  --c-brand-900: 136 19 55;
  --c-babyblue-100: 252 231 243;
  --c-babyblue-200: 251 207 232;
  --c-babyblue-300: 249 168 212;
  --c-babyblue-400: 244 114 182;
  --c-babyblue-500: 236 72 153;
  --c-babyblue-600: 219 39 119;
  --c-accent-400: 248 113 113;
  --c-accent-500: 239 68 68;
  --c-accent-600: 220 38 38;
  --c-surface-950: 13 7 10;
  --c-surface-900: 20 11 15;
  --c-surface-800: 28 17 22;
  --c-surface-700: 39 24 31;
  --c-surface-600: 54 34 43;
  --c-surface-500: 71 46 57;
}

html[data-tema="festa-junina"] {
  --c-brand-50: 254 242 242;
  --c-brand-100: 254 226 226;
  --c-brand-200: 254 202 202;
  --c-brand-300: 252 165 165;
  --c-brand-400: 248 113 113;
  --c-brand-500: 220 38 38;
  --c-brand-600: 185 28 28;
  --c-brand-700: 153 27 27;
  --c-brand-800: 127 29 29;
  --c-brand-900: 99 23 23;
  --c-babyblue-100: 254 249 195;
  --c-babyblue-200: 254 240 138;
  --c-babyblue-300: 253 224 71;
  --c-babyblue-400: 250 204 21;
  --c-babyblue-500: 234 179 8;
  --c-babyblue-600: 202 138 4;
  --c-accent-400: 74 222 128;
  --c-accent-500: 34 197 94;
  --c-accent-600: 22 163 74;
  --c-surface-950: 12 9 7;
  --c-surface-900: 18 14 11;
  --c-surface-800: 26 20 16;
  --c-surface-700: 37 29 23;
  --c-surface-600: 51 40 32;
  --c-surface-500: 67 54 44;
}

html[data-tema="criancas"] {
  --c-brand-50: 245 243 255;
  --c-brand-100: 237 233 254;
  --c-brand-200: 221 214 254;
  --c-brand-300: 196 181 253;
  --c-brand-400: 167 139 250;
  --c-brand-500: 139 92 246;
  --c-brand-600: 124 58 237;
  --c-brand-700: 109 40 217;
  --c-brand-800: 91 33 182;
  --c-brand-900: 76 29 149;
  --c-babyblue-100: 254 249 195;
  --c-babyblue-200: 254 240 138;
  --c-babyblue-300: 253 224 71;
  --c-babyblue-400: 250 204 21;
  --c-babyblue-500: 234 179 8;
  --c-babyblue-600: 202 138 4;
  --c-accent-400: 74 222 128;
  --c-accent-500: 34 197 94;
  --c-accent-600: 22 163 74;
}

html[data-tema="black-friday"] {
  --c-brand-50: 255 251 235;
  --c-brand-100: 254 243 199;
  --c-brand-200: 253 230 138;
  --c-brand-300: 252 211 77;
  --c-brand-400: 245 158 11;
  --c-brand-500: 217 119 6;
  --c-brand-600: 180 83 9;
  --c-brand-700: 146 64 14;
  --c-brand-800: 120 53 15;
  --c-brand-900: 69 26 3;
  --c-babyblue-100: 254 252 232;
  --c-babyblue-200: 254 249 195;
  --c-babyblue-300: 254 240 138;
  --c-babyblue-400: 253 224 71;
  --c-babyblue-500: 250 204 21;
  --c-babyblue-600: 202 138 4;
  --c-accent-400: 248 113 113;
  --c-accent-500: 239 68 68;
  --c-accent-600: 220 38 38;
  /* preto de verdade, sem o azulado de sempre */
  --c-surface-950: 5 5 5;
  --c-surface-900: 10 10 10;
  --c-surface-800: 18 18 18;
  --c-surface-700: 28 28 28;
  --c-surface-600: 38 38 38;
  --c-surface-500: 51 51 51;
}

/*
 * Rubi: não é data comemorativa, só existe como cosmético (tema do painel de
 * quem tem). Vermelho de batom, com o fundo em gradiente que se mexe devagar
 * e os botões principais com um brilho que corre.
 */
html[data-tema="rubi"] {
  --c-brand-50: 255 241 242;
  --c-brand-100: 255 228 230;
  --c-brand-200: 254 205 211;
  --c-brand-300: 253 164 175;
  --c-brand-400: 251 113 133;
  --c-brand-500: 225 29 72;
  --c-brand-600: 190 18 60;
  --c-brand-700: 159 18 57;
  --c-brand-800: 136 19 55;
  --c-brand-900: 76 5 25;
  --c-babyblue-100: 255 228 230;
  --c-babyblue-200: 254 205 211;
  --c-babyblue-300: 253 164 175;
  --c-babyblue-400: 251 113 133;
  --c-babyblue-500: 244 63 94;
  --c-babyblue-600: 225 29 72;
  --c-accent-400: 252 165 165;
  --c-accent-500: 239 68 68;
  --c-accent-600: 220 38 38;
  --c-surface-950: 14 5 8;
  --c-surface-900: 22 8 12;
  --c-surface-800: 32 11 17;
  --c-surface-700: 45 15 24;
  --c-surface-600: 63 21 33;
  --c-surface-500: 84 28 44;
}

/* O fundo: três manchas de vermelho que passeiam (atrás de tudo, sem clique). */
html[data-tema="rubi"] body::before {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(40% 35% at 20% 25%, rgb(225 29 72 / 0.30), transparent 70%),
    radial-gradient(35% 30% at 80% 20%, rgb(251 113 133 / 0.18), transparent 70%),
    radial-gradient(45% 40% at 60% 85%, rgb(159 18 57 / 0.32), transparent 70%),
    linear-gradient(135deg, #1a0509, #2a0812 45%, #12040a);
  background-size: 140% 140%, 160% 160%, 150% 150%, 100% 100%;
  animation: tema-rubi-fundo 18s ease-in-out infinite alternate;
}
@keyframes tema-rubi-fundo {
  0%   { background-position: 0% 0%, 100% 0%, 50% 100%, 0 0; }
  50%  { background-position: 60% 40%, 30% 60%, 0% 30%, 0 0; }
  100% { background-position: 100% 100%, 0% 100%, 100% 0%, 0 0; }
}

/* Botão principal e título com gradiente vivo: o brilho corre de um lado ao outro. */
html[data-tema="rubi"] .btn-brand {
  background-image: linear-gradient(110deg, #be123c 0%, #e11d48 35%, #fb7185 50%, #e11d48 65%, #9f1239 100%);
  background-size: 250% 100%;
  animation: tema-rubi-brilho 4s linear infinite;
}
@keyframes tema-rubi-brilho {
  from { background-position: 100% 0; }
  to   { background-position: -150% 0; }
}
html[data-tema="rubi"] main h1 {
  background-image: linear-gradient(90deg, #fff1f2, #fb7185, #e11d48, #fb7185, #fff1f2);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: tema-rubi-brilho 7s linear infinite;
}
html[data-tema="rubi"] main h1 svg { color: #fb7185; }
@media (prefers-reduced-motion: reduce) {
  html[data-tema="rubi"] body::before,
  html[data-tema="rubi"] .btn-brand,
  html[data-tema="rubi"] main h1 { animation: none; }
}

/* ===================================================== brilho do fundo */

/* Um halo da cor do tema no topo da página, parado (não rola junto). */
html[data-tema] body {
  background-image: radial-gradient(ellipse 80% 45% at 50% -8%, var(--tema-halo, transparent), transparent 70%);
  background-attachment: fixed;
}
html[data-tema="halloween"]    { --tema-halo: rgb(249 115 22 / 0.13); }
html[data-tema="natal"]        { --tema-halo: rgb(239 68 68 / 0.10); }
/* Natal: o "Star" do logo em vermelho (a 2a cor do tema e o branco da neve). */
html[data-tema="natal"] .logo-star { background: linear-gradient(90deg, rgb(var(--c-brand-400)), rgb(var(--c-brand-600))); -webkit-background-clip: text; background-clip: text; }
html[data-tema="ano-novo"]     { --tema-halo: rgb(250 204 21 / 0.10); }
html[data-tema="carnaval"]     { --tema-halo: rgb(217 70 239 / 0.12); }
html[data-tema="pascoa"]       { --tema-halo: rgb(167 139 250 / 0.12); }
html[data-tema="namorados"]    { --tema-halo: rgb(244 63 94 / 0.12); }
html[data-tema="festa-junina"] { --tema-halo: rgb(250 204 21 / 0.09); }
html[data-tema="criancas"]     { --tema-halo: rgb(139 92 246 / 0.12); }
html[data-tema="black-friday"] { --tema-halo: rgb(250 204 21 / 0.07); }
html[data-tema="rubi"]         { --tema-halo: rgb(225 29 72 / 0.16); }

/* ============================================================== camada */

/*
 * Acima do cabeçalho (z 50) para a teia/luzes cobrirem o canto dele, abaixo
 * de qualquer janela (modais começam em 1000). Nunca recebe clique.
 */
.tema-camada {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  overflow: hidden;
  contain: strict;
}
.tema-camada.tema-escondida > :not(.tema-mascote) { display: none; }

/* ----------------------------------------------------------------- canto */
.tema-canto {
  position: absolute;
  top: 0;
  width: 180px;
  height: 180px;
}
.tema-canto-e { left: 0; }
.tema-canto-d { right: 0; transform: scaleX(-1); }
@media (max-width: 640px) {
  .tema-canto { width: 120px; height: 120px; }
}

/* ------------------------------------------------------------- aranha */
.tema-aranha {
  position: absolute;
  top: 0;
  right: 74px;
  width: 26px;
  animation: tema-aranha-desce 16s ease-in-out infinite;
  animation-delay: 3s;
  transform: translateY(-40px);
}
.tema-aranha::before {
  /* o fio: sobe da aranha até sair pelo topo da tela */
  content: "";
  position: absolute;
  left: 50%;
  bottom: 70%;
  width: 1px;
  height: 420px;
  background: linear-gradient(to top, rgb(255 255 255 / 0.55), rgb(255 255 255 / 0.25));
}
.tema-aranha svg { position: relative; display: block; width: 100%; animation: tema-balanca 2.6s ease-in-out infinite; transform-origin: 50% 0; }
@keyframes tema-aranha-desce {
  0%, 8%    { transform: translateY(-40px); }
  30%       { transform: translateY(150px); }
  34%       { transform: translateY(138px); }
  38%, 55%  { transform: translateY(146px); }
  78%, 100% { transform: translateY(-40px); }
}
@keyframes tema-balanca {
  0%, 100% { transform: rotate(-6deg); }
  50%      { transform: rotate(6deg); }
}
@media (max-width: 640px) {
  .tema-aranha { right: 34px; width: 20px; }
}

/* ------------------------------------------------------------ morcego */
.tema-morcego {
  position: absolute;
  left: 0;
  top: var(--altura, 20vh);
  width: var(--tamanho, 34px);
  animation: tema-atravessa var(--duracao, 9s) linear forwards;
}
.tema-morcego.tema-volta { animation-name: tema-atravessa-volta; }
.tema-morcego > div { animation: tema-ondula 1.6s ease-in-out infinite alternate; }
.tema-morcego svg { display: block; width: 100%; overflow: visible; }
.tema-morcego .asa { transform-box: fill-box; animation: tema-bate-asa 0.22s ease-in-out infinite alternate; }
.tema-morcego .asa-e { transform-origin: 100% 40%; }
.tema-morcego .asa-d { transform-origin: 0% 40%; }
.tema-morcego.tema-volta svg { transform: scaleX(-1); }
@keyframes tema-atravessa {
  from { transform: translateX(-12vw); }
  to   { transform: translateX(112vw); }
}
@keyframes tema-atravessa-volta {
  from { transform: translateX(112vw); }
  to   { transform: translateX(-12vw); }
}
@keyframes tema-ondula {
  from { transform: translateY(-22px); }
  to   { transform: translateY(22px); }
}
@keyframes tema-bate-asa {
  from { transform: scaleY(1); }
  to   { transform: scaleY(-0.35); }
}

/* --------------------------------------------- chuva (neve, confete...) */
.tema-gota {
  position: absolute;
  top: 0;
  left: var(--x, 50%);
  width: var(--tamanho, 8px);
  opacity: var(--opacidade, 0.8);
  will-change: transform;
  animation: tema-cai var(--duracao, 12s) linear infinite;
  animation-delay: var(--atraso, 0s);
}
.tema-gota svg { display: block; width: 100%; height: auto; }
.tema-gota.tema-sobe { animation-name: tema-sobe; }
@keyframes tema-cai {
  from { transform: translate3d(0, -12vh, 0) rotate(0deg); }
  to   { transform: translate3d(var(--deriva, 0px), 112vh, 0) rotate(var(--giro, 0deg)); }
}
@keyframes tema-sobe {
  from { transform: translate3d(0, 112vh, 0) rotate(0deg); }
  to   { transform: translate3d(var(--deriva, 0px), -18vh, 0) rotate(var(--giro, 0deg)); }
}
.tema-floco {
  border-radius: 9999px;
  background: #fff;
  box-shadow: 0 0 6px rgb(255 255 255 / 0.8);
  aspect-ratio: 1;
}
.tema-faisca {
  border-radius: 9999px;
  background: #fde047;
  box-shadow: 0 0 6px 1px rgb(251 146 60 / 0.9);
  aspect-ratio: 1;
}
html[data-tema="rubi"] .tema-faisca { background: #ffe4e6; box-shadow: 0 0 7px 1px rgb(244 63 94 / 0.95); }

/* --------------------------------------------- varal no topo (luz/bandeira) */
.tema-varal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 30px;
}
.tema-varal svg { display: block; width: 100%; height: 100%; overflow: visible; }
.tema-lampada { animation: tema-acende 1.4s ease-in-out infinite alternate; }
@keyframes tema-acende {
  from { opacity: 0.35; filter: none; }
  to   { opacity: 1; filter: drop-shadow(0 0 3px currentColor) drop-shadow(0 0 6px currentColor); }
}
.tema-bandeira { transform-box: fill-box; transform-origin: 50% 0; animation: tema-tremula 2.4s ease-in-out infinite alternate; }
@keyframes tema-tremula {
  from { transform: rotate(-5deg); }
  to   { transform: rotate(5deg); }
}

/* --------------------------------------------------- fita (Black Friday) */
.tema-fita {
  position: absolute;
  top: 26px;
  width: 230px;
  padding: 5px 0;
  text-align: center;
  font: 800 11px/1.2 Poppins, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0.22em;
  color: #0a0a0a;
  background: repeating-linear-gradient(45deg, #facc15 0 14px, #eab308 14px 28px);
  box-shadow: 0 4px 14px rgb(0 0 0 / 0.5);
}
.tema-fita-e { left: -58px; transform: rotate(-45deg); }
.tema-fita-d { right: -58px; transform: rotate(45deg); }
@media (max-width: 640px) {
  .tema-fita { width: 170px; top: 16px; font-size: 9px; }
  .tema-fita-e { left: -48px; }
  .tema-fita-d { right: -48px; }
}

/* ---------------------------------------------------------- fogos */
.tema-fogos { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ========================================================== mascote */

/*
 * O bichinho do canto de baixo (abóbora, presente...). É a única parte que
 * recebe clique: pula, e no Halloween solta morcegos.
 */
.tema-mascote {
  position: absolute;
  left: var(--mascote-x, 18px);
  bottom: var(--mascote-y, 18px);
  width: 64px;
  pointer-events: auto;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: left 0.25s ease, bottom 0.25s ease;
  /* Na troca de página (view transition do painel), fica parado no lugar
     em vez de cruzar a tela junto com o resto. */
  view-transition-name: tema-mascote;
}
/* Na home do celular o canto de baixo já tem o botão de filtros, a faixa e o
   Discord: o mascote fica só no computador. */
@media (max-width: 1023px) {
  body.home-sem-selecao .tema-mascote { display: none; }
}
.tema-mascote > .corpo { animation: tema-flutua 3.2s ease-in-out infinite; }
.tema-mascote svg { display: block; width: 100%; height: auto; overflow: visible; }
.tema-mascote.pulando > .corpo { animation: tema-pulo 0.55s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes tema-flutua {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}
@keyframes tema-pulo {
  0%   { transform: translateY(0) scale(1.08, 0.9); }
  45%  { transform: translateY(-26px) scale(0.95, 1.06); }
  100% { transform: translateY(0) scale(1); }
}
/* sombra no chão */
.tema-mascote::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: -6px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(0 0 0 / 0.55), transparent);
  z-index: -1;
}
/* O cartão que abre no clique: a frase do tema e a chave liga/desliga das
   decorações (antes era um "x" pequeno que só aparecia com o mouse em cima). */
.tema-mascote .tema-painel {
  position: absolute;
  left: 0;
  bottom: calc(100% + 12px);
  width: 250px;
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgb(28 28 34 / 0.97), rgb(14 14 18 / 0.97));
  border: 1px solid rgb(var(--c-brand-500) / 0.45);
  box-shadow: 0 18px 40px rgb(0 0 0 / 0.5), 0 0 0 1px rgb(255 255 255 / 0.04) inset;
  color: #e2e8f0;
  font: 500 12px/1.35 Poppins, ui-sans-serif, system-ui, sans-serif;
  cursor: default;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px) scale(0.98);
  transform-origin: 24px 100%;
  transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
}
.tema-mascote.aberto .tema-painel { opacity: 1; visibility: visible; transform: none; }
.tema-mascote.aberto .balao { opacity: 0 !important; }
/* a setinha apontando para o mascote */
.tema-mascote .tema-painel::after {
  content: "";
  position: absolute;
  left: 24px;
  bottom: -6px;
  width: 10px;
  height: 10px;
  background: rgb(14 14 18);
  border-right: 1px solid rgb(var(--c-brand-500) / 0.45);
  border-bottom: 1px solid rgb(var(--c-brand-500) / 0.45);
  transform: rotate(45deg);
}
.tema-painel .titulo { margin: 0; font-size: 14px; font-weight: 700; color: #fff; }
.tema-painel .sub { margin: 2px 0 0; font-size: 11px; color: #94a3b8; }
.tema-painel .linha {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgb(255 255 255 / 0.05);
  border: 1px solid rgb(255 255 255 / 0.08);
  cursor: pointer;
}
.tema-painel .linha:hover { background: rgb(255 255 255 / 0.08); }
.tema-painel .texto { display: flex; flex-direction: column; min-width: 0; }
.tema-painel .texto b { font-size: 13px; font-weight: 600; color: #fff; }
.tema-painel .texto small { font-size: 11px; color: #94a3b8; }
.tema-painel .chave {
  position: relative;
  flex-shrink: 0;
  width: 42px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 9999px;
  background: rgb(100 116 139 / 0.55);
  cursor: pointer;
  transition: background 0.2s;
}
.tema-painel .chave > span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 9999px;
  background: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.4);
  transition: transform 0.2s;
}
.tema-painel .chave[aria-checked="true"] { background: rgb(var(--c-brand-500)); }
.tema-painel .chave[aria-checked="true"] > span { transform: translateX(18px); }
.tema-painel .chave:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
/* decorações desligadas: o mascote fica, mais apagado */
.tema-mascote.apagado > .corpo { opacity: 0.55; filter: saturate(0.6); }
.tema-mascote.apagado:hover > .corpo,
.tema-mascote.apagado.aberto > .corpo { opacity: 1; filter: none; }

/* O balão abre para a direita: o mascote mora encostado na esquerda, e
   centralizado o texto saía cortado pela borda da tela. */
.tema-mascote .balao {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  transform: translateY(4px);
  white-space: nowrap;
  padding: 5px 10px;
  border-radius: 10px;
  background: rgb(15 15 20 / 0.92);
  border: 1px solid rgb(var(--c-brand-500) / 0.5);
  color: #fff;
  font: 600 12px/1.2 Poppins, ui-sans-serif, system-ui, sans-serif;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
.tema-mascote:hover .balao,
.tema-mascote.falando .balao { opacity: 1; transform: translateY(0); }
@media (max-width: 640px) {
  .tema-mascote { width: 46px; }
}

/* ------------------------------------------- abóbora (Halloween) */
.tema-abobora .olho { transform-box: fill-box; transform-origin: 50% 55%; transition: transform 0.07s ease-in; }
.tema-abobora.piscando .olho,
.tema-abobora.piscadela .olho-d { transform: scaleY(0.12); }
.tema-abobora .brilho { animation: tema-chama 2.8s ease-in-out infinite; }
@keyframes tema-chama {
  0%, 100% { opacity: 1; }
  20%      { opacity: 0.82; }
  23%      { opacity: 0.95; }
  55%      { opacity: 0.88; }
  60%      { opacity: 1; }
  78%      { opacity: 0.8; }
}
/* luz da vela vazando pela frente, no chão */
.tema-abobora .luz {
  position: absolute;
  left: 30%;
  right: -60%;
  bottom: -14px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(251 146 60 / 0.45), transparent);
  animation: tema-chama 2.8s ease-in-out infinite;
  pointer-events: none;
}

/* ---------------------------------------- mascotes que só se mexem */
.tema-balanca-lado > .corpo svg { animation: tema-balanca-lado 2.4s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes tema-balanca-lado {
  0%, 100% { transform: rotate(-7deg); }
  50%      { transform: rotate(7deg); }
}
.tema-bate > .corpo svg { animation: tema-bate 1.1s ease-in-out infinite; }
@keyframes tema-bate {
  0%, 100% { transform: scale(1); }
  12%      { transform: scale(1.12); }
  24%      { transform: scale(0.98); }
  36%      { transform: scale(1.08); }
}
.tema-tremelica > .corpo svg .chama { transform-box: fill-box; transform-origin: 50% 100%; animation: tema-chama-sobe 0.5s ease-in-out infinite alternate; }
@keyframes tema-chama-sobe {
  from { transform: scaleY(0.9) skewX(-3deg); opacity: 0.9; }
  to   { transform: scaleY(1.08) skewX(3deg); opacity: 1; }
}
.tema-chacoalha.mexendo > .corpo svg { animation: tema-chacoalha 0.6s ease-in-out; }
@keyframes tema-chacoalha {
  0%, 100% { transform: rotate(0); }
  20%      { transform: rotate(-12deg); }
  40%      { transform: rotate(10deg); }
  60%      { transform: rotate(-7deg); }
  80%      { transform: rotate(4deg); }
}

/* ========================================================= prévia */

/* Acima da faixa de anúncio (40px no rodapé), numa linha só. */
.tema-previa {
  position: fixed;
  left: 50%;
  bottom: 62px;
  white-space: nowrap;
  z-index: 2500;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px 7px 14px;
  border: 1px solid rgb(255 255 255 / 0.14);
  border-radius: 9999px;
  background: rgb(10 10 14 / 0.92);
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.5);
  color: #e2e8f0;
  font: 500 12px/1.2 Poppins, ui-sans-serif, system-ui, sans-serif;
  backdrop-filter: blur(6px);
}
.tema-previa b { color: #fff; }
.tema-previa span.so-voce { color: #94a3b8; }
.tema-previa a {
  padding: 5px 11px;
  border-radius: 9999px;
  background: rgb(255 255 255 / 0.08);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}
.tema-previa a:hover { background: rgb(255 255 255 / 0.16); }
@media (max-width: 640px) {
  .tema-previa { gap: 8px; padding: 6px 6px 6px 12px; font-size: 11px; }
  .tema-previa span.so-voce { display: none; }
}

/* ================================================ menos movimento */

@media (prefers-reduced-motion: reduce) {
  .tema-camada *,
  .tema-camada *::before,
  .tema-mascote > .corpo,
  .tema-mascote svg { animation: none !important; transition: none !important; }
  .tema-aranha { transform: translateY(60px); }
}

/* Botão do Discord no Halloween: a caveira animada no lugar do ícone, depois
   que ela ganha src (o common.js solta no load; até lá fica o ícone). */
html[data-tema="halloween"] .discord-flutuante:not(:has(.discord-gif[data-src-depois])) .discord-svg { display: none !important; }
html[data-tema="halloween"] .discord-flutuante .discord-gif:not([data-src-depois]) { display: block !important; }


/* ================================================ temas Minecraft (cosmético)
 * Só existem como tema do painel de quem tem. O fundo usa as texturas do
 * próprio jogo (public/cosmeticos/mc/temas/), pixeladas e escurecidas para o
 * texto continuar legível; a decoração que se mexe mora no temas.js. */

html[data-tema="nether"] {
  --c-brand-50: 255 247 237; --c-brand-100: 255 237 213; --c-brand-200: 254 215 170; --c-brand-300: 253 186 116;
  --c-brand-400: 251 146 60; --c-brand-500: 249 115 22; --c-brand-600: 234 88 12; --c-brand-700: 194 65 12;
  --c-brand-800: 154 52 18; --c-brand-900: 124 45 18;
  --c-babyblue-100: 254 243 199; --c-babyblue-200: 253 230 138; --c-babyblue-300: 252 211 77; --c-babyblue-400: 251 191 36;
  --c-babyblue-500: 245 158 11; --c-babyblue-600: 217 119 6;
  --c-accent-400: 248 113 113; --c-accent-500: 239 68 68; --c-accent-600: 220 38 38;
  --c-surface-950: 16 5 4; --c-surface-900: 26 8 6; --c-surface-800: 38 12 9; --c-surface-700: 54 17 12;
  --c-surface-600: 74 24 17; --c-surface-500: 96 32 22;
  --tema-halo: rgb(249 115 22 / 0.16);
}
html[data-tema="nether"] body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; image-rendering: pixelated;
  background:
    radial-gradient(120% 40% at 50% 112%, rgb(255 120 20 / 0.42), transparent 62%),
    linear-gradient(180deg, rgb(18 4 4 / 0.93), rgb(26 6 5 / 0.84) 70%, rgb(40 8 4 / 0.7)),
    url("/cosmeticos/mc/temas/netherrack.png");
  background-size: 100% 100%, 100% 100%, 64px 64px;
  animation: tema-nether-calor 4s ease-in-out infinite alternate;
}
@keyframes tema-nether-calor { from { filter: brightness(0.92); } to { filter: brightness(1.12) saturate(1.1); } }
html[data-tema="nether"] .btn-brand {
  background-image: linear-gradient(110deg, #c2410c 0%, #f97316 35%, #fde047 50%, #f97316 65%, #9a3412 100%);
  background-size: 250% 100%; animation: tema-rubi-brilho 3.5s linear infinite;
}
html[data-tema="nether"] main h1 {
  background-image: linear-gradient(90deg, #fde68a, #f97316, #dc2626, #f97316, #fde68a); background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: tema-rubi-brilho 7s linear infinite;
}
.tema-lava {
  position: absolute; left: 0; right: 0; bottom: 0; height: 14px; image-rendering: pixelated;
  background: url("/cosmeticos/mc/temas/lava.png") 0 0 / 28px 28px repeat-x;
  box-shadow: 0 -6px 26px 6px rgb(255 110 20 / 0.45);
  animation: tema-lava-corre 9s linear infinite;
}
@keyframes tema-lava-corre { to { background-position: 280px 0; } }

html[data-tema="end"] {
  --c-brand-50: 250 245 255; --c-brand-100: 243 232 255; --c-brand-200: 233 213 255; --c-brand-300: 216 180 254;
  --c-brand-400: 192 132 252; --c-brand-500: 168 85 247; --c-brand-600: 147 51 234; --c-brand-700: 126 34 206;
  --c-brand-800: 107 33 168; --c-brand-900: 88 28 135;
  --c-babyblue-100: 236 254 255; --c-babyblue-200: 207 250 254; --c-babyblue-300: 165 243 252; --c-babyblue-400: 103 232 249;
  --c-babyblue-500: 34 211 238; --c-babyblue-600: 8 145 178;
  --c-accent-400: 240 171 252; --c-accent-500: 217 70 239; --c-accent-600: 192 38 211;
  --c-surface-950: 9 5 15; --c-surface-900: 15 8 24; --c-surface-800: 23 13 36; --c-surface-700: 34 19 52;
  --c-surface-600: 47 27 72; --c-surface-500: 63 37 96;
  --tema-halo: rgb(168 85 247 / 0.16);
}
html[data-tema="end"] body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; image-rendering: pixelated;
  background:
    linear-gradient(180deg, rgb(10 4 18 / 0.78), rgb(14 6 24 / 0.9)),
    url("/cosmeticos/mc/temas/end-portal.png"),
    url("/cosmeticos/mc/temas/end-portal.png");
  background-size: 100% 100%, 256px 256px, 512px 512px;
  animation: tema-end-deriva 90s linear infinite;
}
@keyframes tema-end-deriva { to { background-position: 0 0, 256px 512px, -512px 256px; } }
html[data-tema="end"] .btn-brand {
  background-image: linear-gradient(110deg, #7e22ce 0%, #a855f7 35%, #f0abfc 50%, #a855f7 65%, #581c87 100%);
  background-size: 250% 100%; animation: tema-rubi-brilho 4s linear infinite;
}
html[data-tema="end"] main h1 {
  background-image: linear-gradient(90deg, #f5f3ff, #c084fc, #22d3ee, #c084fc, #f5f3ff); background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: tema-rubi-brilho 8s linear infinite;
}

html[data-tema="mar-profundo"] {
  --c-brand-50: 236 254 255; --c-brand-100: 207 250 254; --c-brand-200: 165 243 252; --c-brand-300: 103 232 249;
  --c-brand-400: 34 211 238; --c-brand-500: 6 182 212; --c-brand-600: 8 145 178; --c-brand-700: 14 116 144;
  --c-brand-800: 21 94 117; --c-brand-900: 22 78 99;
  --c-babyblue-100: 204 251 241; --c-babyblue-200: 153 246 228; --c-babyblue-300: 94 234 212; --c-babyblue-400: 45 212 191;
  --c-babyblue-500: 20 184 166; --c-babyblue-600: 13 148 136;
  --c-accent-400: 251 146 60; --c-accent-500: 249 115 22; --c-accent-600: 234 88 12;
  --c-surface-950: 3 14 24; --c-surface-900: 5 21 35; --c-surface-800: 8 30 48; --c-surface-700: 12 42 64;
  --c-surface-600: 17 56 84; --c-surface-500: 24 72 106;
  --tema-halo: rgb(34 211 238 / 0.14);
}
html[data-tema="mar-profundo"] body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; image-rendering: pixelated;
  background:
    repeating-linear-gradient(100deg, rgb(170 235 255 / 0.1) 0 46px, transparent 46px 150px),
    linear-gradient(180deg, rgb(6 40 62 / 0.5), rgb(3 16 30 / 0.8) 55%, rgb(2 10 20 / 0.94)),
    url("/cosmeticos/mc/temas/agua.png");
  background-size: 180% 60%, 100% 100%, 64px 64px;
  background-repeat: no-repeat, no-repeat, repeat;
  animation: tema-mar-luz 9s ease-in-out infinite alternate, tema-mar-agua 40s linear infinite;
}
@keyframes tema-mar-luz { from { background-position: 0% 0%, 0 0, 0 0; } to { background-position: 60% 0%, 0 0, 0 0; } }
@keyframes tema-mar-agua { to { background-position: 60% 0%, 0 0, 128px 256px; } }
html[data-tema="mar-profundo"] .btn-brand {
  background-image: linear-gradient(110deg, #0e7490 0%, #06b6d4 35%, #a5f3fc 50%, #06b6d4 65%, #155e75 100%);
  background-size: 250% 100%; animation: tema-rubi-brilho 4.5s linear infinite;
}
html[data-tema="mar-profundo"] main h1 {
  background-image: linear-gradient(90deg, #ecfeff, #22d3ee, #2dd4bf, #22d3ee, #ecfeff); background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: tema-rubi-brilho 8s linear infinite;
}
.tema-peixe { position: absolute; width: 34px; image-rendering: pixelated; animation: tema-peixe-nada linear forwards; }
.tema-peixe svg { display: block; width: 100%; height: auto; }
.tema-peixe.volta { transform: scaleX(-1); }
@keyframes tema-peixe-nada {
  from { translate: var(--de) 0; } 25% { margin-top: -6px; } 50% { margin-top: 4px; } 75% { margin-top: -4px; } to { translate: var(--ate) 0; }
}

html[data-tema="profundezas"] {
  --c-brand-50: 236 254 255; --c-brand-100: 207 250 254; --c-brand-200: 165 243 252; --c-brand-300: 103 232 249;
  --c-brand-400: 34 211 238; --c-brand-500: 6 182 212; --c-brand-600: 8 145 178; --c-brand-700: 14 116 144;
  --c-brand-800: 21 94 117; --c-brand-900: 22 78 99;
  --c-babyblue-100: 207 250 254; --c-babyblue-200: 165 243 252; --c-babyblue-300: 103 232 249; --c-babyblue-400: 34 211 238;
  --c-babyblue-500: 6 182 212; --c-babyblue-600: 8 145 178;
  --c-accent-400: 94 234 212; --c-accent-500: 20 184 166; --c-accent-600: 13 148 136;
  --c-surface-950: 2 7 10; --c-surface-900: 4 12 16; --c-surface-800: 7 18 24; --c-surface-700: 11 27 35;
  --c-surface-600: 16 38 48; --c-surface-500: 22 52 64;
  --tema-halo: rgb(34 211 238 / 0.10);
}
html[data-tema="profundezas"] body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; image-rendering: pixelated;
  background:
    linear-gradient(180deg, rgb(2 6 9 / 0.94) 0%, rgb(2 7 10 / 0.82) 50%, rgb(2 8 11 / 0.3) 100%),
    url("/cosmeticos/mc/temas/sculk.png");
  background-size: 100% 100%, 48px 48px;
  animation: tema-sculk-pulsa 3.2s ease-in-out infinite;
}
@keyframes tema-sculk-pulsa { 0%, 100% { filter: brightness(0.9); } 50% { filter: brightness(1.25) saturate(1.3); } }
html[data-tema="profundezas"] .btn-brand {
  background-image: linear-gradient(110deg, #155e75 0%, #0891b2 35%, #67e8f9 50%, #0891b2 65%, #164e63 100%);
  background-size: 250% 100%; animation: tema-rubi-brilho 3.2s linear infinite;
}
html[data-tema="profundezas"] main h1 { color: #a5f3fc; text-shadow: 0 0 14px rgb(34 211 238 / 0.55); }
.tema-sculk-chao {
  position: absolute; left: 0; right: 0; bottom: 0; height: 64px; image-rendering: pixelated;
  background: url("/cosmeticos/mc/temas/sculk.png") 0 0 / 32px 32px repeat;
  -webkit-mask-image: linear-gradient(0deg, #000 30%, transparent); mask-image: linear-gradient(0deg, #000 30%, transparent);
  animation: tema-sculk-pulsa 3.2s ease-in-out infinite;
}
.tema-onda {
  position: absolute; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%;
  border: 2px solid rgb(41 223 235 / 0.9); box-shadow: 0 0 12px rgb(41 223 235 / 0.6), inset 0 0 12px rgb(41 223 235 / 0.4);
  animation: tema-onda 1.6s ease-out forwards;
}
.tema-onda.grande { animation-duration: 2.6s; border-width: 3px; }
@keyframes tema-onda { from { transform: scale(0.2); opacity: 1; } to { transform: scale(var(--ate, 5)); opacity: 0; } }

html[data-tema="overworld"] {
  --c-brand-50: 240 253 244; --c-brand-100: 220 252 231; --c-brand-200: 187 247 208; --c-brand-300: 134 239 172;
  --c-brand-400: 74 222 128; --c-brand-500: 34 197 94; --c-brand-600: 22 163 74; --c-brand-700: 21 128 61;
  --c-brand-800: 22 101 52; --c-brand-900: 20 83 45;
  --c-babyblue-100: 224 242 254; --c-babyblue-200: 186 230 253; --c-babyblue-300: 125 211 252; --c-babyblue-400: 56 189 248;
  --c-babyblue-500: 14 165 233; --c-babyblue-600: 2 132 199;
  --c-accent-400: 250 204 21; --c-accent-500: 234 179 8; --c-accent-600: 202 138 4;
  --c-surface-950: 8 15 12; --c-surface-900: 12 22 17; --c-surface-800: 17 31 24; --c-surface-700: 24 43 33;
  --c-surface-600: 33 58 45; --c-surface-500: 44 76 59;
  --tema-halo: transparent;
}
/* O céu: as cores vêm do temas.js pela hora de Brasília (--ceu-1 em cima, --ceu-2 no horizonte). */
html[data-tema="overworld"] body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, var(--ceu-1, #1f4f8f) 0, var(--ceu-2, #2f6aa8) 240px, rgb(var(--c-surface-950)) 520px);
  transition: background 4s ease;
}
.tema-astro { position: absolute; width: 72px; height: 72px; image-rendering: pixelated; transition: left 60s linear, top 60s linear; }
.tema-astro.lua { background: url("/cosmeticos/mc/temas/lua.png") 0 0 / 400% 200% no-repeat; }
.tema-astro.sol { background: url("/cosmeticos/mc/temas/sol.png") center / 100% 100% no-repeat; filter: drop-shadow(0 0 18px rgb(255 240 160 / 0.8)); }
.tema-nuvens {
  position: absolute; left: 0; right: 0; top: 26px; height: 64px; opacity: 0.55; image-rendering: pixelated;
  background: url("/cosmeticos/mc/temas/nuvens.png") 0 0 / 1024px 512px repeat-x;
  animation: tema-nuvens 240s linear infinite;
}
@keyframes tema-nuvens { to { background-position: 1024px 0; } }
.tema-estrela { position: absolute; width: 2px; height: 2px; background: #fff; animation: tema-estrela 3s ease-in-out infinite; }
@keyframes tema-estrela { 0%, 100% { opacity: 0.2; } 50% { opacity: 1; } }

/* As partículas de imagem (brasas, bolhas, almas) e os mascotes de bloco. */
.tema-gota img { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.tema-mascote img { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.tema-mascote.brilha > .corpo { filter: drop-shadow(0 0 10px rgb(170 240 255 / 0.85)); }
.tema-estilhaco { position: absolute; width: 5px; height: 5px; animation: tema-estilhaco 0.7s ease-out forwards; }
@keyframes tema-estilhaco { to { transform: translate(var(--dx), var(--dy)); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  html[data-tema="nether"] body::before, html[data-tema="end"] body::before, html[data-tema="mar-profundo"] body::before,
  html[data-tema="profundezas"] body::before, html[data-tema="nether"] .btn-brand, html[data-tema="end"] .btn-brand,
  html[data-tema="mar-profundo"] .btn-brand, html[data-tema="profundezas"] .btn-brand,
  html[data-tema="nether"] main h1, html[data-tema="end"] main h1, html[data-tema="mar-profundo"] main h1,
  .tema-lava, .tema-nuvens { animation: none; }
}

html[data-tema="end"] .tema-faisca-end { background: #e9b3ff; box-shadow: 0 0 6px 1px rgb(176 75 255 / 0.9); }
