:root {
    --primary-color: #21618C;
    --secondary-color: #2E86C1;
    --accent-color: #F1C40F;
    --text-color: #2C3E50;
    --bg-color: #ECF0F1;
    --success-color: #27AE60;
    --error-color: #C0392B;
    --white: #FFFFFF;
    --font-main: 'Comic Neue', cursive, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(46, 134, 193, 0.1) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(241, 196, 15, 0.1) 0%, transparent 20%);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
    padding: 1rem;
}

/* Language Switcher */
.language-switcher {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
    z-index: 100;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-family: var(--font-main);
    font-weight: bold;
    transition: all 0.2s;
    backdrop-filter: blur(5px);
}

.lang-btn.active,
.lang-btn:hover {
    background: var(--primary-color);
    color: var(--white);
}

/* Game Container */
.game-container {
    width: 100%;
    max-width: 800px;
    margin-top: 4rem;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 600px;
}

/* Game Card */
.game-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1), 0 5px 15px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 700px;
    padding: 2rem;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Mascots */
.mascots-container {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 1rem;
    position: relative;
    z-index: 20;
}

.mascot-wrapper {
    width: 120px;
    height: 160px;
    pointer-events: auto;
    transition: transform 0.3s;
    animation: float 3s ease-in-out infinite;
}

.mascot-wrapper:nth-child(2) {
    animation-delay: 1.5s;
}

.mascot-wrapper:hover {
    transform: scale(1.05);
}

.mascot {
    width: 100%;
    height: 100%;
    overflow: visible;
}

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

/* Speech Bubbles */
.speech-bubble {
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
}

.mascot-wrapper .speech-bubble {
    z-index: 25;
}

/* Screens */
.screen {
    width: 100%;
    text-align: center;
    z-index: 10;
    position: relative;
    transition: opacity 0.3s ease-in-out;
    padding: 1rem 0;
}

.screen.hidden {
    display: none !important;
    opacity: 0 !important;
}

.screen.active {
    display: block;
    opacity: 1;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Typography */
.game-title {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.1);
}

.intro-text {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Buttons */
.primary-button {
    background: linear-gradient(135deg, var(--accent-color), #f39c12);
    color: var(--text-color);
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    font-family: var(--font-main);
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(241, 196, 15, 0.3);
    transition: transform 0.1s, box-shadow 0.1s;
}

.primary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(241, 196, 15, 0.4);
}

.primary-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 5px rgba(241, 196, 15, 0.2);
}

/* Stats Bar */
.stats-bar {
    display: flex;
    justify-content: space-around;
    margin-bottom: 2rem;
    background: rgba(236, 240, 241, 0.5);
    padding: 0.8rem;
    border-radius: 15px;
    border: 1px solid rgba(0,0,0,0.05);
}

.stat-item {
    font-size: 1.2rem;
    font-weight: bold;
}

.stat-item .label {
    color: var(--secondary-color);
}

/* Game Area */
.level-display {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.question {
    font-size: 3.5rem;
    font-weight: bold;
    margin-bottom: 2rem;
    color: var(--primary-color);
    text-shadow: 2px 2px 0px rgba(0,0,0,0.1);
}

.input-area {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

#answer-input {
    font-size: 2.5rem;
    padding: 0.5rem;
    width: 140px;
    text-align: center;
    border: 3px solid var(--secondary-color);
    border-radius: 15px;
    font-family: var(--font-main);
    background: rgba(255, 255, 255, 0.9);
}

#answer-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(46, 134, 193, 0.2);
}

/* Messages */
.message {
    min-height: 2.5rem;
    font-size: 1.4rem;
    font-weight: bold;
}

.message.success {
    color: var(--success-color);
    animation: bounce 0.5s;
}

.message.error {
    color: var(--error-color);
    animation: shake 0.4s;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-10px);}
    60% {transform: translateY(-5px);}
}

@keyframes shake {
    0%, 100% {transform: translateX(0);}
    25% {transform: translateX(-5px);}
    75% {transform: translateX(5px);}
}

/* Responsive - iPhone 7 and similar */
@media (max-width: 450px) {
    .game-container {
        margin-top: 4rem;
        padding: 0.5rem;
    }

    .game-card {
        padding: 1.5rem 1rem;
        border-radius: 20px;
    }

    .mascots-container {
        margin-bottom: 0.5rem;
    }

    .mascot-wrapper {
        width: 90px;
        height: 120px;
    }

    .game-title {
        font-size: 1.8rem;
    }

    .question {
        font-size: 2.5rem;
    }

    .intro-text {
        font-size: 1.1rem;
    }

    .primary-button {
        font-size: 1.2rem;
        padding: 0.8rem 1.5rem;
    }

    .stats-bar {
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: center;
    }
    
    .stat-item {
        font-size: 1rem;
        margin: 0 0.5rem;
    }

    .language-switcher {
        width: 100%;
        justify-content: center;
        top: 0.5rem;
        right: 0;
        flex-wrap: wrap;
    }
    
    .lang-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.9rem;
    }
}