/* ========================================
   Breathing Exercise — Calming Dark Theme
   ======================================== */
:root {
    --primary: #818CF8;
    --primary-glow: rgba(129, 140, 248, 0.2);
    --secondary: #C4B5FD;
    --bg: #0F0E17;
    --bg-card: rgba(18, 16, 28, 0.7);
    --border: rgba(129, 140, 248, 0.1);
    --text: #FFFFFE;
    --text-secondary: #A7A9BE;
    --text-muted: #6B6D80;
    --radius: 16px;
    --font: 'Inter', -apple-system, sans-serif;
    --transition: 0.3s ease;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-font-smoothing: antialiased;
    background-image: radial-gradient(ellipse at 50% 50%, rgba(129, 140, 248, 0.04) 0%, transparent 60%);
}

.app {
    max-width: 440px;
    width: 100%;
    padding: 2rem 1.5rem;
    text-align: center;
}

.header {
    margin-bottom: 1.5rem;
}

.header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
    font-weight: 300;
}

/* Patterns */
.patterns {
    display: flex;
    gap: 0.3rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.pattern-btn {
    padding: 0.4rem 0.7rem;
    border: 1px solid var(--border);
    background: transparent;
    border-radius: 100px;
    font-family: var(--font);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.pattern-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pattern-btn.active {
    background: rgba(129, 140, 248, 0.12);
    border-color: var(--primary);
    color: var(--text);
    box-shadow: 0 0 10px var(--primary-glow);
}

.custom-settings {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.setting-row {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    align-items: center;
}

.setting-row label {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.setting-row input {
    width: 50px;
    padding: 0.3rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(18, 16, 28, 0.7);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.85rem;
    text-align: center;
    outline: none;
}

/* Circle */
.circle-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2rem auto;
    width: 220px;
    height: 220px;
}

.circle {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(129, 140, 248, 0.15), rgba(196, 181, 253, 0.1));
    border: 2px solid rgba(129, 140, 248, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.8s ease, box-shadow 0.8s ease;
    z-index: 2;
}

.circle.inhale {
    transform: scale(1.25);
    box-shadow: 0 0 40px var(--primary-glow), 0 0 80px rgba(129, 140, 248, 0.08);
}

.circle.hold {
    transform: scale(1.25);
    box-shadow: 0 0 30px var(--primary-glow);
}

.circle.exhale {
    transform: scale(0.85);
    box-shadow: 0 0 10px rgba(129, 140, 248, 0.05);
}

.circle-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.phase-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.timer-text {
    font-size: 2rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--primary);
}

.pulse-ring {
    position: absolute;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    border: 1px solid rgba(129, 140, 248, 0.08);
    animation: pulse-anim 4s ease-in-out infinite;
    z-index: 1;
}

@keyframes pulse-anim {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.1);
        opacity: 0;
    }
}

/* Controls */
.controls {
    margin-top: 1.5rem;
}

.btn-primary {
    width: 100%;
    padding: 0.7rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #0F0E17;
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.option-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.7rem;
}

.option-row label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
}

.option-row input[type="checkbox"] {
    accent-color: var(--primary);
}

.cycle-count {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.hidden {
    display: none !important;
}