:root {
    --bg-color: #f0f4f8;
    --text-color: #4a4a4a;
    --primary-yellow: #FFD93D;
    --secondary-coral: #FF6B6B;
    --accent-blue: #4D96FF;
    --success-green: #6BCB77;

    --shadow-light: inset -10px -10px 20px rgba(255, 255, 255, 0.5), inset 10px 10px 20px rgba(70, 70, 70, 0.12), 10px 20px 30px rgba(70, 70, 70, 0.1);
    --shadow-pressed: inset 6px 6px 10px rgba(70, 70, 70, 0.15), inset -6px -6px 10px rgba(255, 255, 255, 0.8);
    --card-radius: 30px;
    --btn-radius: 50px;
}

body {
    background-color: var(--bg-color);
    font-family: 'Nunito', sans-serif;
    color: var(--text-color);
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

.app-container {
    width: 100%;
    max-width: 700px;
    /* Slightly increased default */
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* --- Headers --- */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    gap: 15px;
    flex-wrap: wrap;
}

.logo {
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    font-size: 2rem;
    color: var(--text-color);
    margin: 0;
}

.dot {
    color: var(--secondary-coral);
}

.score-container {
    background-color: #e6eef5;
    padding: 10px 25px;
    border-radius: var(--btn-radius);
    box-shadow: var(--shadow-light);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.score-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
    font-weight: 700;
}

.score-value {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--accent-blue);
    line-height: 1;
}

/* --- Difficulty Selector --- */
.difficulty-selector {
    display: flex;
    gap: 8px;
    background-color: rgba(255, 255, 255, 0.5);
    padding: 6px;
    border-radius: var(--btn-radius);
    box-shadow: var(--shadow-light);
    position: relative;
    z-index: 10;
}

.diff-btn {
    appearance: none;
    border: none;
    background-color: transparent;
    padding: 10px 15px;
    border-radius: 25px;
    font-family: 'Nunito', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 6px;
    outline: none;
    opacity: 0.6;
}

.diff-btn.active {
    background-color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    opacity: 1;
    transform: scale(1.05);
}

.diff-btn:hover:not(.active) {
    opacity: 0.8;
    transform: translateY(-2px);
}

.diff-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.diff-label {
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

/* --- Game Board & Cards --- */
.game-board {
    display: flex;
    flex-direction: column;
    gap: 40px;
    align-items: center;
}

.question-card {
    background-color: var(--accent-blue);
    width: 100%;
    padding: 60px 20px;
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-light);
    text-align: center;
    color: white;
    position: relative;
    border: 4px solid rgba(255, 255, 255, 0.2);
}

.floating {
    animation: float 6s ease-in-out infinite;
}

.card-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lang-label {
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.9rem;
    opacity: 0.8;
    font-weight: 700;
}

#question-word {
    font-family: 'Poppins', sans-serif;
    font-size: 3rem;
    margin: 0;
    font-weight: 800;
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.1);
}

/* --- Options Grid --- */
.options-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.option-btn {
    appearance: none;
    border: none;
    background-color: #f0f4f8;
    padding: 20px;
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-light);
    font-family: 'Nunito', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    outline: none;
}

.option-btn:active {
    box-shadow: var(--shadow-pressed);
    transform: scale(0.98);
}

.option-btn.correct {
    background-color: var(--success-green);
    color: white;
    box-shadow: inset -5px -5px 10px rgba(0, 0, 0, 0.1), inset 5px 5px 10px rgba(255, 255, 255, 0.2);
    animation: pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.option-btn.wrong {
    background-color: var(--secondary-coral);
    color: white;
    box-shadow: inset -5px -5px 10px rgba(0, 0, 0, 0.1), inset 5px 5px 10px rgba(255, 255, 255, 0.2);
    animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

/* --- Input Area (Index 2) --- */
.input-area {
    display: flex;
    flex-direction: column;
    gap: 30px;
    width: 100%;
}

.answer-input {
    width: 100%;
    padding: 30px;
    border: none;
    border-radius: 50px;
    background-color: white;
    box-shadow: var(--shadow-pressed);
    font-family: 'Nunito', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
    text-align: center;
    outline: none;
    box-sizing: border-box;
    transition: box-shadow 0.3s ease;
}

.answer-input::placeholder {
    color: #ccc;
    font-weight: 400;
}

.answer-input:focus {
    box-shadow: inset 4px 4px 8px rgba(70, 70, 70, 0.1), inset -4px -4px 8px rgba(255, 255, 255, 1);
}

.submit-btn {
    appearance: none;
    border: none;
    background-color: var(--accent-blue);
    padding: 25px;
    border-radius: 50px;
    box-shadow: var(--shadow-light);
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    width: 100%;
}

.submit-btn:hover {
    transform: translateY(-4px);
    opacity: 0.95;
    box-shadow: 0 10px 20px rgba(77, 150, 255, 0.3);
}

.submit-btn:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-pressed);
}

/* --- Dictionary (Index 3) --- */
.app-container-dict {
    max-width: 900px;
    height: 100vh;
    overflow: hidden;
    padding: 0;
}

.app-container-dict .game-header {
    padding: 20px;
    flex-shrink: 0;
}

.dictionary-container {
    padding: 0 20px;
    overflow-y: auto;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.dictionary-header-row {
    display: grid;
    grid-template-columns: 1fr 1fr 0.8fr;
    padding: 15px;
    font-weight: 800;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.05);
    margin-bottom: 10px;
    position: sticky;
    top: 0;
    background-color: var(--bg-color);
    z-index: 5;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.dictionary-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.theme-separator {
    padding: 24px 10px 8px;
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--secondary-coral);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-bottom: 2px dashed rgba(0, 0, 0, 0.1);
}

.dict-row {
    display: grid;
    grid-template-columns: 1fr 1fr 0.8fr;
    align-items: center;
    padding: 15px;
    border-radius: 15px;
    background-color: rgba(255, 255, 255, 0.6);
    transition: transform 0.2s ease;
}

.dict-row:hover {
    transform: scale(1.005);
    background-color: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.dict-cz {
    font-weight: 800;
    color: var(--text-color);
    font-size: 1.1rem;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    padding-right: 10px;
}

.dict-en {
    font-weight: 800;
    color: var(--accent-blue);
    font-size: 1.1rem;
    padding-left: 10px;
    cursor: pointer;
    transition: filter 0.3s ease;
}

.dict-cat {
    text-align: right;
    font-size: 0.8rem;
    color: #888;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Blur Effect */
.blurred {
    filter: blur(8px);
    user-select: none;
}

/* Fixed Footer Toggle */
.fixed-footer {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    z-index: 100;
    background: transparent;
    pointer-events: none;
}

.fixed-footer .action-btn {
    pointer-events: auto;
    appearance: none;
    border: none;
    background-color: var(--text-color);
    padding: 15px 30px;
    border-radius: 50px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    gap: 10px;
    align-items: center;
    white-space: nowrap;
}

.fixed-footer .action-btn:hover {
    background-color: black;
    transform: translateY(-5px);
}

.fixed-footer .action-btn:active {
    transform: scale(0.98);
}

.btn-icon {
    font-size: 1.4rem;
}

/* Feedback */
.feedback {
    min-height: 24px;
    font-weight: 700;
    color: var(--success-green);
    margin-top: -20px;
    opacity: 0;
    transition: opacity 0.3s;
}

.feedback.visible {
    opacity: 1;
}

/* Animations */
@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-15px);
    }

    100% {
        transform: translateY(0px);
    }
}

@keyframes pop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

.pulse-anim {
    animation: pulse 0.3s ease-in-out;
}

/* Media Queries */
@media (max-width: 600px) {
    .diff-label {
        display: none;
    }

    .diff-btn {
        padding: 10px;
    }

    .difficulty-selector {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .app-container-dict {
        padding: 0;
    }

    .dictionary-container {
        padding: 0 10px;
    }

    /* Enforce 3 columns on mobile too for dictionary */
    .dictionary-header-row,
    .dict-row {
        grid-template-columns: 1fr 1fr 0.6fr;
        font-size: 0.9rem;
        padding: 12px 5px;
        gap: 5px;
    }

    .dict-cz,
    .dict-en {
        font-size: 0.95rem;
    }

    .dict-cat {
        font-size: 0.65rem;
        letter-spacing: 0;
    }

    .fixed-footer {
        bottom: 20px;
    }
}

/* Sponge/Splash Screen Styles */
.splash-container {
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    max-width: 1100px;
    /* Increased for 3-column layout */
}

.splash-header {
    text-align: center;
    margin-bottom: 20px;
}

.big-logo {
    font-size: 3.5rem;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 1.1rem;
    color: #888;
    margin: 0;
    font-weight: 600;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    width: 100%;
    max-width: 1000px;
}

.menu-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    border-radius: var(--card-radius);
    text-decoration: none;
    color: white;
    box-shadow: var(--shadow-light);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.menu-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.15);
}

.menu-card .icon {
    font-size: 3.5rem;
    margin-bottom: 15px;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
}

.menu-card .label {
    font-family: 'Poppins', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 5px;
}

.menu-card .desc {
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    opacity: 0.9;
}

/* Card Variants */
.card-purple {
    background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
    /* Fallback or nice gradient */
    background-color: #9b59b6;
}

.card-blue {
    background: linear-gradient(135deg, #4D96FF 0%, #6bc5ff 100%);
    background-color: var(--accent-blue);
}

.card-yellow {
    background: linear-gradient(135deg, #FFD93D 0%, #ffed99 100%);
    /* Yellow text needs to be dark usually, but white text on strong yellow works with shadow.
       Let's adjust text color for yellow card if needed. */
    color: #5d4037;
}

.card-yellow .icon {
    text-shadow: none;
}

.splash-footer {
    margin-top: 40px;
    color: #aaa;
    font-size: 0.9rem;
}

/* Mobile responsive splash */
@media (max-width: 768px) {
    .big-logo {
        font-size: 2.8rem;
    }

    .menu-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .big-logo {
        font-size: 2.2rem;
    }

    .menu-grid {
        grid-template-columns: 1fr;
    }
}


/* Logo Link */
.logo a {
    text-decoration: none;
    color: var(--text-color);
    cursor: pointer;
    transition: opacity 0.2s;
}

.logo a:visited {
    color: var(--text-color);
}

/* Green Card for Index 4 */
.card-green {
    background: linear-gradient(135deg, #6BCB77 0%, #a2d9a6 100%);
    background-color: var(--success-green);
}



/* Red Card for Index 5 */
.card-red {
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
    background-color: var(--secondary-coral);
    color: white;
}


/* Orange Card for Index 6 */
.card-orange {
    background: linear-gradient(135deg, #FF9966 0%, #FF5E62 100%);
    background-color: #FF7F50;
    color: white;
}


/* Teal Card for Index 7 */
.card-teal {
    background: linear-gradient(135deg, #20c997 0%, #087f5b 100%);
    background-color: #20c997;
    color: white;
}


/* Indigo Card for Index 8 */
.card-indigo {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-color: #667eea;
    color: white;
}


/* Total Score Display on Main Page */
.total-score-display {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    pointer-events: none;
    user-select: none;
    transition: transform 0.3s ease;
}

.total-score-display:hover {
    transform: scale(1.05);
}

.total-score-display .score-icon {
    font-size: 1.5rem;
    animation: pulse-trophy 2s ease-in-out infinite;
}

.total-score-display .score-number {
    font-weight: 800;
    font-size: 1.3rem;
    color: #FFD700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

@keyframes pulse-trophy {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }
}

/* Pink Card for Index 9 */
.card-pink {
    background: linear-gradient(135deg, #f06292 0%, #f8bbd0 100%);
    background-color: #f06292;
    color: white;
}

/* Coral Card for Word Rain */
.card-coral {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    background-color: #fa709a;
    color: white;
}

/* Audio Button */
.audio-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 1.2rem;
    color: white;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    margin-right: auto;
}

.audio-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.audio-btn:active {
    transform: scale(0.9);
}

/* Feedback Styles */
.correct-feedback {
    color: #2ecc71 !important;
}

.wrong-feedback {
    color: #e74c3c !important;
}