
        :root {
            --primary: #f59e0b;
            --primary-dark: #d97706;
            --bg-gradient: linear-gradient(90deg, #a6ddff 0%, #4c8fff 100%);
            --card-bg: #ffffff;
            --text-main: #1e293b;
            --text-muted: #64748b;
            --accent-red: #ef4444;
            --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            -webkit-tap-highlight-color: transparent;
        }header {
            text-align: center;
            padding: 20px 0;
            color: white;
            position: relative;
        }

        .header-content {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 5px;
        }

        .menu-btn {
            background: none;
            border: none;
            color: white;
            font-size: 2.2rem;
            cursor: pointer;
            line-height: 1;
            transition: transform 0.2s;
        }

        .menu-btn:hover {
            transform: scale(1.1);
        }

        /* Side Menu */
        .side-menu {
            position: fixed;
            top: 0;
            right: -280px;
            width: 280px;
            height: 100%;
            background: white;
            box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
            z-index: 2000;
            transition: right 0.3s ease-out;
            padding: 20px;
            color: #0f172a;
            text-align: left;
        }

        .side-menu.active {
            right: 0;
        }

        .menu-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid #e2e8f0;
            padding-bottom: 15px;
            margin-bottom: 20px;
        }

        .menu-header h2 {
            font-size: 1.5rem;
            font-weight: 800;
        }

        .close-btn {
            background: none;
            border: none;
            font-size: 2rem;
            cursor: pointer;
            color: #64748b;
        }

        .menu-nav ul {
            list-style: none;
        }

        .menu-nav li {
            margin-bottom: 10px;
        }

        .menu-nav a {
            text-decoration: none;
            color: #0f172a;
            font-size: 1.1rem;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px;
            border-radius: 12px;
            transition: all 0.2s;
        }

        .menu-nav a:hover {
            background: #f1f5f9;
            transform: translateX(5px);
        }

        .menu-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.6);
            z-index: 1000;
            display: none;
            backdrop-filter: blur(4px);
        }

        .menu-overlay.active {
            display: block;
        }

        /* Card Styles */
        .card {
            background: rgba(255, 255, 255, 0.95);
            border-radius: 20px;
            padding: 24px;
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
            margin-bottom: 24px;
            transition: transform 0.2s ease;
        }

        .card:hover {
            transform: translateY(-2px);
        }

        /* Quote Box Style Override */
        /* Quote Box Style Override */
        .quote-box {
            text-align: center;
            margin: 0;
            padding: 10px;
            border-bottom: none;
        }

        .quote-box p {
            font-family: 'Nanum Myeongjo', 'Noto Serif KR', serif;
            font-size: 18px color: #451d19;
            /* Dark brown for grandfather clock vibe */
            line-height: 1.4;
            margin-bottom: 8px;
            /* font-style: italic; */
            font-weight: 700;
            word-break: keep-all;
        }

        .quote-box span {
            display: block;
            font-size: 0.9rem;
            color: #8d6e63;
            font-weight: 400;
        }

        .logo {
            font-size: 2rem;
            font-weight: 800;
            letter-spacing: -1px;
            margin-bottom: 4px;
        }

        .logo span {
            color: var(--primary);
        }

        .tagline {
            font-size: 0.85rem;
            opacity: 0.8;
            font-weight: 300;
            text-align: left;
            width: 100%;
            padding: 0 5px;
        }

        .card {
            background: var(--card-bg);
            border-radius: 32px;
            padding: 20px;
            box-shadow: var(--shadow);
        }

        /* Input Section */
        .setup-section {
            display: grid;
            grid-template-columns: 1fr;
            gap: 20px;
            margin-bottom: 30px;
        }

        .input-group {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .input-group label {
            font-size: 0.85rem;
            font-weight: 600;
            color: var(--text-muted);
            padding-left: 4px;
        }

        .birth-input-wrapper {
            position: relative;
            display: flex;
            align-items: center;
        }

        #birth-date {
            width: 100%;
            padding: 12px 45px 12px 16px;
            border-radius: 12px;
            border: 2px solid #e2e8f0;
            font-family: inherit;
            font-size: 1rem;
            outline: none;
            transition: border-color 0.2s;
        }

        #birth-date:focus {
            border-color: var(--primary);
        }

        .calendar-btn {
            position: absolute;
            right: 12px;
            font-size: 1.2rem;
            cursor: pointer;
            pointer-events: none;
        }

        .hidden-picker {
            position: absolute;
            right: 10px;
            width: 30px;
            height: 30px;
            opacity: 0;
            cursor: pointer;
        }

        /* Gender Toggle */
        .gender-toggle {
            display: flex;
            background: #f1f5f9;
            padding: 4px;
            border-radius: 12px;
        }

        .gender-toggle input {
            display: none;
        }

        .gender-toggle label {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            text-align: center;
            padding: 10px;
            cursor: pointer;
            border-radius: 8px;
            font-weight: 600;
            transition: all 0.2s;
            margin: 0;
            line-height: 1;
        }

        .gender-toggle input:checked+label {
            background: white;
            color: var(--primary-dark);
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
        }

        /* Clock Display */
        .clock-display {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 24px;
        }

        /* Sprite-based Grandfather Clock Styling */
        .grandfather-clock {
            width: 100%;
            max-width: 400px;
            margin: 0 auto;
            display: flex;
            flex-direction: column;
            align-items: center;
            position: relative;
            margin-top: -20px;
            margin-bottom: 40px;
        }

        .clock-box {
            width: 100%;
            display: flex;
            justify-content: center;
        }

        /* Mobile Scale Adjustment */
        @media (max-width: 450px) {
            .sprite-clock {
                transform: scale(0.85);
                margin-top: -20px;
                /* Adjusted from -50px */
                /* Pull up to reduce gap */
                margin-bottom: -100px;
            }
        }

        /* V2 Image-based Grandfather Clock */
        .sprite-clock {
            position: relative;
            width: 340px;
            aspect-ratio: 539 / 1151;
            height: auto;
            margin: 30px auto 0;
            /* Added 30px top margin */
            /* Scale down slightly for mobile if needed, but width 380 is fine for most */
            filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.5));
        }

        /* 1. Body: Full clock image */
        .clock-body {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            display: block;
            object-fit: contain;
            z-index: 10;
        }

        /* 2. Container for Hands */
        .clock-hands-container {
            position: absolute;
            /* Visual Tweak: top aligned to face center */
            top: 11%;
            left: 50%;
            transform: translateX(-50%);
            width: 63.2%;
            aspect-ratio: 1 / 1;
            height: auto;
            z-index: 30;
            /* Increased to be safely above body */
            pointer-events: none;
        }

        .center-pin {
            position: absolute;
            top: 50%;
            left: 50%;
            width: 12px;
            height: 12px;
            background: #FFD700;
            border-radius: 50%;
            transform: translate(-50%, -50%);
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
            z-index: 40;
        }

        .hand-hour {
            position: absolute;
            bottom: 50%;
            left: 50%;
            width: 10px;
            height: 50px;
            background: #1e293b;
            /* Navy */
            border-radius: 5px;
            transform-origin: bottom center;
            transform: translateX(-50%) rotate(0deg);
            box-shadow: 0 4px 4px rgba(0, 0, 0, 0.2);
            z-index: 31;
        }

        .hand-minute {
            position: absolute;
            bottom: 50%;
            left: 50%;
            width: 6px;
            height: 78px;
            background: #d4af37;
            /* Gold */
            border-radius: 3px;
            transform-origin: bottom center;
            transform: translateX(-50%) rotate(0deg);
            box-shadow: 0 4px 4px rgba(0, 0, 0, 0.2);
            z-index: 32;
        }


        /* 3. Pendulum: Using the new full pendulum image */
        .pendulum-container {
            position: absolute;
            top: 42.5%;
            left: 50%;
            width: 31.6%;
            /* Slight wider to fit full bob swing */
            height: 38.9%;
            z-index: 15;
            /* Above body(10) but below hands(30) */
            transform-origin: top center;
            animation: swing 2s infinite ease-in-out;
            transform: translateX(-50%);
        }

        @keyframes swing {
            0% {
                transform: translateX(-50%) rotate(4deg);
            }

            50% {
                transform: translateX(-50%) rotate(-4deg);
            }

            100% {
                transform: translateX(-50%) rotate(4deg);
            }
        }

        .pendulum-bob {
            width: 100%;
            height: 100%;
            background-image: url('/img/clock_pendulum_v2.png');
            background-size: contain;
            background-position: center top;
            background-repeat: no-repeat;
        }

        /* Old stuff hidden */
        .clock-face {
            display: none;
        }


        /* 4. Hands: CSS Designed */

        /* 5. Age Display Overlay */
        /* 5. Age Display Overlay */
        .age-display-overlay {
            position: absolute;
            top: 24%;
            left: 50%;
            transform: translate(-50%, -50%);
            text-align: center;
            z-index: 25;
            pointer-events: none;
        }

        #center-age-text {
            font-family: 'Outfit', sans-serif;
            font-weight: 800;
            font-size: 42px;
            text-shadow: 0 2px 0 rgba(255, 255, 255, 0.8);

            color: #0f172a;
            line-height: 1;
        }

        /* 5. Clock Markers (JS Generated) */
        .clock-marker {
            position: absolute;
            font-family: 'Outfit', sans-serif;
            font-weight: 700;
            font-size: 14px;
            color: #64748b;
            text-align: center;
            width: 30px;
            height: 20px;
            line-height: 20px;
            margin-left: -15px;
            /* Center horizontally */
            margin-top: -10px;
            /* Center vertically */
            z-index: 24;
            /* Below hands */
            pointer-events: none;
        }

        .age-unit {
            font-family: 'Noto Sans KR', sans-serif;
            font-size: 18px;
            color: #64748b;
        }

        /* Hide SVG and Old Canvas */
        #lifeClockSvg,
        canvas.lifeClock {
            display: none;
        }


        #lifeClock {
            width: 100%;
            height: 100%;
        }

        .clock-center-info {
            display: none;
        }

        .time-readout {
            text-align: center;
        }

        .time-readout p {
            font-size: 1rem;
        }

        .time-scales {
            margin-top: 10px;
            display: grid;
            gap: 6px;
            color: var(--text-muted);
            font-size: 0.9rem;
        }

        .time-scales p {
            margin: 0;
        }

        .scale-label {
            display: block;
            font-size: 0.85rem;
            color: var(--text-muted);
        }

        .scale-numline {
            display: block;
            font-size: 1.25rem;
            color: var(--text-main);
        }

        .scale-num {
            font-weight: 700;
            color: var(--text-main);
            font-variant-numeric: tabular-nums;
        }

        .digital-time {
            font-size: 2rem;
            font-weight: 700;
            color: var(--accent-red);
            font-variant-numeric: tabular-nums;
            margin-bottom: 8px;
        }

        .ms {
            font-size: 1.2rem;
            opacity: 0.6;
            margin-left: 2px;
        }

        #life-message {
            font-size: 0.9rem;
            color: var(--text-muted);
            font-weight: 400;
        }

        .divider {
            height: 1px;
            background: #f1f5f9;
            margin: 30px 0;
        }

        /* Stats */
        .stats-section {
            display: flex;
            justify-content: space-around;
            gap: 20px;
        }

        .stat-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
        }

        .stat-item .label {
            font-size: 0.8rem;
            color: var(--text-muted);
            font-weight: 600;
        }

        .stat-item .value {
            font-size: 1.25rem;
            font-weight: 700;
            color: var(--text-main);
        }

        /* Quote Section */
        .quote-section {
            text-align: center;
            padding: 10px 20px 20px;
            min-height: 100px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            gap: 8px;
        }

        #quote-text {
            font-family: 'Nanum Myeongjo', 'Noto Serif KR', serif;
            font-size: 1.85em;
            font-style: normal;
            color: #451d19;
            line-height: 1.4;
            transition: opacity 0.5s ease;
            word-break: keep-all;
        }

        #quote-author {
            font-size: 0.8rem;
            color: var(--text-muted);
            font-weight: 600;
            transition: opacity 0.5s ease;
        }

        /* Share Section */
        .share-section {
            display: flex;
            justify-content: center;
            gap: 15px;
            margin: 0px 0 0px;
        }

        .action-btn {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 10px 16px;
            background: rgba(255, 255, 255, 0.9);
            border: none;
            border-radius: 50px;
            font-size: 0.85rem;
            font-weight: 600;
            color: #333;
            cursor: pointer;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
            transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
        }

        .action-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
            background: #ffffff;
        }

        .action-btn:active {
            transform: translateY(0);
        }

        .action-btn span {
            font-size: 1.2rem;
        }

        /* Animations */
        @keyframes pulse {
            0% {
                transform: scale(1);
            }

            50% {
                transform: scale(1.02);
            }

            100% {
                transform: scale(1);
            }
        }

        .digital-time {
            animation: fadeIn 0.5s ease-out;
        }

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

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /* Responsive adjustments */
        @media (max-width: 400px) {
            .card {
                padding: 20px;
            }

            .logo {
                font-size: 2rem;
            }

            .digital-time {
                font-size: 2rem;
            }
        }


       
    
