/* =========================================================
   ASTRONAUTENBAR · ATMUNG REGULIEREN · V2
   ========================================================= */

.breath-page {
    --breath-green: #39D98A;
    --breath-green-soft: #6FBF8F;

    --breath-inhale: #39D98A;
    --breath-hold: #9CE3B9;
    --breath-exhale: #238D68;

    --breath-line: rgba(57, 217, 138, .42);
    --breath-line-faint: rgba(57, 217, 138, .15);
    --breath-bg: rgba(57, 217, 138, .018);
}

.breath-main {
    padding-bottom: 12px;
}

.breath-back {
    margin-bottom: 30px;
}

.breath-back a {
    color: var(--cyan);
    text-decoration: none;
    font-size: var(--font-meta);
    letter-spacing: .05em;
}

.breath-back a:hover {
    color: var(--accent);
}

.breath-board-label {
    color: var(--breath-green-soft);
    font-size: var(--font-meta);
    letter-spacing: .10em;
}

.breath-title {
    margin: 8px 0 0;
    color: var(--breath-green);
    font-size: 1.45rem;
    line-height: 1.25;
    letter-spacing: .07em;
    text-shadow: 0 0 9px rgba(57,217,138,.12);
}

/* =========================================================
   BORDCOMPUTER
   ========================================================= */

.breath-board {
    margin-top: 28px;
    padding: 13px 0;
    border-top: 1px solid var(--breath-line);
    border-bottom: 1px solid var(--breath-line);

    color: var(--cyan);
    font-size: var(--font-system);
    line-height: 1.9;
    letter-spacing: .025em;
}

.breath-board-green {
    color: var(--breath-green);
}

.breath-board-soft {
    color: var(--breath-green-soft);
}

.breath-flicker-a {
    animation: breathFlickerA 8.9s steps(1,end) infinite;
}

.breath-flicker-b {
    animation: breathFlickerB 11.7s steps(1,end) infinite;
}

@keyframes breathFlickerA {
    0%, 89%, 100% { opacity: 1; }
    90% { opacity: .25; }
    92% { opacity: .88; }
    93% { opacity: .4; }
    95% { opacity: 1; }
}

@keyframes breathFlickerB {
    0%, 93%, 100% { opacity: 1; }
    94% { opacity: .28; }
    96% { opacity: 1; }
}

/* =========================================================
   EINFÜHRUNG
   ========================================================= */

.breath-intro {
    max-width: 760px;
    margin-top: 34px;
    padding: 26px 28px;

    border-left: 1px solid var(--breath-line);
    background:
        linear-gradient(90deg, rgba(57,217,138,.038), rgba(57,217,138,0));

    color: var(--breath-green-soft);
    font-size: 1rem;
    line-height: 1.75;
}

.breath-intro p {
    margin: 0 0 1.05em;
}

.breath-intro p:last-child {
    margin-bottom: 0;
}

.breath-intro p:first-child {
    color: var(--breath-green);
    font-size: 1.08em;
}

/* =========================================================
   STEUERUNG
   ========================================================= */

.breath-tool {
    max-width: 760px;
    margin-top: 42px;
    padding-top: 26px;
    border-top: 1px solid var(--breath-line);
}

.breath-control-label {
    margin-bottom: 10px;
    color: var(--breath-green-soft);
    font-size: var(--font-meta);
    letter-spacing: .10em;
}

.breath-mode-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.breath-chip,
.breath-scope,
.breath-sound-toggle,
.breath-action {
    appearance: none;
    font: inherit;
    border-radius: 1px;
    cursor: pointer;
}

.breath-chip {
    min-height: 74px;
    padding: 12px 10px;

    border: 1px solid rgba(57,217,138,.24);
    background: transparent;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;

    color: rgba(111,191,143,.70);
    text-align: center;
}

.breath-chip strong {
    color: inherit;
    font-size: .96rem;
    letter-spacing: .07em;
}

.breath-chip span {
    font-size: var(--font-micro);
    letter-spacing: .055em;
}

.breath-chip:hover,
.breath-chip:focus-visible {
    border-color: rgba(57,217,138,.58);
    color: var(--breath-green);
}

.breath-chip.is-selected {
    border-color: rgba(57,217,138,.72);
    background: rgba(57,217,138,.045);
    color: var(--breath-green);
    box-shadow: inset 0 0 18px rgba(57,217,138,.025);
}

.breath-session-row {
    margin-top: 22px;

    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
}

.breath-scope-buttons {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

.breath-scope,
.breath-sound-toggle {
    padding: 8px 11px;
    border: 1px solid rgba(57,217,138,.23);
    background: transparent;
    color: rgba(111,191,143,.72);
    font-size: var(--font-meta);
    letter-spacing: .045em;
}

.breath-scope:hover,
.breath-scope:focus-visible,
.breath-sound-toggle:hover,
.breath-sound-toggle:focus-visible {
    border-color: rgba(57,217,138,.58);
    color: var(--breath-green);
}

.breath-scope.is-selected,
.breath-sound-toggle.is-on {
    border-color: rgba(57,217,138,.58);
    background: rgba(57,217,138,.035);
    color: var(--breath-green);
}

/* =========================================================
   ATEMFELD
   ========================================================= */

.breath-stage {
    position: relative;

    width: min(100%, 560px);
    aspect-ratio: 1 / 1;

    margin: 42px auto 26px;

    display: grid;
    place-items: center;

    overflow: hidden;
}

.breath-stage::before {
    content: "";
    position: absolute;
    inset: 8%;
    border-radius: 50%;
    background:
        radial-gradient(circle,
            rgba(57,217,138,.035) 0%,
            rgba(57,217,138,.014) 36%,
            rgba(57,217,138,0) 70%);
    animation: breathAmbient 8s ease-in-out infinite;
}

@keyframes breathAmbient {
    0%,100% { opacity: .55; transform: scale(.96); }
    50% { opacity: .95; transform: scale(1.03); }
}

.breath-orbit {
    position: absolute;
    border: 1px solid rgba(57,217,138,.10);
    border-radius: 50%;
    pointer-events: none;
}

.breath-orbit-outer {
    width: 86%;
    height: 86%;
    animation: breathOrbit 26s linear infinite;
}

.breath-orbit-mid {
    width: 69%;
    height: 69%;
    border-style: dashed;
    opacity: .55;
    animation: breathOrbitReverse 19s linear infinite;
}

.breath-orbit-inner {
    width: 54%;
    height: 54%;
    opacity: .46;
    animation: breathOrbit 14s linear infinite;
}

.breath-orbit::after {
    content: "";
    position: absolute;
    width: 4px;
    height: 4px;
    left: 50%;
    top: -2px;
    border-radius: 50%;
    background: rgba(57,217,138,.65);
    box-shadow: 0 0 8px rgba(57,217,138,.35);
}

@keyframes breathOrbit {
    to { transform: rotate(360deg); }
}

@keyframes breathOrbitReverse {
    to { transform: rotate(-360deg); }
}

.breath-sphere {
    --sphere-scale: .66;
    --sphere-color: var(--breath-green);
    --sphere-glow: rgba(57,217,138,.22);
    --phase-seconds: 3s;

    position: absolute;
    width: 48%;
    aspect-ratio: 1 / 1;

    display: grid;
    place-items: center;

    transform: scale(var(--sphere-scale));
    transition:
        transform var(--phase-seconds) cubic-bezier(.42,0,.30,1),
        filter .6s ease;
}

.breath-sphere-core {
    position: absolute;
    inset: 13%;
    border-radius: 50%;

    border: 1px solid color-mix(in srgb, var(--sphere-color) 80%, transparent);
    background:
        radial-gradient(circle at 48% 44%,
            color-mix(in srgb, var(--sphere-color) 18%, transparent) 0%,
            color-mix(in srgb, var(--sphere-color) 7%, transparent) 43%,
            transparent 72%);

    box-shadow:
        0 0 20px var(--sphere-glow),
        inset 0 0 22px color-mix(in srgb, var(--sphere-color) 10%, transparent);

    transition:
        border-color .7s ease,
        background .7s ease,
        box-shadow .7s ease;
}

.breath-sphere-halo {
    position: absolute;
    inset: 4%;
    border-radius: 50%;

    background:
        radial-gradient(circle,
            transparent 48%,
            color-mix(in srgb, var(--sphere-color) 7%, transparent) 64%,
            transparent 74%);

    filter: blur(6px);
    opacity: .8;
}

.breath-sphere-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--sphere-color) 38%, transparent);
}

.breath-sphere-ring-a { inset: 2%; opacity: .35; }
.breath-sphere-ring-b { inset: 8%; opacity: .48; }
.breath-sphere-ring-c { inset: 20%; opacity: .25; }

.breath-sphere.is-idle {
    animation: breathIdle 5.8s ease-in-out infinite;
}

@keyframes breathIdle {
    0%,100% { transform: scale(.64); opacity: .74; }
    50% { transform: scale(.70); opacity: 1; }
}

.breath-sphere.phase-inhale {
    --sphere-scale: 1;
    --sphere-color: var(--breath-inhale);
    --sphere-glow: rgba(57,217,138,.30);
}

.breath-sphere.phase-hold,
.breath-sphere.phase-hold-empty {
    --sphere-color: var(--breath-hold);
    --sphere-glow: rgba(156,227,185,.25);
}

.breath-sphere.phase-hold {
    --sphere-scale: 1;
}

.breath-sphere.phase-hold-empty {
    --sphere-scale: .64;
}

.breath-sphere.phase-exhale {
    --sphere-scale: .64;
    --sphere-color: var(--breath-exhale);
    --sphere-glow: rgba(35,141,104,.25);
}

.breath-sphere.phase-hold .breath-sphere-ring-a,
.breath-sphere.phase-hold-empty .breath-sphere-ring-a {
    animation: breathHoldPulse 2.2s ease-in-out infinite;
}

@keyframes breathHoldPulse {
    0%,100% { opacity: .26; transform: scale(.98); }
    50% { opacity: .56; transform: scale(1.025); }
}

.breath-readout {
    position: relative;
    z-index: 10;

    width: 54%;

    text-align: center;
    pointer-events: none;
}

.breath-phase {
    color: var(--breath-green);
    font-size: 1.12rem;
    line-height: 1.2;
    letter-spacing: .12em;
}

.breath-count {
    margin-top: 7px;
    color: var(--breath-green-soft);
    font-size: 2rem;
    line-height: 1;
    letter-spacing: .04em;
}

.breath-progress {
    margin-top: 10px;
    color: rgba(111,191,143,.68);
    font-size: var(--font-micro);
    letter-spacing: .075em;
}

/* =========================================================
   AKTIONEN
   ========================================================= */

.breath-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.breath-action {
    min-width: 112px;
    padding: 10px 16px;

    border: 1px solid rgba(57,217,138,.34);
    background: transparent;

    color: var(--breath-green-soft);
    font-size: var(--font-system);
    letter-spacing: .06em;
}

.breath-action:hover,
.breath-action:focus-visible {
    border-color: rgba(57,217,138,.74);
    background: rgba(57,217,138,.04);
    color: var(--breath-green);
}

.breath-start {
    color: var(--breath-green);
}

.breath-hint {
    margin-top: 15px;
    color: rgba(111,191,143,.62);
    text-align: center;
    font-size: var(--font-micro);
    letter-spacing: .055em;
}

/* =========================================================
   FORSCHUNGSNOTIZ
   ========================================================= */

.breath-research {
    max-width: 760px;
    margin-top: 42px;
    border-top: 1px solid rgba(57,217,138,.18);
    border-bottom: 1px solid rgba(57,217,138,.18);
}

.breath-research summary {
    padding: 12px 0;
    cursor: pointer;
    color: rgba(111,191,143,.72);
    font-size: var(--font-meta);
    letter-spacing: .08em;
}

.breath-research > div {
    padding: 2px 0 18px;
    color: rgba(111,191,143,.72);
    font-size: .92rem;
    line-height: 1.65;
}

.breath-research p {
    margin: 0 0 .85em;
}

.breath-sources {
    opacity: .72;
    font-size: var(--font-meta);
}

.breath-system-message {
    max-width: 760px;
    margin-top: 36px;
    color: var(--cyan);
    font-size: var(--font-system);
    line-height: 1.75;
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 620px) {

    .breath-board {
        font-size: var(--font-meta);
        line-height: 1.85;
    }

    .breath-intro {
        padding: 21px 18px;
        font-size: .96rem;
    }

    .breath-mode-buttons {
        grid-template-columns: 1fr;
    }

    .breath-chip {
        min-height: 58px;
    }

    .breath-session-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .breath-stage {
        width: min(100%, 430px);
        margin-top: 28px;
    }

    .breath-sphere {
        width: 52%;
    }

    .breath-phase {
        font-size: .98rem;
    }

    .breath-count {
        font-size: 1.65rem;
    }
}

@media (prefers-reduced-motion: reduce) {

    .breath-flicker-a,
    .breath-flicker-b,
    .breath-stage::before,
    .breath-orbit,
    .breath-sphere.is-idle,
    .breath-sphere-ring {
        animation: none !important;
    }

    .breath-sphere {
        transition-duration: .25s !important;
    }
}


/* =========================================================
   V2 · AUFKLAPPBARE ERKLÄRUNG + BORDCOMPUTER-GESICHT
   ========================================================= */

.breath-explainer {
    max-width: 760px;
    margin-top: 32px;
    border-top: 1px solid rgba(57,217,138,.22);
    border-bottom: 1px solid rgba(57,217,138,.22);
}

.breath-explainer summary {
    min-height: 56px;
    padding: 14px 0;

    display: flex;
    align-items: center;
    gap: 10px;

    cursor: pointer;
    list-style: none;

    color: var(--breath-green);
    font-size: var(--font-system);
    letter-spacing: .07em;
}

.breath-explainer summary::-webkit-details-marker {
    display: none;
}

.breath-explainer-prompt {
    color: var(--breath-green);
}

.breath-explainer-title {
    flex: 0 1 auto;
}

.breath-explainer-face {
    margin-left: auto !important;
    color: var(--breath-green) !important;
    opacity: 1 !important;
    text-shadow: 0 0 7px rgba(57,217,138,.16) !important;
}

.breath-explainer[open] .breath-explainer-face {
    color: var(--breath-green-soft) !important;
}

.breath-explainer .breath-intro {
    margin-top: 0;
    padding: 8px 28px 25px;
    border-left: 1px solid var(--breath-line);
    background:
        linear-gradient(90deg, rgba(57,217,138,.038), rgba(57,217,138,0));
}

/* Auf dem Handy bleibt die Atemgrafik groß genug zum Ruhigwerden,
   schrumpft aber automatisch auf die verfügbare Breite. */
@media (max-width: 620px) {
    .breath-stage {
        width: min(94vw, 390px);
        max-width: 100%;
    }

    .breath-explainer .breath-intro {
        padding: 8px 16px 21px;
    }
}


/* =========================================================
   V4 · BORDCOMPUTER-MIMIK
   Entspricht dem Zustandsprinzip der Startseite.
   ========================================================= */

.breath-explainer-face {
    display: inline-block;
    min-width: 4ch;
    text-align: right;

    color: var(--breath-green) !important;
    opacity: 1 !important;

    transform: translateY(0);
    transition:
        color .10s steps(1, end),
        opacity .10s steps(1, end),
        transform .10s steps(1, end);
}

.breath-explainer-face[data-mood="blink"] {
    transform: translateY(1px);
}

.breath-explainer-face[data-mood="happy"] {
    color: var(--breath-green-soft) !important;
}
