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

        :root {
            --primary: #6366f1;
            --primary-dark: #4f46e5;
            --primary-light: #a5b4fc;
            --success: #10b981;
            --success-light: #d1fae5;
            --warning: #f59e0b;
            --danger: #ef4444;
            --gray-50: #f9fafb;
            --gray-100: #f3f4f6;
            --gray-200: #e5e7eb;
            --gray-300: #d1d5db;
            --gray-400: #9ca3af;
            --gray-500: #6b7280;
            --gray-600: #4b5563;
            --gray-700: #374151;
            --gray-800: #1f2937;
            --gray-900: #111827;
            --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
            --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
            --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
            --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
            --radius: 12px;
            --radius-sm: 8px;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            color: var(--gray-800);
            line-height: 1.5;
        }

        .app-container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 20px;
            min-height: 100vh;
        }

        header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 20px 0;
            color: white;
            gap: 12px;
            position: relative;
        }

        .header-brand {
            display: flex;
            align-items: center;
            gap: 16px;
            min-width: 0;
        }

        .header-logo {
            width: 70px;
            height: 70px;
            flex-shrink: 0;
        }

        .header-text {
            text-align: left;
            min-width: 0;
        }

        header h1 {
            font-size: 2rem;
            font-weight: 700;
            margin-bottom: 2px;
            text-shadow: 0 2px 4px rgba(0,0,0,0.1);
            white-space: nowrap;
        }

        header p {
            font-size: 0.95rem;
            opacity: 0.9;
            white-space: nowrap;
        }

        /* Larger header for landing page only */
        .app-container:has(.landing-section.visible) .header-logo {
            width: 70px;
            height: 70px;
        }

        .app-container:has(.landing-section.visible) header h1 {
            font-size: 2rem;
        }

        .app-container:has(.landing-section.visible) header p {
            font-size: 1.1rem;
        }

        .header-right {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-shrink: 0;
        }

        .invite-friend-link {
            color: white;
            text-decoration: none;
            font-size: 0.85rem;
            font-weight: 600;
            padding: 8px 16px;
            background: rgba(255,255,255,0.15);
            border-radius: 20px;
            transition: all 0.2s;
            backdrop-filter: blur(10px);
        }

        .invite-friend-link:hover {
            background: rgba(255,255,255,0.25);
            transform: translateY(-1px);
        }

        .invite-friend-link.copied {
            background: rgba(16, 185, 129, 0.4);
        }

        /* Notification Bell */
        .notification-bell {
            position: relative;
            cursor: pointer;
            font-size: 1.3rem;
            padding: 6px 10px;
            background: rgba(255,255,255,0.15);
            border-radius: 50%;
            transition: all 0.2s;
            line-height: 1;
        }

        .notification-bell:hover {
            background: rgba(255,255,255,0.25);
            transform: translateY(-1px);
        }

        .notification-badge {
            position: absolute;
            top: -4px;
            right: -4px;
            background: #ef4444;
            color: white;
            font-size: 0.65rem;
            font-weight: 700;
            min-width: 18px;
            height: 18px;
            border-radius: 9px;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0 4px;
            line-height: 1;
        }

        /* Notification Panel */
        .notification-panel {
            position: absolute;
            top: 100%;
            right: 0;
            width: 340px;
            max-height: 400px;
            overflow-y: auto;
            background: rgba(30, 30, 50, 0.95);
            backdrop-filter: blur(20px);
            border-radius: 12px;
            box-shadow: 0 8px 32px rgba(0,0,0,0.3);
            z-index: 900;
            border: 1px solid rgba(255,255,255,0.1);
        }

        .notification-panel-header {
            padding: 14px 16px 10px;
            border-bottom: 1px solid rgba(255,255,255,0.1);
        }

        .notification-panel-header h4 {
            margin: 0;
            font-size: 1rem;
            font-weight: 700;
            color: white;
        }

        .notification-list {
            padding: 8px;
        }

        .notification-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px;
            border-radius: 8px;
            transition: background 0.2s;
        }

        .notification-item:hover {
            background: rgba(255,255,255,0.05);
        }

        .notification-item-emoji {
            font-size: 1.5rem;
            flex-shrink: 0;
        }

        .notification-item-content {
            flex: 1;
            min-width: 0;
        }

        .notification-item-title {
            font-weight: 600;
            font-size: 0.9rem;
            color: white;
        }

        .notification-item-subtitle {
            font-size: 0.8rem;
            color: rgba(255,255,255,0.6);
            margin-top: 2px;
        }

        .notification-item-actions {
            display: flex;
            gap: 6px;
            margin-top: 8px;
        }

        .btn-notif-accept {
            padding: 5px 14px;
            background: var(--success);
            color: white;
            border: none;
            border-radius: 6px;
            font-weight: 600;
            font-size: 0.8rem;
            cursor: pointer;
            transition: all 0.2s;
        }

        .btn-notif-accept:hover {
            background: #059669;
        }

        .btn-notif-decline {
            padding: 5px 14px;
            background: transparent;
            color: rgba(255,255,255,0.5);
            border: 1px solid rgba(255,255,255,0.2);
            border-radius: 6px;
            font-weight: 500;
            font-size: 0.8rem;
            cursor: pointer;
            transition: all 0.2s;
        }

        .btn-notif-decline:hover {
            background: rgba(239,68,68,0.15);
            color: #ef4444;
            border-color: #ef4444;
        }

        .notification-empty {
            padding: 24px 16px;
            text-align: center;
            color: rgba(255,255,255,0.5);
            font-size: 0.9rem;
        }
        .notification-item-clickable {
            cursor: pointer;
        }
        .notification-item-clickable:hover {
            background: rgba(255,255,255,0.08);
        }
        .notification-item-preview {
            font-size: 0.8rem;
            color: rgba(255,255,255,0.45);
            margin-top: 4px;
            line-height: 1.4;
            font-style: italic;
        }

        body.light-theme .notification-panel {
            background: rgba(255, 255, 255, 0.95);
            border-color: rgba(0,0,0,0.1);
            box-shadow: 0 8px 32px rgba(0,0,0,0.15);
        }

        body.light-theme .notification-panel-header {
            border-color: rgba(0,0,0,0.1);
        }

        body.light-theme .notification-panel-header h4 {
            color: #1f2937;
        }

        body.light-theme .notification-item-title {
            color: #1f2937;
        }

        body.light-theme .notification-item-subtitle {
            color: #6b7280;
        }

        body.light-theme .btn-notif-decline {
            color: #6b7280;
            border-color: rgba(0,0,0,0.2);
        }

        body.light-theme .notification-empty {
            color: #6b7280;
        }
        body.light-theme .notification-item-preview {
            color: #9ca3af;
        }
        body.light-theme .notification-item-clickable:hover {
            background: rgba(0,0,0,0.05);
        }

        /* Recent Notifications Section */
        .notification-section-divider {
            height: 1px;
            background: rgba(255,255,255,0.1);
            margin: 4px 12px;
        }
        .notification-section-header {
            padding: 8px 16px 4px;
            font-size: 0.75rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: rgba(255,255,255,0.4);
        }
        .notification-item-recent {
            opacity: 0.6;
        }
        .notification-item-recent .notification-item-title {
            font-weight: 500;
        }
        .notification-item-recent .notification-item-subtitle {
            font-size: 0.75rem;
        }
        body.light-theme .notification-section-divider {
            background: rgba(0,0,0,0.1);
        }
        body.light-theme .notification-section-header {
            color: #9ca3af;
        }

        @media (max-width: 480px) {
            .notification-panel {
                width: calc(100vw - 24px);
                right: -60px;
            }
        }

        .user-info {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 16px;
            margin-top: 0;
        }

        .user-info span {
            background: rgba(255,255,255,0.2);
            padding: 6px 16px;
            border-radius: 20px;
            font-size: 0.9rem;
            cursor: pointer;
            transition: all 0.2s;
        }

        .user-info span:hover {
            background: rgba(255,255,255,0.3);
        }

        .user-info button {
            background: rgba(255,255,255,0.2);
            border: none;
            color: white;
            padding: 6px 16px;
            border-radius: 20px;
            cursor: pointer;
            font-size: 0.9rem;
            transition: all 0.2s;
        }

        .user-info button:hover {
            background: rgba(255,255,255,0.3);
        }

        /* Bottom Navigation Dock */
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            z-index: 900;
            display: flex;
            justify-content: center;
            padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
            background: rgba(30, 27, 75, 0.85);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border-top: 1px solid rgba(255, 255, 255, 0.1);
        }

        .bottom-nav-inner {
            display: flex;
            gap: 4px;
            background: rgba(255, 255, 255, 0.1);
            padding: 6px 8px;
            border-radius: 20px;
            max-width: 500px;
            width: 100%;
            justify-content: space-around;
        }

        .nav-btn {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 2px;
            padding: 8px 12px;
            border: none;
            background: transparent;
            color: rgba(255, 255, 255, 0.6);
            font-size: 0.65rem;
            font-weight: 500;
            cursor: pointer;
            border-radius: 14px;
            transition: all 0.25s ease;
            min-width: 56px;
        }

        .nav-btn-icon {
            font-size: 1.4rem;
            line-height: 1;
            transition: transform 0.25s ease;
        }

        .nav-btn:hover {
            color: rgba(255, 255, 255, 0.9);
            background: rgba(255, 255, 255, 0.1);
        }

        .nav-btn:hover .nav-btn-icon {
            transform: scale(1.15) translateY(-2px);
        }

        .nav-btn.active {
            color: white;
            background: rgba(255, 255, 255, 0.2);
        }

        .nav-btn.active .nav-btn-icon {
            transform: scale(1.2) translateY(-2px);
        }

        /* Add Habit Inline Section */
        .add-habit-toggle-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            width: 100%;
            padding: 16px 24px;
            margin-top: 20px;
            border: 2px dashed rgba(99, 102, 241, 0.4);
            border-radius: var(--radius);
            background: rgba(99, 102, 241, 0.05);
            color: var(--primary);
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
        }

        .add-habit-toggle-btn:hover {
            background: rgba(99, 102, 241, 0.1);
            border-color: var(--primary);
            transform: translateY(-1px);
            box-shadow: var(--shadow-md);
        }

        .add-habit-section {
            display: none;
            margin-top: 20px;
            animation: fadeIn 0.3s ease;
        }

        .add-habit-section.visible {
            display: block;
        }

        .tab-content {
            display: none;
        }

        .tab-content.active {
            display: block;
            animation: fadeIn 0.3s ease;
        }

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

        .card {
            background: white;
            border-radius: var(--radius);
            padding: 24px;
            box-shadow: var(--shadow-lg);
            margin-bottom: 20px;
        }

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

        .card-title {
            font-size: 1.25rem;
            font-weight: 600;
            color: var(--gray-800);
        }

        /* Auth Styles */
        .auth-container {
            max-width: 400px;
            margin: 0 auto;
        }

        .auth-card {
            background: white;
            border-radius: var(--radius);
            padding: 32px;
            box-shadow: var(--shadow-lg);
        }

        .auth-logo {
            text-align: center;
            margin-bottom: 24px;
        }

        .auth-logo img {
            width: 100px;
            height: 100px;
            margin-bottom: 12px;
        }

        .auth-logo h1 {
            font-size: 1.5rem;
            font-weight: 700;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .auth-card h2 {
            text-align: center;
            margin-bottom: 24px;
            color: var(--gray-800);
            font-size: 1.1rem;
            font-weight: 500;
        }

        .auth-toggle {
            text-align: center;
            margin-top: 20px;
            color: var(--gray-600);
        }

        .auth-toggle a {
            color: var(--primary);
            cursor: pointer;
            text-decoration: none;
            font-weight: 500;
        }

        .auth-toggle a:hover {
            text-decoration: underline;
        }

        .auth-error {
            background: #fef2f2;
            color: var(--danger);
            padding: 12px;
            border-radius: var(--radius-sm);
            margin-bottom: 16px;
            font-size: 0.9rem;
        }

        /* Stats Grid */
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 16px;
            margin-bottom: 24px;
        }

        .stat-card {
            background: white;
            border-radius: var(--radius);
            padding: 20px;
            box-shadow: var(--shadow-md);
            text-align: center;
        }

        .stat-value {
            font-size: 2.5rem;
            font-weight: 700;
            color: var(--primary);
            line-height: 1.2;
        }

        .stat-label {
            color: var(--gray-500);
            font-size: 0.9rem;
            margin-top: 4px;
        }

        .stat-card.success .stat-value { color: var(--success); }
        .stat-card.warning .stat-value { color: var(--warning); }
        .stat-card.danger .stat-value { color: var(--danger); }

        /* Streaks Card Layout */
        .streaks-card {
            padding: 16px !important;
        }

        .streaks-layout {
            display: flex;
            align-items: center;
            gap: 16px;
        }

        .streaks-left {
            flex: 1;
            display: flex;
            flex-direction: column;
        }

        .streaks-list {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .streak-row {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 0.95rem;
            color: var(--warning);
        }

        .streaks-left .stat-label {
            margin-top: 8px;
        }

        .streaks-right {
            display: flex;
            align-items: center;
            justify-content: center;
        }

        /* Total Fire Circle */
        .total-fire-circle {
            width: 80px;
            height: 80px;
            border-radius: 50%;
            background: linear-gradient(135deg, #ff6b35, #f7931e, #ff4500);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4), 0 0 20px rgba(247, 147, 30, 0.3);
            animation: fireGlow 2s ease-in-out infinite alternate;
            flex-shrink: 0;
        }

        @keyframes fireGlow {
            from { box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4), 0 0 20px rgba(247, 147, 30, 0.3); }
            to { box-shadow: 0 4px 20px rgba(255, 107, 53, 0.6), 0 0 30px rgba(247, 147, 30, 0.5); }
        }

        .total-fire-value {
            font-size: 1.5rem;
            font-weight: 700;
            color: white;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
            line-height: 1;
        }

        .total-fire-label {
            font-size: 0.6rem;
            color: rgba(255, 255, 255, 0.9);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-top: 2px;
        }

        /* Form Styles */
        .form-group {
            display: flex;
            flex-direction: column;
            gap: 6px;
            margin-bottom: 16px;
        }

        .form-group label {
            font-weight: 500;
            color: var(--gray-700);
            font-size: 0.9rem;
        }

        .form-group input,
        .form-group textarea,
        .form-group select {
            padding: 12px 16px;
            border: 2px solid var(--gray-200);
            border-radius: var(--radius-sm);
            font-size: 1rem;
            transition: all 0.2s;
            font-family: inherit;
        }

        .form-group input:focus,
        .form-group textarea:focus,
        .form-group select:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px var(--primary-light);
        }

        .form-group textarea {
            resize: vertical;
            min-height: 80px;
        }

        .form-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 16px;
        }

        @media (max-width: 600px) {
            .form-row {
                grid-template-columns: 1fr;
            }
        }

        .target-inputs {
            display: flex;
            gap: 12px;
            align-items: center;
        }

        .target-inputs input {
            width: 80px;
        }

        .target-inputs span {
            color: var(--gray-500);
        }

        .btn {
            padding: 12px 24px;
            border: none;
            border-radius: var(--radius-sm);
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            width: 100%;
        }

        .btn-primary {
            background: var(--primary);
            color: white;
        }

        .btn-primary:hover {
            background: var(--primary-dark);
            transform: translateY(-1px);
            box-shadow: var(--shadow-md);
        }

        .btn-primary:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            transform: none;
        }

        .btn-success {
            background: var(--success);
            color: white;
        }

        .btn-danger {
            background: var(--danger);
            color: white;
        }

        .btn-outline {
            background: transparent;
            border: 2px solid var(--gray-300);
            color: var(--gray-600);
        }

        .btn-outline:hover {
            border-color: var(--gray-400);
            background: var(--gray-50);
        }

        .btn-sm {
            padding: 8px 16px;
            font-size: 0.875rem;
            width: auto;
        }

        .habit-stats {
            display: flex;
            gap: 24px;
            flex-wrap: wrap;
            margin-bottom: 16px;
        }

        .habit-stat {
            display: flex;
            flex-direction: column;
        }

        .habit-stat-value {
            font-size: 1.25rem;
            font-weight: 700;
            color: var(--gray-800);
        }

        .habit-stat-label {
            font-size: 0.75rem;
            color: var(--gray-500);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .habit-progress {
            margin-bottom: 16px;
        }

        .progress-header {
            display: flex;
            justify-content: space-between;
            margin-bottom: 8px;
            font-size: 0.875rem;
        }

        .progress-bar {
            height: 8px;
            background: var(--gray-200);
            border-radius: 4px;
            overflow: hidden;
        }

        .progress-fill {
            height: 100%;
            background: linear-gradient(90deg, var(--primary), var(--primary-light));
            border-radius: 4px;
            transition: width 0.3s ease;
        }

        .progress-fill.success {
            background: linear-gradient(90deg, var(--success), #34d399);
        }

        .monthly-progress-bar {
            position: relative;
            overflow: visible;
        }

        .monthly-progress-bar .progress-fill {
            position: relative;
            z-index: 0;
        }

        .month-week-divider {
            position: absolute;
            top: -2px;
            bottom: -2px;
            width: 2px;
            background: rgba(0, 0, 0, 0.2);
            z-index: 1;
            pointer-events: none;
            border-radius: 1px;
        }

        .month-today-marker {
            position: absolute;
            top: -3px;
            bottom: -3px;
            width: 2px;
            background: rgba(245, 195, 65, 0.9);
            z-index: 2;
            pointer-events: none;
            border-radius: 1px;
            box-shadow: 0 0 3px rgba(200, 155, 30, 0.5);
        }

        /* Timer Feature */
        .habit-timer-section {
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            gap: 12px;
            margin-top: 16px;
            padding: 12px 16px;
            background: linear-gradient(135deg, #667eea15, #764ba215);
            border-radius: var(--radius-sm);
            border: 1px solid #667eea30;
        }

        .timer-hourglass {
            width: 44px;
            height: 44px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            background: linear-gradient(135deg, #667eea, #764ba2);
            color: white;
            border: none;
            box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
        }

        .timer-hourglass:hover {
            transform: scale(1.1);
            box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
        }

        .timer-hourglass:active {
            transform: scale(0.95);
        }

        .timer-hourglass.running {
            animation: hourglassPulse 2s infinite;
        }

        @keyframes hourglassPulse {
            0%, 100% { box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3); }
            50% { box-shadow: 0 4px 20px rgba(102, 126, 234, 0.6), 0 0 0 8px rgba(102, 126, 234, 0.1); }
        }

        .timer-display {
            display: flex;
            flex-direction: column;
            flex: 1;
        }

        .timer-clock {
            font-size: 1.75rem;
            font-weight: 700;
            font-family: 'Courier New', monospace;
            color: var(--gray-800);
            letter-spacing: 2px;
        }

        .timer-label {
            font-size: 0.75rem;
            color: var(--gray-500);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .timer-status-center {
            display: flex;
            justify-content: center;
            align-items: center;
        }

        @media (max-width: 480px) {
            .timer-status-center {
                width: 100%;
                order: 10;
            }
        }

        .timer-status {
            padding: 6px 14px;
            border-radius: 20px;
            font-size: 0.75rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            white-space: nowrap;
            text-align: center;
        }

        .timer-status.initiate {
            background: rgba(255, 255, 255, 0.95);
            color: #374151;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        }

        .timer-status.apprentice {
            background: linear-gradient(135deg, #3b82f6, #1d4ed8);
            color: white;
            box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
        }

        .timer-status.padawan {
            background: linear-gradient(135deg, #10b981, #059669);
            color: white;
            box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
        }

        .timer-status.jedi-knight {
            background: linear-gradient(135deg, #8b5cf6, #6d28d9);
            color: white;
            box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
        }

        .timer-status.jedi-master {
            background: linear-gradient(135deg, #f59e0b, #d97706);
            color: white;
            box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
        }

        .timer-status.grand-master {
            background: linear-gradient(135deg, #fbbf24, #f59e0b);
            color: #1f2937;
            box-shadow: 0 2px 8px rgba(251, 191, 36, 0.5);
            animation: grandMasterPulse 1.5s infinite;
        }

        @keyframes grandMasterPulse {
            0%, 100% { box-shadow: 0 2px 8px rgba(251, 191, 36, 0.5); }
            50% { box-shadow: 0 2px 16px rgba(251, 191, 36, 0.8); }
        }

        /* Hourglass visual treatments by level */
        .timer-hourglass-container {
            position: relative;
            display: inline-block;
        }

        .timer-hourglass {
            position: relative;
            z-index: 2;
        }

        /* Initiate - subtle white glow */
        .timer-hourglass.level-initiate {
            box-shadow: 0 0 15px rgba(255, 255, 255, 0.6), 0 4px 12px rgba(102, 126, 234, 0.3);
        }

        /* Apprentice - blue lightsaber border */
        .timer-hourglass.level-apprentice {
            box-shadow: 0 0 20px rgba(59, 130, 246, 0.7), 0 0 40px rgba(59, 130, 246, 0.4), inset 0 0 10px rgba(59, 130, 246, 0.2);
            border: 2px solid #3b82f6;
        }

        /* Padawan - green lightsaber border + pulse */
        .timer-hourglass.level-padawan {
            box-shadow: 0 0 20px rgba(16, 185, 129, 0.7), 0 0 40px rgba(16, 185, 129, 0.4), inset 0 0 10px rgba(16, 185, 129, 0.2);
            border: 2px solid #10b981;
            animation: padawanPulse 2s infinite;
        }

        @keyframes padawanPulse {
            0%, 100% { box-shadow: 0 0 20px rgba(16, 185, 129, 0.7), 0 0 40px rgba(16, 185, 129, 0.4); }
            50% { box-shadow: 0 0 30px rgba(16, 185, 129, 0.9), 0 0 60px rgba(16, 185, 129, 0.6); }
        }

        /* Jedi Knight - purple lightsaber + crown */
        .timer-hourglass.level-jedi-knight {
            box-shadow: 0 0 25px rgba(139, 92, 246, 0.8), 0 0 50px rgba(139, 92, 246, 0.5), inset 0 0 15px rgba(139, 92, 246, 0.3);
            border: 3px solid #8b5cf6;
        }

        .timer-hourglass.level-jedi-knight::before {
            content: '👑';
            position: absolute;
            top: -12px;
            left: 50%;
            transform: translateX(-50%);
            font-size: 14px;
            z-index: 10;
        }

        /* Jedi Master - gold border + larger crown + shimmer */
        .timer-hourglass.level-jedi-master {
            box-shadow: 0 0 30px rgba(245, 158, 11, 0.8), 0 0 60px rgba(245, 158, 11, 0.5), inset 0 0 15px rgba(245, 158, 11, 0.3);
            border: 3px solid #f59e0b;
            animation: masterShimmer 2s infinite;
        }

        .timer-hourglass.level-jedi-master::before {
            content: '👑';
            position: absolute;
            top: -14px;
            left: 50%;
            transform: translateX(-50%);
            font-size: 18px;
            z-index: 10;
        }

        @keyframes masterShimmer {
            0%, 100% { box-shadow: 0 0 30px rgba(245, 158, 11, 0.8), 0 0 60px rgba(245, 158, 11, 0.5); }
            50% { box-shadow: 0 0 40px rgba(245, 158, 11, 1), 0 0 80px rgba(245, 158, 11, 0.7); }
        }

        /* Grand Master - gold + crown + cape + intense aura */
        .timer-hourglass.level-grand-master {
            box-shadow: 0 0 40px rgba(251, 191, 36, 1), 0 0 80px rgba(251, 191, 36, 0.7), 0 0 120px rgba(251, 191, 36, 0.4), inset 0 0 20px rgba(251, 191, 36, 0.4);
            border: 4px solid #fbbf24;
            animation: grandMasterAura 1.5s infinite;
        }

        .timer-hourglass.level-grand-master::before {
            content: '👑';
            position: absolute;
            top: -16px;
            left: 50%;
            transform: translateX(-50%);
            font-size: 22px;
            z-index: 10;
            filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.8));
        }

        .timer-hourglass.level-grand-master::after {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 70px;
            height: 70px;
            border-radius: 50%;
            background: radial-gradient(circle, rgba(251, 191, 36, 0.3) 0%, transparent 70%);
            z-index: -1;
            animation: capeFlow 2s infinite;
        }

        @keyframes grandMasterAura {
            0%, 100% { box-shadow: 0 0 40px rgba(251, 191, 36, 1), 0 0 80px rgba(251, 191, 36, 0.7), 0 0 120px rgba(251, 191, 36, 0.4); }
            50% { box-shadow: 0 0 50px rgba(251, 191, 36, 1), 0 0 100px rgba(251, 191, 36, 0.8), 0 0 150px rgba(251, 191, 36, 0.5); }
        }

        @keyframes capeFlow {
            0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
            50% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
        }

        /* Discard button */
        .timer-discard-btn {
            padding: 8px 12px;
            border-radius: 20px;
            border: none;
            font-size: 0.8rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            background: linear-gradient(135deg, #ef4444, #dc2626);
            color: white;
            box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
        }

        .timer-discard-btn:hover {
            box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
            transform: translateY(-1px);
        }

        .timer-buttons {
            display: flex;
            gap: 8px;
            align-items: center;
        }

        /* Start/Pause Button */
        .timer-start-btn {
            padding: 8px 16px;
            border-radius: 20px;
            border: none;
            font-size: 0.85rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .timer-start-btn.start {
            background: linear-gradient(135deg, #10b981, #059669);
            color: white;
            box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
        }

        .timer-start-btn.start:hover {
            box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
            transform: translateY(-1px);
        }

        .timer-start-btn.pause {
            background: linear-gradient(135deg, #f59e0b, #d97706);
            color: white;
            box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
        }

        .timer-start-btn.pause:hover {
            box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
            transform: translateY(-1px);
        }

        /* Editable Timer Clock */
        .timer-clock {
            cursor: pointer;
            padding: 2px 6px;
            border-radius: 4px;
            transition: background 0.2s;
        }

        .timer-clock:hover {
            background: rgba(102, 126, 234, 0.1);
        }

        .timer-clock-input {
            font-size: 1.75rem;
            font-weight: 700;
            font-family: 'Courier New', monospace;
            color: var(--gray-800);
            letter-spacing: 2px;
            border: 2px solid #667eea;
            border-radius: 4px;
            padding: 2px 6px;
            width: 100px;
            text-align: center;
            outline: none;
        }

        /* Timer Day Label */
        .timer-day-label {
            font-size: 0.7rem;
            color: #667eea;
            font-weight: 600;
            text-transform: uppercase;
            margin-left: 4px;
        }

        /* Selected Day in Week View */
        .week-day.selected {
            border: 3px solid #667eea !important;
            box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
        }

        /* Timer checkbox in forms */
        .timer-toggle {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px 16px;
            background: linear-gradient(135deg, #667eea10, #764ba210);
            border-radius: var(--radius-sm);
            border: 1px solid #667eea20;
            cursor: pointer;
            transition: all 0.2s;
        }

        .timer-toggle:hover {
            border-color: #667eea40;
            background: linear-gradient(135deg, #667eea15, #764ba215);
        }

        .timer-toggle input[type="checkbox"] {
            width: 20px;
            height: 20px;
            accent-color: #667eea;
        }

        .timer-toggle-label {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }

        .timer-toggle-title {
            font-weight: 600;
            color: var(--gray-700);
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .timer-toggle-desc {
            font-size: 0.8rem;
            color: var(--gray-500);
        }

        .streak-wheel-section {
            display: flex;
            align-items: center;
            gap: 16px;
            padding: 12px 16px;
            background: linear-gradient(135deg, #667eea10, #764ba210);
            border-radius: var(--radius-sm);
            border: 1px solid #667eea20;
        }

        .streak-wheel-label {
            display: flex;
            flex-direction: column;
            gap: 2px;
            flex: 1;
        }

        .streak-wheel-control {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-shrink: 0;
        }

        .streak-wheel {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 0;
            user-select: none;
            touch-action: none;
        }

        .streak-wheel-arrow {
            width: 48px;
            height: 24px;
            border: none;
            background: transparent;
            color: var(--gray-400);
            font-size: 0.7rem;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: color 0.15s;
            padding: 0;
        }

        .streak-wheel-arrow:hover {
            color: #667eea;
        }

        .streak-wheel-arrow:active {
            color: #4f46e5;
        }

        .streak-wheel-window {
            width: 48px;
            height: 40px;
            border: 2px solid var(--gray-200);
            border-radius: var(--radius-sm);
            background: white;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            position: relative;
            box-shadow: inset 0 2px 6px rgba(0,0,0,0.06);
        }

        .streak-wheel-value {
            font-size: 1.3rem;
            font-weight: 700;
            color: #4f46e5;
            line-height: 1;
        }

        .streak-wheel-value.wheel-up {
            animation: wheelScrollUp 0.15s ease-out;
        }

        .streak-wheel-value.wheel-down {
            animation: wheelScrollDown 0.15s ease-out;
        }

        @keyframes wheelScrollUp {
            0% { transform: translateY(100%); opacity: 0.3; }
            100% { transform: translateY(0); opacity: 1; }
        }

        @keyframes wheelScrollDown {
            0% { transform: translateY(-100%); opacity: 0.3; }
            100% { transform: translateY(0); opacity: 1; }
        }

        .streak-wheel-unit {
            color: var(--gray-500);
            font-size: 0.85rem;
        }

        .check-btn {
            width: 100%;
            padding: 14px;
            background: var(--gray-100);
            border: 2px dashed var(--gray-300);
            border-radius: var(--radius-sm);
            color: var(--gray-600);
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
        }

        .check-btn:hover {
            background: var(--primary-light);
            border-color: var(--primary);
            color: var(--primary-dark);
        }

        .check-btn.checked {
            background: var(--success);
            border: 2px solid var(--success);
            color: white;
        }

        .check-btn.checked:hover {
            background: #059669;
        }

        /* Week View */
        .week-view {
            display: grid;
            grid-template-columns: repeat(7, minmax(40px, 1fr));
            gap: 6px;
            margin-top: 16px;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
        }

        .week-day {
            text-align: center;
            padding: 8px 4px;
            background: var(--gray-50);
            border-radius: var(--radius-sm);
            cursor: pointer;
            transition: all 0.2s;
            border: 2px solid transparent;
            min-width: 40px;
            flex-shrink: 0;
        }

        .week-day:hover {
            background: var(--gray-100);
            transform: scale(1.05);
        }

        .week-day-name {
            font-size: 0.75rem;
            color: var(--gray-500);
            text-transform: uppercase;
            margin-bottom: 4px;
        }

        .week-day-date {
            font-size: 1rem;
            font-weight: 600;
            color: var(--gray-700);
        }

        .week-day.completed {
            /* Background applied inline based on habit color */
        }

        .week-day.completed:hover {
            filter: brightness(0.95);
        }

        .week-day.completed .week-day-date {
            /* Color applied inline based on habit color */
        }

        .week-day.today {
            border: 2px solid var(--primary);
        }

        /* Calendar */
        .calendar-grid {
            display: grid;
            grid-template-columns: repeat(7, minmax(0, 1fr));
            gap: 4px;
            width: 100%;
            overflow: hidden;
        }

        .calendar-day-header {
            text-align: center;
            font-weight: 600;
            color: var(--gray-500);
            font-size: 0.65rem;
            padding: 4px 2px;
            text-transform: uppercase;
            overflow: hidden;
        }

        .calendar-day {
            aspect-ratio: 1;
            min-height: 0;
            padding: 4px;
            border-radius: var(--radius-sm);
            font-size: 0.9rem;
            cursor: pointer;
            transition: all 0.2s;
            position: relative;
            background: var(--gray-50);
            border: 2px solid transparent;
            overflow: hidden;
        }

        .calendar-day:hover {
            border-color: var(--primary);
            background: white;
            box-shadow: var(--shadow-md);
        }

        .calendar-day.other-month {
            opacity: 0.4;
            background: transparent;
        }

        .calendar-day.today {
            border: 2px solid var(--primary);
            background: white;
        }

        .calendar-day.future {
            opacity: 0.5;
            cursor: default;
        }

        .calendar-day.future:hover {
            border-color: transparent;
            box-shadow: none;
        }

        .calendar-day-number {
            font-weight: 600;
            color: var(--gray-700);
            margin-bottom: 4px;
            position: relative;
            z-index: 1;
            text-align: center;
            display: block;
            margin-top: 20px;
        }

        .calendar-day.today .calendar-day-number {
            color: var(--primary);
        }

        /* Per-habit calendar modal */
        #habitCalendarModal .calendar-day {
            cursor: pointer;
        }
        #habitCalendarModal .calendar-day.completed {
            background: var(--habit-color);
            border-color: var(--habit-color);
        }
        #habitCalendarModal .calendar-day.completed .calendar-day-number {
            color: white;
            font-weight: 700;
        }
        #habitCalendarModal .calendar-day.completed.today {
            border: 2px solid var(--gray-800);
        }
        #habitCalendarModal .calendar-day:not(.future):not(.other-month):hover {
            border-color: var(--habit-color);
        }
        #habitCalendarModal .calendar-day.future,
        #habitCalendarModal .calendar-day.other-month {
            cursor: default;
        }
        #habitCalendarModal .calendar-day-number {
            margin-top: 6px;
            margin-bottom: 0;
        }

        /* Detail modal inline calendar (mirrors #habitCalendarModal styles) */
        #habitDetailModal .calendar-day {
            cursor: pointer;
        }
        #habitDetailModal .calendar-day.completed {
            background: var(--habit-color);
            border-color: var(--habit-color);
        }
        #habitDetailModal .calendar-day.completed .calendar-day-number {
            color: white;
            font-weight: 700;
        }
        #habitDetailModal .calendar-day.completed.today {
            border: 2px solid var(--gray-800);
        }
        #habitDetailModal .calendar-day:not(.future):not(.other-month):hover {
            border-color: var(--habit-color);
        }
        #habitDetailModal .calendar-day.future,
        #habitDetailModal .calendar-day.other-month {
            cursor: default;
        }
        #habitDetailModal .calendar-day-number {
            margin-top: 6px;
            margin-bottom: 0;
        }


        /* Community */
        .community-user {
            background: rgba(255,255,255,0.95);
            border-radius: var(--radius);
            padding: 20px;
            box-shadow: var(--shadow-lg);
            margin-bottom: 20px;
        }

        .community-user-header {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 20px;
            padding-bottom: 16px;
            border-bottom: 1px solid var(--gray-200);
        }

        .community-avatar {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.25rem;
            font-weight: 700;
            box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
        }

        .community-user-name {
            font-size: 1.1rem;
            font-weight: 600;
            color: var(--gray-800);
        }

        .community-user-info {
            display: flex;
            flex-direction: column;
        }

        .community-lifetime {
            font-size: 0.8rem;
            color: var(--gray-500);
        }

        .community-circles-row {
            display: flex;
            gap: 16px;
            overflow-x: auto;
            padding: 8px 0;
            -webkit-overflow-scrolling: touch;
        }

        .community-habit-circle {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
            flex-shrink: 0;
        }

        .community-circle {
            width: 70px;
            height: 70px;
            border-radius: 50%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            border: 3px solid;
            position: relative;
            overflow: hidden;
        }

        .community-circle.completed {
            box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        }

        .community-circle .symbol {
            font-size: 1.5rem;
            z-index: 1;
        }

        .community-circle .streak {
            font-size: 0.65rem;
            font-weight: 700;
            z-index: 1;
        }

        .community-habit-name {
            font-size: 0.7rem;
            font-weight: 600;
            color: var(--gray-600);
            text-align: center;
            max-width: 80px;
            line-height: 1.2;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .community-habit-percent {
            font-size: 0.75rem;
            font-weight: 700;
            color: var(--gray-700);
        }

        .community-empty {
            text-align: center;
            padding: 40px 20px;
            color: white;
        }

        .community-empty-icon {
            font-size: 3rem;
            margin-bottom: 12px;
            opacity: 0.8;
        }

        .community-empty h3 {
            font-size: 1.25rem;
            margin-bottom: 8px;
        }

        .community-empty p {
            opacity: 0.8;
        }

        /* Legacy - keep for compatibility */
        .community-stats {
            display: none;
        }

        .community-habit-stat {
            display: grid;
            grid-template-columns: 30px 1fr auto auto;
            align-items: center;
            gap: 8px;
            padding: 8px 12px;
            background: var(--gray-50);
            border-radius: var(--radius-sm);
        }

        .community-habit-symbol {
            font-size: 1.2rem;
        }

        .community-habit-name {
            font-weight: 500;
            color: var(--gray-700);
        }

        .community-habit-streak {
            font-weight: 600;
            color: var(--warning);
            min-width: 50px;
            text-align: right;
        }

        .community-habit-percent {
            font-weight: 600;
            color: var(--primary);
            min-width: 45px;
            text-align: right;
        }

        /* Community Sub-tabs */
        .community-subtabs {
            display: flex;
            gap: 8px;
            margin-bottom: 20px;
            background: rgba(255, 255, 255, 0.1);
            padding: 6px;
            border-radius: 12px;
        }

        .community-subtab {
            flex: 1;
            padding: 10px 16px;
            border: none;
            background: transparent;
            color: rgba(255, 255, 255, 0.7);
            font-size: 0.9rem;
            font-weight: 500;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .community-subtab:hover {
            color: white;
            background: rgba(255, 255, 255, 0.1);
        }

        .community-subtab.active {
            background: white;
            color: var(--primary);
            box-shadow: var(--shadow-sm);
        }

        /* 4-tab: tighten padding on mobile */
        @media (max-width: 480px) {
            .community-subtab {
                padding: 8px 4px;
                font-size: 0.8rem;
            }
        }

        /* Community Garden */
        .community-garden-user {
            background: rgba(255, 255, 255, 0.08);
            border-radius: 12px;
            padding: 16px;
            margin-bottom: 16px;
        }

        .community-garden-user-header {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 12px;
        }

        .community-garden-user-name {
            color: white;
            font-weight: 600;
            font-size: 1rem;
        }

        .community-garden-plants {
            display: flex;
            gap: 10px;
            overflow-x: auto;
            padding-bottom: 4px;
            -webkit-overflow-scrolling: touch;
        }

        .community-garden-plants::-webkit-scrollbar {
            height: 4px;
        }

        .community-garden-plants::-webkit-scrollbar-thumb {
            background: rgba(255, 255, 255, 0.2);
            border-radius: 2px;
        }

        .community-mini-plant {
            flex: 0 0 80px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 10px;
            padding: 10px 6px;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
            cursor: pointer;
            transition: background 0.2s ease;
        }

        .community-mini-plant:hover {
            background: rgba(255, 255, 255, 0.18);
        }

        .mini-plant-symbol {
            font-size: 1.4rem;
        }

        .mini-plant-stage {
            font-size: 1.1rem;
        }

        .mini-plant-health {
            color: rgba(255, 255, 255, 0.8);
            font-size: 0.75rem;
            font-weight: 600;
        }

        .mini-plant-name {
            color: rgba(255, 255, 255, 0.6);
            font-size: 0.7rem;
            text-align: center;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: 72px;
        }

        .community-garden-empty-text {
            color: rgba(255, 255, 255, 0.4);
            font-size: 0.85rem;
            padding: 8px 0;
        }

        /* Community Sections */
        .community-section {
            margin-bottom: 24px;
        }

        .community-section-title {
            color: white;
            font-size: 1.25rem;
            margin-bottom: 16px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        /* App-Wide Stats */
        .app-wide-stats {
            display: flex;
            justify-content: space-around;
            align-items: center;
            background: rgba(255, 255, 255, 0.12);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border-radius: var(--radius);
            padding: 14px 12px;
            margin-bottom: 16px;
            gap: 8px;
        }

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

        .app-wide-stat-value {
            font-size: 1.3rem;
            font-weight: 700;
            color: #fff;
            white-space: nowrap;
        }

        .app-wide-stat-label {
            font-size: 0.7rem;
            font-weight: 600;
            color: rgba(255, 255, 255, 0.7);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        body.light-theme .app-wide-stats {
            background: rgba(0, 0, 0, 0.06);
        }

        body.light-theme .app-wide-stat-value {
            color: #1f2937;
        }

        body.light-theme .app-wide-stat-label {
            color: rgba(31, 41, 55, 0.6);
        }

        /* My Tribes Section */
        .community-my-tribes-section {
            margin-bottom: 20px;
        }

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

        .community-my-tribes-header .community-section-title {
            margin-bottom: 0;
        }

        /* Community Button Row */
        .community-button-row {
            display: flex;
            gap: 10px;
            margin-bottom: 20px;
        }

        .community-action-btn {
            flex: 1;
            padding: 12px 16px;
            background: rgba(255, 255, 255, 0.12);
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: var(--radius);
            color: white;
            font-size: 0.95rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }

        .community-action-btn:hover {
            background: rgba(255, 255, 255, 0.2);
            transform: translateY(-1px);
        }

        /* Community Feed Section */
        .community-feed-section {
            margin-top: 8px;
        }

        .community-feed-title {
            margin-top: 8px;
        }

        /* Community Plant Grid (Garden Mode - flat grid) */
        .community-plant-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
            gap: 12px;
            margin-bottom: 24px;
        }

        .community-plant-tile {
            background: rgba(255, 255, 255, 0.1);
            border-radius: 12px;
            padding: 12px 8px;
            text-align: center;
            cursor: pointer;
            transition: background 0.2s ease, transform 0.2s ease;
        }

        .community-plant-tile:hover {
            background: rgba(255, 255, 255, 0.18);
            transform: translateY(-2px);
        }

        .plant-tile-visual {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 2px;
            margin-bottom: 6px;
        }

        .plant-tile-symbol {
            font-size: 1.6rem;
        }

        .plant-tile-stage {
            font-size: 1.1rem;
        }

        .plant-tile-health {
            color: rgba(255, 255, 255, 0.8);
            font-size: 0.75rem;
            font-weight: 600;
            margin-bottom: 4px;
        }

        .plant-tile-name {
            color: rgba(255, 255, 255, 0.9);
            font-size: 0.75rem;
            font-weight: 600;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            margin-bottom: 2px;
        }

        .plant-tile-user {
            color: rgba(255, 255, 255, 0.5);
            font-size: 0.65rem;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        /* Feed Styles */
        .feed-empty {
            text-align: center;
            padding: 40px 20px;
            color: rgba(255, 255, 255, 0.6);
        }

        .feed-empty-icon {
            font-size: 3rem;
            margin-bottom: 12px;
        }

        .feed-item {
            background: white;
            border-radius: var(--radius);
            padding: 16px;
            margin-bottom: 12px;
            box-shadow: var(--shadow-sm);
            display: flex;
            align-items: flex-start;
            gap: 12px;
        }

        .feed-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--primary), var(--secondary));
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: 600;
            font-size: 1rem;
            flex-shrink: 0;
        }

        .feed-content {
            flex: 1;
        }

        .feed-text {
            color: var(--gray-700);
            font-size: 0.95rem;
            line-height: 1.4;
        }

        .feed-text strong {
            color: var(--gray-900);
        }

        .feed-time {
            color: var(--gray-400);
            font-size: 0.8rem;
            margin-top: 4px;
        }

        .feed-icon {
            font-size: 1.2rem;
        }

        .feed-actions {
            display: flex;
            align-items: center;
            gap: 16px;
            margin-top: 10px;
            padding-top: 10px;
            border-top: 1px solid var(--gray-100);
        }

        .feed-action-btn {
            display: flex;
            align-items: center;
            gap: 4px;
            background: none;
            border: none;
            color: var(--gray-500);
            font-size: 0.85rem;
            cursor: pointer;
            padding: 4px 8px;
            border-radius: 6px;
            transition: all 0.2s;
        }

        .feed-action-btn:hover {
            background: var(--gray-100);
            color: var(--gray-700);
        }

        .feed-action-btn.liked {
            color: #ef4444;
        }

        .feed-action-btn.liked:hover {
            background: #fef2f2;
        }

        .feed-comments {
            margin-top: 12px;
            padding-top: 12px;
            border-top: 1px solid var(--gray-100);
        }

        .feed-comment {
            display: flex;
            gap: 8px;
            margin-bottom: 8px;
        }

        .feed-comment-avatar {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            background: var(--gray-200);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.7rem;
            font-weight: 600;
            color: var(--gray-600);
            flex-shrink: 0;
        }

        .feed-comment-content {
            flex: 1;
            background: var(--gray-50);
            padding: 8px 12px;
            border-radius: 12px;
        }

        .feed-comment-author {
            font-weight: 600;
            font-size: 0.8rem;
            color: var(--gray-700);
        }

        .feed-comment-text {
            font-size: 0.85rem;
            color: var(--gray-600);
            margin-top: 2px;
        }

        .feed-comment-time {
            font-size: 0.7rem;
            color: var(--gray-400);
            margin-top: 2px;
        }

        .feed-comment-input {
            display: flex;
            gap: 8px;
            margin-top: 8px;
        }

        .feed-comment-input input {
            flex: 1;
            padding: 8px 12px;
            border: 1px solid var(--gray-200);
            border-radius: 20px;
            font-size: 0.85rem;
            outline: none;
        }

        .feed-comment-input input:focus {
            border-color: var(--primary);
        }

        .feed-comment-input button {
            padding: 8px 16px;
            background: var(--primary);
            color: white;
            border: none;
            border-radius: 20px;
            font-size: 0.85rem;
            cursor: pointer;
        }

        .feed-comment-input button:hover {
            background: var(--primary-dark);
        }

        /* Monthly Review Card */
        .feed-monthly-review {
            background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
            border: 1px solid #bae6fd;
        }

        .monthly-review-stats {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
            gap: 8px;
            margin-top: 12px;
        }

        .monthly-habit-stat {
            background: white;
            padding: 8px 12px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .monthly-habit-symbol {
            font-size: 1.2rem;
        }

        .monthly-habit-info {
            display: flex;
            flex-direction: column;
        }

        .monthly-habit-percent {
            font-weight: 600;
            color: var(--gray-800);
            font-size: 0.9rem;
        }

        .monthly-habit-fire {
            font-size: 0.75rem;
            color: var(--warning);
        }

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

        .tribes-header .community-section-title {
            margin-bottom: 0;
        }

        .btn-create-tribe {
            background: linear-gradient(135deg, #10b981, #059669);
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 25px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
        }

        .btn-create-tribe:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
        }

        /* Condensed Gladiator Row */
        .gladiator-row {
            background: rgba(255,255,255,0.95);
            border-radius: var(--radius);
            padding: 12px 16px;
            margin-bottom: 8px;
            display: flex;
            align-items: center;
            gap: 12px;
            cursor: pointer;
            transition: all 0.2s;
            box-shadow: var(--shadow);
        }

        .gladiator-row:hover {
            transform: translateY(-2px);
            box-shadow: var(--shadow-lg);
        }

        .gladiator-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1rem;
            font-weight: 700;
            flex-shrink: 0;
        }

        .gladiator-name {
            font-weight: 600;
            color: var(--gray-800);
            min-width: 100px;
            flex-shrink: 0;
        }

        .gladiator-habits {
            display: flex;
            gap: 8px;
            overflow-x: auto;
            flex: 1;
            padding: 4px 0;
            -webkit-overflow-scrolling: touch;
        }

        .gladiator-habit-circle {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            border: 2px solid;
            flex-shrink: 0;
            cursor: pointer;
            transition: transform 0.2s;
            position: relative;
        }

        .gladiator-habit-circle:hover {
            transform: scale(1.15);
            z-index: 10;
        }

        .gladiator-habit-circle .symbol {
            font-size: 1rem;
        }

        .gladiator-expand-icon {
            color: var(--gray-400);
            font-size: 1.2rem;
            margin-left: auto;
            transition: transform 0.3s;
        }

        .gladiator-row.expanded .gladiator-expand-icon {
            transform: rotate(180deg);
        }

        /* Expanded Gladiator Details */
        .gladiator-details {
            display: none;
            background: rgba(255,255,255,0.98);
            border-radius: 0 0 var(--radius) var(--radius);
            margin-top: -8px;
            margin-bottom: 8px;
            padding: 16px;
            box-shadow: var(--shadow-lg);
            animation: slideDown 0.3s ease;
        }

        .gladiator-details.show {
            display: block;
        }

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

        .gladiator-stats {
            display: flex;
            gap: 20px;
            margin-bottom: 16px;
            padding-bottom: 12px;
            border-bottom: 1px solid var(--gray-200);
        }

        .gladiator-stat {
            text-align: center;
        }

        .gladiator-stat-value {
            font-size: 1.25rem;
            font-weight: 700;
            color: var(--gray-800);
        }

        .gladiator-stat-label {
            font-size: 0.7rem;
            color: var(--gray-500);
            text-transform: uppercase;
        }

        /* Habit Calendar Popup */
        /* Tribe Card */
        .tribe-card {
            background: rgba(255,255,255,0.95);
            border-radius: var(--radius);
            padding: 16px;
            margin-bottom: 12px;
            box-shadow: var(--shadow);
        }

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

        .tribe-info {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .tribe-emoji {
            font-size: 2rem;
        }

        .tribe-name {
            font-size: 1.1rem;
            font-weight: 700;
            color: var(--gray-800);
        }

        .tribe-meta {
            font-size: 0.8rem;
            color: var(--gray-500);
        }

        .tribe-stats {
            display: flex;
            gap: 16px;
            padding: 12px;
            background: linear-gradient(135deg, #667eea10, #764ba210);
            border-radius: var(--radius-sm);
            margin-bottom: 12px;
        }

        .tribe-stat {
            text-align: center;
            flex: 1;
        }

        .tribe-stat-value {
            font-size: 1.25rem;
            font-weight: 700;
            color: var(--gray-800);
        }

        .tribe-stat-label {
            font-size: 0.7rem;
            color: var(--gray-500);
            text-transform: uppercase;
        }

        .tribe-members-toggle {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 8px 0;
            cursor: pointer;
            color: var(--gray-600);
            font-weight: 500;
        }

        .tribe-members-toggle:hover {
            color: var(--gray-800);
        }

        .tribe-members-list {
            display: none;
            padding-top: 12px;
            border-top: 1px solid var(--gray-200);
        }

        .tribe-members-list.show {
            display: block;
        }

        .tribe-actions {
            display: flex;
            gap: 8px;
        }

        .btn-join-tribe {
            background: linear-gradient(135deg, #667eea, #764ba2);
            color: white;
            border: none;
            padding: 8px 16px;
            border-radius: 20px;
            font-weight: 600;
            font-size: 0.85rem;
            cursor: pointer;
            transition: all 0.2s;
        }

        .btn-join-tribe:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
        }

        .btn-request-tribe {
            background: transparent;
            color: var(--gray-600);
            border: 2px solid var(--gray-300);
            padding: 8px 16px;
            border-radius: 20px;
            font-weight: 600;
            font-size: 0.85rem;
            cursor: pointer;
            transition: all 0.2s;
        }

        .btn-request-tribe:hover {
            border-color: var(--gray-400);
            color: var(--gray-800);
        }

        .btn-request-tribe.pending {
            background: var(--gray-100);
            color: var(--gray-500);
            cursor: default;
        }

        .btn-leave-tribe {
            background: transparent;
            color: var(--gray-500);
            border: none;
            padding: 8px 16px;
            font-size: 0.8rem;
            cursor: pointer;
        }

        .btn-leave-tribe:hover {
            color: #ef4444;
        }

        .btn-invite-tribe {
            background: linear-gradient(135deg, #3b82f6, #1d4ed8);
            color: white;
            border: none;
            padding: 8px 16px;
            border-radius: 20px;
            font-weight: 600;
            font-size: 0.85rem;
            cursor: pointer;
            transition: all 0.2s;
        }

        .btn-invite-tribe:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
        }

        .btn-invite-tribe.copied {
            background: linear-gradient(135deg, #10b981, #059669);
        }

        .tribe-badge {
            padding: 4px 10px;
            border-radius: 12px;
            font-size: 0.7rem;
            font-weight: 600;
            text-transform: uppercase;
        }

        .tribe-badge.public {
            background: #10b98120;
            color: #059669;
        }

        .tribe-badge.private {
            background: #f59e0b20;
            color: #d97706;
        }

        .tribe-badge.member {
            background: #667eea20;
            color: #667eea;
        }

        .tribe-badge.creator {
            background: #8b5cf620;
            color: #8b5cf6;
        }

        /* Pending Requests */
        .pending-requests {
            background: #fef3c7;
            border-radius: var(--radius-sm);
            padding: 12px;
            margin-bottom: 12px;
        }

        .pending-requests-title {
            font-weight: 600;
            color: #92400e;
            margin-bottom: 8px;
            font-size: 0.9rem;
        }

        .pending-request {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 8px 0;
            border-bottom: 1px solid #fde68a;
        }

        .pending-request:last-child {
            border-bottom: none;
        }

        .pending-request-name {
            font-weight: 500;
            color: var(--gray-700);
        }

        .pending-request-actions {
            display: flex;
            gap: 8px;
        }

        .btn-approve {
            background: #10b981;
            color: white;
            border: none;
            width: 28px;
            height: 28px;
            border-radius: 50%;
            cursor: pointer;
            font-size: 1rem;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .btn-reject {
            background: #ef4444;
            color: white;
            border: none;
            width: 28px;
            height: 28px;
            border-radius: 50%;
            cursor: pointer;
            font-size: 1rem;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        /* Create Tribe Modal */
        .tribe-emoji-picker {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }

        .tribe-emoji-btn {
            width: 44px;
            height: 44px;
            border: 2px solid var(--gray-200);
            border-radius: var(--radius-sm);
            background: white;
            font-size: 1.5rem;
            cursor: pointer;
            transition: all 0.2s;
        }

        .tribe-emoji-btn:hover {
            border-color: var(--primary);
        }

        .tribe-emoji-btn.selected {
            border-color: var(--primary);
            background: #667eea10;
        }

        .tribe-privacy-options {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .tribe-privacy-option {
            cursor: pointer;
        }

        .tribe-privacy-option input {
            display: none;
        }

        .privacy-option-content {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px;
            border: 2px solid var(--gray-200);
            border-radius: var(--radius-sm);
            transition: all 0.2s;
        }

        .tribe-privacy-option input:checked + .privacy-option-content {
            border-color: var(--primary);
            background: #667eea10;
        }

        .privacy-icon {
            font-size: 1.5rem;
        }

        .privacy-title {
            font-weight: 600;
            color: var(--gray-800);
        }

        .privacy-desc {
            font-size: 0.8rem;
            color: var(--gray-500);
        }

        /* Challenge Start Type Selector */
        .challenge-start-options {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .challenge-start-option {
            cursor: pointer;
        }

        .challenge-start-option input {
            display: none;
        }

        .start-option-content {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px;
            border: 2px solid var(--gray-200);
            border-radius: var(--radius-sm);
            transition: all 0.2s;
        }

        .challenge-start-option input:checked + .start-option-content {
            border-color: var(--primary);
            background: #667eea10;
        }

        .start-option-title {
            font-weight: 600;
            color: var(--gray-800);
        }

        .start-option-desc {
            font-size: 0.8rem;
            color: var(--gray-500);
        }

        /* Challenge Symbol Picker */
        .challenge-symbol-picker-btn {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 12px;
            border: 2px solid var(--gray-200);
            border-radius: var(--radius-sm);
            background: var(--gray-50);
            cursor: pointer;
            font-size: 0.9rem;
            color: var(--gray-600);
            transition: border-color 0.2s;
        }

        .challenge-symbol-picker-btn:hover {
            border-color: var(--primary);
        }

        .challenge-symbol-placeholder {
            display: inline-block;
            width: 36px;
            height: 36px;
            background: var(--gray-300);
            border-radius: 6px;
        }

        .challenge-symbol-preview-img {
            width: 36px;
            height: 36px;
            border-radius: 6px;
            object-fit: cover;
        }

        .challenge-symbol-picker-modal {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: var(--gray-900);
            border-radius: var(--radius-md);
            padding: 20px;
            z-index: 1100;
            max-width: 360px;
            width: 90%;
            text-align: center;
        }

        .challenge-symbol-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 8px;
            margin-top: 12px;
        }

        .challenge-symbol-grid-item {
            width: 60px;
            height: 60px;
            border-radius: 8px;
            border: 2px solid transparent;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--gray-800);
            transition: border-color 0.2s;
        }

        .challenge-symbol-grid-item:hover {
            border-color: var(--primary);
        }

        .challenge-symbol-grid-item.selected {
            border-color: var(--primary);
            background: #667eea20;
        }

        .challenge-symbol-grid-item img {
            width: 44px;
            height: 44px;
            object-fit: cover;
            border-radius: 4px;
        }

        /* Challenge habit symbol picker button (in habit rows) */
        .challenge-habit-symbol-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 40px;
            height: 40px;
            border: 2px solid var(--gray-200);
            border-radius: var(--radius-sm);
            background: var(--gray-50);
            cursor: pointer;
            font-size: 1.2rem;
            padding: 0;
            transition: border-color 0.2s;
        }

        .challenge-habit-symbol-btn:hover {
            border-color: var(--primary);
        }

        /* Challenges Tab Styles */
        .your-challenges-section {
            margin-bottom: 24px;
        }

        .your-challenges-section h3 {
            color: var(--gray-700);
            font-size: 1.1rem;
            margin-bottom: 16px;
        }

        .challenges-grid {
            display: grid;
            gap: 20px;
        }

        .challenge-card {
            background: white;
            border-radius: var(--radius);
            padding: 24px;
            box-shadow: var(--shadow-lg);
            transition: all 0.3s;
        }

        .challenge-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 12px 40px rgba(0,0,0,0.15);
        }

        .challenge-card.joined {
            border: 2px solid var(--success);
        }

        .challenge-header {
            display: flex;
            align-items: center;
            gap: 16px;
            margin-bottom: 16px;
        }

        .challenge-emoji {
            font-size: 3rem;
            width: 80px;
            height: 80px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border-radius: 16px;
        }

        .challenge-info h3 {
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--gray-800);
            margin-bottom: 4px;
        }

        .challenge-meta {
            display: flex;
            gap: 12px;
            font-size: 0.85rem;
            color: var(--gray-500);
            flex-wrap: wrap;
            align-items: center;
        }

        .challenge-badge {
            padding: 2px 8px;
            border-radius: 12px;
            font-weight: 600;
            font-size: 0.75rem;
        }

        .challenge-badge.extreme {
            background: #fef2f2;
            color: #ef4444;
        }

        .challenge-badge.joined {
            background: #ecfdf5;
            color: #10b981;
        }

        .challenge-description {
            color: var(--gray-600);
            font-size: 0.95rem;
            line-height: 1.6;
            margin-bottom: 20px;
        }

        .challenge-habits-preview {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-bottom: 20px;
        }

        .challenge-habit-pill {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 6px 12px;
            background: var(--gray-100);
            border-radius: 20px;
            font-size: 0.85rem;
            color: var(--gray-700);
        }

        .challenges-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            gap: 16px;
            margin-bottom: 24px;
            flex-wrap: wrap;
        }

        .btn-create-challenge {
            padding: 10px 20px;
            background: var(--success);
            color: white;
            border: none;
            border-radius: var(--radius-sm);
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            white-space: nowrap;
        }

        .btn-create-challenge:hover {
            background: #059669;
            transform: translateY(-1px);
        }

        /* Invite Gladiators Section */
        .invite-suggestions-label {
            font-size: 0.8rem;
            font-weight: 600;
            color: var(--gray-500);
            margin: 12px 0 8px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .invite-suggestions-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 12px;
        }

        .invite-gladiator-card {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 6px;
            cursor: pointer;
            padding: 8px 4px;
            border-radius: var(--radius-sm);
            transition: all 0.2s;
        }

        .invite-gladiator-card:hover {
            background: rgba(99, 102, 241, 0.1);
        }

        .invite-gladiator-card.selected {
            background: rgba(16, 185, 129, 0.15);
        }

        .invite-gladiator-avatar {
            width: 56px;
            height: 56px;
            border-radius: 50%;
            background: rgba(120, 120, 140, 0.5);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.1rem;
            font-weight: 700;
            transition: all 0.2s;
            position: relative;
        }

        .invite-gladiator-card.selected .invite-gladiator-avatar {
            background: linear-gradient(135deg, #10b981 0%, #059669 100%);
            box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3);
        }

        .invite-gladiator-card.selected .invite-gladiator-avatar::after {
            content: '✓';
            position: absolute;
            bottom: -2px;
            right: -2px;
            width: 18px;
            height: 18px;
            background: var(--success);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.65rem;
            border: 2px solid white;
        }

        .invite-gladiator-name {
            font-size: 0.8rem;
            color: var(--gray-700);
            text-align: center;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            max-width: 80px;
        }

        .invite-no-users {
            grid-column: 1 / -1;
            text-align: center;
            color: var(--gray-500);
            font-size: 0.9rem;
            padding: 16px;
        }

        @media (max-width: 400px) {
            .invite-suggestions-grid {
                grid-template-columns: repeat(3, 1fr);
            }
        }

        .challenge-actions {
            display: flex;
            gap: 12px;
            flex-wrap: wrap;
            align-items: center;
        }

        .btn-join-challenge {
            padding: 12px 24px;
            background: var(--primary);
            color: white;
            border: none;
            border-radius: var(--radius-sm);
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
        }

        .btn-join-challenge:hover {
            background: #5558e3;
            transform: translateY(-1px);
        }

        .btn-join-challenge:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            transform: none;
        }

        .btn-share-challenge {
            padding: 10px 20px;
            background: rgba(99, 102, 241, 0.1);
            color: #6366f1;
            border: 1px solid rgba(99, 102, 241, 0.2);
            border-radius: var(--radius-sm);
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
        }

        .btn-share-challenge:hover {
            background: rgba(99, 102, 241, 0.18);
            border-color: rgba(99, 102, 241, 0.35);
        }

        .btn-share-challenge.copied {
            background: var(--success);
            color: white;
        }

        .btn-view-details {
            padding: 12px 24px;
            background: var(--gray-100);
            color: var(--gray-700);
            border: none;
            border-radius: var(--radius-sm);
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
        }

        .btn-view-details:hover {
            background: var(--gray-200);
        }

        .btn-leave-challenge {
            padding: 10px 20px;
            background: var(--gray-200);
            color: var(--gray-600);
            border: none;
            border-radius: var(--radius-sm);
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            font-size: 0.9rem;
        }

        .btn-leave-challenge:hover {
            background: var(--gray-300);
            color: var(--gray-700);
        }

        .btn-leave-challenge-detail {
            padding: 8px 20px;
            background: transparent;
            color: var(--gray-400);
            border: none;
            font-size: 0.85rem;
            font-weight: 500;
            cursor: pointer;
            transition: color 0.2s;
        }

        .btn-leave-challenge-detail:hover {
            color: var(--danger, #ef4444);
        }

        .challenge-joined-badge {
            display: flex;
            align-items: center;
            gap: 6px;
            color: var(--success);
            font-weight: 600;
            font-size: 0.9rem;
        }

        /* Joined Challenge Inline View */
        .joined-challenge {
            background: var(--gray-50);
            border-radius: var(--radius-md);
            padding: 16px;
            margin-bottom: 12px;
        }

        .joined-challenge-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 4px;
        }

        .joined-challenge-title {
            font-size: 1.4rem;
            font-weight: 700;
            color: var(--gray-800);
            cursor: pointer;
            text-decoration: underline;
            text-decoration-color: rgba(99, 102, 241, 0.3);
            text-underline-offset: 3px;
            transition: color 0.2s, text-decoration-color 0.2s;
        }

        .joined-challenge-title:hover {
            color: var(--primary);
            text-decoration-color: var(--primary);
        }

        .challenge-day-progress {
            font-size: 0.8rem;
            font-weight: 500;
            color: var(--gray-500);
            margin-bottom: 12px;
        }

        .completed-challenges-section {
            margin-bottom: 24px;
        }

        .completed-badges-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
            gap: 12px;
        }

        .challenge-badge-card {
            position: relative;
            background: white;
            border-radius: var(--radius-sm);
            padding: 16px 10px;
            text-align: center;
            cursor: pointer;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
            transition: transform 0.2s, box-shadow 0.2s;
        }

        .challenge-badge-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
        }

        .challenge-badge-emoji {
            font-size: 2.5rem;
            line-height: 1;
            margin-bottom: 8px;
        }

        .challenge-badge-name {
            font-size: 0.75rem;
            font-weight: 600;
            color: var(--gray-700);
            line-height: 1.2;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
        }

        .challenge-badge-percent {
            position: absolute;
            top: 6px;
            right: 8px;
            font-size: 0.7rem;
            font-weight: 700;
            color: var(--gray-500);
        }

        .challenge-badge-medal {
            position: absolute;
            bottom: 6px;
            left: 8px;
            font-size: 1.1rem;
            line-height: 1;
        }

        .joined-challenge-actions {
            display: flex;
            gap: 8px;
        }

        .joined-challenge-habits-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            margin-bottom: 8px;
        }

        .joined-challenge-habits {
            display: flex;
            gap: 16px;
            flex-wrap: wrap;
        }

        .challenge-aggregate-stats {
            display: flex;
            gap: 12px;
            flex-shrink: 0;
        }

        .challenge-aggregate-stat {
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
        }

        .challenge-aggregate-value {
            font-size: 1.1rem;
            font-weight: 700;
            color: var(--primary);
            line-height: 1.2;
        }

        .challenge-aggregate-label {
            font-size: 0.65rem;
            font-weight: 600;
            color: var(--gray-500);
            text-transform: uppercase;
            letter-spacing: 0.3px;
        }

        .joined-challenge-habit {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
        }

        .joined-challenge-habit .gladiator-habit-circle {
            width: 40px;
            height: 40px;
        }

        .joined-challenge-habit-name {
            font-size: 0.7rem;
            font-weight: 600;
            color: var(--gray-500);
            text-align: center;
            max-width: 70px;
            line-height: 1.2;
        }

        /* Challenge Leaderboard */
        .challenge-leaderboard {
            display: flex;
            flex-direction: column;
            gap: 6px;
            max-height: 400px;
            overflow-y: auto;
            padding: 4px 0;
        }

        .challenge-participant-row {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 12px;
            background: var(--gray-50);
            border-radius: var(--radius-sm);
        }

        .challenge-participant-row.current-user {
            background: rgba(99, 102, 241, 0.08);
            border: 2px solid rgba(99, 102, 241, 0.25);
        }

        .participant-rank {
            font-weight: 700;
            font-size: 1rem;
            min-width: 28px;
            text-align: center;
            color: var(--gray-500);
            flex-shrink: 0;
        }

        .participant-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.9rem;
            font-weight: 700;
            flex-shrink: 0;
        }

        .participant-info {
            flex: 1;
            min-width: 0;
            overflow: hidden;
        }

        .participant-name {
            font-weight: 600;
            font-size: 0.9rem;
            color: var(--gray-800);
            margin-bottom: 4px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .participant-habits {
            display: flex;
            gap: 4px;
            flex-wrap: wrap;
        }

        .participant-habits .gladiator-habit-circle {
            width: 28px;
            height: 28px;
            border-width: 2px;
        }

        .participant-habits .gladiator-habit-circle .symbol {
            font-size: 0.8rem;
        }

        .participant-percent {
            font-weight: 700;
            font-size: 0.8rem;
            color: var(--primary);
            text-align: right;
            flex-shrink: 0;
            white-space: nowrap;
        }

        /* Challenge Preview Cards & Grid */
        .challenge-preview-section {
            margin-bottom: 28px;
        }

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

        .challenge-preview-section-title {
            font-size: 1.1rem;
            font-weight: 700;
            color: white;
        }

        .challenge-preview-grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 16px;
        }

        @media (min-width: 600px) {
            .challenge-preview-grid {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        @media (min-width: 1024px) {
            .challenge-preview-grid {
                grid-template-columns: repeat(3, 1fr);
            }
        }

        .challenge-preview-card {
            border-radius: 20px;
            overflow: hidden;
            cursor: pointer;
            transition: transform 0.3s, box-shadow 0.3s;
            display: flex;
            flex-direction: column;
            min-height: 220px;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
            position: relative;
        }

        .challenge-preview-card:hover {
            transform: translateY(-4px);
            box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
        }

        .challenge-preview-emoji {
            font-size: 4rem;
            text-align: center;
            padding: 28px 20px 16px;
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            text-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
        }

        .challenge-preview-glass {
            background: rgba(255, 255, 255, 0.15);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border-top: 1px solid rgba(255, 255, 255, 0.3);
            padding: 16px 18px;
        }

        .challenge-preview-name {
            font-size: 1.1rem;
            font-weight: 700;
            color: white;
            text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
            margin-bottom: 4px;
        }

        .challenge-preview-progress {
            font-size: 0.8rem;
            font-weight: 500;
            color: rgba(255, 255, 255, 0.8);
            margin-bottom: 10px;
        }

        .challenge-preview-habits {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
            margin-bottom: 12px;
        }

        .challenge-preview-habit {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
        }

        .challenge-preview-habit .gladiator-habit-circle {
            width: 34px;
            height: 34px;
            border-color: rgba(255, 255, 255, 0.7) !important;
            background: rgba(255, 255, 255, 0.15) !important;
        }

        .challenge-preview-habit .gladiator-habit-circle.completed-today {
            background: rgba(255, 255, 255, 0.4) !important;
            border-color: white !important;
        }

        .challenge-preview-habit-name {
            font-size: 0.6rem;
            font-weight: 600;
            color: rgba(255, 255, 255, 0.85);
            text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
            text-align: center;
            max-width: 55px;
            line-height: 1.2;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
        }

        .challenge-preview-avatars {
            display: flex;
            align-items: center;
        }

        .challenge-preview-avatar-stack {
            display: flex;
        }

        .challenge-preview-avatar {
            width: 26px;
            height: 26px;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.25);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.65rem;
            font-weight: 700;
            border: 2px solid rgba(255, 255, 255, 0.6);
            margin-left: -8px;
            position: relative;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
        }

        .challenge-preview-avatar:first-child {
            margin-left: 0;
        }

        .challenge-preview-joined-count {
            font-size: 0.8rem;
            color: rgba(255, 255, 255, 0.85);
            font-weight: 500;
            margin-left: 8px;
            text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
        }

        @media (max-width: 480px) {
            .challenge-preview-card {
                min-height: 200px;
            }
            .challenge-preview-name {
                font-size: 1rem;
            }
        }

        /* ===== Discover Challenge Preview Card ===== */
        .challenge-preview-card--discover {
            background: rgba(255, 255, 255, 0.08);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border: 1px solid rgba(255, 255, 255, 0.15);
            padding: 20px;
            min-height: auto;
            gap: 0;
        }

        .challenge-discover-name {
            font-size: 1.15rem;
            font-weight: 700;
            color: white;
            margin-bottom: 6px;
        }

        .challenge-discover-description {
            font-size: 0.85rem;
            color: rgba(255, 255, 255, 0.75);
            margin-bottom: 14px;
            line-height: 1.4;
            display: -webkit-box;
            -webkit-line-clamp: 3;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .challenge-discover-habits {
            display: flex;
            gap: 12px;
            flex-wrap: wrap;
            margin-bottom: 14px;
        }

        .challenge-discover-habit {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
        }

        .challenge-preview-card--discover .dashboard-circle {
            width: 44px;
            height: 44px;
            cursor: default;
        }

        .challenge-preview-card--discover .dashboard-circle .symbol {
            font-size: 1rem;
        }

        .challenge-preview-card--discover .dashboard-circle .streak {
            display: none;
        }

        .challenge-discover-habit-name {
            font-size: 0.65rem;
            font-weight: 600;
            color: rgba(255, 255, 255, 0.8);
            text-align: center;
            max-width: 55px;
            line-height: 1.2;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
        }

        /* ===== Active Challenge Preview Card ===== */
        .challenge-preview-card--active {
            min-height: auto;
            max-width: 360px;
            padding: 18px;
            gap: 12px;
            box-shadow: var(--gold-glow, none), 0 8px 32px rgba(0, 0, 0, 0.18);
        }

        .challenge-preview-card.challenge-preview-card--active:hover {
            box-shadow: var(--gold-glow, none), 0 16px 48px rgba(0, 0, 0, 0.25);
        }

        /* Stronger text shadows when gold is bright (>=60% completion) */
        .challenge-preview-card--active.gold-bright .challenge-active-name,
        .challenge-preview-card--active.gold-bright .challenge-active-stat-value,
        .challenge-preview-card--active.gold-bright .challenge-active-lb-name {
            text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
        }

        .challenge-preview-card--active.gold-bright .challenge-active-stat-label,
        .challenge-preview-card--active.gold-bright .challenge-active-lb-title,
        .challenge-preview-card--active.gold-bright .challenge-active-lb-rank,
        .challenge-preview-card--active.gold-bright .challenge-active-lb-completions {
            text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.2);
        }

        .challenge-preview-card--active.gold-bright .challenge-active-stat--rank .challenge-active-stat-value {
            text-shadow: 0 0 10px rgba(192, 192, 192, 0.6), 0 1px 4px rgba(0, 0, 0, 0.4);
        }

        .challenge-preview-card--active.gold-bright .challenge-active-leaderboard {
            background: rgba(0, 0, 0, 0.15);
            border-color: rgba(255, 255, 255, 0.2);
        }

        .challenge-active-header {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .challenge-active-title-row {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .challenge-active-name {
            font-size: 1.1rem;
            font-weight: 700;
            color: white;
            text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
            line-height: 1.3;
        }

        .challenge-active-symbol {
            font-size: 1.3rem;
        }

        .challenge-active-stat--rank .challenge-active-stat-value {
            color: #C0C0C0;
            text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
        }

        .challenge-active-body {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 12px;
        }

        .challenge-active-circles {
            display: flex;
            gap: 12px;
            flex-wrap: wrap;
            justify-content: center;
        }

        .challenge-active-stats-row {
            display: flex;
            gap: 24px;
            justify-content: center;
        }

        .challenge-active-stat {
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
        }

        .challenge-active-stat-value {
            font-size: 1rem;
            font-weight: 700;
            color: white;
            text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
            line-height: 1.2;
        }

        .challenge-active-stat-label {
            font-size: 0.7rem;
            font-weight: 600;
            color: rgba(255, 255, 255, 0.8);
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
            text-transform: uppercase;
            letter-spacing: 0.3px;
        }

        .challenge-active-habit {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 6px;
        }

        /* Mini dashboard circles inside active card */
        .challenge-preview-card--active .dashboard-circle {
            width: 60px;
            height: 60px;
        }

        .challenge-preview-card--active .dashboard-circle .symbol {
            font-size: 1.3rem;
        }

        .challenge-preview-card--active .dashboard-circle .streak {
            font-size: 0.55rem;
            margin-top: 2px;
        }

        .challenge-preview-card--active .dashboard-detail-btn {
            font-size: 0.6rem;
            padding: 3px 10px;
        }

        /* Mini Leaderboard */
        .challenge-active-leaderboard {
            background: rgba(255, 255, 255, 0.12);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            border-radius: 12px;
            padding: 10px 14px;
            border: 1px solid rgba(255, 255, 255, 0.15);
        }

        .challenge-active-lb-title {
            font-size: 0.7rem;
            font-weight: 700;
            color: rgba(255, 255, 255, 0.65);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 6px;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
        }

        .challenge-active-lb-list {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }

        .challenge-active-lb-entry {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 2px 0;
        }

        .challenge-active-lb-entry.is-you {
            font-weight: 700;
        }

        .challenge-active-lb-rank {
            font-size: 0.8rem;
            font-weight: 600;
            color: rgba(255, 255, 255, 0.7);
            min-width: 22px;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
        }

        .challenge-active-lb-name {
            font-size: 0.8rem;
            font-weight: 500;
            color: white;
            text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .challenge-active-lb-entry.is-you .challenge-active-lb-name {
            font-weight: 700;
        }

        .challenge-active-lb-completions {
            font-size: 0.75rem;
            font-weight: 600;
            color: rgba(255, 255, 255, 0.7);
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
            margin-left: auto;
            flex-shrink: 0;
        }

        /* Invite button on active card */
        .challenge-active-invite-btn {
            background: rgba(255, 255, 255, 0.15);
            border: 1px solid rgba(255, 255, 255, 0.25);
            color: white;
            font-size: 0.75rem;
            font-weight: 600;
            padding: 6px 16px;
            border-radius: 20px;
            cursor: pointer;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
            transition: background 0.2s;
            align-self: center;
        }

        .challenge-active-invite-btn:hover {
            background: rgba(255, 255, 255, 0.25);
        }

        /* Discover card start info row */
        .challenge-discover-start-info {
            font-size: 0.85rem;
            color: rgba(255, 255, 255, 0.7);
            padding: 4px 0;
            text-align: center;
        }

        body.light-theme .challenge-discover-start-info {
            color: rgba(31, 41, 55, 0.7);
        }

        /* Discover card footer with avatars + action buttons */
        .challenge-discover-footer {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 8px;
        }

        .challenge-discover-actions {
            display: flex;
            gap: 8px;
            flex-shrink: 0;
        }

        .challenge-discover-join-btn,
        .challenge-discover-invite-btn {
            font-size: 0.7rem;
            font-weight: 600;
            padding: 5px 12px;
            border-radius: 16px;
            cursor: pointer;
            border: none;
            transition: opacity 0.2s;
        }

        .challenge-discover-join-btn {
            background: var(--success);
            color: white;
        }

        .challenge-discover-invite-btn {
            background: rgba(255, 255, 255, 0.15);
            border: 1px solid rgba(255, 255, 255, 0.25);
            color: white;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
        }

        .challenge-discover-join-btn:hover,
        .challenge-discover-invite-btn:hover {
            opacity: 0.85;
        }

        /* Habit Linking Modal */
        .linking-modal-body {
            padding: 8px 0;
            max-height: 60vh;
            overflow-y: auto;
        }

        .linking-modal-section {
            margin-bottom: 16px;
        }

        .linking-section-title {
            font-size: 0.75rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: var(--gray-500);
            padding: 0 4px 8px;
        }

        .linking-habit-row {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 10px 12px;
            border-radius: 10px;
            cursor: pointer;
            transition: background 0.15s;
            margin-bottom: 4px;
        }

        .linking-habit-row:hover {
            background: rgba(99, 102, 241, 0.08);
        }

        .linking-habit-symbol {
            font-size: 1.4rem;
            width: 36px;
            text-align: center;
            flex-shrink: 0;
        }

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

        .linking-habit-name {
            font-weight: 600;
            font-size: 0.95rem;
            color: var(--gray-800);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .linking-habit-status {
            font-size: 0.8rem;
            color: var(--gray-500);
        }

        .linking-status-linked {
            color: var(--success);
        }

        .linking-habit-linked {
            background: rgba(16, 185, 129, 0.08);
        }

        .linking-habit-linked:hover {
            background: rgba(16, 185, 129, 0.15);
        }

        .linking-unlink-btn {
            color: var(--gray-400);
            font-size: 1.1rem;
            padding: 4px 8px;
            flex-shrink: 0;
        }

        .linking-habit-unlinked {
            cursor: default;
            opacity: 0.6;
        }

        .linking-habit-unlinked:hover {
            background: transparent;
        }

        .linking-picker-option {
            border: 1px solid rgba(99, 102, 241, 0.2);
        }

        .linking-picker-option:hover {
            border-color: var(--primary);
            background: rgba(99, 102, 241, 0.1);
        }

        /* Invite choice popup */
        .challenge-invite-choice-overlay {
            z-index: 1100;
        }

        .challenge-invite-choice {
            background: white;
            border-radius: 16px;
            padding: 24px;
            max-width: 320px;
            width: 90%;
            text-align: center;
            box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
        }

        .challenge-invite-choice h3 {
            font-size: 1.1rem;
            font-weight: 700;
            color: #1f2937;
            margin: 0 0 4px 0;
        }

        .challenge-invite-choice p {
            font-size: 0.85rem;
            color: #6b7280;
            margin: 0 0 20px 0;
        }

        .challenge-invite-choice-buttons {
            display: flex;
            gap: 12px;
        }

        .challenge-invite-choice-btn {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
            padding: 16px 12px;
            border: 2px solid #e5e7eb;
            border-radius: 12px;
            background: white;
            cursor: pointer;
            transition: border-color 0.2s, background 0.2s;
        }

        .challenge-invite-choice-btn:hover {
            border-color: var(--primary);
            background: #f0f7ff;
        }

        .challenge-invite-choice-icon {
            font-size: 1.5rem;
        }

        .challenge-invite-choice-label {
            font-size: 0.85rem;
            font-weight: 700;
            color: #1f2937;
        }

        .challenge-invite-choice-desc {
            font-size: 0.7rem;
            color: #6b7280;
        }

        /* Invite user modal */
        .challenge-invite-modal-overlay {
            z-index: 1100;
        }

        .challenge-invite-modal {
            background: white;
            border-radius: 16px;
            padding: 24px;
            max-width: 400px;
            width: 90%;
            max-height: 80vh;
            overflow-y: auto;
            box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
            display: flex;
            flex-direction: column;
            gap: 16px;
        }

        .challenge-invite-modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .challenge-invite-modal-header h3 {
            font-size: 1.05rem;
            font-weight: 700;
            color: #1f2937;
            margin: 0;
        }

        .challenge-invite-modal-close {
            background: #f3f4f6;
            border: none;
            width: 28px;
            height: 28px;
            border-radius: 50%;
            font-size: 0.9rem;
            cursor: pointer;
            color: #6b7280;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .challenge-invite-search {
            width: 100%;
            padding: 10px 14px;
            border: 1px solid #e5e7eb;
            border-radius: 10px;
            font-size: 0.85rem;
            outline: none;
            box-sizing: border-box;
        }

        .challenge-invite-search:focus {
            border-color: var(--primary);
        }

        .challenge-invite-modal-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 10px;
        }

        .challenge-invite-send-btn {
            background: var(--success);
            color: white;
            border: none;
            padding: 12px;
            border-radius: 10px;
            font-size: 0.9rem;
            font-weight: 700;
            cursor: pointer;
            transition: opacity 0.2s;
        }

        .challenge-invite-send-btn:disabled {
            opacity: 0.5;
            cursor: default;
        }

        .challenge-invite-send-btn:not(:disabled):hover {
            opacity: 0.9;
        }

        /* Light theme overrides for discover card buttons */
        body.light-theme .challenge-discover-invite-btn {
            background: rgba(0, 0, 0, 0.06);
            border-color: rgba(0, 0, 0, 0.12);
            color: #1f2937;
            text-shadow: none;
        }

        /* Mobile adjustments for discover card */
        @media (max-width: 480px) {
            .challenge-preview-card--discover {
                padding: 16px;
            }

            .challenge-discover-name {
                font-size: 1rem;
            }

            .challenge-preview-card--discover .dashboard-circle {
                width: 38px;
                height: 38px;
            }

            .challenge-preview-card--discover .dashboard-circle .symbol {
                font-size: 0.85rem;
            }
        }

        /* Mobile adjustments for active card */
        @media (max-width: 480px) {
            .challenge-preview-card--active {
                padding: 14px;
            }

            .challenge-preview-card--active .dashboard-circle {
                width: 50px;
                height: 50px;
            }

            .challenge-preview-card--active .dashboard-circle .symbol {
                font-size: 1.1rem;
            }

            .challenge-preview-card--active .dashboard-circle .streak {
                font-size: 0.5rem;
            }

            .challenge-active-name {
                font-size: 0.95rem;
            }

            .challenge-active-stat-value {
                font-size: 0.9rem;
            }

            .challenge-active-stats-row {
                gap: 16px;
            }
        }

        /* Challenge Detail Modal - Redesigned */
        .challenge-detail-close {
            position: absolute;
            top: 16px;
            right: 16px;
            z-index: 10;
            background: var(--gray-100);
            border: none;
            width: 32px;
            height: 32px;
            border-radius: 50%;
            font-size: 1.2rem;
            color: var(--gray-500);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background 0.2s;
        }
        .challenge-detail-close:hover {
            background: var(--gray-200);
            color: var(--gray-700);
        }

        .challenge-detail-header {
            display: flex;
            align-items: center;
            gap: 16px;
            margin-bottom: 16px;
        }
        .challenge-detail-mini-habits {
            display: flex;
            gap: 14px;
            flex-wrap: wrap;
            margin-bottom: 16px;
        }
        .challenge-detail-mini-habit {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
        }
        .challenge-detail-mini-habits .dashboard-circle {
            width: 44px;
            height: 44px;
            cursor: default;
        }
        .challenge-detail-mini-habits .dashboard-circle .symbol {
            font-size: 1rem;
        }
        .challenge-detail-mini-name {
            font-size: 0.65rem;
            font-weight: 600;
            color: var(--gray-500);
            text-align: center;
            line-height: 1.2;
        }
        /* Single-habit inline variant */
        .challenge-detail-name-row {
            display: flex;
            align-items: center;
            gap: 12px;
        }
        .challenge-detail-mini-habit--inline {
            flex-direction: row;
            gap: 6px;
        }
        .challenge-detail-mini-habit--inline .dashboard-circle {
            width: 44px;
            height: 44px;
            cursor: default;
        }
        .challenge-detail-mini-habit--inline .dashboard-circle .symbol {
            font-size: 1rem;
        }
        .challenge-detail-mini-habit--inline .challenge-detail-mini-name {
            font-size: 0.75rem;
        }
        .challenge-detail-stats-bar {
            display: flex;
            gap: 24px;
            justify-content: center;
            margin-bottom: 20px;
            padding: 12px 16px;
            background: var(--gray-50);
            border-radius: 12px;
        }
        .challenge-detail-stat-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
        }
        .challenge-detail-stat-value {
            font-size: 1.1rem;
            font-weight: 700;
            color: var(--primary);
            line-height: 1.2;
        }
        .challenge-detail-stat-label {
            font-size: 0.7rem;
            font-weight: 600;
            color: var(--gray-500);
            text-transform: uppercase;
            margin-top: 2px;
        }
        .challenge-detail-emoji {
            font-size: 2.8rem;
            width: 72px;
            height: 72px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border-radius: 18px;
            flex-shrink: 0;
        }
        .challenge-detail-title-block {
            flex: 1;
            min-width: 0;
        }
        .challenge-detail-name {
            font-size: 1.4rem;
            font-weight: 700;
            color: var(--gray-800);
            margin: 0;
            line-height: 1.2;
        }
        .challenge-detail-progress {
            font-size: 0.85rem;
            font-weight: 500;
            color: var(--gray-500);
            margin-top: 4px;
            display: inline-block;
        }

        .challenge-detail-actions {
            display: flex;
            gap: 10px;
            margin-bottom: 20px;
        }
        .btn-challenge-action {
            flex: 1;
            padding: 10px 16px;
            background: var(--primary);
            color: white;
            border: none;
            border-radius: 12px;
            font-weight: 600;
            font-size: 0.85rem;
            cursor: pointer;
            transition: all 0.2s;
        }
        .btn-challenge-action:hover {
            opacity: 0.9;
            transform: translateY(-1px);
        }
        .btn-challenge-action.secondary {
            background: var(--gray-100);
            color: var(--gray-700);
        }
        .btn-challenge-action.secondary:hover {
            background: var(--gray-200);
        }
        .btn-challenge-action.copied {
            background: var(--success);
            color: white;
        }

        .challenge-detail-description {
            color: var(--gray-600);
            font-size: 0.9rem;
            line-height: 1.6;
            margin-bottom: 24px;
        }
        .challenge-detail-section-title {
            font-size: 0.95rem;
            font-weight: 700;
            color: var(--gray-700);
            margin: 24px 0 12px;
        }

        /* Challenge Feed */
        .challenge-feed-input {
            display: flex;
            gap: 8px;
            margin-bottom: 16px;
        }
        .challenge-feed-input input {
            flex: 1;
            padding: 10px 14px;
            border: 1px solid var(--gray-200);
            border-radius: 12px;
            font-size: 0.9rem;
            background: var(--gray-50);
            transition: border-color 0.2s;
        }
        .challenge-feed-input input:focus {
            outline: none;
            border-color: var(--primary);
            background: white;
        }
        .btn-challenge-post {
            padding: 10px 18px;
            background: var(--primary);
            color: white;
            border: none;
            border-radius: 12px;
            font-weight: 600;
            font-size: 0.85rem;
            cursor: pointer;
            transition: all 0.2s;
            white-space: nowrap;
        }
        .btn-challenge-post:hover {
            opacity: 0.9;
            transform: translateY(-1px);
        }

        .challenge-feed-list {
            display: flex;
            flex-direction: column;
            gap: 10px;
            max-height: 300px;
            overflow-y: auto;
        }
        .challenge-feed-post {
            display: flex;
            gap: 10px;
            padding: 12px;
            background: var(--gray-50);
            border-radius: 14px;
            transition: background 0.15s;
        }
        .challenge-feed-post-avatar {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.8rem;
            font-weight: 700;
            flex-shrink: 0;
        }
        .challenge-feed-post-body {
            flex: 1;
            min-width: 0;
        }
        .challenge-feed-post-header {
            display: flex;
            align-items: baseline;
            gap: 8px;
            margin-bottom: 3px;
        }
        .challenge-feed-post-name {
            font-weight: 600;
            font-size: 0.85rem;
            color: var(--gray-800);
        }
        .challenge-feed-post-time {
            font-size: 0.75rem;
            color: var(--gray-400);
        }
        .challenge-feed-post-text {
            font-size: 0.88rem;
            color: var(--gray-700);
            line-height: 1.5;
            word-break: break-word;
        }

        /* Tribe Feed */
        .tribe-feed-section {
            border-top: 1px solid var(--gray-200);
            margin-top: 12px;
            padding-top: 12px;
        }
        .tribe-feed-input {
            display: flex;
            gap: 8px;
            margin-bottom: 16px;
        }
        .tribe-feed-input input {
            flex: 1;
            padding: 10px 14px;
            border: 1px solid var(--gray-200);
            border-radius: 12px;
            font-size: 0.9rem;
            background: var(--gray-50);
            transition: border-color 0.2s;
        }
        .tribe-feed-input input:focus {
            outline: none;
            border-color: var(--primary);
            background: white;
        }
        .btn-tribe-post {
            padding: 10px 18px;
            background: var(--primary);
            color: white;
            border: none;
            border-radius: 12px;
            font-weight: 600;
            font-size: 0.85rem;
            cursor: pointer;
            transition: all 0.2s;
            white-space: nowrap;
        }
        .btn-tribe-post:hover {
            opacity: 0.9;
            transform: translateY(-1px);
        }
        .tribe-feed-list {
            display: flex;
            flex-direction: column;
            gap: 10px;
            max-height: 300px;
            overflow-y: auto;
        }
        .tribe-feed-post {
            display: flex;
            gap: 10px;
            padding: 12px;
            background: var(--gray-50);
            border-radius: 14px;
            transition: background 0.15s;
        }
        .tribe-feed-post-avatar {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.8rem;
            font-weight: 700;
            flex-shrink: 0;
        }
        .tribe-feed-post-body {
            flex: 1;
            min-width: 0;
        }
        .tribe-feed-post-header {
            display: flex;
            align-items: baseline;
            gap: 8px;
            margin-bottom: 3px;
        }
        .tribe-feed-post-name {
            font-weight: 600;
            font-size: 0.85rem;
            color: var(--gray-800);
        }
        .tribe-feed-post-time {
            font-size: 0.75rem;
            color: var(--gray-400);
        }
        .tribe-feed-post-text {
            font-size: 0.88rem;
            color: var(--gray-700);
            line-height: 1.5;
            word-break: break-word;
        }

        /* Participant Dashboard View */
        .participant-dashboard-grid {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 20px;
            padding: 16px 0;
        }
        .participant-dashboard-circle {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
            cursor: pointer;
            transition: transform 0.15s;
        }
        .participant-dashboard-circle:active {
            transform: scale(0.95);
        }
        .challenge-participant-row {
            cursor: pointer;
        }

        /* Leave Challenge - Habit Removal View */
        .habit-removal-grid {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 20px;
            padding: 20px 0;
        }

        .habit-removal-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
            position: relative;
        }

        .habit-removal-circle {
            width: 70px;
            height: 70px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            border: 3px solid;
            font-size: 1.8rem;
            position: relative;
        }

        .habit-removal-circle.removed {
            opacity: 0.3;
            border-style: dashed;
        }

        .btn-remove-habit {
            position: absolute;
            top: -5px;
            right: -5px;
            width: 24px;
            height: 24px;
            border-radius: 50%;
            background: #ef4444;
            color: white;
            border: 2px solid white;
            font-size: 1rem;
            font-weight: 700;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            line-height: 1;
        }

        .btn-remove-habit:hover {
            background: #dc2626;
            transform: scale(1.1);
        }

        .habit-removal-name {
            font-size: 0.75rem;
            font-weight: 600;
            text-align: center;
            color: var(--gray-600);
            max-width: 80px;
        }

        .btn-remove-all {
            padding: 12px 24px;
            background: #ef4444;
            color: white;
            border: none;
            border-radius: var(--radius-sm);
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
        }

        .btn-remove-all:hover {
            background: #dc2626;
        }

        .leave-modal-actions {
            display: flex;
            gap: 12px;
            justify-content: center;
            margin-top: 24px;
            flex-wrap: wrap;
        }

        .btn-keep-habits {
            padding: 12px 24px;
            background: var(--success);
            color: white;
            border: none;
            border-radius: var(--radius-sm);
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
        }

        .btn-keep-habits:hover {
            background: #059669;
        }

        .btn-remove-habits {
            padding: 12px 24px;
            background: var(--gray-200);
            color: var(--gray-700);
            border: none;
            border-radius: var(--radius-sm);
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
        }

        .btn-remove-habits:hover {
            background: var(--gray-300);
        }

        /* Create Challenge Modal */
        .challenge-emoji-picker {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }

        .challenge-emoji-btn {
            width: 44px;
            height: 44px;
            border: 2px solid var(--gray-200);
            border-radius: var(--radius-sm);
            background: white;
            font-size: 1.5rem;
            cursor: pointer;
            transition: all 0.2s;
        }

        .challenge-emoji-btn:hover {
            border-color: var(--primary);
        }

        .challenge-emoji-btn.selected {
            border-color: var(--primary);
            background: #667eea10;
        }

        .challenge-habits-list {
            display: flex;
            flex-direction: column;
            gap: 12px;
            margin-bottom: 12px;
        }

        .challenge-habit-row {
            display: flex;
            gap: 8px;
            align-items: center;
            padding: 12px;
            background: var(--gray-50);
            border-radius: var(--radius-sm);
        }

        .challenge-habit-row input[type="text"] {
            flex: 1;
            padding: 8px 12px;
            border: 1px solid var(--gray-200);
            border-radius: var(--radius-sm);
            font-size: 0.9rem;
        }

        .challenge-habit-row select {
            padding: 8px;
            border: 1px solid var(--gray-200);
            border-radius: var(--radius-sm);
            font-size: 0.9rem;
        }

        .challenge-habit-symbol {
            width: 40px;
            text-align: center;
            font-size: 1.2rem;
            cursor: pointer;
        }

        .challenge-habit-color {
            width: 32px;
            height: 32px;
            border: none;
            border-radius: 50%;
            cursor: pointer;
            padding: 0;
        }

        .btn-remove-challenge-habit {
            width: 28px;
            height: 28px;
            border: none;
            background: #ef4444;
            color: white;
            border-radius: 50%;
            cursor: pointer;
            font-size: 1rem;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .btn-remove-challenge-habit:hover {
            background: #dc2626;
        }

        .btn-add-challenge-habit {
            padding: 10px 16px;
            background: var(--gray-100);
            color: var(--gray-700);
            border: 2px dashed var(--gray-300);
            border-radius: var(--radius-sm);
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            width: 100%;
        }

        .btn-add-challenge-habit:hover {
            background: var(--gray-200);
            border-color: var(--gray-400);
        }

        /* Empty State */
        .empty-state {
            text-align: center;
            padding: 60px 20px;
            color: var(--gray-500);
        }

        .empty-state-icon {
            font-size: 4rem;
            margin-bottom: 16px;
        }

        .empty-state h3 {
            font-size: 1.25rem;
            color: var(--gray-700);
            margin-bottom: 8px;
        }

        /* Loading */
        .loading {
            text-align: center;
            padding: 40px;
            color: var(--gray-500);
        }

        .spinner {
            width: 40px;
            height: 40px;
            border: 4px solid var(--gray-200);
            border-top-color: var(--primary);
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin: 0 auto 16px;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        /* Modal */
        .modal-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: 1000;
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s;
        }

        .modal-overlay.active {
            opacity: 1;
            visibility: visible;
        }

        #symbolPickerModal {
            z-index: 1100;
        }

        /* Post-Signup Onboarding Overlay */
        .onboarding-overlay {
            position: fixed;
            inset: 0;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            z-index: 1500;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 24px;
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.4s ease, visibility 0.4s ease;
            overflow-y: auto;
        }

        .onboarding-overlay.active {
            opacity: 1;
            visibility: visible;
        }

        .onboarding-content {
            max-width: 400px;
            width: 100%;
            text-align: center;
            color: white;
            animation: pwaSlideUp 0.5s ease-out;
        }

        .onboarding-logo {
            width: 72px;
            height: 72px;
            border-radius: 16px;
            margin-bottom: 20px;
        }

        .onboarding-title {
            font-size: 1.8rem;
            font-weight: 700;
            margin-bottom: 8px;
            color: white;
        }

        .onboarding-subtitle {
            font-size: 1.05rem;
            opacity: 0.9;
            margin-bottom: 32px;
            line-height: 1.5;
        }

        .onboarding-section {
            margin-bottom: 24px;
            text-align: left;
        }

        .onboarding-label {
            display: block;
            font-size: 0.95rem;
            font-weight: 600;
            margin-bottom: 10px;
            color: rgba(255, 255, 255, 0.9);
        }

        .onboarding-overlay .bg-picker-grid {
            justify-content: center;
        }

        .onboarding-overlay .bg-picker-swatch.selected {
            border-color: white;
            box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5), 0 0 0 4px white;
        }

        .onboarding-overlay .view-mode-btn {
            background: rgba(255, 255, 255, 0.15);
            border-color: rgba(255, 255, 255, 0.3);
            color: rgba(255, 255, 255, 0.8);
            backdrop-filter: blur(10px);
            flex-direction: column;
            padding: 16px 12px 12px;
        }

        .onboarding-overlay .view-mode-btn:hover {
            border-color: rgba(255, 255, 255, 0.6);
        }

        .onboarding-overlay .view-mode-btn.selected {
            background: rgba(255, 255, 255, 0.25);
            border-color: white;
            color: white;
            font-weight: 600;
            box-shadow: 0 0 0 1px white;
        }

        .mode-preview {
            margin-bottom: 10px;
        }

        .mode-preview-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 6px;
            justify-items: center;
        }

        .mini-pot {
            width: 36px;
            height: 40px;
            background: linear-gradient(to bottom, rgba(255,255,255,0.12), rgba(255,255,255,0.04));
            border: 1px solid rgba(255,255,255,0.3);
            border-radius: 4px 4px 6px 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
        }

        .mini-pot::before {
            content: '';
            position: absolute;
            top: -3px;
            left: -2px;
            right: -2px;
            height: 6px;
            background: linear-gradient(180deg, rgba(255,255,255,0.3), rgba(255,255,255,0.15));
            border: 1px solid rgba(255,255,255,0.4);
            border-radius: 3px;
        }

        .mini-pot span {
            font-size: 16px;
            position: relative;
            top: -2px;
        }

        .mini-circle {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            box-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
        }

        .mode-label {
            font-size: 0.9rem;
            font-weight: 500;
        }

        .onboarding-cta-btn {
            background: white;
            color: #667eea;
            border: none;
            padding: 14px 48px;
            font-size: 1.1rem;
            font-weight: 700;
            border-radius: 50px;
            cursor: pointer;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            transition: transform 0.2s ease, box-shadow 0.2s ease;
            margin-top: 8px;
        }

        .onboarding-cta-btn:active {
            transform: scale(0.96);
        }

        @media (max-width: 480px) {
            .onboarding-title {
                font-size: 1.5rem;
            }
            .onboarding-subtitle {
                font-size: 0.95rem;
            }
        }

        /* PWA Onboarding Overlay */
        .pwa-onboarding-overlay {
            position: fixed;
            inset: 0;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            z-index: 2000;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 24px;
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.4s ease, visibility 0.4s ease;
        }

        .pwa-onboarding-overlay.active {
            opacity: 1;
            visibility: visible;
        }

        .pwa-onboarding-content {
            max-width: 360px;
            width: 100%;
            text-align: center;
            color: white;
            animation: pwaSlideUp 0.5s ease-out;
        }

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

        .pwa-logo {
            width: 72px;
            height: 72px;
            border-radius: 16px;
            margin-bottom: 20px;
        }

        .pwa-title {
            font-size: 1.8rem;
            font-weight: 700;
            margin-bottom: 8px;
            color: white;
        }

        .pwa-subtitle {
            font-size: 1.05rem;
            opacity: 0.9;
            margin-bottom: 32px;
            line-height: 1.5;
        }

        .pwa-steps {
            display: flex;
            flex-direction: column;
            gap: 16px;
            margin-bottom: 36px;
        }

        .pwa-step {
            display: flex;
            align-items: center;
            gap: 10px;
            background: rgba(255, 255, 255, 0.15);
            backdrop-filter: blur(10px);
            border-radius: var(--radius);
            padding: 16px 20px;
            font-size: 1.05rem;
            justify-content: center;
            flex-wrap: wrap;
        }

        .pwa-step-number {
            flex-shrink: 0;
            width: 28px;
            height: 28px;
            border-radius: 50%;
            background: white;
            color: #667eea;
            font-weight: 700;
            font-size: 0.9rem;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .pwa-share-svg {
            color: white;
            flex-shrink: 0;
        }

        .pwa-dismiss-btn {
            background: white;
            color: #667eea;
            border: none;
            padding: 14px 48px;
            font-size: 1.1rem;
            font-weight: 700;
            border-radius: 50px;
            cursor: pointer;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            transition: transform 0.2s ease, box-shadow 0.2s ease;
        }

        .pwa-dismiss-btn:active {
            transform: scale(0.96);
        }

        .pwa-bottom-arrow {
            position: fixed;
            bottom: 12px;
            opacity: 0.9;
        }

        .pwa-arrow-center {
            left: 50%;
            right: auto;
            transform: translateX(-50%);
            animation: pwaArrowBounce 1.5s ease-in-out infinite;
        }

        .pwa-arrow-right {
            right: 24px;
            left: auto;
            transform: none;
            animation: pwaArrowBounceRight 1.5s ease-in-out infinite;
        }

        @keyframes pwaArrowBounce {
            0%, 100% { transform: translateX(-50%) translateY(0); }
            50% { transform: translateX(-50%) translateY(-10px); }
        }

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

        .pwa-alt-link {
            margin-top: 16px;
            font-size: 0.95rem;
            opacity: 0.8;
            cursor: pointer;
            text-decoration: underline;
            color: white;
        }

        .pwa-alt-link:active {
            opacity: 1;
        }

        @media (max-width: 480px) {
            .pwa-title {
                font-size: 1.5rem;
            }
            .pwa-subtitle {
                font-size: 0.95rem;
            }
            .pwa-step {
                font-size: 0.95rem;
                padding: 14px 16px;
            }
        }

        .modal {
            background: white;
            border-radius: var(--radius);
            padding: 24px;
            width: 90%;
            max-width: 500px;
            max-height: 90vh;
            overflow-y: auto;
            transform: scale(0.9);
            transition: transform 0.3s;
        }

        .modal-overlay.active .modal {
            transform: scale(1);
        }

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

        .modal-title {
            font-size: 1.25rem;
            font-weight: 600;
        }

        .modal-close {
            background: none;
            border: none;
            font-size: 1.5rem;
            cursor: pointer;
            color: var(--gray-400);
            padding: 4px;
        }

        .modal-close:hover {
            color: var(--gray-600);
        }

        .modal-actions {
            display: flex;
            gap: 12px;
            justify-content: flex-end;
            margin-top: 24px;
        }

        .modal-actions .btn {
            width: auto;
        }

        /* Background Picker */
        .bg-picker-grid {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin-top: 8px;
        }

        .bg-picker-swatch {
            width: 48px;
            height: 48px;
            border-radius: 50%;
            cursor: pointer;
            border: 3px solid transparent;
            transition: transform 0.15s, border-color 0.15s;
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 1px 4px rgba(0,0,0,0.2);
        }

        .bg-picker-swatch:hover {
            transform: scale(1.12);
        }

        .bg-picker-swatch.selected {
            border-color: var(--primary);
            box-shadow: 0 0 0 2px white, 0 0 0 4px var(--primary);
        }

        .bg-picker-check {
            color: white;
            font-size: 18px;
            font-weight: bold;
            text-shadow: 0 1px 3px rgba(0,0,0,0.5);
        }

        /* View Mode Toggle */
        .view-mode-toggle {
            display: flex;
            gap: 8px;
            margin-top: 8px;
        }
        .view-mode-btn {
            flex: 1;
            padding: 10px 16px;
            border: 2px solid var(--gray-200);
            border-radius: var(--radius-sm);
            background: white;
            color: var(--gray-600);
            font-size: 0.9rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
        }
        .view-mode-btn:hover {
            border-color: var(--primary-light);
        }
        .view-mode-btn.selected {
            border-color: var(--primary);
            background: linear-gradient(to bottom, #f0f0ff, white);
            color: var(--primary);
            font-weight: 600;
            box-shadow: 0 0 0 1px var(--primary);
        }

        /* Light theme overrides (for light background gradients) */
        body.light-theme header { color: #1f2937; }
        body.light-theme header h1 { text-shadow: none; }
        body.light-theme .invite-friend-link { color: #1f2937; background: rgba(0,0,0,0.08); }
        body.light-theme .invite-friend-link:hover { background: rgba(0,0,0,0.15); }
        body.light-theme .user-info span { background: rgba(0,0,0,0.08); }
        body.light-theme .user-info span:hover { background: rgba(0,0,0,0.15); }
        body.light-theme .user-info button { color: #1f2937; background: rgba(0,0,0,0.08); }
        body.light-theme .user-info button:hover { background: rgba(0,0,0,0.15); }
        body.light-theme .community-subtabs { background: rgba(0,0,0,0.06); }
        body.light-theme .community-subtab { color: rgba(0,0,0,0.6); }
        body.light-theme .community-subtab:hover { color: #1f2937; background: rgba(0,0,0,0.08); }
        body.light-theme .community-subtab.active { color: var(--primary); background: white; }
        body.light-theme .community-action-btn { background: rgba(0,0,0,0.06); border-color: rgba(0,0,0,0.1); color: #1f2937; }
        body.light-theme .community-action-btn:hover { background: rgba(0,0,0,0.1); }
        body.light-theme .community-plant-tile { background: rgba(0,0,0,0.05); }
        body.light-theme .community-plant-tile:hover { background: rgba(0,0,0,0.08); }
        body.light-theme .plant-tile-health { color: rgba(0,0,0,0.6); }
        body.light-theme .plant-tile-name { color: #1f2937; }
        body.light-theme .plant-tile-user { color: rgba(0,0,0,0.4); }
        body.light-theme .dashboard-habit-name { color: #1f2937; text-shadow: none; }
        body.light-theme .dashboard-circle:not(.completed) .streak { color: #1f2937; text-shadow: none; }
        body.light-theme .dashboard-detail-btn { color: #1f2937; background: rgba(0,0,0,0.08); border-color: rgba(0,0,0,0.15); }
        body.light-theme .dashboard-detail-btn:hover { background: rgba(0,0,0,0.15); }
        body.light-theme .dashboard-empty { color: #1f2937; }
        body.light-theme .garden-pot-rim { border-color: rgba(0,0,0,0.2); background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.05) 100%); }
        body.light-theme .garden-pot-body { border-color: rgba(0,0,0,0.16); background: linear-gradient(180deg, rgba(0,0,0,0.07) 0%, rgba(0,0,0,0.04) 100%); }
        body.light-theme .garden-detail-btn { color: #1f2937; background: rgba(0,0,0,0.08); border-color: rgba(0,0,0,0.15); }
        body.light-theme .garden-detail-btn:hover { background: rgba(0,0,0,0.15); }
        body.light-theme .challenge-preview-section-title { color: #1f2937; }
        body.light-theme .challenge-preview-card--discover { background: rgba(0, 0, 0, 0.06); border-color: rgba(0, 0, 0, 0.1); }
        body.light-theme .challenge-discover-name { color: #1f2937; text-shadow: none; }
        body.light-theme .challenge-discover-description { color: rgba(0, 0, 0, 0.6); }
        body.light-theme .challenge-discover-habit-name { color: rgba(0, 0, 0, 0.6); text-shadow: none; }
        body.light-theme .challenge-preview-card--discover .challenge-preview-avatar { background: rgba(0, 0, 0, 0.1); color: #1f2937; border-color: rgba(0, 0, 0, 0.15); text-shadow: none; }
        body.light-theme .challenge-preview-card--discover .challenge-preview-joined-count { color: rgba(0, 0, 0, 0.6); text-shadow: none; }

        /* Habit Detail Modal */
        .habit-detail-card {
            padding: 4px 0;
            border-radius: var(--radius-sm);
        }

        .habit-detail-actions {
            display: flex;
            gap: 8px;
            margin-bottom: 16px;
            flex-wrap: wrap;
        }

        .detail-back-row {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 8px 0 12px;
            font-size: 0.9rem;
            font-weight: 600;
            color: var(--primary);
            cursor: pointer;
        }

        .detail-back-row:hover {
            opacity: 0.7;
        }

        .detail-back-arrow {
            font-size: 1.1rem;
        }

        /* Day Edit Modal */
        .day-habits-list {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .day-habit-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 12px 16px;
            background: var(--gray-50);
            border-radius: var(--radius-sm);
            cursor: pointer;
            transition: all 0.2s;
            border: 2px solid transparent;
        }

        .day-habit-item:hover {
            background: var(--gray-100);
        }

        .day-habit-item.completed {
            background: var(--success-light);
            border-color: var(--success);
        }

        .day-habit-item .habit-name {
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .day-habit-item .habit-color {
            width: 12px;
            height: 12px;
            border-radius: 50%;
        }

        .day-habit-item .status-icon {
            font-size: 1.25rem;
        }

        /* Responsive */
        @media (max-width: 768px) {
            header {
                flex-wrap: wrap;
            }

            .header-brand {
                gap: 12px;
            }

            .header-logo {
                width: 45px;
                height: 45px;
            }

            header h1 {
                font-size: 1.3rem;
            }

            header p {
                font-size: 0.75rem;
            }

            .header-right {
                gap: 8px;
            }

            .invite-friend-link {
                font-size: 0.75rem;
                padding: 6px 10px;
            }

            .user-info span {
                font-size: 0.75rem;
                padding: 5px 10px;
            }

            .user-info button {
                font-size: 0.75rem;
                padding: 5px 10px;
            }

            .user-info {
                gap: 8px;
            }


            .habit-stats {
                gap: 16px;
            }

            .calendar-day {
                padding: 2px;
            }

            .calendar-day-number {
                font-size: 0.7rem;
                margin-top: 12px;
            }

            .stats-grid {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        @media (max-width: 480px) {
            header p {
                display: none;
            }

            .nav-btn {
                min-width: 48px;
                padding: 6px 8px;
                font-size: 0.6rem;
            }

            .nav-btn-icon {
                font-size: 1.2rem;
            }

            .bottom-nav-inner {
                gap: 2px;
                padding: 4px 6px;
            }
        }

        /* Streak animation */
        @keyframes flame {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.1); }
        }

        .streak-fire {
            animation: flame 1s ease-in-out infinite;
            display: inline-block;
        }

        /* Hide when not logged in */
        .app-main { display: none; }
        .app-main.visible { display: block; padding-bottom: 90px; }
        .auth-section { display: none; }
        .auth-section.visible { display: block; }

        /* Landing Page */
        .landing-section {
            display: none;
            padding: 20px 20px;
        }
        .landing-section.visible { display: block; }

        .landing-container {
            max-width: 1000px;
            margin: 0 auto;
            text-align: center;
        }

        .tribe-invite-message {
            display: none;
            background: rgba(255, 255, 255, 0.15);
            backdrop-filter: blur(10px);
            border-radius: var(--radius);
            padding: 24px;
            margin-bottom: 32px;
            color: white;
            text-align: center;
        }

        .tribe-invite-message.visible {
            display: block;
        }

        .tribe-invite-message h2 {
            font-size: 1.5rem;
            margin-bottom: 12px;
            color: white;
        }

        .tribe-invite-message p {
            font-size: 1.1rem;
            line-height: 1.6;
            opacity: 0.95;
            margin-bottom: 16px;
        }

        .tribe-invite-message a {
            color: #FFD700;
            font-weight: 600;
            cursor: pointer;
            text-decoration: underline;
        }

        .tribe-invite-message a:hover {
            color: #FFF;
        }

        /* Slideshow */
        .slideshow-container {
            position: relative;
            max-width: 600px;
            max-height: 70vh;
            margin: 0 auto 20px;
            overflow: hidden;
            overflow-y: auto;
            border-radius: var(--radius);
            box-shadow: 0 20px 60px rgba(0,0,0,0.3);
        }

        .slideshow-track {
            display: flex;
            align-items: flex-start;
            transition: transform 0.5s ease-in-out;
        }

        .slide {
            min-width: 100%;
            display: flex;
            flex-direction: column;
        }

        .slide img {
            width: 100%;
            height: auto;
            display: block;
        }

        .slide-caption {
            background: rgba(0,0,0,0.7);
            color: white;
            padding: 12px 20px;
            font-size: 1.1rem;
            font-weight: 600;
            text-align: center;
        }

        .slide-centered {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            background: var(--gray-900);
        }

        .slide-centered img {
            width: auto;
            max-width: 90%;
            height: auto;
            max-height: 280px;
            object-fit: contain;
            border-radius: 8px;
        }

        .slide-centered .slide-caption {
            position: static;
            background: none;
            text-align: center;
            padding: 16px 20px 20px;
        }

        .slideshow-dots {
            display: flex;
            justify-content: center;
            gap: 12px;
            margin-top: 12px;
        }

        .slideshow-dot {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            background: rgba(255,255,255,0.4);
            border: none;
            cursor: pointer;
            transition: all 0.3s;
        }

        .slideshow-dot.active {
            background: white;
            transform: scale(1.2);
        }

        .slideshow-dot:hover {
            background: rgba(255,255,255,0.7);
        }

        .slideshow-nav {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            background: rgba(255,255,255,0.9);
            border: none;
            width: 44px;
            height: 44px;
            border-radius: 50%;
            cursor: pointer;
            font-size: 1.2rem;
            color: var(--gray-700);
            transition: all 0.2s;
            z-index: 10;
        }

        .slideshow-nav:hover {
            background: white;
            transform: translateY(-50%) scale(1.1);
        }

        .slideshow-nav.prev { left: 16px; }
        .slideshow-nav.next { right: 16px; }

        /* Landing Buttons */
        .landing-buttons {
            display: flex;
            flex-direction: column;
            gap: 12px;
            align-items: center;
            margin-top: 20px;
        }

        .btn-cta {
            padding: 14px 36px;
            font-size: 1.1rem;
            font-weight: 700;
            border: none;
            border-radius: 50px;
            cursor: pointer;
            transition: all 0.3s;
            min-width: 300px;
        }

        .btn-cta-primary {
            background: linear-gradient(135deg, #10b981 0%, #059669 100%);
            color: white;
            box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
        }

        .btn-cta-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 30px rgba(16, 185, 129, 0.5);
        }

        .btn-cta-secondary {
            background: rgba(255,255,255,0.15);
            color: white;
            border: 2px solid rgba(255,255,255,0.3);
            backdrop-filter: blur(10px);
        }

        .btn-cta-secondary:hover {
            background: rgba(255,255,255,0.25);
            border-color: rgba(255,255,255,0.5);
        }

        @media (min-width: 600px) {
            .landing-buttons {
                flex-direction: row;
                justify-content: center;
            }
            .btn-cta {
                min-width: 280px;
            }
        }

        @media (max-width: 600px) {
            .app-container:has(.landing-section.visible) header h1 {
                font-size: 1.8rem;
            }
            .app-container:has(.landing-section.visible) header p {
                font-size: 1rem;
            }
            .slideshow-nav {
                width: 36px;
                height: 36px;
                font-size: 1rem;
            }
            .slideshow-nav.prev { left: 8px; }
            .slideshow-nav.next { right: 8px; }
            .btn-cta {
                min-width: 100%;
                padding: 16px 32px;
                font-size: 1.1rem;
            }
        }

        @keyframes crownBob {
            0%, 100% { transform: translateX(-50%) translateY(0); }
            50% { transform: translateX(-50%) translateY(-3px); }
        }

        /* Symbol Picker */
        .symbol-picker-btn {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 12px 16px;
            border: 2px solid var(--gray-200);
            border-radius: var(--radius-sm);
            background: white;
            cursor: pointer;
            font-size: 1.5rem;
            transition: all 0.2s;
        }

        .symbol-picker-btn:hover {
            border-color: var(--primary);
        }

        .symbol-picker-btn span {
            font-size: 0.9rem;
            color: var(--gray-500);
        }

        .symbol-tabs {
            display: flex;
            gap: 4px;
            margin-bottom: 16px;
            border-bottom: 2px solid var(--gray-200);
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            scrollbar-width: thin;
        }

        .symbol-tab {
            padding: 8px 12px;
            white-space: nowrap;
            flex-shrink: 0;
            border: none;
            background: none;
            cursor: pointer;
            font-size: 0.85rem;
            font-weight: 500;
            color: var(--gray-500);
            border-bottom: 2px solid transparent;
            margin-bottom: -2px;
            transition: all 0.2s;
        }

        .symbol-tab:hover {
            color: var(--gray-700);
        }

        .symbol-tab.active {
            color: var(--primary);
            border-bottom-color: var(--primary);
        }

        .symbol-grid {
            display: grid;
            grid-template-columns: repeat(6, 1fr);
            gap: 8px;
            max-height: 250px;
            overflow-y: auto;
        }

        .symbol-option {
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 12px;
            font-size: 1.5rem;
            border: 2px solid var(--gray-200);
            border-radius: var(--radius-sm);
            background: white;
            cursor: pointer;
            transition: all 0.2s;
        }

        .symbol-option:hover {
            border-color: var(--primary);
            background: var(--primary-light);
            transform: scale(1.1);
        }

        .symbol-option.selected {
            border-color: var(--primary);
            background: var(--primary-light);
        }

        /* ============== DASHBOARD MODE ============== */
        .dashboard-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 24px;
            padding: 20px;
            max-width: 600px;
            margin: 0 auto;
        }
        @media (min-width: 768px) {
            .dashboard-grid {
                grid-template-columns: repeat(3, 1fr);
                max-width: 800px;
            }
        }
        @media (min-width: 1024px) {
            .dashboard-grid {
                grid-template-columns: repeat(4, 1fr);
                max-width: 1000px;
            }
        }
        .dashboard-habit {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 12px;
            position: relative;
        }
        .dashboard-circle {
            width: 120px;
            height: 120px;
            border-radius: 50%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
            background: transparent;
            border: 4px solid;
            overflow: hidden;
        }
        .dashboard-circle::before {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            width: 0;
            height: 0;
            border-radius: 50%;
            background: var(--habit-light, #e5e7eb);
            transform: translate(-50%, -50%);
            transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
            z-index: 0;
        }
        .dashboard-circle.completed::before {
            width: 160%;
            height: 160%;
        }
        .dashboard-circle:hover {
            transform: scale(1.05);
            box-shadow: 0 10px 40px rgba(0,0,0,0.2);
        }
        .dashboard-circle:active {
            transform: scale(0.95);
        }
        .dashboard-circle.completed {
            box-shadow: 0 8px 30px rgba(0,0,0,0.15), 0 0 0 4px rgba(255,255,255,0.3);
        }
        .dashboard-circle.completed:hover {
            box-shadow: 0 12px 40px rgba(0,0,0,0.2), 0 0 0 4px rgba(255,255,255,0.4);
        }
        .dashboard-circle.animating {
            animation: completePulse 0.6s cubic-bezier(0.4, 0, 0.2, 1);
        }
        .dashboard-circle .symbol {
            font-size: 2.5rem;
            z-index: 1;
            transition: all 0.3s ease;
        }
        .dashboard-circle .streak {
            font-size: 0.9rem;
            font-weight: 700;
            z-index: 1;
            margin-top: 4px;
            transition: all 0.3s ease;
        }
        .dashboard-circle:not(.completed) .symbol {
            filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
        }
        .dashboard-circle:not(.completed) .streak {
            color: white;
            text-shadow: 0 1px 2px rgba(0,0,0,0.2);
        }
        .dashboard-circle.completed .symbol {
            filter: drop-shadow(0 2px 8px rgba(0,0,0,0.15));
        }
        .dashboard-circle.completed .streak {
            text-shadow: 0 1px 2px rgba(0,0,0,0.1);
        }
        .dashboard-habit-name {
            font-size: 0.85rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: white;
            text-align: center;
            text-shadow: 0 2px 4px rgba(0,0,0,0.2);
            max-width: 140px;
            line-height: 1.3;
        }
        .dashboard-detail-btn {
            padding: 6px 16px;
            font-size: 0.75rem;
            font-weight: 600;
            color: white;
            background: rgba(255,255,255,0.15);
            border: 1px solid rgba(255,255,255,0.3);
            border-radius: 20px;
            cursor: pointer;
            transition: all 0.2s;
        }
        .dashboard-detail-btn:hover {
            background: rgba(255,255,255,0.25);
        }
        .dashboard-empty {
            text-align: center;
            padding: 60px 20px;
            color: white;
        }
        .dashboard-empty-icon {
            font-size: 4rem;
            margin-bottom: 16px;
            opacity: 0.8;
        }
        .dashboard-empty h3 {
            font-size: 1.5rem;
            margin-bottom: 8px;
        }
        .dashboard-empty p {
            opacity: 0.8;
            margin-bottom: 20px;
        }
        /* Dashboard Jedi badges */
        .dashboard-habit .jedi-crown {
            position: absolute;
            top: -8px;
            left: 50%;
            transform: translateX(-50%);
            font-size: 18px;
            z-index: 10;
            filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
        }
        .dashboard-habit .jedi-crown.grand-master {
            font-size: 22px;
            top: -10px;
            animation: crownBob 2s ease-in-out infinite;
        }
        .dashboard-circle .jedi-badge {
            font-size: 0.6rem;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 1px;
            padding: 2px 8px;
            border-radius: 10px;
            z-index: 1;
            margin-top: 2px;
            white-space: nowrap;
            line-height: 1.2;
        }
        .dashboard-circle .jedi-badge.initiate {
            background: rgba(255, 255, 255, 0.85);
            color: #374151;
        }
        .dashboard-circle .jedi-badge.apprentice {
            background: linear-gradient(135deg, #3b82f6, #1d4ed8);
            color: white;
        }
        .dashboard-circle .jedi-badge.padawan {
            background: linear-gradient(135deg, #10b981, #059669);
            color: white;
        }
        .dashboard-circle .jedi-badge.jedi-knight {
            background: linear-gradient(135deg, #8b5cf6, #6d28d9);
            color: white;
        }
        .dashboard-circle .jedi-badge.jedi-master {
            background: linear-gradient(135deg, #f59e0b, #d97706);
            color: white;
        }
        .dashboard-circle .jedi-badge.grand-master {
            background: linear-gradient(135deg, #fbbf24, #f59e0b);
            color: #1f2937;
            animation: grandMasterPulse 1.5s infinite;
        }
        .dashboard-circle.jedi-level-padawan {
            box-shadow: 0 0 15px rgba(16, 185, 129, 0.5), 0 0 30px rgba(16, 185, 129, 0.2);
        }
        .dashboard-circle.jedi-level-jedi-knight {
            box-shadow: 0 0 20px rgba(139, 92, 246, 0.6), 0 0 40px rgba(139, 92, 246, 0.3);
        }
        .dashboard-circle.jedi-level-jedi-master {
            box-shadow: 0 0 25px rgba(245, 158, 11, 0.6), 0 0 50px rgba(245, 158, 11, 0.3);
            animation: masterShimmer 2s infinite;
        }
        .dashboard-circle.jedi-level-grand-master {
            box-shadow: 0 0 30px rgba(251, 191, 36, 0.7), 0 0 60px rgba(251, 191, 36, 0.4);
            animation: grandMasterAura 1.5s infinite;
        }

        /* ============== GARDEN TAB ============== */
        .garden-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 12px;
        }

        @media (min-width: 768px) {
            .garden-grid {
                grid-template-columns: repeat(3, 1fr);
            }
        }

        .garden-plant-card {
            background: transparent;
            overflow: visible;
            position: relative;
        }

        .garden-plant-container {
            background: #1a1a1a;
            border-radius: var(--radius) var(--radius) 0 0;
            overflow: hidden;
            position: relative;
            aspect-ratio: 1 / 1;
        }

        .garden-plant-container.loading::after {
            content: 'Loading...';
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            background: #1a1a1a;
            color: #888;
            font-size: 0.75rem;
        }

        .garden-plant-video {
            width: 100%;
            height: 100%;
            display: block;
            object-fit: cover;
        }

        /* Health badge — bottom-right of plant video */
        .garden-health-badge {
            position: absolute;
            bottom: 8px;
            right: 8px;
            z-index: 2;
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .garden-health-number {
            width: 48px;
            height: 48px;
            border-radius: 50%;
            border: 2px solid #5cb85c;
            background: transparent;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1rem;
            font-weight: 800;
            color: #fff;
            text-shadow: 0 1px 4px rgba(0,0,0,0.7);
        }

        .garden-health-label {
            font-size: 0.55rem;
            font-weight: 700;
            color: #fff;
            text-shadow: 0 1px 3px rgba(0,0,0,0.7);
            margin-top: 2px;
            white-space: nowrap;
        }

        /* Habit name centered in pot */
        .garden-pot-name {
            font-size: 0.8rem;
            font-weight: 700;
            color: #fff;
            text-align: center;
            margin-bottom: 4px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            width: 100%;
        }

        /* Pot shape — white outline with cloudy gradient */
        .garden-pot {
            position: relative;
        }

        .garden-pot-rim {
            height: 10px;
            background: linear-gradient(180deg, rgba(255,255,255,0.42) 0%, rgba(255,255,255,0.27) 100%);
            border: 1px solid rgba(255,255,255,0.52);
            border-bottom: none;
            border-radius: 4px 4px 0 0;
            margin: 0 -2px;
        }

        .garden-pot-body {
            background: linear-gradient(180deg, rgba(255,255,255,0.24) 0%, rgba(255,255,255,0.16) 100%);
            border: 1px solid rgba(255,255,255,0.42);
            border-top: none;
            text-align: center;
            padding: 10px 10px 8px;
            clip-path: polygon(2% 0%, 98% 0%, 88% 100%, 12% 100%);
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .garden-unplant-btn {
            display: block;
            margin: 6px auto 0;
            padding: 2px 8px;
            font-size: 0.6rem;
            color: rgba(255,255,255,0.5);
            background: none;
            border: 1px solid rgba(255,255,255,0.25);
            border-radius: 10px;
            cursor: pointer;
        }

        .garden-unplant-btn:hover {
            color: #fff;
            border-color: rgba(255,255,255,0.6);
        }

        /* Habit Card button in pot */
        .garden-detail-btn {
            display: block;
            margin: 6px auto 0;
            padding: 2px 10px;
            font-size: 0.6rem;
            font-weight: 600;
            color: rgba(255,255,255,0.85);
            background: rgba(255,255,255,0.15);
            border: 1px solid rgba(255,255,255,0.3);
            border-radius: 10px;
            cursor: pointer;
            transition: all 0.2s;
        }

        .garden-detail-btn:hover {
            color: #fff;
            background: rgba(255,255,255,0.25);
            border-color: rgba(255,255,255,0.5);
        }

        /* Jedi crown in garden pot */
        .garden-pot-body .jedi-crown {
            font-size: 14px;
            z-index: 10;
            filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
            margin-bottom: -4px;
        }

        .garden-pot-body .jedi-crown.grand-master {
            font-size: 16px;
            animation: crownBob 2s ease-in-out infinite;
        }

        .garden-pot-circle {
            width: 76px;
            height: 76px;
            border-radius: 50%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
            background: transparent;
            border: 3px solid;
            border-color: color-mix(in srgb, var(--habit-color, #9ca3af) 75%, transparent);
            overflow: hidden;
        }

        .garden-pot-circle::before {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            width: 0;
            height: 0;
            border-radius: 50%;
            background: var(--habit-light, #e5e7eb);
            transform: translate(-50%, -50%);
            transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
            z-index: 0;
        }

        .garden-pot-circle.completed::before {
            width: 160%;
            height: 160%;
        }

        @keyframes completePulse {
            0% { transform: scale(1); }
            25% { transform: scale(1.2); }
            50% { transform: scale(0.93); }
            75% { transform: scale(1.05); }
            100% { transform: scale(1); }
        }

        .garden-pot-circle:hover {
            transform: scale(1.08);
            box-shadow: 0 4px 20px rgba(0,0,0,0.15);
        }

        .garden-pot-circle:active {
            transform: scale(0.92);
        }

        .garden-pot-circle.completed {
            background: var(--habit-light, #e5e7eb);
            border-color: var(--habit-color, #6b7280);
            border-width: 3px;
            box-shadow: 0 2px 12px color-mix(in srgb, var(--habit-color, #6b7280) 35%, transparent);
        }

        .garden-pot-circle.animating {
            animation: completePulse 0.6s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .garden-pot-circle .symbol {
            font-size: 1.5rem;
            z-index: 1;
            transition: all 0.3s ease;
        }

        .garden-pot-circle .streak {
            font-size: 0.55rem;
            font-weight: 700;
            z-index: 1;
            margin-top: 1px;
            transition: all 0.3s ease;
        }

        .garden-pot-circle:not(.completed) .symbol {
            filter: drop-shadow(0 1px 3px rgba(0,0,0,0.4));
        }

        .garden-pot-circle:not(.completed) .streak {
            color: white;
            text-shadow: 0 1px 3px rgba(0,0,0,0.5);
        }

        .garden-pot-circle.completed .symbol {
            opacity: 1;
            transform: scale(1.1);
            filter: drop-shadow(0 1px 4px rgba(0,0,0,0.2));
        }

        /* Jedi badge in garden circle */
        .garden-pot-circle .jedi-badge {
            font-size: 0.4rem;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            padding: 1px 5px;
            border-radius: 8px;
            z-index: 1;
            margin-top: 1px;
            white-space: nowrap;
            line-height: 1.2;
        }

        .garden-pot-circle .jedi-badge.initiate {
            background: rgba(255, 255, 255, 0.85);
            color: #374151;
        }

        .garden-pot-circle .jedi-badge.apprentice {
            background: linear-gradient(135deg, #3b82f6, #1d4ed8);
            color: white;
        }

        .garden-pot-circle .jedi-badge.padawan {
            background: linear-gradient(135deg, #10b981, #059669);
            color: white;
        }

        .garden-pot-circle .jedi-badge.jedi-knight {
            background: linear-gradient(135deg, #8b5cf6, #6d28d9);
            color: white;
        }

        .garden-pot-circle .jedi-badge.jedi-master {
            background: linear-gradient(135deg, #f59e0b, #d97706);
            color: white;
        }

        .garden-pot-circle .jedi-badge.grand-master {
            background: linear-gradient(135deg, #fbbf24, #f59e0b);
            color: #1f2937;
        }

        /* Jedi level glow on garden circles */
        .garden-pot-circle.jedi-level-padawan {
            box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
        }

        .garden-pot-circle.jedi-level-jedi-knight {
            box-shadow: 0 0 12px rgba(139, 92, 246, 0.5);
        }

        .garden-pot-circle.jedi-level-jedi-master {
            box-shadow: 0 0 15px rgba(245, 158, 11, 0.5);
        }

        .garden-pot-circle.jedi-level-grand-master {
            box-shadow: 0 0 18px rgba(251, 191, 36, 0.6);
        }

        /* Weekly goal badge */
        .weekly-goal-badge {
            position: absolute;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            background: linear-gradient(135deg, #FFD700, #F5B800);
            color: #5C4A1E;
            font-weight: 800;
            cursor: pointer;
            z-index: 3;
            box-shadow: 0 2px 8px rgba(255, 215, 0, 0.5);
            text-shadow: 0 1px 1px rgba(0,0,0,0.1);
        }

        .garden-plant-card > .weekly-goal-badge {
            top: 8px;
            left: 8px;
            width: 24px;
            height: 24px;
            font-size: 0.7rem;
        }

        .dashboard-habit > .weekly-goal-badge {
            top: 0;
            left: calc(50% - 60px);
            width: 26px;
            height: 26px;
            font-size: 0.75rem;
        }

        .week-complete-toast {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%) scale(0.8);
            background: rgba(0, 0, 0, 0.85);
            color: #FFD700;
            font-size: 1.2rem;
            font-weight: 700;
            padding: 16px 32px;
            border-radius: 16px;
            z-index: 2000;
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.3s, transform 0.3s;
        }

        .week-complete-toast.show {
            opacity: 1;
            transform: translate(-50%, -50%) scale(1);
        }

        /* Add plant card */
        .garden-add-card {
            background: white;
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            min-height: 200px;
            cursor: pointer;
            border: 2px dashed var(--gray-200);
            transition: all 0.2s;
        }

        .garden-add-card:hover {
            border-color: var(--primary);
            background: var(--primary-light);
        }

        .garden-add-icon {
            font-size: 2rem;
            color: var(--gray-400);
            margin-bottom: 8px;
        }

        .garden-add-text {
            font-size: 0.85rem;
            font-weight: 600;
            color: var(--gray-500);
        }

        /* Habit selector modal */
        .garden-no-habits-msg {
            text-align: center;
            color: var(--gray-500);
            padding: 20px;
            font-size: 0.9rem;
        }

        /* Empty state */
        .garden-empty {
            text-align: center;
            padding: 60px 20px;
        }

        .garden-empty-icon {
            font-size: 4rem;
            margin-bottom: 16px;
        }

        .garden-empty h3 {
            font-size: 1.3rem;
            color: var(--gray-800);
            margin-bottom: 8px;
        }

        .garden-empty p {
            color: var(--gray-500);
            margin-bottom: 20px;
        }

        /* Garden Stats Bar */
        .garden-stats-bar {
            display: flex;
            justify-content: space-around;
            align-items: center;
            background: white;
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            padding: 16px 12px;
            margin-top: 16px;
            gap: 8px;
        }

        .garden-stat-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
            min-width: 0;
            flex: 1;
        }

        .garden-stat-value {
            font-size: 1.1rem;
            font-weight: 700;
            color: var(--gray-800);
            white-space: nowrap;
        }

        .garden-stat-label {
            font-size: 0.7rem;
            font-weight: 600;
            color: var(--gray-500);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            white-space: nowrap;
        }

        @media (max-width: 480px) {
            .garden-stats-bar {
                flex-wrap: wrap;
                gap: 12px;
                padding: 12px 8px;
            }

            .garden-stat-item {
                flex: 0 0 calc(50% - 8px);
            }

            .garden-stat-value {
                font-size: 1rem;
            }
        }

        /* Coming Soon Overlay */
        .coming-soon-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.6);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 2000;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.3s ease;
        }

        .coming-soon-overlay.active {
            opacity: 1;
            pointer-events: auto;
        }

        .coming-soon-content {
            background: linear-gradient(135deg, var(--primary), var(--primary-dark, #4338ca));
            color: white;
            padding: 24px 40px;
            border-radius: 16px;
            font-size: 1.25rem;
            font-weight: 700;
            text-align: center;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
        }
