/* ========================================
   CSS Variables & Reset
======================================== */
:root {
    /* Color Palette - Pastel Theme for Kids */
    --primary: #FF9ECD;
    --primary-dark: #FF7EB8;
    --secondary: #9ED2FF;
    --accent: #B8F4C8;
    --accent-light: #D4FFE0;
    
    /* Pastel Colors */
    --pastel-pink: #FFD1DC;
    --pastel-blue: #B5E2FF;
    --pastel-mint: #C1F0DB;
    --pastel-yellow: #FFF5BA;
    --pastel-lavender: #E8D5FF;
    --pastel-peach: #FFDAB9;
    
    /* Neutral Colors */
    --bg-main: #FFF9FC;
    --bg-card: #FFFFFF;
    --bg-dark: #F5F0FF;
    
    /* Text Colors */
    --text-primary: #5D4E6D;
    --text-secondary: #8B7A9E;
    --text-light: #C4B8D0;
    
    /* Shadows */
    --shadow-soft: 0 4px 20px rgba(255, 158, 205, 0.15);
    --shadow-card: 0 8px 32px rgba(158, 210, 255, 0.12);
    --shadow-hover: 0 12px 40px rgba(255, 158, 205, 0.25);
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Border Radius */
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 28px;
    --radius-full: 50px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Gowun Dodum', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    width: 100%;
    max-width: 100vw;
}


/* ========================================
   Main Container
======================================== */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* ========================================
   Header Section
======================================== */
.header {
    text-align: center;
    margin-bottom: 50px;
}

.logo {
    font-family: 'Jua', sans-serif;
    font-size: clamp(2.2rem, 8vw, 3.5rem);
    font-weight: 400;
    background: linear-gradient(135deg, var(--primary) 0%, var(--pastel-lavender) 50%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.highlight {
    background: linear-gradient(135deg, var(--primary) 0%, var(--pastel-lavender) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-family: 'Gowun Dodum', sans-serif;
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-top: 16px;
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* ========================================
   Options Panel
======================================== */
.options-panel {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-card);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 28px;
    margin-bottom: 32px;
    border: 3px solid var(--pastel-pink);
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-label {
    font-family: 'Jua', sans-serif;
    font-weight: 400;
    color: var(--text-primary);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.option-label::before {
    content: '⭐';
    font-size: 0.9rem;
}

/* Radio Buttons */
.radio-group {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
}

.radio-item {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    background: var(--pastel-yellow);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    border: 2px solid transparent;
}

.radio-item:hover {
    background: var(--pastel-pink);
    transform: scale(1.02);
}

.radio-item input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 3px solid var(--text-light);
    border-radius: 50%;
    position: relative;
    transition: var(--transition-fast);
    background: white;
}

.radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
    transition: var(--transition-fast);
}

.radio-item input:checked ~ .radio-custom {
    border-color: var(--primary);
}

.radio-item input:checked ~ .radio-custom::after {
    transform: translate(-50%, -50%) scale(1);
}

.radio-item input:checked ~ .radio-text {
    color: var(--primary-dark);
    font-weight: 600;
}

.radio-text {
    font-family: 'Gowun Dodum', sans-serif;
    font-size: 1rem;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

/* Count Selector */
.count-selector {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--pastel-mint);
    padding: 10px 20px;
    border-radius: var(--radius-full);
    width: fit-content;
}

.count-btn {
    width: 42px;
    height: 42px;
    border: none;
    background: white;
    color: var(--text-primary);
    font-size: 1.4rem;
    font-weight: 700;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.count-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.15);
}

.count-btn:active {
    transform: scale(0.95);
}

.count-display {
    font-family: 'Jua', sans-serif;
    font-size: 1.6rem;
    font-weight: 400;
    color: var(--text-primary);
    min-width: 40px;
    text-align: center;
}

/* ========================================
   Generate Button
======================================== */
.generate-section {
    text-align: center;
    margin-bottom: 50px;
}

.generate-btn {
    position: relative;
    background: linear-gradient(135deg, var(--primary) 0%, var(--pastel-lavender) 100%);
    color: white;
    border: none;
    padding: 20px 50px;
    font-size: 1.3rem;
    font-weight: 400;
    font-family: 'Jua', sans-serif;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 30px rgba(255, 158, 205, 0.4);
    overflow: hidden;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.generate-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: var(--transition-smooth);
}

.generate-btn:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 45px rgba(255, 158, 205, 0.5);
}

.generate-btn:hover::before {
    left: 100%;
}

.generate-btn:active {
    transform: translateY(0) scale(0.98);
}

.btn-icon {
    transition: var(--transition-fast);
    font-size: 1.2em;
}

.generate-btn:hover .btn-icon {
    transform: translateX(5px);
}

.generate-btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

.generate-btn.loading .btn-text::after {
    content: '...';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* ========================================
   Results Section
======================================== */
.results-section {
    display: none;
    margin-bottom: 50px;
}

.results-section.active {
    display: block;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.results-title {
    font-family: 'Jua', sans-serif;
    font-size: 1.8rem;
    color: var(--text-primary);
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.results-title::before {
    content: '🎉';
}

.results-title::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--pastel-pink), var(--pastel-blue), var(--pastel-mint));
    border-radius: 2px;
}

.copy-all-btn {
    background: var(--secondary);
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 400;
    font-family: 'Jua', sans-serif;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(158, 210, 255, 0.4);
}

.copy-all-btn:hover {
    background: var(--pastel-mint);
    color: var(--text-primary);
    transform: translateY(-3px);
}

/* Cards Container */
.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

/* Name Card */
.name-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-card);
    border: 3px solid var(--pastel-blue);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.name-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--pastel-pink), var(--pastel-yellow), var(--pastel-mint), var(--pastel-blue));
    transform: scaleX(0);
    transform-origin: left;
    transition: var(--transition-smooth);
}

.name-card:hover {
    transform: translateY(-10px) rotate(1deg);
    box-shadow: var(--shadow-hover);
    border-color: var(--pastel-pink);
}

.name-card:hover::before {
    transform: scaleX(1);
}

.card-number {
    position: absolute;
    top: 12px;
    right: 16px;
    font-family: 'Jua', sans-serif;
    font-size: 0.9rem;
    font-weight: 400;
    color: white;
    background: var(--pastel-lavender);
    padding: 5px 12px;
    border-radius: var(--radius-full);
}

.card-avatar {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--pastel-pink) 0%, var(--pastel-lavender) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    margin-bottom: 16px;
    font-family: 'Jua', sans-serif;
    font-weight: 400;
    border: 3px solid white;
    box-shadow: 0 4px 15px rgba(255, 158, 205, 0.3);
}

.card-name {
    font-family: 'Jua', sans-serif;
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.card-gender {
    font-family: 'Gowun Dodum', sans-serif;
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.gender-icon {
    font-size: 1.1rem;
}

.card-actions {
    display: flex;
    gap: 10px;
}

.card-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 400;
    font-family: 'Jua', sans-serif;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.copy-btn {
    background: var(--pastel-yellow);
    color: var(--text-primary);
    border: 2px solid transparent;
}

.copy-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.05);
}

.favorite-btn {
    background: var(--pastel-pink);
    color: var(--text-primary);
    border: 2px solid transparent;
}

.favorite-btn:hover,
.favorite-btn.active {
    background: #FFB5C2;
    color: #FF4757;
    transform: scale(1.05);
}

.favorite-btn.active .fav-icon {
    animation: heartbeat 0.6s ease-in-out;
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(1); }
    75% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ========================================
   History Section
======================================== */
.history-section {
    display: none;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-card);
    border: 3px solid var(--pastel-mint);
}

.history-section.active {
    display: block;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.history-title {
    font-family: 'Jua', sans-serif;
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--text-primary);
}

.clear-history-btn {
    background: var(--pastel-peach);
    border: none;
    color: var(--text-primary);
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 400;
    font-family: 'Jua', sans-serif;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition-fast);
}

.clear-history-btn:hover {
    background: #FFB5B5;
    color: #D63031;
    transform: scale(1.05);
}

.history-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.history-list::-webkit-scrollbar {
    width: 8px;
}

.history-list::-webkit-scrollbar-track {
    background: var(--pastel-lavender);
    border-radius: 4px;
}

.history-list::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: var(--pastel-yellow);
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.history-item:hover {
    background: var(--pastel-pink);
    transform: translateX(5px);
}

.history-names {
    font-family: 'Gowun Dodum', sans-serif;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 1rem;
}

.history-time {
    font-family: 'Gowun Dodum', sans-serif;
    font-size: 0.85rem;
    color: var(--text-light);
}

/* ========================================
   Footer
======================================== */
.footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-secondary);
    font-family: 'Jua', sans-serif;
    font-size: 1.1rem;
}

.heart {
    color: #FF4757;
    display: inline-block;
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* ========================================
   Toast Notification
======================================== */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: linear-gradient(135deg, var(--pastel-mint) 0%, var(--secondary) 100%);
    color: var(--text-primary);
    padding: 16px 30px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 30px rgba(158, 210, 255, 0.4);
    opacity: 0;
    transition: var(--transition-smooth);
    z-index: 1000;
    font-family: 'Jua', sans-serif;
    font-size: 1rem;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-icon {
    width: 28px;
    height: 28px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--accent);
}

/* ========================================
   Responsive Design
======================================== */
@media (max-width: 768px) {
    .container {
        padding: 30px 16px;
    }
    
    .options-panel {
        padding: 24px 20px;
        gap: 24px;
    }
    
    .generate-btn {
        padding: 18px 40px;
        font-size: 1.1rem;
    }
    
    .cards-container {
        grid-template-columns: 1fr;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .blob-1 {
        width: 300px;
        height: 300px;
    }
    
    .blob-2 {
        width: 250px;
        height: 250px;
    }
    
    .blob-3 {
        width: 200px;
        height: 200px;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.8rem;
    }
    
    .tagline {
        font-size: 1rem;
    }
    
    .radio-group {
        flex-direction: column;
    }
    
    .card-actions {
        flex-direction: column;
    }
}

/* ========================================
   Loading Animation
======================================== */
.skeleton {
    background: linear-gradient(90deg, var(--pastel-pink) 25%, var(--pastel-lavender) 50%, var(--pastel-pink) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ========================================
   AOS Custom Animations
======================================== */
[data-aos="card-appear"] {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    transition-property: opacity, transform;
}

[data-aos="card-appear"].aos-animate {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ========================================
   Navigation Bar
======================================== */
.navbar {
    background: var(--bg-card);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo {
    font-family: 'Jua', sans-serif;
    font-size: 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-fast);
}

.nav-logo:hover {
    transform: scale(1.05);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 8px;
}

.nav-link {
    font-family: 'Jua', sans-serif;
    font-size: 1.1rem;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 12px 20px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-fast);
}

.nav-link:hover {
    background: var(--pastel-yellow);
    color: var(--text-primary);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--pastel-lavender) 100%);
    color: white;
}

.nav-item {
    position: relative;
}

.nav-item.has-submenu {
    position: relative;
}

.submenu-toggle {
    margin-left: auto;
    font-size: 0.7rem;
    transition: var(--transition-fast);
    display: inline-block;
    opacity: 0.7;
    margin-left: 8px;
}

.nav-item.has-submenu.active .submenu-toggle {
    transform: rotate(180deg);
}

/* Submenu Styles */
.nav-submenu {
    list-style: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    padding: 8px 0;
    margin-top: 8px;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition-smooth);
    z-index: 1000;
    border: 2px solid var(--pastel-pink);
}

.nav-item.has-submenu.active .nav-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-submenu .nav-link {
    padding: 10px 20px;
    border-radius: 0;
    width: 100%;
    justify-content: flex-start;
}

.nav-submenu .nav-link:hover {
    background: var(--pastel-yellow);
    border-radius: var(--radius-sm);
}

.nav-icon {
    font-size: 1.2rem;
}

/* Hamburger Menu */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.hamburger {
    display: block;
    width: 28px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 3px;
    position: relative;
    transition: var(--transition-fast);
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 28px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 3px;
    transition: var(--transition-fast);
}

.hamburger::before {
    top: -8px;
}

.hamburger::after {
    top: 8px;
}

.nav-toggle.active .hamburger {
    background: transparent;
}

.nav-toggle.active .hamburger::before {
    top: 0;
    transform: rotate(45deg);
}

.nav-toggle.active .hamburger::after {
    top: 0;
    transform: rotate(-45deg);
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }
    
    .nav-menu {
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--bg-card);
        flex-direction: column;
        padding: 20px;
        gap: 10px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        transform: translateY(-150%);
        opacity: 0;
        transition: var(--transition-smooth);
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
    }
    
    .nav-link {
        width: 100%;
        justify-content: center;
        padding: 16px;
    }
    
    /* Mobile Submenu */
    .nav-submenu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        margin-top: 0;
        padding: 0;
        background: var(--pastel-yellow);
        border-radius: var(--radius-sm);
        margin-left: 20px;
        margin-top: 8px;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .nav-item.has-submenu.active .nav-submenu {
        max-height: 200px;
        padding: 8px 0;
    }
    
    .nav-submenu .nav-link {
        padding: 12px 20px;
    }
}

/* ========================================
   Alphabet Tracing Page
======================================== */
.section-title {
    font-family: 'Jua', sans-serif;
    font-size: 1.4rem;
    color: var(--text-primary);
    margin-bottom: 20px;
}

/* Alphabet Selector */
.alphabet-selector {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-card);
    margin-bottom: 30px;
    border: 3px solid var(--pastel-blue);
}

.alphabet-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    font-family: 'Jua', sans-serif;
    font-size: 1rem;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-full);
    background: var(--pastel-yellow);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.tab-btn:hover {
    background: var(--pastel-pink);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--pastel-lavender) 100%);
    color: white;
}

.alphabet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 10px;
}

.alphabet-btn {
    font-family: 'Jua', sans-serif;
    font-size: 1.4rem;
    width: 50px;
    height: 50px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--pastel-mint);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.alphabet-btn:hover {
    background: var(--pastel-pink);
    transform: scale(1.1);
}

.alphabet-btn.active {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

/* Tracing Section */
.tracing-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-card);
    margin-bottom: 30px;
    border: 3px solid var(--pastel-pink);
}

.canvas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.canvas-controls {
    display: flex;
    gap: 10px;
}

.control-btn {
    font-family: 'Jua', sans-serif;
    font-size: 0.95rem;
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius-full);
    background: var(--pastel-lavender);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 6px;
}

.control-btn:hover {
    background: var(--pastel-pink);
    transform: scale(1.05);
}

/* Canvas Wrapper */
.canvas-wrapper {
    position: relative;
    width: 100%;
    height: 350px;
    background: white;
    border-radius: var(--radius-md);
    border: 3px dashed var(--pastel-blue);
    overflow: hidden;
    cursor: crosshair;
}

.guide-letter {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Arial', sans-serif;
    font-size: 220px;
    font-weight: bold;
    color: var(--text-primary);
    opacity: 0.15;
    pointer-events: none;
    user-select: none;
    transition: var(--transition-fast);
    line-height: 1;
}

#tracingCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

/* Line Guides */
.line-guides {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.guide-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--pastel-blue);
    opacity: 0.5;
}

.top-line {
    top: 15%;
}

.middle-line {
    top: 50%;
    background: var(--pastel-pink);
}

.baseline {
    top: 75%;
    background: var(--pastel-mint);
    height: 3px;
}

.bottom-line {
    top: 90%;
}

/* Color Picker */
.color-picker,
.brush-size {
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.picker-label {
    font-family: 'Jua', sans-serif;
    font-size: 1rem;
    color: var(--text-primary);
}

.color-options {
    display: flex;
    gap: 8px;
}

.color-btn {
    width: 36px;
    height: 36px;
    border: 3px solid white;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-fast);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.color-btn:hover {
    transform: scale(1.15);
}

.color-btn.active {
    border-color: var(--text-primary);
    transform: scale(1.15);
}

/* Size Options */
.size-options {
    display: flex;
    gap: 8px;
}

.size-btn {
    font-family: 'Jua', sans-serif;
    font-size: 0.9rem;
    padding: 8px 16px;
    border: 2px solid var(--pastel-lavender);
    border-radius: var(--radius-full);
    background: white;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.size-btn:hover {
    background: var(--pastel-lavender);
}

.size-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Success Message */
.success-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: linear-gradient(135deg, var(--pastel-yellow) 0%, var(--pastel-mint) 100%);
    padding: 30px 50px;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 1000;
    opacity: 0;
    transition: var(--transition-smooth);
}

.success-message.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.success-icon {
    font-size: 3rem;
    animation: bounce 0.6s ease infinite;
}

.success-text {
    font-family: 'Jua', sans-serif;
    font-size: 2rem;
    color: var(--text-primary);
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Tracing Page Responsive */
@media (max-width: 768px) {
    .canvas-wrapper {
        height: 280px;
    }
    
    .guide-letter {
        font-size: 180px;
    }
    
    .alphabet-grid {
        grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
    }
    
    .alphabet-btn {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
    
    .canvas-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .canvas-wrapper {
        height: 250px;
    }
    
    .guide-letter {
        font-size: 140px;
    }
    
    .color-picker,
    .brush-size {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ========================================
   Quiz Page - 그림보고 단어 맞추기
======================================== */

/* Score Board */
.score-board {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.score-item {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-card);
    border: 2px solid var(--pastel-yellow);
}

.score-icon {
    font-size: 1.5rem;
}

.score-label {
    font-family: 'Jua', sans-serif;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.score-value {
    font-family: 'Jua', sans-serif;
    font-size: 1.3rem;
    color: var(--text-primary);
    font-weight: bold;
}

/* Category Selector */
.category-selector {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
    margin-bottom: 30px;
    border: 3px solid var(--pastel-blue);
}

.category-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-card);
    margin-bottom: 30px;
    border: 3px solid var(--pastel-pink);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.category-btn {
    font-family: 'Jua', sans-serif;
    font-size: 1rem;
    padding: 14px 20px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--pastel-mint);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.category-btn:hover {
    background: var(--pastel-pink);
    transform: scale(1.03);
}

.category-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--pastel-lavender) 100%);
    color: white;
    transform: scale(1.03);
}

/* Quiz Section */
.quiz-section {
    margin-bottom: 30px;
}

.quiz-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-card);
    border: 3px solid var(--pastel-pink);
    text-align: center;
}

.quiz-image-container {
    margin-bottom: 30px;
}

.quiz-image {
    font-size: 120px;
    line-height: 1;
    display: inline-block;
    animation: float-gentle 3s ease-in-out infinite;
}

@keyframes float-gentle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.quiz-image.pop-in {
    animation: pop-in 0.3s ease-out;
}

@keyframes pop-in {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Answer Options */
.answer-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 1fr;
    gap: 15px;
    max-width: 500px;
    margin: 0 auto 20px;
}

.answer-btn {
    font-family: 'Jua', sans-serif;
    font-size: 1.2rem;
    padding: 14px 20px;
    border: 3px solid var(--pastel-lavender);
    border-radius: var(--radius-md);
    background: white;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-fast);
    animation: fade-in 0.3s ease-out forwards;
    opacity: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    line-height: 1.3;
    min-height: 70px;
    position: relative;
}

.answer-english {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text-primary);
}

.answer-korean {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: normal;
    transition: all 0.3s ease;
    min-height: 1.2em;
}

.answer-korean.hidden {
    opacity: 0;
    visibility: hidden;
}

.answer-btn:not(:disabled) .answer-korean:not(.hidden) {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
    to { opacity: 1; }
}

.answer-btn:hover:not(:disabled) {
    background: var(--pastel-lavender);
    transform: scale(1.02);
}

.answer-btn:disabled {
    cursor: not-allowed;
}

.answer-btn.correct {
    background: var(--pastel-mint);
    border-color: #4CAF50;
    color: #2E7D32;
    animation: correct-pulse 0.5s ease-out;
}

@keyframes correct-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.answer-btn.wrong {
    background: #FFEBEE;
    border-color: #F44336;
    color: #C62828;
    animation: wrong-shake 0.5s ease-out;
}

@keyframes wrong-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* Feedback Message */
.feedback-message {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 24px;
    border-radius: var(--radius-full);
    font-family: 'Jua', sans-serif;
    font-size: 1.1rem;
    margin-top: 20px;
}

.feedback-message.show {
    display: flex;
    animation: slide-up 0.3s ease-out;
}

@keyframes slide-up {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.feedback-message.correct {
    background: var(--pastel-mint);
    color: #2E7D32;
}

.feedback-message.wrong {
    background: #FFEBEE;
    color: #C62828;
}

.feedback-icon {
    font-size: 1.5rem;
}

/* Quiz Controls */
.quiz-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.restart-btn,
.next-btn {
    font-family: 'Jua', sans-serif;
    font-size: 1.1rem;
    padding: 14px 28px;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
}

.restart-btn {
    background: var(--pastel-peach);
    color: var(--text-primary);
}

.restart-btn:hover {
    background: var(--pastel-pink);
    transform: scale(1.05);
}

.next-btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--pastel-lavender) 100%);
    color: white;
}

.next-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 158, 205, 0.4);
}

.next-btn:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Result Modal */
.result-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-smooth);
}

.result-modal.show {
    opacity: 1;
    visibility: visible;
}

.result-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    transform: scale(0.8);
    transition: var(--transition-smooth);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.result-modal.show .result-content {
    transform: scale(1);
}

.result-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: bounce 1s ease infinite;
}

.result-title {
    font-family: 'Jua', sans-serif;
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.result-score {
    background: var(--pastel-yellow);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
}

.result-label {
    font-family: 'Gowun Dodum', sans-serif;
    font-size: 1rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 8px;
}

.result-value {
    font-family: 'Jua', sans-serif;
    font-size: 3rem;
    color: var(--text-primary);
}

.result-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.stat-icon {
    font-size: 1.5rem;
}

.stat-value {
    font-family: 'Jua', sans-serif;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.stat-label {
    font-family: 'Gowun Dodum', sans-serif;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.result-message {
    font-family: 'Jua', sans-serif;
    font-size: 1.3rem;
    color: var(--primary-dark);
    margin-bottom: 25px;
    padding: 15px;
    background: var(--pastel-pink);
    border-radius: var(--radius-md);
}

.result-btn {
    font-family: 'Jua', sans-serif;
    font-size: 1.2rem;
    padding: 16px 40px;
    border: none;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary) 0%, var(--pastel-lavender) 100%);
    color: white;
    cursor: pointer;
    transition: var(--transition-fast);
}

.result-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 158, 205, 0.4);
}

/* Quiz Responsive */
@media (max-width: 768px) {
    .score-board {
        gap: 10px;
    }
    
    .score-item {
        padding: 12px 16px;
    }
    
    .quiz-image {
        font-size: 80px;
    }
    
    .answer-options {
        grid-template-columns: 1fr;
    }
    
    .answer-btn {
        font-size: 1.1rem;
        padding: 14px 20px;
    }
    
    .quiz-card {
        padding: 24px;
    }
}

@media (max-width: 768px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .result-content {
        padding: 24px;
    }
    
    .result-value {
        font-size: 2.5rem;
    }
}

/* ========================================
   Sticker Book Page - 영어 스티커북
======================================== */

.sticker-container {
    max-width: 1200px;
    overflow-x: hidden;
}

.sticker-workspace {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    margin-bottom: 30px;
    width: 100%;
}

/* Sticker Palette */
.sticker-palette {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-card);
    border: 3px solid var(--pastel-lavender);
    height: fit-content;
    position: sticky;
    top: 90px;
}

.palette-title {
    font-family: 'Jua', sans-serif;
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 16px;
    text-align: center;
}

.palette-section {
    margin-bottom: 16px;
}

.section-label {
    display: block;
    font-family: 'Jua', sans-serif;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* Category Tabs Area */
.sticker-tabs {
    display: flex;
    gap: 8px;
    justify-content: center;
    padding: 10px;
    background: var(--pastel-yellow);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
}

.sticker-tabs:last-of-type {
    margin-bottom: 0;
}

.sticker-tab {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: var(--radius-sm);
    background: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition-fast);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sticker-tab:hover {
    background: var(--pastel-pink);
    transform: scale(1.1);
}

.sticker-tab.active {
    background: var(--primary);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 158, 205, 0.4);
}

/* Sticker Grid Area */
.sticker-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 12px;
    background: var(--pastel-mint);
    border-radius: var(--radius-md);
    border: 2px dashed var(--accent);
    max-height: 280px;
    overflow-y: auto;
}

.sticker-grid::-webkit-scrollbar {
    width: 6px;
}

.sticker-grid::-webkit-scrollbar-track {
    background: var(--pastel-lavender);
    border-radius: 3px;
}

.sticker-grid::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

.sticker-item {
    width: 100%;
    aspect-ratio: 1;
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: var(--radius-sm);
    cursor: grab;
    transition: var(--transition-fast);
    animation: sticker-pop 0.3s ease backwards;
    user-select: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

@keyframes sticker-pop {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.sticker-item:hover {
    background: var(--pastel-pink);
    transform: scale(1.15);
}

.sticker-item.dragging {
    opacity: 0.5;
    transform: scale(1.2);
}

.word-display {
    background: var(--pastel-yellow);
    border-radius: var(--radius-md);
    padding: 15px;
    text-align: center;
}

.word-label {
    display: block;
    font-family: 'Gowun Dodum', sans-serif;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.word-text {
    font-family: 'Jua', sans-serif;
    font-size: 1.3rem;
    color: var(--text-primary);
    display: block;
    transition: var(--transition-fast);
    line-height: 1.4;
}

.word-text strong {
    color: var(--primary-dark);
    font-size: 1.4rem;
}

.word-text .korean-text {
    font-size: 1rem;
    color: var(--text-secondary);
    display: block;
    margin-top: 2px;
}

.word-text.pop {
    animation: word-pop 0.3s ease;
}

@keyframes word-pop {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Canvas Area */
.canvas-area {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-card);
    border: 3px solid var(--pastel-blue);
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.canvas-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.canvas-title {
    font-family: 'Jua', sans-serif;
    font-size: 1.2rem;
    color: var(--text-primary);
}

.toolbar-buttons {
    display: flex;
    gap: 10px;
}

.toolbar-btn {
    font-family: 'Jua', sans-serif;
    font-size: 0.9rem;
    padding: 10px 16px;
    border: none;
    border-radius: var(--radius-full);
    background: var(--pastel-peach);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.toolbar-btn:hover {
    background: var(--pastel-pink);
    transform: scale(1.05);
}

.toolbar-btn.download-btn {
    background: var(--pastel-mint);
}

.toolbar-btn.download-btn:hover {
    background: var(--accent);
}

/* Drop Zone */
.drop-zone {
    width: 100%;
    max-width: 100%;
    height: 450px;
    background: white;
    border-radius: var(--radius-md);
    border: 3px dashed var(--pastel-lavender);
    position: relative;
    overflow: hidden;
    transition: var(--transition-fast);
    box-sizing: border-box;
}

.drop-zone.drag-over {
    border-color: var(--primary);
    background: var(--pastel-pink);
}

.drop-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--text-light);
    transition: var(--transition-fast);
}

.hint-icon {
    font-size: 3rem;
    animation: hint-bounce 1.5s ease infinite;
}

@keyframes hint-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.hint-text {
    font-family: 'Jua', sans-serif;
    font-size: 1.1rem;
}

/* Placed Stickers */
.placed-sticker {
    position: absolute;
    width: 70px;
    height: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: grab;
    transition: filter 0.2s ease, box-shadow 0.2s ease;
    z-index: 10;
    will-change: transform;
}

.placed-sticker:hover {
    filter: brightness(1.05);
    z-index: 20;
}

.placed-sticker.moving {
    z-index: 30;
    cursor: grabbing;
    transition: none;
}

.placed-sticker.rotating {
    transition: none;
}

.placed-sticker.pop-in {
    animation: sticker-pop-in 0.3s ease;
}

@keyframes sticker-pop-in {
    0% { transform: scale(0) rotate(-20deg); opacity: 0; }
    70% { transform: scale(1.2) rotate(5deg); }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}

.placed-sticker.removing {
    animation: sticker-remove 0.3s ease forwards;
}

@keyframes sticker-remove {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(0) rotate(30deg); opacity: 0; }
}

.placed-emoji {
    font-size: 2.5rem;
    display: block;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.1));
}

.placed-word {
    font-family: 'Jua', sans-serif;
    font-size: 0.7rem;
    color: var(--text-primary);
    background: white;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    text-align: center;
    line-height: 1.3;
}

.placed-korean {
    font-size: 0.55rem;
    color: var(--text-secondary);
    display: block;
}

/* Rotate Handle */
.rotate-handle {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    width: 26px;
    height: 26px;
    background: linear-gradient(135deg, #E1BEE7, #CE93D8);
    color: white;
    border-radius: 50%;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    opacity: 0;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(206, 147, 216, 0.4);
    z-index: 15;
    user-select: none;
}

.placed-sticker:hover .rotate-handle {
    opacity: 1;
}

.rotate-handle:hover {
    background: linear-gradient(135deg, #CE93D8, #BA68C8);
    transform: translateX(-50%) scale(1.1);
    box-shadow: 0 3px 12px rgba(186, 104, 200, 0.5);
}

.rotate-handle:active {
    cursor: grabbing;
    transform: translateX(-50%) scale(1.05);
}

/* Delete Button */
.sticker-delete-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFCDD2, #EF9A9A);
    color: white;
    font-size: 12px;
    box-shadow: 0 2px 8px rgba(239, 154, 154, 0.4);
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition-fast);
    box-shadow: 0 2px 6px rgba(255, 107, 107, 0.4);
    z-index: 15;
}

.placed-sticker:hover .sticker-delete-btn {
    opacity: 1;
}

.sticker-delete-btn:hover {
    background: linear-gradient(135deg, #EF9A9A, #E57373);
    transform: scale(1.1);
    box-shadow: 0 3px 12px rgba(229, 115, 115, 0.5);
}

.sticker-delete-btn:active {
    transform: scale(1.05);
}

/* Resize Handle */
.resize-handle {
    position: absolute;
    bottom: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, #C8E6C9, #A5D6A7);
    border-radius: 50%;
    cursor: nwse-resize;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 15;
    box-shadow: 0 2px 8px rgba(165, 214, 167, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.resize-handle::before {
    content: '⤡';
    font-size: 12px;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.placed-sticker:hover .resize-handle {
    opacity: 1;
}

.resize-handle:hover {
    background: linear-gradient(135deg, #A5D6A7, #81C784);
    transform: scale(1.1);
    box-shadow: 0 3px 12px rgba(129, 199, 132, 0.5);
}

.resize-handle:active {
    transform: scale(1.05);
}

/* Scale indicator on hover */
.placed-sticker::after {
    content: attr(data-scale-display);
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-family: 'Jua', sans-serif;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 10px;
    opacity: 0;
    transition: var(--transition-fast);
    pointer-events: none;
    white-space: nowrap;
}

.placed-sticker:hover::after {
    opacity: 1;
}

/* Mobile: always show controls */
@media (max-width: 768px) {
    .rotate-handle {
        opacity: 0.9;
        width: 26px;
        height: 26px;
        font-size: 16px;
    }
    
    .sticker-delete-btn {
        opacity: 0.9;
        width: 24px;
        height: 24px;
        font-size: 14px;
    }
    
    .resize-handle {
        opacity: 0.9;
        width: 22px;
        height: 22px;
    }
}

/* Background Selector */
.background-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.bg-label {
    font-family: 'Jua', sans-serif;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.bg-options-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
}

.bg-btn {
    width: 32px;
    height: 32px;
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-fast);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.bg-btn:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.bg-btn.active {
    border-color: var(--text-primary);
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* Touch Clone */
.touch-clone {
    position: fixed;
    font-size: 3rem;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    filter: drop-shadow(2px 4px 8px rgba(0, 0, 0, 0.2));
}

/* Instructions */
.instructions {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
    border: 3px solid var(--pastel-mint);
}

.instructions-title {
    font-family: 'Jua', sans-serif;
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 20px;
    text-align: center;
}

.instruction-steps {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.step {
    display: flex;
    align-items: center;
    gap: 12px;
}

.step-number {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--pastel-lavender) 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Jua', sans-serif;
    font-size: 1rem;
    flex-shrink: 0;
}

.step-text {
    font-family: 'Gowun Dodum', sans-serif;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* Sticker Book Responsive */
@media (max-width: 900px) {
    .sticker-container {
        padding: 20px 15px;
        max-width: 100%;
    }
    
    .sticker-workspace {
        grid-template-columns: 1fr;
        gap: 16px;
        width: 100%;
    }
    
    .sticker-palette {
        position: static;
        padding: 16px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .sticker-grid {
        grid-template-columns: repeat(8, 1fr);
        max-height: 180px;
    }
    
    .canvas-area {
        padding: 16px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .drop-zone {
        height: 350px;
        min-height: 300px;
        width: 100%;
    }
}

@media (max-width: 600px) {
    .sticker-container {
        padding: 15px 10px;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .sticker-workspace {
        gap: 12px;
        width: 100%;
    }
    
    .sticker-palette {
        padding: 12px;
        width: 100%;
    }
    
    .palette-title {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }
    
    .sticker-tabs {
        padding: 8px;
        gap: 6px;
    }
    
    .sticker-tab {
        width: 42px;
        height: 42px;
        font-size: 1.3rem;
    }
    
    .sticker-grid {
        grid-template-columns: repeat(6, 1fr);
        max-height: 140px;
        padding: 10px;
        gap: 6px;
    }
    
    .sticker-item {
        font-size: 1.3rem;
    }
    
    .word-display {
        padding: 10px;
    }
    
    .word-text {
        font-size: 1.1rem;
    }
    
    .canvas-area {
        padding: 12px;
        width: 100%;
    }
    
    .canvas-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .canvas-title {
        text-align: center;
        font-size: 1.1rem;
    }
    
    .toolbar-buttons {
        width: 100%;
        justify-content: center;
    }
    
    .toolbar-btn {
        flex: 1;
        padding: 10px 12px;
        font-size: 0.85rem;
    }
    
    .drop-zone {
        height: 280px;
        min-height: 250px;
        width: 100%;
    }
    
    .background-selector {
        gap: 8px;
    }
    
    .bg-options-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 6px;
    }
    
    .bg-btn {
        width: 28px;
        height: 28px;
    }
    
    .instructions {
        padding: 16px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .instruction-steps {
        flex-direction: column;
        gap: 12px;
    }
    
    .step {
        justify-content: flex-start;
    }
    
    .step-text {
        font-size: 0.9rem;
    }
}

@media (max-width: 400px) {
    .sticker-container {
        padding: 10px 8px;
    }
    
    .sticker-palette,
    .canvas-area {
        padding: 10px;
        border-radius: var(--radius-md);
    }
    
    .sticker-tabs {
        padding: 6px;
        gap: 4px;
    }
    
    .sticker-tab {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }
    
    .sticker-grid {
        grid-template-columns: repeat(5, 1fr);
        max-height: 120px;
        padding: 8px;
        gap: 5px;
    }
    
    .sticker-item {
        font-size: 1.1rem;
    }
    
    .drop-zone {
        height: 240px;
        min-height: 200px;
    }
    
    .placed-sticker {
        width: 55px;
        height: 55px;
    }
    
    .placed-emoji {
        font-size: 2rem;
    }
    
    .placed-word {
        font-size: 0.6rem;
        padding: 1px 6px;
    }
    
    .hint-icon {
        font-size: 2rem;
    }
    
    .hint-text {
        font-size: 0.9rem;
    }
    
    .bg-options-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 5px;
    }
    
    .bg-btn {
        width: 24px;
        height: 24px;
    }
}

/* ========================================
   WORD PUZZLE PAGE STYLES
   ======================================== */

/* Puzzle Info */
.puzzle-info {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

.puzzle-info .info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.puzzle-info .info-icon {
    font-size: 1.5rem;
}

.puzzle-info .info-label {
    font-family: 'Gowun Dodum', sans-serif;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.puzzle-info .info-value {
    font-family: 'Jua', sans-serif;
    font-size: 1.5rem;
    color: var(--primary-dark);
}

/* Puzzle Section */
.puzzle-section {
    background: white;
    border-radius: var(--radius-xl);
    padding: 30px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 30px;
}

/* Question Display */
.puzzle-question {
    text-align: center;
    margin-bottom: 30px;
}

.question-emoji {
    font-size: 5rem;
    margin-bottom: 10px;
    display: block;
}

.question-hint {
    font-family: 'Jua', sans-serif;
    font-size: 1.5rem;
    color: var(--text-secondary);
    padding: 10px 25px;
    background: var(--pastel-yellow);
    border-radius: var(--radius-full);
    display: inline-block;
    transition: var(--transition-smooth);
}

.question-hint.revealed {
    color: var(--primary-dark);
    background: linear-gradient(135deg, var(--pastel-mint), var(--pastel-sky));
    transform: scale(1.05);
}

/* Puzzle Board */
.puzzle-board {
    background: linear-gradient(135deg, #FAFAFA, #F5F5F5);
    border-radius: var(--radius-lg);
    padding: 25px;
    border: 2px dashed var(--border-color);
}

.board-title {
    font-family: 'Jua', sans-serif;
    font-size: 1.2rem;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 20px;
}

/* Answer Zone */
.answer-zone {
    margin-bottom: 30px;
}

.answer-slots {
    display: flex;
    justify-content: center;
    gap: 10px;
    min-height: 80px;
    padding: 15px;
    background: white;
    border-radius: var(--radius-md);
    border: 3px solid var(--pastel-lavender);
    flex-wrap: wrap;
    position: relative;
}

/* 빈 슬롯 배경 표시 (CSS로 생성) */
.answer-slots::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 10px;
    pointer-events: none;
    z-index: 0;
}

/* 빈 슬롯 */
.answer-slot.empty {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--pastel-sky), var(--pastel-lavender));
    border: 2px dashed var(--primary-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    pointer-events: none;
}

.answer-slot.empty::before {
    content: '?';
    font-family: 'Jua', sans-serif;
    font-size: 1.5rem;
    color: var(--primary-color);
    opacity: 0.5;
}

/* 정답 영역의 글자 조각 */
.answer-slots .letter-piece {
    position: relative;
    z-index: 1;
    background: linear-gradient(135deg, var(--pastel-mint), #B2DFDB);
    border-color: #4DB6AC;
    cursor: grab;
}

.answer-slots .letter-piece:hover {
    background: linear-gradient(135deg, #B2DFDB, #80CBC4);
    transform: scale(1.05);
}

.answer-slots .letter-piece:active {
    cursor: grabbing;
    transform: scale(0.95);
}

/* Sortable States for Answer Area */
.answer-slots .letter-ghost {
    opacity: 0.4;
    background: var(--pastel-lavender) !important;
}

.answer-slots .letter-chosen {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    z-index: 100;
}

.answer-slots .letter-drag {
    opacity: 1;
}

/* Letter Pieces Zone */
.pieces-zone {
    text-align: center;
}

.pieces-title {
    font-family: 'Jua', sans-serif;
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.letter-pieces {
    display: flex;
    justify-content: center;
    gap: 10px;
    min-height: 70px;
    padding: 15px;
    background: white;
    border-radius: var(--radius-md);
    flex-wrap: wrap;
}

/* Letter Piece */
.letter-piece {
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, var(--pastel-pink), var(--pastel-peach));
    border: 3px solid white;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Jua', sans-serif;
    font-size: 1.8rem;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: piece-appear 0.3s ease-out backwards;
}

@keyframes piece-appear {
    from {
        opacity: 0;
        transform: scale(0.5) rotate(-10deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

.letter-piece:hover {
    transform: scale(1.1) rotate(2deg);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.letter-piece:active {
    transform: scale(0.95);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.letter-piece.clicked {
    animation: piece-click 0.3s ease;
}

@keyframes piece-click {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Letter Piece States */
.letter-piece.correct {
    background: linear-gradient(135deg, var(--pastel-mint), #A5D6A7) !important;
    border-color: #4CAF50;
    animation: correct-bounce 0.5s ease;
}

@keyframes correct-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.letter-piece.wrong {
    animation: wrong-shake 0.5s ease;
    background: linear-gradient(135deg, #FFCDD2, #EF9A9A) !important;
}

@keyframes wrong-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

.letter-piece.hint-highlight {
    animation: hint-pulse 0.5s ease infinite;
    background: linear-gradient(135deg, var(--pastel-yellow), #FFE082) !important;
    border-color: #FFC107;
}

@keyframes hint-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.5); }
    50% { transform: scale(1.1); box-shadow: 0 0 20px 5px rgba(255, 193, 7, 0.3); }
}

/* Puzzle Feedback */
.puzzle-feedback {
    text-align: center;
    padding: 15px 25px;
    border-radius: var(--radius-full);
    margin-top: 20px;
    opacity: 0;
    transform: translateY(10px);
    transition: var(--transition-smooth);
}

.puzzle-feedback.show {
    opacity: 1;
    transform: translateY(0);
}

.puzzle-feedback.correct {
    background: linear-gradient(135deg, var(--pastel-mint), #C8E6C9);
    color: #2E7D32;
}

.puzzle-feedback.wrong {
    background: linear-gradient(135deg, #FFCDD2, #FFEBEE);
    color: #C62828;
}

.puzzle-feedback.warning {
    background: linear-gradient(135deg, var(--pastel-yellow), #FFF9C4);
    color: #F57F17;
}

.puzzle-feedback .feedback-icon {
    font-size: 1.5rem;
    margin-right: 10px;
}

.puzzle-feedback .feedback-text {
    font-family: 'Jua', sans-serif;
    font-size: 1.2rem;
}

/* Puzzle Controls */
.puzzle-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.puzzle-controls .control-btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-full);
    font-family: 'Jua', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
}

.puzzle-controls .hint-btn {
    background: linear-gradient(135deg, var(--pastel-yellow), #FFE082);
    color: #F57F17;
}

.puzzle-controls .hint-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 224, 130, 0.5);
}

.puzzle-controls .check-btn {
    background: linear-gradient(135deg, var(--pastel-mint), #A5D6A7);
    color: #2E7D32;
}

.puzzle-controls .check-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(165, 214, 167, 0.5);
}

.puzzle-controls .check-btn.pulse {
    animation: check-pulse 1s ease infinite;
}

@keyframes check-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.puzzle-controls .next-btn {
    background: linear-gradient(135deg, var(--pastel-sky), #90CAF9);
    color: #1565C0;
}

.puzzle-controls .next-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(144, 202, 249, 0.5);
}

.puzzle-controls .restart-btn {
    background: linear-gradient(135deg, var(--pastel-lavender), #CE93D8);
    color: #7B1FA2;
}

.puzzle-controls .restart-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(206, 147, 216, 0.5);
}

.puzzle-controls .control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Responsive - Puzzle */
@media (max-width: 768px) {
    .puzzle-info {
        gap: 20px;
        padding: 15px;
    }
    
    .puzzle-info .info-value {
        font-size: 1.3rem;
    }
    
    .puzzle-section {
        padding: 20px;
    }
    
    .question-emoji {
        font-size: 4rem;
    }
    
    .question-hint {
        font-size: 1.2rem;
    }
    
    .answer-slots .letter-piece,
    .letter-piece {
        width: 48px;
        height: 48px;
        font-size: 1.5rem;
    }
    
    .answer-slot.empty {
        width: 50px;
        height: 50px;
    }
    
    .puzzle-controls {
        gap: 10px;
    }
    
    .puzzle-controls .control-btn {
        padding: 10px 18px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .puzzle-info {
        flex-direction: row;
        gap: 15px;
    }
    
    .puzzle-info .info-icon {
        font-size: 1.2rem;
    }
    
    .puzzle-info .info-value {
        font-size: 1.1rem;
    }
    
    .puzzle-board {
        padding: 15px;
    }
    
    .answer-slots {
        gap: 8px;
        padding: 10px;
    }
    
    .answer-slots .letter-piece {
        width: 42px;
        height: 42px;
        font-size: 1.3rem;
    }
    
    .answer-slot.empty {
        width: 45px;
        height: 45px;
    }
    
    .letter-pieces {
        gap: 8px;
        padding: 10px;
    }
    
    .letter-piece {
        width: 42px;
        height: 42px;
        font-size: 1.3rem;
    }
    
    .puzzle-controls .control-btn {
        padding: 10px 14px;
        font-size: 0.85rem;
    }
    
    .puzzle-controls .control-btn span {
        display: none;
    }
}

/* ========================================
   Phonics Page Styles
======================================== */

/* Sound Control */
.sound-control {
    text-align: center;
    margin-bottom: 30px;
}

.sound-btn {
    font-family: 'Jua', sans-serif;
    font-size: 1.3rem;
    padding: 18px 40px;
    border: 3px solid var(--pastel-blue);
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--pastel-blue) 0%, var(--secondary) 100%);
    color: white;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-soft);
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.sound-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: var(--shadow-hover);
}

.sound-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.sound-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.sound-btn.playing {
    animation: sound-pulse 1s ease-in-out infinite;
}

@keyframes sound-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.sound-icon {
    font-size: 1.5rem;
    display: inline-block;
}

.sound-text {
    font-weight: bold;
}

.sound-hint {
    font-family: 'Gowun Dodum', sans-serif;
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: 10px;
}

.hint-text {
    display: inline-block;
    padding: 8px 16px;
    background: var(--pastel-yellow);
    border-radius: var(--radius-sm);
}

/* Phonics Question */
.phonics-question {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 3px solid var(--pastel-pink);
}

.question-emoji {
    font-size: 120px;
    line-height: 1;
    display: inline-block;
    margin-bottom: 15px;
    animation: float-gentle 3s ease-in-out infinite;
}

.question-text {
    font-family: 'Jua', sans-serif;
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-top: 15px;
}

/* Quiz Feedback */
.quiz-feedback {
    text-align: center;
    padding: 15px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-family: 'Jua', sans-serif;
    font-size: 1.1rem;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.quiz-feedback.correct {
    background: var(--pastel-mint);
    color: #2E7D32;
    border: 2px solid #4CAF50;
    animation: feedback-pop 0.3s ease-out;
}

.quiz-feedback.wrong {
    background: #FFEBEE;
    color: #C62828;
    border: 2px solid #F44336;
    animation: feedback-shake 0.5s ease-out;
}

@keyframes feedback-pop {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes feedback-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* Answer Button Selected State */
.answer-btn.selected {
    background: var(--pastel-yellow);
    border-color: var(--primary);
    transform: scale(1.05);
    box-shadow: var(--shadow-hover);
}

.answer-btn.selected::before {
    content: '✓';
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 1.2rem;
    color: var(--primary);
}

/* Responsive - Phonics Page */
@media (max-width: 768px) {
    .sound-btn {
        font-size: 1.1rem;
        padding: 15px 30px;
    }
    
    .question-emoji {
        font-size: 80px;
    }
    
    .question-text {
        font-size: 1.1rem;
    }
    
    .phonics-question {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .sound-btn {
        font-size: 1rem;
        padding: 12px 24px;
        flex-direction: column;
        gap: 8px;
    }
    
    .sound-icon {
        font-size: 1.3rem;
    }
    
    .question-emoji {
        font-size: 60px;
    }
    
    .question-text {
        font-size: 1rem;
    }
    
    .quiz-feedback {
        font-size: 0.95rem;
        padding: 12px 16px;
    }
}
