/* Universal Fullscreen Game Styles */
.fullscreen-game-page {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    overflow: hidden !important;
    z-index: 1000 !important;
}

.fullscreen-game-page .container {
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow-y: auto !important;
}

.fullscreen-game-page .game-area {
    min-height: calc(100vh - 200px) !important;
    padding: 1rem !important;
}

.fullscreen-game-page .app-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1001 !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px) !important;
    padding: 0.5rem 1rem !important;
}

/* Make sure body doesn't scroll when game is fullscreen */
body.fullscreen-game {
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    height: 100vh !important;
}


@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;700&display=swap');

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

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

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    position: relative;
}

/* Game Area */
.game-area {
    min-height: 80vh;
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* Body and Typography */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #2d3748;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    min-height: 100vh;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 0.5rem;
    }

    .game-area {
        padding: 1rem;
        margin: 1rem;
    }

    .main-word {
        font-size: 2rem;
    }

    .flashcard-controls {
        flex-direction: column;
        gap: 0.5rem;
    }

    .game-modes {
        flex-direction: column;
        align-items: center;
    }
}

/* Homepage Styles */
.homepage {
    background: #ffffff;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e2e8f0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.5rem;
    color: #2d3748;
    overflow: hidden;
}

.logo-text {
    display: inline-block;
    animation: slideDown 3s ease-in-out infinite;
    transform-origin: center;
    transition: all 0.3s ease;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background-image: url('india-map-with-om-aum-hindu-symbol-isolated-on-the-white-2TB9WK7.jpg');
    background-size: cover;
    background-position: center;
    border-radius: 50%;
    border: 2px solid #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-5px) rotate(2deg); box-shadow: 0 8px 16px rgba(102, 126, 234, 0.4); }
}

@keyframes slideDown {
    0% { 
        transform: translateY(-15px);
        opacity: 0.5;
    }
    25% { 
        transform: translateY(-5px);
        opacity: 0.8;
    }
    50% { 
        transform: translateY(0px);
        opacity: 1;
    }
    75% { 
        transform: translateY(5px);
        opacity: 0.8;
    }
    100% { 
        transform: translateY(15px);
        opacity: 0.5;
    }
}

/* Cool Loading Animation */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: all 0.5s ease;
    animation: backgroundShift 4s ease-in-out infinite;
}

@keyframes backgroundShift {
    0%, 100% { filter: hue-rotate(0deg) brightness(1); }
    25% { filter: hue-rotate(90deg) brightness(1.1); }
    50% { filter: hue-rotate(180deg) brightness(0.9); }
    75% { filter: hue-rotate(270deg) brightness(1.1); }
}

.loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loading-logo {
    width: 120px;
    height: 120px;
    background-image: url('india-map-with-om-aum-hindu-symbol-isolated-on-the-white-2TB9WK7.jpg');
    background-size: cover;
    background-position: center;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.3);
    margin-bottom: 2rem;
    animation: loadingPulse 2s ease-in-out infinite;
}

@keyframes loadingPulse {
    0%, 100% { transform: scale(1) rotate(0deg); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); }
    25% { transform: scale(1.05) rotate(90deg); box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); }
    50% { transform: scale(1.1) rotate(180deg); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); }
    75% { transform: scale(1.05) rotate(270deg); box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); }
}

.loading-text {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 2rem;
    animation: loadingText 1.5s ease-in-out infinite;
}

@keyframes loadingText {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.loading-dots {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.dot {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: dotBounce 1.4s ease-in-out infinite both;
}

.dot:nth-child(1) { animation-delay: -0.32s; }
.dot:nth-child(2) { animation-delay: -0.16s; }
.dot:nth-child(3) { animation-delay: 0s; }

@keyframes dotBounce {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40% { transform: scale(1.2); opacity: 1; }
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: relative;
}

.nav-links .nav-btn {
    margin-left: auto;
}

.nav-links a {
    text-decoration: none;
    color: black;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a.start-learning-btn {
    color: white;
}

.nav-links a:hover {
    color: #667eea;
}

.nav-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.5);
    background: linear-gradient(135deg, #5a67d8, #6b46c1);
}

.nav-btn.settings-btn {
    background: linear-gradient(135deg, #ed8936, #dd6b20);
    box-shadow: 0 4px 12px rgba(237, 137, 54, 0.3);
    order: 1;
}

.nav-btn.settings-btn:hover {
    background: linear-gradient(135deg, #dd6b20, #c05621);
    box-shadow: 0 8px 20px rgba(237, 137, 54, 0.5);
}

.nav-btn.profile-btn {
    background: linear-gradient(135deg, #48bb78, #38a169);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
    order: 2;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1002;
}

.nav-btn.profile-btn:hover {
    background: linear-gradient(135deg, #38a169, #2f855a);
    box-shadow: 0 8px 20px rgba(72, 187, 120, 0.5);
}

.start-learning-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.start-learning-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

/* Hero Section */
.hero-section {
    padding: 120px 2rem 80px;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: #2d3748;
}

.gradient-text {
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.2rem;
    color: #4a5568;
    margin-bottom: 2rem;
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

.cta-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    font-size: 1.1rem;
    text-decoration: none;
}

.cta-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.3);
}

.cta-secondary {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    font-size: 1.1rem;
    text-decoration: none;
}

.cta-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(240, 147, 251, 0.3);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

.modal-content {
    background-color: #ffffff;
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    animation: modalSlideIn 0.3s ease;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 2px solid #f7fafc;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-radius: 15px 15px 0 0;
}

.modal-header h2 {
    margin: 0;
    color: #1a202c;
    font-weight: 700;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.close {
    color: #718096;
    font-size: 1.8rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 50%;
    background: transparent;
}

.close:hover {
    color: #1a202c;
    background: #f7fafc;
    transform: rotate(90deg);
}

.modal-body {
    padding: 2rem;
    background: #ffffff;
    border-radius: 0 0 15px 15px;
    overflow-y: auto;
    flex: 1;
    max-height: calc(85vh - 80px);
}

/* Custom scrollbar for modal */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a67d8, #6b46c1);
}

.learning-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.option-card {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    text-decoration: none;
    color: #2d3748;
    transition: all 0.3s ease;
}

.option-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.1);
    border-color: #667eea;
}

.option-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.option-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #2d3748;
}

.option-card p {
    color: #4a5568;
    line-height: 1.6;
}

.cta-secondary {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.cta-secondary:hover {
    background: #667eea;
    color: white;
    transform: translateY(-3px);
}

/* Hero Visual */
.sanskrit-showcase {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sanskrit-card {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
    transform: rotate(-2deg);
    transition: transform 0.3s ease;
}

.sanskrit-card:nth-child(2) {
    transform: rotate(1deg);
    margin-left: 2rem;
}

.sanskrit-card:nth-child(3) {
    transform: rotate(-1deg);
    margin-right: 2rem;
}

.sanskrit-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.2);
}

.sanskrit-word-demo {
    font-size: 2.5rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.translation {
    font-size: 1.1rem;
    color: #4a5568;
    font-weight: 500;
}

/* Features Section */
.features-section {
    padding: 80px 2rem;
    background: white;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 3rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: #f7fafc;
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.15);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1rem;
}

.feature-card p {
    color: #4a5568;
    line-height: 1.6;
}

/* About Section */
.about-section {
    padding: 80px 2rem;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
}

/* Games Section */
.games-section {
    padding: 80px 2rem;
    background: white;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

@media (max-width: 600px) {
    .games-grid {
        grid-template-columns: 1fr;
    }
}

.game-card {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.1);
    border-color: #667eea;
}

.game-icon {
    font-size: 4.5rem;
    margin-bottom: 1.5rem;
}

/* Reasonable Game Containers */
.game-container, 
.fullscreen-game {
    position: relative;
    width: 95vw;
    max-width: 1200px;
    height: 85vh;
    max-height: 800px;
    margin: 2rem auto;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

/* Normal body behavior for game pages */
body:has(.game-container),
body:has(.fullscreen-game),
body:has(.mini-game-area),
body:has(.game-area) {
    margin: 0;
    padding: 0;
    overflow-y: auto;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Make containers inside games reasonably sized */
.container {
    max-width: 1200px;
    width: 95%;
    margin: 2rem auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    min-height: 80vh;
    height: auto;
    overflow-y: auto;
}

/* Force fullscreen for all game HTML pages */
html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

/* Ensure all game wrappers are fullscreen */
.game-wrapper,
.fullscreen-wrapper {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 999 !important;
}

/* Game content should be reasonably sized */
.game-content {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    max-width: 1200px;
    margin: 2rem auto;
    height: auto;
    min-height: 70vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Game Section Styles */
.game-section {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    min-height: 80vh;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.game-stats {
    display: flex;
    gap: 2rem;
    font-weight: 600;
}

.game-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 2px solid #f0f0f0;
}

.game-controls button {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 10px;
    background: #667eea;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.game-controls button:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

/* Word Matcher Styles */
.matcher-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin: 2rem 0;
}

.matcher-card {
    background: #f8f9ff;
    border: 2px solid #e0e7ff;
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.matcher-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.matcher-card.selected {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.matcher-card.matched {
    background: #22c55e;
    color: white;
    border-color: #22c55e;
}

/* Speed Game Styles */
.speed-game-area {
    text-align: center;
    margin: 2rem 0;
}

.speed-word {
    margin-bottom: 2rem;
}

.word-display {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
    margin: 1rem 0;
}

.speed-input-area {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 2rem 0;
}

#speed-input {
    padding: 1rem;
    border: 2px solid #e0e7ff;
    border-radius: 10px;
    font-size: 1.1rem;
    width: 300px;
}

#speed-input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

/* Memory Game Styles */
.memory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin: 2rem 0;
}

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

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

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

.memory-card-front, .memory-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.memory-card-front {
    background: #667eea;
    color: white;
    font-size: 2rem;
}

.memory-card-back {
    background: #f8f9ff;
    border: 2px solid #e0e7ff;
    color: #333;
    transform: rotateY(180deg);
}

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

/* Sudoku Styles */
.sudoku-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 2px;
    width: 360px;
    height: 360px;
    margin: 2rem auto;
    border: 3px solid #333;
}

.sudoku-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #ddd;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
}

.sudoku-cell.given {
    background: #f0f0f0;
    cursor: not-allowed;
}

.sudoku-cell.selected {
    background: #667eea;
    color: white;
}

.sudoku-cell.error {
    background: #ef4444;
    color: white;
    animation: shake 0.5s ease-in-out;
}

.difficulty-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 1rem 0;
}

.diff-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #e0e7ff;
    border-radius: 5px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.diff-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Number Pad Styles */
.number-pad {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    width: 360px;
    margin: 1rem auto;
}

.num-btn {
    padding: 0.8rem;
    border: 2px solid #e0e7ff;
    border-radius: 5px;
    background: white;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.num-btn:hover {
    background: #f0f0f0;
}

.num-btn.selected {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.num-btn.erase {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

/* Color Quest Styles */
.color-game-area {
    text-align: center;
    margin: 2rem 0;
}

.color-question {
    margin-bottom: 2rem;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    max-width: 300px;
    margin: 0 auto;
}

.color-option {
    width: 120px;
    height: 120px;
    border-radius: 15px;
    cursor: pointer;
    transition: transform 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.color-option:hover {
    transform: scale(1.1);
}

/* Dice Challenge Styles */
.dice-game-area {
    text-align: center;
    margin: 2rem 0;
}

.dice-display {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 2rem 0;
}

.dice {
    font-size: 4rem;
    background: white;
    border: 3px solid #333;
    border-radius: 10px;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dice-total {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 1rem 0;
}

.dice-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    max-width: 400px;
    margin: 2rem auto;
}

.dice-option {
    padding: 1rem;
    border: 2px solid #e0e7ff;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

.dice-option:hover {
    background: #667eea;
    color: white;
}

/* Art Gallery Styles */
.art-game-area {
    text-align: center;
    margin: 2rem 0;
}

.artwork-display {
    margin-bottom: 2rem;
}

.art-image {
    font-size: 6rem;
    margin-bottom: 1rem;
}

.art-title {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
}

.art-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    max-width: 400px;
    margin: 2rem auto;
}

.art-option {
    padding: 1rem;
    border: 2px solid #e0e7ff;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.art-option:hover {
    background: #667eea;
    color: white;
}

/* Snakes & Ladders Styles */
.snakes-game-area {
    margin: 2rem 0;
}

.board-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 2px;
    width: 500px;
    height: 500px;
    margin: 2rem auto;
    border: 3px solid #333;
}

.board-square {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8f9ff;
    border: 1px solid #ddd;
    font-size: 0.7rem;
    position: relative;
}

.board-square.player-position {
    background: #ffd700;
}

.board-square.snake-square {
    background: #ff6b6b;
}

.board-square.ladder-square {
    background: #22c55e;
}

.square-number {
    font-weight: bold;
    font-size: 0.8rem;
}

.sanskrit-number {
    font-size: 0.6rem;
    color: #666;
}

.special-icon {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 0.8rem;
}

.player-icon {
    position: absolute;
    bottom: 2px;
    left: 2px;
    font-size: 1rem;
}

.question-panel {
    background: #f8f9ff;
    border: 2px solid #e0e7ff;
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem 0;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 1rem 0;
}

.snakes-option {
    padding: 1rem;
    border: 2px solid #e0e7ff;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.snakes-option:hover {
    background: #667eea;
    color: white;
}

.snakes-option.correct {
    background: #22c55e;
    color: white;
}

.snakes-option.incorrect {
    background: #ef4444;
    color: white;
}

/* Sentence Builder Styles */
.sentence-builder-area {
    margin: 2rem 0;
}

.sentence-target {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f8f9ff;
    border-radius: 10px;
}

.word-categories {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 2rem 0;
}

.word-category {
    background: #f8f9ff;
    border-radius: 10px;
    padding: 1rem;
}

.word-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.draggable-word {
    background: white;
    border: 2px solid #e0e7ff;
    border-radius: 8px;
    padding: 0.8rem;
    cursor: grab;
    transition: all 0.3s ease;
    text-align: center;
}

.draggable-word:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.draggable-word.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

.draggable-word.used {
    opacity: 0.3;
    cursor: not-allowed;
}

.drop-zones {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 2rem 0;
}

.drop-zone {
    width: 150px;
    height: 100px;
    border: 3px dashed #ccc;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.drop-zone.drag-active {
    border-color: #667eea;
    background: #f0f0ff;
}

.drop-zone.drag-over {
    background: #667eea;
    color: white;
}

.drop-zone.filled {
    border-color: #22c55e;
    background: #f0fff0;
}

.built-sentence {
    text-align: center;
    font-size: 1.5rem;
    margin: 2rem 0;
    padding: 1rem;
    background: #f8f9ff;
    border-radius: 10px;
}

.built-sentence.complete {
    background: #dcfce7;
    border: 2px solid #22c55e;
}

/* Calligraphy Styles */
.calligraphy-area {
    text-align: center;
    margin: 2rem 0;
}

.letter-display {
    margin-bottom: 2rem;
}

.display-letter {
    font-size: 6rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 1rem;
}

.letter-sound {
    font-size: 1.5rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.tracing-area {
    margin: 2rem 0;
}

#trace-canvas {
    border: 3px solid #333;
    border-radius: 10px;
    background: white;
    cursor: crosshair;
}

.trace-feedback {
    margin-top: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Word Assembly Styles */
.assembly-area {
    margin: 2rem 0;
}

.target-word {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f8f9ff;
    border-radius: 10px;
}

.letter-pieces {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin: 2rem 0;
    min-height: 60px;
    padding: 1rem;
    background: #f8f9ff;
    border-radius: 10px;
}

.letter-piece {
    background: white;
    border: 2px solid #e0e7ff;
    border-radius: 8px;
    padding: 0.8rem;
    cursor: grab;
    font-size: 1.2rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

.letter-piece:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.letter-piece.dragging {
    opacity: 0.5;
}

.assembly-slots {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin: 2rem 0;
}

.assembly-slot {
    width: 80px;
    height: 80px;
    border: 3px dashed #ccc;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.assembly-slot.drag-active {
    border-color: #667eea;
    background: #f0f0ff;
}

.assembly-slot.filled {
    border-color: #22c55e;
    background: #f0fff0;
}

.assembled-display {
    text-align: center;
    margin: 2rem 0;
}

.assembled-word {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 1rem;
}

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

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

@keyframes celebrateSuccess {
    0% { transform: scale(1); }
    25% { transform: scale(1.1) rotate(2deg); }
    75% { transform: scale(1.1) rotate(-2deg); }
    100% { transform: scale(1); }
}

/* Game areas should be well-proportioned */
.game-area {
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

/* Mini game areas should be contained */
.mini-game-area {
    width: 100%;
    height: 70vh;
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Header adjustments for contained games */
.game-header {
    position: relative;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 100;
    margin-bottom: 1rem;
    padding: 1rem 2rem;
    height: auto;
    min-height: 80px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Normal game content padding */
.game-content:has(.game-header) {
    padding-top: 2rem;
}

/* Make game boards appropriately sized */
.snakes-board {
    width: min(500px, 70vw);
    height: min(500px, 70vw);
    max-width: 500px;
    max-height: 500px;
}

/* Flashcard adjustments for contained view */
.flashcard {
    width: min(600px, 80vw);
    height: min(400px, 50vh);
    font-size: 1.2rem;
}

/* Make island map reasonably sized */
.island-map {
    width: calc(100% - 2rem);
    height: 70vh;
    min-height: 500px;
    max-height: 700px;
    margin: 1rem;
}

/* Universal fullscreen game wrapper */
.fullscreen-game-wrapper {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden !important;
    z-index: 1000 !important;
}

.fullscreen-game-wrapper .container {
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow-y: auto !important;
}

/* Make sure all game canvases and boards scale properly */
canvas, .game-board, .board-grid, .snakes-board {
    max-width: calc(100vw - 2rem) !important;
    max-height: calc(100vh - 200px) !important;
    width: auto !important;
    height: auto !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .game-container,
    .fullscreen-game {
        width: 98vw;
        height: 80vh;
        margin: 1rem auto;
    }

    .game-header {
        padding: 1rem;
        min-height: 70px;
    }

    .game-content:has(.game-header) {
        padding-top: 1rem;
    }

    .island-map {
        height: 60vh;
        min-height: 400px;
    }

    .flashcard {
        width: 90vw;
        height: min(45vh, 300px);
    }

    .mini-game-area {
        height: 60vh;
        padding: 1rem;
    }

    .container {
        width: 98%;
        margin: 1rem auto;
    }

    canvas, .game-board, .board-grid, .snakes-board {
        max-width: calc(90vw - 2rem);
        max-height: calc(60vh - 60px);
    }
}

.game-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #2d3748;
}

.game-card p {
    color: #4a5568;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.game-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    margin: 0.5rem;
    min-width: 140px;
    min-height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.game-btn.secondary {
    background: linear-gradient(135deg, #a0aec0 0%, #718096 100%);
}

/* Snakes & Ladders Board Styles */
.snakes-board {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    grid-template-rows: repeat(10, 1fr);
    gap: 2px;
    width: 500px;
    height: 500px;
    margin: 0 auto 2rem;
    background: #2d3748;
    padding: 10px;
    border-radius: 15px;
}

.board-cell {
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
    color: #2d3748;
    border-radius: 5px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.board-cell.player-position {
    background: #4299e1;
    color: white;
    box-shadow: 0 0 20px rgba(66, 153, 225, 0.5);
}

.board-cell.snake-head {
    background: #f56565;
    color: white;
}

.board-cell.ladder-bottom {
    background: #48bb78;
    color: white;
}

.dice-display {
    font-size: 2rem;
    text-align: center;
    margin: 1rem 0;
    padding: 1rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.question-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.question-modal .modal-content {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    text-align: center;
}

.option-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1.5rem;
}

.option-buttons button {
    padding: 1rem;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option-buttons button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

/* Bridge Builder Styles */
.bridge-area {
    max-width: 1000px;
    margin: 0 auto;
}

.challenge-info {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #e6fffa 0%, #b2f5ea 100%);
    border-radius: 15px;
}

.bridge-scene {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    align-items: center;
    margin: 2rem 0;
    padding: 2rem;
    background: linear-gradient(135deg, #e6f3ff 0%, #cce7ff 100%);
    border-radius: 20px;
}

.left-bank, .right-bank {
    text-align: center;
    padding: 2rem;
    background: #48bb78;
    border-radius: 15px;
    color: white;
    font-weight: bold;
}

.river-gap {
    position: relative;
    background: linear-gradient(135deg, #4299e1 0%, #2b6cb0 100%);
    border-radius: 10px;
    padding: 1rem;
    margin: 0 1rem;
}

.water-flow {
    text-align: center;
    font-size: 1.5rem;
    color: white;
    margin-bottom: 1rem;
}

.bridge-slots {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.bridge-slot {
    width: 100px;
    height: 80px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px dashed #666;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.bridge-slot:hover {
    background: rgba(255, 255, 255, 1);
    border-color: #4299e1;
}

.slot-placeholder {
    font-size: 0.8rem;
    color: #666;
    text-align: center;
}

.word-blocks {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f7fafc;
    border-radius: 15px;
}

.draggable-words {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.draggable-word {
    background: white;
    padding: 1rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    cursor: grab;
    transition: all 0.3s ease;
    text-align: center;
    min-width: 100px;
}

.draggable-word:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.draggable-word:active {
    cursor: grabbing;
}

.word-sanskrit {
    font-weight: bold;
    color: #2d3748;
    font-size: 1.1rem;
}

.word-english {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.5rem;
}

.bridge-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 2rem 0;
}

.level-complete {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 2px solid #28a745;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    margin-top: 2rem;
}

/* Word Chain Styles */
.chain-container {
    max-width: 1000px;
    margin: 0 auto;
}

.chain-progress {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    text-align: center;
}

.chain-display {
    background: #f7fafc;
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 2rem;
}

.current-chain {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    min-height: 100px;
}

.chain-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chain-word {
    background: white;
    padding: 1rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    min-width: 100px;
}

.chain-connector {
    font-size: 1.5rem;
    color: #4299e1;
    font-weight: bold;
}

.remove-btn {
    background: #e53e3e;
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    font-size: 0.8rem;
}

.word-bank {
    background: white;
    padding: 2rem;
    border-radius: 15px;
}

.available-words {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.chain-word-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.chain-word-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.chain-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 2rem 0;
}

/* Game Container Styles */
.game-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem;
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}

/* Consistent background for all learning pages */
body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

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

.game-header {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    align-items: center;
    background: white;
    padding: 1rem 2rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.header-left {
    justify-self: start;
}

.header-center {
    justify-self: center;
}

.header-right {
    justify-self: end;
}

.game-header h2 {
    color: #2d3748;
    margin: 0;
    font-size: 1.8rem;
}

.game-stats {
    display: flex;
    gap: 2rem;
    font-weight: 600;
    color: #4a5568;
}

.game-content {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    margin: 0 auto;
}

.game-instructions {
    text-align: center;
    font-size: 1.2rem;
    color: #4a5568;
    margin-bottom: 2rem;
}

/* Word Matcher Styles */
.matcher-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.matcher-card {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    padding: 2rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.matcher-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.5s ease;
}

.matcher-card:hover::before {
    left: 100%;
}

.matcher-card:hover:not(.matched):not(.selected) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
    border-color: #667eea;
    background: linear-gradient(135deg, #f7fafc 0%, #e2e8f0 100%);
}

.matcher-card.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    animation: pulse 0.6s ease-in-out;
}

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

.matcher-card.matched {
    border-color: #48bb78;
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    cursor: default;
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(72, 187, 120, 0.3);
    animation: matchSuccess 0.8s ease-out;
}

@keyframes matchSuccess {
    0% { transform: scale(1.05); }
    50% { transform: scale(1.15); box-shadow: 0 15px 40px rgba(72, 187, 120, 0.5); }
    100% { transform: scale(1.02); }
}

.matcher-card.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    animation: pulse 0.6s ease-in-out;
}

.card-text {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    line-height: 1.3;
    word-wrap: break-word;
    max-width: 100%;
}

.card-type {
    font-size: 0.8rem;
    opacity: 0.7;
    text-transform: capitalize;
    margin-top: 0.2rem;
}

/* Puzzle Styles */
.puzzle-card, .speed-card {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
}

.scrambled-display, .speed-display {
    margin-bottom: 2rem;
}

#scrambled-word, #speed-word {
    font-size: 3rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 1rem;
}

#puzzle-meaning {
    font-size: 1.2rem;
    color: #4a5568;
    font-style: italic;
}

.puzzle-hint, .speed-prompt {
    color: #4a5568;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

#puzzle-input, #speed-input {
    width: 100%;
    max-width: 400px;
    padding: 1rem;
    font-size: 1.2rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    margin: 1rem 0;
    text-align: center;
}

#puzzle-input:focus, #speed-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.result-display {
    margin: 1rem 0;
    font-size: 1.2rem;
    font-weight: 600;
    min-height: 30px;
}

/* Madlibs Section */
.madlibs-section {
    padding: 80px 2rem;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.madlib-container {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
}

.madlib-card {
    background: white;
    border-radius: 25px;
    padding: 2.5rem;
    box-shadow: 0 20px 40px rgba(240, 147, 251, 0.2);
}

.madlib-card h3 {
    color: #2d3748;
    font-size: 1.8rem;
    margin-bottom: 2rem;
    text-align: center;
}

.madlib-form {
    display: grid;
    gap: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0.5rem;
}

.input-group input {
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
}

.input-group input:focus {
    outline: none;
    border-color: #f093fb;
    box-shadow: 0 0 0 3px rgba(240, 147, 251, 0.1);
}

.madlib-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.madlib-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(240, 147, 251, 0.4);
}

.story-result {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: 15px;
    padding: 2rem;
    margin-top: 1rem;
}

.story-result h4 {
    color: #2d3748;
    margin-bottom: 1rem;
}

.generated-story {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    line-height: 1.8;
    font-size: 1.1rem;
    color: #4a5568;
    margin-bottom: 1.5rem;
}

.madlib-templates {
    background: white;
    border-radius: 25px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(240, 147, 251, 0.2);
    height: fit-content;
}

.madlib-templates h3 {
    color: #2d3748;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.template-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.template-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.template-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

@media (max-width: 768px) {
    .madlib-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .matcher-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .memory-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .memory-card {
        width: 90px;
        height: 90px;
    }

    .trivia-options {
        grid-template-columns: 1fr;
    }

    .drawing-tools {
        gap: 0.5rem;
    }

    .guess-section {
        flex-direction: column;
        gap: 1rem;
    }

    #guess-input {
        min-width: 200px;
    }

    .game-header {
        grid-template-columns: 1fr;
        gap: 1rem;
        text-align: center;
        padding: 1rem;
    }

    .header-left, .header-center, .header-right {
        justify-self: center;
    }

    .game-stats {
        justify-content: center;
        gap: 1rem;
    }

    .game-stats span {
        display: inline-block;
        background: rgba(102, 126, 234, 0.1);
        padding: 0.5rem 1rem;
        border-radius: 20px;
        font-size: 0.9rem;
    }
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

@media (max-width: 600px) {
    .games-grid {
        grid-template-columns: 1fr;
    }
}

.game-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.3);
}

.game-icon {
    font-size: 4.5rem;
    margin-bottom: 1.5rem;
}

.game-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.game-card p {
    margin-bottom: 1.5rem;
    opacity: 0.9;
    line-height: 1.6;
}

.game-btn {
    background: white;
    color: #667eea;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.game-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Madlibs Section */
.madlibs-section {
    padding: 80px 2rem;
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
}

.madlib-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    max-width: 1000px;
    margin: 0 auto;
}

.madlib-card {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.madlib-card h3 {
    color: #2d3748;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.madlib-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-weight: 600;
    color: #4a5568;
}

.input-group input {
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

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

.madlib-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.madlib-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.story-result {
    background: #f7fafc;
    padding: 2rem;
    border-radius: 15px;
    margin-top: 2rem;
}

.story-result h4 {
    color: #2d3748;
    margin-bottom: 1rem;
}

.generated-story {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    line-height: 1.8;
    font-size: 1.1rem;
    color: #4a5568;
    margin-bottom: 1rem;
}

.madlib-templates {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    height: fit-content;
}

.madlib-templates h3 {
    color: #2d3748;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.template-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.template-btn {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    color: #2d3748;
    border: none;
    padding: 15px;
    border-radius: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.template-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 154, 158, 0.3);
}

@media (max-width: 768px) {
    .madlib-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .games-grid {
        grid-template-columns: 1fr;
    }
}

.about-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
    align-items: start;
    max-width: 1200px;
    margin: 0 auto;
}

.about-text h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 1.5rem;
}

.about-text p {
    font-size: 1.1rem;
    color: #4a5568;
    line-height: 1.7;
    margin-bottom: 2rem;
}

.about-text .stats {
    display: flex;
    justify-content: flex-start;
    gap: 3rem;
    margin-top: 2rem;
}

.stat-item {
    text-align: left;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
}

.stat-label {
    font-size: 0.9rem;
    color: #4a5568;
    font-weight: 500;
}

.about-visual {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 2rem;
}

.om-symbol {
    font-size: 10rem;
    color: #667eea;
    opacity: 0.7;
    text-align: center;
}

/* Footer */
.footer {
    background: #2d3748;
    color: white;
    padding: 2rem;
    text-align: center;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-brand {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.footer-text {
    color: #a0aec0;
}

/* Stats alignment fix */
.stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0;
    padding: 1rem;
}

.stat {
    text-align: center;
}

.stat-label {
    font-weight: 600;
    color: #4a5568;
    display: block;
    margin-bottom: 0.5rem;
}

.stat span:last-child {
    font-size: 1.2rem;
    font-weight: bold;
    color: #667eea;
}

/* Learning App Styles */
.app-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 30px;
    border-radius: 20px 20px 0 0;
}

/* Flashcard Styles */
.flashcard-progress {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: 600;
    color: #2d3748;
}

.progress-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.flashcard {
    width: 100%;
    height: 400px;
    perspective: 1000px;
    margin-bottom: 30px;
    cursor: pointer;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

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

.flashcard-front, .flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 20px;
    border: 3px solid #e2e8f0;
    background: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.flashcard-back {
    transform: rotateY(180deg);
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: #667eea;
}

.card-type {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0.7;
}

.card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.main-word {
    font-size: 4rem;
    font-weight: bold;
    margin-bottom: 20px;
    line-height: 1.2;
}

.flashcard-front .main-word {
    color: #2d3748;
}

.flashcard-back .main-word {
    color: white;
}

.romanized {
    font-size: 1.5rem;
    opacity: 0.8;
    font-style: italic;
    margin-bottom: 20px;
}

.card-hint {
    font-size: 1.2rem;
    color: #4a5568;
    font-style: italic;
    margin-top: 20px;
}

.flip-instruction {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.9rem;
    opacity: 0.6;
    font-style: italic;
}

.flashcard-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.nav-btn, .flip-btn {
    padding: 14px 28px;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    min-width: 120px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.nav-btn {
    background: #6c757d;
    color: white;
}

.nav-btn:hover:not(:disabled) {
    background: #495057;
    transform: translateY(-2px);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.flip-btn {
    background: linear-gradient(135deg, #ff6b6b, #feca57);
    color: white;
}

.flip-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
}

.difficulty-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.difficulty-btn {
    padding: 10px 20px;
    border: 2px solid transparent;
    border-radius: 25px;
    background: #f8f9fa;
    color: #2d3748;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.difficulty-btn.easy {
    border-color: #28a745;
}

.difficulty-btn.medium {
    border-color: #ffc107;
}

.difficulty-btn.hard {
    border-color: #dc3545;
}

.difficulty-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.difficulty-btn.selected {
    background: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.difficulty-btn.easy.selected {
    background: #28a745;
    color: white;
}

.difficulty-btn.medium.selected {
    background: #ffc107;
    color: white;
}

.difficulty-btn.hard.selected {
    background: #dc3545;
    color: white;
}

.back-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 0.75rem 1.5rem;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    color: #2d3748;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.8);
}

.app-title {
    flex: 1;
    text-align: center;
}

.app-title h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.app-title p {
    font-size: 1.2em;
    opacity: 0.9;
}

/* Existing learning app styles */
.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    min-height: calc(100vh - 4rem);
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.game-modes {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.mode-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    background: #6c757d;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.mode-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.mode-btn.active {
    background: linear-gradient(135deg, #ff6b6b, #feca57);
}

.game-area {
    padding: 30px;
}

.score-board {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    padding: 15px;
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    border-radius: 15px;
}

.score, .streak {
    font-weight: bold;
    font-size: 1.1em;
}

.question-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.question-text {
    font-size: 1.3em;
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
    font-weight: 600;
}

.sanskrit-display {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #ffeaa7 0%, #fab1a0 100%);
    border-radius: 15px;
    border: 2px solid #e17055;
}

.sanskrit-word {
    font-size: 3em;
    font-weight: bold;
    color: #2d3436;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.romanized {
    font-size: 1.2em;
    color: #636672;
    font-style: italic;
}

.options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.option-btn {
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    background: white;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option-btn:hover {
    border-color: #4facfe;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(79, 172, 254, 0.2);
}

.option-btn.correct {
    background: #2ecc71;
    color: white;
    border-color: #27ae60;
}

.option-btn.incorrect {
    background: #e74c3c;
    color: white;
    border-color: #c0392b;
}

.option-btn.disabled {
    pointer-events: none;
    opacity: 0.8;
}

.option-btn.correct-highlight {
    background: #28a745 !important;
    color: white !important;
    border-color: #1e7e34 !important;
    opacity: 1 !important;
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.5);
}

.option-btn.incorrect-highlight {
    background: #dc3545 !important;
    color: white !important;
    border-color: #bd2130 !important;
    opacity: 1 !important;
    box-shadow: 0 0 10px rgba(220, 53, 69, 0.5);
}

.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.next-btn, .hint-btn {
    padding: 14px 30px;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 130px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.next-btn {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: white;
    font-size: 1.1rem;
}

.hint-btn {
    background: #f39c12;
    color: white;
    font-size: 1.1rem;
}

.next-btn:hover, .hint-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.hint-display {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 10px;
    padding: 15px;
    margin-top: 15px;
    color: #856404;
}

/* Answer Feedback Styles */
.answer-feedback {
    display: none;
    margin: 20px 0;
    padding: 20px;
    border-radius: 15px;
    animation: fadeIn 0.3s ease;
}

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

.feedback-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.feedback-icon {
    font-size: 2rem;
}

.feedback-text {
    flex: 1;
}

.correct-feedback {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border: 2px solid #28a745;
    color: #155724;
}

.incorrect-feedback {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    border: 2px solid #dc3545;
    color: #721c24;
}

.sanskrit-display {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2d3748;
    margin: 0 5px;
}

.romanized-display {
    font-style: italic;
    opacity: 0.8;
    font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .about-content {
        grid-template-columns: 1fr;
    }

    .nav-links {
        gap: 1rem;
    }

    .nav-links a {
        display: none;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .stats {
        flex-direction: column;
        gap: 1rem;
    }

    .game-modes {
        flex-direction: column;
        align-items: center;
    }

    .options {
        grid-template-columns: 1fr;
    }

    .controls {
        flex-direction: column;
        align-items: center;
    }
}

/* Speed Game specific styles */
.speed-input-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.speed-input-container {
    display: flex;
    gap: 10px;
    align-items: center;
    width: 100%;
    max-width: 500px;
}

.check-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    min-height: 48px;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.check-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.check-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #6c757d;
}

.speed-result {
    min-height: 30px;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Word Search Styles */
.word-search-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

/* Bridge Builder Game Styles */
.bridge-area {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

.challenge-info {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.challenge-info h3 {
    color: #2d3748;
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.bridge-scene {
    display: grid;
    grid-template-columns: 200px 1fr 200px;
    gap: 2rem;
    align-items: center;
    margin-bottom: 3rem;
    min-height: 200px;
}

.left-bank, .right-bank {
    background: linear-gradient(135deg, #68d391, #38a169);
    height: 150px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.river-gap {
    background: linear-gradient(135deg, #4299e1, #3182ce);
    border-radius: 20px;
    padding: 2rem;
    position: relative;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.water-flow {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 1.5rem;
    animation: flow 2s ease-in-out infinite;
}

@keyframes flow {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.bridge-slots {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.bridge-slot {
    width: 140px;
    height: 80px;
    background: rgba(255, 255, 255, 0.9);
    border: 3px dashed #cbd5e0;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
}

.bridge-slot.drag-over {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.2);
    transform: scale(1.05);
}

.bridge-slot.bridge-complete {
    background: linear-gradient(135deg, #68d391, #38a169);
    border-color: #38a169;
    animation: bridgeSuccess 0.5s ease;
}

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

.slot-number {
    position: absolute;
    top: -10px;
    left: -10px;
    background: #667eea;
    color: white;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

.slot-content {
    text-align: center;
    color: #a0aec0;
    font-size: 0.9rem;
    font-weight: 600;
}

.placed-word {
    text-align: center;
}

.placed-word .sanskrit-text {
    font-size: 1.2rem;
    font-weight: bold;
    color: #2d3748;
    margin-bottom: 5px;
}

.placed-word .english-text {
    font-size: 0.8rem;
    color: #718096;
}

.word-blocks {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.word-blocks h4 {
    text-align: center;
    color: #2d3748;
    margin-bottom: 1.5rem;
}

.draggable-words {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    justify-items: center;
}

.draggable-word {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 15px;
    border-radius: 15px;
    cursor: grab;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    user-select: none;
}

.draggable-word:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.draggable-word.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
    cursor: grabbing;
}

.draggable-word .sanskrit-text {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.draggable-word .english-text {
    font-size: 0.9rem;
    opacity: 0.9;
}

.bridge-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.correct-word {
    background: linear-gradient(135deg, #68d391, #38a169) !important;
    animation: correctPulse 0.5s ease;
}

.incorrect-word {
    background: linear-gradient(135deg, #fc8181, #e53e3e) !important;
    animation: incorrectShake 0.5s ease;
}

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

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

.level-complete {
    background: linear-gradient(135deg, #68d391, #38a169);
    color: white;
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    animation: levelComplete 1s ease;
}

@keyframes levelComplete {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

.game-feedback.hint {
    background: linear-gradient(135deg, #fbb6ce, #ed64a6);
    color: white;
}

.game-feedback.warning {
    background: linear-gradient(135deg, #fbb6ce, #ed64a6);
    color: white;
}

.game-feedback.success {
    background: linear-gradient(135deg, #68d391, #38a169);
    color: white;
}

.game-feedback.error {
    background: linear-gradient(135deg, #fc8181, #e53e3e);
    color: white;
}

@media (max-width: 768px) {
    .bridge-scene {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .left-bank, .right-bank {
        height: 80px;
    }

    .bridge-slots {
        gap: 10px;
    }

    .bridge-slot {
        width: 120px;
        height: 70px;
    }

    .draggable-words {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 10px;
    }

    .bridge-controls {
        flex-direction: column;
        align-items: center;
    }
}

.word-search-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    align-items: start;
    margin-top: 2rem;
}

.search-instructions {
    text-align: center;
    margin-top: 1rem;
    padding: 1rem;
    background: linear-gradient(145deg, #f8f9fc, #e2e8f0);
    border-radius: 10px;
    border: 1px solid #cbd5e1;
}

.search-instructions p {
    margin: 0.3rem 0;
    color: #4a5568;
    font-size: 0.9rem;
    font-weight: 500;
}

.word-list {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 15px;
    border: 2px solid #e2e8f0;
}

.word-list h3 {
    color: #2d3748;
    margin-bottom: 1rem;
    text-align: center;
}

.search-words {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.word-item {
    background: white;
    padding: 0.8rem;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
}

.word-item.found {
    background: #48bb78;
    color: white;
    border-color: #38a169;
    text-decoration: line-through;
}

.search-grid-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.search-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 2px;
    background: #2d3748;
    padding: 8px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    max-width: 500px;
    margin: 0 auto;
}

.enhanced-grid {
    background: linear-gradient(145deg, #2d3748, #4a5568);
    border: 2px solid #4a5568;
}

.enhanced-cell {
    background: linear-gradient(145deg, #ffffff, #f7fafc);
    color: #2d3748;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.enhanced-cell:hover {
    background: linear-gradient(145deg, #e2e8f0, #cbd5e1);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.search-cell {
    width: 35px;
    height: 35px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.search-cell:hover {
    background: #f0f9ff;
    border-color: #0ea5e9;
}

.search-cell.selecting {
    background: #fbbf24;
    color: white;
    border-color: #f59e0b;
}

.search-cell.found-word {
    background: #22c55e;
    color: white;
    border-color: #16a34a;
}

.word-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 2px;
    background: #e2e8f0;
    padding: 5px;
    border-radius: 10px;
    user-select: none;
    max-width: 400px;
    margin: 0 auto;
}

.grid-cell {
    width: 35px;
    height: 35px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 5px;
    border: 2px solid transparent;
}

.grid-cell:hover {
    background: #edf2f7;
    border-color: #667eea;
    transform: scale(1.05);
}

.grid-cell.selected {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: #5a67d8;
    transform: scale(1.1);
}

.grid-cell.found {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
    border-color: #38a169;
    transform: scale(1.02);
    cursor: default;
}

.grid-cell.found:hover {
    transform: scale(1.02);
}

/* Sudoku Styles */
.sudoku-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.number-guide {
    background: #f8f9fa;
    padding: 1rem 2rem;
    border-radius: 15px;
    border: 2px solid #e2e8f0;
    text-align: center;
}

.number-guide h4 {
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.number-mappings {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.number-mappings span {
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    font-weight: bold;
    font-size: 1.1rem;
}

.sudoku-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 2px;
    background: #2d3748;
    padding: 8px;
    border-radius: 10px;
    border: 3px solid #2d3748;
}

.sudoku-cell {
    width: 40px;
    height: 40px;
    background: white;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sudoku-cell input {
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    text-align: center;
    font-weight: bold;
    font-size: 1.2rem;
    background: transparent;
}

.sudoku-cell.given {
    background: #f8f9fa;
    color: #2d3748;
}

.sudoku-cell.given input {
    color: #2d3748;
    cursor: not-allowed;
}

.sudoku-cell.error {
    background: #fed7d7;
    border-color: #e53e3e;
}

.sudoku-cell.correct {
    background: #c6f6d5;
    border-color: #38a169;
}

.sudoku-cell:nth-child(3n) {
    border-right: 3px solid #2d3748;
}

.sudoku-cell:nth-child(n+19):nth-child(-n+27),
.sudoku-cell:nth-child(n+46):nth-child(-n+54) {
    border-bottom: 3px solid #2d3748;
}

.sudoku-controls {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.number-pad {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: 1.5rem 0;
    max-width: 350px;
}

.num-btn {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 50px;
}

.num-btn:hover {
    background: #f0f9ff;
    border-color: #667eea;
    transform: translateY(-2px);
}

.num-btn.selected {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: #667eea;
    transform: scale(1.05);
}

.num-btn.erase {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
    font-size: 0.9rem;
}

.num-btn.erase:hover {
    background: #fecaca;
    border-color: #f87171;
}

.num-btn.erase.selected {
    background: #dc2626;
    color: white;
    border-color: #b91c1c;
}

.sudoku-cell.selected {
    background: #e0f2fe;
    border-color: #0284c7;
    transform: scale(1.05);
}

.sudoku-cell.hint-cell {
    background: #fef3c7;
    border-color: #f59e0b;
    animation: hintPulse 2s ease-in-out;
}

@keyframes hintPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); box-shadow: 0 0 15px rgba(245, 158, 11, 0.5); }
}

.difficulty-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 1rem 0;
}

.diff-btn {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    padding: 8px 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.diff-btn:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
}

.diff-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: #667eea;
}

@media (max-width: 768px) {
    .word-search-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .word-grid {
        grid-template-columns: repeat(10, 1fr);
    }

    .grid-cell {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }

    .sudoku-grid {
        gap: 1px;
        padding: 4px;
    }

    .sudoku-cell {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .number-mappings {
        gap: 0.5rem;
    }

    .number-mappings span {
        padding: 0.3rem 0.6rem;
        font-size: 1rem;
    }
}

/* Memory Palace Game Styles */
.memory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    max-width: 600px;
    margin: 0 auto 30px;
}

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

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

.memory-card.flipped .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;
    font-weight: bold;
    border: 3px solid #e2e8f0;
}

.memory-card-front {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-size: 2rem;
}

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

.memory-card-back.sanskrit {
    background: linear-gradient(135deg, #ffecd2, #fcb69f);
}

.memory-card-back.english {
    background: linear-gradient(135deg, #a8edea, #fed6e3);
}

.memory-card.matched {
    opacity: 0.7;
    transform: scale(0.9);
}

.memory-controls {
    text-align: center;
    margin-top: 30px;
}

/* Color Quest Game Styles */
.color-question {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.color-question h3 {
    font-size: 2.5rem;
    color: #2d3748;
    margin-bottom: 10px;
}

.color-question p {
    margin: 5px 0;
    color: #4a5568;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 400px;
    margin: 0 auto 30px;
}

.color-option {
    width: 150px;
    height: 150px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.color-option:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.color-controls {
    text-align: center;
    margin-top: 30px;
}

/* Dice Challenge Game Styles */
.dice-area {
    text-align: center;
    margin-bottom: 30px;
}

.dice-display {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.dice {
    font-size: 4rem;
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    animation: rollAnimation 1s ease-in-out;
}

@keyframes rollAnimation {
    0% { transform: rotate(0deg); }
    50% { transform: rotate(180deg); }
    100% { transform: rotate(360deg); }
}

.dice-sum h3 {
    font-size: 2rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.dice-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    max-width: 500px;
    margin: 0 auto 30px;
}

.dice-option {
    background: white;
    border: none;
    padding: 20px;
    border-radius: 15px;
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.dice-option:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.dice-controls {
    text-align: center;
    margin-top: 30px;
}

/* Art Gallery Game Styles */
.gallery-display {
    text-align: center;
}

.artwork {
    margin-bottom: 30px;
}

.art-frame {
    background: white;
    padding: 30px;
    border-radius: 25px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    display: inline-block;
    border: 5px solid #f7fafc;
}

.art-image {
    font-size: 6rem;
    margin-bottom: 15px;
}

.art-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
}

.art-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    max-width: 600px;
    margin: 0 auto 30px;
}

.art-option {
    background: white;
    border: 2px solid #e2e8f0;
    padding: 15px;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    cursor: pointer;
    transition: all 0.3s ease;
}

.art-option:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    transform: translateY(-2px);
}

.gallery-controls {
    text-align: center;
    margin-top: 30px;
}

/* Word Builder Game Styles */
.word-builder-area {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.target-word {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    margin-bottom: 2rem;
}

.target-display {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 1rem 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hint-text {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-top: 0.5rem;
}

.letter-pool {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.letter-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 1rem;
}

.letter-tile {
    background: linear-gradient(135deg, #ff9a9e, #fecfef);
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 15px 20px;
    font-size: 1.8rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #2d3748;
    min-width: 50px;
    text-align: center;
    user-select: none;
}

.letter-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 154, 158, 0.4);
    border-color: #ff6b6b;
}

.letter-tile.used {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
    background: #f7fafc;
}

.word-assembly {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.assembly-area {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.drop-zone {
    background: #f7fafc;
    border: 3px dashed #cbd5e0;
    border-radius: 10px;
    padding: 15px 20px;
    font-size: 1.8rem;
    font-weight: bold;
    min-width: 50px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #a0aec0;
}

.drop-zone:hover {
    border-color: #667eea;
    background: #edf2f7;
}

.drop-zone.filled {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-color: #38b2ac;
    border-style: solid;
    color: #2d3748;
}

.drop-zone.filled:hover {
    background: linear-gradient(135deg, #81e6d9, #fbb6ce);
    transform: translateY(-2px);
}

.word-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.game-btn.secondary {
    background: linear-gradient(135deg, #a0aec0, #718096);
}

.game-btn.secondary:hover {
    background: linear-gradient(135deg, #718096, #4a5568);
}

.game-feedback {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Sentence Builder Game Styles */
.sentence-container {
    max-width: 1000px;
    margin: 0 auto;
}

.sentence-prompt {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.sentence-prompt h3 {
    color: #2d3748;
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.hint-box {
    background: linear-gradient(135deg, #ffeaa7, #fab1a0);
    padding: 1rem;
    border-radius: 15px;
    color: #2d3748;
    font-weight: 600;
}

.sentence-builder-area {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.drop-zones {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.drop-zone {
    background: white;
    border: 3px dashed #cbd5e0;
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.drop-zone.drag-active {
    border-color: #667eea;
    background: #f0f9ff;
    transform: scale(1.02);
}

.drop-zone.drag-over {
    border-color: #48bb78;
    background: #f0fff4;
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(72, 187, 120, 0.2);
}

.drop-zone.filled {
    border-color: #48bb78;
    background: linear-gradient(135deg, #f0fff4, #c6f6d5);
    border-style: solid;
}

.zone-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.drop-area {
    font-size: 1.1rem;
    color: #a0aec0;
    font-style: italic;
}

.dropped-word {
    position: relative;
    background: white;
    border-radius: 10px;
    padding: 1rem;
    border: 2px solid #48bb78;
}

.dropped-word .sanskrit-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2d3748;
    margin-bottom: 0.3rem;
}

.dropped-word .english-text {
    font-size: 1rem;
    color: #4a5568;
}

.remove-word {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #f56565;
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.remove-word:hover {
    background: #e53e3e;
    transform: scale(1.1);
}

.word-boxes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.word-box {
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border: 2px solid #f0f0f0;
}

.word-box h4 {
    color: #2d3748;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 1.2rem;
}

.word-box.subjects {
    border-color: #ff6b6b;
}

.word-box.verbs {
    border-color: #4ecdc4;
}

.word-box.objects {
    border-color: #45b7d1;
}

.word-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    max-height: 300px;
    overflow-y: auto;
}

.draggable-word {
    background: linear-gradient(135deg, #f7fafc, #edf2f7);
    border: 2px solid #dee2e6;
    border-radius: 15px;
    padding: 1.2rem 0.8rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
    line-height: 1.4;
    position: relative;
    overflow: hidden;
}

.draggable-word::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
}

.draggable-word:hover::before {
    left: 100%;
}

.draggable-word:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.draggable-word.selected {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
    border-color: #38a169;
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 35px rgba(72, 187, 120, 0.4);
}

.draggable-word .sanskrit-text {
    font-size: 1.3rem;
    font-weight: bold;
    display: block;
    margin: 0.5rem 0;
    color: #667eea;
}

.draggable-word.selected .sanskrit-text,
.draggable-word:hover .sanskrit-text {
    color: white;
}

.sentence-result {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.built-sentence {
    font-size: 1.8rem;
    color: #4a5568;
    margin-bottom: 1rem;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.built-sentence.complete {
    color: #2d3748;
}

.complete-sentence .sanskrit-sentence {
    font-size: 2.2rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.complete-sentence .english-sentence {
    font-size: 1.3rem;
    color: #4a5568;
}

.sentence-translation {
    font-style: italic;
    color: #718096;
    margin-top: 1rem;
    font-size: 1.1rem;
}

.sentence-placeholder {
    color: #a0aec0;
    font-style: italic;
}

.filled-word {
    color: #667eea;
    font-weight: bold;
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    padding: 0.3rem 0.8rem;
    border-radius: 8px;
    border: 2px solid #667eea;
}

.empty-slot {
    color: #cbd5e0;
    font-weight: bold;
    font-size: 1.5rem;
    margin: 0 0.5rem;
}

.sentence-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.sentence-feedback {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    margin-top: 1rem;
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    display: none;
    animation: feedbackSlide 0.5s ease-out;
}

@keyframes feedbackSlide {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.sentence-feedback.success {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    color: #155724;
    border: 3px solid #28a745;
}

.sentence-feedback.partial {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    color: #856404;
    border: 3px solid #ffc107;
}

.sentence-feedback.warning {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    color: #721c24;
    border: 3px solid #dc3545;
}

.sentence-feedback.info {
    background: linear-gradient(135deg, #d1ecf1, #bee5eb);
    color: #0c5460;
    border: 3px solid #17a2b8;
}

.sentence-feedback.hint {
    background: linear-gradient(135deg, #e2e3ff, #c5c6ff);
    color: #383d75;
    border: 3px solid #6366f1;
}

.sentence-feedback.levelup {
    background: linear-gradient(135deg, #f3e5f5, #e1bee7);
    color: #4a148c;
    border: 3px solid #9c27b0;
    animation: levelUpPulse 1s ease-out;
}

@keyframes dropSuccess {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); box-shadow: 0 15px 40px rgba(72, 187, 120, 0.4); }
    100% { transform: scale(1); }
}

@keyframes celebrateSuccess {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.05) rotate(1deg); }
    50% { transform: scale(1.1); }
    75% { transform: scale(1.05) rotate(-1deg); }
}

@keyframes levelUpPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); box-shadow: 0 20px 50px rgba(156, 39, 176, 0.4); }
}

@media (max-width: 768px) {
    .ingredient-sections {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .ingredient-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }

    .sentence-display {
        flex-direction: column;
        align-items: center;
        gap: 0.8rem;
    }

    .word-slot {
        min-width: 100px;
        font-size: 1rem;
    }

    .ice-cream-container {
        min-width: 160px;
        padding: 1.5rem;
    }

    .ingredient-item {
        font-size: 0.8rem;
        padding: 1rem 0.6rem;
    }

    .ingredient-item .sanskrit-word {
        font-size: 1.1rem;
    }
}

/* Snakes & Ladders Game Styles */
.snakes-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
    align-items: start;
}

.board-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 2px;
    background: #2d3748;
    padding: 10px;
    border-radius: 15px;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.board-square {
    width: 45px;
    height: 45px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.7rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.square-number {
    font-size: 0.8rem;
    color: #2d3748;
    font-weight: bold;
}

.sanskrit-number {
    font-size: 0.7rem;
    color: #667eea;
    font-weight: 600;
    margin-top: 1px;
}

.special-icon {
    font-size: 0.8rem;
    position: absolute;
    top: 2px;
    right: 2px;
}

.player-icon {
    font-size: 1rem;
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    animation: playerBounce 0.6s ease-in-out;
}

@keyframes playerBounce {
    0%, 100% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.2); }
}

.board-square.start-square {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
}

.board-square.end-square {
    background: linear-gradient(135deg, #ffd700, #ffed4a);
    color: #2d3748;
}

.board-square.snake-square {
    background: linear-gradient(135deg, #f56565, #e53e3e);
    color: white;
}

.board-square.ladder-square {
    background: linear-gradient(135deg, #4299e1, #3182ce);
    color: white;
}

.board-square.player-position {
    background: linear-gradient(135deg, #ed8936, #dd6b20);
    color: white;
    transform: scale(1.15);
    box-shadow: 0 8px 20px rgba(237, 137, 54, 0.6);
    z-index: 10;
    border-color: #ed8936;
    animation: playerPositionPulse 2s ease-in-out infinite;
}

@keyframes playerPositionPulse {
    0%, 100% { box-shadow: 0 8px 20px rgba(237, 137, 54, 0.6); transform: scale(1.15); }
    50% { box-shadow: 0 12px 30px rgba(237, 137, 54, 0.8); transform: scale(1.2); }
}

.board-square.player-position .square-number,
.board-square.player-position .sanskrit-number {
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.board-legend {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #4a5568;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.game-panel {
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    height: fit-content;
}

.dice-section {
    text-align: center;
    margin-bottom: 2rem;
}

.dice-display {
    font-size: 3rem;
    margin: 1rem 0;
    text-align: center;
    background: white;
    border-radius: 15px;
    padding: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border: 3px solid #e2e8f0;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dice-face {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.dice-face.final {
    animation: diceSuccess 0.8s ease-out;
}

@keyframes diceSuccess {
    0% { transform: scale(0.8); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.dice-number {
    font-size: 3rem;
    line-height: 1;
}

.dice-sanskrit {
    font-size: 1.5rem;
    color: #667eea;
    font-weight: bold;
    background: linear-gradient(135deg, #f7fafc, #edf2f7);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    border: 2px solid #667eea;
}

.dice-result {
    font-weight: bold;
    color: #667eea;
    margin: 1rem 0;
    font-size: 1.1rem;
}

.question-panel {
    background: linear-gradient(135deg, #f7fafc, #edf2f7);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 2px solid #e2e8f0;
}

.question-panel h3 {
    color: #2d3748;
    margin-bottom: 1rem;
    text-align: center;
}

.snakes-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.snakes-option {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.snakes-option:hover:not(:disabled) {
    background: #f0f9ff;
    border-color: #667eea;
    transform: translateY(-2px);
}

.snakes-option:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.snakes-option.correct {
    background: #48bb78;
    color: white;
    border-color: #38a169;
}

.snakes-option.incorrect {
    background: #f56565;
    color: white;
    border-color: #e53e3e;
}

.snakes-result {
    text-align: center;
    font-weight: bold;
    font-size: 1.1rem;
    min-height: 25px;
    margin-top: 1rem;
}

.game-controls {
    text-align: center;
    margin-top: 2rem;
}

.game-message {
    animation: messageSlideIn 0.3s ease-out;
}

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

@keyframes rollAnimation {
    0% { transform: rotateX(0deg) rotateY(0deg); }
    25% { transform: rotateX(90deg) rotateY(90deg); }
    50% { transform: rotateX(180deg) rotateY(180deg); }
    75% { transform: rotateX(270deg) rotateY(270deg); }
    100% { transform: rotateX(360deg) rotateY(360deg); }
}

@media (max-width: 768px) {
    .snakes-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .board-grid {
        max-width: 350px;
        margin: 0 auto;
    }

    .board-square {
        width: 30px;
        height: 30px;
        font-size: 0.7rem;
    }

    .snakes-options {
        grid-template-columns: 1fr;
    }

    .game-panel {
        order: -1;
    }
}

/* Ice Cream Game Styles */
.ice-cream-builder {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.ice-cream-display {
    background: linear-gradient(135deg, #e3f2fd, #f3e5f5);
    border-radius: 25px;
    padding: 3rem;
    margin-bottom: 3rem;
    text-align: center;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.ice-cream-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { left: -100%; }
    100% { left: 100%; }
}

.ice-cream-container {
    display: inline-block;
    position: relative;
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border: 3px solid #f0f0f0;
    min-height: 300px;
    min-width: 200px;
}

.ice-cream-cone {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.ice-cream-layers {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.ice-cream-scoop, .sauce-layer, .cream-layer {
    background: white;
    border-radius: 15px;
    padding: 1rem;
    font-size: 1.2rem;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border: 2px solid #e0e0e0;
    margin: 0.3rem 0;
    text-align: center;
    min-width: 150px;
}

.ice-cream-scoop.flavor-vanilla {
    background: linear-gradient(135deg, #fff8e1, #ffffff);
    border-color: #ffc107;
}

.ice-cream-scoop.flavor-chocolate {
    background: linear-gradient(135deg, #d7ccc8, #8d6e63);
    color: white;
    border-color: #5d4037;
}

.ice-cream-scoop.flavor-strawberry {
    background: linear-gradient(135deg, #fce4ec, #f8bbd9);
    border-color: #e91e63;
}

.ice-cream-scoop.flavor-mint {
    background: linear-gradient(135deg, #e8f5e8, #c8e6c9);
    border-color: #4caf50;
}

.sauce-layer {
    font-size: 1rem;
    padding: 0.8rem;
    opacity: 0.9;
}

.sauce-layer.sauce-caramel {
    background: linear-gradient(135deg, #ffcc80, #ff8f00);
    color: white;
}

.sauce-layer.sauce-chocolate {
    background: linear-gradient(135deg, #8d6e63, #3e2723);
    color: white;
}

.sauce-layer.sauce-berry {
    background: linear-gradient(135deg, #ce93d8, #7b1fa2);
    color: white;
}

.sauce-layer.sauce-fruit {
    background: linear-gradient(135deg, #ffab91, #e65100);
    color: white;
}

.toppings-display {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.topping {
    background: white;
    border-radius: 10px;
    padding: 0.8rem;
    font-size: 1.1rem;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border: 2px solid #ff9800;
    animation: toppingBounce 0.6s ease-out;
}

@keyframes toppingBounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes buildIceCream {
    0% { opacity: 0; transform: translateY(20px) scale(0.8); }
    50% { opacity: 0.7; transform: translateY(-10px) scale(1.1); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes celebrateIceCream {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.05) rotate(2deg); }
    50% { transform: scale(1.1) rotate(-2deg); }
    75% { transform: scale(1.05) rotate(1deg); }
}

.floating-points {
    position: absolute;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #ffd700, #ffed4a);
    color: #2d3748;
    padding: 0.8rem 1.2rem;
    border-radius: 25px;
    font-weight: bold;
    font-size: 1.5rem;
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4);
    animation: floatUp 1.5s ease-out forwards;
    z-index: 100;
}

@keyframes floatUp {
    0% { opacity: 0; transform: translateY(20px) scale(0.8); }
    30% { opacity: 1; transform: translateY(-10px) scale(1.2); }
    70% { opacity: 1; transform: translateY(-30px) scale(1); }
    100% { opacity: 0; transform: translateY(-60px) scale(0.8); }
}

/* Calligraphy Game Styles */
.calligraphy-header {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.stats-panel {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 1rem;
}

.stat-item {
    text-align: center;
    color: white;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
}

.calligraphy-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.letter-display {
    text-align: center;
    margin-bottom: 2rem;
}

.current-letter h3 {
    color: #2d3748;
    margin-bottom: 1rem;
}

.sanskrit-letter {
    font-size: 4rem;
    font-weight: bold;
    color: #667eea;
    margin: 1rem 0;
    font-family: 'Noto Sans Devanagari', serif;
}

.letter-pronunciation {
    font-size: 1.2rem;
    color: #4a5568;
    font-style: italic;
}

.tracing-area {
    text-align: center;
    margin: 2rem 0;
}

.canvas-container {
    position: relative;
    display: inline-block;
}

#trace-canvas {
    border: 3px solid #667eea;
    border-radius: 15px;
    background: white;
    cursor: crosshair;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}

.tracing-instructions {
    margin-top: 1rem;
    color: #4a5568;
}

.tracing-instructions p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.calligraphy-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.control-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.feedback-area {
    text-align: center;
    padding: 1rem;
    border-radius: 10px;
    margin: 1rem 0;
    font-weight: 500;
    display: none;
}

.feedback-area.success {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
}

.feedback-area.partial {
    background: linear-gradient(135deg, #ed8936, #dd6b20);
    color: white;
}

.feedback-area.encourage {
    background: linear-gradient(135deg, #4299e1, #3182ce);
    color: white;
}

.feedback-area.info {
    background: linear-gradient(135deg, #805ad5, #6b46c1);
    color: white;
}

.feedback-area.complete {
    background: linear-gradient(135deg, #ffd700, #ffed4a);
    color: #2d3748;
}

.progress-section {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.progress-info {
    color: white;
    font-weight: 500;
    margin-bottom: 1rem;
    text-align: center;
}

.sentence-area {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.target-sentence {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    border-radius: 15px;
    border: 3px solid #4caf50;
}

.target-sentence.easy-challenge {
    background: linear-gradient(135deg, #e8f5e8, #c8e6c9);
    border-color: #4caf50;
}

.target-sentence.medium-challenge {
    background: linear-gradient(135deg, #fff3e0, #ffcc80);
    border-color: #ff9800;
}

.target-sanskrit {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2d3748;
    margin-top: 0.5rem;
}

.built-sentence {
    text-align: center;
    margin-bottom: 1rem;
}

.sentence-display {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.word-slot {
    background: #f5f5f5;
    border: 2px dashed #ccc;
    border-radius: 10px;
    padding: 1rem;
    min-width: 120px;
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
    transition: all 0.3s ease;
}

.word-slot.filled {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border: 2px solid #2196f3;
    color: #1565c0;
    transform: scale(1.05);
}

.sentence-translation {
    font-style: italic;
    color: #666;
    margin-top: 1rem;
    font-size: 1.1rem;
}

.ingredient-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.ingredient-section {
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border: 2px solid #f0f0f0;
}

.ingredient-section h3 {
    color: #2d3748;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 1.3rem;
}

.ingredient-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.ingredient-item {
    background: linear-gradient(135deg, #f7fafc, #edf2f7);
    border: 2px solid #dee2e6;
    border-radius: 15px;
    padding: 1.2rem 0.8rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
    line-height: 1.4;
    position: relative;
    overflow: hidden;
}

.ingredient-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
}

.ingredient-item:hover::before {
    left: 100%;
}

.ingredient-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.ingredient-item.selected {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
    border-color: #38a169;
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 35px rgba(72, 187, 120, 0.4);
}

.ingredient-item .sanskrit-word {
    font-size: 1.3rem;
    font-weight: bold;
    display: block;
    margin: 0.5rem 0;
    color: #667eea;
}

.ingredient-item.selected .sanskrit-word,
.ingredient-item:hover .sanskrit-word {
    color: white;
}

.feedback-area {
    margin-top: 2rem;
}

.sentence-feedback {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    display: none;
    animation: feedbackSlide 0.5s ease-out;
}

@keyframes feedbackSlide {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.sentence-feedback.success {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    color: #155724;
    border: 3px solid #28a745;
}

.sentence-feedback.partial {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    color: #856404;
    border: 3px solid #ffc107;
}

.sentence-feedback.warning {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    color: #721c24;
    border: 3px solid #dc3545;
}

.sentence-feedback.info {
    background: linear-gradient(135deg, #d1ecf1, #bee5eb);
    color: #0c5460;
    border: 3px solid #17a2b8;
}

.sentence-feedback.hint {
    background: linear-gradient(135deg, #e2e3ff, #c5c6ff);
    color: #383d75;
    border: 3px solid #6366f1;
}

.sentence-feedback.levelup {
    background: linear-gradient(135deg, #f3e5f5, #e1bee7);
    color: #4a148c;
    border: 3px solid #9c27b0;
    animation: levelUpPulse 1s ease-out;
}

@keyframes dropSuccess {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); box-shadow: 0 15px 40px rgba(72, 187, 120, 0.4); }
    100% { transform: scale(1); }
}

@keyframes celebrateSuccess {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.05) rotate(1deg); }
    50% { transform: scale(1.1); }
    75% { transform: scale(1.05) rotate(-1deg); }
}

@keyframes levelUpPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); box-shadow: 0 20px 50px rgba(156, 39, 176, 0.4); }
}

@media (max-width: 768px) {
    .ingredient-sections {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .ingredient-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }

    .sentence-display {
        flex-direction: column;
        align-items: center;
        gap: 0.8rem;
    }

    .word-slot {
        min-width: 100px;
        font-size: 1rem;
    }

    .ice-cream-container {
        min-width: 160px;
        padding: 1.5rem;
    }

    .ingredient-item {
        font-size: 0.8rem;
        padding: 1rem 0.6rem;
    }

    .ingredient-item .sanskrit-word {
        font-size: 1.1rem;
    }
}

/* JavaScript Functions */
function startWordMatcher() {
    let selectedCards = [];
    let matchedPairs = 0;
    const totalPairs = 8; // Assuming 8 pairs of cards

    const cards = document.querySelectorAll('.matcher-card');
    cards.forEach(card => {
        card.addEventListener('click', () => {
            if (!card.classList.contains('selected') && !card.classList.contains('matched')) {
                card.classList.add('selected');
                selectedCards.push(card);

                if (selectedCards.length === 2) {
                    const [card1, card2] = selectedCards;
                    const word1 = card1.querySelector('.card-text').textContent;
                    const word2 = card2.querySelector('.card-text').textContent;

                    if (word1 === word2) {
                        card1.classList.add('matched');
                        card2.classList.add('matched');
                        matchedPairs++;
                        if (matchedPairs === totalPairs) {
                            alert('Congratulations! You matched all the words!');
                            // Optionally restart or go to next level
                        }
                    } else {
                        // Mismatch, flip them back after a short delay
                        setTimeout(() => {
                            card1.classList.remove('selected');
                            card2.classList.remove('selected');
                            selectedCards = [];
                        }, 800);
                    }
                    selectedCards = []; // Clear selection for the next pair
                }
            }
        });
    });
}

// Placeholder for other game functions
function startPuzzle() {
    console.log('Starting Puzzle Game...');
}

function startMadlibs() {
    console.log('Starting Madlibs Game...');
}

// Initialize the word matcher game when the DOM is ready
document.addEventListener('DOMContentLoaded', () => {
    if (document.querySelector('.matcher-grid')) {
        startWordMatcher();
    }
    // Add calls to other game initializers here
});

/* Settings modal functions */
function showSettings() {
    document.getElementById('settings-modal').style.display = 'block';
    applySettings();
}

function hideSettings() {
    document.getElementById('settings-modal').style.display = 'none';
}

function applySettings() {
    const themeSelect = document.getElementById('theme-select');
    const fontSizeInput = document.getElementById('font-size-input');
    const soundToggle = document.getElementById('sound-toggle');

    // Apply theme
    const selectedTheme = themeSelect.value;
    document.body.className = ''; // Remove existing themes
    document.body.classList.add(`theme-${selectedTheme}`);

    // Apply font size
    const fontSize = fontSizeInput.value;
    document.documentElement.style.fontSize = `${fontSize}px`;

    // Apply sound setting (example)
    const soundEnabled = soundToggle.checked;
    console.log('Sound enabled:', soundEnabled); // Placeholder for actual sound logic
}

// Add event listeners for settings
document.addEventListener('DOMContentLoaded', () => {
    const settingsModal = document.getElementById('settings-modal');
    if (settingsModal) {
        settingsModal.querySelector('.close').addEventListener('click', hideSettings);
        window.addEventListener('click', (event) => {
            if (event.target === settingsModal) {
                hideSettings();
            }
        });

        document.getElementById('theme-select').addEventListener('change', applySettings);
        document.getElementById('font-size-input').addEventListener('input', applySettings);
        document.getElementById('sound-toggle').addEventListener('change', applySettings);

        // Button to open settings
        const settingsButton = document.querySelector('.settings-icon'); // Assuming you have a settings icon/button
        if (settingsButton) {
            settingsButton.addEventListener('click', showSettings);
        }
    }
});
/* Theme Support */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --accent-color: #667eea;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
}

.theme-light {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --accent-color: #667eea;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
}

.theme-dark {
    --bg-primary: #1a202c;
    --bg-secondary: #2d3748;
    --text-primary: #f7fafc;
    --text-secondary: #e2e8f0;
    --accent-color: #4299e1;
    --card-bg: #2d3748;
    --border-color: #4a5568;
}

.theme-dark body {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%) !important;
    color: var(--text-primary) !important;
}

.theme-dark .homepage {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%) !important;
}

.theme-dark .navbar {
    background: rgba(26, 32, 44, 0.95) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.theme-dark .hero-section {
    background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%) !important;
}

.theme-dark .features-section,
.theme-dark .about-section,
.theme-dark .games-section,
.theme-dark .madlibs-section {
    background: var(--bg-primary) !important;
}

.theme-dark .feature-card,
.theme-dark .game-card,
.theme-dark .madlib-card,
.theme-dark .madlib-templates {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
    border: 2px solid var(--border-color) !important;
}

.theme-dark .sanskrit-card {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

.theme-dark .modal-content,
.theme-dark .game-content,
.theme-dark .flashcard-front {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

.theme-dark .modal-header {
    background: linear-gradient(135deg, #2d3748, #4a5568) !important;
    color: var(--text-primary) !important;
}

.theme-dark .setting-item,
.theme-dark .settings-section {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

.theme-dark .setting-item input,
.theme-dark .setting-item select {
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

.theme-dark h1, .theme-dark h2, .theme-dark h3, .theme-dark h4, .theme-dark h5, .theme-dark h6 {
    color: var(--text-primary) !important;
}

.theme-dark p, .theme-dark span, .theme-dark div {
    color: var(--text-primary);
}

.theme-sanskrit {
    --bg-primary: #fef5e7;
    --bg-secondary: #fff8e1;
    --text-primary: #3e2723;
    --text-secondary: #5d4037;
    --accent-color: #ff6f00;
    --card-bg: #fff8e1;
    --border-color: #ffcc80;
}

.theme-sanskrit body {
    background: linear-gradient(135deg, #fef5e7 0%, #fff8e1 100%) !important;
    color: var(--text-primary) !important;
}

.theme-sanskrit .homepage {
    background: linear-gradient(135deg, #fef5e7 0%, #fff8e1 100%) !important;
}

.theme-sanskrit .navbar {
    background: rgba(254, 245, 231, 0.95) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.theme-sanskrit .hero-section {
    background: linear-gradient(135deg, #fff8e1 0%, #ffcc80 100%) !important;
}

.theme-sanskrit .features-section,
.theme-sanskrit .about-section,
.theme-sanskrit .games-section,
.theme-sanskrit .madlibs-section {
    background: var(--bg-primary) !important;
}

.theme-sanskrit .feature-card,
.theme-sanskrit .game-card,
.theme-sanskrit .madlib-card,
.theme-sanskrit .madlib-templates {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
    border: 2px solid var(--border-color) !important;
}

.theme-sanskrit .modal-content,
.theme-sanskrit .game-content,
.theme-sanskrit .flashcard-front {
    background: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

.theme-sanskrit h1, .theme-sanskrit h2, .theme-sanskrit h3, .theme-sanskrit h4, .theme-sanskrit h5, .theme-sanskrit h6 {
    color: var(--text-primary) !important;
}

/* Animation keyframes */
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideOutRight {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100%); }
}

/* Settings styles */
.settings-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.settings-section h3 {
    color: #1a202c;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.8rem;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    padding: 1rem;
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.setting-item:hover {
    border-color: #cbd5e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.setting-item label {
    font-weight: 600;
    color: #1a202c;
    font-size: 0.95rem;
}

.setting-item input[type="checkbox"] {
    width: 22px;
    height: 22px;
    accent-color: #667eea;
    cursor: pointer;
}

.setting-item input[type="range"] {
    width: 150px;
    accent-color: #667eea;
    cursor: pointer;
}

.setting-item input[type="text"] {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.6rem;
    font-weight: 500;
    color: #1a202c;
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
}

.setting-item input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.setting-item select {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.6rem;
    font-weight: 500;
    color: #1a202c;
    font-size: 0.95rem;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.setting-item select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.settings-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2.5rem;
    flex-wrap: wrap;
    padding-top: 1.5rem;
    border-top: 2px solid #f7fafc;
}

.settings-btn {
    padding: 0.9rem 1.8rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.settings-btn.primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.settings-btn.secondary {
    background: #f7fafc;
    color: #1a202c;
    border: 2px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.settings-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.settings-btn.primary:hover {
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.settings-btn.secondary:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

/* Profile specific styles */
.profile-section {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.profile-avatar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 15px;
    border: 2px solid #e2e8f0;
}

.avatar-display {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.change-avatar-btn {
    background: #f7fafc;
    color: #1a202c;
    border: 2px solid #e2e8f0;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.change-avatar-btn:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
    transform: translateY(-1px);
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.achievements-section {
    margin-top: 2rem;
}

.achievements-section h3 {
    color: #1a202c;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.8rem;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.achievement {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease;
}

.achievement:hover {
    border-color: #cbd5e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.achievement.earned {
    border-color: #48bb78;
    background: linear-gradient(135deg, #f0fff4, #c6f6d5);
}

.achievement.locked {
    opacity: 0.6;
    background: #f7fafc;
}

.achievement-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.achievement-name {
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 0.3rem;
    font-size: 1rem;
}

.achievement-desc {
    font-size: 0.85rem;
    color: #4a5568;
}

.profile-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #f7fafc;
    flex-wrap: wrap;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    color: #2d3748;
}

/* Settings modal functions */
function showSettings() {
    document.getElementById('settings-modal').style.display = 'block';
    applySettings();
}

function hideSettings() {
    document.getElementById('settings-modal').style.display = 'none';
}

function applySettings() {
    const themeSelect = document.getElementById('theme-select');
    const fontSizeInput = document.getElementById('font-size-input');
    const soundToggle = document.getElementById('sound-toggle');

    // Apply theme
    const selectedTheme = themeSelect.value;
    document.body.className = ''; // Remove existing themes
    document.body.classList.add(`theme-${selectedTheme}`);

    // Apply font size
    const fontSize = fontSizeInput.value;
    document.documentElement.style.fontSize = `${fontSize}px`;

    // Apply sound setting (example)
    const soundEnabled = soundToggle.checked;
    console.log('Sound enabled:', soundEnabled); // Placeholder for actual sound logic
}

// Add event listeners for settings
document.addEventListener('DOMContentLoaded', () => {
    const settingsModal = document.getElementById('settings-modal');
    if (settingsModal) {
        settingsModal.querySelector('.close').addEventListener('click', hideSettings);
        window.addEventListener('click', (event) => {
            if (event.target === settingsModal) {
                hideSettings();
            }
        });

        document.getElementById('theme-select').addEventListener('change', applySettings);
        document.getElementById('font-size-input').addEventListener('input', applySettings);
        document.getElementById('sound-toggle').addEventListener('change', applySettings);

        // Button to open settings
        const settingsButton = document.querySelector('.settings-icon'); // Assuming you have a settings icon/button
        if (settingsButton) {
            settingsButton.addEventListener('click', showSettings);
        }
    }
});