/* HabitForge 2.0 - Modern Console Theme (PS5/Xbox Style) */

:root {
    /* Dark backgrounds - Deep blue-gray tones */
    --hf-bg-dark: #0d1117;
    --hf-bg-card: #161b22;
    --hf-bg-card-hover: #1c2128;
    --hf-bg-elevated: #21262d;
    --hf-bg-input: #0d1117;
    --hf-bg-glass: rgba(22, 27, 34, 0.85);

    /* Console accent colors - Muted and elegant */
    --hf-accent-blue: #58a6ff;
    --hf-accent-purple: #a371f7;
    --hf-accent-green: #3fb950;
    --hf-accent-orange: #d29922;
    --hf-accent-red: #f85149;
    --hf-accent-cyan: #79c0ff;

    /* Primary gradient - Subtle blue shift */
    --hf-gradient-primary: linear-gradient(135deg, #58a6ff, #a371f7);
    --hf-gradient-success: linear-gradient(135deg, #3fb950, #56d364);
    --hf-gradient-fire: linear-gradient(135deg, #d29922, #f0883e);
    --hf-gradient-gold: linear-gradient(135deg, #e3b341, #d29922);

    /* Text - Clean and readable */
    --hf-text-primary: #e6edf3;
    --hf-text-secondary: #8b949e;
    --hf-text-muted: #6e7681;

    /* Borders - Subtle definition */
    --hf-border: #30363d;
    --hf-border-light: #3d444d;

    /* Subtle glows - Console style soft highlights */
    --hf-glow-blue: 0 0 20px rgba(88, 166, 255, 0.15);
    --hf-glow-purple: 0 0 20px rgba(163, 113, 247, 0.15);
    --hf-glow-green: 0 0 20px rgba(63, 185, 80, 0.2);
    --hf-glow-orange: 0 0 20px rgba(210, 153, 34, 0.15);

    /* Category colors - Balanced palette */
    --hf-cat-fitness: #f85149;
    --hf-cat-gesundheit: #3fb950;
    --hf-cat-produktivitaet: #58a6ff;
    --hf-cat-achtsamkeit: #a371f7;
    --hf-cat-sozial: #f0883e;
    --hf-cat-lernen: #e3b341;
    --hf-cat-allgemein: var(--hf-text-secondary);

    /* Spacing */
    --hf-space-xs: 4px;
    --hf-space-sm: 8px;
    --hf-space-md: 16px;
    --hf-space-lg: 24px;
    --hf-space-xl: 32px;

    /* Radius - Slightly softer for console feel */
    --hf-radius-sm: 8px;
    --hf-radius-md: 12px;
    --hf-radius-lg: 16px;
    --hf-radius-xl: 20px;
    --hf-radius-full: 9999px;

    /* Touch targets */
    --hf-touch-min: 48px;

    /* Transitions - Smooth console-like animations */
    --hf-transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --hf-transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --hf-transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base */
* {
    box-sizing: border-box;
}

.habitforge-app {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--hf-bg-dark);
    color: var(--hf-text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    padding-bottom: 90px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Subtle gradient background */
.habitforge-app::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at top, rgba(88, 166, 255, 0.03) 0%, transparent 50%),
                radial-gradient(ellipse at bottom right, rgba(163, 113, 247, 0.02) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

/* ============================================
   AUTH SCREENS
   ============================================ */

.hf-auth-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--hf-space-lg);
    position: relative;
    z-index: 1;
}

.hf-auth-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--hf-space-sm);
    margin-bottom: var(--hf-space-xl);
}

.hf-auth-logo svg {
    width: 64px;
    height: 64px;
    filter: drop-shadow(var(--hf-glow-blue));
}

.hf-auth-logo h1 {
    font-size: 2rem;
    font-weight: 700;
    background: var(--hf-gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.hf-auth-card {
    background: var(--hf-bg-card);
    border: 1px solid var(--hf-border);
    border-radius: var(--hf-radius-xl);
    padding: var(--hf-space-xl);
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.hf-auth-card h2 {
    font-size: 1.5rem;
    margin: 0 0 var(--hf-space-lg) 0;
    text-align: center;
}

.hf-auth-tabs {
    display: flex;
    gap: var(--hf-space-sm);
    margin-bottom: var(--hf-space-lg);
}

.hf-auth-tab {
    flex: 1;
    padding: var(--hf-space-md);
    background: transparent;
    border: 1px solid var(--hf-border);
    border-radius: var(--hf-radius-md);
    color: var(--hf-text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--hf-transition);
}

.hf-auth-tab.active {
    background: var(--hf-gradient-primary);
    border-color: transparent;
    color: var(--hf-bg-dark);
}

.hf-auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--hf-space-md);
}

.hf-auth-error {
    padding: var(--hf-space-sm) var(--hf-space-md);
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid var(--hf-accent-red);
    border-radius: var(--hf-radius-sm);
    color: var(--hf-accent-red);
    font-size: 0.875rem;
}

.hf-auth-link {
    color: var(--hf-accent-blue);
    text-decoration: none;
    font-size: 0.875rem;
    cursor: pointer;
}

.hf-auth-link:hover {
    text-decoration: underline;
}

/* Verification Banner */
.hf-verification-banner {
    background: rgba(210, 153, 34, 0.1);
    border-bottom: 1px solid var(--hf-accent-orange);
    padding: var(--hf-space-md);
    position: relative;
    z-index: 99;
}

.hf-verification-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--hf-space-md);
    max-width: 600px;
    margin: 0 auto;
    color: var(--hf-accent-orange);
    font-size: 0.875rem;
    flex-wrap: wrap;
    text-align: center;
}

/* App Container */
.hf-app-container {
    display: contents;
}

/* Profile Section */
.hf-profile-section {
    display: flex;
    flex-direction: column;
    gap: var(--hf-space-md);
}

.hf-profile-header {
    display: flex;
    align-items: center;
    gap: var(--hf-space-md);
}

.hf-profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: var(--hf-radius-full);
    border: 3px solid var(--hf-accent-blue);
    overflow: hidden;
    box-shadow: var(--hf-glow-blue);
    flex-shrink: 0;
}

.hf-profile-avatar svg {
    width: 100%;
    height: 100%;
}

.hf-profile-info {
    flex: 1;
}

.hf-profile-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--hf-text-primary);
}

.hf-profile-username {
    font-size: 0.875rem;
    color: var(--hf-text-muted);
}

.hf-profile-actions {
    display: flex;
    gap: var(--hf-space-sm);
}

/* Avatar Grid in Profile Modal */
.hf-avatar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--hf-space-sm);
    margin-bottom: var(--hf-space-sm);
}

.hf-avatar-option {
    aspect-ratio: 1;
    border-radius: var(--hf-radius-md);
    border: 2px solid var(--hf-border);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--hf-transition);
    padding: 4px;
    background: var(--hf-bg-elevated);
}

.hf-avatar-option:hover {
    border-color: var(--hf-accent-blue);
}

.hf-avatar-option.selected {
    border-color: var(--hf-accent-blue);
    box-shadow: var(--hf-glow-blue);
    background: rgba(88, 166, 255, 0.1);
}

.hf-avatar-option svg {
    width: 100%;
    height: 100%;
}

/* ============================================
   HEADER
   ============================================ */

.hf-header {
    background: linear-gradient(180deg, var(--hf-bg-card) 0%, transparent 100%);
    padding: var(--hf-space-md);
    padding-top: max(var(--hf-space-md), env(safe-area-inset-top));
    position: sticky;
    top: 0;
    z-index: 100;
}

.hf-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
}

.hf-header-left {
    display: flex;
    align-items: center;
    gap: var(--hf-space-md);
}

.hf-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--hf-radius-full);
    border: 2px solid var(--hf-accent-blue);
    overflow: hidden;
    box-shadow: var(--hf-glow-blue);
}

.hf-user-avatar svg {
    width: 100%;
    height: 100%;
}

.hf-header-info h1 {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0;
    background: var(--hf-gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hf-header-date {
    font-size: 0.75rem;
    color: var(--hf-text-secondary);
}

/* Level Badge */
.hf-level-badge {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.hf-level-info {
    display: flex;
    align-items: center;
    gap: var(--hf-space-sm);
}

.hf-level-number {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--hf-accent-blue);
    text-shadow: var(--hf-glow-blue);
}

.hf-xp-text {
    font-size: 0.625rem;
    color: var(--hf-text-muted);
}

.hf-xp-total {
    font-size: 0.7rem;
    color: var(--hf-accent-cyan);
    font-weight: 600;
}

.hf-xp-bar {
    width: 80px;
    height: 4px;
    background: var(--hf-bg-input);
    border-radius: var(--hf-radius-full);
    overflow: hidden;
}

.hf-xp-fill {
    height: 100%;
    background: var(--hf-gradient-primary);
    border-radius: var(--hf-radius-full);
    transition: width var(--hf-transition);
    box-shadow: var(--hf-glow-blue);
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.hf-main {
    max-width: 600px;
    margin: 0 auto;
    padding: var(--hf-space-md);
    position: relative;
    z-index: 1;
}

/* Home Date Navigation */
.hf-date-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--hf-space-md);
    padding: var(--hf-space-sm) 0;
}

.hf-date-nav-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--hf-radius-full);
    border: 1px solid var(--hf-border);
    background: var(--hf-bg-card);
    color: var(--hf-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--hf-transition);
}

.hf-date-nav-btn:hover:not(:disabled) {
    border-color: var(--hf-accent-blue);
    color: var(--hf-accent-blue);
}

.hf-date-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.hf-date-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--hf-space-xs);
}

.hf-date-label {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--hf-text-primary);
}

.hf-date-today-btn {
    font-size: 0.75rem;
    padding: 4px 12px;
    border-radius: var(--hf-radius-full);
    border: 1px solid var(--hf-accent-blue);
    background: transparent;
    color: var(--hf-accent-blue);
    cursor: pointer;
    transition: all var(--hf-transition);
}

.hf-date-today-btn:hover {
    background: var(--hf-accent-blue);
    color: var(--hf-bg-dark);
}

/* Progress Summary Card */
.hf-progress-card,
.hf-progress-summary {
    background: var(--hf-bg-card);
    border: 1px solid var(--hf-border);
    border-radius: var(--hf-radius-lg);
    padding: var(--hf-space-lg);
    margin-bottom: var(--hf-space-lg);
    position: relative;
    overflow: hidden;
}

.hf-progress-card::before,
.hf-progress-summary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--hf-gradient-primary);
}

.hf-progress-card.perfect::before,
.hf-progress-summary.perfect::before {
    background: var(--hf-gradient-success);
    box-shadow: var(--hf-glow-green);
}

.hf-progress-stats {
    display: flex;
    justify-content: space-around;
    text-align: center;
}

.hf-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hf-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--hf-text-primary);
}

.hf-stat-value.highlight {
    background: var(--hf-gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hf-stat-value.streak {
    color: var(--hf-accent-orange);
    text-shadow: 0 0 8px rgba(210, 153, 34, 0.4);
}

.hf-stat-label {
    font-size: 0.625rem;
    color: var(--hf-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ============================================
   HABIT CARDS
   ============================================ */

.hf-category {
    margin-bottom: var(--hf-space-lg);
}

.hf-category-header {
    display: flex;
    align-items: center;
    gap: var(--hf-space-sm);
    margin-bottom: var(--hf-space-md);
    padding: 0 var(--hf-space-xs);
}

.hf-category-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    box-shadow: 0 0 10px currentColor;
}

.hf-category-dot.fitness { color: var(--hf-cat-fitness); background: currentColor; }
.hf-category-dot.gesundheit, .hf-category-dot.health { color: var(--hf-cat-gesundheit); background: currentColor; }
.hf-category-dot.produktivitaet, .hf-category-dot.productivity { color: var(--hf-cat-produktivitaet); background: currentColor; }
.hf-category-dot.achtsamkeit, .hf-category-dot.mindfulness { color: var(--hf-cat-achtsamkeit); background: currentColor; }
.hf-category-dot.sozial, .hf-category-dot.social { color: var(--hf-cat-sozial); background: currentColor; }
.hf-category-dot.lernen, .hf-category-dot.learning { color: var(--hf-cat-lernen); background: currentColor; }
.hf-category-dot.allgemein, .hf-category-dot.general { color: var(--hf-cat-allgemein); background: currentColor; }

.hf-category-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--hf-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hf-habit-list {
    display: flex;
    flex-direction: column;
    gap: var(--hf-space-sm);
}

.hf-habit-card {
    background: var(--hf-bg-card);
    border: 1px solid var(--hf-border);
    border-radius: var(--hf-radius-md);
    padding: var(--hf-space-md);
    display: flex;
    align-items: center;
    gap: var(--hf-space-md);
    cursor: pointer;
    transition: all var(--hf-transition);
    min-height: var(--hf-touch-min);
    position: relative;
    overflow: hidden;
}

.hf-habit-card:active {
    transform: scale(0.98);
}

.hf-habit-card:hover {
    background: var(--hf-bg-card-hover);
    border-color: var(--hf-border-light);
}

.hf-habit-card.completed {
    border-color: var(--hf-accent-green);
    box-shadow: inset 0 0 30px rgba(63, 185, 80, 0.08);
}

.hf-habit-card.completed::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--hf-accent-green);
    box-shadow: var(--hf-glow-green);
}

/* Checkbox */
.hf-checkbox {
    width: var(--hf-touch-min);
    height: var(--hf-touch-min);
    min-width: var(--hf-touch-min);
    border-radius: var(--hf-radius-sm);
    border: 2px solid var(--hf-border);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--hf-transition);
    background: var(--hf-bg-input);
}

.hf-habit-card.completed .hf-checkbox {
    background: var(--hf-accent-green);
    border-color: var(--hf-accent-green);
    box-shadow: var(--hf-glow-green);
}

.hf-checkbox-icon {
    opacity: 0;
    transform: scale(0.5);
    transition: all var(--hf-transition);
}

.hf-habit-card.completed .hf-checkbox-icon {
    opacity: 1;
    transform: scale(1);
}

.hf-checkbox-icon svg {
    width: 24px;
    height: 24px;
    color: var(--hf-bg-dark);
}

/* Habit Info */
.hf-habit-info {
    flex: 1;
    min-width: 0;
}

.hf-habit-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--hf-text-primary);
    margin-bottom: 2px;
    word-break: break-word;
    line-height: 1.3;
}

.hf-habit-identity {
    font-size: 0.75rem;
    color: var(--hf-text-muted);
    font-style: italic;
    word-break: break-word;
}

/* Edit Button */
.hf-habit-edit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--hf-text-muted);
    border-radius: var(--hf-radius-sm);
    cursor: pointer;
    opacity: 0.5;
    transition: all var(--hf-transition-fast);
    flex-shrink: 0;
}

.hf-habit-edit-btn:hover {
    opacity: 1;
    background: var(--hf-bg-elevated);
    color: var(--hf-text-primary);
}

.hf-habit-edit-btn svg {
    width: 16px;
    height: 16px;
}

/* Drag Handle */
.hf-drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 32px;
    color: var(--hf-text-muted);
    cursor: grab;
    opacity: 0.3;
    transition: opacity var(--hf-transition-fast);
    flex-shrink: 0;
    margin-right: 4px;
}

.hf-drag-handle:hover {
    opacity: 0.7;
}

.hf-drag-handle:active {
    cursor: grabbing;
}

.hf-drag-handle svg {
    width: 14px;
    height: 14px;
}

/* Force Majeure (Pause) Button */
.hf-habit-pause-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--hf-text-muted);
    border-radius: var(--hf-radius-sm);
    cursor: pointer;
    opacity: 0.4;
    transition: all var(--hf-transition-fast);
    flex-shrink: 0;
}

.hf-habit-pause-btn:hover {
    opacity: 1;
    background: rgba(210, 153, 34, 0.15);
    color: var(--hf-accent-orange);
}

.hf-habit-pause-btn svg {
    width: 16px;
    height: 16px;
}

/* Force Majeure Habit Card */
.hf-habit-card.force-majeure {
    opacity: 0.6;
    background: repeating-linear-gradient(
        -45deg,
        var(--hf-bg-card),
        var(--hf-bg-card) 10px,
        var(--hf-bg-elevated) 10px,
        var(--hf-bg-elevated) 20px
    );
}

.hf-habit-card.force-majeure .hf-checkbox {
    background: var(--hf-accent-orange);
    border-color: var(--hf-accent-orange);
}

.hf-habit-card.force-majeure .hf-checkbox-icon {
    opacity: 1;
    color: var(--hf-bg-dark);
}

/* Drag and Drop States */
.hf-habit-card.dragging {
    opacity: 0.5;
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.hf-habit-card.drag-over {
    border-color: var(--hf-accent-blue);
    background: rgba(88, 166, 255, 0.1);
}

/* Streak Badge */
.hf-streak-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--hf-bg-elevated);
    border-radius: var(--hf-radius-full);
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--hf-text-secondary);
}

.hf-streak-badge.active {
    background: rgba(210, 153, 34, 0.12);
    color: var(--hf-accent-orange);
}

.hf-streak-icon {
    width: 16px;
    height: 16px;
}

.hf-streak-badge.active .hf-streak-icon {
    animation: flame 0.5s ease-in-out infinite;
    filter: drop-shadow(0 0 3px rgba(210, 153, 34, 0.5));
}

@keyframes flame {
    0%, 100% { transform: scaleY(1) translateY(0); }
    50% { transform: scaleY(1.15) translateY(-1px); }
}

/* Shared Habit Participants */
.hf-habit-participants {
    display: flex;
    gap: -8px;
    margin-top: var(--hf-space-sm);
    padding-top: var(--hf-space-sm);
    border-top: 1px solid var(--hf-border);
}

.hf-participant {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 44px;
}

.hf-participant-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--hf-radius-full);
    border: 2px solid var(--hf-border);
    overflow: hidden;
    position: relative;
}

.hf-participant-avatar svg {
    width: 100%;
    height: 100%;
}

.hf-participant.completed .hf-participant-avatar {
    border-color: var(--hf-accent-green);
    box-shadow: var(--hf-glow-green);
}

.hf-participant-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    background: var(--hf-accent-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--hf-glow-green);
}

.hf-participant-badge svg {
    width: 10px;
    height: 10px;
    color: var(--hf-bg-dark);
}

.hf-participant-streak {
    font-size: 0.625rem;
    color: var(--hf-accent-orange);
    font-weight: 700;
}

/* ============================================
   BODY SCREEN
   ============================================ */

.hf-body-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--hf-space-lg);
    padding: var(--hf-space-sm) 0;
}

.hf-body-nav-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--hf-radius-full);
    background: var(--hf-bg-card);
    border: 1px solid var(--hf-border);
    color: var(--hf-text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--hf-transition);
}

.hf-body-nav-btn:hover:not(:disabled) {
    border-color: var(--hf-accent-blue);
    color: var(--hf-accent-blue);
}

.hf-body-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.hf-body-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--hf-space-xs);
}

.hf-body-date-label {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--hf-text-primary);
}

.hf-body-today-btn {
    padding: 4px 12px;
    background: var(--hf-gradient-primary);
    border: none;
    border-radius: var(--hf-radius-full);
    color: var(--hf-bg-dark);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--hf-transition);
}

.hf-body-today-btn:hover {
    transform: scale(1.05);
}

/* Checkpoint Card */
.hf-checkpoint-card {
    background: var(--hf-bg-card);
    border: 1px solid var(--hf-border);
    border-radius: var(--hf-radius-md);
    padding: var(--hf-space-md);
    margin-bottom: var(--hf-space-lg);
}

.hf-checkpoint-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--hf-space-sm);
}

.hf-checkpoint-label {
    font-size: 0.75rem;
    color: var(--hf-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hf-checkpoint-stats {
    display: flex;
    gap: var(--hf-space-lg);
}

.hf-checkpoint-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hf-checkpoint-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--hf-text-primary);
}

.hf-checkpoint-value.positive {
    color: var(--hf-accent-green);
}

.hf-checkpoint-value.negative {
    color: var(--hf-accent-red);
}

.hf-checkpoint-sublabel {
    font-size: 0.625rem;
    color: var(--hf-text-muted);
    text-transform: uppercase;
}

.hf-checkpoint-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--hf-space-sm);
    padding: var(--hf-space-md);
    margin-bottom: var(--hf-space-lg);
}

/* Checkpoint Grid */
.hf-checkpoint-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--hf-space-sm);
}

@media (max-width: 480px) {
    .hf-checkpoint-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.hf-checkpoint-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--hf-space-xs);
}

.hf-checkpoint-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--hf-text-primary);
}

.hf-checkpoint-value.hf-checkpoint-positive {
    color: var(--hf-accent-green);
}

.hf-checkpoint-value.hf-checkpoint-negative {
    color: var(--hf-accent-red);
}

.hf-checkpoint-value.hf-checkpoint-neutral {
    color: var(--hf-text-muted);
}

/* Info Tooltip */
.hf-info-tooltip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--hf-bg-input);
    border: 1px solid var(--hf-border);
    color: var(--hf-text-muted);
    font-size: 0.625rem;
    font-weight: 600;
    cursor: help;
    margin-left: var(--hf-space-xs);
    position: relative;
}

.hf-info-tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--hf-bg-dark);
    color: var(--hf-text-primary);
    padding: var(--hf-space-sm) var(--hf-space-md);
    border-radius: var(--hf-radius-sm);
    font-size: 0.75rem;
    font-weight: 400;
    white-space: nowrap;
    z-index: 100;
    margin-bottom: var(--hf-space-xs);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--hf-border);
}

.hf-info-tooltip:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--hf-bg-dark);
    margin-bottom: -6px;
    z-index: 101;
}

/* Formula Subline */
.hf-formula-subline {
    font-size: 0.625rem;
    color: var(--hf-text-muted);
    font-style: italic;
    margin-top: 2px;
}

.hf-calc-card .hf-formula-subline {
    text-align: center;
}

/* Body Form */
.hf-body-form {
    background: var(--hf-bg-card);
    border: 1px solid var(--hf-border);
    border-radius: var(--hf-radius-md);
    padding: var(--hf-space-md);
    margin-bottom: var(--hf-space-lg);
}

.hf-body-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--hf-space-md);
    margin-bottom: var(--hf-space-md);
}

.hf-body-field {
    display: flex;
    flex-direction: column;
    gap: var(--hf-space-xs);
    min-width: 0;
}

.hf-body-field label {
    font-size: 0.75rem;
    color: var(--hf-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hf-body-input-wrap {
    display: flex;
    align-items: center;
    background: var(--hf-bg-input);
    border: 1px solid var(--hf-border);
    border-radius: var(--hf-radius-sm);
    overflow: hidden;
    transition: all var(--hf-transition);
}

.hf-body-input-wrap:focus-within {
    border-color: var(--hf-accent-blue);
    box-shadow: var(--hf-glow-blue);
}

.hf-body-input-wrap input {
    flex: 1;
    background: none;
    border: none;
    padding: var(--hf-space-sm) var(--hf-space-md);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--hf-text-primary);
    text-align: center;
    min-width: 0;
}

.hf-body-input-wrap input:focus {
    outline: none;
}

.hf-body-input-wrap input::placeholder {
    color: var(--hf-text-muted);
}

.hf-body-unit {
    padding: 0 var(--hf-space-sm);
    font-size: 0.75rem;
    color: var(--hf-text-muted);
    min-width: 32px;
    text-align: left;
}

.hf-body-notes {
    grid-column: 1 / -1;
    margin-bottom: var(--hf-space-md);
}

.hf-body-notes textarea {
    width: 100%;
    background: var(--hf-bg-input);
    border: 1px solid var(--hf-border);
    border-radius: var(--hf-radius-sm);
    padding: var(--hf-space-sm) var(--hf-space-md);
    font-size: 0.875rem;
    color: var(--hf-text-primary);
    resize: vertical;
    font-family: inherit;
}

.hf-body-notes textarea:focus {
    outline: none;
    border-color: var(--hf-accent-blue);
    box-shadow: var(--hf-glow-blue);
}

/* Body Calculations */
.hf-body-calculations {
    background: var(--hf-bg-card);
    border: 1px solid var(--hf-border);
    border-radius: var(--hf-radius-md);
    padding: var(--hf-space-md);
    margin-bottom: var(--hf-space-lg);
}

.hf-body-calculations h4 {
    font-size: 0.75rem;
    color: var(--hf-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 var(--hf-space-md) 0;
}

.hf-calc-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--hf-space-sm);
}

.hf-calc-card {
    background: var(--hf-bg-elevated);
    border-radius: var(--hf-radius-sm);
    padding: var(--hf-space-sm);
    text-align: center;
}

.hf-calc-card-value {
    display: block;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--hf-accent-blue);
}

.hf-calc-card-label {
    display: block;
    font-size: 0.625rem;
    color: var(--hf-text-muted);
    text-transform: uppercase;
    margin-top: 2px;
}

.hf-calc-card.deficit .hf-calc-card-value {
    color: var(--hf-accent-green);
}

.hf-calc-card.surplus .hf-calc-card-value {
    color: var(--hf-accent-orange);
}

.hf-calc-card.warning {
    border: 1px solid var(--hf-accent-red);
}

.hf-calc-card.warning .hf-calc-card-value {
    color: var(--hf-accent-red);
}

/* Body Charts */
.hf-body-charts {
    background: var(--hf-bg-card);
    border: 1px solid var(--hf-border);
    border-radius: var(--hf-radius-md);
    padding: var(--hf-space-md);
    margin-bottom: var(--hf-space-lg);
}

.hf-body-charts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--hf-space-md);
}

.hf-body-charts-header h4 {
    font-size: 0.75rem;
    color: var(--hf-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

.hf-body-chart-range {
    padding: var(--hf-space-xs) var(--hf-space-sm);
    background: var(--hf-bg-elevated);
    border: 1px solid var(--hf-border);
    border-radius: var(--hf-radius-full);
    color: var(--hf-text-secondary);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--hf-transition);
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: var(--hf-space-lg);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238b949e' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

.hf-body-chart-range:hover {
    border-color: var(--hf-accent-blue);
}

.hf-body-chart-range:focus {
    border-color: var(--hf-accent-blue);
    box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.2);
}

.hf-body-charts h4 {
    font-size: 0.75rem;
    color: var(--hf-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 var(--hf-space-md) 0;
}

.hf-body-chart-tabs {
    display: flex;
    gap: var(--hf-space-xs);
    margin-bottom: var(--hf-space-md);
    overflow-x: auto;
    padding-bottom: var(--hf-space-xs);
    -webkit-overflow-scrolling: touch;
}

.hf-body-chart-tab {
    padding: var(--hf-space-sm) var(--hf-space-md);
    background: var(--hf-bg-elevated);
    border: 1px solid var(--hf-border);
    border-radius: var(--hf-radius-full);
    color: var(--hf-text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--hf-transition);
    white-space: nowrap;
}

.hf-body-chart-tab:hover {
    border-color: var(--hf-accent-blue);
}

.hf-body-chart-tab.active {
    background: var(--hf-gradient-primary);
    border-color: transparent;
    color: var(--hf-bg-dark);
}

.hf-body-chart-container {
    height: 200px;
    position: relative;
}

/* Body History */
.hf-body-history {
    background: var(--hf-bg-card);
    border: 1px solid var(--hf-border);
    border-radius: var(--hf-radius-md);
    padding: var(--hf-space-md);
    margin-bottom: var(--hf-space-lg);
}

.hf-body-history h4 {
    font-size: 0.75rem;
    color: var(--hf-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 var(--hf-space-md) 0;
}

.hf-body-history-list {
    display: flex;
    flex-direction: column;
    gap: var(--hf-space-xs);
}

.hf-body-history-item {
    background: var(--hf-bg-elevated);
    border: 1px solid var(--hf-border);
    border-radius: var(--hf-radius-sm);
    padding: var(--hf-space-sm) var(--hf-space-md);
    cursor: pointer;
    transition: all var(--hf-transition);
    display: flex;
    align-items: center;
    gap: var(--hf-space-md);
    flex-wrap: wrap;
}

.hf-body-history-item:hover {
    border-color: var(--hf-accent-blue);
}

.hf-body-history-date {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--hf-text-primary);
    min-width: 90px;
    flex-shrink: 0;
}

.hf-body-history-values {
    display: flex;
    gap: var(--hf-space-sm);
    font-size: 0.8rem;
    color: var(--hf-text-secondary);
    flex-wrap: wrap;
}

.hf-body-history-notes {
    font-size: 0.8rem;
    color: var(--hf-text-secondary);
    font-style: italic;
    margin-left: auto;
    text-align: right;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hf-body-history-notes.hf-truncated {
    cursor: pointer;
    text-decoration: underline dotted;
}

.hf-body-history-notes.hf-expanded {
    max-width: none;
    white-space: normal;
    word-break: break-word;
    text-align: left;
    width: 100%;
    margin-left: 0;
    margin-top: 4px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
}

/* ============================================
   FITNESS TAB (Legacy)
   ============================================ */

.hf-fitness-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--hf-space-lg);
}

.hf-fitness-date {
    display: flex;
    align-items: center;
    gap: var(--hf-space-sm);
}

.hf-fitness-date-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--hf-radius-sm);
    background: var(--hf-bg-card);
    border: 1px solid var(--hf-border);
    color: var(--hf-text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--hf-transition);
}

.hf-fitness-date-btn:hover {
    border-color: var(--hf-accent-blue);
    color: var(--hf-accent-blue);
}

.hf-fitness-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--hf-space-md);
    margin-bottom: var(--hf-space-lg);
}

.hf-metric-card {
    background: var(--hf-bg-card);
    border: 1px solid var(--hf-border);
    border-radius: var(--hf-radius-md);
    padding: var(--hf-space-md);
}

.hf-metric-card.full-width {
    grid-column: 1 / -1;
}

.hf-metric-label {
    font-size: 0.625rem;
    color: var(--hf-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--hf-space-xs);
}

.hf-metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--hf-text-primary);
}

.hf-metric-value.positive {
    color: var(--hf-accent-green);
}

.hf-metric-value.negative {
    color: var(--hf-accent-red);
}

.hf-metric-unit {
    font-size: 0.875rem;
    color: var(--hf-text-secondary);
    font-weight: 400;
}

.hf-metric-input {
    width: 100%;
    background: var(--hf-bg-input);
    border: 1px solid var(--hf-border);
    border-radius: var(--hf-radius-sm);
    padding: var(--hf-space-sm) var(--hf-space-md);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--hf-text-primary);
    text-align: center;
}

.hf-metric-input:focus {
    outline: none;
    border-color: var(--hf-accent-blue);
    box-shadow: var(--hf-glow-blue);
}

/* Calculated values */
.hf-calculations {
    background: var(--hf-bg-card);
    border: 1px solid var(--hf-border);
    border-radius: var(--hf-radius-md);
    padding: var(--hf-space-md);
    margin-bottom: var(--hf-space-lg);
}

.hf-calculations h3 {
    font-size: 0.75rem;
    color: var(--hf-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 var(--hf-space-md) 0;
}

.hf-calc-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--hf-space-md);
}

.hf-calc-item {
    text-align: center;
}

.hf-calc-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--hf-accent-blue);
}

.hf-calc-label {
    font-size: 0.625rem;
    color: var(--hf-text-muted);
}

/* Charts */
.hf-chart-container {
    background: var(--hf-bg-card);
    border: 1px solid var(--hf-border);
    border-radius: var(--hf-radius-md);
    padding: var(--hf-space-md);
    margin-bottom: var(--hf-space-md);
}

.hf-chart-title {
    font-size: 0.75rem;
    color: var(--hf-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 var(--hf-space-md) 0;
}

.hf-chart {
    height: 200px;
    position: relative;
}

.hf-mini-charts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--hf-space-sm);
}

.hf-mini-chart {
    background: var(--hf-bg-card);
    border: 1px solid var(--hf-border);
    border-radius: var(--hf-radius-md);
    padding: var(--hf-space-sm);
}

.hf-mini-chart .hf-chart {
    height: 80px;
}

/* ============================================
   BOTTOM NAVIGATION
   ============================================ */

.hf-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(13, 17, 23, 0.95) 30%);
    padding: var(--hf-space-sm) var(--hf-space-md);
    padding-bottom: max(var(--hf-space-sm), env(safe-area-inset-bottom));
    z-index: 100;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.hf-nav-content {
    display: flex;
    justify-content: space-around;
    max-width: 600px;
    margin: 0 auto;
    background: rgba(22, 27, 34, 0.9);
    border: 1px solid var(--hf-border);
    border-radius: var(--hf-radius-lg);
    padding: var(--hf-space-xs);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.hf-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: var(--hf-space-sm) var(--hf-space-md);
    min-width: var(--hf-touch-min);
    min-height: var(--hf-touch-min);
    border-radius: var(--hf-radius-md);
    color: var(--hf-text-muted);
    cursor: pointer;
    transition: all var(--hf-transition);
    background: none;
    border: none;
}

.hf-nav-item:hover {
    color: var(--hf-text-secondary);
}

.hf-nav-item.active {
    background: rgba(88, 166, 255, 0.15);
    color: var(--hf-accent-blue);
}

.hf-nav-icon {
    width: 24px;
    height: 24px;
}

.hf-nav-label {
    font-size: 0.625rem;
    font-weight: 600;
}

/* ============================================
   FAB BUTTON
   ============================================ */

.hf-fab {
    position: fixed;
    bottom: 100px;
    right: var(--hf-space-md);
    width: 56px;
    height: 56px;
    border-radius: var(--hf-radius-full);
    background: var(--hf-gradient-primary);
    border: none;
    color: var(--hf-bg-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 24px rgba(88, 166, 255, 0.25), 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 50;
    transition: all var(--hf-transition);
}

.hf-fab:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 28px rgba(88, 166, 255, 0.35), 0 12px 40px rgba(0, 0, 0, 0.5);
}

.hf-fab:active {
    transform: scale(0.95);
}

.hf-fab svg {
    width: 24px;
    height: 24px;
}

/* ============================================
   MODALS
   ============================================ */

.hf-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(13, 17, 23, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 400;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.hf-modal-overlay.show {
    display: flex;
}

.hf-modal {
    background: var(--hf-bg-card);
    border: 1px solid var(--hf-border);
    border-top: 1px solid rgba(88, 166, 255, 0.2);
    border-radius: var(--hf-radius-xl) var(--hf-radius-xl) 0 0;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform var(--hf-transition-slow);
    box-shadow: 0 -10px 60px rgba(0, 0, 0, 0.5);
}

.hf-modal-overlay.show .hf-modal {
    transform: translateY(0);
}

.hf-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--hf-space-lg);
    border-bottom: 1px solid var(--hf-border);
    position: sticky;
    top: 0;
    background: var(--hf-bg-card);
    z-index: 1;
}

.hf-modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    background: var(--hf-gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hf-modal-close {
    width: var(--hf-touch-min);
    height: var(--hf-touch-min);
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--hf-text-secondary);
    cursor: pointer;
    border-radius: var(--hf-radius-full);
    transition: all var(--hf-transition);
}

.hf-modal-close:hover {
    background: var(--hf-bg-elevated);
    color: var(--hf-text-primary);
}

.hf-modal-body {
    padding: var(--hf-space-lg);
}

/* ============================================
   FORMS
   ============================================ */

.hf-form {
    display: flex;
    flex-direction: column;
    gap: var(--hf-space-md);
}

.hf-form-group {
    display: flex;
    flex-direction: column;
    gap: var(--hf-space-xs);
}

.hf-form-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--hf-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hf-form-input,
.hf-form-select,
.hf-form-textarea {
    width: 100%;
    padding: var(--hf-space-md);
    background: var(--hf-bg-input);
    border: 1px solid var(--hf-border);
    border-radius: var(--hf-radius-sm);
    font-size: 1rem;
    color: var(--hf-text-primary);
    min-height: var(--hf-touch-min);
    transition: all var(--hf-transition);
}

.hf-form-input:focus,
.hf-form-select:focus,
.hf-form-textarea:focus {
    outline: none;
    border-color: var(--hf-accent-blue);
    box-shadow: var(--hf-glow-blue);
}

.hf-form-input::placeholder {
    color: var(--hf-text-muted);
}

.hf-form-textarea {
    min-height: 100px;
    resize: vertical;
}

/* ============================================
   BUTTONS
   ============================================ */

.hf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--hf-space-sm);
    padding: var(--hf-space-md) var(--hf-space-lg);
    border-radius: var(--hf-radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--hf-transition);
    border: none;
    min-height: var(--hf-touch-min);
}

.hf-btn-primary {
    background: var(--hf-gradient-primary);
    color: var(--hf-bg-dark);
    box-shadow: var(--hf-glow-blue);
}

.hf-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--hf-glow-blue), 0 8px 20px rgba(88, 166, 255, 0.2);
}

.hf-btn-secondary {
    background: var(--hf-bg-elevated);
    border: 1px solid var(--hf-border);
    color: var(--hf-text-primary);
}

.hf-btn-secondary:hover {
    border-color: var(--hf-accent-blue);
}

.hf-btn-danger {
    background: var(--hf-accent-red);
    color: var(--hf-bg-dark);
}

.hf-btn-ghost {
    background: transparent;
    color: var(--hf-text-secondary);
}

.hf-btn-ghost:hover {
    color: var(--hf-text-primary);
    background: var(--hf-bg-elevated);
}

/* Outline Button - Modern Glass Style */
.hf-btn-outline {
    background: var(--hf-bg-card);
    border: 1px solid var(--hf-border);
    color: var(--hf-text-primary);
    position: relative;
    overflow: hidden;
}

.hf-btn-outline::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(88, 166, 255, 0.08) 0%, rgba(163, 113, 247, 0.08) 100%);
    opacity: 0;
    transition: opacity var(--hf-transition);
}

.hf-btn-outline::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--hf-gradient-primary);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform var(--hf-transition);
}

.hf-btn-outline:hover {
    border-color: var(--hf-accent-blue);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(88, 166, 255, 0.15);
}

.hf-btn-outline:hover::before {
    opacity: 1;
}

.hf-btn-outline:hover::after {
    transform: scaleX(1);
}

.hf-btn-outline svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    transition: transform var(--hf-transition);
}

.hf-btn-outline:hover svg {
    transform: scale(1.1);
}

/* ============================================
   TOASTS & NOTIFICATIONS
   ============================================ */

.hf-toast-container {
    position: fixed;
    top: var(--hf-space-md);
    left: 50%;
    transform: translateX(-50%);
    z-index: 500;
    width: calc(100% - 32px);
    max-width: 400px;
    pointer-events: none;
}

.hf-toast {
    background: var(--hf-bg-card);
    border: 1px solid var(--hf-border);
    border-radius: var(--hf-radius-md);
    padding: var(--hf-space-md);
    margin-bottom: var(--hf-space-sm);
    display: flex;
    align-items: center;
    gap: var(--hf-space-md);
    transform: translateY(-100px);
    opacity: 0;
    transition: all var(--hf-transition);
    pointer-events: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.hf-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.hf-toast-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--hf-radius-sm);
    background: var(--hf-gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--hf-bg-dark);
    flex-shrink: 0;
}

.hf-toast.level-up .hf-toast-icon {
    background: var(--hf-gradient-gold);
    box-shadow: 0 0 25px rgba(227, 179, 65, 0.3);
}

.hf-toast.achievement .hf-toast-icon {
    background: var(--hf-gradient-fire);
    box-shadow: var(--hf-glow-purple);
}

.hf-toast-content {
    flex: 1;
    min-width: 0;
}

.hf-toast-title {
    font-weight: 700;
    color: var(--hf-text-primary);
    margin-bottom: 2px;
}

.hf-toast-message {
    font-size: 0.875rem;
    color: var(--hf-text-secondary);
}

/* XP Popup */
.hf-xp-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: var(--hf-bg-card);
    border: 1px solid var(--hf-accent-green);
    padding: var(--hf-space-xl);
    border-radius: var(--hf-radius-xl);
    box-shadow: var(--hf-glow-green), 0 20px 60px rgba(0, 0, 0, 0.5);
    z-index: 300;
    text-align: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.hf-xp-popup.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.hf-xp-amount {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--hf-accent-green);
    text-shadow: 0 0 15px rgba(63, 185, 80, 0.4);
}

.hf-xp-label {
    color: var(--hf-text-secondary);
    font-size: 0.875rem;
}

/* ============================================
   ACHIEVEMENTS
   ============================================ */

.hf-achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--hf-space-md);
}

.hf-achievement-card {
    background: var(--hf-bg-card);
    border: 1px solid var(--hf-border);
    border-radius: var(--hf-radius-md);
    padding: var(--hf-space-lg);
    text-align: center;
    opacity: 0.4;
    filter: grayscale(1);
    transition: all var(--hf-transition);
}

.hf-achievement-card.earned {
    opacity: 1;
    filter: none;
    border-color: var(--hf-accent-purple);
    box-shadow: var(--hf-glow-purple);
}

.hf-achievement-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto var(--hf-space-sm);
    border-radius: var(--hf-radius-full);
    background: var(--hf-bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.hf-achievement-card.earned .hf-achievement-icon {
    background: var(--hf-gradient-primary);
    box-shadow: var(--hf-glow-purple);
}

.hf-achievement-name {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--hf-text-primary);
    margin-bottom: var(--hf-space-xs);
}

.hf-achievement-desc {
    font-size: 0.75rem;
    color: var(--hf-text-muted);
}

/* ============================================
   STATS & CHARTS
   ============================================ */

.hf-stats-card {
    background: var(--hf-bg-card);
    border: 1px solid var(--hf-border);
    border-radius: var(--hf-radius-md);
    padding: var(--hf-space-lg);
    margin-bottom: var(--hf-space-md);
}

.hf-stats-card h3 {
    font-size: 0.75rem;
    color: var(--hf-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 var(--hf-space-md) 0;
}

/* Heatmap */
.hf-heatmap {
    display: grid;
    grid-template-columns: repeat(53, 1fr);
    gap: 3px;
}

.hf-heatmap-day {
    aspect-ratio: 1;
    border-radius: 2px;
    background: var(--hf-bg-elevated);
}

.hf-heatmap-day.level-1 { background: rgba(88, 166, 255, 0.2); }
.hf-heatmap-day.level-2 { background: rgba(88, 166, 255, 0.4); }
.hf-heatmap-day.level-3 { background: rgba(88, 166, 255, 0.65); }
.hf-heatmap-day.level-4 { background: var(--hf-accent-blue); }

/* Performance bars */
.hf-performance-list {
    display: flex;
    flex-direction: column;
    gap: var(--hf-space-md);
}

.hf-performance-item {
    display: flex;
    flex-direction: column;
    gap: var(--hf-space-xs);
}

.hf-performance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hf-performance-name {
    font-size: 0.875rem;
    color: var(--hf-text-primary);
}

.hf-performance-rate {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--hf-accent-blue);
}

.hf-performance-bar {
    height: 8px;
    background: var(--hf-bg-elevated);
    border-radius: var(--hf-radius-full);
    overflow: hidden;
}

.hf-performance-fill {
    height: 100%;
    background: var(--hf-gradient-primary);
    border-radius: var(--hf-radius-full);
    transition: width 0.5s ease;
}

/* ============================================
   TEMPLATES
   ============================================ */

.hf-templates-section {
    margin-bottom: var(--hf-space-lg);
}

.hf-templates-header {
    display: flex;
    align-items: center;
    gap: var(--hf-space-sm);
    margin-bottom: var(--hf-space-md);
}

.hf-templates-icon {
    width: 24px;
    height: 24px;
    color: var(--hf-accent-blue);
}

.hf-templates-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--hf-text-primary);
}

.hf-template-card {
    background: var(--hf-bg-card);
    border: 1px solid var(--hf-border);
    border-radius: var(--hf-radius-md);
    padding: var(--hf-space-md);
    margin-bottom: var(--hf-space-sm);
    cursor: pointer;
    transition: all var(--hf-transition);
}

.hf-template-card:hover {
    border-color: var(--hf-accent-blue);
    box-shadow: var(--hf-glow-blue);
}

.hf-template-name {
    font-weight: 600;
    color: var(--hf-text-primary);
    margin-bottom: 4px;
}

.hf-template-identity {
    font-size: 0.75rem;
    color: var(--hf-text-muted);
    font-style: italic;
}

/* ============================================
   GROUPS & SOCIAL
   ============================================ */

.hf-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--hf-space-sm);
}

.hf-group-name {
    font-weight: 700;
    color: var(--hf-text-primary);
}

.hf-group-members {
    display: flex;
    align-items: center;
    gap: var(--hf-space-xs);
    font-size: 0.75rem;
    color: var(--hf-text-secondary);
}

.hf-invite-link {
    display: flex;
    align-items: center;
    gap: var(--hf-space-sm);
    background: var(--hf-bg-input);
    border: 1px solid var(--hf-border);
    border-radius: var(--hf-radius-sm);
    padding: var(--hf-space-sm) var(--hf-space-md);
    margin-top: var(--hf-space-sm);
}

.hf-invite-link input {
    flex: 1;
    background: none;
    border: none;
    color: var(--hf-accent-blue);
    font-family: monospace;
    font-size: 0.875rem;
}

.hf-invite-link input:focus {
    outline: none;
}

/* Battle Invite Section */
.hf-invite-section {
    background: var(--hf-bg-elevated);
    border-radius: var(--hf-radius-md);
    padding: var(--hf-space-md);
    margin: var(--hf-space-md) 0;
    border: 1px solid var(--hf-border);
}

.hf-invite-label {
    font-size: 0.75rem;
    color: var(--hf-text-secondary);
    margin-bottom: var(--hf-space-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hf-invite-code-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--hf-space-md);
    background: var(--hf-bg-input);
    border-radius: var(--hf-radius-sm);
    padding: var(--hf-space-sm) var(--hf-space-md);
}

.hf-invite-code {
    font-family: 'JetBrains Mono', 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--hf-accent-blue);
    letter-spacing: 0.15em;
}

.hf-invite-code-box .hf-btn {
    display: flex;
    align-items: center;
    gap: var(--hf-space-xs);
    white-space: nowrap;
}

/* ============================================
   LOADING & EMPTY STATES
   ============================================ */

.hf-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--hf-space-xl);
}

.hf-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--hf-bg-elevated);
    border-top-color: var(--hf-accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.hf-empty {
    text-align: center;
    padding: var(--hf-space-xl) var(--hf-space-lg);
    color: var(--hf-text-secondary);
    background: linear-gradient(180deg, var(--hf-bg-elevated) 0%, var(--hf-bg-card) 100%);
    border-radius: var(--hf-radius-lg);
    border: 1px dashed var(--hf-border);
    position: relative;
    overflow: hidden;
}

.hf-empty::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(88, 166, 255, 0.03) 0%, transparent 70%);
    pointer-events: none;
}

.hf-empty p {
    margin: 0;
    position: relative;
    z-index: 1;
}

.hf-empty-icon {
    font-size: 3rem;
    margin-bottom: var(--hf-space-md);
    opacity: 0.4;
    filter: grayscale(0.5);
}

/* ============================================
   SCREENS
   ============================================ */

.hf-screen {
    display: none;
}

.hf-screen.active {
    display: block;
}

/* ============================================
   UTILITIES
   ============================================ */

.hf-text-center { text-align: center; }
.hf-text-right { text-align: right; }
.hf-mb-0 { margin-bottom: 0; }
.hf-mb-sm { margin-bottom: var(--hf-space-sm); }
.hf-mb-md { margin-bottom: var(--hf-space-md); }
.hf-mb-lg { margin-bottom: var(--hf-space-lg); }
.hf-w-full { width: 100%; }
.hf-flex { display: flex; }
.hf-items-center { align-items: center; }
.hf-justify-between { justify-content: space-between; }
.hf-gap-sm { gap: var(--hf-space-sm); }
.hf-gap-md { gap: var(--hf-space-md); }

/* ============================================
   RESPONSIVE
   ============================================ */

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

    .hf-modal {
        border-radius: var(--hf-radius-xl);
        margin: auto;
        max-height: 80vh;
    }

    .hf-modal-overlay.show {
        align-items: center;
    }

    .hf-fitness-metrics {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* PWA Standalone */
@media (display-mode: standalone) {
    .hf-header {
        padding-top: max(var(--hf-space-md), env(safe-area-inset-top));
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   GROUPS STYLES
   ============================================ */

.hf-groups-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.hf-group-name {
    font-weight: 600;
    color: var(--hf-text-primary);
    margin-bottom: 4px;
}

.hf-group-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
}

.hf-group-role {
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.hf-group-role.admin {
    background: rgba(163, 113, 247, 0.2);
    color: var(--hf-accent-purple);
}

.hf-group-role.member {
    background: rgba(88, 166, 255, 0.2);
    color: var(--hf-accent-blue);
}

.hf-group-members {
    color: var(--hf-text-muted);
}

.hf-group-arrow {
    color: var(--hf-text-muted);
    flex-shrink: 0;
}

.hf-empty-small {
    padding: 16px;
    text-align: center;
}

/* Group Details Modal */
.hf-group-details {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hf-group-header-info {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--hf-border);
}

.hf-group-section {
    padding: 12px;
    background: var(--hf-bg-secondary);
    border-radius: var(--hf-radius-md);
}

/* Members List */
.hf-members-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.hf-member-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    background: var(--hf-bg-tertiary);
    border-radius: var(--hf-radius-sm);
}

.hf-member-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.hf-member-avatar svg {
    width: 100%;
    height: 100%;
}

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

.hf-member-name {
    font-weight: 500;
    color: var(--hf-text-primary);
    font-size: 0.875rem;
}

.hf-member-role {
    font-size: 0.7rem;
    padding: 1px 4px;
    border-radius: 3px;
    display: inline-block;
    margin-top: 2px;
}

.hf-member-role.admin {
    background: rgba(163, 113, 247, 0.2);
    color: var(--hf-accent-purple);
}

.hf-member-role.member {
    background: rgba(88, 166, 255, 0.2);
    color: var(--hf-accent-blue);
}

/* ============================================
   TEAMBUILDING FEATURES
   ============================================ */

/* Social Tabs */
.hf-social-tabs {
    display: flex;
    gap: var(--hf-space-sm);
    margin-bottom: var(--hf-space-lg);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: var(--hf-space-xs);
    background: var(--hf-bg-card);
    border-radius: var(--hf-radius-lg);
    border: 1px solid var(--hf-border);
}

.hf-social-tabs::-webkit-scrollbar {
    display: none;
}

.hf-social-tab {
    flex-shrink: 0;
    flex: 1;
    padding: var(--hf-space-sm) var(--hf-space-md);
    background: transparent;
    border: none;
    border-radius: var(--hf-radius-md);
    color: var(--hf-text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--hf-transition);
    position: relative;
    text-align: center;
}

.hf-social-tab:hover {
    background: var(--hf-bg-elevated);
    color: var(--hf-text-primary);
}

.hf-social-tab.active {
    background: var(--hf-gradient-primary);
    color: var(--hf-bg-dark);
}

.hf-social-content .hf-social-panel {
    display: none !important;
}

.hf-social-content .hf-social-panel.active {
    display: block !important;
}

/* Activity Feed - Compact List Style */
#hf-activity-feed {
    background: var(--hf-bg-card);
    border: 1px solid var(--hf-border);
    border-radius: var(--hf-radius-md);
    overflow: hidden;
}

.hf-feed-item {
    display: flex;
    align-items: center;
    gap: var(--hf-space-sm);
    padding: 10px var(--hf-space-md);
    background: transparent;
    border-bottom: 1px solid var(--hf-border);
    transition: background var(--hf-transition);
}

.hf-feed-item:last-child {
    border-bottom: none;
}

.hf-feed-item:hover {
    background: var(--hf-bg-elevated);
}

.hf-feed-avatar {
    width: 28px;
    height: 28px;
    border-radius: var(--hf-radius-full);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--hf-bg-elevated);
}

.hf-feed-avatar svg {
    width: 100%;
    height: 100%;
}

.hf-feed-avatar-placeholder {
    width: 100%;
    height: 100%;
    background: var(--hf-bg-elevated);
}

.hf-feed-content {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 0.8rem;
    line-height: 1.4;
}

.hf-feed-header {
    display: contents;
}

.hf-feed-name {
    font-weight: 600;
    color: var(--hf-text-primary);
    font-size: 0.8rem;
}

.hf-feed-message {
    display: contents;
    color: var(--hf-text-secondary);
}

.hf-feed-icon {
    display: inline-flex;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    margin-right: 2px;
}

.hf-feed-icon svg {
    width: 100%;
    height: 100%;
}

.hf-feed-target {
    color: var(--hf-accent-blue);
    font-weight: 500;
}

.hf-feed-time {
    font-size: 0.7rem;
    color: var(--hf-text-muted);
    margin-left: auto;
    flex-shrink: 0;
    padding-left: var(--hf-space-sm);
}

.hf-feed-group {
    width: 100%;
    font-size: 0.7rem;
    color: var(--hf-text-muted);
}

.hf-feed-actions {
    flex-shrink: 0;
}

/* Reaction Button - Compact */
.hf-reaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: transparent;
    border: none;
    border-radius: var(--hf-radius-sm);
    color: var(--hf-text-muted);
    font-size: 0.7rem;
    cursor: pointer;
    transition: all var(--hf-transition);
}

.hf-reaction-btn:hover {
    background: rgba(88, 166, 255, 0.1);
    border-color: var(--hf-accent-blue);
    color: var(--hf-accent-blue);
    transform: translateY(-2px);
}

.hf-reaction-btn:hover {
    border-color: var(--hf-accent-blue);
    color: var(--hf-accent-blue);
}

.hf-reaction-btn.reacted {
    background: rgba(88, 166, 255, 0.15);
    border-color: var(--hf-accent-blue);
    color: var(--hf-accent-blue);
    box-shadow: var(--hf-glow-blue);
}

.hf-reaction-btn svg {
    width: 14px;
    height: 14px;
    transition: transform var(--hf-transition);
}

.hf-reaction-btn:hover svg {
    transform: scale(1.2) rotate(-10deg);
}

.hf-reaction-btn.reacted svg {
    animation: reaction-pop 0.4s ease;
}

@keyframes reaction-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.4) rotate(10deg); }
    100% { transform: scale(1); }
}

.hf-reaction-count {
    font-weight: 600;
    min-width: 16px;
    text-align: center;
}

/* High-Five Animation */
.hf-highfive-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hf-highfive-overlay.active {
    opacity: 1;
}

.hf-highfive-emoji {
    font-size: 80px;
    animation: highfive-bounce 0.8s ease;
}

@keyframes highfive-bounce {
    0% { transform: scale(0.5) rotate(-10deg); opacity: 0; }
    50% { transform: scale(1.2) rotate(5deg); opacity: 1; }
    100% { transform: scale(1) rotate(0); opacity: 0.8; }
}

/* Duel Cards */
.hf-duel-card {
    background: var(--hf-bg-card);
    border: 1px solid var(--hf-border);
    border-radius: var(--hf-radius-lg);
    padding: 12px;
    margin-bottom: var(--hf-space-sm);
    position: relative;
    overflow: hidden;
}

.hf-duel-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--hf-gradient-primary);
}

.hf-duel-card.active::before {
    background: var(--hf-gradient-fire);
    box-shadow: var(--hf-glow-orange);
}

.hf-duel-card.finished::before {
    background: var(--hf-text-muted);
}

.hf-duel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--hf-space-sm);
}

.hf-duel-status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: var(--hf-space-xs) var(--hf-space-sm);
    border-radius: var(--hf-radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hf-duel-status.pending {
    background: rgba(210, 153, 34, 0.2);
    color: var(--hf-accent-orange);
}

.hf-duel-status.active {
    background: rgba(63, 185, 80, 0.2);
    color: var(--hf-accent-green);
}

.hf-duel-status.finished {
    background: rgba(139, 148, 158, 0.2);
    color: var(--hf-text-muted);
}

.hf-duel-title {
    font-weight: 500;
    color: var(--hf-text-secondary);
    font-size: 0.875rem;
}

.hf-duel-players {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: var(--hf-space-md);
}

.hf-duel-player {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--hf-space-xs);
}

.hf-duel-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--hf-radius-full);
    overflow: hidden;
    border: 2px solid var(--hf-border);
}

.hf-duel-player.me .hf-duel-avatar {
    border-color: var(--hf-accent-blue);
    box-shadow: var(--hf-glow-blue);
}

.hf-duel-avatar svg {
    width: 100%;
    height: 100%;
}

.hf-duel-score {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--hf-text-primary);
}

.hf-duel-score.winning {
    color: var(--hf-accent-green);
    text-shadow: 0 0 8px rgba(63, 185, 80, 0.4);
}

.hf-duel-name {
    font-size: 0.75rem;
    color: var(--hf-text-muted);
}

.hf-duel-vs {
    font-weight: 700;
    font-size: 1rem;
    color: var(--hf-accent-red);
    text-shadow: 0 0 8px rgba(248, 81, 73, 0.4);
}

.hf-duel-actions {
    display: flex;
    gap: var(--hf-space-sm);
    margin-top: var(--hf-space-md);
    justify-content: center;
}

.hf-duel-winner {
    text-align: center;
    margin-top: var(--hf-space-sm);
    padding: var(--hf-space-xs) var(--hf-space-sm);
    background: rgba(227, 179, 65, 0.1);
    border-radius: var(--hf-radius-md);
    color: var(--hf-accent-orange);
    font-weight: 600;
}

/* Battle Cards */
.hf-battle-card {
    background: var(--hf-bg-card);
    border: 1px solid var(--hf-border);
    border-radius: var(--hf-radius-lg);
    padding: 12px;
    margin-bottom: var(--hf-space-sm);
    cursor: pointer;
    transition: all var(--hf-transition);
    position: relative;
    overflow: hidden;
}

.hf-battle-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--hf-gradient-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--hf-transition);
}

.hf-battle-card:hover {
    border-color: var(--hf-accent-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(88, 166, 255, 0.12);
}

.hf-battle-card:hover::before {
    transform: scaleX(1);
}

.hf-battle-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle at bottom right, rgba(88, 166, 255, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.hf-battle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--hf-space-sm);
}

.hf-battle-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--hf-text-primary);
    display: flex;
    align-items: center;
    gap: var(--hf-space-xs);
}

.hf-battle-title::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: var(--hf-gradient-primary);
    flex-shrink: 0;
}

.hf-battle-status {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--hf-radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hf-battle-status.pending {
    background: rgba(88, 166, 255, 0.15);
    color: var(--hf-accent-blue);
    animation: status-pulse 2s ease infinite;
}

.hf-battle-status.active {
    background: rgba(63, 185, 80, 0.15);
    color: var(--hf-accent-green);
    box-shadow: 0 0 12px rgba(63, 185, 80, 0.2);
}

.hf-battle-status.finished {
    background: rgba(139, 148, 158, 0.15);
    color: var(--hf-text-muted);
}

@keyframes status-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.hf-battle-my-team {
    padding: var(--hf-space-sm) var(--hf-space-md);
    border-left: 4px solid;
    background: linear-gradient(90deg, rgba(88, 166, 255, 0.08) 0%, transparent 100%);
    border-radius: 0 var(--hf-radius-md) var(--hf-radius-md) 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--hf-text-secondary);
    margin-bottom: var(--hf-space-sm);
    display: flex;
    align-items: center;
    gap: var(--hf-space-sm);
}

.hf-battle-my-team::after {
    content: 'Dein Team';
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--hf-accent-blue);
    margin-left: auto;
    background: rgba(88, 166, 255, 0.1);
    padding: 2px 8px;
    border-radius: var(--hf-radius-full);
}

.hf-battle-dates {
    font-size: 0.75rem;
    color: var(--hf-text-muted);
    display: flex;
    align-items: center;
    gap: var(--hf-space-sm);
}

.hf-battle-dates::before {
    content: '';
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236e7681' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
    background-size: contain;
    flex-shrink: 0;
}

/* Battle Details */
.hf-battle-details {
    display: flex;
    flex-direction: column;
    gap: var(--hf-space-md);
}

.hf-battle-status-bar {
    padding: var(--hf-space-sm);
    text-align: center;
    border-radius: var(--hf-radius-md);
    font-size: 0.875rem;
    font-weight: 500;
}

.hf-battle-status-bar.active {
    background: rgba(63, 185, 80, 0.1);
    color: var(--hf-accent-green);
}

.hf-battle-status-bar.pending {
    background: rgba(88, 166, 255, 0.1);
    color: var(--hf-accent-blue);
}

.hf-battle-status-bar.finished {
    background: rgba(139, 148, 158, 0.1);
    color: var(--hf-text-muted);
}

.hf-battle-desc {
    color: var(--hf-text-secondary);
    font-size: 0.875rem;
}

.hf-battle-leaderboard {
    display: flex;
    flex-direction: column;
    gap: var(--hf-space-md);
}

.hf-battle-team {
    background: var(--hf-bg-elevated);
    border: 1px solid var(--hf-border);
    border-radius: var(--hf-radius-md);
    padding: var(--hf-space-md);
    border-left: 4px solid var(--team-color, var(--hf-accent-blue));
}

.hf-battle-team.my-team {
    background: rgba(88, 166, 255, 0.05);
    border-color: var(--hf-accent-blue);
}

.hf-battle-team-header {
    display: flex;
    align-items: center;
    gap: var(--hf-space-sm);
    margin-bottom: var(--hf-space-sm);
}

.hf-battle-rank {
    font-weight: 700;
    color: var(--hf-text-muted);
    font-size: 0.875rem;
}

.hf-battle-team-name {
    font-weight: 600;
    color: var(--hf-text-primary);
    flex: 1;
}

.hf-battle-team-score {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--hf-accent-green);
}

.hf-battle-team-members {
    display: flex;
    flex-direction: column;
    gap: var(--hf-space-xs);
    margin-top: var(--hf-space-sm);
}

.hf-battle-member {
    display: flex;
    align-items: center;
    gap: var(--hf-space-sm);
    padding: var(--hf-space-xs) 0;
}

.hf-battle-member-avatar {
    width: 28px;
    height: 28px;
    border-radius: var(--hf-radius-full);
    overflow: hidden;
}

.hf-battle-member-avatar svg {
    width: 100%;
    height: 100%;
}

.hf-battle-member-name {
    flex: 1;
    font-size: 0.875rem;
    color: var(--hf-text-secondary);
}

.hf-battle-member-score {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--hf-text-muted);
}

/* Streak Chain Cards */
.hf-streak-chain-card {
    background: var(--hf-bg-card);
    border: 1px solid var(--hf-border);
    border-radius: var(--hf-radius-lg);
    padding: var(--hf-space-md);
    margin-bottom: var(--hf-space-md);
    cursor: pointer;
    transition: all var(--hf-transition);
    position: relative;
    overflow: hidden;
}

.hf-streak-chain-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--hf-gradient-fire);
    opacity: 0.5;
}

.hf-streak-chain-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle at top right, rgba(210, 153, 34, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.hf-streak-chain-card:hover {
    border-color: var(--hf-accent-orange);
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 8px 24px rgba(210, 153, 34, 0.15);
}

.hf-streak-chain-card:hover::before {
    opacity: 1;
}

.hf-streak-chain-card.needs-contribution {
    border-color: var(--hf-accent-orange);
    box-shadow: var(--hf-glow-orange);
    animation: chain-pulse 2s ease infinite;
}

@keyframes chain-pulse {
    0%, 100% { box-shadow: var(--hf-glow-orange); }
    50% { box-shadow: 0 0 30px rgba(210, 153, 34, 0.25); }
}

.hf-chain-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--hf-space-sm);
}

.hf-chain-name {
    font-weight: 600;
    color: var(--hf-text-primary);
}

.hf-chain-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: var(--hf-space-xs) var(--hf-space-sm);
    border-radius: var(--hf-radius-full);
    text-transform: uppercase;
}

.hf-chain-badge.urgent {
    background: rgba(248, 81, 73, 0.2);
    color: var(--hf-accent-red);
    animation: pulse-urgent 2s infinite;
}

@keyframes pulse-urgent {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.hf-chain-streak {
    display: flex;
    align-items: center;
    gap: var(--hf-space-sm);
    margin-bottom: var(--hf-space-sm);
}

.hf-chain-streak-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--hf-accent-orange);
    text-shadow: 0 0 12px rgba(210, 153, 34, 0.4);
}

.hf-chain-streak-label {
    font-size: 0.875rem;
    color: var(--hf-text-muted);
}

.hf-chain-streak svg {
    width: 24px;
    height: 24px;
    color: var(--hf-accent-orange);
}

.hf-chain-last {
    font-size: 0.75rem;
    color: var(--hf-text-muted);
}

/* Chain Details */
.hf-chain-details {
    display: flex;
    flex-direction: column;
    gap: var(--hf-space-md);
}

.hf-chain-stats {
    display: flex;
    justify-content: space-around;
    padding: var(--hf-space-md);
    background: var(--hf-bg-elevated);
    border-radius: var(--hf-radius-md);
}

.hf-chain-contributed {
    text-align: center;
    padding: var(--hf-space-md);
    background: rgba(63, 185, 80, 0.1);
    border-radius: var(--hf-radius-md);
    color: var(--hf-accent-green);
    font-weight: 500;
}

.hf-chain-members {
    display: flex;
    flex-direction: column;
    gap: var(--hf-space-sm);
}

.hf-chain-member {
    display: flex;
    align-items: center;
    gap: var(--hf-space-md);
    padding: var(--hf-space-sm);
    background: var(--hf-bg-elevated);
    border-radius: var(--hf-radius-md);
}

.hf-chain-member.is-saver {
    border: 1px solid var(--hf-accent-green);
}

.hf-chain-member-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--hf-radius-full);
    overflow: hidden;
}

.hf-chain-member-avatar svg {
    width: 100%;
    height: 100%;
}

.hf-chain-member-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hf-chain-member-name {
    font-weight: 500;
    color: var(--hf-text-primary);
    font-size: 0.875rem;
}

.hf-chain-member-stats {
    font-size: 0.75rem;
    color: var(--hf-text-muted);
}

.hf-saver-badge {
    font-size: 1.25rem;
}

/* Button Variants */
.hf-btn-success {
    background: var(--hf-gradient-success);
    color: var(--hf-bg-dark);
}

.hf-btn-glow {
    box-shadow: var(--hf-glow-blue);
    animation: btn-glow 2s infinite;
}

@keyframes btn-glow {
    0%, 100% { box-shadow: var(--hf-glow-blue); }
    50% { box-shadow: 0 0 30px rgba(88, 166, 255, 0.3); }
}

.hf-btn-sm {
    padding: var(--hf-space-xs) var(--hf-space-sm);
    font-size: 0.75rem;
}

/* Groups Actions */
.hf-groups-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--hf-space-md);
    margin-bottom: var(--hf-space-lg);
}

.hf-groups-actions .hf-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--hf-space-sm);
    padding: var(--hf-space-lg);
    background: var(--hf-bg-card);
    border: 1px solid var(--hf-border);
    border-radius: var(--hf-radius-lg);
    min-height: 80px;
    position: relative;
    overflow: hidden;
}

.hf-groups-actions .hf-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--hf-gradient-primary);
    opacity: 0;
    transition: opacity var(--hf-transition);
}

.hf-groups-actions .hf-btn:hover::before {
    opacity: 1;
}

.hf-groups-actions .hf-btn svg {
    width: 24px;
    height: 24px;
    color: var(--hf-accent-blue);
    transition: transform var(--hf-transition);
}

.hf-groups-actions .hf-btn:hover svg {
    transform: scale(1.2);
}

/* Social Panel Full-Width Buttons */
.hf-social-panel > .hf-btn-outline {
    width: 100%;
    margin-bottom: var(--hf-space-lg);
    padding: var(--hf-space-md) var(--hf-space-lg);
    font-size: 0.9rem;
    font-weight: 600;
    justify-content: center;
    gap: var(--hf-space-sm);
    background: linear-gradient(135deg, var(--hf-bg-card) 0%, var(--hf-bg-elevated) 100%);
    border: 1px solid var(--hf-border);
    border-radius: var(--hf-radius-lg);
}

.hf-social-panel > .hf-btn-outline svg {
    color: var(--hf-accent-blue);
}

.hf-social-panel > .hf-btn-outline:hover {
    background: linear-gradient(135deg, var(--hf-bg-elevated) 0%, var(--hf-bg-card) 100%);
    border-color: var(--hf-accent-blue);
}

/* Duel Action Buttons */
.hf-duel-actions {
    display: flex;
    gap: var(--hf-space-sm);
    margin-top: var(--hf-space-md);
    justify-content: center;
}

.hf-duel-actions .hf-btn {
    flex: 1;
    max-width: 140px;
    padding: var(--hf-space-sm) var(--hf-space-md);
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--hf-radius-md);
}

.hf-duel-actions .hf-btn-success {
    background: var(--hf-gradient-success);
    color: var(--hf-bg-dark);
    border: none;
    box-shadow: 0 2px 8px rgba(63, 185, 80, 0.3);
}

.hf-duel-actions .hf-btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(63, 185, 80, 0.4);
}

.hf-duel-actions .hf-btn-outline {
    background: transparent;
    border: 1px solid var(--hf-border);
    color: var(--hf-text-secondary);
}

.hf-duel-actions .hf-btn-outline:hover {
    border-color: var(--hf-accent-red);
    color: var(--hf-accent-red);
    background: rgba(248, 81, 73, 0.1);
}

/* Group Card Enhanced */
.hf-group-card {
    background: var(--hf-bg-card);
    border: 1px solid var(--hf-border);
    border-radius: var(--hf-radius-lg);
    padding: 12px;
    margin-bottom: var(--hf-space-sm);
    cursor: pointer;
    transition: all var(--hf-transition);
    position: relative;
    overflow: hidden;
}

.hf-group-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(163, 113, 247, 0.05) 0%, transparent 60%);
    opacity: 0;
    transition: opacity var(--hf-transition);
}

.hf-group-card:hover {
    border-color: var(--hf-accent-purple);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(163, 113, 247, 0.1);
}

.hf-group-card:hover::before {
    opacity: 1;
}

.hf-group-card.theme-group {
    padding-top: calc(12px + 20px);
}

.hf-group-category-badge {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 6px var(--hf-space-md);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: var(--hf-radius-lg) var(--hf-radius-lg) 0 0;
    color: white;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--hf-space-xs);
}

.hf-group-category-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
}

.hf-group-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--hf-text-primary);
    margin-bottom: var(--hf-space-sm);
    position: relative;
    z-index: 1;
}

.hf-group-card:hover .hf-group-name {
    background: var(--hf-gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hf-group-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--hf-text-muted);
    position: relative;
    z-index: 1;
}

.hf-group-meta span:first-child {
    display: flex;
    align-items: center;
    gap: var(--hf-space-xs);
}

.hf-group-meta span:first-child::before {
    content: '';
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236e7681' stroke-width='2'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'%3E%3C/path%3E%3Ccircle cx='9' cy='7' r='4'%3E%3C/circle%3E%3Cpath d='M22 21v-2a4 4 0 0 0-3-3.87'%3E%3C/path%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'%3E%3C/path%3E%3C/svg%3E");
    background-size: contain;
}

.hf-group-role {
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--hf-radius-full);
    background: rgba(163, 113, 247, 0.15);
    color: var(--hf-accent-purple);
}

/* Form Enhancements */
.hf-form-row {
    display: flex;
    gap: var(--hf-space-md);
}

.hf-form-row .hf-form-group {
    flex: 1;
}

.hf-team-input {
    display: flex;
    gap: var(--hf-space-sm);
    margin-bottom: var(--hf-space-sm);
}

.hf-team-input .hf-form-input {
    flex: 1;
}

.hf-color-input {
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--hf-border);
    border-radius: var(--hf-radius-md);
    cursor: pointer;
    background: var(--hf-bg-input);
}

.hf-color-input::-webkit-color-swatch-wrapper {
    padding: 4px;
}

.hf-color-input::-webkit-color-swatch {
    border-radius: var(--hf-radius-sm);
    border: none;
}

/* Section Styles */
.hf-section {
    margin-bottom: var(--hf-space-xl);
}

.hf-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--hf-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--hf-space-md);
    display: flex;
    align-items: center;
    gap: var(--hf-space-sm);
}

.hf-section-title::before {
    content: '';
    width: 3px;
    height: 14px;
    background: var(--hf-gradient-fire);
    border-radius: 2px;
}

.hf-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--hf-border) 0%, transparent 100%);
    margin-left: var(--hf-space-sm);
}

/* Groups List */
.hf-groups-list {
    display: flex;
    flex-direction: column;
    gap: var(--hf-space-sm);
}

/* ============================================
   SHARED HABITS ON HOME SCREEN
   ============================================ */

.hf-shared-category {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--hf-border);
}

.hf-category-dot.shared {
    background: var(--hf-gradient-primary);
}

.hf-shared-badge {
    margin-left: auto;
    padding: 2px 8px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(163, 113, 247, 0.2);
    color: var(--hf-accent-purple);
    border-radius: 4px;
}

.hf-habit-card.shared {
    border-left: 3px solid var(--hf-accent-purple);
}

.hf-habit-participants {
    font-size: 0.7rem;
    color: var(--hf-text-muted);
    margin-top: 2px;
}

/* Participant avatars for shared habits */
.hf-participants-row {
    display: flex;
    gap: 4px;
    margin-top: 6px;
}

.hf-participant-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--hf-bg-elevated);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    border: 2px solid var(--hf-bg-card);
    color: var(--hf-text-secondary);
    overflow: hidden;
}

.hf-participant-avatar.completed {
    border-color: var(--hf-accent-green);
}

.hf-participant-avatar svg {
    width: 100%;
    height: 100%;
}

.hf-check-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background: var(--hf-accent-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hf-check-badge svg {
    width: 8px;
    height: 8px;
    color: white;
}

/* ============================================
   SATISFACTION ANIMATIONS
   ============================================ */

/* Checkmark Pop Animation */
@keyframes checkmark-pop {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

.hf-checkbox.completing .hf-checkbox-icon {
    animation: checkmark-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* XP Float Animation */
@keyframes xp-float {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    50% {
        opacity: 1;
        transform: translateY(-20px) scale(1.1);
    }
    100% {
        opacity: 0;
        transform: translateY(-40px) scale(0.9);
    }
}

.hf-xp-float {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--hf-accent-orange);
    text-shadow: 0 0 10px rgba(210, 153, 34, 0.5);
    pointer-events: none;
    z-index: 100;
    animation: xp-float 1s ease-out forwards;
}

.hf-xp-float.streak-bonus {
    color: var(--hf-accent-green);
    text-shadow: 0 0 10px rgba(63, 185, 80, 0.5);
}

.hf-xp-float.perfect-bonus {
    color: var(--hf-accent-purple);
    text-shadow: 0 0 10px rgba(163, 113, 247, 0.5);
    font-size: 1.5rem;
}

/* Streak Counter Bounce Animation */
@keyframes streak-bounce {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.15); }
    50% { transform: scale(0.95); }
    75% { transform: scale(1.05); }
}

@keyframes streak-bounce-milestone {
    0% { transform: scale(1); }
    20% { transform: scale(1.4); }
    40% { transform: scale(0.9); }
    60% { transform: scale(1.2); }
    80% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.hf-streak-badge.bouncing {
    animation: streak-bounce 0.5s ease-out;
}

.hf-streak-badge.bouncing-milestone {
    animation: streak-bounce-milestone 0.8s ease-out;
}

/* Confetti Animation */
@keyframes confetti-fall {
    0% {
        transform: translateY(-100%) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.hf-confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 9999;
}

.hf-confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    animation: confetti-fall 3s ease-out forwards;
}

.hf-confetti.circle {
    border-radius: 50%;
}

.hf-confetti.square {
    border-radius: 2px;
}

/* Level Up Celebration Overlay */
@keyframes level-up-pulse {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes level-up-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(88, 166, 255, 0.3); }
    50% { box-shadow: 0 0 40px rgba(88, 166, 255, 0.6), 0 0 60px rgba(163, 113, 247, 0.4); }
}

@keyframes progress-fill {
    0% { width: 0; }
    100% { width: var(--fill-percent, 100%); }
}

.hf-level-up-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 17, 23, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease-out;
}

.hf-level-up-content {
    text-align: center;
    animation: level-up-pulse 0.6s ease-out;
}

.hf-level-up-badge {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--hf-gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    animation: level-up-glow 2s ease-in-out infinite;
}

.hf-level-up-number {
    font-size: 3rem;
    font-weight: 800;
    color: var(--hf-bg-dark);
}

.hf-level-up-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--hf-text-primary);
    margin-bottom: 8px;
}

.hf-level-up-subtitle {
    font-size: 1rem;
    color: var(--hf-text-secondary);
    margin-bottom: 24px;
}

.hf-level-up-progress {
    width: 200px;
    height: 8px;
    background: var(--hf-bg-elevated);
    border-radius: var(--hf-radius-full);
    overflow: hidden;
    margin: 0 auto 24px;
}

.hf-level-up-progress-fill {
    height: 100%;
    background: var(--hf-gradient-primary);
    border-radius: var(--hf-radius-full);
    animation: progress-fill 1s ease-out forwards;
}

.hf-level-up-close {
    padding: 12px 32px;
    background: var(--hf-gradient-primary);
    border: none;
    border-radius: var(--hf-radius-full);
    color: var(--hf-bg-dark);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: transform var(--hf-transition);
}

.hf-level-up-close:hover {
    transform: scale(1.05);
}

/* Habit Card Completing State */
.hf-habit-card.completing {
    background: rgba(63, 185, 80, 0.05);
}

/* Card Success Flash */
@keyframes card-success-flash {
    0% { background: var(--hf-bg-card); }
    50% { background: rgba(63, 185, 80, 0.15); }
    100% { background: var(--hf-bg-card); }
}

.hf-habit-card.success-flash {
    animation: card-success-flash 0.6s ease-out;
}

/* ============================================
   XP MULTIPLIER DISPLAY
   ============================================ */

.hf-multiplier-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--hf-bg-elevated);
    border: 1px solid var(--hf-border);
    border-radius: var(--hf-radius-md);
    margin-bottom: var(--hf-space-md);
}

.hf-multiplier-icon {
    width: 24px;
    height: 24px;
    color: var(--hf-accent-orange);
}

.hf-multiplier-info {
    flex: 1;
}

.hf-multiplier-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--hf-accent-orange);
}

.hf-multiplier-label {
    font-size: 0.75rem;
    color: var(--hf-text-muted);
}

.hf-multiplier-bar {
    width: 80px;
    height: 6px;
    background: var(--hf-bg-input);
    border-radius: var(--hf-radius-full);
    overflow: hidden;
}

.hf-multiplier-bar-fill {
    height: 100%;
    background: var(--hf-gradient-fire);
    border-radius: var(--hf-radius-full);
    transition: width var(--hf-transition);
}

.hf-multiplier-warning {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid var(--hf-accent-red);
    border-radius: var(--hf-radius-md);
    margin-bottom: var(--hf-space-md);
    font-size: 0.875rem;
    color: var(--hf-accent-red);
}

.hf-multiplier-warning svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

@keyframes multiplier-decay {
    0% { transform: scale(1); color: var(--hf-accent-orange); }
    50% { transform: scale(0.9); color: var(--hf-accent-red); }
    100% { transform: scale(1); color: var(--hf-accent-orange); }
}

.hf-multiplier-value.decaying {
    animation: multiplier-decay 0.5s ease-out;
}

/* ============================================
   STREAK RECOVERY (ENDANGERED STATE)
   ============================================ */

.hf-streak-badge.endangered {
    background: rgba(248, 81, 73, 0.15);
    color: var(--hf-accent-red);
    border: 1px solid var(--hf-accent-red);
    animation: endangered-pulse 2s ease-in-out infinite;
}

@keyframes endangered-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(248, 81, 73, 0);
        border-color: var(--hf-accent-red);
    }
    50% {
        box-shadow: 0 0 10px 2px rgba(248, 81, 73, 0.3);
        border-color: rgba(248, 81, 73, 0.7);
    }
}

.hf-streak-recovery-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid var(--hf-accent-red);
    border-radius: var(--hf-radius-md);
    margin-bottom: var(--hf-space-md);
}

.hf-streak-recovery-info {
    flex: 1;
}

.hf-streak-recovery-title {
    font-weight: 600;
    color: var(--hf-accent-red);
    margin-bottom: 4px;
}

.hf-streak-recovery-countdown {
    font-size: 0.875rem;
    color: var(--hf-text-secondary);
}

.hf-streak-recovery-countdown strong {
    color: var(--hf-accent-red);
}

.hf-streak-recovery-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--hf-accent-red);
    border: none;
    border-radius: var(--hf-radius-full);
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--hf-transition);
    white-space: nowrap;
}

.hf-streak-recovery-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(248, 81, 73, 0.4);
}

.hf-streak-recovery-cost {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--hf-radius-full);
    font-size: 0.75rem;
}

/* Habit card with endangered streak */
.hf-habit-card.endangered-streak {
    border-color: rgba(248, 81, 73, 0.5);
}

.hf-habit-card.endangered-streak .hf-streak-badge {
    background: rgba(248, 81, 73, 0.15);
    color: var(--hf-accent-red);
}

/* Fade in animation utility */
@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}
