/* Sistema visual de temas comemorativos do Impacto Diário. */
:root {
  --theme-primary: #0f172a;
  --theme-secondary: #1f2937;
  --theme-accent: #d10f35;
  --theme-page-background: #f6f8fb;
  --theme-card-background: #ffffff;
  --theme-text: #0f172a;
  --theme-text-on-primary: #ffffff;
  --theme-decoration-opacity: 0.42;
  --theme-animation-speed: 1;
  --theme-particle-count: 24;
}

body.theme-active,
body.seasonal-theme-active {
  --accent-color: var(--theme-accent);
  --accent: var(--theme-accent);
  --accent-dark: color-mix(in srgb, var(--theme-accent) 76%, #000000);
  --bg: var(--theme-page-background);
  --footer: color-mix(in srgb, var(--theme-primary) 88%, #020617);
  --accent-soft: color-mix(in srgb, var(--theme-accent) 14%, transparent);
  --gradient-accent: linear-gradient(135deg, var(--theme-primary), var(--theme-accent));
  --background-color: var(--theme-page-background);
  --surface-color: var(--theme-card-background);
  --seasonal-primary: var(--theme-primary);
  --seasonal-accent: var(--theme-accent);
  --seasonal-background: var(--theme-page-background);
  --seasonal-surface: var(--theme-card-background);
  --seasonal-title-color: var(--theme-text);
  min-height: 100%;
  overflow-x: clip;
  isolation: isolate;
  background:
    radial-gradient(circle at 9% 8%, color-mix(in srgb, var(--theme-accent) 24%, transparent), transparent 28vw),
    radial-gradient(circle at 92% 6%, color-mix(in srgb, var(--theme-secondary) 22%, transparent), transparent 30vw),
    linear-gradient(180deg, color-mix(in srgb, var(--theme-page-background) 82%, #ffffff) 0%, var(--theme-page-background) 56%, #ffffff 100%) !important;
  color: var(--theme-text);
}

body.theme-active > *:not(.commemorative-background),
body.seasonal-theme-active > *:not(.commemorative-background) {
  position: relative;
  z-index: 1;
}

body.theme-active header,
body.theme-active nav,
body.theme-active .article-viewer,
body.theme-active .toast-container,
body.theme-active .cookie-banner,
body.seasonal-theme-active header,
body.seasonal-theme-active nav,
body.seasonal-theme-active .article-viewer,
body.seasonal-theme-active .toast-container,
body.seasonal-theme-active .cookie-banner {
  z-index: 20;
}

body.theme-active .modal,
body.theme-active .auth-modal,
body.theme-active .share-menu,
body.theme-active [role="dialog"],
body.seasonal-theme-active .modal,
body.seasonal-theme-active .auth-modal,
body.seasonal-theme-active .share-menu,
body.seasonal-theme-active [role="dialog"] {
  z-index: 1000;
}

.commemorative-background {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  contain: layout paint style;
}

.commemorative-background[hidden] {
  display: none !important;
}

.commemorative-bg-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.commemorative-item {
  position: absolute;
  pointer-events: none;
  user-select: none;
  opacity: var(--theme-decoration-opacity);
  will-change: transform, opacity;
}

body.theme-intensity-discrete {
  --theme-decoration-opacity: 0.2;
}

body.theme-intensity-medium {
  --theme-decoration-opacity: 0.38;
}

body.theme-intensity-high {
  --theme-decoration-opacity: 0.56;
}

body.theme-motion-paused .commemorative-item,
body.theme-motion-paused .seasonal-particles span,
body.theme-motion-paused .seasonal-banner-icon,
body.theme-motion-paused .seasonal-header-band,
body.theme-motion-paused .seasonal-header-word,
body.theme-motion-paused .seasonal-header-icon,
body.theme-motion-paused .seasonal-header-bunting,
body.theme-motion-paused .seasonal-header-ribbon,
body.theme-motion-paused .seasonal-header-flag-card {
  animation-play-state: paused !important;
}

body.theme-active header[role="banner"],
body.theme-active nav[role="navigation"] {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--theme-card-background) 82%, var(--theme-primary)) 0%, var(--theme-card-background) 58%, color-mix(in srgb, var(--theme-accent) 18%, var(--theme-card-background)) 100%) !important;
  border-color: color-mix(in srgb, var(--theme-accent) 30%, transparent) !important;
}

body.theme-active header[role="banner"],
body.seasonal-theme-active header[role="banner"] {
  overflow: hidden;
  isolation: isolate;
}

body.theme-active header[role="banner"] > :not(.seasonal-header-decor),
body.seasonal-theme-active header[role="banner"] > :not(.seasonal-header-decor) {
  position: relative;
  z-index: 2;
}

.seasonal-header-decor {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.seasonal-header-decor[hidden] {
  display: none !important;
}

.seasonal-header-band,
.seasonal-header-word,
.seasonal-header-icon,
.seasonal-header-bunting,
.seasonal-header-ribbon,
.seasonal-header-flag-card {
  position: absolute;
  will-change: transform, opacity;
}

.seasonal-header-band {
  width: min(360px, 28vw);
  height: 74px;
  border: 1px solid color-mix(in srgb, var(--theme-accent) 42%, transparent);
  border-radius: 999px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--theme-primary) 28%, transparent), color-mix(in srgb, var(--theme-accent) 26%, transparent));
  opacity: 0.42;
  transform: rotate(-14deg);
  animation: seasonalHeaderFloat calc(9s / var(--theme-animation-speed)) ease-in-out infinite;
}

.seasonal-header-band.one { left: -92px; top: 18px; --decor-rotate: -14deg; }
.seasonal-header-band.two { right: -72px; top: 34px; --decor-rotate: 16deg; animation-delay: -3s; }
.seasonal-header-band.three { left: 35%; bottom: -42px; width: min(420px, 34vw); --decor-rotate: -4deg; animation-delay: -5s; }

.seasonal-header-word {
  color: color-mix(in srgb, var(--theme-primary) 78%, var(--theme-accent));
  font-size: clamp(0.72rem, 1.1vw, 0.92rem);
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.18;
  animation: seasonalHeaderDrift calc(16s / var(--theme-animation-speed)) linear infinite;
}

.seasonal-header-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid color-mix(in srgb, var(--theme-accent) 38%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--theme-card-background) 72%, transparent);
  color: var(--theme-primary);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--theme-accent) 16%, transparent);
  animation: seasonalHeaderPulse calc(4.6s / var(--theme-animation-speed)) ease-in-out infinite;
}

.seasonal-header-bunting-line {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--theme-primary), var(--theme-accent));
  opacity: 0.55;
}

.seasonal-header-bunting {
  top: 2px;
  width: 18px;
  height: 24px;
  border-radius: 0 0 4px 4px;
  clip-path: polygon(0 0, 100% 0, 100% 76%, 50% 100%, 0 76%);
  opacity: 0.82;
  animation: seasonalHeaderSwing calc(3.8s / var(--theme-animation-speed)) ease-in-out infinite;
  transform-origin: 50% 0;
}

.seasonal-header-ribbon {
  width: 24px;
  height: 34px;
  border: 3px solid var(--theme-accent);
  border-bottom: 0;
  border-radius: 14px 14px 4px 4px;
  opacity: 0.5;
  animation: seasonalHeaderPulse calc(5.2s / var(--theme-animation-speed)) ease-in-out infinite;
}

.seasonal-header-ribbon::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -12px;
  width: 18px;
  height: 18px;
  border-right: 3px solid var(--theme-accent);
  border-bottom: 3px solid var(--theme-accent);
  transform: translateX(-50%) rotate(45deg);
}

.seasonal-header-flag-card {
  width: 72px;
  height: 48px;
  border-radius: 8px;
  background: #159447;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
  opacity: 0.34;
  transform: rotate(-8deg);
  animation: seasonalHeaderFloat calc(8s / var(--theme-animation-speed)) ease-in-out infinite;
}

.seasonal-header-flag-card::before {
  content: "";
  position: absolute;
  inset: 9px 14px;
  background: #f8d532;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}

.seasonal-header-flag-card::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #1d4ed8;
  transform: translate(-50%, -50%);
}

body.theme-setembro-amarelo .seasonal-header-band,
body.seasonal-kind-setembro_amarelo .seasonal-header-band {
  background: repeating-linear-gradient(90deg, rgba(250, 204, 21, 0.28) 0 18px, rgba(255, 255, 255, 0.16) 18px 34px);
}

body.theme-7-de-setembro .seasonal-header-band,
body.theme-sete-de-setembro .seasonal-header-band,
body.seasonal-kind-sete_de_setembro .seasonal-header-band {
  background: linear-gradient(90deg, rgba(21, 148, 71, 0.34), rgba(248, 213, 50, 0.3), rgba(29, 78, 216, 0.26));
}

body.theme-7-de-setembro #site-description,
body.theme-sete-de-setembro #site-description,
body.seasonal-kind-sete_de_setembro #site-description {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: #064e3b !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.85);
  box-shadow: 0 8px 18px rgba(15, 81, 50, 0.1);
}

body.theme-natal .seasonal-header-band,
body.seasonal-kind-natal .seasonal-header-band {
  background: repeating-linear-gradient(90deg, rgba(15, 118, 110, 0.26) 0 22px, rgba(220, 38, 38, 0.2) 22px 42px);
}

@keyframes seasonalHeaderFloat {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(var(--decor-rotate, -14deg)); }
  50% { transform: translate3d(0, -8px, 0) rotate(calc(var(--decor-rotate, -14deg) + 2deg)); }
}

@keyframes seasonalHeaderPulse {
  0%, 100% { opacity: 0.5; transform: translate3d(0, 0, 0) scale(1); }
  50% { opacity: 0.88; transform: translate3d(0, -4px, 0) scale(1.05); }
}

@keyframes seasonalHeaderDrift {
  from { transform: translate3d(-18vw, 0, 0); }
  to { transform: translate3d(118vw, 0, 0); }
}

@keyframes seasonalHeaderSwing {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(4deg); }
}

body.theme-active .site-logo-icon,
body.theme-active .footer-logo-icon,
body.theme-active section h2 i,
body.theme-active .legal-pill:hover {
  color: var(--theme-accent) !important;
}

body.theme-active header h1,
body.theme-active section h2,
body.theme-active .financial-card h3,
body.theme-active .live-header h3,
body.theme-active .premium-channel-panel h3,
body.theme-active .footer-logo,
body.theme-active .panel h2 {
  color: var(--theme-text) !important;
}

body.theme-active .home-action,
body.theme-active nav a,
body.theme-active .premium-type-tab,
body.theme-active .source-tab,
body.theme-active .legal-pill {
  color: var(--theme-text) !important;
}

body.theme-active .home-action.live,
body.theme-active .home-action.account,
body.theme-active .home-action:hover,
body.theme-active nav a.active,
body.theme-active nav a:hover,
body.theme-active .read-more,
body.theme-active .search-button,
body.theme-active .refresh-button,
body.theme-active .retry-btn,
body.theme-active .exchange-form button,
body.theme-active .admin-primary,
body.theme-active .button,
body.theme-active .contact-form button,
body.theme-active .premium-type-tab.active,
body.theme-active .source-tab.active {
  background: linear-gradient(135deg, var(--theme-primary), var(--theme-accent)) !important;
  border-color: transparent !important;
  color: var(--theme-text-on-primary) !important;
  box-shadow: 0 14px 28px color-mix(in srgb, var(--theme-accent) 18%, transparent) !important;
}

body.theme-active .home-action,
body.theme-active .trust-strip a,
body.theme-active .trust-strip span,
body.theme-active .carousel-container,
body.theme-active .news-card,
body.theme-active .financial-card,
body.theme-active .live-container,
body.theme-active .premium-channel-panel,
body.theme-active .premium-watch-area,
body.theme-active .premium-paywall,
body.theme-active .premium-payment-card,
body.theme-active .conversion-history,
body.theme-active .exchange-result,
body.theme-active .admin-panel,
body.theme-active .panel,
body.theme-active .benefit-card,
body.theme-active .side-card,
body.theme-active article {
  background: color-mix(in srgb, var(--theme-card-background) 92%, transparent) !important;
  border-color: color-mix(in srgb, var(--theme-accent) 24%, transparent) !important;
}

body.theme-active .news-card:hover,
body.theme-active .carousel-container:hover,
body.theme-active .benefit-card:hover,
body.theme-active .premium-channel-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px color-mix(in srgb, var(--theme-accent) 16%, transparent) !important;
}

body.theme-active .source,
body.theme-active .news-category,
body.theme-active .premium-channel-card small,
body.theme-active .meta span {
  background: color-mix(in srgb, var(--theme-accent) 14%, #ffffff) !important;
  color: var(--theme-primary) !important;
}

body.theme-active footer,
body.seasonal-theme-active footer {
  width: 100%;
  color: #f8fafc !important;
}

body.theme-active footer .footer-logo,
body.theme-active footer .footer-logo span,
body.theme-active footer .footer-summary,
body.theme-active footer .footer-column a,
body.theme-active footer .legal-links a,
body.theme-active footer #footer-credit,
body.theme-active footer #footer-credit span,
body.seasonal-theme-active footer .footer-logo,
body.seasonal-theme-active footer .footer-logo span,
body.seasonal-theme-active footer .footer-summary,
body.seasonal-theme-active footer .footer-column a,
body.seasonal-theme-active footer .legal-links a,
body.seasonal-theme-active footer #footer-credit,
body.seasonal-theme-active footer #footer-credit span {
  color: rgba(248, 250, 252, 0.92) !important;
}

body.theme-active footer .footer-logo,
body.theme-active footer .footer-column h3,
body.theme-active footer .footer-sponsors-title,
body.seasonal-theme-active footer .footer-logo,
body.seasonal-theme-active footer .footer-column h3,
body.seasonal-theme-active footer .footer-sponsors-title {
  color: #ffffff !important;
}

body.theme-active.theme-ad-badges .ad-card,
body.theme-active.theme-ad-badges .footer-sponsor-card,
body.theme-active.theme-ad-badges .sponsor-note {
  position: relative;
  overflow: hidden;
}

body.theme-active.theme-ad-badges .ad-card::before,
body.theme-active.theme-ad-badges .footer-sponsor-card::after,
body.theme-active.theme-ad-badges .sponsor-note::before {
  content: var(--seasonal-ad-label, "Especial");
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  max-width: calc(100% - 16px);
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--theme-accent);
  color: var(--theme-text-on-primary);
  font-size: 0.68rem;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.theme-active:not(.theme-ad-badges) .ad-card::before {
  display: none !important;
  content: "" !important;
}

.seasonal-banner {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding: 8px 18px;
  border-top: 1px solid color-mix(in srgb, var(--theme-accent) 25%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--theme-accent) 25%, transparent);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--theme-primary) 92%, #000), var(--theme-secondary), var(--theme-accent)) !important;
  color: var(--theme-text-on-primary, #ffffff);
}

.seasonal-banner[hidden] {
  display: none !important;
}

.seasonal-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 10% 40%, rgba(255,255,255,.18), transparent 20%),
    radial-gradient(circle at 86% 0%, rgba(255,255,255,.16), transparent 28%);
  opacity: 0.85;
}

.seasonal-banner-main {
  position: relative;
  z-index: 2;
  width: min(1680px, calc(100% - 24px));
  min-height: 42px;
  margin: 0 auto;
  border: 1px solid rgba(255, 255, 255, .58);
  border-radius: 999px !important;
  padding: 7px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(255,255,255,.9) !important;
  color: color-mix(in srgb, var(--theme-primary, #0f172a) 86%, #000);
  box-shadow: 0 12px 28px rgba(15, 23, 42, .12);
  text-align: center;
}

.seasonal-banner-icon {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--theme-accent, #d10f35);
  color: var(--theme-text-on-primary, #fff);
  font-size: .84rem;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--theme-accent, #d10f35) 30%, transparent);
}

.seasonal-banner-copy {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.seasonal-banner-copy strong {
  overflow: hidden;
  color: inherit;
  font-size: clamp(.88rem, 1.2vw, 1rem);
  font-weight: 950;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seasonal-banner-copy small {
  overflow: hidden;
  color: color-mix(in srgb, var(--theme-primary, #0f172a) 72%, #fff);
  font-size: .84rem;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seasonal-banner-period {
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--theme-accent, #d10f35) 32%, transparent);
  border-radius: 999px;
  padding: 5px 10px;
  background: color-mix(in srgb, var(--theme-accent, #d10f35) 12%, #fff);
  color: color-mix(in srgb, var(--theme-primary, #0f172a) 82%, #000);
  font-size: .76rem;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

.seasonal-particles {
  display: none !important;
}

.theme-natal {
  --theme-page-background: #f3fdf8;
  --theme-card-background: #ffffff;
}

.theme-7-de-setembro {
  --theme-page-background: #effdf4;
  --theme-card-background: #ffffff;
}

.theme-sao-joao {
  --theme-page-background: #fff7ed;
}

.theme-carnaval {
  --theme-page-background: #fff8fb;
}

.theme-ano-novo {
  --theme-page-background: #f8fafc;
}

.theme-setembro-amarelo {
  --theme-page-background: #fffbeb;
}

.theme-top-garland,
.theme-footer-glow,
.theme-side-rail,
.theme-br-flag,
.theme-small-flag,
.theme-bunting-line,
.theme-bunting,
.theme-snowflake,
.theme-star,
.theme-gift,
.theme-branch,
.theme-balloon,
.theme-fire,
.theme-confetti,
.theme-streamer,
.theme-mask,
.theme-firework,
.theme-gold-particle,
.theme-ribbon,
.theme-light-dot,
.theme-custom-image {
  transform: translateZ(0);
}

.theme-top-garland {
  top: 0;
  left: 0;
  right: 0;
  height: 82px;
  opacity: calc(var(--theme-decoration-opacity) + 0.12);
  background:
    radial-gradient(circle at 8% 12px, var(--theme-accent) 0 5px, transparent 6px),
    radial-gradient(circle at 18% 18px, var(--theme-secondary) 0 4px, transparent 5px),
    radial-gradient(circle at 30% 12px, #ffffff 0 4px, transparent 5px),
    linear-gradient(90deg, transparent, color-mix(in srgb, var(--theme-accent) 18%, transparent), transparent);
  background-size: 220px 82px, 220px 82px, 220px 82px, 100% 100%;
  animation: themeGarlandMove calc(22s / var(--theme-animation-speed)) linear infinite;
}

.theme-footer-glow {
  left: 0;
  right: 0;
  bottom: 0;
  height: 160px;
  background: radial-gradient(ellipse at 50% 100%, color-mix(in srgb, var(--theme-accent) 28%, transparent), transparent 70%);
}

.theme-side-rail {
  top: 90px;
  bottom: 110px;
  width: min(90px, 8vw);
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--theme-accent) 26%, transparent), color-mix(in srgb, var(--theme-secondary) 18%, transparent), transparent);
  filter: blur(1px);
}

.theme-side-rail.left { left: 0; }
.theme-side-rail.right { right: 0; }

.theme-custom-image {
  right: min(42px, 4vw);
  bottom: min(110px, 12vh);
  width: min(180px, 22vw);
  max-height: 220px;
  object-fit: contain;
  opacity: calc(var(--theme-decoration-opacity) + 0.12);
  filter: drop-shadow(0 16px 30px rgba(0,0,0,.18));
  animation: themeSoftFloat calc(8s / var(--theme-animation-speed)) ease-in-out infinite;
}

.theme-br-flag {
  right: min(64px, 5vw);
  top: min(170px, 18vh);
  width: min(260px, 24vw);
  aspect-ratio: 14 / 10;
  border-radius: 8px;
  overflow: hidden;
  opacity: calc(var(--theme-decoration-opacity) + 0.12);
  background: #159447;
  box-shadow: 0 24px 60px rgba(15, 81, 50, .2);
  transform-origin: 50% 50%;
  animation: themeFlagWave calc(3.8s / var(--theme-animation-speed)) ease-in-out infinite;
}

.theme-br-flag::before {
  content: "";
  position: absolute;
  inset: 18% 12%;
  background: #f8d532;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}

.theme-br-flag::after {
  content: "";
  position: absolute;
  inset: 28% 33%;
  border-radius: 999px;
  background:
    linear-gradient(8deg, transparent 42%, #ffffff 43% 49%, transparent 50%),
    #1d4ed8;
  box-shadow: inset 0 0 0 999px rgba(0,0,0,.02);
}

.theme-small-flag {
  width: 46px;
  height: 32px;
  border-radius: 4px;
  background: #159447;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), 0 8px 20px rgba(15,23,42,.12);
  animation: themeSmallFlag calc(5s / var(--theme-animation-speed)) ease-in-out infinite;
}

.theme-small-flag::before {
  content: "";
  position: absolute;
  inset: 7px 9px;
  background: #f8d532;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}

.theme-small-flag::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  left: 18px;
  top: 11px;
  border-radius: 50%;
  background: #1d4ed8;
}

.theme-bunting-line {
  top: 16px;
  left: -5vw;
  width: 110vw;
  height: 2px;
  background: color-mix(in srgb, var(--theme-primary) 42%, transparent);
  opacity: calc(var(--theme-decoration-opacity) + 0.12);
}

.theme-bunting {
  top: 18px;
  width: 28px;
  height: 32px;
  border-radius: 2px 2px 12px 12px;
  background: var(--theme-accent);
  clip-path: polygon(0 0, 100% 0, 100% 76%, 50% 100%, 0 76%);
  animation: themeBuntingSwing calc(3.6s / var(--theme-animation-speed)) ease-in-out infinite;
  transform-origin: 50% 0;
}

.theme-bunting.junina {
  width: 30px;
  height: 34px;
}

.theme-snowflake {
  width: var(--flake-size, 7px);
  height: var(--flake-size, 7px);
  border-radius: 999px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 0 12px rgba(255,255,255,.82);
  animation: themeSnowFall var(--fall-duration, 14s) linear infinite;
}

.theme-star {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--theme-accent) 70%, #ffffff);
  box-shadow: 0 0 18px color-mix(in srgb, var(--theme-accent) 80%, transparent);
  animation: themeTwinkle calc(var(--twinkle-duration, 5s) / var(--theme-animation-speed)) ease-in-out infinite;
}

.theme-gift {
  width: 36px;
  height: 32px;
  border-radius: 6px;
  background:
    linear-gradient(90deg, transparent 42%, #facc15 42% 58%, transparent 58%),
    linear-gradient(180deg, #dc2626 0 34%, #b91c1c 34% 100%);
  box-shadow: 0 10px 24px rgba(220, 38, 38, .18);
  animation: themeSoftFloat calc(7s / var(--theme-animation-speed)) ease-in-out infinite;
}

.theme-branch {
  width: 90px;
  height: 26px;
  border-radius: 999px;
  background: repeating-linear-gradient(135deg, #166534 0 12px, #0f766e 12px 24px);
  transform: rotate(var(--branch-rotate, -16deg));
  animation: themeSoftFloat calc(9s / var(--theme-animation-speed)) ease-in-out infinite;
}

.theme-balloon {
  width: 44px;
  height: 58px;
  border-radius: 50% 50% 42% 42%;
  background: radial-gradient(circle at 32% 24%, rgba(255,255,255,.72), transparent 24%), var(--balloon-color, var(--theme-accent));
  box-shadow: 0 14px 34px color-mix(in srgb, var(--theme-accent) 18%, transparent);
  animation: themeBalloonUp var(--balloon-duration, 18s) linear infinite;
}

.theme-balloon::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -18px;
  width: 1px;
  height: 20px;
  background: color-mix(in srgb, var(--theme-primary) 45%, transparent);
}

.theme-fire {
  left: min(62px, 5vw);
  bottom: 74px;
  width: 84px;
  height: 72px;
  opacity: calc(var(--theme-decoration-opacity) + 0.18);
}

.theme-fire::before,
.theme-fire::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 12px;
  border-radius: 54% 46% 50% 50%;
  transform: translateX(-50%) rotate(45deg);
  animation: themeFlame calc(1.7s / var(--theme-animation-speed)) ease-in-out infinite;
}

.theme-fire::before {
  width: 46px;
  height: 46px;
  background: #f97316;
}

.theme-fire::after {
  width: 28px;
  height: 28px;
  background: #facc15;
  animation-delay: -.6s;
}

.theme-confetti {
  width: 9px;
  height: 16px;
  border-radius: 2px;
  background: var(--confetti-color, var(--theme-accent));
  animation: themeConfettiFall var(--confetti-duration, 9s) linear infinite;
}

.theme-streamer {
  width: 86px;
  height: 20px;
  border: 3px solid var(--streamer-color, var(--theme-accent));
  border-left-color: transparent;
  border-right-color: transparent;
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
  animation: themeStreamer calc(8s / var(--theme-animation-speed)) ease-in-out infinite;
}

.theme-mask {
  width: 82px;
  height: 42px;
  border-radius: 48% 48% 56% 56%;
  background:
    radial-gradient(circle at 30% 52%, #0f172a 0 7px, transparent 8px),
    radial-gradient(circle at 70% 52%, #0f172a 0 7px, transparent 8px),
    linear-gradient(135deg, var(--theme-accent), var(--theme-secondary));
  animation: themeSoftFloat calc(7s / var(--theme-animation-speed)) ease-in-out infinite;
}

.theme-firework {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #facc15;
  box-shadow:
    0 -28px 0 0 rgba(250,204,21,.75),
    22px -18px 0 0 rgba(255,255,255,.65),
    28px 0 0 0 rgba(250,204,21,.55),
    18px 22px 0 0 rgba(255,255,255,.55),
    0 28px 0 0 rgba(250,204,21,.48),
    -22px 18px 0 0 rgba(255,255,255,.55),
    -28px 0 0 0 rgba(250,204,21,.55),
    -18px -22px 0 0 rgba(255,255,255,.65);
  animation: themeFirework calc(5.5s / var(--theme-animation-speed)) ease-out infinite;
}

.theme-gold-particle {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #facc15;
  box-shadow: 0 0 16px rgba(250,204,21,.8);
  animation: themeGoldRise var(--gold-duration, 12s) linear infinite;
}

.theme-ribbon {
  width: 42px;
  height: 54px;
  animation: themeRibbonFloat calc(11s / var(--theme-animation-speed)) ease-in-out infinite;
}

.theme-ribbon::before,
.theme-ribbon::after {
  content: "";
  position: absolute;
  top: 6px;
  width: 18px;
  height: 42px;
  border: 7px solid #facc15;
  border-bottom-color: transparent;
  border-radius: 999px 999px 8px 8px;
}

.theme-ribbon::before {
  left: 5px;
  transform: rotate(28deg);
}

.theme-ribbon::after {
  right: 5px;
  transform: rotate(-28deg);
}

.theme-light-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--theme-accent) 78%, #ffffff);
  box-shadow: 0 0 20px color-mix(in srgb, var(--theme-accent) 70%, transparent);
  animation: themeGentleGlow calc(6s / var(--theme-animation-speed)) ease-in-out infinite;
}

.theme-top-brazil {
  background:
    linear-gradient(90deg, #159447 0 28%, #f8d532 28% 58%, #1d4ed8 58% 78%, #ffffff 78% 100%);
  height: 36px;
  clip-path: polygon(0 0, 100% 0, 100% 58%, 96% 100%, 92% 58%, 88% 100%, 84% 58%, 80% 100%, 76% 58%, 72% 100%, 68% 58%, 64% 100%, 60% 58%, 56% 100%, 52% 58%, 48% 100%, 44% 58%, 40% 100%, 36% 58%, 32% 100%, 28% 58%, 24% 100%, 20% 58%, 16% 100%, 12% 58%, 8% 100%, 4% 58%, 0 100%);
}

.theme-preview-card {
  position: relative;
  overflow: hidden;
}

.seasonal-theme-advanced,
.seasonal-toggle-grid {
  grid-column: 1 / -1;
}

.seasonal-theme-advanced {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  padding: 14px;
  background: color-mix(in srgb, var(--surface-muted, #f8fafc) 86%, #ffffff);
}

.seasonal-toggle-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.seasonal-toggle-grid label,
.seasonal-theme-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  padding: 9px 10px;
  background: var(--surface-color, #ffffff);
  color: var(--primary-color, #0f172a);
  font-weight: 800;
}

.admin-color-control {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.admin-color-control input[type="color"] {
  width: 54px;
  height: 44px;
  border: 1px solid var(--border-color, #dbe3ef);
  border-radius: 8px;
  padding: 4px;
  background: var(--surface-color, #fff);
  cursor: pointer;
}

.admin-color-control input[type="text"] {
  min-height: 44px;
  font-family: Consolas, "Courier New", monospace;
  text-transform: lowercase;
}

.theme-range-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.theme-range-row output {
  min-width: 46px;
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--primary-color, #0f172a);
  color: #fff;
  text-align: center;
  font-weight: 900;
}

.seasonal-theme-preview {
  position: relative;
  min-height: 260px !important;
  align-items: stretch !important;
  padding: 0 !important;
  border-radius: 8px !important;
  overflow: hidden;
  background:
    radial-gradient(circle at 14% 12%, color-mix(in srgb, var(--seasonal-preview-accent, #d10f35) 32%, transparent), transparent 34%),
    linear-gradient(135deg, var(--seasonal-preview-primary, #0f172a), var(--seasonal-preview-secondary, #1f2937)) !important;
  color: var(--seasonal-preview-text-on-primary, #ffffff) !important;
}

.theme-preview-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.theme-preview-ui {
  position: relative;
  z-index: 2;
  width: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 16px;
  padding: 18px;
}

.theme-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.theme-preview-logo,
.theme-preview-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255,255,255,.16);
  color: inherit;
  font-weight: 950;
}

.theme-preview-content {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 14px;
  align-items: stretch;
}

.theme-preview-hero,
.theme-preview-news {
  display: grid;
  align-content: center;
  gap: 10px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(12px);
}

.theme-preview-hero strong {
  font-size: clamp(1.15rem, 3vw, 1.7rem) !important;
  line-height: 1.08;
}

.theme-preview-hero small,
.theme-preview-news p {
  margin: 0;
  color: rgba(255,255,255,.84);
  font-weight: 700;
}

.theme-preview-button {
  width: fit-content;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--seasonal-preview-accent, #d10f35);
  color: var(--seasonal-preview-text-on-primary, #fff);
  font-weight: 950;
}

.theme-preview-badge {
  width: fit-content;
  border-radius: 999px;
  padding: 5px 9px;
  background: color-mix(in srgb, var(--seasonal-preview-accent, #d10f35) 74%, #fff);
  color: var(--seasonal-preview-text-on-primary, #fff);
  font-size: .72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.theme-preview-mini {
  position: absolute;
  opacity: .76;
  animation: themePreviewDrift calc(7s / var(--theme-animation-speed, 1)) ease-in-out infinite;
}

.seasonal-schedule-warning {
  grid-column: 1 / -1;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff7ed;
  color: #9a3412;
  font-weight: 800;
}

.seasonal-schedule-warning.ok {
  background: #ecfdf5;
  color: #047857;
}

.seasonal-schedule-warning[hidden] {
  display: none;
}

@keyframes themeGarlandMove {
  from { background-position: 0 0, 0 0, 0 0, 0 0; }
  to { background-position: 220px 0, 220px 0, 220px 0, 0 0; }
}

@keyframes themeFlagWave {
  0%, 100% { transform: perspective(460px) rotateY(-7deg) skewY(-1deg) translate3d(0,0,0); filter: brightness(1); }
  50% { transform: perspective(460px) rotateY(7deg) skewY(1.6deg) translate3d(0,-4px,0); filter: brightness(1.08); }
}

@keyframes themeSmallFlag {
  0%, 100% { transform: rotate(-4deg) translate3d(0,0,0); }
  50% { transform: rotate(5deg) translate3d(0,-8px,0); }
}

@keyframes themeBuntingSwing {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(6deg); }
}

@keyframes themeSnowFall {
  0% { opacity: 0; transform: translate3d(var(--snow-x, 0), -12vh, 0) rotate(0deg); }
  12% { opacity: var(--theme-decoration-opacity); }
  100% { opacity: 0; transform: translate3d(calc(var(--snow-x, 0) + var(--snow-drift, 36px)), 112vh, 0) rotate(220deg); }
}

@keyframes themeTwinkle {
  0%, 100% { opacity: .2; transform: scale(.8); }
  50% { opacity: .9; transform: scale(1.25); }
}

@keyframes themeSoftFloat {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(var(--float-rotate, 0deg)); }
  50% { transform: translate3d(0, -14px, 0) rotate(calc(var(--float-rotate, 0deg) + 2deg)); }
}

@keyframes themeBalloonUp {
  0% { opacity: 0; transform: translate3d(0, 108vh, 0) rotate(-4deg); }
  14% { opacity: var(--theme-decoration-opacity); }
  100% { opacity: 0; transform: translate3d(var(--balloon-drift, 24px), -18vh, 0) rotate(6deg); }
}

@keyframes themeFlame {
  0%, 100% { transform: translateX(-50%) rotate(45deg) scale(.92); opacity: .8; }
  50% { transform: translateX(-50%) rotate(45deg) scale(1.1); opacity: 1; }
}

@keyframes themeConfettiFall {
  0% { opacity: 0; transform: translate3d(0, -12vh, 0) rotate(0deg); }
  10% { opacity: var(--theme-decoration-opacity); }
  100% { opacity: 0; transform: translate3d(var(--confetti-drift, 40px), 112vh, 0) rotate(540deg); }
}

@keyframes themeStreamer {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(-12deg); }
  50% { transform: translate3d(18px, -16px, 0) rotate(12deg); }
}

@keyframes themeFirework {
  0% { opacity: 0; transform: scale(.3); filter: blur(0); }
  28% { opacity: calc(var(--theme-decoration-opacity) + .2); transform: scale(1); }
  100% { opacity: 0; transform: scale(1.7); filter: blur(1px); }
}

@keyframes themeGoldRise {
  0% { opacity: 0; transform: translate3d(0, 112vh, 0) scale(.8); }
  18% { opacity: var(--theme-decoration-opacity); }
  100% { opacity: 0; transform: translate3d(var(--gold-drift, 20px), -18vh, 0) scale(1.22); }
}

@keyframes themeRibbonFloat {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(-4deg); opacity: calc(var(--theme-decoration-opacity) + .08); }
  50% { transform: translate3d(0, -18px, 0) rotate(6deg); opacity: calc(var(--theme-decoration-opacity) + .2); }
}

@keyframes themeGentleGlow {
  0%, 100% { opacity: .18; transform: scale(.88); }
  50% { opacity: calc(var(--theme-decoration-opacity) + .24); transform: scale(1.18); }
}

@keyframes themePreviewDrift {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(-4deg); }
  50% { transform: translate3d(12px, -10px, 0) rotate(7deg); }
}

@media (max-width: 900px) {
  .theme-br-flag {
    width: min(180px, 34vw);
    top: 120px;
    right: -24px;
  }

  .theme-side-rail {
    width: 42px;
  }

  .theme-bunting {
    width: 22px;
    height: 26px;
  }

  .seasonal-header-band {
    width: min(260px, 42vw);
    height: 58px;
  }

  .seasonal-header-icon {
    width: 28px;
    height: 28px;
  }

  .seasonal-theme-advanced,
  .seasonal-toggle-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .theme-preview-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .commemorative-item {
    opacity: min(var(--theme-decoration-opacity), .32);
  }

  .seasonal-banner {
    padding: 8px 10px;
  }

  .seasonal-banner-main {
    width: 100%;
    min-height: 0;
    border-radius: 14px !important;
    padding: 9px 11px;
    justify-content: flex-start;
  }

  .seasonal-banner-copy {
    display: grid;
    gap: 2px;
    text-align: left;
  }

  .seasonal-banner-copy strong,
  .seasonal-banner-copy small {
    white-space: normal;
  }

  .seasonal-banner-period {
    display: none;
  }

  .theme-top-garland {
    height: 48px;
  }

  .theme-footer-glow {
    height: 90px;
  }

  .theme-custom-image,
  .theme-side-rail.right,
  .theme-side-rail.left {
    display: none;
  }

  .seasonal-header-word:nth-of-type(n+12),
  .seasonal-header-icon:nth-of-type(n+16),
  .seasonal-header-flag-card {
    display: none;
  }

  .seasonal-theme-advanced,
  .seasonal-toggle-grid {
    grid-template-columns: 1fr;
  }

  .seasonal-theme-preview {
    min-height: 320px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .commemorative-item,
  .seasonal-banner-icon,
  .seasonal-particles span,
  .seasonal-header-band,
  .seasonal-header-word,
  .seasonal-header-icon,
  .seasonal-header-bunting,
  .seasonal-header-ribbon,
  .seasonal-header-flag-card,
  .theme-preview-mini {
    animation: none !important;
  }
}
