:root {
    --bg-color: #030305;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.5);
    --accent-color: #a78bfa;
    --glass-bg: rgba(15, 15, 20, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
}

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

body, html {
    width: 100%; height: 100%;
    font-family: 'Pretendard', 'Outfit', 'Noto Sans KR', sans-serif;
    background-color: #000; /* 완전한 우주의 블랙 */
    color: var(--text-primary);
    overflow: hidden; overflow-x: hidden; overflow-y: hidden;
}

#root {
    width: 100vw; height: 100vh;
    display: flex; justify-content: center; align-items: center;
}

/* 🎬 Cinematic Intro */
.intro-screen {
    position: absolute; 
    inset: 0; 
    background: #000000; 
    z-index: 9999;
    display: flex; 
    justify-content: center; 
    align-items: center;
}

.intro-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #cbd5e1 0%, #94a3b8 20%, #64748b 50%, #334155 100%);
    box-shadow: 
        inset -3px -3px 8px rgba(0,0,0,0.8),
        inset 3px 3px 8px rgba(255,255,255,0.4),
        0 0 25px 5px rgba(255, 255, 255, 0.15);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    will-change: opacity, transform;
    z-index: 10000;
}

.intro-text {
    position: absolute; font-family: 'Outfit', sans-serif;
    font-size: 1.5rem; font-weight: 200; letter-spacing: 0.3em;
    text-align: center; opacity: 0;
    transition: opacity 4s ease-in-out, transform 6s ease-out;
}

#introText {
    position: absolute;
    top: calc(50% + 35px);
    left: 50%;
    transform: translate(-50%, -50%) scale(0.98);
    opacity: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    text-align: center;
    will-change: opacity, transform;
}

.hello-my { color: #fff; transition: opacity 3s ease; }
.eden-text { color: var(--accent-color); font-weight: 400; text-shadow: 0 0 20px rgba(167,139,250,0.5); }

/* Ambient Background */
.ambient-background {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 0; overflow: hidden; overflow-x: hidden; overflow-y: hidden;
}

.glow-orb {
    position: absolute; border-radius: 50%; filter: blur(100px); opacity: 0.4;
    animation: drift 20s infinite alternate ease-in-out;
}
.orb-1 { width: 60vh; height: 60vh; background: radial-gradient(circle, rgba(76,29,149,0.5) 0%, transparent 70%); top: -10%; left: -20%; }
.orb-2 { width: 70vh; height: 70vh; background: radial-gradient(circle, rgba(30,58,138,0.4) 0%, transparent 70%); bottom: -20%; right: -20%; animation-delay: -5s; }
.orb-3 { width: 50vh; height: 50vh; background: radial-gradient(circle, rgba(139,92,246,0.3) 0%, transparent 70%); top: 30%; left: 20%; animation-delay: -10s; }

@keyframes drift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(10%, 10%) scale(1.1); }
}

.noise-overlay {
    position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background-image: url('data:image/svg+xml;utf8,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)" opacity="0.04"/%3E%3C/svg%3E');
}

/* App Container (Mobile Size) */
.app-container {
    position: relative; z-index: 10;
    width: 100%; max-width: 420px; height: 100vh;
    margin: 0 auto;
    background: rgba(3, 3, 5, 0.82);
    border: none;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    display: flex; flex-direction: column;
    padding-top: max(env(safe-area-inset-top, 0px), 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    padding-left: 0;
    padding-right: 0;
}

@media (min-width: 744px) {         /* iPad 세로 */
    .app-container { max-width: 720px; }
}
@media (min-width: 1024px) {        /* iPad 가로·13인치 */
    .app-container { max-width: 960px; }
}

.header { display: flex; }
.logo {
    font-size: 2rem; font-weight: 300; letter-spacing: 0.4em; margin-right: -0.4em;
    background: linear-gradient(135deg, #cbd5e1 0%, #fff 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

/* Wizard Flow */
.wizard-flow {
    flex: 1; position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.step-card {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0; transform: translateX(30px); pointer-events: none;
    transition: all 0.15s ease-out;
    display: flex; flex-direction: column; align-items: center; justify-content: safe center; text-align: center; gap: 1.5rem;
    overflow-y: auto;
}
.step-card::-webkit-scrollbar {
    display: none;
}

.step-card.active {
    opacity: 1; transform: translateX(0); pointer-events: auto;
    position: relative;
}

.step-card.passed {
    opacity: 0; transform: translateX(-30px); pointer-events: none;
}

.step-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.8rem; font-weight: 300; line-height: 1.5; color: #cbd5e1;
}
.highlight { color: #fff; font-weight: 500; text-shadow: 0 0 10px rgba(255,255,255,0.4); }

.clean-input {
    width: 100%; background: transparent;
    border: none; border-bottom: 1px solid rgba(203,213,225,0.3);
    color: #fff; font-size: 1.5rem; font-family: 'JetBrains Mono', monospace;
    text-align: center; padding: 0.5rem; outline: none; transition: 0.3s;
    letter-spacing: 0.1em;
}
.clean-input:focus { border-bottom-color: #fff; box-shadow: 0 10px 10px -10px rgba(255,255,255,0.2); }
.clean-input::placeholder { color: rgba(203,213,225,0.25); font-size: 0.95rem; }

.hint { font-size: 0.8rem; color: var(--text-secondary); margin-top: -1rem; }

@keyframes holoMetal {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

.next-btn, .bubble-btn {
    position: relative;
    background: linear-gradient(135deg, rgba(30, 20, 40, 0.85) 0%, rgba(20, 30, 50, 0.85) 25%, rgba(255, 255, 255, 0.9) 45%, rgba(5, 5, 10, 0.95) 47%, rgba(40, 25, 50, 0.85) 65%, rgba(15, 40, 45, 0.85) 100%);
    background-size: 200% 200%;
    animation: holoMetal 5s ease-in-out infinite alternate;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
    font-size: 1.1rem; letter-spacing: 0.1em; cursor: pointer;
    padding: 1rem 2rem; border-radius: 30px;
    margin: 0 auto;
    backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px);
    box-shadow: 
        inset 0 2px 5px rgba(255, 255, 255, 0.5),
        inset 0 -10px 20px rgba(15, 23, 42, 0.6),
        0 15px 35px rgba(0, 0, 0, 0.7),
        0 0 20px rgba(224, 195, 252, 0.3),
        0 0 20px rgba(187, 240, 243, 0.3);
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.next-btn:active, .bubble-btn:active { transform: scale(0.95); }

.bubble-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    padding: 1.2rem 2rem;
    width: 100%;
}

.bubble-btn .label {
    font-family: 'Pretendard', sans-serif;
    font-size: 1.1rem;
    letter-spacing: 0.15em;
    background: linear-gradient(to bottom, #ffffff 0%, #e2e8f0 40%, #cbd5e1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    font-weight: 500 !important;
    filter: drop-shadow(0px 2px 4px rgba(0, 0, 0, 0.6));
}

/* Keywords Step */
.keyword-grid {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem;
}

.tag-btn {
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6); padding: 0.6rem 1rem; border-radius: 20px;
    font-size: 0.9rem; font-family: inherit; cursor: pointer; 
    backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.tag-btn.selected {
    background: linear-gradient(135deg, rgba(30, 20, 40, 0.85) 0%, rgba(20, 30, 50, 0.85) 25%, rgba(255, 255, 255, 0.9) 45%, rgba(5, 5, 10, 0.95) 47%, rgba(40, 25, 50, 0.85) 65%, rgba(15, 40, 45, 0.85) 100%);
    background-size: 200% 200%;
    animation: holoMetal 5s ease-in-out infinite alternate;
    border: 1px solid rgba(255, 255, 255, 0.15); 
    color: #fff;
    font-weight: 600;
    backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px);
    box-shadow: 
        inset 0 2px 5px rgba(255, 255, 255, 0.5),
        inset 0 -10px 20px rgba(15, 23, 42, 0.6),
        0 15px 35px rgba(0, 0, 0, 0.7),
        0 0 20px rgba(224, 195, 252, 0.3),
        0 0 20px rgba(187, 240, 243, 0.3);
}
.tag-btn:active { transform: scale(0.95); }

.selected-tags-display {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; min-height: 40px;
}
.selected-chip {
    background: var(--accent-color); color: #000; font-weight: 500;
    padding: 0.3rem 0.8rem; border-radius: 12px; font-size: 0.8rem;
    display: flex; align-items: center; gap: 5px;
}

/* Loading Section */
.hidden { display: none !important; }

.loading-section {
    position: relative;
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 2rem;
    width: 100%; height: 100%;
}

.hud-container {
    position: absolute; top: 1rem; left: 1rem; right: 1rem;
    display: flex; justify-content: space-between; align-items: flex-start;
    z-index: 10; pointer-events: none;
}

.universal-code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem; color: #cbd5e1;
    text-align: left; line-height: 1.4;
    text-shadow: 0 0 10px rgba(203,213,225,0.4);
    white-space: pre-wrap;
}

#visualizerCanvas {
    position: absolute;
    top: calc(-1 * env(safe-area-inset-top, 0px));
    left: calc(-1.5rem - env(safe-area-inset-left, 0px));
    width: calc(100vw + 3rem + env(safe-area-inset-left, 0px) + env(safe-area-inset-right, 0px));
    height: calc(100dvh + env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px));
    z-index: 0;
    pointer-events: auto;
    background: #000000 !important;
    mix-blend-mode: screen;
    opacity: 0.96;
    filter: drop-shadow(0 0 15px rgba(0, 0, 0, 0.9));
}

.quantum-clock {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: rgba(203,213,225,0.4);
    letter-spacing: 0.1em;
    text-align: right;
    margin-top: 0.2rem;
}

.loading-title {
    position: relative; z-index: 10;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem; font-weight: 300; line-height: 1.6; color: #f8fafc;
    text-shadow: 0 0 15px rgba(248,250,252,0.3);
}

.status-console {
    position: relative; z-index: 10;
    width: 100%; height: 150px; display: flex; flex-direction: column; justify-content: flex-end;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem; color: #94a3b8; text-align: center; gap: 0.5rem; overflow: hidden; overflow-x: hidden; overflow-y: hidden;
}

.status-line {
    opacity: 0; transform: translateY(15px); transition: all 1.2s ease;
}
.status-line.active { opacity: 1; transform: translateY(0); color: #fff; text-shadow: 0 0 10px rgba(255,255,255,0.5); }
.status-line.done { opacity: 0.4; transform: translateY(0); }

.progress-bar { width: 100%; height: 3px; background: rgba(255,255,255,0.1); border-radius: 2px; overflow: hidden; overflow-x: hidden; overflow-y: hidden; }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #8b5cf6, #d8b4fe); box-shadow: 0 0 10px #a78bfa; transition: width 0.2s linear; }

/* Home Screen & Holographic UI */
.home-screen {
    width: 100%;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: safe center;
    gap: 1.5rem;
    z-index: 10;
}

.home-greeting {
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    font-weight: 300;
    letter-spacing: 0.15em;
    color: #fff;
    text-shadow: 0 0 10px rgba(255,255,255,0.3);
    text-align: center;
    margin-bottom: 1rem;
}

/* Audio Sphere / Panels */
.sphere-panel {
    position: absolute;
    inset: 0;
    background: rgba(5, 10, 15, 0.85);
    backdrop-filter: blur(40px); -webkit-backdrop-filter: blur(40px);
    border-radius: 38px;
    border: 1px solid rgba(255,255,255,0.08);
    z-index: 110;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    transition: all 0.5s ease;
}

.sphere-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: absolute;
    top: calc(env(safe-area-inset-top, 0px) + 2.5rem);
    left: 0;
    padding: 0 2rem;
}

.sphere-header h2 {
    font-family: 'Pretendard', sans-serif;
    font-size: 1.3rem;
    font-weight: 300;
    letter-spacing: 0.15em;
    color: #fff;
}

.sphere-content {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: calc(env(safe-area-inset-top, 0px) + 5rem);
    max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 5.5rem);
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.4) transparent;
}

.sphere-content::-webkit-scrollbar { width: 6px; }
.sphere-content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.4); border-radius: 3px; }
.sphere-content::-webkit-scrollbar-track { background: transparent; }

/* 개인 프로필 스크롤바 — 스크롤할 때만 보이고 평소엔 숨김 */
.profile-scroll-content {
    scrollbar-width: thin !important;                    /* Firefox */
    scrollbar-color: transparent transparent;            /* 평소: 숨김 */
    -ms-overflow-style: auto !important;
    overflow-y: auto !important;                         /* 표준 스크롤 */
    -webkit-overflow-scrolling: touch !important;        /* iOS 부드러운 스크롤 */
    transition: scrollbar-color 0.3s ease;
    padding-right: 6px !important;                       /* 컨텐츠 여백 확보 */
    position: relative !important;
    z-index: 100 !important;                             /* 배경 위로 */
}
.profile-scroll-content.is-scrolling {
    scrollbar-color: rgba(255,255,255,0.28) transparent; /* 스크롤 중: 보임 */
}
.profile-scroll-content::-webkit-scrollbar {             /* iOS/Safari/Chrome */
    width: 5px !important;
    height: 5px !important;
    display: block !important;
}
.profile-scroll-content::-webkit-scrollbar-thumb {
    background: transparent !important;                  /* 평소: 투명(안 보임) */
    border-radius: 4px !important;
    border: 1px solid transparent !important;
    background-clip: padding-box !important;
    transition: background 0.3s ease;
}
.profile-scroll-content.is-scrolling::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.28) !important;        /* 스크롤 중: 보임 */
}
.profile-scroll-content::-webkit-scrollbar-track {
    background: transparent !important;
}

/* 스크롤 중에만 스크롤바 표시 */
.profile-scroll-content:not(.is-scrolling)::-webkit-scrollbar-thumb {
    background: transparent !important;
}
.profile-scroll-content:not(.is-scrolling) {
    scrollbar-color: transparent transparent !important;
}

/* 소리 주파수/오버레이 스크롤바 항상 보이게 (복구) */
.sphere-content::-webkit-scrollbar {
    width: 4px;
}
.sphere-content::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.25);
    border-radius: 2px;
}
.sphere-content::-webkit-scrollbar-track {
    background: transparent;
}

.audio-sphere-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    margin-top: 1.5rem;
}

.audio-sphere-container {
    position: relative;
    width: 250px;
    height: 250px;
    margin: 1rem 0;
    background: rgba(255,255,255,0.01);
    border-radius: 50%;
}

#sphereRadarCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.sphere-node {
    position: absolute;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.05em;
    pointer-events: none;
}

#quantumSpherePointer {
    position: absolute;
    width: 22px;
    height: 22px;
    background: #fff;
    border: 2px solid #a78bfa;
    border-radius: 50%;
    box-shadow: 0 0 15px #a78bfa;
    cursor: grab;
    z-index: 10;
}

#sphereLiveStatus {
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: rgba(255,255,255,0.4);
    line-height: 1.4;
}

.close-btn {
    background: transparent; border: none; color: #fff; font-size: 1.5rem; cursor: pointer;
    text-shadow: 0 0 10px rgba(255,255,255,0.5); transition: 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
}
.close-btn:active { transform: scale(0.85); background: rgba(255,255,255,0.1); }

.slider-group {
    width: 100%;
}
.slider-group label {
    display: block; font-size: 0.9rem; color: #cbd5e1; letter-spacing: 0.05em; margin-bottom: 0.8rem; font-weight: 300;
}
.chrome-slider {
    -webkit-appearance: none; appearance: none;
    width: 100%; height: 3px; border-radius: 1.5px;
    background: linear-gradient(90deg, rgba(0,0,0,0) calc(50% - 1px), rgba(255,255,255,0.4) calc(50% - 1px), rgba(255,255,255,0.4) calc(50% + 1px), rgba(0,0,0,0) calc(50% + 1px)), #000000;
    outline: none;
    box-shadow: inset 0 1px 3px rgba(0,0,0,1), 0 1px 1px rgba(255,255,255,0.15);
}
.chrome-slider::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 24px; height: 24px; border-radius: 50%; cursor: pointer;
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 45%, #94a3b8 50%, #f1f5f9 100%);
    box-shadow: 
        inset 0 2px 4px rgba(255,255,255,1), 
        inset 0 -2px 4px rgba(0,0,0,0.3),
        0 5px 10px rgba(0,0,0,0.8);
    border: 1px solid rgba(255,255,255,0.4);
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.intro-skip-btn, .tutorial-skip-btn {
    position: absolute;
    top: 2rem;
    right: 2rem;
    z-index: 10000;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.05em;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.intro-skip-btn:hover, .tutorial-skip-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

.step-desc {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    line-height: 1.6;
    max-width: 90%;
    margin-top: 1rem;
    word-break: keep-all;
    text-align: center;
}

/* Daily Zen Overlay */
.zen-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(1, 1, 3, 0.96);
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    z-index: 2000;
    transition: opacity 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}

.zen-content {
    text-align: center;
    display: flex; flex-direction: column; align-items: center;
    max-width: 85%;
}

.zen-title {
    font-size: 2rem; font-weight: 200; letter-spacing: 0.05em;
    color: #fff;
    margin-bottom: 0.5rem;
}

.zen-subtitle {
    font-size: 1rem; color: rgba(255, 255, 255, 0.6); font-weight: 300; letter-spacing: 0.05em;
    margin-bottom: 2.5rem;
}

.zen-loader {
    width: 40px; height: 1px; background: rgba(255,255,255,0.2); margin: 0 auto 2.5rem; position: relative; overflow: hidden; overflow-x: hidden; overflow-y: hidden;
}

.zen-loader div {
    position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: #a78bfa; animation: zenLoadingBar 2s infinite ease-in-out;
}

@keyframes zenLoadingBar {
    0% { left: -100%; }
    50% { left: 0; }
    100% { left: 100%; }
}

.zen-description {
    font-size: 0.85rem; color: rgba(255,255,255,0.55); line-height: 1.8; max-width: 600px;
}

/* === Daily Zen: 스크롤 + 상단 노치 보정 === */
.zen-scroll-content {
    width: 100%;
    max-width: 440px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: max(4.5rem, calc(env(safe-area-inset-top, 0px) + 1.5rem)) 1.25rem max(2rem, calc(env(safe-area-inset-bottom, 0px) + 1rem));
    scrollbar-width: none;        /* Firefox: 스크롤바 숨김 */
    -ms-overflow-style: none;     /* IE/Edge */
}
.zen-scroll-content::-webkit-scrollbar { width: 0; height: 0; display: none; }  /* iOS/Safari/Chrome: 스크롤바 숨김 (스크롤 기능은 유지) */

/* === Daily Zen: 호흡 가이드 서클 === */
.zen-breath-container {
    position: relative;
    width: 150px; height: 150px;
    display: flex; align-items: center; justify-content: center;
    margin: 0.5rem auto 1.8rem;
    flex-shrink: 0;
}
.zen-breath-ring {
    position: absolute; inset: 0; border-radius: 50%;
    border: 2px solid rgba(167, 139, 250, 0.5);
    box-shadow: 0 0 30px rgba(167, 139, 250, 0.25), inset 0 0 30px rgba(167, 139, 250, 0.1);
    transition: transform 3.5s ease-in-out, border-color 1s ease;
}
.zen-breath-ring.inhale { transform: scale(1.18); border-color: rgba(96, 165, 250, 0.75); }
.zen-breath-ring.hold   { transform: scale(1.18); border-color: rgba(52, 211, 153, 0.75); }
.zen-breath-ring.exhale { transform: scale(0.8);  border-color: rgba(167, 139, 250, 0.6); }
.zen-breath-pulse-glow {
    position: absolute; width: 72%; height: 72%; border-radius: 50%;
    background: radial-gradient(circle, rgba(167, 139, 250, 0.22), transparent 70%);
    pointer-events: none;
}
.zen-breath-center {
    position: relative; z-index: 2;
    display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
}
.zen-breath-seconds {
    font-size: 1.9rem; font-weight: 300; color: #fff; line-height: 1;
    font-family: 'JetBrains Mono', monospace;
}
.zen-breath-label {
    font-size: 0.82rem; color: rgba(255, 255, 255, 0.7);
    font-family: 'Pretendard', sans-serif; letter-spacing: 0.02em;
}

/* === Daily Zen: 바이오 피드백 그리드 + 카드 === */
.zen-biofeedback-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem;
    width: 100%; margin-top: 0.5rem;
}
.zen-bio-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 0.9rem 1rem;
    display: flex; flex-direction: column; gap: 0.35rem;
    text-align: left;
}
.zen-bio-header { display: flex; align-items: center; gap: 0.45rem; }
.zen-bio-dot { font-size: 0.55rem; line-height: 1; flex-shrink: 0; }
.zen-bio-dot.blinking { animation: safety-blink 1.2s infinite alternate; }
.zen-bio-title {
    font-size: 0.78rem; color: rgba(255, 255, 255, 0.85); font-weight: 500;
    font-family: 'Pretendard', sans-serif;
}
.zen-bio-value {
    font-size: 1.45rem; font-weight: 300; color: #fff; line-height: 1.1;
    margin-top: 0.1rem;
}
.zen-bio-value .unit { font-size: 0.7rem; color: rgba(255, 255, 255, 0.4); margin-left: 0.2rem; }
.zen-bio-status {
    font-size: 0.66rem; color: rgba(255, 255, 255, 0.45);
    font-family: 'Pretendard', sans-serif;
}
.zen-bio-bar-bg {
    width: 100%; height: 6px; border-radius: 3px; margin-top: 0.3rem;
    background: rgba(255, 255, 255, 0.1); overflow: hidden; overflow-x: hidden; overflow-y: hidden;
}
.zen-bio-bar-fill {
    height: 100%; border-radius: 3px;
    background: linear-gradient(90deg, #a78bfa, #60a5fa);
    transition: width 0.8s ease;
}

@keyframes safety-blink {
    from { opacity: 1; }
    to   { opacity: 0.35; }
}
@keyframes breathPulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50%      { transform: scale(1.08); opacity: 1; }
}

/* Grayscale trial limit */
.monochrome-trial {
    filter: grayscale(100%) contrast(1.15) brightness(0.8) !important;
    transition: filter 1.5s ease-in-out;
}

/* Trial status floating banner */
.trial-status-banner {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    width: 90%;
    max-width: 360px;
    background: rgba(10, 10, 18, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    padding: 1.2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(167, 139, 250, 0.15);
    backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    align-items: center;
    text-align: center;
}
.trial-status-banner.active {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}
.trial-status-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fca5a5;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.trial-status-desc {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
    word-break: keep-all;
}
.trial-action-btn {
    width: 100%;
    padding: 0.7rem;
    border-radius: 12px;
    font-size: 0.82rem;
    cursor: pointer;
    font-weight: 600;
    letter-spacing: 0.05em;
    transition: all 0.3s;
    border: none;
}
.trial-share-btn {
    background: rgba(167, 139, 250, 0.12);
    border: 1px solid rgba(167, 139, 250, 0.3);
    color: #c084fc;
}
.trial-subscribe-btn {
    background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

/* Security Screen Capture Block Overlay */
#securityBlockOverlay {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    color: #fff;
    text-align: center;
    padding: 2rem;
}
#securityBlockOverlay.active {
    opacity: 1;
    pointer-events: auto;
}
.security-alert-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 0, 0, 0.2);
    border-radius: 24px;
    padding: 2.5rem;
    max-width: 320px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(239, 68, 68, 0.1);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.security-icon {
    font-size: 2.5rem;
    margin-bottom: 1.2rem;
}
.security-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ef4444;
    margin-bottom: 0.8rem;
}
.security-desc {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
    word-break: keep-all;
}

/* Dev Premium Toggle HUD */
.dev-premium-toggle {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 10006;
    background: rgba(10, 10, 15, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 4px 10px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.68rem;
    font-family: 'JetBrains Mono', monospace;
    color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.dev-toggle-label {
    cursor: pointer;
}
.dev-toggle-checkbox {
    width: 28px;
    height: 16px;
    appearance: none;
    background: rgba(255,255,255,0.15);
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
    outline: none;
    border: 1px solid rgba(255,255,255,0.05);
}
.dev-toggle-checkbox:checked {
    background: #a78bfa;
}
.dev-toggle-checkbox::before {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    top: 1px;
    left: 1px;
    transition: transform 0.3s;
}
.dev-toggle-checkbox:checked::before {
    transform: translateX(12px);
}

/* Guest Trial Countdown HUD */
.trial-countdown-hud {
    position: absolute;
    top: 3.5rem;
    right: 1.5rem;
    z-index: 10004;
    background: rgba(167, 139, 250, 0.08);
    border: 1px solid rgba(167, 139, 250, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 5px 12px;
    border-radius: 20px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    font-weight: 500;
    color: #c084fc;
    letter-spacing: 0.05em;
    pointer-events: none;
    box-shadow: 0 4px 15px rgba(167, 139, 250, 0.1);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.trial-countdown-hud .timer-dot {
    width: 6px;
    height: 6px;
    background: #c084fc;
    border-radius: 50%;
    box-shadow: 0 0 8px #c084fc;
}

/* Visualizer exp / blur lock */
.canvas-expired {
    filter: grayscale(100%) blur(16px) brightness(0.35) !important;
    transition: filter 1.2s ease-in-out;
}

/* Custom UI Layout additions */
.home-menu-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    max-width: 300px;
}

.profile-info-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    padding: 1.5rem;
    border-radius: 16px;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    width: 100%;
}

/* Satellite SOS styles */
.quantum-toggle-btn {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.quantum-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.05);
}
.quantum-toggle-btn:active {
    transform: scale(0.98);
}
.quantum-toggle-btn.active {
    background: rgba(167, 139, 250, 0.15) !important;
    border-color: rgba(167, 139, 250, 0.4) !important;
    color: #a78bfa !important;
    box-shadow: 0 0 20px rgba(167, 139, 250, 0.2);
    font-weight: 600;
}
.trial-countdown-hud.premium {
    background: rgba(52, 199, 89, 0.08) !important;
    border: 1px solid rgba(52, 199, 89, 0.2) !important;
    color: #34c759 !important;
    box-shadow: 0 4px 15px rgba(52, 199, 89, 0.1) !important;
}
.trial-countdown-hud.premium .timer-dot {
    background: #34c759 !important;
    box-shadow: 0 0 8px #34c759 !important;
}

/* Responsive Desktop Adapters to replicate App Version on Web */
@media (min-width: 744px) {
    html {
        font-size: 17px !important; /* Rule 3-f: html { font-size: 17px } */
    }
    body, html {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        background-color: #000 !important;
        overflow: hidden !important;
    }
    
    .app-container {
        max-width: 720px !important; /* iPad 세로 */
        max-height: 100% !important;
        width: 100% !important;
        height: 100vh !important;
        margin: 0 auto !important;
        border-radius: 0 !important;
        border: none !important;
        box-shadow: none !important;
        padding: 2.5rem 2rem !important;
        background: #030305 !important;
        overflow: hidden !important;
    }

    .home-screen {
        margin-top: 2rem;
    }
    
    .home-menu-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        max-width: 580px !important;
        gap: 1.4rem !important;
        margin: 2rem auto 0 !important;
    }

    /* Onboarding: 입력 카드 max-width 560px 중앙 (Rule 3-e) */
    .step-card {
        position: absolute !important;
        left: 0 !important;
        right: 0 !important;
        margin: 0 auto !important;
        max-width: 560px !important;
        padding: 0 0.5rem !important;
    }
    .step-card.active {
        position: relative !important;
    }

    .status-console {
        max-width: 560px !important;
        margin: 0 auto !important;
    }

    .sphere-panel, .zen-overlay {
        inset: 0 !important;
        top: 0 !important;
        left: 0 !important;
        transform: none !important;
        width: 100% !important;
        height: 100% !important;
        border-radius: 0 !important;
        border: none !important;
        box-shadow: none !important;
    }

    .sphere-header {
        top: 1rem !important;
        padding: 0 1rem !important;
    }

    /* a) 소리 주파수 믹서: 스피어 width min(52vw, 560px) 중앙 (Rule 3-a) */
    .audio-sphere-container {
        width: min(52vw, 560px) !important;
        height: min(52vw, 560px) !important;
        margin: 1.5rem auto !important;
        aspect-ratio: 1 / 1 !important;
    }
    .sphere-node {
        font-size: 0.95rem !important;
    }
    .sphere-content {
        max-width: 680px !important;
        margin: calc(env(safe-area-inset-top, 0px) + 5.5rem) auto 0 auto !important;
        max-height: calc(100% - env(safe-area-inset-top, 0px) - 6.5rem) !important;
    }

    /* b) 메인 재생 화면: 비주얼·컨트롤 중앙 720px (Rule 3-b) */
    .zen-scroll-content {
        max-width: 680px !important;
        margin: 0 auto !important;
    }
    .zen-biofeedback-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.2rem !important;
    }

    /* c) 프로필·설정: 필드 max-width 640px 중앙 (Rule 3-c) */
    .profile-info-card {
        max-width: 640px !important;
        margin: 0 auto !important;
    }
    
    .sphere-panel .export-btn, 
    .sphere-panel #restartOnboardingBtn,
    .sphere-panel #copyLocationBtn,
    .sphere-panel #openShareCardBtn {
        max-width: 640px !important;
        margin-left: auto;
        margin-right: auto;
    }

    /* d) 공유 카드: 카드 높이 min(68vh, 520px) 비율 유지 축소 (Rule 3-d) */
    .share-card-preview-container {
        height: min(68vh, 520px) !important;
        width: auto !important;
        aspect-ratio: 9 / 16 !important;
        margin: 0 auto !important;
    }
    .share-modal-left {
        max-width: 600px !important;
        margin: 0 auto !important;
    }
    .share-modal-layout {
        max-width: 600px !important;
        margin: 0 auto !important;
        max-height: calc(100% - env(safe-area-inset-top, 0px) - 6rem) !important;
        overflow-y: auto !important;
    }

    #visualizerCanvas {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        z-index: 0 !important;
    }
}

@media (min-width: 1024px) {
    .app-container {
        max-width: 960px !important; /* iPad 가로·13인치 (Rule 2) */
        padding: 3rem 2.5rem !important;
    }

    /* a) 1024px 이상에서는 스피어(좌 55%) + 음량·4축 설명(우 45%) 2단 (Rule 3-a) */
    .sphere-content {
        flex-direction: row !important;
        max-width: 900px !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 2.5rem !important;
        overflow: hidden !important;
        max-height: calc(100% - env(safe-area-inset-top, 0px) - 6rem) !important;
    }
    .sphere-fixed-top {
        flex: 0 0 52% !important;
        width: 52% !important;
    }
    .sphere-scroll-bottom {
        flex: 0 0 44% !important;
        width: 44% !important;
        max-height: 90% !important;
        overflow-y: auto !important;
        padding-right: 0.5rem !important;
    }
    .audio-sphere-container {
        width: min(40vw, 440px) !important;
        height: min(40vw, 440px) !important;
    }

    /* b) 메인 재생 화면: 1024px 가로 중앙 폭 연동 */
    .zen-scroll-content {
        max-width: 760px !important;
        margin: 0 auto !important;
    }

    /* d) 공유 카드: 가로 2단 믹스 뷰 */
    .share-modal-layout {
        flex-direction: row !important;
        max-width: 900px !important;
        align-items: center !important;
        gap: 3rem !important;
        overflow: hidden !important;
    }
    .share-modal-left {
        flex: 0 0 45% !important;
        width: 45% !important;
    }
    .share-modal-layout > div:last-child {
        flex: 0 0 50% !important;
        width: 50% !important;
        max-height: 90% !important;
        overflow-y: auto !important;
    }
    .share-card-preview-container {
        height: min(65vh, 460px) !important;
    }
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.85; }
    50% { transform: scale(1.08); opacity: 1; filter: drop-shadow(0 0 10px rgba(255,255,255,0.4)); }
    100% { transform: scale(1); opacity: 0.85; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 스마트워치 관련 CSS */
.smartwatch-device-wrapper {
    position: relative;
    width: 140px;
    height: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.smartwatch-device-wrapper.square .smartwatch-body { border-radius: 28px; }
.smartwatch-device-wrapper.round .smartwatch-body { border-radius: 50%; }
.smartwatch-device-wrapper.round .smartwatch-screen { border-radius: 50%; }
.smartwatch-device-wrapper.round .smartwatch-crown { border-radius: 50%; }

.smartwatch-strap {
    width: 90%;
    height: 18px;
    background: linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 100%);
    border: 1px solid rgba(255,255,255,0.1);
}

.smartwatch-strap.top-strap {
    margin-bottom: 6px;
    border-radius: 12px 12px 4px 4px;
}

.smartwatch-strap.bottom-strap {
    margin-top: 6px;
    border-radius: 4px 4px 12px 12px;
}

.smartwatch-body {
    width: 110px;
    height: 110px;
    background: linear-gradient(135deg, #2a2a3e 0%, #1a1a2e 100%);
    border: 2px solid rgba(167, 139, 250, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.smartwatch-screen {
    width: 98px;
    height: 98px;
    background: radial-gradient(circle at 30% 30%, #0a0a0a 0%, #000000 100%);
    border: 1px solid rgba(192, 132, 252, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    overflow: hidden; overflow-x: hidden; overflow-y: hidden;
    position: relative;
}

.smartwatch-screen-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid rgba(192, 132, 252, 0.2);
    border-radius: inherit;
    animation: pulse 2s ease-in-out infinite;
    pointer-events: none;
}

.smartwatch-crown {
    position: absolute;
    right: -8px;
    width: 16px;
    height: 24px;
    background: linear-gradient(90deg, #3a3a4a 0%, #2a2a3a 100%);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 3px;
}

.passcode-container {
    display: flex;
    gap: 0.4rem;
    justify-content: center;
    margin: 1rem 0;
}

.passcode-digit-box {
    width: 40px;
    height: 48px;
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
    background: rgba(167, 139, 250, 0.05);
    border: 2px solid rgba(167, 139, 250, 0.2);
    border-radius: 8px;
    color: #c084fc;
    font-family: 'JetBrains Mono', monospace;
    outline: none;
    transition: all 0.2s;
}

.passcode-digit-box:focus {
    border-color: #c084fc;
    background: rgba(167, 139, 250, 0.1);
    box-shadow: 0 0 12px rgba(192, 132, 252, 0.3);
}

.passcode-digit-box.filled {
    border-color: #c084fc;
    background: rgba(192, 132, 252, 0.08);
}

.watch-scroll-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-height: calc(100% - env(safe-area-inset-top, 0px) - 5.5rem);
    min-height: 0;
    overflow-y: auto;
    padding-bottom: 1rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.4) transparent;
}

.watch-scroll-content::-webkit-scrollbar {
    width: 6px;
}

.watch-scroll-content::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.4);
    border-radius: 3px;
}

.watch-scroll-content::-webkit-scrollbar-track {
    background: transparent;
}

/* 소셜 공유 카드 모달 레이아웃 (카드 덱 표시) */
.share-modal-layout {
    max-height: none !important; /* sphere-content 높이 제한 해제 */
    display: flex !important;
    flex-direction: column !important;
    gap: 1.5rem !important;
}

.share-modal-left {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.share-modal-right {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    max-height: 400px;
    padding-bottom: 1rem;
}

.ecg-wave-container {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 0.8rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.ecg-wave-canvas {
    width: 100%;
    height: 60px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    display: block;
}

.ecg-status-text {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.watch-face-modes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
}

@media (min-width: 1024px) {
    html {
        font-size: 19px !important; /* 대형 아이패드용 최적 폰트 크기 조율 */
    }
}
