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

:root {
    --primary: #6C63FF;
    --primary-light: #8B83FF;
    --accent: #FF8C42;
    --accent-light: #FFA96B;
    --bg: #F8F4F0;
    --card: #FFFFFF;
    --text: #2D3436;
    --text-light: #636E72;
    --text-muted: #B2BEC3;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
    --radius: 16px;
    --radius-sm: 12px;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    padding-bottom: 80px;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

/* Header */
.site-header {
    text-align: center;
    padding: 30px 0 20px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 8px;
}

.logo-icon {
    font-size: 32px;
}

.logo h1 {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
}

.tagline {
    color: var(--text-light);
    font-size: 15px;
    font-weight: 600;
}

/* Screens */
.screen {
    display: none;
    animation: fadeIn 0.3s ease;
}

.screen.active {
    display: block;
}

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

/* Age Selection */
.intro-text {
    text-align: center;
    margin-bottom: 24px;
}

.intro-text p {
    font-size: 16px;
    color: var(--text-light);
    line-height: 1.6;
}

.age-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 30px;
}

.age-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 24px;
    border: 2px solid transparent;
    border-radius: var(--radius);
    background: var(--card);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
    text-align: left;
    font-family: inherit;
}

.age-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

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

.age-emoji {
    font-size: 36px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f0ff 0%, #ffe8d6 100%);
    border-radius: 50%;
    flex-shrink: 0;
}

.age-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.age-range {
    margin-left: auto;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
}

/* Screen Header */
.screen-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.back-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background: var(--card);
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-light);
    transition: var(--transition);
    box-shadow: var(--shadow);
}

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

.screen-header h2 {
    font-size: 22px;
    font-weight: 800;
    flex: 1;
}

/* Featured Card */
.featured-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.card-category {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.card-category.video { background: #FFE5E5; color: #E74C3C; }
.card-category.game { background: #E5F5FF; color: #3498DB; }
.card-category.book { background: #FFF3E0; color: #FF8C42; }
.card-category.craft { background: #E8F5E9; color: #27AE60; }
.card-category.experiment { background: #F3E5F5; color: #9B59B6; }

.card-title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--text);
    line-height: 1.3;
}

.card-description {
    font-size: 15px;
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 20px;
}

.card-why {
    background: #F0FFF4;
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 20px;
}

.card-why::before {
    content: "💡 Why it's good:";
    display: block;
    font-weight: 700;
    font-size: 13px;
    color: #27AE60;
    margin-bottom: 8px;
}

.card-why p {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.6;
}

.card-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.meta-tag {
    padding: 6px 12px;
    background: var(--bg);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
}

.card-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 15px;
    transition: var(--transition);
}

.card-link:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
}

/* Actions */
.screen-actions {
    display: flex;
    gap: 12px;
}

.action-btn {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid var(--text-muted);
    border-radius: var(--radius-sm);
    background: var(--card);
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    font-size: 14px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

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

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

.action-btn.saved {
    background: #FFF8E1;
    border-color: var(--accent);
    color: var(--accent);
}

/* Browse */
.age-filters {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 20px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.age-filters::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    padding: 10px 18px;
    border: 2px solid transparent;
    border-radius: 25px;
    background: var(--card);
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    font-size: 13px;
    color: var(--text-light);
    transition: var(--transition);
    white-space: nowrap;
    box-shadow: var(--shadow);
    flex-shrink: 0;
}

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

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

/* Browse List */
.browse-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.browse-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--card);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

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

.browse-item-icon {
    font-size: 28px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border-radius: 12px;
    flex-shrink: 0;
}

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

.browse-item-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text);
}

.browse-item-desc {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Favorites */
.favorites-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.favorite-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--card);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: var(--transition);
}

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

.favorite-item-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border-radius: 10px;
    flex-shrink: 0;
}

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

.favorite-item-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.favorite-item-age {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 15px;
    font-weight: 600;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card);
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-around;
    padding: 8px 0 20px;
    z-index: 100;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
    position: relative;
}

.nav-icon {
    font-size: 22px;
}

.nav-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
}

.nav-btn.active .nav-label {
    color: var(--primary);
}

.nav-btn.active::after {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
}

.fav-count {
    position: absolute;
    top: 2px;
    right: 10px;
    background: var(--accent);
    color: white;
    font-size: 10px;
    font-weight: 800;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive */
@media (max-width: 360px) {
    .container {
        padding: 0 16px;
    }
    
    .featured-card {
        padding: 20px;
    }
    
    .card-title {
        font-size: 20px;
    }
}

/* Toast */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--text);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 200;
    white-space: nowrap;
}

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