/* ===== Thèmes (jeux de variables de couleur) + décor kawaii ===== */
/* Chaque thème est peaufiné pour un bon contraste et une palette cohérente. */

:root{ /* Sombre (défaut) — gris neutre, sans teinte */
  --bg:#0e0e10; --sidebar:#151517; --panel:#161618; --panel-2:#1e1e21;
  --line:#2a2a2e; --line-soft:#212124; --text:#e7e7ea; --muted:#9a9aa0; --faint:#66666d;
  --accent:#39d6c1; --accent-ink:#052623; --accent-dim:rgba(57,214,193,.12); --accent-line:rgba(57,214,193,.35);
  --danger:#f0716f; --amber:#e8a33d; --radius:12px;
}
:root[data-theme="light"]{ /* Clair — blanc neutre, gris doux */
  --bg:#f4f4f5; --sidebar:#ffffff; --panel:#ffffff; --panel-2:#f0f0f1;
  --line:#e2e2e4; --line-soft:#ededee; --text:#1b1b1d; --muted:#5f5f64; --faint:#9a9aa0;
  --accent:#0e9f8d; --accent-ink:#ffffff; --accent-dim:rgba(14,159,141,.12); --accent-line:rgba(14,159,141,.42);
  --danger:#d0433f; --amber:#a86d15;
}
:root[data-theme="ocean"]{ /* Océan — bleus profonds, accent cyan clair */
  --bg:#081521; --sidebar:#0c1c2c; --panel:#102434; --panel-2:#163044;
  --line:#204058; --line-soft:#1a3346; --text:#dcecf8; --muted:#89a4bd; --faint:#5b7189;
  --accent:#54c1ff; --accent-ink:#04212f; --accent-dim:rgba(84,193,255,.13); --accent-line:rgba(84,193,255,.42);
  --danger:#ff7a8a; --amber:#ffc061;
}
:root[data-theme="terminal"]{ /* Terminal — vert phosphore sur noir */
  --bg:#010402; --sidebar:#04120b; --panel:#05170d; --panel-2:#081f13;
  --line:#0e4026; --line-soft:#0a301c; --text:#9dffc4; --muted:#4dba80; --faint:#2c7350;
  --accent:#2dff86; --accent-ink:#012011; --accent-dim:rgba(45,255,134,.12); --accent-line:rgba(45,255,134,.4);
  --danger:#ff6b6b; --amber:#eaff66;
}
:root[data-theme="sunset"]{ /* Sunset — ambre & rose chauds sur brun sombre */
  --bg:#170d12; --sidebar:#20141a; --panel:#271821; --panel-2:#33202b;
  --line:#4c313d; --line-soft:#3a2631; --text:#ffe6da; --muted:#cd9d92; --faint:#8c6057;
  --accent:#ff9166; --accent-ink:#2a1108; --accent-dim:rgba(255,145,102,.14); --accent-line:rgba(255,145,102,.45);
  --danger:#ff6b6b; --amber:#ffc266;
}
:root[data-theme="kawaii"]{ /* Kawaii — rose bonbon, coins très arrondis */
  --bg:#ffdbef; --sidebar:#ffe6f4; --panel:#ffedf7; --panel-2:#ffd6ec;
  --line:#ffb8db; --line-soft:#ffcce4; --text:#7a1f4f; --muted:#c06389; --faint:#e695bd;
  --accent:#ff4f9d; --accent-ink:#ffffff; --accent-dim:rgba(255,79,157,.16); --accent-line:rgba(255,79,157,.55);
  --danger:#e0557f; --amber:#d98a3d; --radius:20px;
}
:root[data-theme="kawaii"] body{ background:linear-gradient(160deg,#ffd0ea 0%,#ffbfe2 50%,#ffd7ee 100%); }

/* ----- Décor kawaii : chats memes SVG (repli) + images perso, en PETIT ----- */
.kawaii-decor{ display:none; }
:root[data-theme="kawaii"] .kawaii-decor{ display:block; }
.kawaii-decor.has-memes .kd-svg{ display:none; }
.kd{ position:fixed; pointer-events:none; z-index:1; }
.kd1{ bottom:14px; left:14px; width:60px; animation:bob 3.2s ease-in-out infinite; }
.kd2{ top:84px; right:26px; width:26px; animation:floaty 4s ease-in-out infinite; }
.kd3{ bottom:18px; right:16px; width:52px; animation:bob 3.6s ease-in-out infinite .4s; }
.kd4{ top:130px; left:28px; width:20px; animation:twinkle 2.4s ease-in-out infinite; }
/* images perso (memes de chat) : petites vignettes flottantes */
.kdm{ width:66px; height:auto; border-radius:10px; box-shadow:0 6px 18px rgba(214,90,150,.3); }
.kdm1{ bottom:14px; left:14px; animation:bob 3.4s ease-in-out infinite; }
.kdm2{ bottom:18px; right:14px; animation:bob 3.8s ease-in-out infinite .3s; }
.kdm3{ top:86px; right:20px; animation:floaty 4.2s ease-in-out infinite; }
.kdm4{ top:120px; left:20px; animation:floaty 3.6s ease-in-out infinite .5s; }
@keyframes bob{ 0%,100%{ transform:translateY(0) rotate(-3deg);} 50%{ transform:translateY(-9px) rotate(3deg);} }
@keyframes floaty{ 0%,100%{ transform:translateY(0) rotate(-6deg);} 50%{ transform:translateY(-12px) rotate(6deg);} }
@keyframes twinkle{ 0%,100%{ opacity:.35; transform:scale(.8);} 50%{ opacity:1; transform:scale(1.1);} }
@media (prefers-reduced-motion:reduce){ .kd,.kdm{ animation:none!important; } }

/* ----- Effet CRT (scanlines) : thème Terminal uniquement ----- */
.fx-scanlines{ position:fixed; inset:0; z-index:4; pointer-events:none; display:none; }
:root[data-theme="terminal"] .fx-scanlines{ display:block; }
:root[data-theme="terminal"] .fx-scanlines::before{ content:""; position:absolute; inset:0;
  background:repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0, rgba(0,0,0,0) 2px, rgba(0,0,0,.22) 3px, rgba(0,0,0,.22) 3px); }
:root[data-theme="terminal"] .fx-scanlines::after{ content:""; position:absolute; inset:0;
  background:radial-gradient(ellipse at center, rgba(45,255,134,.06), transparent 72%); animation:crtflicker 4s steps(30) infinite; }
@keyframes crtflicker{ 0%,100%{ opacity:.55; } 47%{ opacity:.7; } 53%{ opacity:.62; } }
@media (prefers-reduced-motion:reduce){ :root[data-theme="terminal"] .fx-scanlines::after{ animation:none; } }

/* ----- Effets d'ambiance par thème ----- */
.theme-fx{ position:fixed; inset:0; pointer-events:none; z-index:1; display:none; }
:root[data-theme="ocean"] .theme-fx, :root[data-theme="sunset"] .theme-fx{ display:block; }
:root[data-theme="ocean"] .theme-fx{ background:radial-gradient(120% 55% at 50% -8%, rgba(84,193,255,.13), transparent 62%); animation:oceanGlow 7s ease-in-out infinite; }
@keyframes oceanGlow{ 0%,100%{ opacity:.5; } 50%{ opacity:1; } }
:root[data-theme="sunset"] .theme-fx{ background:radial-gradient(110% 55% at 50% 108%, rgba(255,145,102,.14), transparent 60%); }
:root[data-theme="sunset"] .theme-fx::after{ content:""; position:absolute; inset:0; opacity:.05; mix-blend-mode:overlay;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E"); }
@media (prefers-reduced-motion:reduce){ :root[data-theme="ocean"] .theme-fx{ animation:none; } }
