/* ============================================================
   FOCUS RITUAL — Meditative Pre-Focus Breathing Interface
   ============================================================ */

/* ── Ritual Overlay ──────────────────────────────────────── */
.ritual-overlay {
    position: fixed;
    inset: 0;
    z-index: 9500;
    background: var(--bg-primary);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    overflow-y: auto;
    padding: 60px 20px;
}

.ritual-overlay.open {
    display: flex;
    animation: ritualFadeIn 0.7s var(--ease-out) both;
}

.ritual-overlay.closing {
    animation: ritualFadeOut 0.5s var(--ease-out) both;
}

@keyframes ritualFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes ritualFadeOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}

/* ── Particle Canvas ─────────────────────────────────────── */
#ritual-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.55;
}

/* ── Content Layer ───────────────────────────────────────── */
.ritual-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    user-select: none;
}

/* ── Top Badge ───────────────────────────────────────────── */
.ritual-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 99px;
    border: 1px solid rgba(124,58,237,0.3);
    background: rgba(124,58,237,0.1);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary-light);
    margin-top: 20px;
    margin-bottom: 12px;
    animation: ritualBadgeIn 0.8s var(--ease-spring) 0.3s both;
}

@keyframes ritualBadgeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Breathing Circle ────────────────────────────────────── */
.ritual-circle-wrap {
    position: relative;
    width: 260px;
    height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

/* Outer ambient glow ring */
.ritual-ring-outer {
    position: absolute;
    inset: -20px;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(124,58,237,0.08) 0%, transparent 70%);
    transition: transform 4s ease-in-out, opacity 4s ease-in-out;
}

/* SVG circle track */
.ritual-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.ritual-circle-track {
    fill: none;
    stroke: rgba(255,255,255,0.05);
    stroke-width: 3;
}

.ritual-circle-progress {
    fill: none;
    stroke: url(#ritual-grad);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 722;
    stroke-dashoffset: 722;
    transition: stroke-dashoffset 0.5s linear;
}

/* Inner breathing sphere */
.ritual-sphere {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(ellipse at 38% 35%,
        rgba(167, 139, 250, 0.35) 0%,
        rgba(124, 58, 237, 0.25) 40%,
        rgba(79, 36, 181, 0.15) 70%,
        transparent 100%
    );
    border: 1px solid rgba(167,139,250,0.2);
    box-shadow:
        0 0 40px rgba(124,58,237,0.2),
        0 0 80px rgba(124,58,237,0.08),
        inset 0 0 30px rgba(167,139,250,0.08);
    transition: transform 4s ease-in-out, box-shadow 4s ease-in-out, opacity 0.5s ease;
    position: relative;
    z-index: 1;
    will-change: transform;
}

/* Breathing animation states */
.ritual-sphere.inhale {
    transform: scale(1.3);
    box-shadow:
        0 0 60px rgba(124,58,237,0.35),
        0 0 120px rgba(124,58,237,0.15),
        inset 0 0 40px rgba(167,139,250,0.15);
}

.ritual-sphere.hold {
    transform: scale(1.3);
    box-shadow:
        0 0 50px rgba(124,58,237,0.3),
        0 0 100px rgba(124,58,237,0.12),
        inset 0 0 35px rgba(167,139,250,0.12);
}

.ritual-sphere.exhale {
    transform: scale(0.8);
    box-shadow:
        0 0 25px rgba(124,58,237,0.12),
        0 0 50px rgba(124,58,237,0.05),
        inset 0 0 20px rgba(167,139,250,0.05);
}

/* ── Phase Text ──────────────────────────────────────────── */
.ritual-phase-label {
    font-size: 2.25rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 0%, #f0f0ff 30%, #c084fc 65%, #22d3ee 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 18px rgba(124, 58, 237, 0.50)) drop-shadow(0 0 25px rgba(6, 182, 212, 0.30));
    letter-spacing: -0.035em;
    transition: opacity 0.4s ease, transform 0.4s ease, filter 0.4s ease;
    text-align: center;
    line-height: 1.2;
    margin-bottom: 6px;
    animation: ritualTextIn 0.8s var(--ease-spring) 0.5s both;
}

@keyframes ritualTextIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ritual-phase-label.transitioning {
    opacity: 0;
    transform: translateY(6px);
}

.ritual-phase-sub {
    font-size: 0.92rem;
    font-weight: 500;
    color: rgba(224, 231, 255, 0.88);
    text-shadow: 0 2px 10px rgba(124, 58, 237, 0.40);
    text-align: center;
    transition: opacity 0.3s ease, color 0.3s ease;
    margin-bottom: 12px;
    letter-spacing: 0.02em;
    line-height: 1.45;
    max-width: 380px;
    animation: ritualTextIn 0.8s var(--ease-spring) 0.65s both;
}

/* ── Cycle Dots ──────────────────────────────────────────── */
.ritual-cycle-dots {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    animation: ritualTextIn 0.8s var(--ease-spring) 0.7s both;
}

.ritual-cycle-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.08);
    transition: all 0.4s var(--ease-smooth);
}

.ritual-cycle-dot.done {
    background: var(--primary-color);
    border-color: var(--primary-light);
    box-shadow: 0 0 8px rgba(124,58,237,0.5);
}

.ritual-cycle-dot.active {
    background: rgba(124,58,237,0.4);
    border-color: var(--primary-light);
    transform: scale(1.2);
}

/* ── Start Button ────────────────────────────────────────── */
.ritual-start-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 36px;
    border-radius: 99px;
    border: none;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: #ffffff;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: all 0.25s var(--ease-smooth);
    box-shadow: 0 6px 24px rgba(124,58,237,0.4), 0 0 0 1px rgba(255,255,255,0.08) inset;
    animation: ritualTextIn 0.8s var(--ease-spring) 0.8s both;
    margin-bottom: 14px;
}

.ritual-start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 36px rgba(124,58,237,0.55), 0 0 0 1px rgba(255,255,255,0.1) inset;
}

.ritual-start-btn.locked {
    background: linear-gradient(135deg, #d97706, #b45309);
    box-shadow: 0 6px 24px rgba(217, 119, 6, 0.4), 0 0 0 1px rgba(255,255,255,0.08) inset;
    animation: ritualPulseGold 2.5s infinite ease-in-out;
}

.ritual-start-btn.locked:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 36px rgba(217, 119, 6, 0.55), 0 0 0 1px rgba(255,255,255,0.1) inset;
}

.ritual-start-btn.locked:active {
    transform: translateY(0);
    box-shadow: 0 4px 14px rgba(217, 119, 6, 0.35);
}

@keyframes ritualPulseGold {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.025);
    }
}

.ritual-start-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ── Exit / Skip Buttons ─────────────────────────────────── */
.ritual-skip-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: all 0.18s;
    animation: ritualTextIn 0.8s var(--ease-spring) 0.9s both;
}

.ritual-skip-btn:hover {
    color: var(--text-secondary);
    background: var(--surface-subtle);
}

/* ── Close Button ────────────────────────────────────────── */
.ritual-close-btn {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 9600;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--surface-subtle);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s;
}

.ritual-close-btn:hover {
    color: var(--text-secondary);
    border-color: var(--border-hover);
    background: var(--surface-raised);
}

.ritual-close-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ── Ritual Button in Timer Section ──────────────────────── */
.ritual-trigger-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--surface-raised);
    color: var(--primary-light);
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.22s;
    white-space: nowrap;
    width: 100%;
    justify-content: center;
}

.ritual-trigger-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ritual-trigger-btn:hover {
    background: var(--interactive-subtle);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-glow-primary);
    transform: translateY(-1px);
}

/* ── Pro Gate State ──────────────────────────────────────── */
.ritual-overlay.pro-gate-mode .ritual-sphere {
    opacity: 0.4;
    filter: blur(1px);
}

.ritual-pro-notice {
    position: relative;
    z-index: 4;
    display: none;
    width: 100%;
}

/* Premium Lock Card */
.ritual-pro-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    max-width: 320px;
    width: calc(100vw - 48px);
    margin: 10px auto;
    text-align: center;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45), 0 0 20px rgba(139, 92, 246, 0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.ritual-pro-card-header {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.68rem;
    font-weight: 800;
    color: #f59e0b;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.ritual-pro-card-header i {
    filter: drop-shadow(0 0 3px rgba(245, 158, 11, 0.4));
}

.ritual-pro-card-desc {
    font-size: 0.76rem;
    line-height: 1.45;
    color: #a7b5ec;
    margin-bottom: 12px;
    font-weight: 500;
}

.ritual-pro-card-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px;
    border-radius: 99px;
    border: none;
    background: linear-gradient(135deg, #a855f7, #6d28d9);
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 4px 15px rgba(109, 40, 217, 0.4);
}

.ritual-pro-card-btn:hover {
    transform: translateY(-1.5px);
    box-shadow: 0 6px 20px rgba(109, 40, 217, 0.6);
}

.ritual-pro-card-btn:active {
    transform: translateY(0);
}

/* ── Timer Section Ritual Hint ───────────────────────────── */
.ritual-separator {
    height: 1px;
    background: var(--border-color);
    margin: 14px 0;
    opacity: 0.6;
}

/* ── Transition to Timer ─────────────────────────────────── */
.ritual-overlay.launch-transition {
    animation: ritualLaunch 0.8s var(--ease-out) both;
}

@keyframes ritualLaunch {
    0%   { opacity: 1; transform: scale(1); }
    60%  { opacity: 1; transform: scale(1.04); }
    100% { opacity: 0; transform: scale(0.98); }
}

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 480px) {
    .ritual-circle-wrap {
        width: 220px;
        height: 220px;
    }
    .ritual-sphere {
        width: 120px;
        height: 120px;
    }
    .ritual-phase-label {
        font-size: 1.6rem;
    }
    .ritual-start-btn {
        padding: 12px 28px;
    }
}

/* ── Bottom Ritual Tile ─────────────────────────────────── */
.ritual-bottom-tile {
    position: relative;
    margin: 0.75rem 0 1rem;
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    cursor: pointer;
    overflow: hidden;
    backdrop-filter: blur(12px);
    transition: all 0.3s var(--ease-smooth);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    display: block;
}

.ritual-bottom-tile:hover {
    transform: translateY(-2px);
    border-color: rgba(124, 58, 237, 0.4);
    box-shadow: 0 12px 40px rgba(124, 58, 237, 0.15), 0 8px 32px rgba(0, 0, 0, 0.4);
}

.ritual-tile-glow {
    position: absolute;
    top: -50%;
    left: -20%;
    width: 140%;
    height: 200%;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.08) 0%, transparent 60%);
    pointer-events: none;
}

.ritual-tile-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.ritual-tile-left {
    display: flex;
    align-items: center;
    gap: 18px;
}

.ritual-tile-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(124, 58, 237, 0.12);
    border: 1px solid rgba(124, 58, 237, 0.25);
    color: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
    transition: all 0.3s;
}

.ritual-bottom-tile:hover .ritual-tile-icon {
    transform: scale(1.1);
    background: rgba(124, 58, 237, 0.2);
    box-shadow: 0 0 15px rgba(124, 58, 237, 0.3);
}

.ritual-tile-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 4px;
    letter-spacing: -0.01em;
}

.ritual-tile-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
}

.ritual-tile-arrow {
    color: var(--text-muted);
    font-size: 0.95rem;
    transition: transform 0.2s;
}

.ritual-bottom-tile:hover .ritual-tile-arrow {
    transform: translateX(4px);
    color: var(--primary-light);
}

/* Luxurious Break Timer HUD Card */
.ritual-break-card {
    display: none;
    flex-direction: column;
    align-items: center;
    margin: 6px auto 12px;
    padding: 10px 28px;
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: var(--radius-xl);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), inset 0 0 15px rgba(16, 185, 129, 0.06);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 4;
}

.ritual-break-card-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.8px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.ritual-break-card-label i {
    color: var(--success-color);
    filter: drop-shadow(0 0 4px rgba(16, 185, 129, 0.5));
}

.ritual-break-card-timer {
    font-family: var(--font-mono);
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--success-color);
    letter-spacing: 0.02em;
    text-shadow: 0 0 16px rgba(16, 185, 129, 0.45), 0 0 30px rgba(16, 185, 129, 0.2);
    line-height: 1;
}

/* Luxurious Gold/Purple Gradient Button with Scale animation */
.ritual-break-unlock-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 30px;
    border-radius: 99px;
    border: 1px solid rgba(245, 158, 11, 0.4);
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(124, 58, 237, 0.15));
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 15px rgba(168, 85, 247, 0.15);
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.25s, border-color 0.25s;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    animation: pulseGlowGold 3s infinite ease-in-out;
}

.ritual-break-unlock-btn:hover {
    transform: scale(1.05);
    border-color: rgba(245, 158, 11, 0.7);
    box-shadow: 0 12px 30px rgba(124, 58, 237, 0.35), 0 0 20px rgba(245, 158, 11, 0.3);
}

.ritual-break-unlock-btn:active {
    transform: scale(0.98);
}

@keyframes pulseGlowGold {
    0%, 100% {
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 15px rgba(168, 85, 247, 0.15);
    }
    50% {
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 25px rgba(245, 158, 11, 0.25);
    }
}

.ritual-skip-break-btn:hover {
    opacity: 1 !important;
    color: #ffffff !important;
}
