:root {
    --bg-color: #7A5A6A;
    --btn-color: #B48E8E;
    --btn-hover: #c9a3a3;
    --text-color: #F9F7F4;
    --card-bg: rgba(249, 247, 244, 0.1);
}

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

body {
    background-color: var(--bg-color);
    background-image: url('assets/bg.png?v=2');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
}

#app {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    position: relative;
    padding: 20px;
}

#start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    max-width: none;
    background-image: url('assets/New 2.png?v=2');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-blend-mode: overlay;
    background-color: rgba(122, 90, 106, 0.85); /* Plum color with opacity to make text readable */
    z-index: 10;
}

.screen {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 800px;
    animation: fadeIn 0.5s ease-out forwards;
}

.screen.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes float {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

.character-container {
    font-size: 100px;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

h1 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
    width: 100%;
    max-width: 300px;
}

.input-group label {
    font-size: 1.2rem;
    margin-bottom: 10px;
    font-weight: bold;
}

#name-input {
    width: 100%;
    padding: 15px;
    border-radius: 20px;
    border: none;
    font-size: 1.2rem;
    text-align: center;
    background: var(--text-color);
    color: var(--bg-color);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    outline: none;
    transition: transform 0.2s;
}

#name-input:focus {
    transform: scale(1.05);
}

.fun-btn {
    background-color: var(--btn-color);
    color: var(--text-color);
    border: none;
    padding: 15px 40px;
    font-size: 1.5rem;
    font-weight: 900;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 6px 0px rgba(0,0,0,0.2), 0 10px 20px rgba(0,0,0,0.2);
    transition: all 0.1s;
}

.fun-btn:hover {
    background-color: var(--btn-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 0px rgba(0,0,0,0.2), 0 15px 25px rgba(0,0,0,0.3);
}

.fun-btn:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0px rgba(0,0,0,0.2), 0 5px 10px rgba(0,0,0,0.2);
}

#welcome-screen h2 {
    font-size: 4rem;
    text-align: center;
    text-shadow: 0 0 20px rgba(255,255,255,0.5);
    animation: welcomePop 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes welcomePop {
    0% { opacity: 0; transform: scale(0.5); }
    50% { opacity: 1; transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}

/* Lesson Screen */
#lesson-screen {
    justify-content: flex-start;
    padding: 40px 20px;
    max-width: 1000px;
}

.lesson-welcome {
    font-size: 3.5rem;
    font-weight: 900;
    text-shadow: 2px 2px 5px rgba(0,0,0,0.5), 0 0 20px rgba(0,0,0,0.3);
    margin-bottom: 20px;
    letter-spacing: 1px;
}

.controls-container {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.lesson-pill {
    background-color: rgba(180, 142, 142, 0.7); /* Dusty Rose translucent */
    backdrop-filter: blur(5px);
    padding: 10px 25px;
    border-radius: 30px;
    font-weight: bold;
    font-size: 1.2rem;
    border: 1px solid rgba(255,255,255,0.2);
}

.speed-select {
    background-color: rgba(180, 142, 142, 0.7);
    backdrop-filter: blur(5px);
    color: var(--text-color);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: bold;
    outline: none;
    cursor: pointer;
}

.speed-select option {
    background-color: var(--bg-color);
    color: var(--text-color);
}

.lesson-container {
    width: 100%;
    margin-top: 20px;
}

.word-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    width: 100%;
}

.word-card {
    background: rgba(122, 90, 106, 0.7); /* Plum translucent */
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
}

.word-card:hover {
    transform: translateY(-5px);
    background: rgba(122, 90, 106, 0.85);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 15px 25px rgba(0,0,0,0.25);
}

.word-card:active {
    transform: translateY(2px) scale(0.98);
}

.word-sv {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 10px;
    color: var(--text-color);
}

.word-en {
    font-size: 1.3rem;
    opacity: 0.9;
    font-style: italic;
    color: #e6e0d4;
}

.play-btn {
    margin-top: 20px;
    width: 50px;
    height: 50px;
    background-color: rgba(180, 142, 142, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s;
    border: 1px solid rgba(255,255,255,0.1);
}

.word-card:hover .play-btn {
    transform: scale(1.1);
    background-color: var(--btn-color);
}

/* Pulse animation when playing */
@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(180, 142, 142, 0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 15px rgba(180, 142, 142, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(180, 142, 142, 0); }
}

.playing {
    animation: pulse 1s infinite;
    background: rgba(180, 142, 142, 0.3);
    border-color: var(--btn-color);
}
