/* =====================================================================
   PRIMEz HUB — Live Wallpaper THEMES (preview)
   Selectable "anime live themes": each = palette + FX preset.
   Palette vars: --c1 primary, --c2 secondary, --c3 hot/accent, --c4 cool.
   ===================================================================== */

/* ---- theme palettes (switchable via [data-theme]) ---- */
:root, [data-theme="limitless"] {
  --c1:#a855f7; --c1-rgb:168,85,247;
  --c2:#4f8cff; --c2-rgb:79,140,255;
  --c3:#e879f9; --c3-rgb:232,121,249;
  --c4:#22d3ee; --c4-rgb:34,211,238;
}
[data-theme="cyber"] {
  --c1:#ff2fd0; --c1-rgb:255,47,208;
  --c2:#00e5ff; --c2-rgb:0,229,255;
  --c3:#ff5cf0; --c3-rgb:255,92,240;
  --c4:#7c4dff; --c4-rgb:124,77,255;
}
[data-theme="matrix"] {
  --c1:#22c55e; --c1-rgb:34,197,94;
  --c2:#16a34a; --c2-rgb:22,163,74;
  --c3:#86efac; --c3-rgb:134,239,172;
  --c4:#a3e635; --c4-rgb:163,230,53;
}
[data-theme="frost"] {
  --c1:#38bdf8; --c1-rgb:56,189,248;
  --c2:#818cf8; --c2-rgb:129,140,248;
  --c3:#a5f3fc; --c3-rgb:165,243,252;
  --c4:#e0f2fe; --c4-rgb:224,242,254;
}
[data-theme="crimson"] {
  --c1:#ef4444; --c1-rgb:239,68,68;
  --c2:#b91c1c; --c2-rgb:185,28,28;
  --c3:#fb7185; --c3-rgb:251,113,133;
  --c4:#f59e0b; --c4-rgb:245,158,11;
}
[data-theme="ember"] {
  --c1:#f59e0b; --c1-rgb:245,158,11;
  --c2:#ef4444; --c2-rgb:239,68,68;
  --c3:#fbbf24; --c3-rgb:251,191,36;
  --c4:#fb923c; --c4-rgb:251,146,60;
}
[data-theme="void"] {
  --c1:#6d28d9; --c1-rgb:109,40,217;
  --c2:#1e3a8a; --c2-rgb:30,58,138;
  --c3:#a78bfa; --c3-rgb:167,139,250;
  --c4:#22d3ee; --c4-rgb:34,211,238;
}

/* ---- runtime vars ---- */
:root {
  --mx:0; --my:0;
  --intensity:1; --speed:1; --wind:1;
  --aura-size:420px; --aura-x:34%; --aura-y:54%;
  --hair-x:46%; --hair-y:30%; --hair-r:24vw;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: #05060a; color: #eef2ff; overflow: hidden; cursor: crosshair;
  font-family: "Segoe UI", system-ui, -apple-system, "Plus Jakarta Sans", sans-serif;
  transition: background .6s ease;
}
body.ui-hidden [data-ui] { opacity: 0 !important; pointer-events: none !important; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------------- WALLPAPER STACK ---------------- */
.stage { position: fixed; inset: 0; overflow: hidden; }
.layer { position: absolute; inset: -6vmax; will-change: transform; }

.wallpaper { inset: -4vmax; animation: breathe calc(16s / var(--speed)) ease-in-out infinite; }
.wall-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(1.15) contrast(1.06) brightness(0.92); transform: scale(1.06); }
@keyframes breathe { 0%,100% { transform: scale(1.02) translate3d(0,0,0); } 50% { transform: scale(1.075) translate3d(0,-0.6%,0); } }

.hair-layer {
  position: absolute; inset: 0;
  -webkit-mask-image: radial-gradient(circle var(--hair-r) at var(--hair-x) var(--hair-y), #000 40%, transparent 74%);
          mask-image: radial-gradient(circle var(--hair-r) at var(--hair-x) var(--hair-y), #000 40%, transparent 74%);
}
.hair-img { filter: url(#hair-wind) saturate(1.25) brightness(1.07) contrast(1.05) drop-shadow(0 0 26px rgba(var(--c1-rgb),0.4)); animation: hairSway calc(6.5s / var(--speed)) ease-in-out infinite; }
@keyframes hairSway {
  0%,100% { transform: scale(1.06) translateX(0) skewX(0deg); }
  25% { transform: scale(1.06) translateX(5px) skewX(-0.5deg); }
  50% { transform: scale(1.06) translateX(-3px) skewX(0.4deg); }
  75% { transform: scale(1.06) translateX(4px) skewX(-0.3deg); }
}
body.hide-hair .hair-layer { display: none; }

/* wash / theme tint */
.wash {
  background:
    radial-gradient(60% 55% at 34% 54%, rgba(var(--c1-rgb),0.30), transparent 62%),
    radial-gradient(45% 45% at 78% 30%, rgba(var(--c2-rgb),0.16), transparent 68%),
    radial-gradient(40% 40% at 15% 80%, rgba(var(--c3-rgb),0.14), transparent 70%);
  mix-blend-mode: screen;
  animation: washPulse calc(7s / var(--speed)) ease-in-out infinite;
  transition: background .6s ease;
}
@keyframes washPulse { 0%,100% { opacity:.55; } 50% { opacity:.95; } }

/* orbs */
.orb { position: absolute; border-radius: 50%; pointer-events: none; z-index: 12; mix-blend-mode: screen;
  background: radial-gradient(circle, #fff 0%, var(--c3) 30%, transparent 70%);
  box-shadow: 0 0 40px var(--c3), 0 0 80px var(--c1); transition: box-shadow .6s ease; }
.orb-1 { width: 90px; height: 90px; top: 55%; left: 44%; animation: floatOrb1 calc(6s / var(--speed)) ease-in-out infinite alternate; }
.orb-2 { width: 38px; height: 38px; top: 38%; left: 30%; opacity: .7; animation: floatOrb2 calc(8s / var(--speed)) ease-in-out infinite alternate; }
@keyframes floatOrb1 { 0% { transform: translate(0,0) scale(1); } 50% { transform: translate(22px,-16px) scale(1.3); } 100% { transform: translate(-16px,10px) scale(.9); } }
@keyframes floatOrb2 { 0% { transform: translate(0,0) scale(1); } 100% { transform: translate(50px,30px) scale(1.5); } }
body.hide-aura .orb { display: none; }

/* aura */
.aura { position: absolute; left: var(--aura-x); top: var(--aura-y); width: var(--aura-size); height: var(--aura-size); transform: translate(-50%,-50%); pointer-events: auto; cursor: grab; z-index: 14; }
.aura.dragging { cursor: grabbing; }
.aura-core, .aura-pulse, .aura-ring { position: absolute; inset: 0; border-radius: 50%; }
.aura-core { background: radial-gradient(circle, rgba(255,255,255,0.95) 0%, rgba(var(--c1-rgb),0.65) 18%, rgba(var(--c1-rgb),0.35) 42%, transparent 68%); filter: blur(6px); animation: auraCore calc(3.4s / var(--speed)) ease-in-out infinite; }
.aura-pulse { background: radial-gradient(circle, rgba(var(--c3-rgb),0.35), transparent 60%); animation: auraPulse calc(3.4s / var(--speed)) ease-out infinite; }
.aura-ring { border: 2px solid rgba(var(--c1-rgb),0.55); box-shadow: 0 0 40px rgba(var(--c1-rgb),0.65), inset 0 0 60px rgba(var(--c2-rgb),0.35); animation: auraRing calc(3.4s / var(--speed)) ease-out infinite; }
@keyframes auraCore { 0%,100% { transform: scale(.92); opacity:.85; } 50% { transform: scale(1.12); opacity:1; } }
@keyframes auraPulse { 0% { transform: scale(.7); opacity:.9; } 100% { transform: scale(1.5); opacity:0; } }
@keyframes auraRing { 0% { transform: scale(.8); opacity:.8; } 100% { transform: scale(1.6); opacity:0; } }
body.hide-aura .aura { display: none; }

/* hair zone */
.zone { position: absolute; left: var(--hair-x); top: var(--hair-y); width: calc(2 * var(--hair-r)); height: calc(2 * var(--hair-r)); transform: translate(-50%,-50%); border-radius: 50%; display: none; pointer-events: auto; cursor: grab; z-index: 26; }
body.edit-zones .zone { display: block; }
.zone-ring { position: absolute; inset: 0; border: 2px dashed rgba(var(--c4-rgb),0.85); border-radius: 50%; box-shadow: 0 0 30px rgba(var(--c4-rgb),0.35); }
.zone-tag { position: absolute; top: -22px; left: 50%; transform: translateX(-50%); font-size: 10px; letter-spacing: .22em; color: var(--c4); white-space: nowrap; }

/* sheen */
.sweep { background: linear-gradient(105deg, transparent 42%, rgba(255,255,255,0.10) 50%, rgba(var(--c3-rgb),0.16) 54%, transparent 62%); mix-blend-mode: screen; animation: sweepMove calc(9s / var(--speed)) linear infinite; }
@keyframes sweepMove { 0% { transform: translateX(-60%) skewX(-8deg); opacity: 0; } 12% { opacity:.9; } 60% { opacity:.5; } 100% { transform: translateX(60%) skewX(-8deg); opacity: 0; } }

.fx { inset: 0; pointer-events: none; }
.scanlines { inset: 0; pointer-events: none; background: repeating-linear-gradient(to bottom, rgba(255,255,255,0.035) 0 1px, transparent 1px 3px); mix-blend-mode: overlay; opacity:.5; animation: scanRoll 8s linear infinite; }
@keyframes scanRoll { 0% { background-position-y: 0; } 100% { background-position-y: 120px; } }
.noise { inset: 0; pointer-events: none; opacity:.05; mix-blend-mode: overlay; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/></filter><rect width='120' height='120' filter='url(%23n)' opacity='0.6'/></svg>"); }
.vignette { inset: 0; pointer-events: none; background: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(0,0,0,0.55) 82%, rgba(0,0,0,0.8) 100%); }
body.hide-scanlines .scanlines { display: none; }

.glitch { position: absolute; inset: 0; pointer-events: none; opacity: 0; }
.glitch.on { opacity: 1; background: linear-gradient(rgba(var(--c3-rgb),0.12), rgba(var(--c2-rgb),0.10)); mix-blend-mode: screen; animation: glitchShift .18s steps(2) 2; }
@keyframes glitchShift { 0% { transform: translate(0,0); clip-path: inset(12% 0 60% 0); } 25% { transform: translate(-6px,2px); clip-path: inset(40% 0 30% 0); } 50% { transform: translate(5px,-3px); clip-path: inset(66% 0 8% 0); } 75% { transform: translate(-3px,1px); clip-path: inset(22% 0 52% 0); } 100% { transform: translate(0,0); clip-path: inset(0 0 0 0); } }
.flash { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(80% 70% at 34% 54%, rgba(var(--c1-rgb),0.55), rgba(var(--c3-rgb),0.18) 45%, transparent 75%); opacity: 0; }
.flash.on { animation: flashPop .28s ease-out; }
@keyframes flashPop { 0% { opacity: 0; } 12% { opacity:.95; } 100% { opacity: 0; } }
body.hide-flash .flash { display: none; }

/* ---------------- HUD ---------------- */
.hud { position: fixed; z-index: 20; transition: opacity .35s ease; }
.hud-top { top: 22px; left: 24px; right: 24px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 20px; color: #fff; background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 0 24px rgba(var(--c1-rgb),0.6); transition: all .6s ease; }
.brand-name { font-weight: 800; letter-spacing: .04em; font-size: 16px; }
.brand-name em { font-style: normal; background: linear-gradient(90deg, var(--c3), var(--c2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-sub { font-size: 10.5px; letter-spacing: .28em; color: #b9c2ff; opacity:.8; }
.badge-live { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 999px; letter-spacing: .12em; border: 1px solid rgba(var(--c3-rgb),0.5); background: rgba(var(--c3-rgb),0.10); transition: all .6s ease; }
.badge-live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c3); box-shadow: 0 0 12px var(--c3); animation: pulseDot 1.6s ease-in-out infinite; }
@keyframes pulseDot { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity:.4; transform: scale(.7); } }

.profile { top: 30%; right: 40px; text-align: right; }
.profile-kanji { font-size: 42px; font-weight: 800; writing-mode: vertical-rl; letter-spacing: .35em; margin-left: auto; background: linear-gradient(180deg, #fff, var(--c3)); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: 0 0 30px rgba(var(--c3-rgb),0.5); transition: all .6s ease; }
.profile-name { font-size: 22px; font-weight: 800; letter-spacing: .3em; margin-top: 14px; }
.profile-tags { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 6px; justify-items: end; }
.profile-tags li { font-size: 11px; letter-spacing: .32em; color: #cbd5ff; opacity:.85; border-bottom: 1px solid rgba(var(--c1-rgb),.5); padding-bottom: 5px; }

.hint { bottom: 22px; left: 24px; display: flex; gap: 18px; flex-wrap: wrap; font-size: 11.5px; color: #aeb6e6; opacity:.8; }

/* ---------------- CONTROLS ---------------- */
.controls { position: fixed; right: 20px; bottom: 20px; z-index: 25; width: 268px; padding: 14px; border-radius: 14px;
  background: rgba(10,12,20,0.72); backdrop-filter: blur(14px); border: 1px solid rgba(var(--c1-rgb),0.35);
  box-shadow: 0 18px 50px rgba(0,0,0,0.6); font-size: 12px; transition: opacity .35s ease, border-color .6s ease; }
.controls-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.controls-head b { letter-spacing: .1em; font-size: 12px; color: #e9d5ff; }
.ctl-hide, .ctl-reset { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.14); color: #eef2ff; border-radius: 8px; padding: 5px 9px; font-size: 11px; cursor: pointer; }
.ctl-hide:hover, .ctl-reset:hover { border-color: var(--c1); }
.ctl-reset.active { border-color: var(--c4); color: var(--c4); }

.theme-label { font-size: 10px; letter-spacing: .22em; color: #aeb6e6; margin: 2px 0 6px; }
.themes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 12px; }
.theme-swatch { position: relative; height: 34px; border-radius: 9px; cursor: pointer; border: 1.5px solid rgba(255,255,255,0.14); background: linear-gradient(135deg, var(--s1), var(--s2)); transition: transform .15s, border-color .15s; }
.theme-swatch:hover { transform: translateY(-2px); }
.theme-swatch.active { border-color: #fff; box-shadow: 0 0 16px rgba(255,255,255,0.35); }
.theme-swatch span { position: absolute; bottom: -14px; left: 0; right: 0; text-align: center; font-size: 8.5px; letter-spacing: .06em; color: #aeb6e6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.themes { margin-bottom: 20px; }

.toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin-bottom: 10px; }
.toggles label { display: flex; align-items: center; gap: 6px; cursor: pointer; color: #cdd5ff; }
.toggles input { accent-color: var(--c1); }
.sliders { display: grid; gap: 8px; margin-bottom: 10px; }
.sliders label { display: grid; gap: 4px; color: #b9c2ff; }
.sliders input[type=range] { width: 100%; accent-color: var(--c3); }
.controls-foot { display: flex; gap: 6px; justify-content: space-between; flex-wrap: wrap; }
.upload { cursor: pointer; font-size: 11px; padding: 6px 10px; border-radius: 8px; background: linear-gradient(135deg, rgba(var(--c1-rgb),0.5), rgba(var(--c2-rgb),0.4)); border: 1px solid rgba(var(--c1-rgb),0.6); }

@media (max-width: 720px) {
  .profile { display: none; }
  .controls { width: 200px; }
  .hint { display: none; }
  .themes { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width:820px){.wallpaper{animation:none !important;} .wall-img{object-fit:contain !important;transform:none !important;} .hair-layer{display:none !important;} .sweep{display:none !important;}}

