/* ========================================
   위빠사나 명상 - 고요하고 신성한 디자인
   ======================================== */

:root {
    /* Animation Timing */
    --breathing-duration: 8s;
    --bell-fade-duration: 2s;

    /* Color Palette */
    --gradient-color-1: #a794e0;
    --gradient-color-2: #89b8ff;
    --gradient-color-3: #9bebb4;
    --meditation-primary: #89b8ff;
    --meditation-light: #b4d4ff;
    --text-dark: #212529;
    --text-muted: #6c757d;
    --bg-neutral: #F5F5F7;
    --white: #ffffff;

    /* Transitions */
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-reverent: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-quick: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);

    /* Spacing */
    --spacing-xs: 8px;
    --spacing-sm: 16px;
    --spacing-md: 24px;
    --spacing-lg: 40px;
    --spacing-xl: 60px;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 20px;
    --radius-lg: 24px;
    --radius-xl: 28px;

    /* Shadows */
    --shadow-soft: 0 15px 60px rgba(0, 0, 0, 0.1);
    --shadow-meditation-subtle: 0 15px 80px rgba(137, 184, 255, 0.12);
    --shadow-meditation-hover: 0 15px 100px rgba(137, 184, 255, 0.18);
    --shadow-card-hover: 0 25px 60px rgba(137, 184, 255, 0.35);
}

/* 페이지 배경 */
body {
    background: var(--bg-neutral);
}

/* 마우스 빛 효과 (청록빛) - Performance Optimized */
.mouse-light {
    position: fixed;
    top: 0;
    left: 0;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(137, 184, 255, 0.2), transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    filter: blur(120px);
    z-index: 1;
    /* Performance: GPU acceleration hints */
    will-change: transform;
    transform: translate3d(0, 0, 0);
}

/* 전체 페이지 */
.meditation-page {
    min-height: 100vh;
    background: transparent;
    position: relative;
    z-index: 2;
}

/* ========================================
   Tab Navigation System
   ======================================== */

.meditation-tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 10px 20px 10px;
    max-width: 650px;
    margin: 0 auto;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.6);
    border: 2px solid rgba(137, 184, 255, 0.2);
    border-radius: var(--radius-md);
    padding: 14px 32px;
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-smooth);
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.tab-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--meditation-primary), var(--gradient-color-3));
    opacity: 0;
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 0;
}

.tab-btn span {
    position: relative;
    z-index: 1;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(137, 184, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(137, 184, 255, 0.25);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--meditation-primary), var(--gradient-color-3));
    color: white;
    border-color: transparent;
    box-shadow: 0 10px 30px rgba(137, 184, 255, 0.35);
}

.tab-btn.active::before {
    opacity: 0;
}

.tab-btn:focus-visible {
    outline: 2px solid var(--meditation-primary);
    outline-offset: 2px;
}

/* Tab Panels */
.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* 화면 전환 시스템 - Performance Optimized */
.screen {
    display: none;
    padding: 20px 20px;
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.screen.show {
    display: flex;
}

/* Center content for setup and completion screens */
.screen.center-content {
    min-height: calc(100vh - 140px);
    align-items: center;
    justify-content: center;
}

/* Top-align content for meditation progress screens */
.screen.top-align {
    padding-top: 40px;
}

/* GPU-accelerated screen transitions */
.screen-exit {
    animation: screenExit 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.screen-enter {
    animation: screenEnter 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes screenExit {
    from {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
    to {
        opacity: 0;
        transform: translate3d(0, -20px, 0) scale(0.98);
    }
}

@keyframes screenEnter {
    from {
        opacity: 0;
        transform: translate3d(0, 20px, 0) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
}

/* 중앙 박스 */
.center-box {
    max-width: 650px;
    width: 100%;
    text-align: center;
}

#screen-setup h1,
#screen-buddha-setup h1 {
    font-size: clamp(2.5rem, 7vw, 4rem);
    font-weight: 300;
    margin: 0 0 12px;
    background: linear-gradient(120deg, var(--meditation-primary), var(--gradient-color-3));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin: 0 0 30px;
    line-height: 1.6;
}

/* ========================================
   수행 안내 섹션 (Guidance Section)
   ======================================== */

.guidance-container {
    background: rgba(255, 255, 255, 0.7);
    /* Performance: backdrop-filter removed for better mobile performance */
    /* Increased background opacity for better readability without filter */
    border: 1px solid rgba(137, 184, 255, 0.15);
    border-radius: var(--radius-lg);
    margin-bottom: 40px;
    overflow: hidden;
    animation: guidanceFadeIn 0.8s ease-out;
}

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

.guidance-toggle {
    width: 100%;
    background: transparent;
    border: none;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.3s ease;
}

.guidance-toggle:hover {
    background: rgba(137, 184, 255, 0.05);
}

.toggle-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-dark);
    letter-spacing: 0.02em;
}

.toggle-icon {
    font-size: 0.9rem;
    color: var(--meditation-primary);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.guidance-toggle[aria-expanded="true"] .toggle-icon {
    transform: rotate(180deg);
}

.guidance-content {
    max-height: 800px;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                padding 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 1;
    padding: 0 24px 28px;
}

.guidance-content.closed {
    max-height: 0;
    opacity: 0;
    padding: 0 24px;
}

.guidance-title {
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--text-dark);
    margin: 0 0 16px;
    letter-spacing: -0.01em;
}

.guidance-intro {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 2;
    margin: 0 0 28px;
    letter-spacing: -0.003em;
}

.guidance-section {
    margin-bottom: 24px;
}

.guidance-section:last-child {
    margin-bottom: 0;
}

.guidance-section h4 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--meditation-primary);
    margin: 0 0 12px;
    letter-spacing: 0.01em;
}

.guidance-section p {
    font-size: 0.98rem;
    color: var(--text-dark);
    line-height: 2.1;
    margin: 0;
    letter-spacing: -0.003em;
}

.guidance-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.guidance-list li {
    font-size: 0.98rem;
    color: var(--text-dark);
    line-height: 2.3;
    padding-left: 24px;
    position: relative;
    margin-bottom: 8px;
}

.guidance-list li::before {
    content: '·';
    position: absolute;
    left: 8px;
    color: var(--meditation-primary);
    font-size: 1.4em;
    line-height: 2;
}

.guidance-list li:last-child {
    margin-bottom: 0;
}

.pali {
    font-style: italic;
    color: var(--text-muted);
    font-size: 0.92em;
    letter-spacing: 0.02em;
    font-weight: 400;
}

/* Accessibility: Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .guidance-container {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .toggle-icon,
    .guidance-content {
        transition-duration: 0.1s;
    }

    .screen-exit,
    .screen-enter {
        animation: none;
    }

    .lotus {
        animation: none;
    }

    .glow {
        animation: none;
    }
}

.duration-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Add consistent spacing for Buddha tab to match Tab 1 */
#screen-buddha-setup .subtitle {
    margin-bottom: 40px !important;  /* Override default 30px to match Tab 1 visual spacing */
}

.duration-cards .card {
    background: rgba(255, 255, 255, 0.85);
    /* Performance: backdrop-filter removed for better mobile performance */
    border: 2px solid rgba(137, 184, 255, 0.2);
    border-radius: var(--radius-lg);
    padding: 35px 25px;
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    /* Performance: GPU acceleration for hover animations */
    will-change: transform;
    transform: translate3d(0, 0, 0);
}

.duration-cards .card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--meditation-primary), var(--gradient-color-3));
    opacity: 0;
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 0;
}

.duration-cards .card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-card-hover);
    border-color: rgba(137, 184, 255, 0.4);
}

.duration-cards .card:hover::before {
    opacity: 1;
}

.duration-cards .card h2 {
    font-size: 2.2rem;
    font-weight: 600;
    margin: 0 0 8px;
    color: var(--text-dark);
    position: relative;
    z-index: 1;
    transition: color 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.duration-cards .card p {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 0;
    position: relative;
    z-index: 1;
    transition: color 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.duration-cards .card:hover h2,
.duration-cards .card:hover p {
    color: var(--white);
}

/* 맞춤 시간 입력 */
.custom-duration {
    background: rgba(255, 255, 255, 0.8);
    /* Performance: backdrop-filter removed for better mobile performance */
    border: 2px solid rgba(137, 184, 255, 0.2);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.custom-duration label {
    font-size: 1rem;
    color: var(--text-dark);
    font-weight: 500;
}

.custom-duration input {
    width: 200px;
    padding: 12px 20px;
    font-size: 1.1rem;
    border: 2px solid rgba(137, 184, 255, 0.3);
    border-radius: var(--radius-md);
    background: var(--white);
    text-align: center;
    transition: var(--transition-quick);
}

.custom-duration input:focus {
    outline: none;
    border-color: var(--meditation-primary);
    box-shadow: 0 0 0 3px rgba(137, 184, 255, 0.1);
}

.custom-duration button {
    padding: 12px 40px;
    font-size: 1.1rem;
    font-weight: 500;
    background: linear-gradient(135deg, var(--meditation-primary), var(--gradient-color-3));
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-quick);
}

.custom-duration button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(137, 184, 255, 0.3);
}

/* ========================================
   2. 명상 진행 화면
   ======================================== */

.meditation-container {
    width: 100%;
    max-width: 650px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 0;
}

.back-btn {
    position: relative;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    padding: 12px 20px;
    margin-bottom: 20px;
    transition: var(--transition-quick);
}

.back-btn::before {
    content: '';
    position: absolute;
    inset: -4px;
    background: radial-gradient(circle, rgba(137, 184, 255, 0.15), transparent 70%);
    opacity: 0;
    border-radius: 50%;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.back-btn:hover {
    color: var(--meditation-primary);
}

.back-btn:hover::before {
    opacity: 1;
}

/* 호흡 원 (Breathing Circle) */
.breathing-circle {
    width: 300px;
    height: 300px;
    margin: 0 auto var(--spacing-lg);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-ring {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
    display: block;
}

.progress-ring-bg {
    fill: none;
    stroke: rgba(137, 184, 255, 0.1);
    stroke-width: 4;
}

.progress-ring-circle {
    fill: none;
    stroke: url(#breathing-gradient);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 880;
    stroke-dashoffset: 880;
    /* Performance: Remove transition to avoid conflict with JS updates */
    /* JavaScript handles smooth updates via requestAnimationFrame */
}

/* SVG gradient 정의 */
svg defs linearGradient {
    --color-start: var(--meditation-primary);
    --color-end: var(--gradient-color-3);
}

.time-display {
    position: absolute;
    font-size: 3rem;
    font-weight: 300;
    color: var(--text-dark);
    letter-spacing: 0.05em;
}

.meditation-instruction {
    font-size: 1.3rem;
    color: var(--text-muted);
    font-weight: 300;
    letter-spacing: 0.1em;
    margin: 0;
    text-align: center;
}

/* ========================================
   3. 명상 완료 화면
   ======================================== */

.completion-icon {
    position: relative;
    width: 240px;
    height: 240px;
    margin: 0 auto 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.glow {
    position: absolute;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, rgba(137, 184, 255, 0.3), transparent 70%);
    border-radius: 50%;
    filter: blur(40px);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

.lotus {
    font-size: 6rem;
    position: relative;
    z-index: 1;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.completion-text {
    font-size: 2.5rem;
    font-weight: 300;
    color: var(--text-dark);
    margin: 0 0 20px;
}

.completion-msg {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin: 0 0 40px;
}

.primary-btn {
    padding: 16px 48px;
    font-size: 1.2rem;
    font-weight: 500;
    background: linear-gradient(135deg, var(--meditation-primary), var(--gradient-color-3));
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-quick);
    display: none;  /* Hidden - auto-return already implemented */
}

.primary-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 40px rgba(137, 184, 255, 0.4);
}

/* ========================================
   Buddha Contemplation Styles
   ======================================== */

.buddha-container {
    width: 100%;
    max-width: 500px;
    margin: 20px auto var(--spacing-md);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.buddha-stack {
    position: relative;
    width: 100%;
    max-width: 400px;
    height: 400px;
    z-index: 1;
}

.buddha-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../assets/buddha-meditation.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    filter: drop-shadow(0 0 30px rgba(218, 165, 32, 0.4));
    -webkit-mask-image: linear-gradient(to top, transparent, black);
    mask-image: linear-gradient(to top, transparent, black);
    -webkit-mask-size: 100% 200%;
    mask-size: 100% 200%;
    -webkit-mask-position: 0% 100%;
    mask-position: 0% 100%;
}

/* Radial gradient aura behind Buddha */
.buddha-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    background: radial-gradient(
        circle,
        rgba(218, 165, 32, 0.2) 0%,
        rgba(218, 165, 32, 0.1) 30%,
        rgba(218, 165, 32, 0.05) 50%,
        transparent 70%
    );
    border-radius: 50%;
    z-index: 0;
    animation: aurapulse 4s ease-in-out infinite;
}

@keyframes aurapulse {
    0%, 100% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 0.9;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* Buddha dissolution animation - Layered bottom-to-top with smoke */
.buddha-stack.dissolving .buddha-layer {
    animation-timing-function: ease-in-out;
    animation-fill-mode: forwards;
    /* Duration set dynamically by JavaScript */
}

.buddha-stack.dissolving .buddha-layer:nth-child(1) {
    animation-name: layerFade1;
}

.buddha-stack.dissolving .buddha-layer:nth-child(2) {
    animation-name: layerFade2;
    animation-delay: calc(var(--animation-duration) * -0.033); /* -1s for 30s duration */
}

.buddha-stack.dissolving .buddha-layer:nth-child(3) {
    animation-name: layerFade3;
    animation-delay: calc(var(--animation-duration) * -0.067); /* -2s for 30s duration */
}

/* Layer 1: Stays sharp longest */
@keyframes layerFade1 {
    0% {
        opacity: 1;
        filter: drop-shadow(0 0 30px rgba(218, 165, 32, 0.4)) blur(0px);
        transform: translateY(0) scale(1);
        -webkit-mask-position: 0% 100%;
        mask-position: 0% 100%;
    }
    60% {
        opacity: 0.85;
        filter: drop-shadow(0 0 35px rgba(218, 165, 32, 0.45)) blur(0px);
        transform: translateY(-8px) scale(1.01);
        -webkit-mask-position: 0% 60%;
        mask-position: 0% 60%;
    }
    80% {
        opacity: 0.5;
        filter: drop-shadow(0 0 40px rgba(218, 165, 32, 0.3)) blur(2px);
        transform: translateY(-20px) scale(1.03);
        -webkit-mask-position: 0% 30%;
        mask-position: 0% 30%;
    }
    100% {
        opacity: 0;
        filter: drop-shadow(0 0 50px rgba(218, 165, 32, 0.2)) blur(5px);
        transform: translateY(-35px) scale(1.05);
        -webkit-mask-position: 0% 0%;
        mask-position: 0% 0%;
    }
}

/* Layer 2: Adds softness */
@keyframes layerFade2 {
    0% {
        opacity: 0.7;
        filter: drop-shadow(0 0 35px rgba(218, 165, 32, 0.35)) blur(0px);
        transform: translateY(0) scale(1);
        -webkit-mask-position: 0% 100%;
        mask-position: 0% 100%;
    }
    50% {
        opacity: 0.45;
        filter: drop-shadow(0 0 40px rgba(218, 165, 32, 0.3)) blur(1px);
        transform: translateY(-12px) scale(1.02);
        -webkit-mask-position: 0% 50%;
        mask-position: 0% 50%;
    }
    100% {
        opacity: 0;
        filter: drop-shadow(0 0 50px rgba(218, 165, 32, 0.2)) blur(6px);
        transform: translateY(-38px) scale(1.06);
        -webkit-mask-position: 0% 0%;
        mask-position: 0% 0%;
    }
}

/* Layer 3: Creates smoke trails */
@keyframes layerFade3 {
    0% {
        opacity: 0.5;
        filter: drop-shadow(0 0 40px rgba(218, 165, 32, 0.3)) blur(1px);
        transform: translateY(0) scale(1);
        -webkit-mask-position: 0% 100%;
        mask-position: 0% 100%;
    }
    40% {
        opacity: 0.3;
        filter: drop-shadow(0 0 50px rgba(218, 165, 32, 0.25)) blur(3px);
        transform: translateY(-15px) scale(1.03);
        -webkit-mask-position: 0% 60%;
        mask-position: 0% 60%;
    }
    100% {
        opacity: 0;
        filter: drop-shadow(0 0 60px rgba(218, 165, 32, 0.15)) blur(8px);
        transform: translateY(-45px) scale(1.08);
        -webkit-mask-position: 0% 0%;
        mask-position: 0% 0%;
    }
}

/* TEST OPTION 1: Rising Incense Smoke - Wispy trails ascending */
@keyframes buddhaDissolveParticles {
    0% {
        opacity: 1;
        filter: drop-shadow(0 0 30px rgba(218, 165, 32, 0.4))
                drop-shadow(0 0 60px rgba(218, 165, 32, 0.2))
                blur(0px)
                brightness(1);
        transform: translateY(0) scale(1);
        clip-path: inset(0% 0% 0% 0%);
    }
    15% {
        opacity: 0.95;
        filter: drop-shadow(0 0 35px rgba(218, 165, 32, 0.5))
                drop-shadow(0 0 70px rgba(218, 165, 32, 0.3))
                drop-shadow(0 -10px 40px rgba(218, 165, 32, 0.15))
                blur(1px)
                brightness(1.03);
        transform: translateY(-8px) scale(1.01);
        clip-path: inset(0% 0% 15% 0%);
    }
    30% {
        opacity: 0.88;
        filter: drop-shadow(0 0 42px rgba(218, 165, 32, 0.5))
                drop-shadow(0 0 85px rgba(218, 165, 32, 0.3))
                drop-shadow(0 -20px 50px rgba(218, 165, 32, 0.2))
                drop-shadow(0 -40px 60px rgba(218, 165, 32, 0.12))
                blur(3px)
                brightness(1.07);
        transform: translateY(-15px) scale(1.025);
        clip-path: inset(0% 0% 30% 0%);
    }
    50% {
        opacity: 0.75;
        filter: drop-shadow(0 0 50px rgba(218, 165, 32, 0.48))
                drop-shadow(0 0 100px rgba(218, 165, 32, 0.28))
                drop-shadow(0 -30px 60px rgba(218, 165, 32, 0.22))
                drop-shadow(0 -60px 80px rgba(218, 165, 32, 0.15))
                blur(6px)
                brightness(1.12);
        transform: translateY(-25px) scale(1.045);
        clip-path: inset(0% 0% 50% 0%);
    }
    70% {
        opacity: 0.55;
        filter: drop-shadow(0 0 60px rgba(218, 165, 32, 0.4))
                drop-shadow(0 0 120px rgba(218, 165, 32, 0.25))
                drop-shadow(0 -45px 75px rgba(218, 165, 32, 0.2))
                drop-shadow(0 -90px 100px rgba(218, 165, 32, 0.14))
                drop-shadow(0 -130px 120px rgba(218, 165, 32, 0.08))
                blur(10px)
                brightness(1.17);
        transform: translateY(-35px) scale(1.065);
        clip-path: inset(0% 0% 70% 0%);
    }
    85% {
        opacity: 0.3;
        filter: drop-shadow(0 0 75px rgba(218, 165, 32, 0.3))
                drop-shadow(0 0 150px rgba(218, 165, 32, 0.2))
                drop-shadow(0 -60px 90px rgba(218, 165, 32, 0.18))
                drop-shadow(0 -120px 120px rgba(218, 165, 32, 0.12))
                drop-shadow(0 -180px 150px rgba(218, 165, 32, 0.08))
                blur(13px)
                brightness(1.22);
        transform: translateY(-45px) scale(1.08);
        clip-path: inset(0% 0% 85% 0%);
    }
    100% {
        opacity: 0;
        filter: drop-shadow(0 0 100px rgba(218, 165, 32, 0.2))
                drop-shadow(0 0 180px rgba(218, 165, 32, 0.12))
                drop-shadow(0 -80px 110px rgba(218, 165, 32, 0.15))
                drop-shadow(0 -160px 150px rgba(218, 165, 32, 0.1))
                drop-shadow(0 -240px 180px rgba(218, 165, 32, 0.06))
                blur(15px)
                brightness(1.28);
        transform: translateY(-55px) scale(1.1);
        clip-path: inset(0% 0% 100% 0%);
    }
}

/* TEST OPTION 2: Morning Fog Lifting - Ultra-soft static fog evaporation */
@keyframes buddhaDissolveSmoke {
    0% {
        opacity: 1;
        filter: drop-shadow(0 0 30px rgba(218, 165, 32, 0.4))
                drop-shadow(0 0 60px rgba(218, 165, 32, 0.2))
                blur(0px)
                brightness(1);
        transform: scale(1);
        clip-path: inset(0% 0% 0% 0%);
    }
    12% {
        opacity: 0.96;
        filter: drop-shadow(0 0 35px rgba(218, 165, 32, 0.48))
                drop-shadow(0 0 70px rgba(218, 165, 32, 0.28))
                drop-shadow(0 0 110px rgba(218, 165, 32, 0.15))
                blur(2px)
                brightness(1.02);
        transform: scale(1.01);
        clip-path: inset(0% 0% 12% 0%);
    }
    25% {
        opacity: 0.9;
        filter: drop-shadow(0 0 40px rgba(218, 165, 32, 0.5))
                drop-shadow(0 0 80px rgba(218, 165, 32, 0.3))
                drop-shadow(0 0 120px rgba(218, 165, 32, 0.18))
                drop-shadow(0 0 160px rgba(218, 165, 32, 0.1))
                blur(4px)
                brightness(1.05);
        transform: scale(1.02);
        clip-path: inset(0% 0% 25% 0%);
    }
    37% {
        opacity: 0.82;
        filter: drop-shadow(0 0 48px rgba(218, 165, 32, 0.48))
                drop-shadow(0 0 95px rgba(218, 165, 32, 0.3))
                drop-shadow(0 0 145px rgba(218, 165, 32, 0.2))
                drop-shadow(0 0 195px rgba(218, 165, 32, 0.12))
                blur(7px)
                brightness(1.08);
        transform: scale(1.03);
        clip-path: inset(0% 0% 37% 0%);
    }
    50% {
        opacity: 0.72;
        filter: drop-shadow(0 0 55px rgba(218, 165, 32, 0.45))
                drop-shadow(0 0 110px rgba(218, 165, 32, 0.3))
                drop-shadow(0 0 170px rgba(218, 165, 32, 0.2))
                drop-shadow(0 0 230px rgba(218, 165, 32, 0.13))
                drop-shadow(0 0 290px rgba(218, 165, 32, 0.08))
                blur(10px)
                brightness(1.12);
        transform: scale(1.045);
        clip-path: inset(0% 0% 50% 0%);
    }
    62% {
        opacity: 0.6;
        filter: drop-shadow(0 0 65px rgba(218, 165, 32, 0.42))
                drop-shadow(0 0 125px rgba(218, 165, 32, 0.28))
                drop-shadow(0 0 190px rgba(218, 165, 32, 0.2))
                drop-shadow(0 0 260px rgba(218, 165, 32, 0.14))
                drop-shadow(0 0 330px rgba(218, 165, 32, 0.09))
                blur(13px)
                brightness(1.16);
        transform: scale(1.06);
        clip-path: inset(0% 0% 62% 0%);
    }
    75% {
        opacity: 0.45;
        filter: drop-shadow(0 0 75px rgba(218, 165, 32, 0.38))
                drop-shadow(0 0 145px rgba(218, 165, 32, 0.26))
                drop-shadow(0 0 220px rgba(218, 165, 32, 0.18))
                drop-shadow(0 0 300px rgba(218, 165, 32, 0.13))
                drop-shadow(0 0 385px rgba(218, 165, 32, 0.08))
                drop-shadow(0 0 470px rgba(218, 165, 32, 0.05))
                blur(16px)
                brightness(1.2);
        transform: scale(1.075);
        clip-path: inset(0% 0% 75% 0%);
    }
    87% {
        opacity: 0.25;
        filter: drop-shadow(0 0 90px rgba(218, 165, 32, 0.3))
                drop-shadow(0 0 170px rgba(218, 165, 32, 0.22))
                drop-shadow(0 0 255px rgba(218, 165, 32, 0.16))
                drop-shadow(0 0 345px rgba(218, 165, 32, 0.12))
                drop-shadow(0 0 440px rgba(218, 165, 32, 0.08))
                drop-shadow(0 0 540px rgba(218, 165, 32, 0.05))
                blur(18px)
                brightness(1.25);
        transform: scale(1.09);
        clip-path: inset(0% 0% 87% 0%);
    }
    100% {
        opacity: 0;
        filter: drop-shadow(0 0 110px rgba(218, 165, 32, 0.25))
                drop-shadow(0 0 200px rgba(218, 165, 32, 0.18))
                drop-shadow(0 0 295px rgba(218, 165, 32, 0.13))
                drop-shadow(0 0 395px rgba(218, 165, 32, 0.1))
                drop-shadow(0 0 500px rgba(218, 165, 32, 0.07))
                drop-shadow(0 0 610px rgba(218, 165, 32, 0.04))
                blur(20px)
                brightness(1.3);
        transform: scale(1.1);
        clip-path: inset(0% 0% 100% 0%);
    }
}

/* TEST OPTION 3: Radial Light Burst - Using opacity + filter only */
@keyframes buddhaDissolveRadial {
    0% {
        opacity: 1;
        filter: drop-shadow(0 0 30px rgba(218, 165, 32, 0.4)) blur(0) brightness(1);
        transform: scale(1);
    }
    20% {
        opacity: 0.95;
        filter: drop-shadow(0 0 70px rgba(218, 165, 32, 0.9))
                drop-shadow(0 0 140px rgba(218, 165, 32, 0.7))
                blur(4px) brightness(1.4);
        transform: scale(1.08);
    }
    50% {
        opacity: 0.65;
        filter: drop-shadow(0 0 120px rgba(218, 165, 32, 1))
                drop-shadow(0 0 220px rgba(218, 165, 32, 0.9))
                blur(12px) brightness(1.75);
        transform: scale(1.2);
    }
    75% {
        opacity: 0.28;
        filter: drop-shadow(0 0 170px rgba(218, 165, 32, 0.7))
                drop-shadow(0 0 300px rgba(218, 165, 32, 0.5))
                blur(25px) brightness(2);
        transform: scale(1.4);
    }
    100% {
        opacity: 0;
        filter: drop-shadow(0 0 240px rgba(218, 165, 32, 0.4))
                drop-shadow(0 0 400px rgba(218, 165, 32, 0.3))
                blur(45px) brightness(2.3);
        transform: scale(1.6);
    }
}

.buddha-timer-display {
    display: none;  /* Hidden - focus on Buddha dissolution without time distraction */
}

/* Impermanence completion text */
.impermanence-text {
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 400;
    background: linear-gradient(135deg, #daa520, #b8860b);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    margin: 0 0 40px;
    line-height: 1.6;
    letter-spacing: 0.02em;
    opacity: 0;
    text-shadow: 0 0 30px rgba(218, 165, 32, 0.3);
    animation: impermanenceFadeIn 2.5s ease-out 0.5s forwards;
    position: relative;
}

/* Backdrop glow element */
.impermanence-text::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150%;
    height: 150%;
    background: radial-gradient(
        circle,
        rgba(218, 165, 32, 0) 0%,
        rgba(218, 165, 32, 0) 40%,
        transparent 70%
    );
    opacity: 0;
    z-index: -1;
    pointer-events: none;
    border-radius: 50%;
    filter: blur(30px);
}

@keyframes impermanenceFadeIn {
    from {
        opacity: 0;
        transform: translateY(25px);
        filter: blur(12px);
    }
    50% {
        opacity: 0.7;
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

/* Fade-out animation with golden glow */
.impermanence-text.fading {
    animation: impermanenceFadeOut 1s ease-in-out forwards;
}

.impermanence-text.fading::before {
    animation: glowPulse 1s ease-in-out forwards;
}

@keyframes impermanenceFadeOut {
    0% {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
    30% {
        opacity: 0.9;
        transform: translateY(-5px);
        filter: blur(1px);
    }
    70% {
        opacity: 0.4;
        transform: translateY(-15px) scale(1.02);
        filter: blur(4px);
    }
    100% {
        opacity: 0;
        transform: translateY(-25px) scale(1.05);
        filter: blur(8px);
    }
}

@keyframes glowPulse {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    30% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1);
        background: radial-gradient(
            circle,
            rgba(218, 165, 32, 0.4) 0%,
            rgba(218, 165, 32, 0.2) 40%,
            transparent 70%
        );
    }
    70% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1.2);
        background: radial-gradient(
            circle,
            rgba(218, 165, 32, 0.5) 0%,
            rgba(218, 165, 32, 0.3) 40%,
            transparent 70%
        );
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.5);
        background: radial-gradient(
            circle,
            rgba(218, 165, 32, 0.2) 0%,
            rgba(218, 165, 32, 0.1) 40%,
            transparent 70%
        );
    }
}

/* Coming soon text */
.coming-soon {
    font-size: 2rem;
    font-weight: 300;
    color: var(--text-muted);
    margin: 0;
}

/* ========================================
   반응형 디자인
   ======================================== */

@media (max-width: 768px) {
    /* Tab navigation responsive */
    .meditation-tabs {
        gap: 8px;
        padding: 20px 15px 15px;
    }

    .tab-btn {
        padding: 12px 20px;
        font-size: 0.95rem;
    }

    .duration-cards {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .breathing-circle {
        width: 250px;
        height: 250px;
    }

    .time-display {
        font-size: 2.5rem;
    }

    .completion-icon,
    .glow {
        width: 180px;
        height: 180px;
    }

    .lotus {
        font-size: 5rem;
    }

    /* Buddha contemplation mobile */
    .buddha-container {
        margin-top: 15px;
    }

    .buddha-image {
        max-height: 250px;
    }

    .impermanence-text {
        font-size: 1.8rem;
    }

    /* Performance: Disable mouse light on mobile devices */
    .mouse-light {
        display: none;
    }

    /* Performance: Reduce animation complexity on mobile */
    .glow {
        filter: blur(30px);
    }

    /* Performance: Optimize card hover for touch devices */
    .duration-cards .card {
        /* Remove will-change on mobile to save memory */
        will-change: auto;
    }
}

@media (max-width: 428px) {
    .screen {
        padding: 24px 16px;
    }

    .breathing-circle {
        width: 220px;
        height: 220px;
    }

    .time-display {
        font-size: 2.2rem;
    }

    .buddha-container {
        margin-top: 10px;
    }

    .buddha-image {
        max-height: 220px;
    }

    /* Mobile typography optimization */
    .guidance-content {
        padding: 24px 20px;
    }

    .guidance-title {
        font-size: 1.25rem;
        line-height: 1.5;
        margin-bottom: 14px;
    }

    .guidance-intro {
        font-size: 0.95rem;
        line-height: 2.2;
        margin-bottom: 24px;
    }

    .guidance-section h4 {
        font-size: 1rem;
        margin-bottom: 10px;
    }

    .guidance-section p {
        font-size: 0.95rem;
        line-height: 2.2;
    }

    .duration-cards {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 24px;
    }

    .duration-cards .card {
        padding: 28px 20px;
    }

    .duration-cards .card h2 {
        font-size: 2rem;
    }

    .custom-duration {
        padding: 20px 16px;
    }

    .custom-duration input {
        width: 100%;
        max-width: 280px;
        font-size: 1rem;
    }

    .custom-duration button {
        width: 100%;
        max-width: 280px;
        padding: 14px 32px;
    }
}

/* Extra small screens (iPhone SE, etc.) */
@media (max-width: 320px) {
    .guidance-content {
        padding: 20px 16px;
    }

    .guidance-intro {
        font-size: 0.94rem;
        line-height: 2.1;
    }

    #screen-setup h1 {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .buddha-container {
        margin-top: 10px;
    }

    .buddha-image {
        max-height: 200px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Hide mouse light on touch devices */
    .mouse-light {
        display: none;
    }

    /* Touch feedback for cards */
    .duration-cards .card:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }

    /* Touch feedback for buttons */
    .custom-duration button:active,
    .back-btn:active,
    .primary-btn:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
}
