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

body {
    font-family: 'Comic Neue', 'Fredoka', sans-serif;
    background: #f0f9ff;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Animated Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(255, 107, 107, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(78, 205, 196, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 193, 7, 0.1) 0%, transparent 50%);
    animation: backgroundFloat 15s ease-in-out infinite;
    z-index: -1;
}

@keyframes backgroundFloat {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(2deg); }
}

/* Main Container */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 10;
}

/* Header - Playful Style */
.header {
    text-align: center;
    margin-bottom: 40px;
    background: linear-gradient(135deg, #ff6b6b 0%, #4ecdc4 50%, #45b7d1 100%);
    border-radius: 30px;
    padding: 40px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    transform: rotate(-1deg);
    transition: transform 0.3s ease;
}

.header:hover {
    transform: rotate(0deg) scale(1.02);
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.logo-section {
    position: relative;
    z-index: 2;
}

.logo-icon {
    font-size: 4em;
    color: white;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.2);
    animation: bounce 2s ease-in-out infinite;
    display: inline-block;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-10px) rotate(-5deg); }
    75% { transform: translateY(-5px) rotate(5deg); }
}

.main-title {
    font-size: 3em;
    font-weight: 700;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
    letter-spacing: 1px;
    animation: wobble 3s ease-in-out infinite;
}

@keyframes wobble {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(1deg); }
    75% { transform: rotate(-1deg); }
}

.subtitle {
    font-size: 1.4em;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px 20px;
    border-radius: 20px;
    display: inline-block;
}

.header-decoration {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.header-decoration i {
    font-size: 2em;
    color: rgba(255, 255, 255, 0.8);
    animation: wiggle 2s ease-in-out infinite;
}

.header-decoration i:nth-child(2) { animation-delay: 0.5s; }
.header-decoration i:nth-child(3) { animation-delay: 1s; }

@keyframes wiggle {
    0%, 100% { transform: rotate(-10deg); }
    50% { transform: rotate(10deg); }
}

/* Section Title - Fun Style */
.section-title {
    text-align: center;
    font-size: 2.5em;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    background: linear-gradient(135deg, #ff6b6b, #4ecdc4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.section-title i {
    font-size: 0.8em;
    -webkit-text-fill-color: #ff6b6b;
    animation: spin 4s ease-in-out infinite;
}

@keyframes spin {
    0%, 100% { transform: rotate(-10deg); }
    50% { transform: rotate(10deg); }
}

/* Games Section - Playful Grid */
.games-section {
    margin-bottom: 60px;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

/* Game Cards - Box Style for Kids */
.game-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    transform: rotate(1deg);
    border: 3px solid transparent;
}

.game-card:nth-child(even) {
    transform: rotate(-1deg);
}

.game-card:hover {
    transform: rotate(0deg) translateY(-8px) scale(1.03);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.game-card:nth-child(1) { border-color: #ff6b6b; }
.game-card:nth-child(2) { border-color: #4ecdc4; }
.game-card:nth-child(3) { border-color: #45b7d1; }
.game-card:nth-child(4) { border-color: #96ceb4; }
.game-card:nth-child(5) { border-color: #feca57; }
.game-card:nth-child(6) { border-color: #a29bfe; }

/* Card Header - Colorful Blocks */
.card-header {
    padding: 25px;
    text-align: center;
    position: relative;
    color: white;
}

.snap-card .card-header { background: linear-gradient(135deg, #ff6b6b, #ee5a6f); }
.writing-card .card-header { background: linear-gradient(135deg, #4ecdc4, #44a3a0); }
.memory-card .card-header { background: linear-gradient(135deg, #45b7d1, #3498db); }
.quickclick-card .card-header { background: linear-gradient(135deg, #96ceb4, #88b0a3); }
.wordbuilder-card .card-header { background: linear-gradient(135deg, #feca57, #f39c12); }
.picturequiz-card .card-header { background: linear-gradient(135deg, #a29bfe, #6c5ce7); }

.game-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 1.8em;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.game-card:hover .game-icon {
    transform: scale(1.1) rotate(10deg);
}

.game-title {
    font-size: 1.6em;
    font-weight: 700;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    margin-bottom: 10px;
}

.game-difficulty {
    display: flex;
    justify-content: center;
    gap: 3px;
}

.game-difficulty i {
    color: #feca57;
    font-size: 1em;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

/* Card Image - Playful Frame */
.card-image {
    position: relative;
    height: 180px;
    overflow: hidden;
    background: linear-gradient(45deg, #f0f0f0, #e0e0e0);
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.game-card:hover .card-image img {
    transform: scale(1.05);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.game-card:hover .image-overlay {
    opacity: 1;
}

.image-overlay i {
    font-size: 2.5em;
    color: white;
    transform: scale(0);
    transition: transform 0.3s ease;
}

.game-card:hover .image-overlay i {
    transform: scale(1);
}

/* Card Content - Friendly Layout */
.card-content {
    padding: 25px;
}

.game-description {
    font-size: 1em;
    color: #555;
    line-height: 1.5;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 500;
}

.game-features {
    display: flex;
    justify-content: space-around;
    gap: 15px;
    flex-wrap: wrap;
}

.feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 12px;
    background: rgba(240, 240, 240, 0.6);
    border-radius: 15px;
    min-width: 80px;
    transition: all 0.3s ease;
}

.feature:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.feature i {
    font-size: 1.3em;
}

.snap-card .feature i { color: #ff6b6b; }
.writing-card .feature i { color: #4ecdc4; }
.memory-card .feature i { color: #45b7d1; }
.quickclick-card .feature i { color: #96ceb4; }
.wordbuilder-card .feature i { color: #feca57; }
.picturequiz-card .feature i { color: #a29bfe; }

.feature span {
    font-size: 0.85em;
    font-weight: 600;
    color: #333;
    text-align: center;
}

/* Card Footer - Play Button */
.card-footer {
    padding: 20px;
    text-align: center;
    background: rgba(240, 240, 240, 0.3);
}

.play-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    font-size: 1.1em;
    font-weight: 700;
    text-decoration: none;
    border-radius: 25px;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.play-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.play-btn:hover::before {
    left: 100%;
}

.snap-btn { background: linear-gradient(45deg, #ff6b6b, #ee5a6f); }
.writing-btn { background: linear-gradient(45deg, #4ecdc4, #44a3a0); }
.memory-btn { background: linear-gradient(45deg, #45b7d1, #3498db); }
.quickclick-btn { background: linear-gradient(45deg, #96ceb4, #88b0a3); }
.wordbuilder-btn { background: linear-gradient(45deg, #feca57, #f39c12); }
.picturequiz-btn { background: linear-gradient(45deg, #a29bfe, #6c5ce7); }

.play-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.3);
}

/* Instructions Section - Friendly Style */
.instructions-section {
    margin-bottom: 50px;
}

.instructions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.instruction-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    transform: rotate(0.5deg);
    border: 2px solid transparent;
}

.instruction-card:nth-child(even) {
    transform: rotate(-0.5deg);
}

.instruction-card:nth-child(1) { border-color: #ff6b6b; }
.instruction-card:nth-child(2) { border-color: #4ecdc4; }
.instruction-card:nth-child(3) { border-color: #45b7d1; }
.instruction-card:nth-child(4) { border-color: #feca57; }

.instruction-card:hover {
    transform: rotate(0deg) translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.instruction-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 1.5em;
    color: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.instruction-card:nth-child(1) .instruction-icon { background: linear-gradient(135deg, #ff6b6b, #ee5a6f); }
.instruction-card:nth-child(2) .instruction-icon { background: linear-gradient(135deg, #4ecdc4, #44a3a0); }
.instruction-card:nth-child(3) .instruction-icon { background: linear-gradient(135deg, #45b7d1, #3498db); }
.instruction-card:nth-child(4) .instruction-icon { background: linear-gradient(135deg, #feca57, #f39c12); }

.instruction-card h3 {
    font-size: 1.2em;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
}

.instruction-card p {
    color: #666;
    line-height: 1.4;
    font-size: 0.95em;
}

/* Footer - Friendly Style */
.footer {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    border: 2px solid #f0f0f0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-info p {
    color: #666;
    font-weight: 600;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-info i {
    color: #ff6b6b;
}

.footer-links {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.footer-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.footer-link:nth-child(1) { background: linear-gradient(45deg, #ff6b6b, #ee5a6f); }
.footer-link:nth-child(2) { background: linear-gradient(45deg, #4ecdc4, #44a3a0); }
.footer-link:nth-child(3) { background: linear-gradient(45deg, #45b7d1, #3498db); }
.footer-link:nth-child(4) { background: linear-gradient(45deg, #96ceb4, #88b0a3); }
.footer-link:nth-child(5) { background: linear-gradient(45deg, #feca57, #f39c12); }
.footer-link:nth-child(6) { background: linear-gradient(45deg, #a29bfe, #6c5ce7); }

.footer-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* Creator Credit */
.creator-credit {
    text-align: center;
    padding: 15px 0 0 0;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    margin-top: 15px;
}

.made-by {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
    font-weight: 500;
}

.creator-name {
    color: #ff6b6b;
    font-weight: 700;
    transition: all 0.3s ease;
}

.creator-name:hover {
    color: #4ecdc4;
}

.visit-site {
    font-size: 0.8em;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.visit-site:hover {
    color: #ff6b6b;
}

.creator-link {
    color: #4ecdc4;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
}

.creator-link:hover {
    color: #ff6b6b;
    border-bottom-color: #ff6b6b;
}

.visit-site i {
    color: #feca57;
    font-size: 0.9em;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-container {
        padding: 15px;
    }

    .games-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .main-title {
        font-size: 2.5em;
    }

    .section-title {
        font-size: 2em;
    }
}

@media (max-width: 768px) {
    .main-container {
        padding: 10px;
    }

    .header {
        padding: 30px 20px;
        transform: rotate(0deg);
    }

    .main-title {
        font-size: 2em;
    }

    .logo-icon {
        font-size: 3em;
    }

    .section-title {
        font-size: 1.8em;
        flex-direction: column;
        gap: 10px;
    }

    .games-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .game-card {
        transform: rotate(0deg);
    }

    .game-card:nth-child(even) {
        transform: rotate(0deg);
    }

    .card-header {
        padding: 20px;
    }

    .game-title {
        font-size: 1.4em;
    }

    .game-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5em;
    }

    .card-content {
        padding: 20px;
    }

    .card-footer {
        padding: 20px;
    }

    .play-btn {
        padding: 12px 25px;
        font-size: 1em;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .footer-links {
        flex-direction: column;
        width: 100%;
    }

    .footer-link {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .main-container {
        padding: 5px;
    }

    .header {
        padding: 25px 15px;
    }

    .main-title {
        font-size: 1.7em;
    }

    .subtitle {
        font-size: 1.1em;
    }

    .section-title {
        font-size: 1.5em;
    }

    .game-description {
        font-size: 0.9em;
    }

    .game-features {
        flex-direction: column;
        gap: 10px;
    }

    .feature {
        min-width: auto;
        width: 100%;
    }

    .play-btn {
        padding: 10px 20px;
        font-size: 0.95em;
    }

    .instructions-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .instruction-card {
        padding: 25px 20px;
    }

    .footer {
        padding: 25px 20px;
    }
}

/* Loading Animation */
.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

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

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection Color */
::selection {
    background: rgba(255, 107, 107, 0.3);
    color: #333;
}

/* Focus Styles for Accessibility */
.play-btn:focus,
.footer-link:focus {
    outline: 3px solid #feca57;
    outline-offset: 2px;
}