/* Game-specific styles for all games */

/* Common game container styles */
.game-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    width: 100%;
    padding: 30px;
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.game-header {
    margin-bottom: 30px;
}

.game-header h1 {
    color: #4a5568;
    font-size: 2.5rem;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.score-display {
    display: flex;
    justify-content: space-around;
    font-size: 1.2rem;
    font-weight: bold;
    color: #2d3748;
}

.score-display span {
    background: #f7fafc;
    padding: 10px 20px;
    border-radius: 25px;
    border: 2px solid #e2e8f0;
}

.game-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Emotion Match Game Specific Styles */
.emotion-display {
    margin-bottom: 40px;
}

.main-emotion {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.emotion-face {
    font-size: 8rem;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s ease;
}

.emotion-face.large {
    font-size: 10rem;
}

.emotion-face:hover {
    transform: scale(1.1);
}

.instruction {
    font-size: 1.5rem;
    color: #4a5568;
    font-weight: bold;
}

/* Face Recognition Styles */
#face-video {
    border: 3px solid #4facfe;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

#face-video:hover {
    transform: scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

#face-canvas {
    pointer-events: none;
}

.camera-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 15px 0;
    flex-wrap: wrap;
}

.camera-controls .btn {
    font-size: 0.9rem;
    padding: 8px 16px;
}

/* Face detection status indicator */
.face-status {
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px;
    margin: 10px 0;
    font-size: 0.9rem;
    color: #4a5568;
}

.face-status.detected {
    background: #c6f6d5;
    border-color: #68d391;
    color: #22543d;
}

.face-status.not-detected {
    background: #fed7d7;
    border-color: #fc8181;
    color: #742a2a;
}

.matching-area {
    margin-bottom: 30px;
}

.options-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    max-width: 600px;
    margin: 0 auto;
}

.emotion-option {
    background: #f7fafc;
    border: 3px solid #e2e8f0;
    border-radius: 15px;
    padding: 20px;
    font-size: 1.3rem;
    font-weight: bold;
    color: #2d3748;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.emotion-option:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.emotion-option:focus {
    outline: 3px solid #4facfe;
    outline-offset: 2px;
}

.emotion-option.correct {
    background: #c6f6d5;
    border-color: #68d391;
    color: #22543d;
}

.emotion-option.incorrect {
    background: #fed7d7;
    border-color: #fc8181;
    color: #742a2a;
}

.emotion-option.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.feedback-area {
    margin-bottom: 30px;
}

.feedback-message {
    font-size: 1.4rem;
    font-weight: bold;
    margin-bottom: 15px;
    min-height: 2rem;
}

.feedback-message.correct {
    color: #22543d;
}

.feedback-message.incorrect {
    color: #742a2a;
}

.feedback-message.help {
    color: #2b6cb0;
    text-align: left;
    background: #ebf8ff;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #3182ce;
}

.feedback-message.help h3 {
    margin-bottom: 15px;
    color: #2d3748;
}

.feedback-message.help h4 {
    margin: 15px 0 10px 0;
    color: #2d3748;
}

.feedback-message.help ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.feedback-message.help li {
    margin-bottom: 8px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin: 0 auto;
    max-width: 400px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #48bb78, #38a169);
    width: 0%;
    transition: width 0.5s ease;
}

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

/* Coming Soon Game Styles */
.coming-soon-game {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.coming-soon-game h2 {
    color: #4a5568;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.coming-soon-game p {
    color: #666;
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.placeholder-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 3rem;
    color: white;
}

.large-icon {
    font-size: 5rem;
    display: block;
    margin-bottom: 1rem;
}

.placeholder-content p {
    color: white;
    font-size: 1.3rem;
    font-weight: bold;
}

/* Responsive Design for Games */
@media (max-width: 768px) {
    .game-container {
        padding: 20px;
        margin: 10px;
    }
    
    .game-header h1 {
        font-size: 2rem;
    }
    
    .emotion-face.large {
        font-size: 6rem;
    }
    
    .emotion-face {
        font-size: 5rem;
    }
    
    #face-video {
        width: 280px !important;
        height: 210px !important;
    }
    
    #face-canvas {
        width: 280px !important;
        height: 210px !important;
    }
    
    .options-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .emotion-option {
        padding: 15px;
        font-size: 1.1rem;
        min-height: 60px;
    }
    
    .score-display {
        flex-direction: column;
        gap: 10px;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .camera-controls {
        flex-direction: column;
        align-items: center;
    }
}

/* High contrast mode for accessibility */
@media (prefers-contrast: high) {
    .emotion-option {
        border-width: 4px;
    }
    
    .btn {
        border: 2px solid #000;
    }
    
    #face-video {
        border-width: 4px;
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

body, .emotion-face, .emotion-option {
    font-family: 'Comic Neue', 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
}

/* --- Playful Modern Additions for Games --- */
.game-container {
    background: linear-gradient(135deg, #fffbe7 0%, #ffcc33 100%);
    border-radius: 30px;
    box-shadow: 0 12px 48px rgba(255, 179, 71, 0.10), 0 2px 8px rgba(162, 89, 196, 0.08);
    padding: 40px 30px;
    position: relative;
    z-index: 1;
}

.game-header h1 {
    font-family: 'Fredoka One', 'Comic Neue', cursive;
    color: #ffb347;
    text-shadow: 2px 2px 8px rgba(255, 204, 51, 0.15);
}

.emotion-face, .emotion-face.large {
    filter: drop-shadow(0 12px 32px rgba(255, 179, 71, 0.10));
    transition: transform 0.25s cubic-bezier(.68,-0.55,.27,1.55);
}
.emotion-face:hover {
    transform: scale(1.15) rotate(-3deg);
}

.emotion-option {
    border-radius: 20px;
    background: linear-gradient(90deg, #ffb347 0%, #a259c4 100%);
    color: #fff;
    font-size: 1.2rem;
    font-family: 'Fredoka One', 'Comic Neue', cursive;
    box-shadow: 0 4px 16px rgba(255, 179, 71, 0.10);
    transition: transform 0.18s cubic-bezier(.68,-0.55,.27,1.55), box-shadow 0.18s;
}
.emotion-option:hover, .emotion-option:focus {
    transform: scale(1.08) rotate(-2deg);
    box-shadow: 0 8px 32px rgba(255, 179, 71, 0.18);
    filter: brightness(1.1);
}

.emotion-option.correct {
    background: linear-gradient(90deg, #c6f6d5 0%, #ffcc33 100%);
    color: #22543d;
}
.emotion-option.incorrect {
    background: linear-gradient(90deg, #fed7d7 0%, #a259c4 100%);
    color: #742a2a;
}

.score-display span {
    background: linear-gradient(90deg, #a259c4 0%, #ffb347 100%);
    color: #fff;
    font-family: 'Fredoka One', 'Comic Neue', cursive;
    font-size: 1.1rem;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(255, 179, 71, 0.10);
}

/* Bouncy feedback message */
.feedback-message {
    animation: bounceIn 0.6s cubic-bezier(.68,-0.55,.27,1.55);
}
@keyframes bounceIn {
    0% { opacity: 0; transform: scale(0.7); }
    60% { opacity: 1; transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}

/* Accessibility: Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition: none !important;
        animation: none !important;
    }
}

.sticky-header {
    position: sticky;
    top: 0;
    background: linear-gradient(90deg, #fffbe7 0%, #ffcc33 100%);
    z-index: 10;
    box-shadow: 0 2px 12px rgba(255, 179, 71, 0.10);
}
.fixed-controls {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, #fffbe7 0%, #ffcc33 100%);
    box-shadow: 0 -2px 12px rgba(255, 179, 71, 0.10);
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1.2rem 0 1.2rem 0;
    z-index: 20;
}
@media (max-width: 768px) {
    .fixed-controls {
        flex-direction: column;
        gap: 1rem;
        padding: 0.8rem 0 0.8rem 0;
    }
}
.animated-bar span, .animated-bar #timer-area {
    transition: color 0.3s, background 0.3s, transform 0.3s;
    font-size: 1.2rem;
    font-weight: bold;
}
.animated-bar span.updated, .animated-bar #timer-area.updated {
    color: #ff9800;
    transform: scale(1.15);
    background: #fffbe7;
}
.animated-face {
    animation: faceBounceIn 0.7s cubic-bezier(.68,-0.55,.27,1.55);
}
@keyframes faceBounceIn {
    0% { opacity: 0; transform: scale(0.7); }
    60% { opacity: 1; transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}
.animated-options .emotion-option {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    animation: optionFadeIn 0.5s forwards;
}
.animated-options .emotion-option:nth-child(1) { animation-delay: 0.05s; }
.animated-options .emotion-option:nth-child(2) { animation-delay: 0.15s; }
.animated-options .emotion-option:nth-child(3) { animation-delay: 0.25s; }
.animated-options .emotion-option:nth-child(4) { animation-delay: 0.35s; }
@keyframes optionFadeIn {
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.animated-feedback {
    animation: feedbackPop 0.5s cubic-bezier(.68,-0.55,.27,1.55);
}
@keyframes feedbackPop {
    0% { opacity: 0; transform: scale(0.7); }
    60% { opacity: 1; transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}

/* Responsive and Dynamic Enhancements */
@media (max-width: 1024px) {
    .game-container {
        max-width: 98vw;
        padding: 20px 5px;
    }
    .game-header h1 {
        font-size: 2rem;
    }
    .emotion-face.large {
        font-size: 6rem;
    }
    .emotion-face {
        font-size: 4rem;
    }
    .scorebar {
        flex-direction: column;
        gap: 0.5rem;
    }
}
@media (max-width: 600px) {
    .game-container {
        padding: 8px 2px;
        border-radius: 12px;
    }
    .game-header h1 {
        font-size: 1.2rem;
    }
    .emotion-face.large {
        font-size: 3.2rem;
    }
    .emotion-face {
        font-size: 2.2rem;
    }
    .scorebar {
        font-size: 1rem;
    }
    .options-container {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .controls.fixed-controls {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.5rem 0;
    }
    .btn {
        font-size: 1rem;
        padding: 10px 16px;
        min-width: 90vw;
        max-width: 100vw;
    }
}
/* Ensure controls never overlap content */
.game-main {
    margin-bottom: 90px;
}
@media (max-width: 600px) {
    .game-main {
        margin-bottom: 120px;
    }
}
/* Make option buttons larger and more touch-friendly */
.emotion-option {
    min-height: 56px;
    font-size: 1.2rem;
    border-radius: 24px;
    padding: 18px 10px;
    margin: 0 0 4px 0;
    box-shadow: 0 2px 8px rgba(255, 179, 71, 0.10);
    transition: background 0.2s, color 0.2s, transform 0.2s;
}
.emotion-option:active {
    background: #ffe082;
    color: #333;
    transform: scale(0.97);
}
/* Subtle animated background for playfulness */
.game-container::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 0;
    background: repeating-linear-gradient(135deg, #fffbe7 0 20px, #ffecb3 20px 40px);
    opacity: 0.18;
    pointer-events: none;
    animation: bgMove 12s linear infinite;
}
@keyframes bgMove {
    0% { background-position: 0 0; }
    100% { background-position: 120px 120px; }
}

html, body {
    scroll-behavior: smooth;
}

/* Ensure .fixed-controls never blocks content */
.fixed-controls {
    box-shadow: 0 -2px 12px rgba(255, 179, 71, 0.10);
    z-index: 30;
}

/* Focus outlines for keyboard navigation */
.btn:focus, .emotion-option:focus {
    outline: 3px solid #4facfe;
    outline-offset: 2px;
    z-index: 2;
}

/* Allow vertical scrolling in modal if needed */
.modal-content.game-modal {
    max-height: 98vh;
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* Playful, attractive score and level display */
.scorebar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin: 1.2rem 0 1.2rem 0;
    font-size: 1.5rem;
    font-family: 'Fredoka One', 'Comic Neue', cursive;
    background: linear-gradient(90deg, #fffbe7 0%, #ffe082 100%);
    border-radius: 18px;
    box-shadow: 0 2px 12px rgba(255, 179, 71, 0.10);
    padding: 0.7rem 1.5rem;
    position: relative;
    z-index: 2;
}
.scorebar span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: #fffbe7;
    border-radius: 14px;
    padding: 0.4rem 1.1rem;
    font-size: 1.3em;
    font-weight: bold;
    color: #ff9800;
    box-shadow: 0 1px 6px rgba(255, 179, 71, 0.10);
    text-shadow: 1px 2px 8px #ffe082;
    border: 2px solid #ffcc33;
    transition: background 0.3s, color 0.3s, box-shadow 0.3s;
    position: relative;
}
.scorebar span#timer-area {
    color: #4facfe;
    background: #e3f6ff;
    border: 2px solid #4facfe;
    text-shadow: 1px 2px 8px #b3e0ff;
}
.scorebar span::before {
    content: attr(data-emoji);
    margin-right: 0.3em;
    font-size: 1.2em;
    filter: drop-shadow(0 2px 4px #ffe082);
}
#score::before { content: '⭐'; }
#level::before { content: '🎯'; }
#timer-area::before { content: '⏰'; }
.scorebar span.glow {
    box-shadow: 0 0 16px 4px #ffe082, 0 1px 6px rgba(255, 179, 71, 0.10);
    background: #fffde4;
    color: #ffb347;
    animation: glowPulse 1.2s infinite alternate;
}
@keyframes glowPulse {
    from { box-shadow: 0 0 8px 2px #ffe082; }
    to { box-shadow: 0 0 24px 8px #ffe082; }
}

/* Playful decorations for in-game section */
.game-container {
    position: relative;
    overflow: visible;
}
.game-container .decoration-emoji {
    position: absolute;
    z-index: 1;
    opacity: 0.25;
    pointer-events: none;
    font-size: 3.5rem;
    user-select: none;
    filter: blur(0.5px) drop-shadow(0 2px 8px #ffe082);
}
.game-container .decoration-emoji.emoji1 { left: 2%; top: 2%; }
.game-container .decoration-emoji.emoji2 { right: 3%; top: 8%; }
.game-container .decoration-emoji.emoji3 { left: 5%; bottom: 8%; }
.game-container .decoration-emoji.emoji4 { right: 5%; bottom: 5%; }