:root {
    --primary-color: #FFB6C1;
    --secondary-color: #FFDAB9;
    --accent-color: #87CEFA;
    --text-color: #333333;
    --card-bg: #FFFFFF;
    --bg-color: #F0F8FF;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Jua', 'Nunito', sans-serif;
    background-color: var(--bg-color);
    background-image: radial-gradient(var(--secondary-color) 2px, transparent 2px);
    background-size: 30px 30px;
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    touch-action: manipulation;
}

.app-container {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 30px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    width: 90%;
    text-align: center;
    position: relative;
    overflow: hidden;
}

header h1 {
    color: #FF69B4;
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

header p {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 20px;
}

/* Flashcard Styles */
.flashcard-container {
    perspective: 1000px;
    width: 100%;
    height: 350px;
    margin: 0 auto 30px;
    cursor: pointer;
}

.flashcard {
    width: 100%;
    height: 100%;
    position: relative;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
}

.flashcard.is-flipped {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 25px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    border: 8px solid white;
}

.card-front {
    background: linear-gradient(135deg, #FFE4E1, #FFB6C1);
}

.card-back {
    background: linear-gradient(135deg, #E0FFFF, #87CEFA);
    transform: rotateY(180deg);
}

.emoji {
    font-size: 8rem;
    margin-bottom: 20px;
    filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.2));
    transition: transform 0.3s ease;
}

.flashcard:hover .emoji {
    transform: scale(1.1);
}

.word {
    font-family: 'Nunito', sans-serif;
    font-size: 3.5rem;
    font-weight: 700;
    color: #333;
    letter-spacing: 2px;
}

.word-ko {
    font-size: 4rem;
    font-weight: bold;
    color: #333;
}

.speak-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 2rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.speak-btn:hover {
    transform: scale(1.1);
    background: #FFF0F5;
}

.speak-btn:active {
    transform: scale(0.95);
}

/* Controls */
.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    background: white;
    padding: 15px;
    border-radius: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.nav-btn {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 1.5rem;
    border-radius: 15px;
    cursor: pointer;
    font-family: 'Jua', sans-serif;
    transition: all 0.2s;
    box-shadow: 0 4px 0 #5CABDE;
}

.nav-btn:hover {
    background-color: #76BDE9;
    transform: translateY(-2px);
}

.nav-btn:active {
    transform: translateY(2px);
    box-shadow: 0 0 0 #5CABDE;
}

.nav-btn:disabled {
    background-color: #ccc;
    box-shadow: 0 4px 0 #999;
    cursor: not-allowed;
    transform: none;
}

.progress {
    font-size: 1.5rem;
    font-weight: bold;
    color: #666;
    background: #f0f0f0;
    padding: 8px 20px;
    border-radius: 15px;
}

/* Celebration Animation */
.celebration {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    font-size: 3rem;
    color: #FF69B4;
    font-weight: bold;
    z-index: 100;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}

.celebration.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

/* Responsive */
@media (max-width: 480px) {
    header h1 { font-size: 2rem; }
    .flashcard-container { height: 300px; }
    .emoji { font-size: 6rem; }
    .word { font-size: 2.5rem; }
    .word-ko { font-size: 3rem; }
    .nav-btn { padding: 10px 15px; font-size: 1.2rem; }
}
