/* --------------------------------------------------
   THEME VARIABLES (Emotion Engine v1)
-------------------------------------------------- */
:root {
    --theme-bg: #1f2b4a;
    --theme-glow: rgba(0,150,255,0.25);
}

/* --------------------------------------------------
   GLOBAL
-------------------------------------------------- */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background: radial-gradient(circle at top, var(--theme-bg) 0%, #050814 60%, #02030a 100%);
    font-family: "Inter", system-ui, sans-serif;
    color: white;
    text-align: center;
    overflow-x: hidden;
    transition: background 2.5s ease;
}

.app-container {
    margin-top: 40px;
}

.title {
    font-size: 30px;
    margin-bottom: 15px;
    font-weight: 600;
    opacity: 0.95;
}

/* --------------------------------------------------
   SLEEP MODE
-------------------------------------------------- */
.mode-btn {
    margin-top: 5px;
    padding: 8px 18px;
    background: #2d2d4a;
    color: white;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: 0.3s;
}

.mode-btn.active {
    background: #4a4a7a;
}

body.sleep-mode {
    background: radial-gradient(circle at top, #15152a 0%, #05050b 60%, #010108 100%);
}

.breathing-circle.sleep {
    box-shadow:
        0 0 50px rgba(120, 150, 255, 0.35),
        0 0 120px rgba(80, 100, 255, 0.35);
}

.inner-circle.sleep {
    background: radial-gradient(circle at top, rgba(200,200,255,0.25), rgba(80,80,140,0.25));
}

/* --------------------------------------------------
   BREATHING CIRCLE (JS‑gestuurd)
-------------------------------------------------- */
.breathing-circle {
    width: 260px;
    height: 260px;
    border-radius: 50%;
    margin: 30px auto 0;
    border: 3px solid rgba(255,255,255,0.25);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow:
        0 0 40px var(--theme-glow),
        0 0 80px var(--theme-glow);
    position: relative;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.inner-circle {
    width: 160px;
    height: 160px;
    background: radial-gradient(circle at top, rgba(255,255,255,0.25), rgba(255,255,255,0.05));
    border-radius: 50%;
    backdrop-filter: blur(6px);
    box-shadow:
        inset 0 0 25px rgba(0,0,0,0.4),
        0 0 20px rgba(255,255,255,0.15);
}

/* --------------------------------------------------
   INSTRUCTION TEXT
-------------------------------------------------- */
.instruction {
    margin-top: 20px;
    font-size: 24px;
    opacity: 0;
    animation: fadeText 4s infinite;
}

@keyframes fadeText {
    0% { opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { opacity: 0; }
}

/* --------------------------------------------------
   CONTROLS
-------------------------------------------------- */
.controls {
    margin-top: 35px;
    padding: 20px;
    width: 280px;
    margin-left: auto;
    margin-right: auto;
    background: rgba(10,10,25,0.8);
    border-radius: 18px;
    backdrop-filter: blur(14px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.45);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

label {
    text-align: left;
    font-size: 14px;
    opacity: 0.85;
}

/* SELECT FIX */
select {
    background: rgba(255,255,255,0.08) !important;
    color: white !important;
    border: none;
    padding: 9px;
    border-radius: 10px;
}

select option {
    background: #0d0f1a;
    color: white;
}

input[type="range"],
button {
    padding: 9px;
    border-radius: 10px;
    border: none;
    font-size: 15px;
}

input[type="range"] {
    accent-color: #4a7cff;
}

button {
    background: #4a7cff;
    color: white;
    cursor: pointer;
    transition: 0.2s;
}

button:hover {
    background: #6a92ff;
}

/* Timer */
.timer-controls {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.timer-btn {
    padding: 6px 10px;
    background: #3a4a6a;
    color: white;
    border-radius: 999px;
    font-size: 13px;
}

/* Custom rhythm */
.custom-rhythm {
    margin-top: 15px;
    padding: 14px;
    background: rgba(255,255,255,0.04);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.custom-rhythm input {
    padding: 7px;
    background: rgba(255,255,255,0.12);
    color: white;
}

/* --------------------------------------------------
   MAGIC ENGINE v1
-------------------------------------------------- */
.mind-fog {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at 50% 60%, rgba(255,255,255,0.08), rgba(0,0,0,0.6));
    opacity: 0.25;
    filter: blur(40px);
    transition: opacity 0.6s ease, filter 0.6s ease;
    z-index: -1;
}

.fog-heavy {
    opacity: 0.55;
    filter: blur(70px);
}

.fog-clear {
    opacity: 0.10;
    filter: blur(20px);
}

.portal-rim {
    position: absolute;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    border: 2px solid rgba(120, 180, 255, 0.25);
    box-shadow: 0 0 40px rgba(120, 180, 255, 0.25);
    opacity: 0.4;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.portal-pulse {
    position: absolute;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    background: radial-gradient(circle, rgba(120,180,255,0.25), transparent 70%);
    opacity: 0;
}

.portal-open {
    transform: translate(-50%, -50%) scale(1.6);
    opacity: 1;
    box-shadow: 0 0 120px rgba(180, 220, 255, 0.45);
}

@keyframes portalPulse {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.4; }
    100% { transform: translate(-50%, -50%) scale(1.8); opacity: 0; }
}

.star-container {
    position: absolute;
    width: 260px;
    height: 260px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    overflow: visible;
    pointer-events: none;
}

.star {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(200, 220, 255, 0.9);
    border-radius: 50%;
    opacity: 1;
    animation: starFloat 2.5s ease-out forwards;
    filter: blur(1px);
}

@keyframes starFloat {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(0, -80px) scale(0.2); opacity: 0; }
}

/* --------------------------------------------------
   COSMIC ENGINE v1
-------------------------------------------------- */
.heart-shadow {
    position: absolute;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    background: radial-gradient(circle, rgba(255, 80, 120, 0.25), transparent 70%);
    opacity: 0.0;
    filter: blur(18px);
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.resonance-field {
    position: absolute;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    border: 1px solid rgba(140, 200, 255, 0.25);
    box-shadow: 0 0 40px rgba(140, 200, 255, 0.25);
    opacity: 0.35;
    pointer-events: none;
    transition: transform 0.4s ease, opacity 0.4s ease, box-shadow 0.4s ease;
}

.resonance-field.stressed {
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0.55;
    box-shadow: 0 0 60px rgba(255, 120, 120, 0.35);
}

.resonance-field.calm {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 0.3;
    box-shadow: 0 0 60px rgba(140, 220, 255, 0.4);
}

/* --------------------------------------------------
   COSMIC ENGINE v2
-------------------------------------------------- */
.dna-spiral {
    position: absolute;
    width: 220px;
    height: 220px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    background:
        radial-gradient(circle at 30% 20%, rgba(180,220,255,0.4), transparent 60%),
        radial-gradient(circle at 70% 80%, rgba(140,190,255,0.35), transparent 60%);
    mix-blend-mode: screen;
    opacity: 0.35;
    filter: blur(4px);
    transition: opacity 0.4s ease;
}

.ripple-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at 50% 60%, rgba(120,160,255,0.08), transparent 70%);
    opacity: 0.0;
    transition: opacity 0.6s ease;
    z-index: -2;
}

.ripple-layer.active {
    opacity: 0.35;
}

body.dim-shift {
    background: radial-gradient(circle at 45% 20%, #222b4f 0%, #050814 55%, #010109 100%);
}

/* --------------------------------------------------
   MOBILE
-------------------------------------------------- */
@media (max-width: 480px) {
    .breathing-circle {
        width: 220px;
        height: 220px;
    }
    .inner-circle {
        width: 140px;
        height: 140px;
    }
    .controls {
        width: 90%;
    }
}
