/* ===== Global Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: rgb(37, 32, 99);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
}

/* ===== Welcome Screen ===== */
.welcome-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    animation: fadeIn 0.5s ease-in;
}

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

/* Logo Container - Outside white box */
.logo-container {
    text-align: center;
    margin-bottom: 10px;
}

.logo-image {
    max-width: 450px;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 8px 20px rgba(0,0,0,0.3));
    transition: transform 0.3s ease;
}

.logo-image:hover {
    transform: scale(1.05);
}

/* White Box - Narrower */
.welcome-screen {
    background: white;
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    padding: 40px 30px;
    text-align: center;
    max-width: 450px;
    width: 100%;
}

.flags {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin: 30px 0;
}

.flag {
    width: 80px;
    height: 80px;
    cursor: pointer;
    border-radius: 50%;
    border: 4px solid transparent;
    transition: all 0.3s ease;
    object-fit: cover;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.flag:hover, .flag:active {
    transform: scale(1.1);
    border-color: #667eea;
    box-shadow: 0 6px 25px rgba(102,126,234,0.5);
}

.flag.selected {
    border-color: #4CAF50;
    box-shadow: 0 0 0 4px rgba(76,175,80,0.3);
}

#start-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 18px 60px;
    font-size: 24px;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    margin-top: 30px;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(102,126,234,0.4);
}

#start-btn:hover, #start-btn:active {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102,126,234,0.6);
}

/* ===== Change Language Button - Top Right ===== */
.change-lang-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border: none;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
}

.change-lang-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* ===== Back Button - Top Left ===== */
.back-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border: none;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* ===== Category/Game Grid ===== */
body > h1 {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 36px;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.3);
    z-index: 10;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    padding: 120px 40px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

/* ===== Category Grid ===== */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    padding: 100px 40px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.category-card {
    background: linear-gradient(135deg, var(--category-color, #667eea) 0%, rgba(255,255,255,0.1) 100%);
    border-radius: 25px;
    padding: 40px 30px;
    text-align: center;
    color: white;
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: block;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    pointer-events: none;
}

.category-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px rgba(0,0,0,0.4);
}

.category-icon {
    font-size: 64px;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.category-content {
    position: relative;
    z-index: 1;
}

.category-content h3 {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.category-content p {
    font-size: 16px;
    margin-bottom: 25px;
    opacity: 0.9;
    line-height: 1.5;
}

.category-explore {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 12px 25px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    margin-top: 10px;
}

.category-card:hover .category-explore {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.game-card {
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: #667eea;
    display: block;
}

.game-card:hover, .game-card:active {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

.game-card-title {
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
    margin: 15px 0 10px 0;
}

.game-card-mode {
    font-size: 14px;
    color: #999;
    margin-top: 10px;
}

.game-card-actions {
    margin-top: 15px;
}

.game-card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 15px;
    margin-bottom: 20px;
}

/* ===== Game Screen ===== */
.game-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

#game-image {
    width: 100%;
    max-width: 1000px;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.3);
    display: block;
    margin: 20px auto;
    cursor: crosshair;
}

.game-wrapper {
    position: relative;
    display: inline-block;
    margin: 80px auto 20px;
}

.hotspot {
    position: absolute;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 8px;
}

.hotspot:hover, .hotspot:active {
    border-color: rgba(255, 215, 0, 0.8);
    background: rgba(255, 215, 0, 0.2);
}

.hotspot.correct {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.3);
    animation: correctPulse 0.6s ease;
}

.hotspot.incorrect {
    border-color: #f44336;
    background: rgba(244, 67, 54, 0.3);
    animation: shake 0.5s ease;
}

@keyframes correctPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

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

/* ===== Question Display ===== */
.question-box {
    background: white;
    padding: 25px 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    text-align: center;
    margin: 20px auto;
    max-width: 600px;
    font-size: 28px;
    font-weight: bold;
    color: #333;
}

/* ===== Score Display ===== */
.score-display {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 20px 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
    z-index: 100;
}

/* ===== Feedback Messages ===== */
.feedback {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: white;
    padding: 40px 60px;
    border-radius: 25px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.4);
    font-size: 36px;
    font-weight: bold;
    z-index: 200;
    animation: popIn 0.5s ease forwards;
}

.feedback.correct {
    color: #4CAF50;
    border: 5px solid #4CAF50;
}

.feedback.incorrect {
    color: #f44336;
    border: 5px solid #f44336;
}

@keyframes popIn {
    0% { transform: translate(-50%, -50%) scale(0); }
    50% { transform: translate(-50%, -50%) scale(1.1); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

/* ===== Navigation Buttons ===== */
.nav-button {
    position: fixed;
    bottom: 30px;
    background: white;
    color: #667eea;
    border: 3px solid #667eea;
    padding: 15px 40px;
    font-size: 20px;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    z-index: 100;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    display: block;
    box-sizing: border-box;
}

.nav-button:hover, .nav-button:active {
    background: #667eea;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102,126,234,0.4);
}

.nav-button.back {
    left: 30px;
}

.nav-button.next {
    right: 30px;
}

/* ===== Admin Styles ===== */
.admin-container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 1400px;
    margin: 0 auto;
    box-shadow: 0 15px 50px rgba(0,0,0,0.3);
}

/* Global admin responsiveness */
@media (max-width: 900px) {
    .admin-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .games-list { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .admin-container { padding: 20px; }
    .admin-section { padding: 15px; }
    .logout-btn { width: 100%; text-align: center; }
    .btn { width: 100%; box-sizing: border-box; }
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.admin-header h1 {
    color: #333;
    font-size: 32px;
}

.logout-btn {
    background: #f44336;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: #d32f2f;
    transform: translateY(-2px);
}

.admin-section {
    margin: 30px 0;
    padding: 25px;
    background: #f5f5f5;
    border-radius: 15px;
}

.admin-section h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 24px;
}

.form-group {
    margin: 20px 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 14px 35px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
    margin: 10px 5px;
}

.btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102,126,234,0.4);
}

.btn-secondary {
    background: #757575;
}

.btn-secondary:hover {
    background: #616161;
}

.btn-success {
    background: #4CAF50;
}

.btn-success:hover {
    background: #45a049;
}

.btn-danger {
    background: #f44336;
}

.btn-danger:hover {
    background: #d32f2f;
}

/* ===== Game List ===== */
.games-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.game-item {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.game-item h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.game-item .actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* ===== Hotspot Editor ===== */
.editor-canvas {
    position: relative;
    display: inline-block;
    margin: 20px auto;
    border: 2px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
}

.editor-canvas img {
    display: block;
    max-width: 100%;
    height: auto;
}

.editor-hotspot {
    position: absolute;
    border: 3px dashed #667eea;
    background: rgba(102, 126, 234, 0.2);
    cursor: move;
}

.editor-hotspot .resize-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #667eea;
    border: 2px solid white;
    border-radius: 50%;
    right: -6px;
    bottom: -6px;
    cursor: nwse-resize;
}

.editor-hotspot .delete-handle {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 24px;
    height: 24px;
    background: #f44336;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
}

/* ===== Modal ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.modal-close {
    cursor: pointer;
    font-size: 30px;
    color: #999;
}

.modal-close:hover {
    color: #333;
}

/* ===== Login Form ===== */
.login-container {
    background: white;
    border-radius: 25px;
    padding: 50px 60px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    max-width: 450px;
    width: 100%;
}

.login-container h1 {
    color: #667eea;
    margin-bottom: 30px;
    text-align: center;
}

.login-container .error {
    background: #ffebee;
    color: #c62828;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.login-container input {
    width: 100%;
    padding: 15px;
    margin: 12px 0;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
}

.login-container input:focus {
    outline: none;
    border-color: #667eea;
}

.login-container button {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.3s ease;
}

.login-container button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102,126,234,0.4);
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .logo-image {
        max-width: 320px;
    }
    
    .welcome-screen {
        max-width: 380px;
        padding: 30px 20px;
    }
    
    .welcome-container {
        gap: 20px;
    }
    
    .change-lang-btn {
        top: 15px;
        right: 15px;
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .back-btn {
        top: 15px;
        left: 15px;
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
        padding: 100px 20px 20px;
    }
    
    .category-card {
        padding: 30px 20px;
    }
    
    .category-icon {
        font-size: 48px;
    }
    
    .category-content h3 {
        font-size: 24px;
    }
    
    .game-grid {
        grid-template-columns: 1fr;
        padding: 100px 20px 20px;
    }
    
    .flag {
        width: 60px;
        height: 60px;
    }
    
    body > h1 {
        font-size: 28px;
    }
    
    .question-box {
        font-size: 22px;
        padding: 20px 25px;
    }
    
    .nav-button {
        padding: 12px 25px;
        font-size: 16px;
    }
    
    .admin-container {
        padding: 20px;
    }
}

/* ===== Loading Spinner ===== */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== CONNECT GAME STYLES ===== */
.connect-game-container {
    width: 100%;
    max-width: 1200px;
    margin: 120px auto 60px;
    padding: 20px;
}

.connect-progress-bar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 110;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.progress-segment {
    width: 50px;
    height: 12px;
    background: #e0e0e0;
    border-radius: 10px;
    transition: all 0.3s ease;
    position: relative;
}

.progress-segment.active {
    background: #667eea;
    animation: pulse 1.5s ease-in-out infinite;
}

.progress-segment.completed {
    background: #4CAF50;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.connect-instruction-box {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 20px 40px;
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    font-size: 28px;
    font-weight: 600;
    color: #333;
    z-index: 100;
    text-align: center;
    min-width: 300px;
    animation: slideDown 0.5s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.connect-columns {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 100px;
    min-height: 600px;
    padding: 20px;
}

.connect-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
    justify-content: center;
}

.connect-column-left {
    align-items: flex-end;
}

.connect-column-right {
    align-items: flex-start;
}

.connect-item {
    width: 150px;
    height: 150px;
    background: white;
    border-radius: 20px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
}

.connect-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

.connect-item:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.connect-item.connect-active {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
    border: 3px solid #667eea;
}

.connect-item.connect-matched {
    opacity: 0.7;
    transform: scale(0.95);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    border: 3px solid #4CAF50;
    cursor: default;
}

.connect-item.connect-matched:hover {
    transform: scale(0.95);
}

.connect-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.connect-line-temp {
    stroke: #667eea;
    stroke-width: 4;
    stroke-linecap: round;
    opacity: 0.6;
    pointer-events: none;
}

.connect-line-matched {
    stroke: #4CAF50;
    stroke-width: 5;
    stroke-linecap: round;
    pointer-events: none;
    animation: lineAppear 0.5s ease;
}

@keyframes lineAppear {
    from {
        opacity: 0;
        stroke-dasharray: 1000;
        stroke-dashoffset: 1000;
    }
    to {
        opacity: 1;
        stroke-dasharray: 1000;
        stroke-dashoffset: 0;
    }
}

/* Connect game responsive design */
@media (max-width: 768px) {
    .connect-game-container {
        margin-top: 100px;
    }
    
    .connect-instruction-box {
        top: 60px;
        font-size: 20px;
        padding: 15px 25px;
        min-width: 250px;
    }
    
    .connect-columns {
        gap: 60px;
        padding: 10px;
    }
    
    .connect-item {
        width: 120px;
        height: 120px;
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .connect-columns {
        gap: 40px;
    }
    
    .connect-item {
        width: 100px;
        height: 100px;
        padding: 8px;
    }
    
    .connect-instruction-box {
        font-size: 18px;
        padding: 12px 20px;
    }
}

/* ===== VOCABULARY FLASHCARD STYLES ===== */
.vocabulary-container {
    width: 100%;
    max-width: 800px;
    margin: 80px auto 60px;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.vocabulary-card {
    background: white;
    border-radius: 30px;
    padding: 50px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    min-width: 500px;
    animation: fadeIn 0.5s ease;
}

.vocabulary-image-container {
    width: 350px;
    height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 20px;
    padding: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.vocabulary-image-container:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.vocabulary-image-container::after {
    content: '🔊';
    position: absolute;
    bottom: 15px;
    right: 15px;
    font-size: 32px;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.vocabulary-image-container:hover::after {
    opacity: 1;
}

.vocabulary-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

.vocabulary-text {
    font-size: 48px;
    font-weight: 700;
    color: #333;
    text-align: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    letter-spacing: 1px;
}

.vocabulary-nav {
    display: flex;
    align-items: center;
    gap: 40px;
    margin-top: 20px;
}

.vocab-nav-btn {
    padding: 15px 30px;
    font-size: 18px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    min-width: 140px;
    display: block;
    width: 100%;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.vocab-nav-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.vocab-nav-btn:active:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.5);
}

.vocab-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.vocab-progress {
    font-size: 24px;
    font-weight: 600;
    color: white;
    background: rgba(255, 255, 255, 0.2);
    padding: 12px 30px;
    border-radius: 25px;
    min-width: 120px;
    text-align: center;
}

/* Vocabulary responsive design */
@media (max-width: 768px) {
    .vocabulary-container {
        margin-top: 60px;
        padding: 20px 15px;
    }
    
    .vocabulary-card {
        padding: 30px;
        min-width: unset;
        width: 100%;
    }
    
    .vocabulary-image-container {
        width: 280px;
        height: 280px;
        padding: 20px;
    }
    
    .vocabulary-text {
        font-size: 36px;
    }
    
    .vocabulary-nav {
        gap: 20px;
        flex-wrap: wrap;
    }
    
    .vocab-nav-btn {
        padding: 12px 24px;
        font-size: 16px;
        min-width: 120px;
    }
    
    .vocab-progress {
        font-size: 20px;
        padding: 10px 24px;
    }
}

@media (max-width: 480px) {
    .vocabulary-card {
        padding: 20px;
    }
    
    .vocabulary-image-container {
        width: 220px;
        height: 220px;
        padding: 15px;
    }
    
    .vocabulary-text {
        font-size: 28px;
    }
    
    .vocab-nav-btn {
        padding: 10px 20px;
        font-size: 14px;
        min-width: 100px;
    }
    
    .vocab-progress {
        font-size: 18px;
        padding: 8px 20px;
    }
}

/* ===== FIND GRID GAME STYLES ===== */
.find-grid-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.find-grid-title {
    font-size: 32px;
    font-weight: bold;
    color: #333;
    margin-bottom: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.find-grid-question-box {
    background: #f8f9fa;
    padding: 25px 40px;
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    margin-bottom: 40px;
    font-size: 28px;
    font-weight: bold;
    color: #333;
    border: 3px solid #e9ecef;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.find-grid-animal-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 15px;
    max-width: 600px;
    margin: 0 auto 30px;
    padding: 20px;
    width: 100%;
    aspect-ratio: 1;
}

.find-grid-animal-tile {
    background: white;
    border: 3px solid #e9ecef;
    border-radius: 15px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    min-height: 120px;
    overflow: hidden;
}

.find-grid-animal-tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #667eea;
}

.find-grid-animal-tile.correct {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
    animation: correctPulse 0.6s ease;
}

.find-grid-animal-tile.incorrect {
    border-color: #f44336;
    background: rgba(244, 67, 54, 0.1);
    animation: shake 0.5s ease;
}

.find-grid-animal-image {
    width: 100%;
    height: 80px;
    object-fit: contain;
    object-position: center;
    flex-shrink: 0;
    border-radius: 8px;
}

.find-grid-animal-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-transform: capitalize;
    text-align: center;
    margin-top: 5px;
    flex-shrink: 0;
}

.find-grid-animal-placeholder {
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 8px;
    color: #666;
    font-size: 32px;
}

.find-grid-progress {
    font-size: 18px;
    font-weight: 600;
    color: #666;
    margin-bottom: 20px;
}

.find-grid-complete {
    text-align: center;
    padding: 40px;
}

.find-grid-complete h2 {
    font-size: 36px;
    color: #333;
    margin-bottom: 30px;
}

.find-grid-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    margin-bottom: 15px;
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.3);
}

.score-number {
    font-size: 36px;
    line-height: 1;
}

.score-total {
    font-size: 18px;
    opacity: 0.8;
}

.score-percentage {
    font-size: 24px;
    font-weight: bold;
    color: #4CAF50;
}

/* ===== PARTS GAME STYLES ===== */
.parts-game-wrapper {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.parts-game-wrapper img {
    display: block;
    max-width: 100%;
    height: auto;
}

.parts-highlight-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.parts-highlight-path,
.parts-highlight-rect {
    transition: opacity 0.5s ease;
    animation: parts-pulse 1.5s ease-in-out infinite;
    stroke: #00FFFF;
    filter: drop-shadow(0 0 8px #00FFFF) drop-shadow(0 0 12px rgba(0, 255, 255, 0.6));
}

@keyframes partPulse {
    0%, 100% {
        opacity: 1;
        stroke-width: 5;
        filter: drop-shadow(0 0 5px #00FFFF);
    }
    50% {
        opacity: 0.8;
        stroke-width: 7;
        filter: drop-shadow(0 0 10px #00FFFF);
    }
}

@keyframes parts-pulse {
    0%, 100% {
        opacity: 1;
        stroke-width: 5;
        filter: drop-shadow(0 0 8px #00FFFF);
    }
    50% {
        opacity: 0.85;
        stroke-width: 7;
        filter: drop-shadow(0 0 15px #00FFFF);
    }
}

.parts-hotspot {
    position: absolute;
    cursor: pointer;
    z-index: 5;
    transition: all 0.3s ease;
    border-radius: 5px;
}

.parts-hotspot:hover {
    background: rgba(33, 150, 243, 0.2);
    transform: scale(1.05);
}

.parts-instruction-box {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 20px 40px;
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    font-size: 26px;
    font-weight: 600;
    color: #333;
    z-index: 100;
    text-align: center;
    min-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.parts-stage-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 25px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 16px;
    color: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 110;
    transition: all 0.3s ease;
}

.parts-quiz-btn {
    margin-top: 15px;
    padding: 15px 35px;
    font-size: 20px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.3);
}

.parts-quiz-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 152, 0, 0.4);
}

/* Parts responsive design */
@media (max-width: 768px) {
    .parts-instruction-box {
        top: 60px;
        font-size: 20px;
        padding: 15px 25px;
        min-width: 300px;
    }
    
    .parts-stage-indicator {
        top: 15px;
        right: 15px;
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .parts-quiz-btn {
        padding: 12px 28px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .parts-instruction-box {
        font-size: 16px;
        padding: 12px 20px;
        min-width: 250px;
    }
    
    .parts-stage-indicator {
        font-size: 12px;
        padding: 8px 15px;
    }
    
    .parts-quiz-btn {
        padding: 10px 24px;
        font-size: 16px;
    }
}

/* ===== MEMORY GAME STYLES ===== */
.memory-game-container {
    width: 100%;
    max-width: 1200px;
    margin: 100px auto 60px;
    padding: 20px;
}

.memory-info-bar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 30px;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    z-index: 100;
}

.memory-difficulty-badge {
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 16px;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.memory-easy {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
}

.memory-medium {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
}

.memory-hard {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
}

.memory-extreme {
    background: linear-gradient(135deg, #9C27B0 0%, #7B1FA2 100%);
}

.memory-moves, .memory-pairs {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.memory-cards-grid {
    display: grid;
    gap: 15px;
    padding: 20px;
    justify-content: center;
}

/* Grid layouts for different difficulties */
.memory-cards-grid.memory-easy {
    grid-template-columns: repeat(4, 140px);
    grid-template-rows: repeat(2, 140px);
}

.memory-cards-grid.memory-medium {
    grid-template-columns: repeat(4, 130px);
    grid-template-rows: repeat(4, 130px);
    gap: 12px;
}

.memory-cards-grid.memory-hard {
    grid-template-columns: repeat(6, 100px);
    grid-template-rows: repeat(4, 100px);
    gap: 10px;
}

.memory-cards-grid.memory-extreme {
    grid-template-columns: repeat(9, 90px);
    grid-template-rows: repeat(4, 90px);
    gap: 8px;
}

.memory-card {
    perspective: 1000px;
    cursor: pointer;
}

.memory-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.memory-card.flipped .memory-card-inner {
    transform: rotateY(180deg);
}

.memory-card.matched .memory-card-inner {
    transform: rotateY(180deg);
}

.memory-card-front,
.memory-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.memory-card-front {
    background: linear-gradient(135deg, #9C27B0 0%, #7B1FA2 100%);
    color: white;
    font-size: 64px;
    font-weight: 700;
}

.memory-card-back {
    background: white;
    transform: rotateY(180deg);
    padding: 10px;
}

.memory-card-back img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.memory-card:hover:not(.flipped):not(.matched) .memory-card-inner {
    transform: scale(1.05);
}

.memory-card.matched {
    opacity: 0.7;
    cursor: default;
}

.memory-card.matched .memory-card-back {
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.6);
    border: 3px solid #4CAF50;
}

.memory-complete-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 50px;
    border-radius: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    text-align: center;
    z-index: 200;
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Memory responsive design */
@media (max-width: 768px) {
    .memory-game-container {
        margin-top: 80px;
    }
    
    .memory-info-bar {
        top: 15px;
        padding: 12px 20px;
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .memory-difficulty-badge {
        font-size: 14px;
        padding: 6px 15px;
    }
    
    .memory-moves, .memory-pairs {
        font-size: 16px;
    }
    
    .memory-cards-grid.memory-easy {
        grid-template-columns: repeat(4, 120px);
        grid-template-rows: repeat(2, 120px);
        gap: 12px;
    }
    
    .memory-cards-grid.memory-medium {
        grid-template-columns: repeat(4, 100px);
        grid-template-rows: repeat(4, 100px);
        gap: 10px;
    }
    
    .memory-cards-grid.memory-hard {
        grid-template-columns: repeat(6, 80px);
        grid-template-rows: repeat(4, 80px);
        gap: 8px;
    }
    
    .memory-cards-grid.memory-extreme {
        grid-template-columns: repeat(9, 70px);
        grid-template-rows: repeat(4, 70px);
        gap: 6px;
    }
}

@media (max-width: 480px) {
    .memory-info-bar {
        font-size: 14px;
        padding: 10px 15px;
    }
    
    .memory-cards-grid.memory-easy {
        grid-template-columns: repeat(4, 80px);
        grid-template-rows: repeat(2, 80px);
        gap: 8px;
    }
    
    .memory-cards-grid.memory-medium {
        grid-template-columns: repeat(4, 75px);
        grid-template-rows: repeat(4, 75px);
        gap: 6px;
    }
    
    .memory-cards-grid.memory-hard {
        grid-template-columns: repeat(4, 65px);
        grid-template-rows: repeat(6, 65px);
        gap: 5px;
    }
    
    .memory-cards-grid.memory-extreme {
        grid-template-columns: repeat(4, 55px);
        grid-template-rows: repeat(9, 55px);
        gap: 4px;
    }
    
    .memory-card-front {
        font-size: 36px;
    }
    
    .memory-complete-message {
        padding: 30px;
        font-size: 14px;
    }
}

/* ===== VOCABULARY SUMMARY STYLES ===== */
.vocabulary-summary {
    padding: 20px;
    text-align: center;
}

.summary-title {
    font-size: 28px;
    font-weight: bold;
    color: #333;
    margin-bottom: 30px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.summary-item {
    background: white;
    border: 3px solid #e9ecef;
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.summary-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #4CAF50;
}

.summary-image {
    width: 100%;
    height: 120px;
    object-fit: contain;
    object-position: center;
    margin-bottom: 10px;
    border-radius: 8px;
}

.summary-text {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    text-align: center;
}

.summary-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 30px;
}

.summary-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 25px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.quiz-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.quiz-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.restart-btn {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
}

.restart-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.4);
}

/* ===== VOCABULARY QUIZ STYLES ===== */

/* Progress Bar */
.vocabulary-progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    margin-bottom: 20px;
    overflow: hidden;
}

.vocabulary-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Quiz Interface */
.quiz-title {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 10px;
}

.quiz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.quiz-item {
    background: white;
    border: 3px solid #e0e0e0;
    border-radius: 12px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.quiz-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-color: #667eea;
}

.quiz-item img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.quiz-item.correct {
    border-color: #4CAF50;
    background: #E8F5E8;
    transform: scale(1.05);
}

.quiz-item.incorrect {
    border-color: #f44336;
    background: #FFEBEE;
    transform: scale(0.95);
}

.quiz-question {
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    color: #333;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.quiz-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.quiz-progress {
    font-size: 16px;
    font-weight: bold;
    color: #666;
}

.quiz-next-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s ease;
}

.quiz-next-btn:hover {
    background: #5a6fd8;
}

/* Quiz Results */
.quiz-results {
    text-align: center;
    padding: 40px 20px;
}

.quiz-results h2 {
    color: #333;
    margin-bottom: 30px;
    font-size: 28px;
}

.quiz-score {
    margin-bottom: 40px;
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4CAF50, #8BC34A);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 4px 20px rgba(76, 175, 80, 0.3);
}

.score-number {
    font-size: 36px;
    font-weight: bold;
    color: white;
}

.quiz-results p {
    font-size: 18px;
    color: #666;
    margin-bottom: 30px;
}

.quiz-restart-btn,
.quiz-back-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin: 10px;
    transition: background 0.3s ease;
}

.quiz-restart-btn:hover,
.quiz-back-btn:hover {
    background: #5a6fd8;
}

.quiz-back-btn {
    background: #6c757d;
}

.quiz-back-btn:hover {
    background: #5a6268;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .quiz-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 10px;
    }
    
    .quiz-item img {
        height: 60px;
    }
    
    .quiz-title {
        font-size: 20px;
        padding: 15px;
    }
    
    .quiz-question {
        font-size: 18px;
        padding: 12px;
    }
    
    .score-circle {
        width: 100px;
        height: 100px;
    }
    
    .score-number {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .quiz-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .quiz-item {
        padding: 8px;
    }
    
    .quiz-item img {
        height: 50px;
    }
    
    .quiz-title {
        font-size: 18px;
        padding: 12px;
    }
    
    .quiz-question {
        font-size: 16px;
        padding: 10px;
    }
}

/* ===== Game Card Styles ===== */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    max-width: 1200px;
    width: 100%;
    padding: 20px;
}

.game-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    text-decoration: none;
    color: #333;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-height: 200px;
    justify-content: center;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    text-decoration: none;
    color: #333;
}

.game-card-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 15px;
    transition: transform 0.3s ease;
}

.game-card:hover .game-card-image {
    transform: scale(1.05);
}

.game-card-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #2c3e50;
}

.game-card-mode {
    font-size: 14px;
    color: #7f8c8d;
    font-style: italic;
}

/* Back Button */
.back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255,255,255,0.9);
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.back-btn:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* Change Language Button */
.change-lang-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,0.9);
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.change-lang-btn:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* Page Title */
h1 {
    text-align: center;
    color: white;
    font-size: 2.5rem;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* Responsive Design for Game Cards */
@media (max-width: 768px) {
    .game-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
        padding: 15px;
    }
    
    .game-card {
        min-height: 180px;
        padding: 15px;
    }
    
    .game-card-image {
        height: 120px;
    }
    
    .game-card-title {
        font-size: 18px;
    }
    
    .game-card-mode {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .game-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 10px;
        padding: 10px;
    }
    
    .game-card {
        min-height: 160px;
        padding: 12px;
    }
    
    .game-card-image {
        height: 100px;
    }
    
    .game-card-title {
        font-size: 16px;
    }
    
    .game-card-mode {
        font-size: 11px;
    }
}

/* ===== Vocabulary Game Styles ===== */
.vocabulary-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

/* Header with back button */
.vocabulary-header {
    width: 100%;
    max-width: 800px;
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.vocab-back-btn {
    background: rgba(255,255,255,0.9);
    border: 2px solid #667eea;
    border-radius: 25px;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 600;
    color: #667eea;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.vocab-back-btn:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.vocabulary-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    max-width: 800px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.vocabulary-main-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    width: 100%;
    margin-bottom: 20px;
}

.vocabulary-image-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 500px;
    min-height: 400px;
    cursor: pointer;
    position: relative;
}

.vocabulary-image {
    width: 100%;
    max-width: 500px;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Desktop navigation buttons */
.vocab-nav-desktop {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.vocab-nav-desktop:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Mobile navigation buttons container */
.vocab-nav-mobile {
    display: none; /* Hidden on desktop */
    width: 100%;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
    margin-bottom: 15px;
}

.vocab-nav-mobile .vocab-nav-btn {
    flex: 1;
    max-width: 150px;
    height: 45px;
    border-radius: 25px;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.vocab-nav-mobile .vocab-nav-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.vocab-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: #ccc;
}

.vocabulary-text {
    font-size: 32px;
    font-weight: 600;
    color: #2c3e50;
    text-align: center;
    margin-bottom: 15px;
    min-height: 50px;
}

.vocab-progress {
    font-size: 18px;
    color: #7f8c8d;
    text-align: center;
    font-weight: 500;
}

.vocabulary-progress-bar {
    width: 100%;
    max-width: 800px;
    height: 8px;
    background: rgba(255,255,255,0.3);
    border-radius: 10px;
    margin-bottom: 30px;
    overflow: hidden;
}

.vocabulary-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
    border-radius: 10px;
    transition: width 0.3s ease;
}

/* Responsive Design for Vocabulary Game */
@media (max-width: 768px) {
    .vocabulary-container {
        padding: 15px;
    }
    
    .vocabulary-header {
        margin-bottom: 15px;
    }
    
    .vocab-back-btn {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    .vocabulary-card {
        padding: 20px;
    }
    
    /* Hide desktop buttons on mobile */
    .vocab-nav-desktop {
        display: none;
    }
    
    /* Show mobile buttons */
    .vocab-nav-mobile {
        display: flex;
    }
    
    .vocabulary-main-content {
        gap: 0;
        margin-bottom: 10px; /* Closer to image */
    }
    
    .vocabulary-image-container {
        max-width: 100%;
        min-height: 300px;
        margin-bottom: 0;
    }
    
    .vocabulary-image {
        max-width: 100%;
        max-height: 400px;
    }
    
    .vocabulary-text {
        font-size: 24px;
        margin-top: 10px;
    }
    
    .vocab-progress {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .vocabulary-container {
        padding: 10px;
    }
    
    .vocabulary-header {
        margin-bottom: 10px;
    }
    
    .vocab-back-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .vocabulary-card {
        padding: 15px;
    }
    
    .vocab-nav-mobile {
        gap: 10px;
        margin-top: 8px;
        margin-bottom: 10px;
    }
    
    .vocab-nav-mobile .vocab-nav-btn {
        height: 40px;
        font-size: 12px;
        max-width: 130px;
    }
    
    .vocabulary-image-container {
        min-height: 250px;
    }
    
    .vocabulary-image {
        max-height: 300px;
    }
    
    .vocabulary-text {
        font-size: 20px;
        margin-top: 8px;
    }
    
    .vocab-progress {
        font-size: 14px;
    }
}

/* ===== How Many (Counting) Game Styles ===== */
.how-many-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: rgb(37, 32, 99);
}

.how-many-instruction {
    font-size: 24px;
    color: white;
    text-align: center;
    margin-bottom: 20px;
    font-weight: 600;
}

.how-many-display-box {
    width: 90%;
    max-width: 800px;
    height: 400px;
    background: white;
    border: 4px solid #2c3e50;
    border-radius: 15px;
    position: relative;
    margin-bottom: 30px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

.how-many-item {
    position: absolute;
    width: 60px;
    height: auto;
    user-select: none;
    pointer-events: none;
}

.how-many-clickable-item {
    position: absolute;
    width: 60px;
    height: auto;
    user-select: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.how-many-clickable-item:hover {
    transform: scale(1.1);
}

.how-many-target-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 20px;
    background: white;
    border: 3px solid #667eea;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.how-many-target-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.how-many-target-number {
    font-size: 48px;
    font-weight: bold;
    color: #667eea;
    min-width: 60px;
    text-align: center;
}

.how-many-questions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.how-many-question-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    background: white;
    border: 2px solid #2c3e50;
    border-radius: 10px;
    min-width: 200px;
}

.how-many-question-image {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.how-many-equals {
    font-size: 32px;
    font-weight: bold;
    color: #2c3e50;
}

.how-many-answer-box {
    width: 60px;
    height: 60px;
    border: 2px dashed #ccc;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.how-many-answer-box.drag-over {
    border-color: #667eea;
    background: #e7edff;
    transform: scale(1.1);
}

.how-many-answer-box.correct {
    border-color: #4caf50;
    background: #e8f5e9;
}

.how-many-answer-box.incorrect {
    border-color: #f44336;
    background: #ffebee;
    animation: shake 0.5s;
}

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

.how-many-answer-number {
    font-size: 36px;
    font-weight: bold;
    color: #2c3e50;
}

.how-many-numbers {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    padding: 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    max-width: 800px;
    width: 100%;
}

.how-many-number {
    width: 60px;
    height: 60px;
    background: white;
    border: 3px solid #2c3e50;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: bold;
    color: #2c3e50;
    cursor: grab;
    transition: all 0.3s ease;
    user-select: none;
}

.how-many-number:hover {
    transform: scale(1.1);
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.how-many-number:active,
.how-many-number.dragging {
    cursor: grabbing;
    transform: scale(0.9);
    opacity: 0.7;
}

.how-many-complete {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    z-index: 1000;
}

.how-many-feedback {
    padding: 20px 40px;
    border-radius: 15px;
    font-size: 32px;
    font-weight: bold;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    animation: feedbackPop 0.5s ease;
}

@keyframes feedbackPop {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.how-many-success {
    background: #4caf50;
    color: white;
    border: 3px solid #2e7d32;
}

.how-many-error {
    background: #f44336;
    color: white;
    border: 3px solid #c62828;
}

/* Responsive Design for How Many Game */
@media (max-width: 768px) {
    .how-many-display-box {
        height: 300px;
    }
    
    .how-many-item,
    .how-many-clickable-item {
        width: 50px;
    }
    
    .how-many-target-display {
        padding: 15px;
        gap: 10px;
    }
    
    .how-many-target-image {
        width: 50px;
        height: 50px;
    }
    
    .how-many-target-number {
        font-size: 36px;
        min-width: 50px;
    }
    
    .how-many-question-box {
        min-width: 150px;
        padding: 10px 15px;
    }
    
    .how-many-question-image {
        width: 40px;
        height: 40px;
    }
    
    .how-many-answer-box {
        width: 50px;
        height: 50px;
    }
    
    .how-many-answer-number {
        font-size: 28px;
    }
    
    .how-many-number {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .how-many-equals {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .how-many-display-box {
        height: 250px;
    }
    
    .how-many-item,
    .how-many-clickable-item {
        width: 40px;
    }
    
    .how-many-target-display {
        padding: 12px;
        gap: 8px;
    }
    
    .how-many-target-image {
        width: 40px;
        height: 40px;
    }
    
    .how-many-target-number {
        font-size: 32px;
        min-width: 40px;
    }
    
    .how-many-question-box {
        min-width: 120px;
        padding: 8px 12px;
        gap: 5px;
    }
    
    .how-many-question-image {
        width: 35px;
        height: 35px;
    }
    
    .how-many-answer-box {
        width: 45px;
        height: 45px;
    }
    
    .how-many-answer-number {
        font-size: 24px;
    }
    
    .how-many-number {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .how-many-equals {
        font-size: 20px;
    }
    
    .how-many-numbers {
        gap: 10px;
        padding: 15px;
    }
}

/* ===== STORY TIME GAME STYLES ===== */
.story-time-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
}

.story-title {
    font-size: 32px;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 20px;
    text-align: center;
}

.story-progress {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px 20px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 20px;
}

.story-progress-text {
    font-size: 18px;
    font-weight: 600;
    color: #667eea;
}

.story-step-container {
    width: 100%;
    max-width: 800px;
    margin-bottom: 30px;
}

.story-step-text {
    font-size: 24px;
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    color: #333;
    line-height: 1.6;
}

.story-replay-btn {
    position: fixed;
    top: 100px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    border: none;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    z-index: 100;
}

.story-replay-btn:hover {
    background: #5568d3;
    transform: scale(1.1);
}

.story-options-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
    width: 100%;
    max-width: 1000px;
    margin-top: 30px;
}

.story-option {
    width: 200px;
    height: 200px;
    border: 4px solid #e0e0e0;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: relative;
}

.story-option:hover {
    transform: scale(1.05);
    border-color: #667eea;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.story-option.selected {
    border-color: #667eea;
    transform: scale(1.05);
}

.story-option.correct {
    border-color: #4caf50;
    background: rgba(76, 175, 80, 0.1);
    animation: correctPulse 0.5s ease;
}

.story-option.incorrect {
    border-color: #f44336;
    background: rgba(244, 67, 54, 0.1);
    animation: shake 0.5s ease;
}

.story-option.correct-highlight {
    border-color: #4caf50;
    background: rgba(76, 175, 80, 0.2);
    animation: correctPulse 0.5s ease;
}

.story-option-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.story-option-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    background: #f5f5f5;
    color: #999;
}

.story-feedback {
    padding: 20px 40px;
    border-radius: 15px;
    font-size: 32px;
    font-weight: bold;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    animation: feedbackPop 0.5s ease;
}

.story-feedback-correct {
    background: #4caf50;
    color: white;
    border: 3px solid #2e7d32;
}

.story-feedback-incorrect {
    background: #f44336;
    color: white;
    border: 3px solid #c62828;
}

.story-complete {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    z-index: 1000;
}

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

/* Responsive Design for Story Time Game */
@media (max-width: 768px) {
    .story-title {
        font-size: 24px;
    }
    
    .story-step-text {
        font-size: 20px;
        padding: 15px;
    }
    
    .story-options-container {
        gap: 20px;
    }
    
    .story-option {
        width: 150px;
        height: 150px;
    }
    
    .story-replay-btn {
        width: 50px;
        height: 50px;
        font-size: 24px;
        top: 80px;
        right: 15px;
    }
}

@media (max-width: 480px) {
    .story-title {
        font-size: 20px;
    }
    
    .story-step-text {
        font-size: 18px;
        padding: 12px;
    }
    
    .story-options-container {
        gap: 15px;
        flex-direction: column;
    }
    
    .story-option {
        width: 140px;
        height: 140px;
    }
    
    .story-replay-btn {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
}
