:root {
    --bg-color: #7A5A6A;
    --btn-color: #B48E8E;
    --text-color: #F9F7F4;
    --btn-hover: #c49d9d;
    --card-bg: rgba(122, 90, 106, 0.85); /* Darker plum with opacity */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Fredoka', sans-serif;
}

body {
    background-color: var(--bg-color);
    background-image: url('assets/bg.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

.screen {
    display: none;
    width: 100%;
    min-height: 100vh;
    padding: 2rem;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.screen.active {
    display: flex;
    animation: fadeIn 0.5s forwards;
}

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

.welcome-container {
    background: var(--card-bg);
    padding: 3rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border: 3px solid var(--btn-color);
    backdrop-filter: blur(5px);
    animation: bounceIn 1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bounceIn {
    0% { transform: scale(0.1); opacity: 0; }
    60% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

p {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

input {
    width: 100%;
    padding: 1rem;
    font-size: 1.2rem;
    border: 2px solid var(--btn-color);
    border-radius: 10px;
    margin-bottom: 1.5rem;
    background: rgba(249, 247, 244, 0.9);
    color: #333;
    outline: none;
    text-align: center;
}

input:focus {
    border-color: #fff;
    box-shadow: 0 0 10px rgba(255,255,255,0.5);
}

button {
    background-color: var(--btn-color);
    color: var(--text-color);
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

button:hover {
    background-color: var(--btn-hover);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

button:active {
    transform: translateY(2px);
}

/* Lesson Screen */
#lesson-screen {
    justify-content: flex-start;
}

#greeting-title {
    margin-top: 2rem;
    font-size: 3.5rem;
    text-align: center;
    animation: slideDown 0.8s ease-out;
}

.lesson-topic {
    font-size: 1.8rem;
    margin-bottom: 3rem;
    background: var(--btn-color);
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    animation: slideDown 1s ease-out;
}

@keyframes slideDown {
    0% { transform: translateY(-50px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    width: 100%;
    max-width: 1000px;
}

.card {
    background: var(--card-bg);
    border: 3px solid var(--btn-color);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    transition: transform 0.3s, box-shadow 0.3s;
    backdrop-filter: blur(5px);
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 0.6s forwards;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.3);
}

@keyframes fadeUp {
    to { opacity: 1; transform: translateY(0); }
}

.sv-text {
    font-size: 2.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.en-text {
    font-size: 1.2rem;
    color: #e0d8d8;
    margin-bottom: 1.5rem;
    font-style: italic;
}

.play-btn {
    background: var(--btn-color);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    font-size: 1.5rem;
    padding: 0;
}

.play-btn:hover {
    transform: scale(1.1);
}

/* Delay card animations */
.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }
.card:nth-child(5) { animation-delay: 0.5s; }
.card:nth-child(6) { animation-delay: 0.6s; }
.card:nth-child(7) { animation-delay: 0.7s; }
.card:nth-child(8) { animation-delay: 0.8s; }

/* Responsive */
@media (max-width: 600px) {
    h1 { font-size: 2.5rem; }
    #greeting-title { font-size: 2.5rem; }
    .lesson-topic { font-size: 1.3rem; }
    .sv-text { font-size: 1.8rem; }
}
