/* FamilyHub Styles */
@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;500;600;700&family=Press+Start+2P&display=swap');

/* Cute Theme (Default) */
:root,
[data-theme="cute"] {
    --primary: #ff6b9d;
    --primary-light: #ffa6c9;
    --primary-dark: #e85384;
    --bg: #fff5f7;
    --surface: #ffffff;
    --text: #2d1b2e;
    --text-secondary: #8b7a8c;
    --border: #f0d9e0;
    --success: #5fdc91;
    --warning: #ffb347;
    --danger: #ff6b81;
    --star: #ffd93d;
    --radius: 20px;
    --shadow: 0 4px 12px rgba(255, 107, 157, 0.15);
    --font-family: 'Quicksand', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --bg-gradient: linear-gradient(135deg, #fff5f7 0%, #ffe8f0 100%);
}

/* Retro Game Theme */
[data-theme="retro"] {
    --primary: #ff6b35;
    --primary-light: #ff8c61;
    --primary-dark: #e55a2b;
    --bg: #2d1b2e;
    --surface: #3e2c41;
    --text: #f4f1de;
    --text-secondary: #c9b8a5;
    --border: #6b4e71;
    --success: #06ffa5;
    --warning: #ffe66d;
    --danger: #ff5470;
    --star: #ffe66d;
    --radius: 0px;
    --shadow: 4px 4px 0px rgba(0, 0, 0, 0.3);
    --font-family: 'Press Start 2P', monospace;
    --bg-gradient: repeating-linear-gradient(
        0deg,
        #2d1b2e 0px,
        #2d1b2e 2px,
        #331d30 2px,
        #331d30 4px
    );
}

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

body {
    font-family: var(--font-family);
    background: var(--bg-gradient);
    color: var(--text);
    min-height: 100vh;
    transition: all 0.3s ease;
    -webkit-text-size-adjust: 100%;
}

/* iOS PWA specific fixes */
input, textarea, select {
    font-size: 16px !important; /* Prevents iOS zoom on focus */
    touch-action: manipulation;
    -webkit-user-select: text !important;
    user-select: text !important;
    pointer-events: auto !important;
}

.hidden { display: none !important; }

/* Auth Screen */
.auth-container {
    max-width: 420px;
    margin: 0 auto;
    padding: 2rem;
    text-align: center;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
}

.auth-container h1 {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 500;
}

.auth-container input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid var(--border);
    border-radius: 50px;
    font-size: 16px !important;
    margin-bottom: 0.5rem;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    -webkit-user-select: text;
    user-select: text;
    pointer-events: auto;
}

.auth-container input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(255, 107, 157, 0.2);
}

/* Buttons */
.btn {
    padding: 0.85rem 1.75rem;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-bottom: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 157, 0.3);
}

.btn-secondary {
    background: var(--surface);
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: #fff0f5;
    transform: translateY(-2px);
}

.btn-link {
    background: none;
    color: var(--text-secondary);
    text-decoration: underline;
    padding: 0.5rem;
}

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

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    width: auto;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: 0 2px 12px rgba(255, 107, 157, 0.2);
}

header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

#logout-btn { color: rgba(255,255,255,0.8); }

/* Tab Bar */
.tab-bar {
    display: flex;
    background: white;
    border-bottom: 2px solid var(--border);
    overflow-x: auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.tab {
    flex: 1;
    padding: 1rem;
    border: none;
    background: none;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.tab:hover {
    color: var(--primary);
    background: rgba(255, 107, 157, 0.05);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: rgba(255, 107, 157, 0.08);
}

/* Content */
.tab-content { display: none; padding: 1rem; }
.tab-content.active { display: block; }

/* Cards */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    border: 2px solid var(--border);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 107, 157, 0.2);
}

.user-card {
    background: linear-gradient(145deg, #ffffff 0%, #fffafc 100%);
}

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

/* Stars */
.stars {
    color: var(--star);
    font-size: 1.1rem;
}

/* User avatars */
.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    border: 3px solid white;
}

.user-avatar:hover {
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.25);
}

#user-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin: 1rem 0;
}

.user-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.75rem;
    border-radius: var(--radius);
    transition: background 0.2s;
}

.user-option:hover { background: #eef2ff; }
.user-option .user-avatar { width: 64px; height: 64px; font-size: 1.5rem; }

/* Task Items */
.task-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
}

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

.task-check {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.task-check.completed {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.task-info { flex: 1; }
.task-title { font-weight: 500; }
.task-title.completed { text-decoration: line-through; color: var(--text-secondary); }
.task-assignee { font-size: 0.8rem; color: var(--text-secondary); }

/* Shopping List */
.shopping-container {
    display: flex;
    gap: 2rem;
    min-height: 500px;
    max-height: calc(100vh - 200px);
    position: relative;
}

.shopping-quickadd {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 2px solid var(--border);
}

.shopping-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    padding-bottom: 80px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 2px solid var(--border);
    position: relative;
}

.quickadd-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

.quickadd-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.quickadd-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(255, 107, 157, 0.3);
    background: var(--primary-dark);
}

.quickadd-name {
    font-size: 0.95rem;
    text-align: center;
}

.quickadd-count {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-weight: 700;
}

.shop-items-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.shop-item-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--bg);
    border-radius: var(--radius);
    border: 2px solid var(--border);
    transition: all 0.3s ease;
    cursor: pointer;
}

.shop-item-card:hover {
    transform: translateX(4px);
    border-color: var(--primary);
}

.shop-item-card.bought {
    opacity: 0.5;
    background: var(--border);
}

.shop-item-card.bought .shop-item-name {
    text-decoration: line-through;
}

.shop-item-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.shop-checkbox {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 3px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: white;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.shop-checkbox.checked {
    background: var(--success);
    border-color: var(--success);
}

.shop-item-name {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
}

.shop-delete-btn {
    background: none;
    border: none;
    color: var(--danger);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.shop-delete-btn:hover {
    opacity: 1;
}

.add-item-fixed {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: var(--surface);
    border-top: 2px solid var(--border);
    display: flex;
    gap: 0.75rem;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
}

.add-item-fixed input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
}

.add-item-fixed input:focus {
    outline: none;
    border-color: var(--primary);
}

.add-item-fixed .btn {
    white-space: nowrap;
    margin: 0;
}

.mobile-nav-dots {
    display: none;
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    gap: 0.5rem;
    z-index: 10;
}

.nav-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-secondary);
    opacity: 0.3;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-dot.active {
    opacity: 1;
    background: var(--primary);
    transform: scale(1.3);
}

/* Mobile: Single column swipe view */
@media (max-width: 768px) {
    .shopping-container {
        flex-direction: column;
        overflow: hidden;
        position: relative;
    }

    .shopping-quickadd,
    .shopping-list {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .shopping-quickadd.active {
        transform: translateX(0);
    }

    .shopping-list {
        transform: translateX(0);
    }

    .shopping-list.active {
        transform: translateX(0);
    }

    .mobile-nav-dots {
        display: flex;
    }

    .quickadd-buttons {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

/* Appointments */
.appointment-item {
    padding: 0.75rem;
    border-left: 4px solid var(--primary);
    margin-bottom: 0.5rem;
    background: #f8faff;
    border-radius: 0 var(--radius) var(--radius) 0;
}

.appointment-time {
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 600;
}

.appointment-title { font-weight: 500; margin-top: 0.25rem; }

/* Progress Tracker (GitHub-style) */
.progress-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 14px);
    gap: 3px;
    margin: 1rem 0;
}

.progress-cell {
    width: 12px;
    height: 12px;
    border-radius: 4px;
    background: #f5e6ee;
    transition: all 0.2s ease;
}

.progress-cell:hover {
    transform: scale(1.2);
}

.progress-cell.level-1 { background: #b8f0d6; }
.progress-cell.level-2 { background: #7ee3b8; }
.progress-cell.level-3 { background: #5fdc91; }
.progress-cell.level-4 { background: #3ac776; }

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-size: 1.75rem;
    border: none;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    z-index: 50;
}

.fab:hover { transform: scale(1.1); }

/* Modal */
.modal {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 90%;
    width: 420px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(255, 107, 157, 0.3);
    border: 2px solid var(--border);
}

#modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

#modal-overlay.hidden { display: none; }

.modal h3 { margin-bottom: 1rem; }

.modal input, .modal select, .modal textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid var(--border);
    border-radius: 15px;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
    background: white;
}

.modal input:focus, .modal select:focus, .modal textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 3px 10px rgba(255, 107, 157, 0.15);
    transform: translateY(-1px);
}

.modal-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.modal-actions .btn { flex: 1; }

/* Add input row */
.add-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.add-row input { flex: 1; margin: 0; }

/* Section titles */
.section-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--primary);
    letter-spacing: -0.5px;
}

/* Touch targets - minimum 44px for all interactive elements */
.task-check { min-width: 44px; min-height: 44px; width: 44px; height: 44px; }
.appointment-item { cursor: pointer; min-height: 44px; }

/* ========== TABLET / DESKTOP (768px+) ========== */
@media (min-width: 768px) {
    .tab-content { max-width: 900px; margin: 0 auto; padding: 1.5rem; }
    .auth-container { padding-top: 10vh; }
    .tab { font-size: 1rem; padding: 0.85rem 1.5rem; }
    header h1 { font-size: 1.5rem; }
    .card { padding: 1.25rem; }
    .task-item { padding: 0.85rem 1rem; }
    .user-option .user-avatar { width: 72px; height: 72px; font-size: 1.75rem; }
}

/* ========== LANDSCAPE iPad / Tablet (landscape + min 768 wide) ========== */
@media (orientation: landscape) and (min-width: 768px) {
    /* Full viewport layout - no scrolling on large screens */
    #main-screen {
        display: flex;
        flex-direction: column;
        height: 100vh;
        overflow: hidden;
    }

    header { flex-shrink: 0; padding: 0.5rem 1.5rem; }
    .tab-bar { flex-shrink: 0; }

    #content {
        flex: 1;
        overflow: hidden;
        display: flex;
    }

    .tab-content {
        max-width: 100%;
        width: 100%;
        overflow-y: auto;
        padding: 1rem 2rem;
    }

    .tab-content.active {
        display: flex;
        flex-direction: column;
    }

    /* Dashboard: side by side layout */
    #tab-dashboard.active {
        flex-direction: row;
        gap: 1.5rem;
        flex-wrap: nowrap;
        align-items: flex-start;
    }

    #tab-dashboard .card {
        flex: 1;
        min-width: 0;
        margin-bottom: 0;
    }

    /* Tasks: compact for no-scroll */
    .task-item { padding: 0.5rem 0.75rem; }
    .task-assignee { font-size: 0.75rem; }

    /* Shopping: compact */
    .shop-item { padding: 0.4rem 0; }

    /* Appointments: compact */
    .appointment-item { padding: 0.5rem 0.75rem; margin-bottom: 0.35rem; }
}

/* ========== LANDSCAPE small screens (phones) ========== */
@media (orientation: landscape) and (max-height: 500px) {
    .auth-container { padding: 0.75rem; min-height: auto; gap: 0.5rem; }
    .auth-container h1 { font-size: 1.5rem; }
    .subtitle { margin-bottom: 0.25rem; font-size: 0.85rem; }
    .auth-container input { padding: 0.5rem 0.75rem; margin-bottom: 0.25rem; font-size: 0.9rem; }
    .btn { padding: 0.5rem 1rem; font-size: 0.9rem; margin-bottom: 0.25rem; }

    header { padding: 0.35rem 1rem; }
    header h1 { font-size: 1rem; }
    .tab { padding: 0.4rem 0.75rem; font-size: 0.8rem; }
    .tab-content { padding: 0.5rem 0.75rem; }
    .card { padding: 0.75rem; margin-bottom: 0.5rem; }
    .section-title { font-size: 0.95rem; margin-bottom: 0.5rem; }
    .task-item { padding: 0.4rem 0.5rem; gap: 0.5rem; }
    .task-check { min-width: 36px; min-height: 36px; width: 36px; height: 36px; }
}

/* ========== TV / very large landscape (1200px+ wide, landscape) ========== */
@media (orientation: landscape) and (min-width: 1200px) {
    .tab-content { padding: 1.5rem 3rem; }
    .tab { font-size: 1.05rem; padding: 0.75rem 2rem; }
    header { padding: 0.6rem 2rem; }
    header h1 { font-size: 1.5rem; }
    .card { padding: 1.5rem; }
    .progress-cell { width: 14px; height: 14px; }

    /* Larger touch targets for TV remote navigation */
    .task-check { width: 48px; height: 48px; min-width: 48px; min-height: 48px; font-size: 1.25rem; }
    .task-item { padding: 0.75rem 1rem; }
    .user-avatar { width: 56px; height: 56px; font-size: 1.5rem; }
    .user-option .user-avatar { width: 80px; height: 80px; font-size: 2rem; }
}

/* Dashboard Task Items (divs with rounded edges for better responsive layout) */
.dashboard-task-item {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    padding: 0.7rem 0.5rem;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 3px 10px rgba(255, 107, 157, 0.25);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
}

.dashboard-task-item:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 5px 15px rgba(255, 107, 157, 0.35);
}

.dashboard-task-item:active {
    transform: translateY(0) scale(0.98);
}

.dashboard-task-item.completed {
    background: linear-gradient(135deg, #e8d5e0 0%, #f0e0ea 100%);
    color: var(--text-secondary);
    text-decoration: line-through;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.dashboard-task-item.completed:hover {
    background: linear-gradient(135deg, #d8c5d0 0%, #e0d0da 100%);
    transform: translateY(-1px);
}

/* Legacy Task Buttons (kept for backwards compatibility) */
.task-btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    padding: 0.7rem 1.2rem;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 3px 10px rgba(255, 107, 157, 0.25);
}

.task-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 5px 15px rgba(255, 107, 157, 0.35);
}

.task-btn.completed {
    background: linear-gradient(135deg, #e8d5e0 0%, #f0e0ea 100%);
    color: var(--text-secondary);
    text-decoration: line-through;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.task-btn.completed:hover {
    background: linear-gradient(135deg, #d8c5d0 0%, #e0d0da 100%);
    transform: translateY(-1px);
}

/* Leaderboard Ticker */
.leaderboard-ticker-container {
    background: linear-gradient(90deg, #fff5f7 0%, #ffe8f0 50%, #fff5f7 100%);
    border-bottom: 2px solid var(--border);
    overflow: hidden;
    height: 40px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.leaderboard-ticker {
    display: inline-block;
    white-space: nowrap;
    animation: scroll 30s linear infinite;
    padding-left: 100%;
    font-size: 0.95rem;
    color: var(--text);
    font-weight: 600;
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* User Cards Container */
.user-cards-container {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0;
}

@media (min-width: 768px) {
    .user-cards-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-task-item {
        font-size: 0.9rem;
        padding: 0.8rem 0.6rem;
    }
}

@media (max-width: 767px) {
    .dashboard-task-item {
        font-size: 0.8rem;
        padding: 0.6rem 0.4rem;
        min-height: 40px;
    }
}

@media (min-width: 1024px) {
    .dashboard-task-item {
        font-size: 0.95rem;
        padding: 0.9rem 0.8rem;
    }
}

/* ========== RETRO GAME THEME ENHANCEMENTS ========== */
[data-theme="retro"] * {
    font-size: 10px;
    line-height: 1.4;
}

[data-theme="retro"] .card {
    background: var(--surface);
    border: 4px solid var(--primary);
    box-shadow: 8px 8px 0px rgba(0, 0, 0, 0.5);
}

[data-theme="retro"] .card:hover {
    box-shadow: 12px 12px 0px rgba(0, 0, 0, 0.6);
    transform: translate(-2px, -2px);
}

[data-theme="retro"] header {
    background: var(--surface);
    border-bottom: 4px solid var(--primary);
    box-shadow: 0 4px 0px rgba(0, 0, 0, 0.5);
}

[data-theme="retro"] header h1 {
    text-shadow: 3px 3px 0px rgba(0, 0, 0, 0.5);
    font-size: 16px;
}

[data-theme="retro"] .btn-primary {
    background: var(--primary);
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.5);
    border: 3px solid var(--primary-dark);
}

[data-theme="retro"] .btn-primary:hover {
    box-shadow: 6px 6px 0px rgba(0, 0, 0, 0.6);
    transform: translate(-2px, -2px);
}

[data-theme="retro"] .dashboard-task-item {
    background: var(--primary);
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.5);
    border: 3px solid var(--primary-dark);
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.3);
    font-size: 10px;
    padding: 0.8rem 0.4rem;
}

[data-theme="retro"] .dashboard-task-item:hover {
    box-shadow: 6px 6px 0px rgba(0, 0, 0, 0.6);
    transform: translate(-2px, -2px);
}

[data-theme="retro"] .dashboard-task-item.completed {
    background: #5a4a5e;
    border-color: #44374a;
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.5);
    text-shadow: none;
}

[data-theme="retro"] .task-btn {
    background: var(--primary);
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.5);
    border: 3px solid var(--primary-dark);
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.3);
    font-size: 10px;
    padding: 0.8rem 0.6rem;
}

[data-theme="retro"] .task-btn:hover {
    box-shadow: 6px 6px 0px rgba(0, 0, 0, 0.6);
    transform: translate(-2px, -2px);
}

[data-theme="retro"] .task-btn.completed {
    background: #5a4a5e;
    border-color: #44374a;
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.5);
    text-shadow: none;
}

[data-theme="retro"] .user-avatar {
    border: 4px solid var(--primary);
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.5);
}

[data-theme="retro"] .progress-cell {
    background: #1a0f1c;
    border: 1px solid var(--border);
}

[data-theme="retro"] .progress-cell.level-1 {
    background: #4a90e2;
}

[data-theme="retro"] .progress-cell.level-2 {
    background: #f5a623;
}

[data-theme="retro"] .progress-cell.level-3 {
    background: #ff6b35;
}

[data-theme="retro"] .progress-cell.level-4 {
    background: #ff006e;
    box-shadow: 0 0 4px #ff006e;
}

[data-theme="retro"] .leaderboard-ticker-container {
    background: var(--surface);
    border-bottom: 4px solid var(--primary);
    box-shadow: 0 4px 0px rgba(0, 0, 0, 0.5);
}

[data-theme="retro"] .leaderboard-ticker {
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.5);
    font-size: 11px;
}

[data-theme="retro"] .auth-container h1 {
    color: var(--primary);
    text-shadow: 4px 4px 0px rgba(0, 0, 0, 0.5);
    font-size: 28px;
    -webkit-text-fill-color: var(--primary);
    filter: none;
    animation: none;
}

[data-theme="retro"] input,
[data-theme="retro"] select,
[data-theme="retro"] textarea {
    background: var(--surface);
    border: 3px solid var(--primary);
    color: var(--text);
    box-shadow: inset 2px 2px 0px rgba(0, 0, 0, 0.3);
}

[data-theme="retro"] input:focus,
[data-theme="retro"] select:focus,
[data-theme="retro"] textarea:focus {
    box-shadow: inset 2px 2px 0px rgba(0, 0, 0, 0.3), 0 0 0 2px var(--primary-light);
    border-color: var(--primary-light);
}

[data-theme="retro"] .tab {
    font-size: 10px;
}

[data-theme="retro"] .tab.active {
    box-shadow: inset 0 -4px 0 0 var(--primary);
}

[data-theme="retro"] .modal {
    background: var(--surface);
    border: 4px solid var(--primary);
    box-shadow: 8px 8px 0px rgba(0, 0, 0, 0.5);
}

[data-theme="retro"] .section-title {
    font-size: 12px;
}

[data-theme="retro"] .quickadd-btn {
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.5);
    border: 3px solid var(--primary-dark);
    font-size: 10px;
}

[data-theme="retro"] .quickadd-btn:hover {
    box-shadow: 6px 6px 0px rgba(0, 0, 0, 0.6);
}

[data-theme="retro"] .shop-item-card {
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.3);
    border: 3px solid var(--border);
}

[data-theme="retro"] .shop-item-card:hover {
    box-shadow: 6px 6px 0px rgba(0, 0, 0, 0.4);
}

[data-theme="retro"] .shop-item-name {
    font-size: 10px;
}

[data-theme="retro"] .add-item-fixed input {
    border: 3px solid var(--primary);
    box-shadow: inset 2px 2px 0px rgba(0, 0, 0, 0.3);
    font-size: 10px;
}
