﻿/* ============================================================
               CSS Variables ?Dark Neon Theme
               ============================================================ */
        :root {
            --bg-dark: #0a0a0f;
            --bg-card: rgba(18, 18, 26, 0.85);
            --bg-elevated: rgba(26, 26, 37, 0.9);
            --bg-glass: rgba(18, 18, 26, 0.6);
            --bg-image: url('https://images.unsplash.com/photo-1502003148287-a82ef80a6abc?w=1920&q=80&auto=format');
            --primary: #00f5d4;
            --primary-glow: rgba(0, 245, 212, 0.35);
            --primary-dim: rgba(0, 245, 212, 0.12);
            --secondary: #ff006e;
            --secondary-glow: rgba(255, 0, 110, 0.35);
            --secondary-dim: rgba(255, 0, 110, 0.12);
            --accent: #fee800;
            --accent-glow: rgba(254, 232, 0, 0.35);
            --accent-dim: rgba(254, 232, 0, 0.12);
            --text-primary: #ffffff;
            --text-secondary: #a0a0b0;
            --text-muted: #606070;
            --border-glow: rgba(255, 255, 255, 0.06);
            --shadow-neon: 0 0 20px rgba(0, 245, 212, 0.15);
            --radius-sm: 10px;
            --radius-md: 16px;
            --radius-lg: 24px;
            --radius-xl: 32px;
            --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            --transition-bounce: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
        }

        /* ============================================================
               Light Theme
               ============================================================ */
        [data-theme="light"] {
            --bg-dark: #f8f9fa;
            --bg-card: #ffffff;
            --bg-elevated: #f1f3f4;
            --bg-glass: rgba(255, 255, 255, 0.85);
            --bg-image: url('https://images.unsplash.com/photo-1760891494704-bd9fabef4757?w=1920&q=80&auto=format');
            --primary: #00b4d8;
            --primary-glow: rgba(0, 180, 216, 0.25);
            --primary-dim: rgba(0, 180, 216, 0.1);
            --secondary: #ff6b6b;
            --secondary-glow: rgba(255, 107, 107, 0.25);
            --secondary-dim: rgba(255, 107, 107, 0.1);
            --accent: #ffd166;
            --accent-glow: rgba(255, 209, 102, 0.25);
            --accent-dim: rgba(255, 209, 102, 0.1);
            --text-primary: #2d3436;
            --text-secondary: #636e72;
            --text-muted: #b2bec3;
            --border: #dfe6e9;
            --border-glow: rgba(0, 0, 0, 0.06);
            --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
            --shadow-neon: 0 4px 20px rgba(0, 180, 216, 0.15);
        }
        [data-theme="light"] body::before {
            background:
                /* Warm ambient glow */
                radial-gradient(ellipse 80% 60% at 20% 20%, rgba(255, 200, 100, 0.07) 0%, transparent 60%),
                radial-gradient(ellipse 60% 50% at 80% 80%, rgba(255, 150, 150, 0.05) 0%, transparent 50%),
                radial-gradient(ellipse 50% 40% at 50% 50%, rgba(255, 100, 100, 0.03) 0%, transparent 40%),
                /* Light vignette — keeps text readable over bright sunrise image */
                linear-gradient(to bottom, rgba(255,255,255,0.25) 0%, transparent 20%, transparent 75%, rgba(255,255,255,0.35) 100%);
        }
        [data-theme="light"] body::after {
            background-image:
                linear-gradient(rgba(0,0,0,0.03) 1px, transparent 1px),
                linear-gradient(90deg, rgba(0,0,0,0.03) 1px, transparent 1px);
        }
        [data-theme="light"] .header {
            box-shadow: var(--shadow);
        }
        [data-theme="light"] .section {
            box-shadow: var(--shadow);
            border-color: var(--border);
        }
        [data-theme="light"] .modal {
            box-shadow: var(--shadow);
        }
        [data-theme="light"] .focus-btn.primary {
            color: #fff;
        }
        [data-theme="light"] .btn-complete {
            color: #fff;
        }
        [data-theme="light"] .btn-primary {
            color: #fff;
        }

        /* ============================================================
               Theme Transition
               ============================================================ */
        *, *::before, *::after {
            transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
        }

        /* ============================================================
               Reset & Base
               ============================================================ */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            -webkit-tap-highlight-color: transparent;
        }

        body {
            font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
            background-color: var(--bg-dark);
            background-image: var(--bg-image);
            background-size: cover;
            background-position: center;
            background-attachment: fixed;
            background-repeat: no-repeat;
            color: var(--text-primary);
            line-height: 1.6;
            min-height: 100vh;
            overflow-x: hidden;
            position: relative;
        }

        /* Dynamic gradient overlay on background image */
        body::before {
            content: '';
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background:
                /* Colored glow spots (ambient) */
                radial-gradient(ellipse 80% 60% at 20% 20%, rgba(0, 245, 212, 0.06) 0%, transparent 60%),
                radial-gradient(ellipse 60% 50% at 80% 80%, rgba(255, 0, 110, 0.04) 0%, transparent 50%),
                radial-gradient(ellipse 50% 40% at 50% 50%, rgba(254, 232, 0, 0.03) 0%, transparent 40%),
                /* Dark vignette — ensures text readability over bright parts of background image */
                linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, transparent 25%, transparent 70%, rgba(0,0,0,0.55) 100%);
            z-index: -2;
            pointer-events: none;
        }

        /* Grid pattern overlay */
        body::after {
            content: '';
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background-image:
                linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
                linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
            background-size: 40px 40px;
            z-index: -1;
            pointer-events: none;
        }

        /* ============================================================
               Scrollbar
               ============================================================ */
        ::-webkit-scrollbar {
            width: 4px;
        }
        ::-webkit-scrollbar-track {
            background: transparent;
        }
        ::-webkit-scrollbar-thumb {
            background: var(--text-muted);
            border-radius: 4px;
        }

        /* ============================================================
               Toast
               ============================================================ */
        .toast {
            position: fixed;
            top: 20px;
            left: 50%;
            transform: translateX(-50%) translateY(-120px);
            background: var(--bg-elevated);
            backdrop-filter: blur(20px);
            border: 1px solid var(--border-glow);
            color: var(--text-primary);
            padding: 14px 28px;
            border-radius: var(--radius-xl);
            font-size: 14px;
            font-weight: 500;
            z-index: 10000;
            opacity: 0;
            transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
            box-shadow: var(--shadow-neon);
            display: flex;
            align-items: center;
            gap: 10px;
            pointer-events: none;
        }

        .toast.show {
            transform: translateX(-50%) translateY(0);
            opacity: 1;
            pointer-events: auto;
        }

        .toast.error {
            border-color: var(--secondary-glow);
            box-shadow: 0 0 20px var(--secondary-glow);
        }
        .toast.success {
            border-color: var(--primary-glow);
            box-shadow: 0 0 20px var(--primary-glow);
        }
        .toast i {
            font-size: 18px;
        }

        /* Undo toast bottom bar style */
        .toast-undo {
            position: fixed;
            bottom: max(24px, env(safe-area-inset-bottom, 0px) + 8px);
            left: 50%;
            transform: translateX(-50%) translateY(120px);
            background: var(--bg-elevated);
            backdrop-filter: blur(24px);
            border: 1px solid var(--border-glow);
            border-radius: var(--radius-md);
            padding: 14px 20px;
            z-index: 10000;
            opacity: 0;
            transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
            box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
            display: flex;
            align-items: center;
            gap: 16px;
            pointer-events: none;
            min-width: 280px;
            max-width: 90vw;
        }
        .toast-undo.show {
            transform: translateX(-50%) translateY(0);
            opacity: 1;
            pointer-events: auto;
        }
        .toast-undo-text {
            flex: 1;
            font-size: 14px;
            color: var(--text-secondary);
        }
        .toast-undo-text strong {
            color: var(--text-primary);
        }
        .toast-undo-btn {
            background: transparent;
            border: 1px solid var(--primary);
            color: var(--primary);
            padding: 6px 16px;
            border-radius: var(--radius-sm);
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            transition: var(--transition);
            font-family: inherit;
        }
        .toast-undo-btn:hover {
            background: var(--primary-dim);
            box-shadow: 0 0 16px var(--primary-glow);
        }
        .toast-undo-dismiss {
            background: none;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            font-size: 16px;
            padding: 4px;
            transition: var(--transition);
        }
        .toast-undo-dismiss:hover {
            color: var(--text-primary);
        }

        /* ============================================================
               Skeleton Loading
               ============================================================ */
        .skeleton-overlay {
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: var(--bg-dark);
            z-index: 9999;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            transition: opacity 0.5s ease, visibility 0.5s ease;
        }
        .skeleton-overlay.hidden {
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
        }

        .skeleton-loader {
            width: 48px;
            height: 48px;
            border: 3px solid var(--border-glow);
            border-top-color: var(--primary);
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
            box-shadow: 0 0 30px var(--primary-glow);
            margin-bottom: 20px;
        }
        @keyframes spin { to { transform: rotate(360deg); } }

        .skeleton-text {
            color: var(--text-muted);
            font-size: 14px;
            animation: pulseText 1.5s ease-in-out infinite;
        }
        @keyframes pulseText {
            0%, 100% { opacity: 0.4; }
            50% { opacity: 1; }
        }

        .skeleton-cards {
            padding: 0 20px;
            max-width: 480px;
            margin: 0 auto;
            width: 100%;
        }
        .skeleton-card {
            background: var(--bg-glass);
            border-radius: var(--radius-md);
            height: 80px;
            margin-bottom: 12px;
            position: relative;
            overflow: hidden;
        }
        .skeleton-card::after {
            content: '';
            position: absolute;
            top: 0; left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent);
            animation: shimmer 1.5s infinite;
        }
        @keyframes shimmer {
            100% { left: 100%; }
        }

        /* ============================================================
               Container
               ============================================================ */
        .container {
            max-width: 480px;
            margin: 0 auto;
            padding: 0 16px;
        }
        @media (min-width: 768px) {
            .container {
                max-width: 600px;
                padding: 0 24px;
            }
        }

        /* ============================================================
               Header
               ============================================================ */
        .header {
            background: var(--bg-glass);
            backdrop-filter: blur(24px);
            -webkit-backdrop-filter: blur(24px);
            border: 1px solid var(--border-glow);
            border-top: none;
            border-radius: 0 0 var(--radius-xl) var(--radius-xl);
            padding: 24px 16px 28px;
            margin: 0 auto 20px;
            max-width: 480px;
            position: relative;
            overflow: hidden;
            box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
        }

        .header::before {
            content: '';
            position: absolute;
            top: -60%;
            right: -10%;
            width: 250px;
            height: 250px;
            background: radial-gradient(circle, var(--primary-dim) 0%, transparent 70%);
            pointer-events: none;
        }

        .header-top {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 16px;
            position: relative;
            z-index: 1;
        }

        .header-title {
            font-size: 18px;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 10px;
            background: linear-gradient(135deg, var(--primary), var(--secondary));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }
        .header-title i {
            -webkit-text-fill-color: var(--primary);
            font-size: 22px;
        }
        .header-tagline {
            font-size: 11px; font-weight: 400; opacity: 0.6;
            -webkit-text-fill-color: var(--text-secondary);
            display: none;
        }
        @media (min-width: 480px) { .header-tagline { display: inline; } }

        .header-actions {
            display: flex;
            gap: 8px;
        }
        .header-btn {
            width: 44px;
            height: 44px;
            border-radius: 50%;
            border: 1px solid var(--border-glow);
            background: var(--bg-glass);
            color: var(--text-secondary);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: var(--transition);
            font-size: 14px;
            backdrop-filter: blur(8px);
        }
        .header-btn:hover {
            border-color: var(--primary-glow);
            color: var(--primary);
            box-shadow: 0 0 16px var(--primary-glow);
        }

        /* Streak indicator */
        .streak-badge {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            background: var(--accent-dim);
            border: 1px solid var(--accent-glow);
            padding: 4px 12px;
            border-radius: var(--radius-xl);
            font-size: 13px;
            font-weight: 600;
            color: var(--accent);
            margin-left: 8px;
            animation: streakPulse 2s ease-in-out infinite;
        }
        .streak-badge i {
            font-size: 14px;
        }
        @keyframes streakPulse {
            0%, 100% { box-shadow: 0 0 4px var(--accent-glow); }
            50% { box-shadow: 0 0 16px var(--accent-glow); }
        }

        /* ============================================================
               Shell Counter
               ============================================================ */
        .shell-counter {
            text-align: center;
            margin-bottom: 20px;
            position: relative;
            z-index: 1;
        }

        .shell-icon-large {
            font-size: 40px;
            color: var(--primary);
            margin-bottom: 4px;
            display: inline-block;
            filter: drop-shadow(0 0 12px var(--primary-glow));
            animation: float 3s ease-in-out infinite;
        }
        @keyframes float {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-6px); }
        }

        .shell-count-wrapper {
            position: relative;
            display: inline-block;
        }

        .shell-count {
            font-family: 'Orbitron', monospace;
            font-size: 56px;
            font-weight: 900;
            background: linear-gradient(180deg, var(--text-primary) 30%, var(--primary));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            line-height: 1;
            position: relative;
            transition: transform 0.15s ease;
        }
        .shell-count.pop {
            animation: popCount 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
        }

        /* Shell fund 鈥?motivational money display */
        .shell-fund {
            font-size: 12px;
            color: var(--accent);
            margin-top: 2px;
            font-weight: 600;
            letter-spacing: 0.5px;
            opacity: 0.9;
            transition: var(--transition);
            min-height: 18px;
        }
        .shell-fund:hover {
            opacity: 1;
            text-shadow: 0 0 8px var(--accent-glow);
        }
        @keyframes popCount {
            0% { transform: scale(1); }
            50% { transform: scale(1.3); filter: brightness(1.5); }
            100% { transform: scale(1); }
        }

        /* Rolling number animation */
        .shell-count-rolling {
            display: inline-block;
            position: relative;
            overflow: hidden;
            height: 56px;
            line-height: 56px;
        }
        .shell-count-rolling span {
            display: block;
            transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
        }

        .shell-label {
            font-size: 13px;
            color: var(--text-muted);
            margin-top: 2px;
            letter-spacing: 2px;
            text-transform: uppercase;
        }

        /* ============================================================
               Progress Bar
               ============================================================ */
        .milestone-progress {
            background: var(--bg-glass);
            border: 1px solid var(--border-glow);
            border-radius: var(--radius-md);
            padding: 14px 16px;
            position: relative;
            z-index: 1;
            backdrop-filter: blur(8px);
        }

        .milestone-info {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 8px;
            font-size: 12px;
            color: var(--text-secondary);
        }

        .milestone-name {
            font-weight: 500;
            color: var(--text-primary);
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .milestone-name i {
            color: var(--secondary);
            font-size: 14px;
        }

        .milestone-remaining {
            font-size: 11px;
            color: var(--text-muted);
        }

        .progress-bar-bg {
            height: 8px;
            background: rgba(255, 255, 255, 0.06);
            border-radius: var(--radius-xl);
            overflow: hidden;
            position: relative;
        }

        .progress-bar-fill {
            height: 100%;
            border-radius: var(--radius-xl);
            background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
            background-size: 200% 100%;
            animation: flowGradient 3s linear infinite;
            transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
            position: relative;
            box-shadow: 0 0 12px var(--primary-glow);
        }

        .progress-bar-fill::after {
            content: '';
            position: absolute;
            top: 0; left: 0; right: 0; bottom: 0;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
            animation: shimmerSweep 2s ease-in-out infinite;
        }
        @keyframes shimmerSweep {
            0% { transform: translateX(-100%); }
            100% { transform: translateX(100%); }
        }

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

        /* ============================================================
               Companion System Styles
               ============================================================ */
        .companion-badge {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            background: var(--bg-glass);
            border: 1px solid var(--border-glow);
            padding: 4px 12px;
            border-radius: var(--radius-xl);
            font-size: 13px;
            font-weight: 600;
            color: var(--text-primary);
            margin-top: 4px;
            cursor: pointer;
            transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
        }
        .companion-badge:hover {
            border-color: var(--accent);
            box-shadow: 0 0 12px var(--accent-glow);
        }
        .companion-mini-emoji {
            font-size: 18px;
            line-height: 1;
        }
        .companion-mini-name {
            font-size: 12px;
            color: var(--text-secondary);
        }

        /* 伙伴对话气泡 — 从伙伴头像位置弹出 */
        .companion-badge {
            position: relative;
        }
        .companion-bubble {
            position: absolute;
            top: calc(100% + 8px);
            left: 50%;
            transform: translateX(-50%) translateY(4px) scale(0.95);
            max-width: 220px;
            width: max-content;
            min-width: 120px;
            background: var(--bg-card);
            border: 1px solid var(--border-glow, var(--border));
            border-radius: 14px;
            padding: 8px 12px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.12);
            display: flex;
            align-items: flex-start;
            gap: 6px;
            z-index: 999;
            opacity: 0;
            pointer-events: none;
            transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
        }
        .companion-bubble.show {
            opacity: 1;
            transform: translateX(-50%) translateY(0) scale(1);
            pointer-events: auto;
        }
        .companion-bubble.hiding {
            opacity: 0;
            transform: translateX(-50%) translateY(-6px) scale(0.95);
        }
        .companion-bubble:active {
            transform: translateX(-50%) scale(0.96);
        }
        .bubble-emoji {
            font-size: 18px;
            line-height: 1.4;
            flex-shrink: 0;
        }
        .bubble-text {
            font-size: 12px;
            line-height: 1.4;
            color: var(--text-primary);
            word-break: break-word;
        }
        /* 气泡小三角 — 指向伙伴头像 */
        .companion-bubble::before {
            content: '';
            position: absolute;
            top: -6px;
            left: 50%;
            margin-left: -6px;
            width: 10px;
            height: 10px;
            background: var(--bg-card);
            border-left: 1px solid var(--border-glow, var(--border));
            border-top: 1px solid var(--border-glow, var(--border));
            transform: rotate(45deg);
        }

        .companion-premium-art {
            width: 36px;
            height: 36px;
            object-fit: contain;
            border-radius: 6px;
            vertical-align: middle;
        }
        .companion-premium-art-card {
            width: 64px;
            height: 64px;
            object-fit: contain;
            border-radius: 10px;
        }

        /* Companion Gallery */
        .companion-gallery-content {
            max-height: 70vh;
            overflow-y: auto;
            padding-right: 4px;
        }
        .companion-gallery-content::-webkit-scrollbar {
            width: 4px;
        }
        .companion-gallery-content::-webkit-scrollbar-thumb {
            background: var(--border-glow);
            border-radius: 4px;
        }
        .companion-gallery-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 16px;
            padding-bottom: 12px;
            border-bottom: 1px solid var(--border-glow);
        }
        .companion-progress {
            font-size: 14px;
            font-weight: 700;
            color: var(--accent);
        }
        .companion-series-group {
            margin-bottom: 20px;
        }
        .companion-series-header {
            font-size: 16px;
            font-weight: 700;
            color: var(--text-primary);
            padding: 8px 12px;
            margin-bottom: 10px;
            background: var(--bg-glass);
            border-radius: var(--radius-md);
            border-left: 3px solid var(--accent);
        }
        .companion-series-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
            gap: 10px;
        }
        .companion-card {
            background: var(--bg-glass);
            border: 1px solid var(--border-glow);
            border-radius: var(--radius-md);
            padding: 12px;
            text-align: center;
            transition: var(--transition);
            position: relative;
            overflow: hidden;
        }
        .companion-card.unlocked {
            border-color: rgba(0, 245, 212, 0.3);
        }
        .companion-card.unlocked:hover {
            border-color: var(--primary);
            box-shadow: 0 0 16px var(--primary-glow);
            transform: translateY(-2px);
        }
        .companion-card.locked {
            opacity: 0.5;
            filter: grayscale(0.8);
        }
        .companion-card-level {
            font-size: 11px;
            font-weight: 700;
            color: var(--text-muted);
            margin-bottom: 4px;
        }
        .companion-card-emoji {
            font-size: 32px;
            margin: 4px 0;
            line-height: 1.2;
        }
        .companion-lock-icon {
            font-size: 28px;
        }
        .companion-card-name {
            font-size: 13px;
            font-weight: 700;
            color: var(--text-primary);
            margin-bottom: 2px;
        }
        .companion-card-title {
            font-size: 11px;
            color: var(--text-muted);
            margin-bottom: 6px;
        }
        .companion-card-desc {
            font-size: 11px;
            color: var(--text-secondary);
            line-height: 1.3;
            margin-bottom: 6px;
        }
        .companion-card-quote {
            font-size: 11px;
            font-style: italic;
            color: var(--accent);
            padding: 4px 8px;
            background: rgba(0, 245, 212, 0.06);
            border-radius: 6px;
            line-height: 1.3;
        }

        /* Companion unlock notification in level-up */
        .companion-unlock {
            margin-top: 12px;
            padding: 12px;
            background: linear-gradient(135deg, rgba(0,245,212,0.1), rgba(254,232,0,0.1));
            border: 1px solid var(--accent-glow);
            border-radius: var(--radius-md);
            animation: companionUnlockGlow 1.5s ease-in-out infinite;
        }
        .companion-unlock-emoji {
            font-size: 38px;
            display: block;
            margin-bottom: 4px;
        }
        .companion-unlock-label {
            font-size: 11px;
            color: var(--accent);
            font-weight: 600;
        }
        .companion-unlock-name {
            font-size: 16px;
            font-weight: 700;
            color: var(--text-primary);
        }
        .companion-unlock-quote {
            font-size: 12px;
            font-style: italic;
            color: var(--text-secondary);
            margin-top: 4px;
        }
        @keyframes companionUnlockGlow {
            0%, 100% { box-shadow: 0 0 8px var(--accent-glow); }
            50% { box-shadow: 0 0 24px var(--accent-glow); }
        }

        /* ============================================================
               Section Cards (Glassmorphism)
               ============================================================ */
        .section {
            background: var(--bg-card);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border: 1px solid var(--border-glow);
            border-radius: var(--radius-lg);
            padding: 20px;
            margin-bottom: 16px;
            box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
            transition: var(--transition);
            position: relative;
            overflow: hidden;
        }

        .section::before {
            content: '';
            position: absolute;
            top: 0; left: 0; right: 0;
            height: 1px;
            background: linear-gradient(90deg, transparent, var(--primary-glow), transparent);
            opacity: 0.4;
        }

        .section:hover {
            border-color: rgba(255, 255, 255, 0.1);
        }

        .section-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 16px;
        }

        .section-title {
            font-size: 15px;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .section-title i {
            color: var(--primary);
            font-size: 16px;
            filter: drop-shadow(0 0 6px var(--primary-glow));
        }
        .section-title .badge {
            background: var(--secondary-dim);
            color: var(--secondary);
            font-size: 11px;
            padding: 1px 8px;
            border-radius: var(--radius-xl);
            font-weight: 500;
            margin-left: 4px;
        }

        /* ============================================================
               Goals
               ============================================================ */
        .goals-list {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .goal-card {
            background: var(--bg-glass);
            border: 1px solid var(--border-glow);
            border-radius: var(--radius-md);
            padding: 14px 16px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            transition: var(--transition);
            position: relative;
            overflow: hidden;
            cursor: default;
            transform-style: preserve-3d;
            perspective: 600px;
        }

        .goal-card::after {
            content: '';
            position: absolute;
            top: 0; left: 0;
            width: 3px;
            height: 100%;
            background: linear-gradient(180deg, var(--primary), var(--secondary));
            border-radius: 0 2px 2px 0;
            opacity: 0.6;
        }

        .goal-card:hover {
            border-color: var(--primary-glow);
            box-shadow: 0 0 20px var(--primary-glow), inset 0 0 20px rgba(0,245,212,0.03);
            transform: translateY(-1px);
        }

        .goal-card.swiping {
            transition: transform 0.2s ease;
        }

        .goal-card .goal-swipe-hint {
            position: absolute;
            top: 0;
            height: 100%;
            display: flex;
            align-items: center;
            padding: 0 16px;
            font-size: 14px;
            font-weight: 600;
            opacity: 0;
            transition: opacity 0.2s;
            pointer-events: none;
        }
        .goal-card .swipe-hint-left {
            right: 0;
            color: var(--secondary);
        }

        .goal-info {
            flex: 1;
            min-width: 0;
        }

        .goal-name {
            font-size: 14px;
            font-weight: 500;
            color: var(--text-primary);
            margin-bottom: 3px;
        }

        .goal-reward {
            font-size: 12px;
            color: var(--accent);
            display: flex;
            align-items: center;
            gap: 4px;
            filter: drop-shadow(0 0 4px var(--accent-glow));
        }

        .goal-actions {
            display: flex;
            align-items: center;
            gap: 6px;
            flex-shrink: 0;
        }

        /* Complete button with ripple */
        .btn-complete {
            background: linear-gradient(135deg, var(--primary), #00c9b0);
            color: var(--bg-dark);
            border: none;
            padding: 8px 18px;
            border-radius: var(--radius-xl);
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            transition: var(--transition);
            display: flex;
            align-items: center;
            gap: 6px;
            position: relative;
            overflow: hidden;
            font-family: inherit;
        }
        .btn-complete:hover {
            box-shadow: 0 0 24px var(--primary-glow);
            transform: scale(1.03);
        }
        .btn-complete:active {
            transform: scale(0.95);
        }

        /* Ripple effect */
        .ripple {
            position: absolute;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.4);
            transform: scale(0);
            animation: rippleAnim 0.6s ease-out;
            pointer-events: none;
        }
        @keyframes rippleAnim {
            to { transform: scale(4); opacity: 0; }
        }

        /* Shell fly animation */
        .shell-fly {
            position: fixed;
            font-size: 24px;
            color: var(--accent);
            pointer-events: none;
            z-index: 9999;
            animation: flyToCounter 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
        }
        @keyframes flyToCounter {
            0% {
                opacity: 1;
                transform: scale(1) rotate(0deg);
            }
            100% {
                opacity: 0;
                transform: scale(0.3) rotate(360deg) translateY(-200px);
            }
        }

        /* Flash effect */
        .flash-overlay {
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: radial-gradient(circle at center, rgba(0,245,212,0.15), transparent);
            pointer-events: none;
            z-index: 9998;
            opacity: 0;
            animation: flashAnim 0.6s ease-out forwards;
        }
        @keyframes flashAnim {
            0% { opacity: 1; }
            100% { opacity: 0; }
        }

        /* Icon buttons */
        .btn-icon {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            border: 1px solid transparent;
            background: transparent;
            color: var(--text-muted);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: var(--transition);
            font-size: 12px;
        }
        .btn-icon:hover {
            border-color: var(--border-glow);
            background: var(--bg-glass);
            color: var(--text-primary);
        }
        .btn-icon.delete:hover {
            border-color: var(--secondary-glow);
            color: var(--secondary);
            background: var(--secondary-dim);
            box-shadow: 0 0 12px var(--secondary-glow);
        }

        .btn-add-goal {
            width: 100%;
            padding: 14px;
            border: 1px dashed var(--border-glow);
            background: transparent;
            border-radius: var(--radius-md);
            color: var(--text-muted);
            font-size: 13px;
            font-weight: 500;
            cursor: pointer;
            transition: var(--transition);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            margin-top: 10px;
            font-family: inherit;
        }
        .btn-add-goal:hover {
            border-color: var(--primary);
            color: var(--primary);
            background: var(--primary-dim);
            box-shadow: 0 0 20px var(--primary-glow);
        }

        /* Quick-add template buttons */
        .btn-template {
            background: var(--bg-glass);
            border: 1px solid var(--border-glow);
            color: var(--text-primary);
            padding: 10px 8px;
            border-radius: var(--radius-sm);
            cursor: pointer;
            font-size: 13px;
            font-family: inherit;
            transition: var(--transition);
            text-align: center;
            min-height: 44px;
        }
        .btn-template:hover {
            border-color: var(--primary);
            background: var(--primary-dim);
            transform: translateY(-1px);
            box-shadow: 0 0 12px var(--primary-glow);
        }
        .btn-template:active {
            transform: scale(0.96);
        }

        /* ============================================================
               Records (with undo buttons)
               ============================================================ */
        .records-list {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .record-item {
            display: flex;
            align-items: center;
            padding: 10px 12px;
            background: var(--bg-glass);
            border: 1px solid var(--border-glow);
            border-radius: var(--radius-sm);
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
        }

        .record-item.slide-out {
            transform: translateX(-120%);
            opacity: 0;
            max-height: 0;
            padding: 0 12px;
            margin-bottom: -8px;
            border-color: transparent;
        }

        .record-item .record-icon {
            width: 36px;
            height: 36px;
            background: linear-gradient(135deg, var(--primary-dim), var(--primary));
            border: 1px solid var(--primary-glow);
            border-radius: var(--radius-sm);
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--primary);
            font-size: 14px;
            margin-right: 10px;
            flex-shrink: 0;
        }

        .record-info {
            flex: 1;
            min-width: 0;
        }
        .record-goal {
            font-size: 13px;
            font-weight: 500;
            color: var(--text-primary);
        }
        .record-time {
            font-size: 11px;
            color: var(--text-muted);
        }

        .record-shells {
            display: flex;
            align-items: center;
            gap: 4px;
            color: var(--accent);
            font-weight: 600;
            font-size: 13px;
            margin-right: 8px;
            filter: drop-shadow(0 0 4px var(--accent-glow));
            transition: all 0.4s ease;
        }
        .record-shells.roll-down {
            transform: translateY(20px);
            opacity: 0;
        }

        .btn-undo-record {
            width: 44px;
            height: 44px;
            border-radius: 50%;
            border: 1px solid var(--secondary-glow);
            background: var(--secondary-dim);
            color: var(--secondary);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: var(--transition);
            font-size: 12px;
            opacity: 0.7;
            flex-shrink: 0;
        }
        .btn-undo-record:hover {
            opacity: 1;
            box-shadow: 0 0 12px var(--secondary-glow);
            transform: scale(1.1);
        }
        .records-show-more {
            text-align: center;
            padding: 12px;
        }
        .records-show-more button {
            background: var(--bg-elevated);
            border: 1px solid var(--border-glow);
            border-radius: 20px;
            padding: 8px 20px;
            color: var(--text-secondary);
            font-size: 13px;
            cursor: pointer;
            transition: var(--transition);
        }
        .records-show-more button:hover {
            background: var(--primary-dim);
            color: var(--primary);
            border-color: var(--primary-glow);
        }

        .empty-state {
            text-align: center;
            padding: 32px 16px;
            color: var(--text-muted);
            font-size: 13px;
        }
        .empty-state i {
            font-size: 36px;
            margin-bottom: 10px;
            opacity: 0.3;
        }

        /* ============================================================
               Chart
               ============================================================ */
        .chart-container {
            position: relative;
            height: 200px;
            margin-top: 8px;
        }
        .chart-empty {
            height: 200px;
            display: none;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            color: var(--text-muted);
            font-size: 13px;
        }
        .chart-empty i {
            font-size: 40px;
            margin-bottom: 10px;
            opacity: 0.3;
        }

        /* ============================================================
               Milestone Banner
               ============================================================ */
        .milestone-banner-wrap {
            animation: slideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
        }

        .milestone-banner {
            background: linear-gradient(135deg, var(--bg-elevated), var(--bg-card));
            border: 1px solid var(--accent-glow);
            border-radius: var(--radius-lg);
            padding: 14px 18px;
            margin-top: 12px;
            display: flex;
            align-items: center;
            gap: 12px;
            box-shadow: 0 0 30px var(--accent-glow);
            position: relative;
            overflow: hidden;
        }

        .milestone-banner::before {
            content: '';
            position: absolute;
            top: 0; left: 0; right: 0; bottom: 0;
            background: linear-gradient(135deg, var(--accent-dim), transparent);
            pointer-events: none;
        }

        .milestone-banner i {
            font-size: 28px;
            color: var(--accent);
            filter: drop-shadow(0 0 8px var(--accent-glow));
            position: relative;
        }

        .milestone-banner-content {
            flex: 1;
            position: relative;
        }
        .milestone-banner-title {
            font-size: 13px;
            font-weight: 600;
            color: var(--accent);
            margin-bottom: 2px;
        }
        .milestone-banner-text {
            font-size: 12px;
            color: var(--text-secondary);
        }

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

        /* ============================================================
               Modals
               ============================================================ */
        .modal-overlay {
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 5000;
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s ease;
            padding: 20px;
        }
        .modal-overlay.show {
            opacity: 1;
            visibility: visible;
        }

        .modal {
            background: var(--bg-elevated);
            backdrop-filter: blur(24px);
            border: 1px solid var(--border-glow);
            border-radius: var(--radius-lg);
            width: 100%;
            max-width: 400px;
            max-height: 85vh;
            overflow-y: auto;
            transform: scale(0.9) translateY(20px);
            transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
        }
        .modal-overlay.show .modal {
            transform: scale(1) translateY(0);
        }

        .modal-header {
            padding: 20px 20px 0;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .modal-title {
            font-size: 17px;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .modal-title i {
            color: var(--primary);
        }

        .modal-close {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            border: 1px solid var(--border-glow);
            background: transparent;
            color: var(--text-muted);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: var(--transition);
        }
        .modal-close:hover {
            border-color: var(--primary-glow);
            color: var(--primary);
        }

        .modal-body {
            padding: 20px;
        }
        .modal-footer {
            padding: 0 20px 20px;
            display: flex;
            gap: 10px;
        }

        /* Form */
        .form-group {
            margin-bottom: 16px;
        }
        .form-label {
            display: block;
            font-size: 13px;
            font-weight: 500;
            color: var(--text-secondary);
            margin-bottom: 6px;
        }
        .form-input {
            width: 100%;
            padding: 12px 16px;
            border: 1px solid var(--border-glow);
            border-radius: var(--radius-md);
            font-size: 14px;
            font-family: inherit;
            transition: var(--transition);
            background: var(--bg-glass);
            color: var(--text-primary);
            outline: none;
        }
        .form-input:focus {
            border-color: var(--primary);
            box-shadow: 0 0 16px var(--primary-glow);
        }
        .form-input::placeholder {
            color: var(--text-muted);
        }
        .form-hint {
            font-size: 12px;
            color: var(--text-muted);
            margin-top: 4px;
        }
        textarea.form-input {
            resize: vertical;
            min-height: 80px;
        }

        .btn {
            flex: 1;
            padding: 12px 20px;
            border-radius: var(--radius-md);
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: var(--transition);
            border: none;
            font-family: inherit;
            text-align: center;
        }
        .btn-primary {
            background: linear-gradient(135deg, var(--primary), #00c9b0);
            color: var(--bg-dark);
            font-weight: 600;
        }
        .btn-primary:hover {
            box-shadow: 0 0 20px var(--primary-glow);
            transform: translateY(-1px);
        }
        .btn-secondary {
            background: var(--bg-glass);
            border: 1px solid var(--border-glow);
            color: var(--text-secondary);
        }
        .btn-secondary:hover {
            border-color: var(--text-muted);
            color: var(--text-primary);
        }

        /* ============================================================
               Celebration Modal
               ============================================================ */
        .celebration-modal .modal {
            text-align: center;
            max-width: 360px;
        }

        .celebration-icon {
            font-size: 64px;
            margin-bottom: 12px;
            animation: bounce 1s cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
            display: inline-block;
        }
        @keyframes bounce {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.12); }
        }

        .celebration-title {
            font-size: 22px;
            font-weight: 700;
            background: linear-gradient(135deg, var(--accent), var(--secondary));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            margin-bottom: 8px;
        }

        .celebration-message {
            font-size: 14px;
            color: var(--text-secondary);
            margin-bottom: 12px;
            line-height: 1.6;
        }

        .celebration-reward {
            background: linear-gradient(135deg, var(--accent-dim), var(--secondary-dim));
            border: 1px solid var(--accent-glow);
            border-radius: var(--radius-md);
            padding: 16px;
            margin-bottom: 20px;
        }
        .celebration-reward-label {
            font-size: 11px;
            color: var(--text-muted);
            margin-bottom: 4px;
        }
        .celebration-reward-text {
            font-size: 15px;
            font-weight: 600;
            color: var(--accent);
        }

        /* ============================================================
               Settings Modal
               ============================================================ */
        .settings-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 14px 0;
            border-bottom: 1px solid var(--border-glow);
        }
        .settings-item:last-child {
            border-bottom: none;
        }
        .settings-item-left {
            display: flex;
            align-items: center;
            gap: 12px;
        }
        .settings-item-icon {
            width: 36px;
            height: 36px;
            border-radius: var(--radius-sm);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
        }
        .settings-item-icon.export { background: var(--primary-dim); color: var(--primary); }
        .settings-item-icon.import { background: var(--accent-dim); color: var(--accent); }
        .settings-item-icon.danger { background: var(--secondary-dim); color: var(--secondary); }

        .settings-item-text {
            font-size: 14px;
            font-weight: 500;
        }
        .settings-item-desc {
            font-size: 12px;
            color: var(--text-muted);
        }

        .settings-item-btn {
            padding: 6px 16px;
            border-radius: var(--radius-sm);
            border: 1px solid var(--border-glow);
            background: transparent;
            color: var(--text-secondary);
            font-size: 12px;
            cursor: pointer;
            transition: var(--transition);
            font-family: inherit;
        }
        .settings-item-btn:hover {
            border-color: var(--primary-glow);
            color: var(--primary);
        }
        .settings-item-btn.danger:hover {
            border-color: var(--secondary-glow);
            color: var(--secondary);
        }

        /* ============================================================
               Achievements Modal
               ============================================================ */
        .achievement-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 12px;
        }

        .achievement-card {
            background: var(--bg-glass);
            border: 1px solid var(--border-glow);
            border-radius: var(--radius-md);
            padding: 16px 8px;
            text-align: center;
            transition: var(--transition);
            cursor: default;
            position: relative;
        }
        .achievement-card.unlocked {
            border-color: var(--accent-glow);
            box-shadow: 0 0 16px var(--accent-glow);
        }
        .achievement-card.locked {
            opacity: 0.4;
            filter: grayscale(0.8);
        }
        .achievement-card .ach-icon {
            font-size: 28px;
            margin-bottom: 6px;
            display: block;
        }
        .achievement-card .ach-name {
            font-size: 12px;
            font-weight: 500;
        }
        .achievement-card .ach-desc {
            font-size: 10px;
            color: var(--text-muted);
            margin-top: 2px;
        }
        .achievement-card .ach-new {
            position: absolute;
            top: -4px;
            right: -4px;
            background: var(--secondary);
            color: white;
            font-size: 9px;
            padding: 1px 6px;
            border-radius: var(--radius-sm);
            font-weight: 600;
            animation: pulse 1.5s ease-in-out infinite;
        }
        @keyframes pulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.1); }
        }

        /* ============================================================
               Confetti (Enhanced)
               ============================================================ */
        .confetti-piece {
            position: fixed;
            width: 10px;
            height: 10px;
            top: -10px;
            z-index: 9997;
            pointer-events: none;
            animation: confettiFall var(--duration) ease-out forwards;
        }

        @keyframes confettiFall {
            0% {
                transform: translateY(0) rotate(0deg) scale(1);
                opacity: 1;
            }
            100% {
                transform: translateY(105vh) rotate(calc(var(--rotation) * 720deg)) scale(0.3);
                opacity: 0;
            }
        }

        /* Screen shake */
        .shake {
            animation: shake 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
        }
        @keyframes shake {
            0%, 100% { transform: translateX(0); }
            10% { transform: translateX(-4px); }
            20% { transform: translateX(4px); }
            30% { transform: translateX(-3px); }
            40% { transform: translateX(3px); }
            50% { transform: translateX(-2px); }
            60% { transform: translateX(2px); }
            70% { transform: translateX(-1px); }
            80% { transform: translateX(1px); }
        }

        /* ============================================================
               Fade In / Entry Animations
               ============================================================ */
        .fade-in {
            animation: fadeIn 0.5s ease both;
        }
        .fade-in-up {
            animation: fadeInUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
        }

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

        .stagger-1 { animation-delay: 0.05s; }
        .stagger-2 { animation-delay: 0.10s; }
        .stagger-3 { animation-delay: 0.15s; }
        .stagger-4 { animation-delay: 0.20s; }
        .stagger-5 { animation-delay: 0.25s; }
        .stagger-6 { animation-delay: 0.30s; }

        /* ============================================================
               Responsive
               ============================================================ */
        @media (min-width: 768px) {
            body {
                padding: 20px;
            }
            .header {
                border-radius: var(--radius-xl);
                border: 1px solid var(--border-glow);
                max-width: 600px;
                padding: 24px 24px 28px;
            }
            .site-footer {
                padding: 32px 24px calc(24px + env(safe-area-inset-bottom, 0px));
            }
        }

        @media (max-width: 400px) {
            .shell-count {
                font-size: 44px;
            }
            .goal-card {
                padding: 12px;
            }
            .btn-complete {
                padding: 6px 14px;
                font-size: 12px;
            }
            .achievement-grid {
                grid-template-columns: repeat(2, 1fr);
            }
            .noise-grid {
                grid-template-columns: repeat(3, 1fr);
            }
            .btn-template {
                font-size: 12px;
                padding: 8px 4px;
            }
            .guide-tooltip {
                max-width: 220px;
                padding: 12px 14px;
            }
        }

        /* Fallback for browsers without backdrop-filter */
        @supports not (backdrop-filter: blur(8px)) {
            .header, .section, .modal, .goal-card, .toast, .record-item, .btn-add-goal {
                background: #12121a;
            }
        }

        /* Streak interruption toast */
        .streak-warn {
            border-color: var(--accent-glow) !important;
            box-shadow: 0 0 30px var(--accent-glow) !important;
        }

        /* ============================================================
               Shell SVG
               ============================================================ */
        .shell-svg {
            width: 40px; height: 40px;
            color: var(--primary);
            filter: drop-shadow(0 0 8px var(--primary-glow));
            animation: shellFloat 3s ease-in-out infinite;
        }
        @keyframes shellFloat {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-6px); }
        }
        .shell-svg.bounce {
            animation: shellBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
        }
        @keyframes shellBounce {
            0% { transform: scale(1); }
            50% { transform: scale(1.3); }
            100% { transform: scale(1); }
        }

        /* ============================================================
               Encourage Modal
               ============================================================ */
        .encourage-overlay {
            position: fixed; top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.5);
            display: flex; align-items: center; justify-content: center;
            z-index: 11000;
            opacity: 0; visibility: hidden;
            transition: opacity 0.3s, visibility 0.3s;
        }
        .encourage-overlay.show { opacity: 1; visibility: visible; }
        .encourage-modal {
            background: var(--bg-card);
            backdrop-filter: blur(20px);
            border-radius: var(--radius-lg);
            padding: 32px 24px;
            text-align: center;
            max-width: 360px;
            width: 90%;
            position: relative;
            border: 1px solid var(--border-glow);
            transform: scale(0.8);
            transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
        }
        .encourage-overlay.show .encourage-modal { transform: scale(1); }
        [data-theme="dark"] .encourage-modal {
            border-color: var(--primary-glow);
            box-shadow: 0 0 30px var(--primary-glow), inset 0 0 30px rgba(0,245,212,0.05);
        }
        [data-theme="light"] .encourage-modal {
            border-color: var(--primary);
            box-shadow: 0 8px 32px rgba(0,180,216,0.15);
        }
        .encourage-title { font-size: 28px; font-weight: 900; margin-bottom: 12px; }
        .encourage-message { font-size: 16px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 8px; }
        .encourage-tip { font-size: 14px; color: var(--primary); font-weight: 500; margin-bottom: 8px; }
        .encourage-close-btn {
            margin-top: 16px;
            background: var(--primary);
            color: #fff;
            border: none;
            padding: 10px 32px;
            border-radius: var(--radius-xl);
            font-size: 15px;
            font-weight: 600;
            cursor: pointer;
            font-family: inherit;
        }

        /* ============================================================
               V4 ?Ad Styles
               ============================================================ */
        .ad-banner-bottom {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            height: 56px;
            background: var(--bg-glass);
            backdrop-filter: blur(16px);
            border-top: 1px solid var(--border-glow);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 900;
            transition: var(--transition);
        }
        .ad-banner-bottom.hidden {
            transform: translateY(100%);
        }
        .ad-banner-bottom .ad-close {
            position: absolute;
            top: 4px;
            right: 8px;
            background: none;
            border: none;
            color: var(--text-muted);
            font-size: 14px;
            cursor: pointer;
            padding: 4px;
            line-height: 1;
            z-index: 1;
        }
        .ad-banner-bottom .ad-close:hover { color: var(--text-primary); }
        .ad-placeholder {
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            color: var(--text-muted);
        }
        .ad-card {
            background: var(--bg-glass);
            border: 1px solid var(--border-glow);
            border-radius: var(--radius-md);
            padding: 14px 16px;
            margin-bottom: 16px;
            position: relative;
            min-height: 100px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .ad-card .ad-label {
            position: absolute;
            top: 6px;
            right: 8px;
            font-size: 10px;
            color: var(--text-muted);
            background: var(--bg-dark);
            padding: 1px 6px;
            border-radius: 4px;
            opacity: 0.7;
        }
        .ad-card .ad-content {
            text-align: center;
            color: var(--text-muted);
            font-size: 13px;
        }
        .ad-reward-btn {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            background: var(--accent-dim);
            border: 1px solid var(--accent-glow);
            color: var(--accent);
            padding: 6px 14px;
            border-radius: var(--radius-xl);
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
            transition: var(--transition);
            font-family: inherit;
        }
        .ad-reward-btn:hover {
            box-shadow: 0 0 16px var(--accent-glow);
            transform: scale(1.05);
        }
        .ad-reward-btn:disabled {
            opacity: 0.4;
            cursor: not-allowed;
            transform: none;
        }
        .ad-reward-count {
            font-size: 11px;
            color: var(--text-muted);
            margin-top: 4px;
        }

        /* ============================================================
               V4 ?Level / XP Styles
               ============================================================ */
        .level-badge {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            background: linear-gradient(135deg, var(--secondary-dim), var(--primary-dim));
            border: 1px solid var(--secondary-glow);
            padding: 3px 12px 3px 8px;
            border-radius: var(--radius-xl);
            font-size: 12px;
            font-weight: 700;
            color: var(--secondary);
            margin-left: 4px;
            cursor: default;
            transition: var(--transition);
        }
        .level-badge i { font-size: 13px; filter: drop-shadow(0 0 4px var(--secondary-glow)); }
        .level-up-modal .modal { max-width: 340px; text-align: center; }
        .level-up-icon { font-size: 64px; margin-bottom: 12px; animation: levelUpBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); }
        @keyframes levelUpBounce {
            0% { transform: scale(0) rotate(-20deg); opacity: 0; }
            60% { transform: scale(1.3) rotate(5deg); }
            100% { transform: scale(1) rotate(0deg); opacity: 1; }
        }
        .level-up-title {
            font-size: 22px;
            font-weight: 900;
            background: linear-gradient(135deg, var(--primary), var(--secondary));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            margin-bottom: 8px;
        }
        .level-up-desc { font-size: 14px; color: var(--text-secondary); margin-bottom: 16px; }
        .xp-bar-container {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-top: 6px;
        }
        .xp-bar-bg { flex: 1; height: 6px; background: rgba(255,255,255,0.06); border-radius: var(--radius-xl); overflow: hidden; }
        .xp-bar-fill {
            height: 100%;
            border-radius: var(--radius-xl);
            background: linear-gradient(90deg, var(--secondary), var(--primary));
            transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
            box-shadow: 0 0 8px var(--secondary-glow);
        }
        .xp-text { font-size: 11px; color: var(--text-muted); white-space: nowrap; font-family: 'Orbitron', monospace; }

        /* ============================================================
               V4 ?Challenge Styles
               ============================================================ */
        .challenge-tabs {
            display: flex;
            gap: 6px;
            margin-bottom: 12px;
            flex-wrap: wrap;
        }
        .challenge-tab {
            flex: 1;
            padding: 8px 12px;
            border-radius: var(--radius-sm);
            border: 1px solid var(--border-glow);
            background: var(--bg-glass);
            color: var(--text-muted);
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            transition: var(--transition);
            text-align: center;
            min-width: 60px;
        }
        .challenge-tab:hover {
            background: var(--bg-elevated);
            color: var(--text-primary);
        }
        .challenge-tab.active {
            background: var(--primary-dim);
            border-color: var(--primary-glow);
            color: var(--primary);
        }
        .challenge-entry {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 12px;
            background: var(--bg-glass);
            border-radius: var(--radius-sm);
            border: 1px solid var(--border-glow);
            margin-bottom: 8px;
            transition: var(--transition);
        }
        .challenge-entry.completed {
            border-color: var(--primary-glow);
            background: var(--primary-dim);
        }
        .challenge-entry.claimed {
            opacity: 0.5;
            border-color: var(--text-muted);
        }
        .challenge-icon {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
            flex-shrink: 0;
        }
        .challenge-icon.daily-icon { background: var(--primary-dim); }
        .challenge-icon.weekly-icon { background: var(--secondary-dim); }
        .challenge-icon.monthly-icon { background: var(--accent-dim); }
        .challenge-icon.yearly-icon { background: linear-gradient(135deg, var(--primary-dim), var(--secondary-dim)); }
        .challenge-info {
            flex: 1;
            min-width: 0;
        }
        .challenge-title {
            font-size: 14px;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 2px;
        }
        .challenge-desc {
            font-size: 11px;
            color: var(--text-muted);
        }
        .challenge-rewards {
            display: flex;
            flex-direction: column;
            align-items: flex-end;
            gap: 2px;
            flex-shrink: 0;
        }
        .challenge-reward-shells {
            font-size: 13px;
            font-weight: 700;
            color: var(--accent);
        }
        .challenge-reward-xp {
            font-size: 11px;
            color: var(--primary);
        }
        .challenge-claim-btn {
            padding: 6px 14px;
            border-radius: var(--radius-sm);
            border: none;
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
            transition: var(--transition);
            background: var(--primary);
            color: var(--bg-dark);
            flex-shrink: 0;
        }
        .challenge-claim-btn:hover { opacity: 0.8; }
        .challenge-claim-btn:disabled {
            background: var(--text-muted);
            cursor: not-allowed;
            opacity: 0.4;
        }
        .challenge-check {
            width: 22px;
            height: 22px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            flex-shrink: 0;
        }
        .challenge-check.done {
            background: var(--primary);
            color: var(--bg-dark);
        }
        .challenge-check.pending {
            border: 2px solid var(--text-muted);
            color: transparent;
        }
        .challenge-countdown {
            text-align: center;
            font-size: 11px;
            color: var(--text-muted);
            margin-top: 8px;
            padding: 6px;
            font-family: 'Orbitron', monospace;
        }
        .challenge-empty {
            text-align: center;
            padding: 20px;
            color: var(--text-muted);
            font-size: 13px;
        }

        /* ============================================================
               V4 ?Premium Styles
               ============================================================ */
        .premium-badge {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            background: linear-gradient(135deg, var(--accent-dim), var(--primary-dim));
            border: 1px solid var(--accent-glow);
            padding: 2px 10px;
            border-radius: var(--radius-xl);
            font-size: 11px;
            font-weight: 700;
            color: var(--accent);
            cursor: default;
        }
        .premium-badge i { font-size: 12px; color: var(--accent); }
        .premium-card {
            background: linear-gradient(135deg, var(--accent-dim), var(--primary-dim));
            border: 1px solid var(--accent-glow);
            border-radius: var(--radius-md);
            padding: 16px;
            text-align: center;
            margin-bottom: 12px;
        }
        .premium-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
        .premium-card .price { font-size: 28px; font-weight: 900; color: var(--accent); font-family: 'Orbitron', monospace; margin: 8px 0; }
        .premium-card .price small { font-size: 14px; font-weight: 400; color: var(--text-muted); }
        .premium-card .perks { text-align: left; margin: 12px 0; font-size: 13px; line-height: 2; }
        .premium-card .perks i { width: 20px; color: var(--primary); }

	        /* Upgrade plan selection cards */
	        .upgrade-plan-card {
	            display: flex;
	            align-items: center;
	            gap: 14px;
	            padding: 14px 16px;
	            margin-bottom: 10px;
	            border-radius: var(--radius-md);
	            border: 2px solid var(--border-glow);
	            background: var(--bg-card);
	            cursor: pointer;
	            transition: all 0.2s ease;
	            position: relative;
	        }
	        .upgrade-plan-card:hover {
	            border-color: var(--accent);
	            background: var(--accent-dim);
	        }
	        .upgrade-plan-card.active {
	            border-color: var(--accent);
	            background: var(--accent-dim);
	        }
	        .upgrade-plan-card .upgrade-plan-left {
	            display: flex;
	            align-items: baseline;
	            gap: 2px;
	            flex-shrink: 0;
	        }
	        .upgrade-plan-card .upgrade-plan-price {
	            font-size: 26px;
	            font-weight: 900;
	            color: var(--accent);
	            font-family: 'Orbitron', monospace;
	            line-height: 1;
	        }
	        .upgrade-plan-card .upgrade-plan-period {
	            font-size: 13px;
	            color: var(--text-muted);
	        }
	        .upgrade-plan-card .upgrade-plan-right {
	            display: flex;
	            flex-direction: column;
	            gap: 2px;
	        }
	        .upgrade-plan-card .upgrade-plan-label {
	            font-size: 15px;
	            font-weight: 600;
	            color: var(--text);
	        }
	        .upgrade-plan-card .upgrade-plan-desc {
	            font-size: 12px;
	            color: var(--text-muted);
	        }
	        .upgrade-plan-card .upgrade-plan-badge {
	            position: absolute;
	            top: -8px;
	            right: 12px;
	            background: linear-gradient(135deg, #f59e0b, #ef4444);
	            color: #fff;
	            font-size: 11px;
	            font-weight: 700;
	            padding: 2px 10px;
	            border-radius: 20px;
	        }
        .btn-premium {
            background: linear-gradient(135deg, var(--accent), var(--primary));
            color: #000;
            border: none;
            padding: 12px 24px;
            border-radius: var(--radius-xl);
            font-size: 15px;
            font-weight: 700;
            cursor: pointer;
            transition: var(--transition);
            font-family: inherit;
            width: 100%;
        }
        .btn-premium:hover { transform: scale(1.02); box-shadow: 0 0 24px var(--accent-glow); }
        .btn-premium.purchased { background: var(--primary-dim); color: var(--primary); cursor: default; }

        /* ============================================================
               Focus Panel
               ============================================================ */
        .focus-panel {
            position: fixed; bottom: 0; left: 0; right: 0;
            background: var(--bg-card);
            backdrop-filter: blur(24px);
            -webkit-backdrop-filter: blur(24px);
            border-radius: var(--radius-xl) var(--radius-xl) 0 0;
            padding: 24px;
            padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
            z-index: 9000;
            transform: translateY(100%);
            transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
            max-height: 85vh;
            overflow-y: auto;
            border-top: 1px solid var(--border-glow);
        }
        .focus-panel.show { transform: translateY(0); }
        .focus-panel-header {
            display: flex; justify-content: space-between; align-items: center;
            margin-bottom: 16px;
        }
        .focus-panel-header h2 { font-size: 18px; font-weight: 700; }
        .focus-panel-header .icon-btn {
            width: 44px; height: 44px; border-radius: 50%;
            border: 1px solid var(--border-glow);
            background: transparent; color: var(--text-muted);
            cursor: pointer; display: flex; align-items: center; justify-content: center;
        }
        .focus-mode-tabs {
            display: flex; gap: 8px; margin-bottom: 16px; overflow-x: auto;
            padding-bottom: 4px;
        }
        .focus-tab {
            padding: 8px 18px;
            border-radius: var(--radius-xl);
            border: 1px solid var(--border-glow);
            background: transparent;
            color: var(--text-secondary);
            cursor: pointer;
            font-family: inherit; font-size: 13px;
            white-space: nowrap;
            transition: var(--transition);
        }
        .focus-tab:hover { border-color: var(--primary-glow); color: var(--primary); }
        .focus-tab.active {
            background: var(--primary-dim);
            color: var(--primary);
            border-color: var(--primary);
        }
        .focus-custom-input { margin-bottom: 12px; }
        .focus-timer-display {
            text-align: center;
            font-size: 72px;
            font-weight: 700;
            font-family: 'Orbitron', monospace;
            color: var(--text-primary);
            margin: 12px 0;
            letter-spacing: 4px;
            text-shadow: 0 0 20px rgba(0,245,212,0.15);
        }
        [data-theme="light"] .focus-timer-display {
            text-shadow: none;
        }
        .focus-phase-label {
            text-align: center;
            font-size: 14px;
            color: var(--text-muted);
            margin-bottom: 16px;
            text-transform: uppercase;
            letter-spacing: 2px;
        }
        .focus-controls {
            display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
            margin-bottom: 16px;
        }
        .focus-btn {
            padding: 12px 24px;
            border-radius: var(--radius-xl);
            border: none;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            font-family: inherit;
            transition: var(--transition);
        }
        .focus-btn:hover { transform: translateY(-1px); }
        .focus-btn.primary { background: var(--primary); color: #000; }
        .focus-btn.primary:hover { box-shadow: 0 0 20px var(--primary-glow); }
        .focus-btn.secondary {
            background: var(--bg-elevated);
            color: var(--text-secondary);
            border: 1px solid var(--border-glow);
        }
        .focus-btn.secondary:hover { border-color: var(--primary-glow); color: var(--primary); }
        .focus-options { margin-bottom: 16px; }
        .toggle-row {
            display: flex; align-items: center; justify-content: space-between;
            padding: 8px 0; font-size: 14px; color: var(--text-secondary); gap: 12px;
        }
        .toggle-row input[type="checkbox"] { display: none; }
        .toggle-slider {
            width: 44px; height: 24px; background: var(--bg-elevated);
            border-radius: 12px; position: relative; cursor: pointer;
            border: 1px solid var(--border-glow); flex-shrink: 0;
            transition: var(--transition);
        }
        .toggle-slider::after {
            content: ''; position: absolute; top: 2px; left: 2px;
            width: 18px; height: 18px; border-radius: 50%;
            background: var(--text-muted); transition: var(--transition);
        }
        .toggle-row input:checked + .toggle-slider { background: var(--primary-dim); border-color: var(--primary); }
        .toggle-row input:checked + .toggle-slider::after {
            left: 22px; background: var(--primary);
        }
        .strict-toggle-row input:checked + .toggle-slider { background: rgba(255, 0, 110, 0.2); border-color: #ff006e; }
        .strict-toggle-row input:checked + .toggle-slider::after { background: #ff006e; }
        .strict-toggle-row .toggle-slider::after { background: var(--text-muted); }
        .strict-badge {
            display: inline-block; font-size: 10px; font-weight: 700;
            background: #ff006e; color: #fff; padding: 1px 6px; border-radius: 8px;
            vertical-align: middle; margin-left: 4px; line-height: 16px;
        }
        .strict-hint {
            font-size: 12px; color: var(--text-muted); margin-top: -4px; margin-bottom: 4px;
            padding-left: 4px; line-height: 1.4;
        }
        .focus-btn.danger {
            background: rgba(255, 0, 110, 0.15); color: #ff006e; border-color: rgba(255, 0, 110, 0.3);
        }
        .focus-btn.danger:hover { background: rgba(255, 0, 110, 0.25); }

        /* Stats Panel */
        .stats-panel {
            position: fixed; bottom: 0; left: 0; right: 0; z-index: 2000;
            background: var(--bg-elevated); border-radius: 20px 20px 0 0;
            box-shadow: 0 -8px 40px rgba(0,0,0,0.3);
            transform: translateY(100%); transition: transform 0.35s cubic-bezier(.4,0,.2,1);
            max-height: 85vh; display: flex; flex-direction: column;
        }
        .stats-panel.show { transform: translateY(0); }
        .stats-panel-header {
            display: flex; justify-content: space-between; align-items: center;
            padding: 18px 20px 12px; border-bottom: 1px solid var(--border-glow); flex-shrink: 0;
        }
        .stats-panel-header h2 { font-size: 18px; font-weight: 700; }
        .stats-panel-header h2 i { margin-right: 8px; color: var(--accent); }
        .stats-panel-body {
            padding: 16px 20px 24px; overflow-y: auto; flex: 1;
        }
        .stats-overview {
            display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 20px;
        }
        .stats-card {
            background: var(--bg-elevated); border-radius: var(--radius-sm);
            padding: 14px 8px; text-align: center; border: 1px solid var(--border-glow);
        }
        .stats-card .stat-value { display: block; font-size: 20px; font-weight: 700; color: var(--primary); }
        .stats-card label { display: block; font-size: 12px; color: var(--text-muted); margin-top: 4px; }
        .stats-chart-section { margin-bottom: 20px; }
        .stats-chart-section h3 { font-size: 14px; font-weight: 600; margin-bottom: 10px; color: var(--text-secondary); }
        .stats-chart-section h3 i { margin-right: 6px; }
        .stats-chart-container { height: 180px; position: relative; }
        .stats-empty { text-align: center; padding: 40px 0; color: var(--text-muted); font-size: 14px; }
        .strict-stats-content { padding: 12px; background: var(--bg-elevated); border-radius: var(--radius-sm); border: 1px solid var(--border-glow); }
        .strict-stat-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
        .strict-stat-row span:first-child { color: var(--text-secondary); }
        .strict-stat-row span:last-child { font-weight: 600; }

        /* Noise / White Noise */
        .focus-noise-section { margin-bottom: 16px; }
        .focus-noise-section h3 { font-size: 15px; font-weight: 600; margin-bottom: 10px; }
        .noise-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
        .noise-btn {
            padding: 10px 4px;
            border-radius: var(--radius-sm);
            border: 1px solid var(--border-glow);
            background: var(--bg-elevated);
            color: var(--text-secondary);
            font-size: 12px;
            cursor: pointer;
            font-family: inherit;
            transition: var(--transition);
            text-align: center;
            position: relative;
        }
        .noise-btn:hover { border-color: var(--primary-glow); }
        .premium-tag {
            position: absolute;
            top: -6px;
            right: -6px;
            background: linear-gradient(135deg, var(--secondary), var(--primary));
            color: #fff;
            font-size: 8px;
            font-weight: 700;
            padding: 1px 5px;
            border-radius: 6px;
            letter-spacing: 0.5px;
        }
        .noise-btn.premium-noise {
            border-color: var(--secondary-dim);
        }
        .noise-btn.premium-noise:hover {
            border-color: var(--secondary-glow);
        }
        .noise-btn.premium-locked {
            opacity: 0.5;
            cursor: not-allowed;
        }
        .noise-btn.active {
            border-color: var(--primary);
            color: var(--primary);
            background: var(--primary-dim);
            box-shadow: 0 0 12px var(--primary-glow);
        }
        .noise-volume-row {
            display: flex; align-items: center; gap: 12px;
            font-size: 13px; color: var(--text-secondary); margin-bottom: 8px;
        }
        .noise-volume-row input[type="range"] { flex: 1; accent-color: var(--primary); }

        /* Focus goal link */
        .focus-goal-link { margin-bottom: 16px; }
        .focus-goal-link select { font-size: 14px; }

        /* Focus stats */
        .focus-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
        .focus-stat {
            text-align: center;
            padding: 12px 8px;
            background: var(--bg-elevated);
            border-radius: var(--radius-sm);
            border: 1px solid var(--border-glow);
        }
        .focus-stat span { display: block; font-size: 20px; font-weight: 700; color: var(--primary); }
        .focus-stat label { font-size: 11px; color: var(--text-muted); margin-top: 2px; display: block; }

        /* ============================================================
               Category System
               ============================================================ */
        .category-filter {
            display: flex; gap: 8px; margin-bottom: 14px; overflow-x: auto;
            padding-bottom: 4px; -webkit-overflow-scrolling: touch;
        }
        .cat-filter-btn {
            padding: 6px 14px;
            border-radius: var(--radius-xl);
            border: 1px solid var(--border-glow);
            background: transparent;
            color: var(--text-secondary);
            cursor: pointer;
            font-family: inherit; font-size: 13px;
            white-space: nowrap;
            transition: var(--transition);
            flex-shrink: 0;
        }
        .cat-filter-btn:hover { border-color: var(--primary-glow); color: var(--primary); }
        .cat-filter-btn.active {
            background: var(--primary-dim);
            color: var(--primary);
            border-color: var(--primary);
        }
        .goal-category-badge {
            position: absolute; top: 8px; right: 8px;
            font-size: 14px; width: 24px; height: 24px;
            display: flex; align-items: center; justify-content: center;
            border-radius: 50%;
            background: var(--bg-elevated);
            border: 1px solid var(--border-glow);
        }
        .settings-section { margin-bottom: 20px; }
        .settings-divider { height: 1px; background: var(--border-glow); margin: 16px 0; }
        .category-manager { display: flex; flex-direction: column; gap: 8px; }
        .category-manager-item {
            display: flex; align-items: center; gap: 10px;
            padding: 8px 12px; background: var(--bg-elevated);
            border-radius: var(--radius-sm); font-size: 14px;
        }
        .category-manager-item .cat-color {
            width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
        }
        .category-manager-item .cat-del-btn {
            margin-left: auto; background: none; border: none;
            color: var(--text-muted); cursor: pointer; font-size: 14px;
            padding: 4px;
        }
        .category-manager-item .cat-del-btn:hover { color: var(--secondary); }

        /* ============================================================
               Mood Tracker
               ============================================================ */
        .mood-selector {
            display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
        }
        .mood-btn {
            padding: 10px 16px;
            border-radius: var(--radius-xl);
            border: 2px solid transparent;
            background: var(--bg-elevated);
            color: var(--text-secondary);
            font-size: 14px;
            cursor: pointer;
            transition: var(--transition);
            font-family: inherit;
        }
        .mood-btn:hover { transform: scale(1.1); border-color: var(--border-glow); }
        .mood-btn.selected {
            border-color: var(--primary);
            background: var(--primary-dim);
            color: var(--primary);
            transform: scale(1.1);
        }
        .mood-note { margin-top: 12px; }
        .today-mood-display {
            margin-top: 8px; padding: 8px 12px;
            background: var(--bg-elevated); border-radius: var(--radius-sm);
            font-size: 14px; display: flex; align-items: center; gap: 8px;
        }
        .quick-mood-overlay {
            position: fixed; top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.4);
            display: flex; align-items: center; justify-content: center;
            z-index: 10001;
            opacity: 0; visibility: hidden;
            transition: opacity 0.2s;
        }
        .quick-mood-overlay.show { opacity: 1; visibility: visible; }
        .quick-mood-prompt {
            background: var(--bg-card); border-radius: var(--radius-lg);
            padding: 24px; text-align: center; max-width: 320px; width: 90%;
            border: 1px solid var(--border-glow);
        }
        .quick-mood-prompt p { font-size: 15px; margin-bottom: 16px; }
        .quick-mood-skip {
            background: none; border: none; color: var(--text-muted);
            font-size: 13px; cursor: pointer; margin-top: 12px; font-family: inherit;
        }

        /* ============================================================
               Heatmap
               ============================================================ */
        .heatmap-container { overflow-x: auto; padding: 8px 0; scrollbar-width: thin; }
        .heatmap-grid {
            display: grid;
            grid-template-columns: 30px repeat(53, 1fr);
            gap: 3px;
            min-width: 750px;
        }
        .heatmap-label { font-size: 10px; color: var(--text-muted); display:flex;align-items:center; }
        .heatmap-cell {
            width: 14px; height: 14px;
            border-radius: 3px;
            background: var(--bg-elevated);
            cursor: pointer;
            position: relative;
            transition: transform 0.15s;
        }
        .heatmap-cell:hover { transform: scale(1.5); z-index: 2; }
        .heatmap-cell.tooltip-trigger { position: relative; }
        [data-theme="dark"] .heatmap-cell.lv1 { background: #0d3b3a; }
        [data-theme="dark"] .heatmap-cell.lv2 { background: #0f5c5a; }
        [data-theme="dark"] .heatmap-cell.lv3 { background: #0a7d79; }
        [data-theme="dark"] .heatmap-cell.lv4 { background: #00b8a9; }
        [data-theme="dark"] .heatmap-cell.lv5 { background: #00f5d4; }
        [data-theme="light"] .heatmap-cell.lv1 { background: #fff3cd; }
        [data-theme="light"] .heatmap-cell.lv2 { background: #ffe69c; }
        [data-theme="light"] .heatmap-cell.lv3 { background: #ffda6a; }
        [data-theme="light"] .heatmap-cell.lv4 { background: #ffc107; }
        [data-theme="light"] .heatmap-cell.lv5 { background: #ff9f00; }

        .heatmap-stats {
            display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 16px;
        }
        .heatmap-stat {
            text-align: center; padding: 12px 8px;
            background: var(--bg-elevated); border-radius: var(--radius-sm);
            border: 1px solid var(--border-glow);
        }
        .heatmap-stat span { display: block; font-size: 20px; font-weight: 700; color: var(--primary); }
        .heatmap-stat label { font-size: 11px; color: var(--text-muted); margin-top: 2px; display: block; }

        .heatmap-tooltip {
            position: fixed; z-index: 100; pointer-events: none;
            background: var(--bg-card); border: 1px solid var(--primary);
            border-radius: var(--radius-sm); padding: 8px 12px;
            font-size: 13px; opacity: 0; transition: opacity 0.15s;
            box-shadow: var(--shadow-neon);
        }
        .heatmap-tooltip.show { opacity: 1; }

        /* ============================================================
        Priority Badges
        ============================================================ */
        .goal-priority-badge {
            display: inline-flex; align-items: center; gap: 3px;
            font-size: 11px; padding: 2px 7px; border-radius: 10px;
            margin-left: 8px; vertical-align: middle;
        }
        .goal-priority-badge.high {
            background: rgba(255, 69, 58, 0.2);
            color: #ff453a; border: 1px solid rgba(255, 69, 58, 0.3);
        }
        .goal-priority-badge.medium {
            background: rgba(255, 204, 0, 0.15);
            color: #ffcc00; border: 1px solid rgba(255, 204, 0, 0.3);
        }

        /* ============================================================
        Habit Cycle Progress
        ============================================================ */
        .habit-cycle-progress {
            display: inline-flex; align-items: center; gap: 4px;
            font-size: 11px; color: var(--text-muted); margin-left: 8px;
        }
        .habit-cycle-progress .completed-count {
            color: var(--primary); font-weight: 600;
        }
        .habit-cycle-progress .target-count {
            color: var(--text-muted);
        }
        .habit-cycle-badge {
            display: inline-block; font-size: 10px;
            padding: 1px 6px; border-radius: 8px;
            background: rgba(0, 245, 212, 0.12);
            color: var(--primary); border: 1px solid rgba(0, 245, 212, 0.2);
            margin-left: 6px; vertical-align: middle;
        }

        /* ============================================================
        Onboarding Overlay
        ============================================================ */
        .onboarding-overlay {
            position: fixed; top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0, 0, 0, 0.75);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            z-index: 99999;
            display: flex; align-items: center; justify-content: center;
            opacity: 0; visibility: hidden;
            transition: opacity 0.4s ease, visibility 0.4s ease;
            padding: 20px;
        }
        .onboarding-overlay.show {
            opacity: 1; visibility: visible;
        }
        .onboarding-card {
            background: var(--bg-card);
            border: 1px solid var(--border-glow);
            border-radius: 20px;
            padding: 40px 36px 32px;
            max-width: 420px; width: 100%;
            text-align: center;
            box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 40px rgba(0,245,212,0.08);
            animation: onboardingBounceIn 0.5s ease;
        }
        @keyframes onboardingBounceIn {
            0% { opacity: 0; transform: scale(0.9) translateY(20px); }
            60% { transform: scale(1.02) translateY(-4px); }
            100% { opacity: 1; transform: scale(1) translateY(0); }
        }
        .onboarding-icon {
            font-size: 56px; margin-bottom: 16px; display: block;
            animation: onboardingFloat 3s ease-in-out infinite;
        }
        @keyframes onboardingFloat {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-8px); }
        }
        .onboarding-card h2 {
            font-size: 24px; font-weight: 700; margin: 0 0 8px;
            background: linear-gradient(135deg, var(--primary), var(--secondary));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }
        .onboarding-card p {
            font-size: 15px; line-height: 1.7;
            color: var(--text-secondary); margin: 8px 0 20px;
        }
        .onboarding-features {
            display: flex; flex-direction: column; gap: 10px;
            margin: 20px 0; text-align: left;
        }
        .onboarding-features .feature-item {
            display: flex; align-items: center; gap: 12px;
            padding: 12px 16px;
            background: var(--bg-elevated);
            border-radius: 12px;
            border: 1px solid var(--border-glow);
            font-size: 14px; color: var(--text);
        }
        .onboarding-features .feature-item .fi-icon {
            font-size: 20px; flex-shrink: 0;
        }
        .onboarding-card .btn-primary {
            width: 100%; padding: 14px; font-size: 16px;
            border-radius: 14px; margin-top: 8px;
        }
        .onboarding-dots {
            display: flex; justify-content: center; gap: 8px; margin: 20px 0 8px;
        }
        .onboarding-dots .dot {
            width: 8px; height: 8px; border-radius: 50%;
            background: var(--text-muted); opacity: 0.3;
            transition: all 0.3s;
        }
        .onboarding-dots .dot.active {
            opacity: 1; background: var(--primary);
            box-shadow: 0 0 8px var(--primary);
        }
        .onboarding-card .skip-btn {
            background: none; border: none;
            color: var(--text-muted); font-size: 13px;
            cursor: pointer; margin-top: 12px; opacity: 0.7;
            transition: opacity 0.2s;
        }
        .onboarding-card .skip-btn:hover { opacity: 1; }

        /* Brand positioning step */
        .onboarding-step-brand { text-align: center; }
        .onboarding-step-brand .onboarding-icon { font-size: 64px; display: block; margin-bottom: 8px; }
        .onboarding-step-brand h2 {
            font-size: 24px; font-weight: 800;
            background: linear-gradient(135deg, var(--primary), var(--secondary), #fee800);
            -webkit-background-clip: text; -webkit-text-fill-color: transparent;
            background-clip: text;
        }
        .onboarding-step-brand p { font-size: 16px; line-height: 1.6; }

        /* ============================================================
        Guided Tour Tooltip
        ============================================================ */
        .guide-tooltip {
            position: fixed;
            z-index: 9999;
            background: var(--bg-card);
            border: 1px solid var(--primary);
            border-radius: var(--radius-md);
            padding: 14px 18px;
            max-width: 280px;
            box-shadow: 0 0 30px var(--primary-glow), 0 8px 32px rgba(0,0,0,0.4);
            animation: guideIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
            pointer-events: auto;
        }
        .guide-tooltip .guide-arrow {
            position: absolute;
            width: 12px; height: 12px;
            background: var(--bg-card);
            border-left: 1px solid var(--primary);
            border-top: 1px solid var(--primary);
            transform: rotate(45deg);
        }
        .guide-tooltip .guide-arrow.top {
            top: -7px; left: 50%; margin-left: -6px;
            border-left: none; border-top: none;
            border-right: 1px solid var(--primary);
            border-bottom: 1px solid var(--primary);
        }
        .guide-tooltip .guide-arrow.bottom {
            bottom: -7px; left: 50%; margin-left: -6px;
        }
        .guide-tooltip .guide-arrow.left {
            left: -7px; top: 50%; margin-top: -6px;
            border-left: none; border-top: none;
        }
        .guide-tooltip .guide-arrow.right {
            right: -7px; top: 50%; margin-top: -6px;
        }
        .guide-tooltip .guide-title {
            font-size: 14px;
            font-weight: 700;
            margin-bottom: 4px;
            color: var(--primary);
        }
        .guide-tooltip .guide-text {
            font-size: 13px;
            color: var(--text-secondary);
            line-height: 1.5;
            margin-bottom: 10px;
        }
        .guide-tooltip .guide-btn {
            background: var(--primary);
            color: var(--bg-dark);
            border: none;
            padding: 6px 18px;
            border-radius: var(--radius-sm);
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            font-family: inherit;
            transition: var(--transition);
        }
        .guide-tooltip .guide-btn:hover {
            box-shadow: 0 0 16px var(--primary-glow);
        }
        .guide-tooltip .guide-skip {
            background: none;
            border: none;
            color: var(--text-muted);
            font-size: 12px;
            cursor: pointer;
            margin-left: 10px;
            font-family: inherit;
        }
        .guide-tooltip .guide-skip:hover {
            color: var(--text-secondary);
        }
        @keyframes guideIn {
            from { opacity: 0; transform: scale(0.85) translateY(-8px); }
            to { opacity: 1; transform: scale(1) translateY(0); }
        }

        /* ============================================================
        Share Card (        /* ============================================================
               Share Card ?鐧捐瘝鏂╅鏍?offscreen, captured by html2canvas)
               ============================================================ */
        .share-card-container {
            position: fixed;
            left: -9999px;
            top: 0;
            z-index: -1;
            pointer-events: none;
        }
        .share-card {
            width: 600px;
            min-height: 780px;
            border-radius: 24px;
            position: relative;
            overflow: hidden;
            font-family: 'Noto Sans SC', -apple-system, sans-serif;
            background-size: cover;
            background-position: center;
            background-repeat: no-repeat;
        }
        /* Dark gradient overlay over background image */
        .share-card::before {
            content: '';
            position: absolute;
            inset: 0;
            background: linear-gradient(
                180deg,
                rgba(0,0,0,0.55) 0%,
                rgba(0,0,0,0.35) 40%,
                rgba(0,0,0,0.50) 70%,
                rgba(0,0,0,0.75) 100%
            );
            pointer-events: none;
            z-index: 1;
        }
        .share-card > * {
            position: relative;
            z-index: 2;
        }
        /* Inner frosted card */
        .sc-inner {
            background: rgba(255,255,255,0.10);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border-radius: 20px;
            border: 1px solid rgba(255,255,255,0.15);
            margin: 55px 40px 40px;
            padding: 32px 32px 28px;
        }
        /* Brand + date row */
        .sc-brand-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
        }
        .sc-brand {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .sc-brand-icon {
            width: 38px; height: 38px;
            background: rgba(255,255,255,0.15);
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
        }
        .sc-brand-name {
            font-size: 17px;
            font-weight: 800;
            color: #ffffff;
            letter-spacing: 0.5px;
        }
        .sc-date {
            font-size: 13px;
            color: rgba(255,255,255,0.65);
            font-weight: 500;
        }
        .sc-divider {
            height: 1px;
            background: linear-gradient(90deg, rgba(255,255,255,0.20), rgba(255,255,255,0.05));
            margin: 16px 0 20px;
        }
        .sc-section-label {
            font-size: 13px;
            font-weight: 700;
            color: rgba(255,255,255,0.50);
            text-transform: uppercase;
            letter-spacing: 2px;
            margin-bottom: 14px;
        }
        .sc-task-list {
            list-style: none;
            padding: 0;
            margin: 0 0 4px;
        }
        .sc-task-list li {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 0;
            font-size: 16px;
            font-weight: 600;
            color: #ffffff;
            border-bottom: 1px solid rgba(255,255,255,0.06);
        }
        .sc-task-list li:last-child {
            border-bottom: none;
        }
        .sc-task-list li::before {
            content: '鈥?;
            font-size: 12px;
            color: rgba(0,245,212,0.8);
            flex-shrink: 0;
        }
        .sc-empty-tasks {
            text-align: center;
            font-size: 15px;
            color: rgba(255,255,255,0.45);
            padding: 20px 0;
            font-weight: 500;
        }
        .sc-stats-row {
            display: flex;
            justify-content: space-around;
            align-items: center;
            padding: 16px 0 12px;
            gap: 8px;
        }
        .sc-stat-item {
            text-align: center;
            flex: 1;
        }
        .sc-stat-icon {
            font-size: 20px;
            margin-bottom: 2px;
        }
        .sc-stat-value {
            font-size: 26px;
            font-weight: 900;
            color: #ffffff;
            line-height: 1.2;
        }
        .sc-stat-label {
            font-size: 11px;
            color: rgba(255,255,255,0.50);
            font-weight: 500;
            margin-top: 1px;
        }
        .sc-today-shells {
            text-align: center;
            font-size: 15px;
            font-weight: 700;
            color: #00f5d4;
            margin: 8px 0 4px;
            letter-spacing: 0.5px;
        }
        .sc-quote {
            text-align: center;
            font-size: 15px;
            font-weight: 500;
            color: rgba(255,255,255,0.60);
            font-style: italic;
            margin-top: 12px;
            padding-top: 16px;
            border-top: 1px solid rgba(255,255,255,0.08);
            letter-spacing: 0.3px;
        }
        .sc-companion {
            text-align: center;
            margin-top: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            flex-wrap: wrap;
            padding: 8px 12px;
            background: rgba(255,255,255,0.06);
            border-radius: 12px;
            backdrop-filter: blur(4px);
        }
        .sc-comp-avatar {
            font-size: 24px;
            line-height: 1;
        }
        .sc-comp-avatar img {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            object-fit: contain;
            display: block;
        }
        .sc-comp-name {
            font-size: 13px;
            font-weight: 600;
            color: rgba(255,255,255,0.85);
        }
        .sc-comp-speech {
            font-size: 13px;
            color: rgba(255,255,255,0.75);
            font-style: italic;
            line-height: 1.4;
        }
        .sc-footer {
            text-align: center;
            font-size: 12px;
            color: rgba(255,255,255,0.35);
            margin: 0 40px 30px;
            letter-spacing: 1px;
        }}
                /* H5 Report Viewer */
        .report-viewer { background: var(--bg-card); border-radius: 16px; max-width: 480px; width: 92%; max-height: 85vh; display: flex; flex-direction: column; overflow: hidden; animation: reportSlideUp 0.35s ease-out; }
        @keyframes reportSlideUp { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
        .report-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
        .report-header h2 { font-size: 18px; margin: 0; border: none; padding: 0; }
        .report-tabs { display: flex; gap: 4px; padding: 8px 20px; background: var(--bg-body); }
        .report-tab { flex: 1; padding: 8px; border: none; border-radius: 8px; background: transparent; color: var(--text-muted); font-size: 14px; cursor: pointer; transition: all 0.2s; font-weight: 500; }
        .report-tab.active { background: var(--accent); color: #000; font-weight: 700; }
        .report-tab:hover:not(.active) { background: var(--hover); }
        .report-scroll { flex: 1; overflow-y: auto; padding: 16px 20px 24px; }
        .report-hero { text-align: center; padding: 16px 0 20px; }
        .report-hero-icon { font-size: 48px; line-height: 1; margin-bottom: 8px; animation: heroBounce 1s ease-out; }
        @keyframes heroBounce { 0% { transform: scale(0); } 50% { transform: scale(1.2); } 100% { transform: scale(1); } }
        .report-hero-title { font-size: 20px; font-weight: 700; color: var(--text); }
        .report-hero-period { font-size: 14px; color: var(--text-muted); margin-top: 4px; }
        .report-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
        .report-card { background: var(--bg-body); border-radius: 12px; padding: 14px; text-align: center; animation: cardFadeIn 0.5s ease-out both; }
        .report-card:nth-child(1) { animation-delay: 0.1s; }
        .report-card:nth-child(2) { animation-delay: 0.2s; }
        .report-card:nth-child(3) { animation-delay: 0.3s; }
        .report-card:nth-child(4) { animation-delay: 0.4s; }
        @keyframes cardFadeIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
        .rc-icon { font-size: 28px; line-height: 1; margin-bottom: 4px; }
        .rc-label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
        .rc-value { font-size: 28px; font-weight: 900; color: var(--accent); font-family: 'Orbitron',monospace; }
        .rc-shells .rc-value { color: #00f5d4; }
        .rc-tasks .rc-value { color: #4dabf7; }
        .rc-streak .rc-value { color: #ff6b35; }
        .rc-focus .rc-value { color: #cc5de8; }
        .report-section { margin-bottom: 20px; }
        .report-section-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
        .report-goal-list { display: flex; flex-direction: column; gap: 6px; }
        .report-goal-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; background: var(--bg-body); border-radius: 8px; font-size: 13px; }
        .report-goal-rank { color: var(--accent); font-weight: 700; margin-right: 8px; min-width: 20px; }
        .report-goal-name { flex: 1; color: var(--text); }
        .report-goal-count { color: var(--text-muted); font-weight: 500; }
        .report-ach-list { display: flex; flex-wrap: wrap; gap: 6px; }
        .report-ach-item { padding: 6px 12px; background: var(--bg-body); border-radius: 20px; font-size: 12px; color: var(--text); }
        .report-footer-msg { text-align: center; padding: 16px 0 8px; font-size: 14px; color: var(--accent); font-weight: 500; }
        .report-view-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; background: var(--accent); color: #000; border: none; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
        .report-view-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,245,212,0.3); }

/* Poster Template Selector */
        .poster-templates { display: flex; gap: 10px; padding: 16px 8px; justify-content: center; flex-wrap: wrap; }
        .poster-template-option { cursor: pointer; border-radius: 12px; transition: transform 0.2s, box-shadow 0.2s; flex: 1; min-width: 100px; max-width: 130px; }
        .poster-template-option:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,245,212,0.2); }
        .pto-preview { border-radius: 10px; padding: 16px 8px; text-align: center; position: relative; overflow: hidden; border: 2px solid transparent; transition: border-color 0.2s; }
        .poster-template-option:hover .pto-preview { border-color: var(--accent); }
        .pto-badge { position: absolute; top: 4px; left: 4px; background: var(--accent); color: #000; font-size: 10px; font-weight: 700; padding: 1px 8px; border-radius: 6px; }
        .pto-content { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; color: var(--text); }
        .pto-icon { font-size: 28px; line-height: 1; }
        .pto-classic { background: linear-gradient(135deg,#1a2a3a,#2a3a4a); }
        .pto-heat { background: linear-gradient(135deg,#2d1b00,#4a2a00); }
        .pto-minimal { background: linear-gradient(135deg,#f0f0f0,#ffffff); color: #333 !important; }
        .pto-minimal .pto-content { color: #333; }

        /* Template 2: 鐑姏椋?*/
        .share-card-heat { width: 380px; min-height: 540px; border-radius: 20px; background: linear-gradient(145deg,#1a0a00,#2d1500,#1a0a00); overflow: hidden; position: relative; display: flex; flex-direction: column; }
        .sch-bg-particles { position: absolute; inset: 0; background: radial-gradient(ellipse at 30% 20%,rgba(255,100,0,0.12) 0%,transparent 50%),radial-gradient(ellipse at 70% 80%,rgba(255,50,0,0.08) 0%,transparent 50%); pointer-events: none; }
        .sch-inner { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; align-items: center; padding: 36px 24px 20px; }
        .sch-brand { font-size: 16px; font-weight: 700; color: #ff8c00; letter-spacing: 4px; margin-bottom: 12px; }
        .sch-streak-number { font-size: 80px; font-weight: 900; color: #ff6b00; line-height: 1; text-shadow: 0 0 40px rgba(255,100,0,0.4); margin: 10px 0; }
        .sch-streak-label { font-size: 14px; color: rgba(255,255,255,0.5); letter-spacing: 6px; margin-bottom: 16px; }
        .sch-stats { display: flex; gap: 24px; margin-bottom: 16px; }
        .sch-stat { font-size: 13px; color: rgba(255,255,255,0.7); }
        .sch-stat span { color: #ff8c00; font-weight: 700; }
        .sch-tasks { font-size: 14px; color: rgba(255,255,255,0.8); text-align: center; padding: 8px 20px; background: rgba(255,255,255,0.06); border-radius: 20px; margin-bottom: 12px; max-width: 100%; }
        .sch-quote { font-size: 12px; color: rgba(255,255,255,0.4); font-style: italic; margin-bottom: 8px; text-align: center; }
        .sch-companion { text-align: center; margin-bottom: 12px; padding: 4px 12px; }
        .sch-comp-speech { font-size: 11px; color: rgba(255,255,255,0.55); font-style: italic; }
        .sch-qr { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,0.05); padding: 8px 16px; border-radius: 12px; }
        .sch-qr img { width: 48px; height: 48px; border-radius: 4px; background: #fff; }
        .sch-qr span { font-size: 11px; color: rgba(255,255,255,0.4); }

        /* Template 3: 鏋佺畝椋?*/
        .share-card-minimal { width: 380px; min-height: 480px; border-radius: 20px; background: #ffffff; overflow: hidden; display: flex; flex-direction: column; }
        .scm-inner { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 40px 28px 20px; color: #333; }
        .scm-icon { font-size: 48px; line-height: 1; margin-bottom: 8px; }
        .scm-title { font-size: 20px; font-weight: 700; color: #222; letter-spacing: 2px; }
        .scm-divider { width: 40px; height: 3px; background: linear-gradient(90deg,#00b4d8,#00f5d4); border-radius: 2px; margin: 16px 0; }
        .scm-tasks-label { font-size: 13px; color: #999; margin-bottom: 8px; align-self: flex-start; }
        .scm-task-list { list-style: none; padding: 0; margin: 0 0 16px; width: 100%; }
        .scm-task-list li { padding: 6px 0; font-size: 14px; color: #444; border-bottom: 1px solid #f0f0f0; }
        .scm-task-list li::before { content: '\2713'; color: #00b4d8; font-weight: 700; margin-right: 8px; }
        .scm-stats { display: flex; gap: 20px; font-size: 13px; color: #666; margin-bottom: 12px; }
        .scm-stats span { background: #f5f5f5; padding: 4px 12px; border-radius: 20px; }
        .scm-quote { font-size: 12px; color: #aaa; font-style: italic; margin-bottom: 8px; }
        .scm-companion { text-align: center; margin-bottom: 12px; }
        .scm-comp-speech { font-size: 11px; color: #bbb; font-style: italic; }
        .scm-footer { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 12px 0 0; border-top: 1px solid #f0f0f0; font-size: 11px; color: #bbb; }
        .scm-footer img { border-radius: 4px; background: #fff; }

        /* Highlight pulse on target element */
        .guide-highlight {
            position: relative;
            z-index: 9998 !important;
            animation: guidePulse 1.5s ease-in-out infinite !important;
        }
        @keyframes guidePulse {
            0%, 100% { box-shadow: 0 0 0 0 var(--primary-glow); }
            50% { box-shadow: 0 0 0 8px rgba(0,245,212,0); }
        }
        /* Dim background overlay for guide */
        .guide-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.4);
            z-index: 9997;
            pointer-events: none;
        }

        /* ============================================================
        Help Button
        ============================================================ */
        .help-btn {
            background: none; border: 1px solid var(--border-glow);
            color: var(--text-muted); width: 32px; height: 32px;
            border-radius: 50%; cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            font-size: 15px; transition: all 0.2s;
        }
        .help-btn:hover {
            border-color: var(--primary); color: var(--primary);
            box-shadow: 0 0 12px rgba(0,245,212,0.15);
        }

        /* ============================================================
        Enhanced Empty State
        ============================================================ */
        .empty-state-enhanced {
            text-align: center; padding: 40px 20px;
        }
        .empty-state-enhanced .empty-icon {
            font-size: 48px; margin-bottom: 16px; display: block;
        }
        .empty-state-enhanced h3 {
            font-size: 18px; margin: 0 0 8px; color: var(--text);
        }
        .empty-state-enhanced p {
            font-size: 14px; color: var(--text-muted); margin: 0 0 20px;
        }

        /* Light theme onboarding adjustments */
        [data-theme="light"] .onboarding-card {
            background: #fff;
            border-color: #e0e0e0;
            box-shadow: 0 20px 60px rgba(0,0,0,0.12);
        }
        [data-theme="light"] .onboarding-features .feature-item {
            background: #f8f9fa;
            border-color: #eee;
        }
        [data-theme="light"] .goal-priority-badge.high {
            background: rgba(255, 69, 58, 0.1);
        }
        [data-theme="light"] .goal-priority-badge.medium {
            background: rgba(255, 193, 7, 0.1);
        }

        /* Priority option selected highlight */
        .priority-option:has(input:checked) {
            border-color: var(--primary) !important;
            box-shadow: 0 0 12px rgba(0,245,212,0.15);
        }
        .priority-option input[value="medium"]:checked ~ span { color: #ffcc00 !important; }
        .priority-option:has(input[value="medium"]:checked) {
            border-color: #ffcc00 !important;
            box-shadow: 0 0 12px rgba(255,204,0,0.15);
        }
        .priority-option:has(input[value="high"]:checked) {
            border-color: #ff453a !important;
            box-shadow: 0 0 12px rgba(255,69,58,0.15);
        }
        .priority-option:hover {
            border-color: var(--text-muted);
            background: var(--bg-card);
        }

        /* ============================================================
           Footer
           ============================================================ */
        .site-footer {
            margin-top: 40px;
            padding: 32px 16px calc(24px + env(safe-area-inset-bottom, 0px));
            border: 1px solid var(--border-glow);
            border-radius: var(--radius-lg);
            background: var(--bg-card);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            text-align: center;
            color: var(--text-muted);
            font-size: 13px;
            line-height: 1.8;
        }
        .site-footer a {
            color: var(--text-secondary);
            text-decoration: none;
            transition: var(--transition);
        }
        .site-footer a:hover {
            color: var(--primary);
        }
        .footer-links {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 8px 20px;
            margin-bottom: 12px;
        }
        .footer-links a {
            font-size: 13px;
        }
        .footer-social {
            display: flex;
            justify-content: center;
            gap: 16px;
            margin-bottom: 14px;
        }
        .footer-social a {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background: var(--bg-card);
            color: var(--text-secondary);
            font-size: 16px;
            transition: var(--transition);
        }
        .footer-social a:hover {
            background: var(--primary-dim);
            color: var(--primary);
            transform: translateY(-2px);
        }
        .footer-copyright {
            opacity: 0.6;
            font-size: 12px;
        }
        .footer-copyright .heart {
            color: var(--secondary);
        }
        [data-theme="light"] .site-footer {
            border-top-color: var(--border);
        }
        [data-theme="light"] .footer-social a {
            background: var(--bg-elevated);
        }

        /* ============================================================
        Image Upload  鍥剧墖
        ============================================================ */
        .record-images {
            display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap;
        }
        .record-thumb {
            width: 56px; height: 56px; border-radius: 10px; object-fit: cover;
            cursor: pointer; transition: var(--transition); border: 2px solid transparent;
        }
        .record-thumb:hover {
            transform: scale(1.05); border-color: var(--primary);
            box-shadow: 0 2px 12px var(--primary-glow);
        }
        .btn-add-photo {
            display: inline-flex; align-items: center; gap: 4px;
            padding: 6px 14px; border: 1px dashed var(--text-muted);
            border-radius: 20px; background: transparent; color: var(--text-secondary);
            font-size: 12px; cursor: pointer; transition: var(--transition); font-family: inherit;
        }
        .btn-add-photo:hover {
            border-color: var(--primary); color: var(--primary);
            background: var(--primary-dim);
        }
        /* Lightbox */
        .lightbox-overlay {
            position: fixed; inset: 0; background: rgba(0,0,0,0.85);
            z-index: 10000; display: flex; align-items: center; justify-content: center;
            opacity: 0; visibility: hidden; transition: all 0.3s ease;
            cursor: zoom-out;
        }
        .lightbox-overlay.show {
            opacity: 1; visibility: visible;
        }
        .lightbox-overlay img {
            max-width: 90%; max-height: 85vh; border-radius: 12px;
            box-shadow: 0 8px 40px rgba(0,0,0,0.5);
            transform: scale(0.9); transition: transform 0.3s ease;
        }
        .lightbox-overlay.show img {
            transform: scale(1);
        }
        .lightbox-close {
            position: absolute; top: 20px; right: 20px;
            width: 40px; height: 40px; border-radius: 50%;
            background: rgba(255,255,255,0.15); border: none;
            color: white; font-size: 20px; cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            transition: var(--transition);
        }
        .lightbox-close:hover {
            background: rgba(255,255,255,0.3);
        }
        .goal-photo-badge {
            position: absolute; top: 6px; right: 6px;
            background: var(--primary-dim); color: var(--primary);
            font-size: 11px; padding: 2px 8px; border-radius: 12px;
            font-weight: 600;
        }
        .photo-btn {
            position: relative;
        }
        .btn-ach-share {
            margin-top: 8px; padding: 6px 16px; border: none;
            border-radius: 20px; background: var(--primary-dim); color: var(--primary);
            font-size: 12px; font-weight: 600; cursor: pointer;
            display: inline-flex; align-items: center; gap: 4px;
            transition: var(--transition); font-family: inherit;
        }
        .btn-ach-share:hover {
            background: var(--primary); color: white;
        }
        .leaderboard-list { display: flex; flex-direction: column; gap: 6px; }
        .lb-item {
            display: flex; align-items: center; gap: 10px;
            padding: 10px 14px; border-radius: 12px;
            background: var(--bg-elevated); transition: var(--transition);
        }
        .lb-item.is-me {
            background: var(--primary-dim); border: 1px solid var(--primary-glow);
        }
        .lb-rank {
            width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
            border-radius: 50%; font-size: 12px; font-weight: 700;
            background: var(--bg-secondary); color: var(--text-muted); flex-shrink: 0;
        }
        .lb-rank.top1 { background: linear-gradient(135deg,#ffd700,#ffaa00); color: #333; }
        .lb-rank.top2 { background: linear-gradient(135deg,#c0c0c0,#a0a0a0); color: #333; }
        .lb-rank.top3 { background: linear-gradient(135deg,#cd7f32,#b8860b); color: white; }
        .lb-name { flex: 1; font-size: 13px; font-weight: 500; color: var(--text-primary); }
        .lb-name.is-me { color: var(--primary); font-weight: 700; }
        .lb-score { font-size: 13px; font-weight: 600; color: var(--accent); }
        .lb-badge { font-size: 10px; }
        }
        .quote-card {
            background: var(--bg-card); border-radius: 16px;
            padding: 16px 20px; position: relative; overflow: hidden;
            border: 1px solid rgba(255,255,255,0.05);
            box-shadow: var(--shadow-sm);
        }
        .quote-card::before {
            content: ''; position: absolute; top: 0; left: 0;
            width: 4px; height: 100%;
            background: linear-gradient(180deg, var(--primary), var(--secondary));
            border-radius: 4px;
        }
        .quote-inner {
            position: relative; padding-left: 4px;
        }
        .btn-quote-refresh:hover {
            background: var(--primary-dim) !important;
            color: var(--primary) !important;
        }
            transform: translateY(-1px);
        }
        /* ============================================================
        Daily Check-in
        ============================================================ */
        .checkin-area {
            margin-top: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            flex-wrap: wrap;
        }
        .btn-checkin {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 10px 24px;
            border: none;
            border-radius: 50px;
            background: linear-gradient(135deg, var(--secondary), var(--secondary-glow));
            color: white;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: var(--transition);
            font-family: inherit;
            box-shadow: 0 2px 12px var(--secondary-glow);
        }
        .btn-checkin:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 20px var(--secondary-glow);
        }
        .btn-checkin:active {
            transform: scale(0.96);
        }
        .btn-checkin.checked {
            background: var(--bg-elevated);
            color: var(--text-muted);
            box-shadow: none;
            cursor: default;
            pointer-events: none;
        }
        .btn-checkin.checked:hover {
            transform: none;
        }
        .btn-checkin .checkin-pulse {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: #4ade80;
            animation: pulse-dot 2s infinite;
        }
        @keyframes pulse-dot {
            0%, 100% { opacity: 1; transform: scale(1); }
            50% { opacity: 0.6; transform: scale(1.3); }
        }
        .checkin-streak-display {
            display: flex;
            align-items: center;
            gap: 4px;
            font-size: 13px;
            color: var(--text-secondary);
        }
        .checkin-streak-display i {
            color: var(--accent);
        }
        .checkin-streak-display strong {
            color: var(--accent);
            font-size: 16px;
        }
        /* Check-in bonus popup */
        .checkin-bonus-toast {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%) scale(0);
            background: var(--bg-card);
            border-radius: 20px;
            padding: 32px 40px;
            text-align: center;
            z-index: 10001;
            box-shadow: 0 8px 40px rgba(0,0,0,0.3);
            border: 1px solid rgba(255,255,255,0.1);
            backdrop-filter: blur(20px);
            opacity: 0;
            transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
        }
        .checkin-bonus-toast.show {
            opacity: 1;
            transform: translate(-50%, -50%) scale(1);
        }
        .checkin-bonus-toast .bonus-emoji {
            font-size: 64px;
            margin-bottom: 8px;
            display: block;
        }
        .checkin-bonus-toast .bonus-title {
            font-size: 20px;
            font-weight: 700;
            color: var(--text-primary);
        }
        .checkin-bonus-toast .bonus-desc {
            font-size: 14px;
            color: var(--text-secondary);
            margin-top: 4px;
        }
        .checkin-bonus-toast .bonus-btn {
            margin-top: 16px;
            padding: 10px 32px;
            border: none;
            border-radius: 50px;
            background: var(--primary);
            color: white;
            font-weight: 600;
            cursor: pointer;
            font-family: inherit;
        }

        /* ============================================================
        Bottom Sheet ?瀹屾垚鐩爣鍚庢搷浣滈€夋嫨
        ============================================================ */
        .bottom-sheet-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.5);
            z-index: 9000;
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s ease;
        }
        .bottom-sheet-overlay.show {
            opacity: 1;
            visibility: visible;
        }
        .bottom-sheet {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background: var(--bg-card);
            border-radius: 24px 24px 0 0;
            padding: 20px 24px 32px;
            z-index: 9001;
            transform: translateY(100%);
            transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border-top: 1px solid rgba(255,255,255,0.08);
        }
        .bottom-sheet-overlay.show .bottom-sheet {
            transform: translateY(0);
        }
        .bs-handle {
            width: 40px;
            height: 4px;
            background: var(--text-muted);
            border-radius: 4px;
            margin: 0 auto 16px;
            opacity: 0.4;
        }
        .bs-header {
            text-align: center;
            margin-bottom: 24px;
        }
        .bs-emoji {
            font-size: 48px;
            margin-bottom: 8px;
            display: block;
        }
        .bs-title {
            font-size: 20px;
            font-weight: 700;
            color: var(--text-primary);
            margin-bottom: 4px;
        }
        .bs-subtitle {
            font-size: 14px;
            color: var(--text-secondary);
            opacity: 0.8;
        }
        .bs-actions {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }
        .bs-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            padding: 16px;
            border: none;
            border-radius: 16px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: var(--transition);
            font-family: inherit;
        }
        .bs-btn:hover {
            transform: translateY(-1px);
        }
        .bs-btn:active {
            transform: scale(0.98);
        }
        .bs-btn-poster {
            background: linear-gradient(135deg, var(--primary), var(--primary-dark));
            color: white;
        }
        .bs-btn-poster:hover {
            box-shadow: 0 4px 16px var(--primary-glow);
        }
        .bs-btn-share {
            background: var(--bg-elevated);
            color: var(--text-primary);
        }
        .bs-btn-share:hover {
            background: var(--primary-dim);
            color: var(--primary);
        }
        .bs-btn-close {
            background: transparent;
            color: var(--text-muted);
            font-size: 14px;
            font-weight: 400;
        }
        .bs-btn-close:hover {
            color: var(--text-secondary);
        }

/* Sponsor badges */
.sponsor-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    background: var(--bg-card);
    border: 1px solid var(--border-glow);
}
.sponsor-badge[data-tier="gold"] {
    background: linear-gradient(135deg, rgba(255,215,0,0.15), rgba(255,215,0,0.05));
    border-color: rgba(255,215,0,0.4);
    color: #ffd700;
}
.sponsor-badge[data-tier="silver"] {
    background: linear-gradient(135deg, rgba(192,192,192,0.15), rgba(192,192,192,0.05));
    border-color: rgba(192,192,192,0.4);
    color: #c0c0c0;
}
.sponsor-badge[data-tier="bronze"] {
    background: linear-gradient(135deg, rgba(205,127,50,0.15), rgba(205,127,50,0.05));
    border-color: rgba(205,127,50,0.4);
    color: #cd7f32;
}

/* Donation tier cards */
.donation-tier {
    flex: 1;
    padding: 10px 4px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-glow);
    background: var(--bg-card);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}
.donation-tier:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}
.donation-tier.active {
    border-color: var(--accent);
    background: var(--accent-dim);
}
.donation-tier-emoji { font-size: 22px; margin-bottom: 2px; }
.donation-tier-price { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.donation-tier-label { font-size: 11px; color: var(--text-muted); }

/* ================================================================
   GSAP Animation Enhancements
   ================================================================ */

/* Floating ambient particles in header */
.ambient-particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    will-change: transform, opacity;
    z-index: 0;
}

/* GSAP-powered confetti */
.gsap-confetti-piece {
    position: fixed;
    pointer-events: none;
    z-index: 9997;
    will-change: transform, opacity;
}

/* Shell trail particles */
.shell-trail-particle {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    will-change: transform, opacity;
}

/* Card tilt perspective wrapper */
.goal-card {
    transform-style: preserve-3d;
    perspective: 800px;
}

/* Toast - let the original CSS transitions handle it */

/* XP bar glow on update */
.xp-bar-fill.glow {
    box-shadow: 0 0 16px var(--secondary-glow), 0 0 32px var(--secondary-glow);
    transition: box-shadow 0.3s ease;
}

/* Counter rolling digit (GSAP version) */
.shell-count-digit {
    display: inline-block;
    will-change: transform;
}

/* ================================================================
   Reduced Motion - Accessibility
   ================================================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .ambient-particle,
    .gsap-confetti-piece,
    .shell-trail-particle {
        display: none !important;
    }
    .goal-card:hover {
        transform: none !important;
    }
    .shell-count.pop {
        animation: none !important;
    }
    .skeleton-loader {
        animation: none !important;
    }
    .progress-bar-fill {
        animation: none !important;
    }
    .progress-bar-fill::after {
        animation: none !important;
    }
    .confetti-piece {
        display: none !important;
    }
}
