/* Gedanken-Wolke – Atmosphärische Welten & 100 % flüchtiges Wohlfühl-Tool */
* {
    box-sizing: border-box;
}

:root {
    --gw-bg: linear-gradient(170deg, #7dd3fc 0%, #bae6fd 38%, #e0f2fe 74%, #fef9c3 100%);
    --gw-topbar-bg: rgba(255, 255, 255, 0.78);
    --gw-topbar-border: rgba(2, 132, 199, 0.16);
    --gw-card-bg: rgba(255, 255, 255, 0.84);
    --gw-card-border: rgba(255, 255, 255, 0.92);
    --gw-card-shadow: 0 22px 50px rgba(3, 105, 161, 0.16);
    --gw-ink: #1e293b;
    --gw-ink-muted: #475569;
    --gw-chip-bg: #dcfce7;
    --gw-chip-border: #86efac;
    --gw-chip-ink: #166534;
    --gw-privacy-bg: rgba(236, 253, 245, 0.92);
    --gw-privacy-border: rgba(22, 163, 74, 0.28);
    --gw-privacy-ink: #14532d;
    --gw-stage-bg: rgba(255, 255, 255, 0.68);
    --gw-stage-border: rgba(2, 132, 199, 0.34);
    --gw-stage-focus: #0284c7;
    --gw-stage-ring: rgba(2, 132, 199, 0.16);
    --gw-placeholder: #64748b;
    --gw-cleared-ink: #0369a1;
    --gw-track-bg: rgba(148, 163, 184, 0.28);
    --gw-fill-bg: linear-gradient(90deg, #0d9488 0%, #0284c7 65%, #f59e0b 100%);
    --gw-pill-bg: rgba(255, 255, 255, 0.82);
    --gw-pill-border: rgba(2, 132, 199, 0.24);
    --gw-pill-hover: #f0f9ff;
    --gw-pill-active-bg: #0284c7;
    --gw-pill-active-ink: #ffffff;
    --gw-pill-active-border: #0369a1;
    --gw-btn-bg: linear-gradient(135deg, #0284c7 0%, #0d9488 100%);
    --gw-btn-shadow: 0 10px 26px rgba(2, 132, 199, 0.28);
}

/* 🌌 Weltall */
body[data-world="space"] {
    --gw-bg:
        radial-gradient(circle at 18% 18%, rgba(99, 102, 241, 0.34) 0%, transparent 45%),
        radial-gradient(circle at 82% 76%, rgba(14, 165, 233, 0.25) 0%, transparent 44%),
        linear-gradient(165deg, #040714 0%, #0b122c 52%, #17153b 100%);
    --gw-topbar-bg: rgba(10, 15, 36, 0.78);
    --gw-topbar-border: rgba(129, 140, 248, 0.24);
    --gw-card-bg: rgba(13, 20, 46, 0.76);
    --gw-card-border: rgba(129, 140, 248, 0.32);
    --gw-card-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 40px rgba(99, 102, 241, 0.14);
    --gw-ink: #f8fafc;
    --gw-ink-muted: #cbd5e1;
    --gw-chip-bg: rgba(16, 185, 129, 0.18);
    --gw-chip-border: rgba(52, 211, 153, 0.45);
    --gw-chip-ink: #a7f3d0;
    --gw-privacy-bg: rgba(6, 78, 59, 0.56);
    --gw-privacy-border: rgba(52, 211, 153, 0.38);
    --gw-privacy-ink: #d1fae5;
    --gw-stage-bg: rgba(9, 14, 34, 0.65);
    --gw-stage-border: rgba(129, 140, 248, 0.42);
    --gw-stage-focus: #38bdf8;
    --gw-stage-ring: rgba(56, 189, 248, 0.22);
    --gw-placeholder: #94a3b8;
    --gw-cleared-ink: #bae6fd;
    --gw-track-bg: rgba(148, 163, 184, 0.22);
    --gw-fill-bg: linear-gradient(90deg, #38bdf8 0%, #818cf8 55%, #f472b6 100%);
    --gw-pill-bg: rgba(30, 41, 82, 0.68);
    --gw-pill-border: rgba(129, 140, 248, 0.34);
    --gw-pill-hover: rgba(49, 64, 122, 0.85);
    --gw-pill-active-bg: linear-gradient(135deg, #6366f1 0%, #0ea5e9 100%);
    --gw-pill-active-ink: #ffffff;
    --gw-pill-active-border: #818cf8;
    --gw-btn-bg: linear-gradient(135deg, #6366f1 0%, #0ea5e9 100%);
    --gw-btn-shadow: 0 10px 28px rgba(99, 102, 241, 0.38);
}

/* ✨ Partikel-Zauber */
body[data-world="particles"] {
    --gw-bg:
        radial-gradient(circle at 80% 18%, rgba(236, 72, 153, 0.28) 0%, transparent 44%),
        radial-gradient(circle at 20% 80%, rgba(20, 184, 166, 0.26) 0%, transparent 46%),
        linear-gradient(160deg, #0b132b 0%, #152238 52%, #231942 100%);
    --gw-topbar-bg: rgba(15, 23, 42, 0.78);
    --gw-topbar-border: rgba(244, 114, 182, 0.24);
    --gw-card-bg: rgba(17, 24, 39, 0.76);
    --gw-card-border: rgba(251, 191, 36, 0.30);
    --gw-card-shadow: 0 24px 60px rgba(0, 0, 0, 0.50), 0 0 38px rgba(245, 158, 11, 0.12);
    --gw-ink: #f8fafc;
    --gw-ink-muted: #cbd5e1;
    --gw-chip-bg: rgba(16, 185, 129, 0.18);
    --gw-chip-border: rgba(52, 211, 153, 0.45);
    --gw-chip-ink: #a7f3d0;
    --gw-privacy-bg: rgba(6, 78, 59, 0.56);
    --gw-privacy-border: rgba(52, 211, 153, 0.38);
    --gw-privacy-ink: #d1fae5;
    --gw-stage-bg: rgba(15, 23, 42, 0.64);
    --gw-stage-border: rgba(251, 191, 36, 0.42);
    --gw-stage-focus: #fbbf24;
    --gw-stage-ring: rgba(251, 191, 36, 0.22);
    --gw-placeholder: #94a3b8;
    --gw-cleared-ink: #fde68a;
    --gw-track-bg: rgba(148, 163, 184, 0.22);
    --gw-fill-bg: linear-gradient(90deg, #2dd4bf 0%, #fbbf24 55%, #f472b6 100%);
    --gw-pill-bg: rgba(30, 41, 59, 0.72);
    --gw-pill-border: rgba(251, 191, 36, 0.30);
    --gw-pill-hover: rgba(51, 65, 85, 0.85);
    --gw-pill-active-bg: linear-gradient(135deg, #f59e0b 0%, #ec4899 100%);
    --gw-pill-active-ink: #ffffff;
    --gw-pill-active-border: #fbbf24;
    --gw-btn-bg: linear-gradient(135deg, #f59e0b 0%, #ec4899 100%);
    --gw-btn-shadow: 0 10px 28px rgba(236, 72, 153, 0.34);
}

/* 🫧 Seifenblasen */
body[data-world="bubbles"] {
    --gw-bg:
        radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.7) 0%, transparent 38%),
        linear-gradient(165deg, #a5f3fc 0%, #cffafe 42%, #e0e7ff 78%, #fae8ff 100%);
    --gw-topbar-bg: rgba(255, 255, 255, 0.76);
    --gw-topbar-border: rgba(14, 165, 233, 0.18);
    --gw-card-bg: rgba(255, 255, 255, 0.80);
    --gw-card-border: rgba(255, 255, 255, 0.94);
    --gw-card-shadow: 0 22px 50px rgba(14, 116, 144, 0.15);
    --gw-ink: #0f172a;
    --gw-ink-muted: #475569;
    --gw-stage-border: rgba(20, 184, 166, 0.36);
    --gw-stage-focus: #0d9488;
    --gw-stage-ring: rgba(13, 148, 136, 0.18);
    --gw-cleared-ink: #0f766e;
    --gw-fill-bg: linear-gradient(90deg, #06b6d4 0%, #3b82f6 55%, #ec4899 100%);
    --gw-pill-border: rgba(6, 182, 212, 0.30);
    --gw-pill-hover: #ecfeff;
    --gw-pill-active-bg: linear-gradient(135deg, #06b6d4 0%, #8b5cf6 100%);
    --gw-pill-active-ink: #ffffff;
    --gw-pill-active-border: #0891b2;
    --gw-btn-bg: linear-gradient(135deg, #06b6d4 0%, #8b5cf6 100%);
    --gw-btn-shadow: 0 10px 26px rgba(6, 182, 212, 0.28);
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: var(--le-font-sans, system-ui, -apple-system, sans-serif);
    color: var(--gw-ink);
    background: var(--gw-bg);
    background-attachment: fixed;
    transition: background 0.55s ease, color 0.35s ease;
}

.cloud-shell {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    overflow-x: hidden;
}

.ambient-canvas,
.fx-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.ambient-canvas {
    z-index: 0;
}

.fx-canvas {
    z-index: 40;
}

.top-bar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--gw-topbar-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--gw-topbar-border);
    transition: background-color 0.35s ease, border-color 0.35s ease;
}

.top-bar-inner {
    max-width: 820px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.brand-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-icon {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    display: flex;
}

.brand-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 900;
    line-height: 1.1;
    color: var(--gw-ink);
}

.mode-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--gw-chip-bg);
    border: 1px solid var(--gw-chip-border);
    color: var(--gw-chip-ink);
    font-size: 0.75rem;
    font-weight: 800;
    transition: background-color 0.35s ease, border-color 0.35s ease, color 0.35s ease;
}

.cloud-main {
    position: relative;
    z-index: 10;
    flex: 1;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 18px 16px max(28px, env(safe-area-inset-bottom));
    display: flex;
    align-items: center;
}

.cloud-card {
    width: 100%;
    background: var(--gw-card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1.5px solid var(--gw-card-border);
    border-radius: 26px;
    padding: 20px 20px 18px;
    box-shadow: var(--gw-card-shadow);
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: background-color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

.privacy-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 14px;
    background: var(--gw-privacy-bg);
    border: 1px solid var(--gw-privacy-border);
    color: var(--gw-privacy-ink);
    font-size: 0.88rem;
    line-height: 1.45;
    transition: background-color 0.35s ease, border-color 0.35s ease, color 0.35s ease;
}

.privacy-lock {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.effects-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.effect-pill {
    appearance: none;
    min-height: 44px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1.5px solid var(--gw-pill-border);
    background: var(--gw-pill-bg);
    color: var(--gw-ink);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.14s ease, box-shadow 0.2s ease;
}

.effect-pill:hover {
    background: var(--gw-pill-hover);
    transform: translateY(-1px);
}

.effect-pill.active {
    background: var(--gw-pill-active-bg);
    border-color: var(--gw-pill-active-border);
    color: var(--gw-pill-active-ink);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.18);
}

.cloud-stage {
    position: relative;
    border-radius: 22px;
    background: var(--gw-stage-bg);
    border: 2px dashed var(--gw-stage-border);
    min-height: 210px;
    overflow: hidden;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.35s ease, transform 0.28s ease;
}

.cloud-stage:focus-within {
    border-color: var(--gw-stage-focus);
    box-shadow: 0 0 0 4px var(--gw-stage-ring);
}

.cloud-stage.is-dissolving {
    transform: scale(1.015);
    box-shadow: 0 0 36px var(--gw-stage-ring);
}

.cloud-textarea {
    position: relative;
    z-index: 2;
    width: 100%;
    min-height: 210px;
    padding: 18px;
    border: none;
    outline: none;
    resize: none;
    background: transparent;
    font-family: inherit;
    font-size: clamp(1.04rem, 2.2vw, 1.2rem);
    line-height: 1.55;
    color: var(--gw-ink);
}

.cloud-textarea::placeholder {
    color: var(--gw-placeholder);
}

.cloud-textarea.is-vanishing {
    opacity: 0;
    filter: blur(6px);
    transform: scale(1.03);
    transition: opacity 0.22s ease, filter 0.22s ease, transform 0.22s ease;
    pointer-events: none;
}

.cloud-cleared-msg {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    padding: 18px;
    color: var(--gw-cleared-ink);
    font-size: 1.05rem;
    pointer-events: none;
    animation: cloudFadeIn 0.45s ease;
}

.cloud-cleared-msg span {
    font-size: 2.35rem;
}

@keyframes cloudFadeIn {
    from { opacity: 0; transform: translateY(8px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.countdown-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.countdown-track {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: var(--gw-track-bg);
    overflow: hidden;
}

.countdown-fill {
    width: 0%;
    height: 100%;
    border-radius: 999px;
    background: var(--gw-fill-bg);
    transition: width 0.08s linear;
}

.countdown-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--gw-ink-muted);
}

.mono {
    font-family: var(--le-font-mono, monospace);
}

.release-btn {
    appearance: none;
    width: 100%;
    min-height: 52px;
    padding: 12px 20px;
    border-radius: 16px;
    border: none;
    background: var(--gw-btn-bg);
    color: #ffffff;
    font-family: inherit;
    font-size: 1.04rem;
    font-weight: 900;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--gw-btn-shadow);
    transition: transform 0.14s ease, opacity 0.15s ease, box-shadow 0.2s ease, background 0.35s ease;
}

.release-btn:hover:not(:disabled) {
    transform: translateY(-2px);
}

.release-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

.support-hint {
    margin: 2px 0 0;
    text-align: center;
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--gw-ink-muted);
}

@media (max-width: 560px) {
    .cloud-card {
        padding: 16px 14px;
        border-radius: 20px;
    }
    .cloud-stage,
    .cloud-textarea {
        min-height: 185px;
    }
    .mode-chip {
        display: none;
    }
    .effect-pill {
        flex: 1 1 calc(50% - 8px);
    }
}
