@import url('https://fonts.googleapis.com/css2?family=Capriola&family=Quicksand:wght@300..700&display=swap');

:root {
    /* Colorful Playful Theme Palette */
    --kids-peach: #FF7A59;
    --kids-lavender: #8B5CF6;
    --kids-sky: #4EA8DE;
    --kids-mint: #20C997;
    --kids-pink: #FF5D8F;
    --kids-sun: #FFB703;
    
    --bg-primary: #FAF9F6;       /* Clean warm canvas */
    --bg-surface: #FFFDF9;       /* Light container bg */
    --bg-card: #FFFFFF;          /* Pure white card */
    
    --text-primary: #2D2730;     /* Dark charcoal */
    --text-secondary: #605765;   /* Warm slate */
    --text-muted: #9E95A3;       /* Pastel grey */
    
    --border-color: #EFEBE4;
    --border-glow: rgba(139, 92, 246, 0.12);
    
    --font-heading: 'Capriola', sans-serif;
    --font-body: 'Quicksand', sans-serif;
    
    --container-max: 1200px;
    --transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --shadow-sm: 0 4px 10px rgba(45, 39, 48, 0.02);
    --shadow-md: 0 10px 25px rgba(45, 39, 48, 0.05);
    --shadow-lg: 0 20px 45px rgba(45, 39, 48, 0.08);
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 1rem;
}

a {
    color: var(--kids-lavender);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--kids-peach);
}

/* Layout Utilities */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: 4rem 0;
}

/* Header & Navigation */
.site-header {
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 0 0 0;
}

.header-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

.site-logo {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--kids-lavender);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    text-shadow: 2px 2px 0px rgba(139, 92, 246, 0.08);
}

.site-logo span:nth-child(6n+1) { color: var(--kids-lavender); }
.site-logo span:nth-child(6n+2) { color: var(--kids-peach); }
.site-logo span:nth-child(6n+3) { color: var(--kids-sky); }
.site-logo span:nth-child(6n+4) { color: var(--kids-mint); }
.site-logo span:nth-child(6n+5) { color: var(--kids-pink); }
.site-logo span:nth-child(6n) { color: var(--kids-sun); }

.site-tagline {
    font-family: var(--font-heading);
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 500px;
    margin: 0 auto;
    font-weight: 500;
}

.nav-bar {
    width: 100%;
    margin-top: 1.5rem;
    background: #FFFDF9;
    border-top: 1px solid var(--border-color);
}

.nav-bar-inner {
    display: flex;
    justify-content: center;
    align-items: center;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    padding: 1rem;
    cursor: pointer;
}

.site-nav {
    display: flex;
    gap: 0.25rem;
}

.nav-link {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 1rem 1.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
    color: var(--kids-lavender);
    border-bottom-color: var(--kids-lavender);
    background: rgba(139, 92, 246, 0.02);
}

/* Playful floating shapes */
.hero-section {
    position: relative;
    background: linear-gradient(135deg, #F5F3FF 0%, #FFF5F5 100%);
    padding: 5rem 0;
    overflow: hidden;
    border-bottom: 1px solid var(--border-color);
}

.hero-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
    z-index: 2;
    position: relative;
}

.hero-content {
    max-width: 600px;
}

.hero-title {
    font-size: 3.5rem;
    line-height: 1.15;
    margin-bottom: 1.5rem;
}

.hero-title span {
    color: var(--kids-peach);
}

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

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0.85rem 2rem;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.btn-pink { background-color: var(--kids-pink); color: white; }
.btn-pink:hover { background-color: #E23E72; color: white; }

.btn-orange { background-color: var(--kids-peach); color: white; }
.btn-orange:hover { background-color: #E55E3B; color: white; }

.btn-sky { background-color: var(--kids-sky); color: white; }
.btn-sky:hover { background-color: #3895C9; color: white; }

.btn-mint { background-color: var(--kids-mint); color: white; }
.btn-mint:hover { background-color: #1aa87d; color: white; }

.btn-outline { background-color: transparent; color: var(--text-primary); border: 2px solid var(--border-color); box-shadow: none; }
.btn-outline:hover { background-color: #F3EFE9; }

.hero-graphics {
    position: relative;
    width: 400px;
    height: 300px;
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: float 6s ease-in-out infinite;
    box-shadow: var(--shadow-md);
}

.shape-balloon {
    width: 80px;
    height: 80px;
    background: var(--kids-pink);
    color: white;
    font-size: 2rem;
    top: 20%;
    left: 20%;
    animation-delay: 0s;
}

.shape-cloud {
    width: 100px;
    height: 60px;
    border-radius: 30px;
    background: white;
    color: var(--kids-sky);
    font-size: 2.2rem;
    top: 50%;
    right: 15%;
    animation-delay: 1.5s;
}

.shape-star-1 {
    font-size: 2.5rem;
    color: var(--kids-sun);
    top: 10%;
    right: 30%;
    animation-delay: 3s;
}

.shape-star-2 {
    font-size: 1.8rem;
    color: var(--kids-lavender);
    bottom: 10%;
    left: 40%;
    animation-delay: 4.5s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(5deg); }
}

.hero-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    line-height: 0;
    z-index: 1;
}

.hero-wave svg {
    width: 100%;
    height: 50px;
}

/* Category Index Page Layout */
.homepage-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2.5rem;
}

.homepage-main {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    min-width: 0;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

/* Playful Cards */
.article-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.article-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: var(--shadow-lg);
    border-color: var(--kids-lavender);
}

.card-img-placeholder,
.card-img-wrapper {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    width: 100%;
}

.card-img-placeholder img,
.card-img-wrapper img,
.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: var(--transition);
}

.article-card:hover .card-img-placeholder img,
.article-card:hover .card-img-wrapper img,
.article-card:hover .card-img {
    transform: scale(1.08);
}


.card-badge {
    position: relative;
    display: inline-block;
    align-self: flex-start;
    background: white;
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.4rem 1rem;
    border-radius: 50px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    z-index: 2;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.card-badge.badge-igrice { background: var(--kids-lavender); color: white; }
.card-badge.badge-bojanke { background: var(--kids-pink); color: white; }
.card-badge.badge-radni-listovi { background: var(--kids-mint); color: white; }
.card-badge.badge-testovi { background: var(--kids-sun); color: white; }
.card-badge.badge-magazin { background: var(--kids-sky); color: white; }

.card-body,
.card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.card-title a {
    color: var(--text-primary);
}

.card-title a:hover {
    color: var(--kids-lavender);
}

.card-excerpt,
.card-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}


.card-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.card-footer i {
    margin-right: 0.25rem;
}

/* Sidebar Widgets */
.homepage-sidebar, .article-sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sidebar-widget {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
}

.widget-title {
    font-size: 1.35rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.75rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.widget-title i {
    color: var(--kids-lavender);
}

.info-widget-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-widget-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.info-widget-item:hover {
    transform: translateX(5px);
    border-color: var(--kids-sky);
}

.info-widget-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(78, 168, 222, 0.1);
    color: var(--kids-sky);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.info-widget-text {
    display: flex;
    flex-direction: column;
}

.info-widget-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.info-widget-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.recent-posts {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.recent-post-item {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.recent-post-img {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
}

.recent-post-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recent-post-text {
    display: flex;
    flex-direction: column;
}

.recent-post-title {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.25rem;
}

.recent-post-title a {
    color: var(--text-primary);
}

.recent-post-title a:hover {
    color: var(--kids-lavender);
}

.recent-post-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Fact Rotator Sidebar widget */
.fact-widget {
    background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
    border-color: #FDE68A;
}

.fact-text {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    color: #92400E;
    line-height: 1.5;
    margin-bottom: 1.25rem;
}

.widget-btn {
    width: 100%;
    background: #92400E;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0.75rem;
    font-family: var(--font-heading);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.widget-btn:hover {
    background: #78350F;
    transform: translateY(-2px);
}

.srecica-promo-widget {
    background: linear-gradient(135deg, #ECFDF5 0%, #D1FAE5 100%);
    border-color: #A7F3D0;
}

.jobs-promo-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.jobs-promo-text {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #065F46;
    margin-bottom: 1.25rem;
}

.jobs-promo-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: 12px;
    color: white;
    font-family: var(--font-heading);
    font-weight: 600;
    text-align: center;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
}

.jobs-promo-btn:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(16, 185, 129, 0.3);
}

/* Footer & Support Partners */
.support-partners-section {
    background: #FAF8F5;
    border-top: 1px solid var(--border-color);
    padding: 2.5rem 0;
    text-align: center;
}

.support-partners-title {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

.support-partners-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.75rem 1.25rem;
}

.support-link {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.support-link:hover {
    color: var(--kids-lavender);
}

.support-separator {
    color: var(--text-muted);
}

.site-footer {
    background: #2D2730;
    color: #ECE9EE;
    padding: 5rem 0 3rem 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 3.5rem;
}

.footer-brand h2 {
    color: white;
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
}

.footer-brand h2 span {
    color: var(--kids-peach);
}

.footer-brand p {
    color: #B4AEB9;
    font-size: 0.95rem;
    line-height: 1.6;
}

.footer-title {
    color: white;
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
}

.footer-links-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-links-list a {
    color: #B4AEB9;
    font-weight: 500;
    transition: var(--transition);
}

.footer-links-list a:hover {
    color: var(--kids-sky);
    padding-left: 5px;
}

.footer-bottom {
    border-top: 1px solid #433D46;
    padding-top: 2rem;
    text-align: center;
    font-size: 0.9rem;
    color: #8E8794;
}

/* Individual Article / Page styles */
.article-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2.5rem;
}

.article-main {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: var(--shadow-sm);
    min-width: 0;
}

.article-header {
    margin-bottom: 2rem;
}

.article-category {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--kids-lavender);
    display: inline-block;
    margin-bottom: 0.5rem;
}

.article-title-large {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 1rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.article-meta-large {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
    margin-top: 1.5rem;
}

.article-meta-large strong {
    color: var(--text-secondary);
}

.article-meta-large i {
    color: var(--kids-lavender);
    margin-right: 0.25rem;
}

.article-cover-img-wrapper {
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 2.5rem;
    aspect-ratio: 16/9;
}

.article-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.summary-box {
    background: #FAF8F5;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 1.5rem 1.75rem;
    margin-bottom: 2.5rem;
}

.summary-box h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.summary-box h3 i {
    color: var(--kids-sun);
}

.article-content .summary-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.summary-box li {
    position: relative;
    padding-left: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.summary-box li::before {
    content: "✦";
    position: absolute;
    left: 0;
    color: var(--kids-peach);
}

.article-content {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #3C3640;
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content h2 {
    font-size: 1.75rem;
    margin: 2.5rem 0 1.25rem 0;
}

.article-content h3 {
    font-size: 1.35rem;
    margin: 2rem 0 1rem 0;
}

.article-content ul, .article-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

/* Callout blocks */
.article-content blockquote {
    background: #FAF5FF;
    border-left: 4px solid var(--kids-lavender);
    border-radius: 4px 12px 12px 4px;
    padding: 1.25rem 1.5rem;
    margin: 2rem 0;
}

.article-content blockquote p {
    margin: 0;
    font-size: 1.05rem;
    font-style: italic;
    color: #58505D;
}

/* TOC (Table of Contents) */
.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toc-item {
    font-size: 0.95rem;
}

.toc-link {
    color: var(--text-secondary);
    font-weight: 500;
    display: block;
    padding: 0.25rem 0;
}

.toc-link:hover {
    color: var(--kids-lavender);
    padding-left: 4px;
}

/* FAQ Block Accordion */
.faq-section-title {
    font-size: 1.8rem;
    margin: 3.5rem 0 1.5rem 0;
}

.faq-accordion {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-card {
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    background: var(--bg-card);
}

.faq-question-btn {
    width: 100%;
    padding: 1.25rem 1.5rem;
    background: none;
    border: none;
    text-align: left;
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.faq-question-btn i {
    transition: var(--transition);
    color: var(--kids-lavender);
}

.faq-question-btn.active i {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease-out;
}

.faq-answer-inner {
    padding: 0 1.5rem 1.5rem 1.5rem;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
}

/* Interactive Canvas / Game Layout Styles */
.game-container {
    width: 100%;
    background: #FFFDF9;
    border: 2px dashed #E5DEC9;
    border-radius: 20px;
    padding: 1.5rem;
    margin: 2rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.game-title {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    color: var(--kids-lavender);
    margin-bottom: 0.5rem;
}

.game-instructions {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    text-align: center;
    max-width: 500px;
}

.game-screen {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

/* Maze Game Styles */
#maze-canvas {
    display: block;
    max-width: 100%;
    cursor: default;
    background: #FAF9F6;
}

.maze-controls {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    width: 100%;
    justify-content: center;
    align-items: center;
}

.mobile-controls {
    display: none;
    grid-template-areas: 
        ". up ."
        "left . right"
        ". down .";
    gap: 8px;
    margin-top: 1rem;
}

.ctrl-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #EFEBE4;
    border: 2px solid #D5DEC9;
    font-size: 1.25rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: manipulation;
}

.ctrl-btn:active {
    background: var(--kids-lavender);
    color: white;
}

.btn-up { grid-area: up; }
.btn-down { grid-area: down; }
.btn-left { grid-area: left; }
.btn-right { grid-area: right; }

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(45, 39, 48, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    text-align: center;
    padding: 20px;
}

.game-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.overlay-title {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    color: var(--kids-yellow);
    margin-bottom: 1rem;
}

.overlay-text {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    max-width: 320px;
}

/* Card Memory Match Game Styles */
.memory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    width: 480px;
    max-width: 100%;
    aspect-ratio: 1;
}

.memory-card {
    aspect-ratio: 1;
    perspective: 1000px;
    cursor: pointer;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
}

.memory-card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border-color);
}

.card-back {
    background: linear-gradient(135deg, var(--kids-lavender), var(--kids-sky));
    color: white;
    font-size: 2rem;
}

.card-front {
    background: white;
    transform: rotateY(180deg);
    font-size: 2.5rem;
}

.memory-card.matched .card-front {
    border-color: var(--kids-mint);
    background: #ECFDF5;
}

/* Coloring Book Canvas Board Styles */
.color-picker-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 1rem;
    justify-content: center;
}

.color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 2px #EFEBE4;
    cursor: pointer;
    transition: var(--transition);
}

.color-swatch.active {
    transform: scale(1.2);
    box-shadow: 0 0 0 2px var(--kids-lavender);
}

.canvas-toolbar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.tool-btn {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-family: var(--font-heading);
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.tool-btn:hover {
    background: #FAF8F5;
    border-color: var(--kids-lavender);
}

.tool-btn.active {
    background: var(--kids-lavender);
    color: white;
    border-color: var(--kids-lavender);
}

/* Xylophone Styles */
.xylo-instrument {
    display: flex;
    gap: 6px;
    background: #FAF8F5;
    border: 4px solid #EFEBE4;
    border-radius: 12px;
    padding: 1.5rem;
    height: 250px;
    width: 480px;
    max-width: 100%;
    justify-content: space-between;
}

.xylo-bar {
    width: 10%;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.15), 0 4px 6px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding-bottom: 1rem;
    font-family: var(--font-heading);
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.25rem;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.xylo-bar:active {
    transform: translateY(4px);
    box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.15), 0 2px 3px rgba(0, 0, 0, 0.05);
}

/* Quiz UI Styles */
.quiz-box {
    width: 100%;
    max-width: 550px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.2rem;
    box-shadow: var(--shadow-md);
}

.quiz-progress-bar {
    width: 100%;
    height: 8px;
    background: #FAF8F5;
    border-radius: 4px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.quiz-progress-fill {
    height: 100%;
    background: var(--kids-lavender);
    width: 0%;
    transition: width 0.3s ease;
}

.quiz-screen {
    display: none;
}

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

.quiz-question {
    font-size: 1.45rem;
    line-height: 1.35;
    margin-bottom: 1.5rem;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.quiz-option {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    text-align: left;
    font-family: var(--font-body);
    font-weight: 600;
    cursor: pointer;
    font-size: 1.05rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.quiz-option:hover {
    border-color: var(--kids-lavender);
    background: rgba(139, 92, 246, 0.02);
}

.quiz-option-marker {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: transparent;
    flex-shrink: 0;
}

.quiz-option:hover .quiz-option-marker {
    border-color: var(--kids-lavender);
}

.quiz-option.selected {
    border-color: var(--kids-lavender);
    background: rgba(139, 92, 246, 0.05);
}

.quiz-option.selected .quiz-option-marker {
    background: var(--kids-lavender);
    border-color: var(--kids-lavender);
    color: white;
}

.quiz-badge-result {
    text-align: center;
    padding: 1.5rem;
    border-radius: 16px;
    background: #FAF8F5;
    margin: 1.5rem 0;
}

.quiz-badge-emoji {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.quiz-badge-name {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    color: var(--kids-peach);
    margin-bottom: 0.5rem;
}

.quiz-badge-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* Coloring pages outlines / SVG frames */
.coloring-templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.coloring-template-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    padding: 1rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.coloring-template-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--kids-pink);
}

.coloring-preview-box {
    aspect-ratio: 4/3;
    border-radius: 8px;
    overflow: hidden;
    background: #FAF9F6;
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.coloring-preview-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.coloring-template-card h4 {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
}

/* Grid Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    padding: 0.6rem 1.25rem;
    border-radius: 30px;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover, .filter-btn.active {
    background: var(--kids-lavender);
    color: white;
    border-color: var(--kids-lavender);
}

/* Direct downloads styling */
.download-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 2rem;
}

.download-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: var(--transition);
}

.download-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--kids-mint);
}

.download-card-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    background: rgba(32, 201, 151, 0.1);
    color: var(--kids-mint);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.download-card h3 {
    font-size: 1.35rem;
    margin-bottom: 0.75rem;
}

.download-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.download-card .btn {
    width: 100%;
    justify-content: center;
    margin-top: auto;
}

/* Responsive styles */
@media (max-width: 991px) {
    .homepage-layout, .article-layout {
        grid-template-columns: 1fr;
    }
    
    .homepage-sidebar, .article-sidebar {
        margin-top: 2rem;
    }
    
    .hero-container {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-content {
        max-width: 100%;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .hero-graphics {
        display: none;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .site-header {
        padding: 0.75rem 0 0 0;
    }
    
    .header-inner {
        gap: 0.4rem;
    }

    .site-logo {
        font-size: 2rem;
    }
    
    .site-tagline {
        font-size: 0.9rem;
        line-height: 1.35;
        max-width: 90%;
    }
    
    .nav-bar {
        margin-top: 0.75rem;
    }
    
    .nav-bar-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .nav-toggle {
        display: block;
        width: 100%;
        text-align: center;
        background: #FFFDF9;
        padding: 0.8rem;
        border: none;
        border-bottom: 1px solid var(--border-color);
        box-sizing: border-box;
    }
    
    .site-nav {
        display: none;
        flex-direction: column;
        width: 100%;
        border-top: none;
    }
    
    .site-nav.active {
        display: flex;
    }
    
    .nav-link {
        width: 100%;
        padding: 1rem 1.5rem;
        border-bottom: none;
        border-left: 3px solid transparent;
    }
    
    .nav-link:hover, .nav-link.active {
        border-left-color: var(--kids-lavender);
        border-bottom-color: transparent;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .article-title-large {
        font-size: 1.8rem;
    }
}

@media (max-width: 400px) {
    .site-logo {
        font-size: 1.7rem;
    }
    
    .site-tagline {
        font-size: 0.9rem;
    }
}

/* Responsive Table and Media Containment Fixes */
table {
    display: block;
    width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
    -webkit-overflow-scrolling: touch;
}

th, td {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    text-align: left;
    min-width: 120px;
}

th {
    background-color: rgba(139, 92, 246, 0.05);
    font-family: var(--font-heading);
    font-weight: 600;
}

.article-body {
    overflow-x: hidden;
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

.game-screen canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

@media (max-width: 576px) {
    .articles-grid {
        grid-template-columns: 1fr;
    }
    
    .article-main {
        padding: 1.25rem;
    }
    
    .game-container {
        padding: 1rem;
    }
    
    .xylo-instrument {
        height: 180px;
        padding: 1rem;
    }
    
    .canvas-toolbar {
        gap: 0.5rem;
        justify-content: center;
    }
}

/* Custom Alert Blocks / Blockquotes inside Articles */
.alert-block {
    background: #FAF8FC;
    border-left: 6px solid var(--kids-lavender);
    border-radius: 16px;
    padding: 1.5rem 1.75rem;
    margin: 2rem 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.01);
}

.alert-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    color: var(--text-primary);
}

.alert-block p {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.alert-block p:last-child {
    margin-bottom: 0;
}

.alert-block-note {
    border-left-color: #20C997; /* Mint */
    background: rgba(32, 201, 151, 0.04);
}

.alert-block-important,
.alert-block-warning,
.alert-block-caution {
    border-left-color: #FF5D8F; /* Pink */
    background: rgba(255, 93, 143, 0.04);
}

.alert-block-tip {
    border-left-color: #FFB703; /* Sun */
    background: rgba(255, 183, 3, 0.04);
}

/* --- INTERACTIVE GAMES STYLING --- */

/* Magic Piano Keyboard Layout */
.piano-keyboard {
    position: relative;
    width: 480px;
    max-width: 100%;
    height: 200px;
    background: #FAF9F6;
    border: 4px solid #E5DEC9;
    border-radius: 16px;
    display: flex;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    user-select: none;
    margin: 1.5rem auto;
}

.piano-white-key {
    flex: 1;
    height: 100%;
    background: #FFFFFF;
    border-right: 1px solid #E5DEC9;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 0.75rem;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-family: var(--font-heading);
    border-radius: 0 0 6px 6px;
    transition: background 0.1s;
}

.piano-white-key:last-child {
    border-right: none;
}

.piano-white-key:active, .piano-white-key.active {
    background: #F1EFF7;
}

.piano-black-key {
    position: absolute;
    width: 6.8%;
    height: 58%;
    background: #2D2730;
    cursor: pointer;
    z-index: 10;
    border-radius: 0 0 4px 4px;
    transition: background 0.1s;
    box-shadow: 0 3px 5px rgba(0,0,0,0.35);
}

.piano-black-key:active, .piano-black-key.active {
    background: #110F12;
}

/* Match Pairs Interaction */
.match-card {
    box-shadow: var(--shadow-sm);
}

.match-card.selected {
    border-color: var(--kids-lavender) !important;
    background: rgba(139, 92, 246, 0.08) !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.match-card.matched {
    border-color: #20C997 !important;
    background: rgba(32, 201, 151, 0.08) !important;
    color: #0E7490 !important;
    cursor: default !important;
    pointer-events: none !important;
}

.match-card.wrong {
    border-color: #FF5D8F !important;
    background: rgba(255, 93, 143, 0.08) !important;
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* Jigsaw Puzzle Styles */
.puzzle-piece {
    border: 1px solid rgba(255, 255, 255, 0.4);
    cursor: pointer;
    background-size: 300px 300px;
    transition: transform 0.15s, opacity 0.15s;
    background-repeat: no-repeat;
}

.puzzle-piece.selected {
    box-shadow: inset 0 0 0 4px var(--kids-pink);
    transform: scale(0.96);
    opacity: 0.85;
}

/* Balloon Pop Styles */
.balloon {
    position: absolute;
    width: 54px;
    height: 70px;
    border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
    cursor: pointer;
    transition: transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset -5px -5px 10px rgba(0,0,0,0.1), 3px 5px 8px rgba(0,0,0,0.15);
}

.balloon::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    width: 2px;
    height: 10px;
    background: rgba(0,0,0,0.2);
}

.balloon-knot {
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 5px solid currentColor;
}

/* Global Victory Overlay */
.game-victory-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    border-radius: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.game-victory-overlay.active {
    display: flex;
    opacity: 1;
}

.victory-card {
    text-align: center;
    background: white;
    border: 3px dashed #E5DEC9;
    border-radius: 24px;
    padding: 2.2rem;
    max-width: 90%;
    width: 320px;
    box-shadow: var(--shadow-lg);
    animation: popBounce 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.victory-icon {
    font-size: 3.5rem;
    display: block;
    margin-bottom: 0.75rem;
    animation: pulseIcon 1.5s infinite;
}

@keyframes popBounce {
    0% { transform: scale(0.7); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes pulseIcon {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}
