:root {
    --primary: #FF9F1C;
    --secondary: #2EC4B6;
    --accent: #E71D36;
    --light: #FDFFFC;
    --dark: #011627;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Comic Neue', cursive;
}

body {
    background-color: var(--light);
    color: var(--dark);
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    min-height: 100vh;
}

header {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
}

.stars {
    position: fixed;
    bottom: 35px;
    right: 10px;
    color: var(--primary);
    font-size: 1.5rem;
}

.stars .fas:not(.filled) {
    opacity: 0.3;
}

h1 {
    color: var(--accent);
    margin: 15px 0;
    font-size: 2.2rem;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.1);
}

.tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    gap: 5px;
}

.tab-btn {
    padding: 10px 15px;
    border: none;
    background-color: var(--secondary);
    color: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.tab-btn.active {
    background-color: var(--primary);
    transform: scale(1.05);
}

.tab-btn i {
    font-size: 0.9rem;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Learn Tab Styles */
.mode-selector {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    gap: 10px;
}

.mode-btn {
    padding: 8px 20px;
    border: 2px solid var(--primary);
    background: white;
    color: var(--primary);
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

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

.card-display {
    perspective: 1000px;
    margin: 20px auto;
    width: 250px;
    height: 250px;
}

.card {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s;
    cursor: pointer;
}

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

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    background: white;
    padding: 20px;
}

.card-back {
    transform: rotateY(180deg);
    background: var(--secondary);
    color: white;
}

.big-char {
    font-size: 8rem;
    color: var(--primary);
    line-height: 1;
}

.char-word {
    font-size: 2rem;
    margin-bottom: 15px;
    text-align: center;
}

.char-image {
    font-size: 4rem;
}

.navigation {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.nav-btn, .flip-btn {
    padding: 10px 15px;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s;
}

.nav-btn {
    background: var(--light);
    border: 2px solid var(--primary);
    color: var(--primary);
}

.flip-btn {
    background: var(--primary);
    color: white;
    border-radius: 20px;
    width: auto;
    padding: 10px 20px;
}

.char-selector {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 20px auto;
    max-width: 400px;
}

.char-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    background: var(--secondary);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.char-btn.active {
    background: var(--primary);
    transform: scale(1.1);
}

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

.action-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.speak-btn {
    background: var(--accent);
    color: white;
}

.trace-btn {
    background: var(--dark);
    color: white;
}

/* Practice Tab Styles */
.tracing-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

#tracing-canvas {
    border: 3px dashed var(--primary);
    border-radius: 10px;
    background: white;
    touch-action: none;
}

.tracing-controls {
    display: flex;
    gap: 15px;
}

.tracing-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    background: var(--secondary);
    color: white;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Quiz Tab Styles */
.quiz-container {
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.quiz-question {
    font-size: 1.5rem;
    margin-bottom: 20px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quiz-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.quiz-option {
    padding: 15px;
    border: 2px solid var(--secondary);
    border-radius: 10px;
    background: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
}

.quiz-option:hover {
    background: var(--secondary);
    color: white;
}

.quiz-feedback {
    min-height: 40px;
    font-size: 1.2rem;
    margin: 10px 0;
}

.quiz-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    background: var(--primary);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
}

.quiz-btn:hover {
    transform: scale(1.05);
}

/* Confetti */
.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: var(--primary);
    opacity: 0;
    animation: confetti-fall 3s ease-in-out forwards;
}

.feedback-message {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    border-radius: 20px;
    color: white;
    font-weight: bold;
    z-index: 1000;
    animation: fadeInOut 3s ease-in-out;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

@keyframes fadeInOut {
    0% { opacity: 0; bottom: 0; }
    10% { opacity: 1; bottom: 20px; }
    90% { opacity: 1; bottom: 20px; }
    100% { opacity: 0; bottom: 40px; }
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Responsive Design */
@media (max-width: 600px) {
    .card-display {
        width: 200px;
        height: 200px;
    }
    
    .big-char {
        font-size: 6rem;
    }
    
    .char-word {
        font-size: 1.5rem;
    }
    
    .char-image {
        font-size: 3rem;
    }
    
    .quiz-options {
        grid-template-columns: 1fr;
    }
}