/* ============================================================
   themes.css — paleta base + temas dinamicos (hora x estacion)
   ============================================================ */

:root {
  /* --- Paleta base del proyecto --- */
  --c-black:  #0a0812;
  --c-blue:   #1f6feb;
  --c-purple: #7a2bd6;
  --c-orange: #ff8a3d;
  --c-cream:  #f6e7c8;
  --c-lime:   #b6ff3b;   /* acento de contraste */
  --c-cyan:   #38e8ff;
  --c-pink:   #ff5fa2;
  --c-red:    #ff4d4d;

  /* --- Variables que consumen las animaciones / CRT --- */
  --theme-lime: var(--c-lime);
  --theme-cyan: var(--c-cyan);
  --crt-scanlines-opacity: var(--crt-opacity, 0.06);
  --crt-brightness: 1;

  /* --- Acentos (los sobrescribe la estacion) --- */
  --a1: var(--c-pink);
  --a2: var(--c-purple);

  /* --- Superficies (las sobrescribe la hora del dia) --- */
  --bg-1: #0b0a18;
  --bg-2: #1a1330;
  --fg:   #eaf2ff;
  --fg-dim: #8b93ab;
  --panel: rgba(255, 255, 255, 0.035);
  --panel-solid: #0e0918;
  --line: rgba(234, 242, 255, 0.14);

  /* --- Cielo de la ventana de la escena --- */
  --sky-1: #040a1c;
  --sky-2: #0f2a55;
  --sky-orb: #eaf7ff;
  --sky-glow: rgba(200, 240, 255, 0.7);
  --sky-stars: 1;

  /* --- Temporada: tinte de la escena y color del clima --- */
  --season-tint: transparent;
  --time-beam: transparent;
  --w-col: #eaf7ff;
  --w-col-2: #bfe9ff;
  --tree-1: #4fb04a;
  --tree-2: #358a3c;
  --tree-dot: #ff9fc8;
  --hill: #3a7d3f;

  /* --- Efectos --- */
  --crt-opacity: 0.06;
  --crt-brightness: 0.5;
  --glow-color: rgba(56, 232, 255, 0.14);

  /* --- Geometria pixel --- */
  --px: 4px;
  --shadow-hard: 8px 8px 0 rgba(0, 0, 0, 0.55);
  --font-pixel: "Courier New", "Lucida Console", ui-monospace, monospace;
  --font-body: "Trebuchet MS", "Segoe UI", Tahoma, sans-serif;
  --font-display: "Arial Black", "Segoe UI Black", system-ui, sans-serif;
  --ease: 140ms steps(4, end);
}

/* ============================================================
   ESTACIONES -> acentos
   ============================================================ */
html[data-season="spring"] {
  --a1: #ff5fa2;
  --a2: #7a2bd6;
  --season-icon: "\273F"; /* flor */
  --season-tint:
    radial-gradient(58% 44% at 12% 6%, rgba(255, 95, 162, 0.30), transparent 72%),
    linear-gradient(180deg, rgba(182, 255, 59, 0.09), rgba(255, 95, 162, 0.06));
  --w-col: #ff9fc8;
  --w-col-2: #b6ff3b;
  --tree-1: #7fd06a;
  --tree-2: #55a34a;
  --tree-dot: #ff9fc8;
  --hill: #4f9a4a;
}
html[data-season="summer"] {
  --a1: #ff8a3d;
  --a2: #ffd23d;
  --season-icon: "\2600"; /* sol */
  --season-tint:
    radial-gradient(55% 50% at 10% 5%, rgba(255, 210, 61, 0.34), transparent 72%),
    linear-gradient(180deg, rgba(255, 138, 61, 0.11), rgba(255, 210, 61, 0.03));
  --w-col: #ffe08a;
  --w-col-2: #fff3b8;
  --tree-1: #4fb04a;
  --tree-2: #358a3c;
  --tree-dot: #fff3b8;
  --hill: #3a7d3f;
}
html[data-season="autumn"] {
  --a1: #ff7a2f;
  --a2: #c0451f;
  --season-icon: "\1F342"; /* hoja */
  --season-tint:
    radial-gradient(58% 46% at 12% 7%, rgba(255, 138, 61, 0.34), transparent 72%),
    linear-gradient(180deg, rgba(192, 69, 31, 0.16), rgba(255, 122, 47, 0.06));
  --w-col: #ff8a3d;
  --w-col-2: #c0451f;
  --tree-1: #ff9a3d;
  --tree-2: #c9571f;
  --tree-dot: #ffd23d;
  --hill: #7a5a2f;
}
html[data-season="winter"] {
  --a1: #38e8ff;
  --a2: #1f6feb;
  --season-icon: "\2744"; /* copo */
  --season-tint:
    radial-gradient(58% 46% at 12% 7%, rgba(56, 232, 255, 0.24), transparent 72%),
    linear-gradient(180deg, rgba(31, 111, 235, 0.16), rgba(200, 240, 255, 0.06));
  --w-col: #eaf7ff;
  --w-col-2: #bfe9ff;
  --tree-1: #dbe9f5;
  --tree-2: #b3d0e6;
  --tree-dot: #ffffff;
  --hill: #cfe3f2;
}

/* ============================================================
   MOMENTO DEL DIA -> superficies, luz, cielo y CRT
   ============================================================ */
html[data-time="day"] {
  --bg-1: #0c1330;
  --bg-2: #1b2a5c;
  --fg: #eaf2ff;
  --fg-dim: #9aa6c2;
  --panel: rgba(255, 255, 255, 0.04);
  --panel-solid: #0d1223;
  --line: rgba(234, 242, 255, 0.16);
  --crt-opacity: 0.04;
  --crt-brightness: 0.4;
  --glow-color: rgba(56, 232, 255, 0.16);
  --sky-1: #2f6fb8;
  --sky-2: #9ecdf2;
  --sky-orb: #fff3b8;
  --sky-glow: rgba(255, 240, 180, 0.65);
  --sky-stars: 0;
  --time-beam: linear-gradient(112deg, rgba(255, 246, 200, 0.16) 0 10%, rgba(255, 246, 200, 0.05) 10% 22%, transparent 33%);
}
html[data-time="evening"] {
  --bg-1: #0a0714;
  --bg-2: #231238;
  --fg: #eaf2ff;
  --fg-dim: #9c8fb0;
  --panel: rgba(255, 255, 255, 0.04);
  --panel-solid: #120b1f;
  --line: rgba(234, 242, 255, 0.15);
  --crt-opacity: 0.06;
  --crt-brightness: 0.55;
  --glow-color: rgba(255, 138, 61, 0.18);
  --sky-1: #2a1c5e;
  --sky-2: #b4587a;
  --sky-orb: #ffb36b;
  --sky-glow: rgba(255, 179, 107, 0.6);
  --sky-stars: 0.55;
  --time-beam: linear-gradient(112deg, rgba(255, 150, 90, 0.18) 0 10%, rgba(255, 150, 90, 0.05) 10% 22%, transparent 33%);
}
html[data-time="dawn"] {
  --bg-1: #0d0a20;
  --bg-2: #3b1c3d;
  --fg: #ffeaf3;
  --fg-dim: #b7a0ba;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-solid: #150d22;
  --line: rgba(255, 234, 243, 0.16);
  --crt-opacity: 0.05;
  --crt-brightness: 0.45;
  --glow-color: rgba(255, 138, 61, 0.22);
  --sky-1: #232a68;
  --sky-2: #ffa06e;
  --sky-orb: #ffd98a;
  --sky-glow: rgba(255, 180, 120, 0.8);
  --sky-stars: 0.3;
  --time-beam: linear-gradient(112deg, rgba(255, 186, 120, 0.22) 0 10%, rgba(255, 186, 120, 0.06) 10% 22%, transparent 33%);
}
html[data-time="night"] {
  --bg-1: #05040a;
  --bg-2: #0b0818;
  --fg: #eaf2ff;
  --fg-dim: #8b93ab;
  --panel: rgba(255, 255, 255, 0.035);
  --panel-solid: #0a0714;
  --line: rgba(234, 242, 255, 0.14);
  --crt-opacity: 0.09;
  --crt-brightness: 0.75;
  --glow-color: rgba(182, 255, 59, 0.16);
  --sky-1: #040a1c;
  --sky-2: #0f2a55;
  --sky-orb: #eaf7ff;
  --sky-glow: rgba(200, 240, 255, 0.7);
  --sky-stars: 1;
}

/* Fechas senaladas: retocan los acentos sin cambiar el resto */
body.is-halloween { --a1: #ff8a3d; --a2: #7a2bd6; }
body.is-christmas { --a1: #ff4d4d; --a2: #b6ff3b; }
body.is-newyear  { --a1: #ffd23d; --a2: #38e8ff; }

/* Fondo del documento */
body {
  background:
    radial-gradient(120% 90% at 50% 0%, var(--bg-2) 0%, var(--bg-1) 55%, var(--c-black) 100%);
  background-attachment: fixed;
  color: var(--fg);
  transition: background 600ms linear, color 600ms linear;
}

/* ============================================================
   CRT: scanlines + vineta + parpadeo
   ============================================================ */
.crt {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9000;
  background-image:
    linear-gradient(rgba(0, 0, 0, var(--crt-scanlines-opacity)) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, calc(var(--crt-scanlines-opacity) * 0.6)) 1px, transparent 1px);
  background-size: 4px 4px, 4px 4px;
  mix-blend-mode: multiply;
  opacity: var(--crt-brightness);
  transition: opacity 600ms linear;
}

.crt::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 120% at 50% 50%,
    transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

@media (prefers-reduced-motion: reduce) {
  .crt { display: none; }
}
