/* ===========================================
   CSS Variables & Design System
   =========================================== */
:root {
    /* Primary Colors - 더 깊은 먹색 계열 */
    --color-primary: #8b7ff5;
    --color-primary-dark: #7c3aed;
    --color-primary-light: #a78bfa;
    --color-primary-50: #f3f0ff;
    --color-primary-100: #e9e5ff;
    
    /* Background Colors - 깊은 먹색 그라데이션 */
    --color-background-light: #f8fafc;
    --color-background-dark: #0f1419;
    --color-background-secondary: #1a1f3a;
    --color-background-tertiary: #2d1b4e;
    
    /* Text Colors */
    --color-text-light: #1e293b;
    --color-text-dark: #f8fafc;
    --color-text-muted-light: #64748b;
    --color-text-muted-dark: #94a3b8;
    --color-text-secondary: #cbd5e1;
    
    /* Border Colors */
    --color-border-light: #e2e8f0;
    --color-border-dark: #2d1b4e;
    --color-border-primary: rgba(139, 127, 245, 0.2);
    
    /* Card Colors */
    --color-card-light: #ffffff;
    --color-card-dark: rgba(255, 255, 255, 0.08);
    --color-card-hover: rgba(255, 255, 255, 0.12);
    
    /* Accent Colors - 전통적 색상 */
    --color-gold: #f5c842;
    --color-jade: #7dd3c0;
    --color-purple: #8b7ff5;
    --color-coral: #ff6b6b;
    
    /* 오행(五行) 색상 - 명리학 전통 색상 */
    --color-wood: #4ade80;      /* 木 (나무) - 녹색 */
    --color-fire: #f87171;      /* 火 (불) - 빨간색/주황 */
    --color-earth: #fbbf24;    /* 土 (흙) - 노란색/황토 */
    --color-metal: #e4e4e7;    /* 金 (금속) - 은색/금색 */
    --color-water: #60a5fa;    /* 水 (물) - 파란색 */
    
    /* 오행 색상 투명도 버전 */
    --color-wood-light: rgba(74, 222, 128, 0.2);
    --color-fire-light: rgba(248, 113, 113, 0.2);
    --color-earth-light: rgba(251, 191, 36, 0.2);
    --color-metal-light: rgba(228, 228, 231, 0.2);
    --color-water-light: rgba(96, 165, 250, 0.2);
    
    /* Status Colors */
    --color-success: #7dd3c0;
    --color-warning: #f5c842;
    --color-error: #ff6b6b;
    --color-info: #8b7ff5;
    
    /* Additional Colors */
    --color-secondary: #6b7280;
    --color-secondary-dark: #4b5563;
    --color-danger: #dc2626;
    --color-danger-dark: #b91c1c;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Typography System - 시스템 폰트 스택 */
    --font-heading: 'Times New Roman', 'Times', serif;
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    --font-accent: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    
    /* Font Sizes - Mobile */
    --text-h1-mobile: 2rem;      /* 32px */
    --text-h2-mobile: 1.5rem;     /* 24px */
    --text-h3-mobile: 1.25rem;    /* 20px */
    --text-body-mobile: 1rem;     /* 16px */
    --text-caption-mobile: 0.875rem; /* 14px */
    
    /* Font Sizes - Desktop */
    --text-h1-desktop: 3rem;      /* 48px */
    --text-h2-desktop: 2rem;      /* 32px */
    --text-h3-desktop: 1.5rem;    /* 24px */
    --text-body-desktop: 1.125rem; /* 18px */
    --text-caption-desktop: 0.9375rem; /* 15px */

    /* Parallax Variables */
    --scroll-speed: 0px;
    --constellation-speed: 0px;
    --watermark-speed: 0px;
    --cloud-float: 0px;
    --dragon-float: 0px;
    --constellation-density: 200px 100px;
    --watermark-opacity: 0.05;
}

/* ===========================================
   Base Styles & Reset
   =========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background: linear-gradient(135deg, var(--color-background-dark) 0%, var(--color-background-secondary) 50%, var(--color-background-tertiary) 100%);
    color: var(--color-text-dark);
    min-height: 100vh;
    overscroll-behavior-y: none;
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    overflow-x: hidden;
}

.parallax-container {
    position: relative;
    overflow-x: hidden;
}

.parallax-container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('/img/bg-pattern.png') repeat;
    background-size: 100px;
    opacity: 0.1;
    z-index: -2;
    pointer-events: none;
    transform: translateY(var(--scroll-speed));
    transition: transform 0.1s linear;
}

.parallax-container::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('/img/constellation-pattern.png') repeat;
    background-size: var(--constellation-density);
    opacity: 0.05;
    z-index: -1;
    pointer-events: none;
    transform: translateY(var(--constellation-speed));
    transition: transform 0.1s linear;
}

/* .watermark-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('/img/watermark.png') no-repeat center center;
    background-size: contain;
    opacity: var(--watermark-opacity);
    z-index: -1;
    pointer-events: none;
    transform: translateY(var(--watermark-speed));
    transition: transform 0.1s linear;
} */

/* ===========================================
   Layout & Structure
   =========================================== */
#app {
    max-width: 32rem;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    position: sticky;
    top: 0;
    background: linear-gradient(135deg, rgba(15, 20, 25, 0.95), rgba(45, 27, 78, 0.9));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 10;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-sm);
    min-height: 3.5rem;
    position: relative; /* user-info가 제대로 표시되도록 추가 */
}

.header-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text-dark);
    white-space: nowrap;
    max-width: calc(100% - 8rem);
    overflow: hidden;
    text-overflow: ellipsis;
}

.back-button {
    width: 2.75rem; /* 44px 확보 (2.75rem = 44px) */
    height: 2.75rem; /* 44px 확보 */
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--color-text-dark);
    cursor: pointer;
    flex-shrink: 0;
    /* 모바일 터치 최적화 */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.back-button svg {
    width: 1.5rem;
    height: 1.5rem;
}

main {
    flex: 1;
    padding: 1rem 1rem 5rem 1rem;
    overflow-y: auto;
    position: relative;
    z-index: 10;
}

.page {
    display: none;
    animation: fadeIn 0.4s ease-in-out;
}

.page.active {
    display: block;
}

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

/* ===========================================
   Typography & Text Styles
   =========================================== */
.mystic-text {
    font-family: var(--font-heading);
    font-weight: 600;
    color: white;
    text-shadow: 0 0 20px rgba(139, 127, 245, 0.3);
}

.mystic-text-gold {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--color-gold);
    text-shadow: 0 0 15px rgba(245, 200, 66, 0.4);
}

.text-accent {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 300;
    line-height: 1.6;
}

.section-title { 
    font-size: 1.75rem; 
    font-weight: 700; 
    margin-bottom: 1.25rem; 
    line-height: 1.3; 
}
