/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
    min-height: 100vh;
    padding: 20px;
}



.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Instructions section */
.instructions {
    text-align: center;
    margin-bottom: 15px;
    padding: 15px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Top Ads Header Bar - Compact & ready for approval */
.ads-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 25px !important;
    max-height: 25px !important;
    min-height: 25px !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 3px 25px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2), 
                0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    position: relative;
    overflow: hidden !important;
}

.ads-header-bar::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, rgba(102, 126, 234, 0.3) 50%, transparent 100%);
    border-radius: 1px;
}

.ads-spacer {
    flex: 1;
    min-width: 120px;
}

/* Header ad sections */
.header-ad-left,
.header-ad-right {
    flex: 0 0 auto;
}

/* Title Header Bar */
.title-header-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 10px 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2), 
                0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    position: relative;
}

.title-header-bar::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, rgba(102, 126, 234, 0.3) 50%, transparent 100%);
    border-radius: 1px;
}

/* Center Title Section */
.header-title-center {
    text-align: center;
}

.header-title-center h1 {
    color: white;
    font-size: 1.2rem;
    margin: 0;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Banner ad spaces - Compact & ready for approval */
.banner-ad-space {
    width: 204px; /* Optimized for 200px ads + 2px padding */
    height: 20px !important;   /* Compact size for banner ads */
    max-height: 20px !important;
    min-height: 20px !important;
    border-radius: 8px;
    overflow: hidden !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), 
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.95);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Temporarily disable nuclear constraints for debugging */
/*.banner-ad-space *,
.banner-ad-space div,
.banner-ad-space ins,
.banner-ad-space iframe,
.ads-header-bar *,
.ads-header-bar div {
    max-height: 3px !important;
    height: 3px !important;
    min-height: 3px !important;
    overflow: hidden !important;
    line-height: 3px !important;
}*/

/* AdSense banner ad units - Ready for approval */
.banner-ad-unit {
    width: 200px !important;
    height: 18px !important;
    max-height: 18px !important;
    min-height: 18px !important;
    border-radius: 7px;
    overflow: hidden !important;
    background: transparent;
    margin: 1px auto;
    display: block !important;
}

/* Nuclear force AdSense to respect paper-thin constraints */
.banner-ad-unit *,
.banner-ad-unit ins,
.banner-ad-unit iframe,
.banner-ad-unit div,
.adsbygoogle {
    width: 200px !important;
    height: 3px !important;
    max-height: 3px !important;
    min-height: 3px !important;
    overflow: hidden !important;
    line-height: 3px !important;
}

/* Fallback placeholder styling */
.fallback-ad {
    display: none; /* Hide by default, show if AdSense fails */
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

/* Show fallback if AdSense is not loaded */
.banner-ad-space:not(.ads-loaded) .fallback-ad {
    display: flex;
}

.banner-ad-space.ads-loaded .fallback-ad {
    display: none;
}

.banner-ad-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 1px solid #2196f3;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 15px;
    box-sizing: border-box;
    position: relative;
}

.banner-ad-placeholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.1) 100%);
    border-radius: 6px;
    pointer-events: none;
}

.banner-ad-label {
    font-size: 0.7rem;
    color: #1565c0;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.95);
    padding: 3px 7px;
    border-radius: 5px;
    border: 1px solid rgba(21, 101, 192, 0.2);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

.banner-ad-content {
    font-size: 0.75rem;
    color: #0d47a1;
    font-weight: 600;
    text-align: center;
    flex: 1;
    margin-left: 8px;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    position: relative;
    z-index: 1;
}

/* Main controls section */
.main-controls {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    padding: 25px;
}



/* Responsive design for separate header bars */
@media (max-width: 768px) {
    .ads-header-bar {
        height: 10px;
        padding: 2px 18px;
        margin-bottom: 15px;
    }
    
    .ads-header-bar::after {
        width: 50%;
        height: 1.5px;
        bottom: -6px;
    }
    
    .title-header-bar {
        height: 50px;
        padding: 8px 18px;
        margin-bottom: 15px;
    }
    
    .title-header-bar::after {
        width: 50%;
        height: 1.5px;
        bottom: -8px;
    }
    
    .header-title-center h1 {
        font-size: 1rem;
    }
    
    .banner-ad-space {
        width: 154px; /* Optimized for smaller banner ads */
        height: 6px;
    }
    
    .banner-ad-unit {
        width: 150px !important;
        height: 5px !important;
        max-height: 5px !important;
    }
    
    .banner-ad-unit ins,
    .banner-ad-unit iframe {
        width: 150px !important;
        height: 5px !important;
        max-height: 5px !important;
    }
    
    .banner-ad-placeholder {
        padding: 4px 8px;
    }
    
    .banner-ad-label {
        font-size: 0.6rem;
        padding: 2px 5px;
    }
    
    .banner-ad-content {
        font-size: 0.65rem;
    }
    
    .main-controls {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .ads-header-bar {
        height: 8px;
        padding: 1px 15px;
        margin-bottom: 12px;
    }
    
    .ads-header-bar::after {
        width: 40%;
        height: 1px;
        bottom: -5px;
    }
    
    .title-header-bar {
        height: 45px;
        padding: 6px 15px;
        margin-bottom: 20px;
    }
    
    .title-header-bar::after {
        width: 40%;
        height: 1px;
        bottom: -6px;
    }
    
    .header-title-center h1 {
        font-size: 0.9rem;
    }
    
    .banner-ad-space {
        width: 124px; /* Optimized for mobile banner ads */
        height: 5px;
    }
    
    .banner-ad-unit {
        width: 120px !important;
        height: 4px !important;
        max-height: 4px !important;
    }
    
    .banner-ad-unit ins,
    .banner-ad-unit iframe {
        width: 120px !important;
        height: 4px !important;
        max-height: 4px !important;
    }
    
    .banner-ad-placeholder {
        padding: 3px 6px;
    }
    
    .banner-ad-label {
        font-size: 0.55rem;
        padding: 1px 4px;
    }
    
    .banner-ad-content {
        font-size: 0.6rem;
        margin-left: 5px;
    }
    
    .main-controls {
        padding: 18px;
    }
}

@media (max-width: 380px) {
    .ads-header-bar {
        height: 6px;
        padding: 1px 12px;
        margin-bottom: 10px;
    }
    
    .ads-header-bar::after {
        width: 35%;
        height: 1px;
        bottom: -4px;
    }
    
    .title-header-bar {
        height: 40px;
        padding: 5px 12px;
        margin-bottom: 18px;
    }
    
    .title-header-bar::after {
        width: 35%;
        height: 1px;
        bottom: -5px;
    }
    
    .header-title-center h1 {
        font-size: 0.8rem;
    }
    
    .banner-ad-space {
        width: 104px; /* Optimized for small mobile banner ads */
        height: 4px;
    }
    
    .banner-ad-unit {
        width: 100px !important;
        height: 3px !important;
        max-height: 3px !important;
    }
    
    .banner-ad-unit ins,
    .banner-ad-unit iframe {
        width: 100px !important;
        height: 3px !important;
        max-height: 3px !important;
    }
    
    .banner-ad-placeholder {
        padding: 2px 5px;
    }
    
    .banner-ad-label {
        font-size: 0.5rem;
        padding: 1px 3px;
    }
    
    .banner-ad-content {
        font-size: 0.55rem;
        margin-left: 3px;
    }
    
    .main-controls {
        padding: 15px;
    }
}

.instructions h1 {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 50%, #ffb74d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    font-size: 1.8rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    font-weight: 700;
}

.instructions p {
    color: #2563eb;
    margin-bottom: 8px;
    font-size: 0.95rem;
    font-weight: 600;
}

.vocab-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 12px;
    margin: 6px auto 0 auto;
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    text-align: center;
    max-width: fit-content;
}

.refresh-btn {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    margin-top: 5px;
}

.refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.refresh-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(34, 197, 94, 0.3);
}

.age-selector {
    margin: 15px 0 10px 0;
    text-align: center;
}

.age-selector h3 {
    color: #2d3748;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.age-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
}

.age-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    min-width: 80px;
}

.age-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.age-btn.active {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    transform: translateY(-1px);
}

.age-btn.active:hover {
    background: linear-gradient(135deg, #3730a3 0%, #312e81 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(67, 56, 202, 0.5);
}

.age-btn small {
    display: block;
    font-size: 0.65rem;
    margin-top: 2px;
    opacity: 0.9;
}

/* Grid layout for alphabet */
.alphabet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
    justify-items: center;
}

/* Base letter card styles */
.letter-card {
    position: relative;
    width: 140px;
    height: 140px;
    border-radius: 25px;
    border: 4px solid #ffffff;
    box-shadow: 
        0 10px 0px rgba(0, 0, 0, 0.2),
        0 15px 30px rgba(0, 0, 0, 0.3),
        inset 0 2px 0px rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: visible;
    transform-style: preserve-3d;
    user-select: none;
    text-align: center;
}

.letter-card:hover {
    transform: translateY(-8px);
    box-shadow: 
        0 12px 0px rgba(0, 0, 0, 0.2),
        0 20px 40px rgba(0, 0, 0, 0.35),
        inset 0 2px 0px rgba(255, 255, 255, 0.3);
}

.letter-card:active {
    transform: translateY(-4px) scale(0.98);
    box-shadow: 
        0 8px 0px rgba(0, 0, 0, 0.2),
        0 12px 25px rgba(0, 0, 0, 0.3),
        inset 0 2px 0px rgba(255, 255, 255, 0.3);
}

.letter {
    font-size: 4.5rem;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 
        2px 2px 0px rgba(0, 0, 0, 0.3),
        0px 0px 0px rgba(0, 0, 0, 0.2),
        inset 0px 1px 0px rgba(255, 255, 255, 0.2);
    z-index: 2;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Arial Black', sans-serif;
    letter-spacing: -2px;
    width: auto;
    height: auto;
    text-align: center;
}

/* Decoration elements */
.decoration {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
}

/* Dynamic decorations - All aligned to top-left corner */
.decoration::before {
    content: var(--icon-content, '🎵');
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: top left;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
    font-size: 2.5rem;
    animation: var(--animation-name, bounce) 2s ease-in-out infinite;
}

.icon-element {
    position: absolute;
    top: 0;
    left: 0;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-origin: top left;
    animation: var(--animation-name, bounce) 2s ease-in-out infinite;
}

.icon-element svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
}

/* Dynamic animation assignment */
.decoration[data-animation="bounce"]::before { animation: bounce 2s ease-in-out infinite; }
.decoration[data-animation="fly"]::before { animation: fly 3s ease-in-out infinite; }
.decoration[data-animation="wiggle"]::before { animation: wiggle 2s ease-in-out infinite; }
.decoration[data-animation="sway"]::before { animation: sway 3s ease-in-out infinite; }
.decoration[data-animation="swim"]::before { animation: swim 2s ease-in-out infinite; }
.decoration[data-animation="nod"]::before { animation: nod 2s ease-in-out infinite; }
.decoration[data-animation="float"]::before { animation: float 3s ease-in-out infinite; }
.decoration[data-animation="hop"]::before { animation: hop 1.5s ease-in-out infinite; }
.decoration[data-animation="stealth"]::before { animation: stealth 2s ease-in-out infinite; }
.decoration[data-animation="hoot"]::before { animation: hoot 2s ease-in-out infinite; }
.decoration[data-animation="waddle"]::before { animation: waddle 2s ease-in-out infinite; }
.decoration[data-animation="royal"]::before { animation: royal 3s ease-in-out infinite; }
.decoration[data-animation="mechanical"]::before { animation: mechanical 2s ease-in-out infinite; }
.decoration[data-animation="slither"]::before { animation: slither 2s ease-in-out infinite; }
.decoration[data-animation="prowl"]::before { animation: prowl 2s ease-in-out infinite; }
.decoration[data-animation="musical"]::before { animation: musical 2s ease-in-out infinite; }
.decoration[data-animation="sail"]::before { animation: sail 3s ease-in-out infinite; }
.decoration[data-animation="gallop"]::before { animation: gallop 2s ease-in-out infinite; }
.decoration[data-animation="roar"]::before { animation: roar 3s ease-in-out infinite; }
.decoration[data-animation="drive"]::before { animation: drive 2s ease-in-out infinite; }

/* Individual letter colors and gradients - Exact match to original */
.letter-a {
    background: linear-gradient(135deg, #ff6b35 0%, #ff8c42 50%, #f7931e 100%);
    box-shadow: 
        0 10px 0px #d4611a,
        0 15px 30px rgba(0, 0, 0, 0.3),
        inset 0 2px 0px rgba(255, 255, 255, 0.3);
}

.letter-b {
    background: linear-gradient(135deg, #8b0000 0%, #a0001a 50%, #dc143c 100%);
    box-shadow: 
        0 10px 0px #6b0000,
        0 15px 30px rgba(0, 0, 0, 0.3),
        inset 0 2px 0px rgba(255, 255, 255, 0.3);
}

.letter-c {
    background: linear-gradient(135deg, #20b2aa 0%, #2dd4bf 50%, #48cae4 100%);
    box-shadow: 
        0 10px 0px #1a8b82,
        0 15px 30px rgba(0, 0, 0, 0.3),
        inset 0 2px 0px rgba(255, 255, 255, 0.3);
}

.letter-d {
    background: linear-gradient(135deg, #ff4500 0%, #ff6347 50%, #ff7f50 100%);
    box-shadow: 
        0 10px 0px #cc3600,
        0 15px 30px rgba(0, 0, 0, 0.3),
        inset 0 2px 0px rgba(255, 255, 255, 0.3);
}

.letter-e {
    background: linear-gradient(135deg, #800020 0%, #991b1b 50%, #b22222 100%);
    box-shadow: 
        0 10px 0px #600018,
        0 15px 30px rgba(0, 0, 0, 0.3),
        inset 0 2px 0px rgba(255, 255, 255, 0.3);
}

.letter-f {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
    box-shadow: 
        0 10px 0px #162d69,
        0 15px 30px rgba(0, 0, 0, 0.3),
        inset 0 2px 0px rgba(255, 255, 255, 0.3);
}

.letter-g {
    background: linear-gradient(135deg, #0d9488 0%, #14b8a6 50%, #20c997 100%);
    box-shadow: 
        0 10px 0px #0a7066,
        0 15px 30px rgba(0, 0, 0, 0.3),
        inset 0 2px 0px rgba(255, 255, 255, 0.3);
}

.letter-h {
    background: linear-gradient(135deg, #0891b2 0%, #06b6d4 50%, #22d3ee 100%);
    box-shadow: 
        0 10px 0px #067088,
        0 15px 30px rgba(0, 0, 0, 0.3),
        inset 0 2px 0px rgba(255, 255, 255, 0.3);
}

.letter-i {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 50%, #fcd34d 100%);
    box-shadow: 
        0 10px 0px #c47e08,
        0 15px 30px rgba(0, 0, 0, 0.3),
        inset 0 2px 0px rgba(255, 255, 255, 0.3);
}

.letter-j {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 50%, #fbbf24 100%);
    box-shadow: 
        0 10px 0px #ae5f05,
        0 15px 30px rgba(0, 0, 0, 0.3),
        inset 0 2px 0px rgba(255, 255, 255, 0.3);
}

.letter-k {
    background: linear-gradient(135deg, #b45309 0%, #d97706 50%, #f59e0b 100%);
    box-shadow: 
        0 10px 0px #904207,
        0 15px 30px rgba(0, 0, 0, 0.3),
        inset 0 2px 0px rgba(255, 255, 255, 0.3);
}

.letter-l {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 50%, #f87171 100%);
    box-shadow: 
        0 10px 0px #b01e1e,
        0 15px 30px rgba(0, 0, 0, 0.3),
        inset 0 2px 0px rgba(255, 255, 255, 0.3);
}

.letter-m {
    background: linear-gradient(135deg, #b91c1c 0%, #dc2626 50%, #ef4444 100%);
    box-shadow: 
        0 10px 0px #941616,
        0 15px 30px rgba(0, 0, 0, 0.3),
        inset 0 2px 0px rgba(255, 255, 255, 0.3);
}

.letter-n {
    background: linear-gradient(135deg, #ea580c 0%, #f97316 50%, #fb923c 100%);
    box-shadow: 
        0 10px 0px #bb460a,
        0 15px 30px rgba(0, 0, 0, 0.3),
        inset 0 2px 0px rgba(255, 255, 255, 0.3);
}

.letter-o {
    background: linear-gradient(135deg, #059669 0%, #10b981 50%, #34d399 100%);
    box-shadow: 
        0 10px 0px #047853,
        0 15px 30px rgba(0, 0, 0, 0.3),
        inset 0 2px 0px rgba(255, 255, 255, 0.3);
}

.letter-p {
    background: linear-gradient(135deg, #047857 0%, #059669 50%, #10b981 100%);
    box-shadow: 
        0 10px 0px #035d45,
        0 15px 30px rgba(0, 0, 0, 0.3),
        inset 0 2px 0px rgba(255, 255, 255, 0.3);
}

.letter-q {
    background: linear-gradient(135deg, #0f766e 0%, #14b8a6 50%, #5eead4 100%);
    box-shadow: 
        0 10px 0px #0c5e57,
        0 15px 30px rgba(0, 0, 0, 0.3),
        inset 0 2px 0px rgba(255, 255, 255, 0.3);
}

.letter-r {
    background: linear-gradient(135deg, #c2410c 0%, #ea580c 50%, #f97316 100%);
    box-shadow: 
        0 10px 0px #9b340a,
        0 15px 30px rgba(0, 0, 0, 0.3),
        inset 0 2px 0px rgba(255, 255, 255, 0.3);
}

.letter-s {
    background: linear-gradient(135deg, #991b1b 0%, #dc2626 50%, #ef4444 100%);
    box-shadow: 
        0 10px 0px #7a1515,
        0 15px 30px rgba(0, 0, 0, 0.3),
        inset 0 2px 0px rgba(255, 255, 255, 0.3);
}

.letter-t {
    background: linear-gradient(135deg, #b91c1c 0%, #ef4444 50%, #f87171 100%);
    box-shadow: 
        0 10px 0px #941616,
        0 15px 30px rgba(0, 0, 0, 0.3),
        inset 0 2px 0px rgba(255, 255, 255, 0.3);
}

.letter-u {
    background: linear-gradient(135deg, #065f46 0%, #047857 50%, #059669 100%);
    box-shadow: 
        0 10px 0px #054c37,
        0 15px 30px rgba(0, 0, 0, 0.3),
        inset 0 2px 0px rgba(255, 255, 255, 0.3);
}

.letter-v {
    background: linear-gradient(135deg, #c2410c 0%, #ea580c 50%, #f97316 100%);
    box-shadow: 
        0 10px 0px #9b340a,
        0 15px 30px rgba(0, 0, 0, 0.3),
        inset 0 2px 0px rgba(255, 255, 255, 0.3);
}

.letter-w {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 50%, #fbbf24 100%);
    box-shadow: 
        0 10px 0px #ae5f05,
        0 15px 30px rgba(0, 0, 0, 0.3),
        inset 0 2px 0px rgba(255, 255, 255, 0.3);
}

.letter-x {
    background: linear-gradient(135deg, #0e7490 0%, #0891b2 50%, #06b6d4 100%);
    box-shadow: 
        0 10px 0px #0b5d73,
        0 15px 30px rgba(0, 0, 0, 0.3),
        inset 0 2px 0px rgba(255, 255, 255, 0.3);
}

.letter-y {
    background: linear-gradient(135deg, #be123c 0%, #e11d48 50%, #f43f5e 100%);
    box-shadow: 
        0 10px 0px #980e30,
        0 15px 30px rgba(0, 0, 0, 0.3),
        inset 0 2px 0px rgba(255, 255, 255, 0.3);
}

.letter-z {
    background: linear-gradient(135deg, #c2410c 0%, #ea580c 50%, #f97316 100%);
    box-shadow: 
        0 10px 0px #9b340a,
        0 15px 30px rgba(0, 0, 0, 0.3),
        inset 0 2px 0px rgba(255, 255, 255, 0.3);
}

/* Animations */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

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

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

@keyframes hop {
    0%, 100% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(-5px) scale(1.1); }
}

@keyframes fly {
    0%, 100% { transform: translateX(0px) translateY(0px); }
    33% { transform: translateX(5px) translateY(-3px); }
    66% { transform: translateX(-3px) translateY(2px); }
}

@keyframes nod {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-3px); }
}

@keyframes waddle {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(5deg); }
}

@keyframes swim {
    0%, 100% { transform: translateX(0px) rotate(0deg); }
    25% { transform: translateX(3px) rotate(2deg); }
    75% { transform: translateX(-3px) rotate(-2deg); }
}

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



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

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

@keyframes royal {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

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

@keyframes slither {
    0%, 100% { transform: translateX(0px) scaleX(1); }
    50% { transform: translateX(3px) scaleX(1.1); }
}

@keyframes prowl {
    0%, 100% { transform: translateX(0px); }
    50% { transform: translateX(2px); }
}

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

@keyframes sail {
    0%, 100% { transform: translateX(0px) rotate(0deg); }
    50% { transform: translateX(4px) rotate(3deg); }
}

@keyframes gallop {
    0%, 100% { transform: translateY(0px) translateX(0px); }
    50% { transform: translateY(-4px) translateX(2px); }
}

@keyframes drive {
    0%, 100% { transform: translateX(0px); }
    50% { transform: translateX(10px) rotate(2deg); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.letter-card.clicked {
    animation: pulse 0.3s ease-out;
}

.letter-card.speaking {
    animation: speaking 0.8s ease-in-out infinite;
    border-color: #4ade80;
    box-shadow: 
        0 10px 0px rgba(74, 222, 128, 0.2),
        0 15px 30px rgba(74, 222, 128, 0.3),
        inset 0 2px 0px rgba(255, 255, 255, 0.3),
        0 0 20px rgba(74, 222, 128, 0.4);
}

@keyframes speaking {
    0%, 100% { 
        transform: scale(1);
        border-color: #4ade80;
    }
    50% { 
        transform: scale(1.02);
        border-color: #22c55e;
    }
}

/* Icon animation - grow, move to center, then return (contained within tile) */
@keyframes iconShowcase {
    0% {
        transform: translate(0px, 0px) scale(1);
    }
    25% {
        transform: translate(20px, 20px) scale(1.2);
    }
    75% {
        transform: translate(20px, 20px) scale(1.2);
    }
    100% {
        transform: translate(0px, 0px) scale(1);
    }
}



/* Complete override for showcasing animation */
.letter-card.showcasing {
    overflow: visible !important;
}

.letter-card.showcasing .decoration {
    z-index: 15 !important;
    position: relative;
    overflow: visible;
}

.letter-card.showcasing .letter {
    z-index: 1;
}

/* Force complete animation override */
.letter-card.showcasing .decoration::before {
    animation: iconShowcase 2.5s ease-in-out !important;
    animation-fill-mode: both !important;
    filter: drop-shadow(6px 6px 12px rgba(0, 0, 0, 0.5)) !important;
    z-index: 15 !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    font-size: 2.5rem !important;
    
    /* Force transform override */
    transform: translate(0px, 0px) scale(1) !important;
    
    /* Remove all inherited animations */
    animation-name: iconShowcase !important;
    animation-duration: 2.5s !important;
    animation-timing-function: ease-in-out !important;
    animation-iteration-count: 1 !important;
}

/* Ensure letter stays centered during all animations */
.letter-card.clicked,
.letter-card.speaking,
.letter-card.showcasing {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.letter-card.clicked .letter,
.letter-card.speaking .letter,
.letter-card.showcasing .letter {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    text-align: center !important;
    z-index: 10 !important;
    width: auto !important;
    height: auto !important;
}

/* Progress tracking styles */
.letter-card.done {
    border-color: #27ae60;
    box-shadow: 
        0 10px 0px #1e7e34,
        0 15px 30px rgba(39, 174, 96, 0.3),
        inset 0 2px 0px rgba(255, 255, 255, 0.3);
    position: relative;
}

.letter-card.done::after {
    content: "✓";
    position: absolute;
    top: 10px;
    right: 10px;
    background: #27ae60;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    z-index: 10;
    animation: checkMarkPopIn 0.3s ease-out;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

@keyframes checkMarkPopIn {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.progress-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.clear-btn {
    padding: 8px 16px;
    border: 2px solid #ff6b6b;
    border-radius: 20px;
    background: white;
    color: #ff6b6b;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 14px;
}

.clear-btn:hover {
    background: #ff6b6b;
    color: white;
    transform: translateY(-2px);
}

.progress-info {
    padding: 8px 16px;
    border: 2px solid #4ecdc4;
    border-radius: 20px;
    background: white;
    color: #4ecdc4;
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Celebration Modal Styles */
.celebration-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    animation: celebrationFadeIn 0.5s ease-out;
}

.celebration-overlay.show {
    display: flex;
}

.celebration-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 30px;
    padding: 50px;
    text-align: center;
    position: relative;
    max-width: 600px;
    width: 90%;
    box-shadow: 
        0 30px 80px rgba(0, 0, 0, 0.4),
        0 0 100px rgba(102, 126, 234, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    color: white !important;
    animation: celebrationBounce 1s ease-out;
    overflow: visible;
}

/* Ensure specific elements have proper text colors */
.celebration-content p,
.celebration-content div:not(.stat-number):not(.celebration-title),
.celebration-content span:not(.stat-number) {
    color: white !important;
}

.celebration-title {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 20px;
    background: linear-gradient(45deg, #ff6b35, #f7931e, #ffb347, #ffd700);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: celebrationGradient 2s ease-in-out infinite;
}

.celebration-message {
    font-size: 1.5rem;
    margin-bottom: 30px;
    line-height: 1.4;
    color: white !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.celebration-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #ffd700 !important;
    display: block;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
}

.stat-label {
    font-size: 1rem;
    color: white !important;
    opacity: 1;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.celebration-close {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white !important;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.celebration-close:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Confetti Animation */
.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #ffd700;
    animation: confettiFall 3s linear infinite;
}

.confetti:nth-child(odd) {
    background: #ff6b35;
    animation-delay: -0.5s;
}

.confetti:nth-child(even) {
    background: #48bb78;
    animation-delay: -1s;
}

.confetti:nth-child(3n) {
    background: #667eea;
    animation-delay: -1.5s;
}

@keyframes celebrationFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes celebrationBounce {
    0% { 
        opacity: 0;
        transform: scale(0.3) translateY(-100px);
    }
    50% { 
        opacity: 0.8;
        transform: scale(1.1) translateY(0);
    }
    70% { 
        transform: scale(0.95);
    }
    100% { 
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes celebrationGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .instructions {
        margin-bottom: 10px;
        padding: 12px;
    }
    
    .instructions h1 {
        font-size: 1.5rem;
        margin-bottom: 5px;
    }

    .instructions p {
        font-size: 0.85rem;
        margin-bottom: 5px;
    }
    
    .vocab-info {
        font-size: 0.75rem;
        padding: 4px 10px;
        margin: 4px auto 0 auto;
    }
    
    .age-selector {
        margin: 8px 0 6px 0;
    }
    
    .age-selector h3 {
        font-size: 0.95rem;
        margin-bottom: 6px;
    }
    
    .age-buttons {
        gap: 6px;
        margin-bottom: 6px;
    }
    
    .age-btn {
        min-width: 75px;
        padding: 6px 8px;
        font-size: 0.75rem;
    }
    
    .age-btn small {
        font-size: 0.6rem;
    }
    
    .refresh-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
        margin-top: 3px;
    }
    
    .alphabet-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 15px;
    }
    
    .letter-card {
        width: 120px;
        height: 120px;
    }
    
    .letter {
        font-size: 3rem;
    }
    
    .decoration::before,
    .decoration::after {
        font-size: 1rem !important;
    }
    
    /* Adjust icon showcase animation for smaller screens (120px tiles) */
    @keyframes iconShowcase {
        0% {
            transform: translate(0, 0) scale(1);
        }
        25% {
            transform: translate(35px, 35px) scale(1.6);
        }
        75% {
            transform: translate(35px, 35px) scale(1.6);
        }
        100% {
            transform: translate(0, 0) scale(1);
        }
    }
}

@media (max-width: 480px) {
    .instructions {
        margin-bottom: 8px;
        padding: 10px;
    }
    
    .instructions h1 {
        font-size: 1.3rem;
        margin-bottom: 4px;
    }

    .instructions p {
        font-size: 0.8rem;
        margin-bottom: 4px;
    }
    
    .vocab-info {
        font-size: 0.7rem;
        padding: 3px 8px;
        margin: 3px auto 0 auto;
    }
}

@media (max-width: 360px) {
    .instructions p {
        line-height: 1.4;
    }
    
    .vocab-info {
        font-size: 0.65rem;
        padding: 2px 6px;
        margin: 2px auto 0 auto;
    }
}

@media (max-width: 380px) {
    .age-selector {
        margin: 6px 0 4px 0;
    }
    
    .age-selector h3 {
        font-size: 0.9rem;
        margin-bottom: 5px;
    }
    
    .age-buttons {
        flex-direction: column;
        gap: 5px;
        align-items: center;
        margin-bottom: 5px;
    }
    
    .age-btn {
        min-width: 180px;
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    .age-btn small {
        font-size: 0.65rem;
    }
    
    .refresh-btn {
        padding: 5px 10px;
        font-size: 0.75rem;
        margin-top: 2px;
    }
    
    .alphabet-grid {
        grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
        gap: 10px;
    }
    
    .letter-card {
        width: 90px;
        height: 90px;
    }
    
    .letter {
        font-size: 2.5rem;
    }
    
    /* Adjust icon showcase animation for mobile screens (90px tiles) */
    @keyframes iconShowcase {
        0% {
            transform: translate(0, 0) scale(1);
        }
        25% {
            transform: translate(25px, 25px) scale(1.5);
        }
        75% {
            transform: translate(25px, 25px) scale(1.5);
        }
        100% {
            transform: translate(0, 0) scale(1);
        }
    }
}

/* Modal Overlay Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-out;
    perspective: 1200px;
    pointer-events: auto;
}

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

/* Disable all interactions when modal is open */
body.modal-open {
    overflow: hidden;
    pointer-events: none;
}

body.modal-open .modal-overlay {
    pointer-events: auto;
}

body.modal-open .letter-card {
    pointer-events: none;
    cursor: default;
}

.modal-overlay.closing {
    animation: fadeOut 1.0s ease-in forwards;
}

.modal-overlay.closing .modal-content {
    animation: modalSlideOut 1.0s cubic-bezier(0.55, 0.085, 0.68, 0.53) forwards;
}

.modal-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 30px;
    padding: 40px;
    text-align: center;
    position: relative;
    max-width: 500px;
    width: 90%;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 0 50px rgba(102, 126, 234, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    animation: modalSlideIn 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    color: white;
    cursor: default;
    transform-style: preserve-3d;
    transform-origin: left center;
    border: 2px solid rgba(255, 255, 255, 0.2);
    overflow: visible;
}



.modal-content::after {
    content: '✨';
    position: absolute;
    top: -10px;
    left: -10px;
    font-size: 1.5rem;
    animation: sparkle 1.5s infinite;
    z-index: 10;
}



.modal-icon {
    margin-bottom: 20px;
}

.modal-icon span {
    font-size: 6rem;
    display: block;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
    position: relative;
    z-index: 2;
    animation: superIconEffect 3s ease-in-out infinite; /* Default animation with color changing */
}

#modalIcon.color-changing {
    animation: superIconEffect 3s ease-in-out infinite;
}

#modalIcon.no-color-change {
    animation: superIconEffectNoColor 3s ease-in-out infinite;
}

.modal-word {
    margin-bottom: 20px;
}

.word-letters {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.word-text {
    font-size: 3rem;
    font-weight: bold;
    color: white;
    text-align: center;
    letter-spacing: 0.1em;
    animation: superTextEffect 1s ease-out;
    text-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(255, 255, 255, 0.5),
        0 0 40px rgba(255, 255, 255, 0.3);
    position: relative;
    z-index: 2;
}



@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes modalSlideIn {
    0% {
        opacity: 0;
        transform: perspective(1000px) rotateY(-180deg) scale(0.8);
        transform-origin: left center;
        filter: blur(5px);
    }
    25% {
        opacity: 0.2;
        transform: perspective(1000px) rotateY(-135deg) scale(0.85);
        transform-origin: left center;
        filter: blur(4px);
    }
    50% {
        opacity: 0.5;
        transform: perspective(1000px) rotateY(-60deg) scale(0.95);
        transform-origin: left center;
        filter: blur(2px);
    }
    75% {
        opacity: 0.8;
        transform: perspective(1000px) rotateY(-15deg) scale(1.03);
        transform-origin: left center;
        filter: blur(1px);
    }
    90% {
        opacity: 0.95;
        transform: perspective(1000px) rotateY(3deg) scale(1.01);
        transform-origin: left center;
        filter: blur(0px);
    }
    100% {
        opacity: 1;
        transform: perspective(1000px) rotateY(0deg) scale(1);
        transform-origin: left center;
        filter: blur(0px);
    }
}

@keyframes modalSlideOut {
    0% {
        opacity: 1;
        transform: perspective(1000px) rotateY(0deg) scale(1);
        transform-origin: left center;
        filter: blur(0px);
    }
    30% {
        opacity: 0.8;
        transform: perspective(1000px) rotateY(-30deg) scale(0.95);
        transform-origin: left center;
        filter: blur(1px);
    }
    70% {
        opacity: 0.3;
        transform: perspective(1000px) rotateY(-120deg) scale(0.8);
        transform-origin: left center;
        filter: blur(3px);
    }
    100% {
        opacity: 0;
        transform: perspective(1000px) rotateY(-180deg) scale(0.7);
        transform-origin: left center;
        filter: blur(5px);
    }
}

@keyframes superIconEffect {
    0% { 
        transform: scale(1) rotateY(0deg); 
        filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3)) hue-rotate(0deg);
    }
    25% { 
        transform: scale(1.1) rotateY(10deg); 
        filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.4)) hue-rotate(90deg);
    }
    50% { 
        transform: scale(1.2) rotateY(0deg); 
        filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.5)) hue-rotate(180deg);
    }
    75% { 
        transform: scale(1.1) rotateY(-10deg); 
        filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.4)) hue-rotate(270deg);
    }
    100% { 
        transform: scale(1) rotateY(0deg); 
        filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3)) hue-rotate(360deg);
    }
}

@keyframes superIconEffectNoColor {
    0% { 
        transform: scale(1) rotateY(0deg); 
        filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
    }
    25% { 
        transform: scale(1.1) rotateY(10deg); 
        filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.4));
    }
    50% { 
        transform: scale(1.2) rotateY(0deg); 
        filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.5));
    }
    75% { 
        transform: scale(1.1) rotateY(-10deg); 
        filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.4));
    }
    100% { 
        transform: scale(1) rotateY(0deg); 
        filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
    }
}

@keyframes superTextEffect {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
        text-shadow: 
            2px 2px 4px rgba(0, 0, 0, 0.3),
            0 0 20px rgba(255, 255, 255, 0.5),
            0 0 40px rgba(255, 255, 255, 0.3);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1) translateY(-5px);
        text-shadow: 
            2px 2px 4px rgba(0, 0, 0, 0.3),
            0 0 30px rgba(255, 255, 255, 0.8),
            0 0 60px rgba(255, 255, 255, 0.5);
    }
    80% {
        opacity: 1;
        transform: scale(0.95) translateY(5px);
        text-shadow: 
            2px 2px 4px rgba(0, 0, 0, 0.3),
            0 0 25px rgba(255, 255, 255, 0.6),
            0 0 50px rgba(255, 255, 255, 0.4);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0px);
        text-shadow: 
            2px 2px 4px rgba(0, 0, 0, 0.3),
            0 0 20px rgba(255, 255, 255, 0.5),
            0 0 40px rgba(255, 255, 255, 0.3);
    }
}

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



@keyframes sparkle {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    25% {
        transform: scale(1.3) rotate(90deg);
        opacity: 0.8;
    }
    50% {
        transform: scale(0.8) rotate(180deg);
        opacity: 0.6;
    }
    75% {
        transform: scale(1.1) rotate(270deg);
        opacity: 0.9;
    }
}

/* Modal responsive design */
@media (max-width: 768px) {
    .modal-content {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .modal-icon span {
        font-size: 4rem;
    }
    
    .word-text {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 25px 15px;
    }
    
    .modal-icon span {
        font-size: 3rem;
    }
    
    .word-text {
        font-size: 2rem;
    }
}

/* Additional visual effects */
.letter-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.2) 0%, transparent 50%, rgba(255,255,255,0.2) 100%);
    border-radius: 20px;
    z-index: 1;
}

/* Subtle grain texture for more realism - but not on done cards */
.letter-card:not(.done)::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 1px 1px, rgba(255,255,255,0.15) 1px, transparent 0);
    background-size: 15px 15px;
    border-radius: 20px;
    z-index: 1;
} 

/* Mode Toggle */
.mode-toggle {
    text-align: center;
    margin-bottom: 15px;
}

.mode-btn {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.mode-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.mode-btn.dev-active {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

/* Dev Section Styles */
.dev-section {
    margin-top: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 15px;
    border: 2px solid #cbd5e1;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Letter Filter Section */
.letter-filter-section {
    margin-bottom: 25px;
    padding: 15px;
    background: linear-gradient(135deg, #fff 0%, #f9fafb 100%);
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.letter-filter-section h3 {
    color: #374151;
    margin: 0 0 15px 0;
    font-size: 1.1rem;
}

.letter-filter-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

#letterSelect {
    padding: 8px 12px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    background: white;
    font-size: 0.9rem;
    min-width: 250px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#letterSelect:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.clear-filter-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.clear-filter-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.letter-details {
    margin-top: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-radius: 8px;
    border: 1px solid #d1d5db;
    min-height: 100px;
    display: none;
}

.letter-details.active {
    display: block;
}

.letter-details h4 {
    color: #1f2937;
    margin: 0 0 15px 0;
    font-size: 1.2rem;
    border-bottom: 2px solid #3b82f6;
    padding-bottom: 8px;
}

.current-assignment {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #93c5fd;
}

.current-assignment h5 {
    color: #1e40af;
    margin: 0 0 8px 0;
    font-size: 0.95rem;
}

.current-assignment-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    background: white;
    border-radius: 6px;
    border: 1px solid #c7d2fe;
}

.current-assignment-icon {
    font-size: 1.5rem;
    min-width: 30px;
    text-align: center;
}

.current-assignment-text {
    flex: 1;
}

.current-assignment-noun {
    font-weight: 600;
    color: #1e40af;
}

.current-assignment-meta {
    font-size: 0.85rem;
    color: #6b7280;
}

.available-options {
    margin-top: 20px;
}

.available-options h5 {
    color: #374151;
    margin: 0 0 15px 0;
    font-size: 0.95rem;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.option-item:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.option-item.current {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #f59e0b;
}

.option-icon {
    font-size: 1.2rem;
    min-width: 24px;
    text-align: center;
}

.option-text {
    flex: 1;
}

.option-noun {
    font-weight: 600;
    color: #374151;
}

.option-meta {
    font-size: 0.8rem;
    color: #6b7280;
}

.option-age {
    background: #3b82f6;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.dev-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.dev-header h2 {
    color: #1e293b;
    margin: 0;
    font-size: 1.4rem;
}

.dev-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.verify-btn, .diagnostics-btn {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.diagnostics-btn {
    background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
}

.verify-btn:hover, .diagnostics-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Verification Stats */
.verification-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    border: 2px solid #cbd5e1;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-card.success {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    border-color: #22c55e;
}

.stat-card.error {
    background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
    border-color: #ef4444;
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 900;
    color: #1e293b;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Verification Grid */
.verification-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.verification-item {
    background: white;
    border-radius: 12px;
    padding: 15px;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.verification-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.verification-item.valid {
    border-color: #22c55e;
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
}

.verification-item.invalid {
    border-color: #ef4444;
    background: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%);
}

.verification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.letter-badge {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1rem;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.success {
    background: #dcfce7;
    color: #166534;
}

.status-badge.error {
    background: #fef2f2;
    color: #dc2626;
}

.verification-content {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.icon-display {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 10px;
    border: 1px solid #cbd5e1;
}

.icon-display .emoji-icon {
    font-size: 2rem;
}

.icon-display svg {
    width: 30px;
    height: 30px;
}

.noun-info {
    flex: 1;
}

.noun-name {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.noun-meta {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
}

.issues {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #fecaca;
}

.issue {
    font-size: 0.75rem;
    color: #dc2626;
    margin-bottom: 4px;
    padding: 4px 8px;
    background: #fef2f2;
    border-radius: 6px;
    border-left: 3px solid #ef4444;
}

/* Responsive adjustments for dev mode */
@media (max-width: 768px) {
    .dev-header {
        flex-direction: column;
        text-align: center;
    }
    
    .verification-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .verification-grid {
        grid-template-columns: 1fr;
    }
    
    .verification-content {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .letter-filter-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    #letterSelect {
        min-width: 100%;
        width: 100%;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .dev-section {
        padding: 15px;
    }
    
    .verification-stats {
        grid-template-columns: 1fr;
    }
    
    .dev-controls {
        flex-direction: column;
        width: 100%;
    }
    
    .verify-btn, .diagnostics-btn {
        width: 100%;
    }
    
    .letter-filter-section {
        padding: 10px;
    }
    
    .clear-filter-btn {
        width: 100%;
    }
} 

.letter-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.option-number {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
} 

.age-badge {
    display: inline-block;
    padding: 2px 6px;
    margin: 0 2px;
    border-radius: 8px;
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.age-categories {
    margin-bottom: 4px;
}

.animation-info {
    color: #6b7280;
    font-size: 0.8rem;
}

/* Copyright Footer */
.copyright-footer {
    margin-top: 40px;
    padding: 20px 0;
    border-top: 1px solid rgba(99, 102, 241, 0.1);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(240, 244, 248, 0.1) 100%);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    text-align: center;
}

.copyright-content {
    max-width: 600px;
    margin: 0 auto;
}

.copyright-content p {
    margin: 0;
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 500;
}

.copyright-content p:first-child {
    color: #475569;
    font-weight: 600;
    margin-bottom: 4px;
}

.copyright-subtitle {
    color: #94a3b8;
    font-size: 0.85rem;
    font-weight: 400;
    font-style: italic;
}

.app-version {
    color: #a1a1aa;
    font-size: 0.75rem;
    font-weight: 400;
    margin-top: 4px;
    opacity: 0.8;
}

/* Responsive adjustments for copyright footer */
@media (max-width: 768px) {
    .copyright-footer {
        margin-top: 30px;
        padding: 15px 0;
    }
    
    .copyright-content p {
        font-size: 0.85rem;
    }
    
    .copyright-subtitle {
        font-size: 0.8rem;
    }
    
    .app-version {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .copyright-footer {
        margin-top: 20px;
        padding: 12px 0;
    }
    
    .copyright-content p {
        font-size: 0.8rem;
    }
    
    .copyright-subtitle {
        font-size: 0.75rem;
    }
    
    .app-version {
        font-size: 0.65rem;
    }
}

/* Responsive design - Compact mobile layout */
@media (max-width: 768px) {
    .instructions {
        margin-bottom: 5px;
        padding: 8px;
    }
    
    .instructions h1 {
        font-size: 1.2rem;
        margin-bottom: 2px;
    }

    .instructions p {
        font-size: 0.75rem;
        margin-bottom: 3px;
    }
    
    .vocab-info {
        font-size: 0.65rem;
        padding: 2px 6px;
        margin: 2px auto 0 auto;
    }
    
    .age-selector {
        margin: 4px 0 3px 0;
    }
    
    .age-selector h3 {
        font-size: 0.8rem;
        margin-bottom: 3px;
    }
    
    .age-buttons {
        gap: 4px;
        margin-bottom: 3px;
    }
    
    .age-btn {
        min-width: 70px;
        padding: 4px 6px;
        font-size: 0.65rem;
    }
    
    .age-btn small {
        font-size: 0.5rem;
    }
    
    .progress-controls {
        margin-top: 4px;
    }
    
    .alphabet-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 15px;
    }
    
    .letter-card {
        width: 120px;
        height: 120px;
    }
    
    .letter {
        font-size: 3rem;
    }
    
    .decoration::before,
    .decoration::after {
        font-size: 1rem !important;
    }
    
    /* Ensure footer has space at bottom on mobile */
    .copyright-footer {
        margin-bottom: 20px;
    }
}

