:root {
    --primary-color: #ff9a9e;
    --secondary-color: #fecfef;
    --text-color: #333;
    --bg-gradient: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
    --card-bg: rgba(255, 255, 255, 0.85);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Jua', sans-serif;
}

body {
    background: var(--bg-gradient);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-color);
    padding: 20px;
}

.app-container {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 30px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.5);
    width: 100%;
    max-width: 500px;
    text-align: center;
}

header h1 {
    font-size: 2.8rem;
    color: #4a4a4a;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.8);
}

header p {
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 25px;
}

.category-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.cat-btn {
    padding: 10px 15px;
    border: none;
    border-radius: 20px;
    background: white;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    color: #555;
    font-family: 'Jua', sans-serif;
}

.cat-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.cat-btn.active {
    background: #ff758c;
    color: white;
    box-shadow: 0 4px 15px rgba(255, 117, 140, 0.4);
}

.flashcard-container {
    perspective: 1000px;
    margin-bottom: 30px;
}

.flashcard {
    width: 100%;
    height: 320px;
    cursor: pointer;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
}

.flashcard.is-flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    background: var(--card-bg);
    border-radius: 25px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 3px solid rgba(255, 255, 255, 0.9);
}

.card-back {
    transform: rotateY(180deg);
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
    color: white;
    border: 3px solid rgba(255, 255, 255, 0.4);
}

.emoji {
    font-size: 6rem;
    margin-bottom: 15px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.15));
}

.english-word {
    font-size: 4rem;
    color: #333;
    letter-spacing: 2px;
}

.korean-word {
    font-size: 4.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.speak-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: #4facfe;
    color: white;
    border: none;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    font-size: 1.6rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(79, 172, 254, 0.4);
    transition: all 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.speak-btn:hover {
    transform: scale(1.15);
    background: #00f2fe;
}

.speak-btn:active {
    transform: scale(0.95);
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.6);
    padding: 15px 20px;
    border-radius: 20px;
}

.nav-btn {
    background: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 15px;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    color: #555;
    transition: all 0.2s;
    font-family: 'Jua', sans-serif;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-btn:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.nav-btn:active {
    transform: translateY(1px);
}

.progress {
    font-size: 1.5rem;
    font-weight: bold;
    color: #444;
}

.instruction {
    font-size: 1.2rem;
    color: #444;
    animation: pulse 2s infinite;
    background: rgba(255, 255, 255, 0.6);
    padding: 10px;
    border-radius: 15px;
    display: inline-block;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}