/* Challenge Page Styles */
:root {
    --primary-color: #2563eb;
    --secondary-color: #3b82f6;
    --background-color: #f8fafc;
    --text-color: #1e293b;
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

main {
    margin-top: 5rem;
    padding: 2rem;
}

.instructions {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    text-align: center;
    max-width: 1200px;
    margin: 0 auto 2rem;
}

.instructions h2 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 1rem;
}

.instructions p {
    color: #64748b;
    max-width: 600px;
    margin: 0 auto;
}

.practice-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Mode Selection */
.mode-selection {
    padding: 0 1rem;
}

.challenge-modes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.mode-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 2px solid transparent;
    transition: all 0.3s ease;
    text-align: center;
}

.mode-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.mode-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.mode-card h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: #333;
}

.mode-details p {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.mode-features {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem 0;
}

.feature {
    background: #f0f4ff;
    color: #667eea;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.start-mode-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.start-mode-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
}

/* Game Screen */
.game-screen {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.game-info {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.score-display, .question-counter, .lives-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.label {
    font-weight: 600;
    color: #666;
}

#current-score, #question-number, #total-questions, #lives-count {
    font-weight: 700;
    color: #333;
    font-size: 1.2rem;
}

.hearts {
    display: flex;
    gap: 0.25rem;
}

.heart.lost {
    opacity: 0.3;
    filter: grayscale(100%);
}

.game-controls {
    display: flex;
    gap: 1rem;
}

.reveal-power-btn {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #333;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reveal-power-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.3);
}

.reveal-power-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.skip-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.skip-btn:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.quit-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quit-btn:hover {
    background: #c82333;
    transform: translateY(-2px);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Challenge Content */
.challenge-content {
    background: rgba(255, 255, 255, 0);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    min-height: 500px;
}

.question-column {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-right: 2px solid #e2e8f0;
    padding-right: 2rem;
}

.demonstration-column {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-left: 2rem;
}

.challenge-mode-content {
    text-align: center;
}

.word-prompt h2 {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-align: center;
}

.instruction {
    font-size: 1.5rem;
    color: #666;
    margin-bottom: 2rem;
    text-align: center;
}

.match-instruction h3 {
    font-size: 1.5rem;
    color: #666;
    margin-bottom: 1rem;
    text-align: center;
}

.match-instruction h2 {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 2rem;
    font-weight: 700;
    text-align: center;
}

.timer-display {
    margin: 2rem 0;
}

.timer-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 2rem;
    font-weight: 700;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.timer-circle.warning {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    animation: shake 0.5s ease-in-out infinite;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Sign Match Mode */
.match-instruction {
    margin-bottom: 2rem;
}

.match-instruction h3 {
    color: #666;
    margin-bottom: 0.5rem;
}

#match-word {
    font-size: 2.5rem;
    color: #333;
    font-weight: 700;
    text-transform: uppercase;
}

.video-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.video-option {
    text-align: center;
}

.video-option video {
    width: 100%;
    max-width: 200px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    border: 3px solid transparent;
    transition: all 0.3s ease;
}

.video-option.selected video {
    border-color: #667eea;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

.select-video-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.select-video-btn:hover {
    background: #5a67d8;
    transform: translateY(-2px);
}

.select-video-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.selection-result {
    background: #f0f8ff;
    padding: 2rem;
    border-radius: 12px;
    margin-top: 2rem;
}

/* Webcam Section */
.webcam-section {
    width: 100%;
    max-width: 400px;
}

.video-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    height: 300px;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    margin: 0 auto;
}

#webcam {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.output_canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.output {
    margin: 1rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 1rem;
}

.control-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

/* Reveal Power Modal */
.reveal-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reveal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.reveal-popup {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    z-index: 1001;
}

.reveal-video h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.reveal-video video {
    width: 100%;
    max-width: 300px;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.reveal-message {
    color: #dc3545;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.continue-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.continue-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

/* Video Options Styling */
.video-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 2rem 0;
}

.video-option {
    text-align: center;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.video-option:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.video-option.selected {
    border-color: var(--primary-color);
    background: #f0f4ff;
}

.video-option video {
    width: 100%;
    max-width: 200px;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.select-video-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.select-video-btn:hover:not(:disabled) {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.select-video-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.output_canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.output {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.control-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: #218838;
    transform: translateY(-2px);
}

/* Reveal Content */
.reveal-content {
    text-align: center;
    background: #fffacd;
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem 0;
}

.reveal-video h3 {
    color: #333;
    margin-bottom: 1rem;
}

.reveal-video video {
    width: 100%;
    max-width: 300px;
    height: 225px;
    object-fit: cover;
    border-radius: 8px;
    margin: 1rem 0;
}

.reveal-message {
    color: #856404;
    font-weight: 600;
    margin: 1rem 0;
}

.continue-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.continue-btn:hover {
    background: #5a67d8;
    transform: translateY(-2px);
}

/* Results Screen */
.results-screen {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 1rem;
}

.results-content {
    background: white;
    border-radius: 16px;
    padding: 3rem 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    text-align: center;
}

#results-title {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 2rem;
}

.final-score {
    font-size: 3rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 2rem;
}

.score-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.stat {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-label {
    color: #666;
    font-weight: 600;
}

.performance-message {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    margin: 2rem 0;
}

.results-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.play-again-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.play-again-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.3);
}

.back-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* Model Selection */
.model-selection-section {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .challenge-modes {
        grid-template-columns: 1fr;
    }
    
    .challenge-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .question-column {
        border-right: none;
        border-bottom: 2px solid #e2e8f0;
        padding-right: 0;
        padding-bottom: 2rem;
    }
    
    .demonstration-column {
        padding-left: 0;
        padding-top: 2rem;
    }
    
    .game-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .game-info {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .video-options {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .results-actions {
        flex-direction: column;
    }
    
    .word-prompt h2 {
        font-size: 2rem;
    }
    
    .final-score {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .challenge-header h1 {
        font-size: 2rem;
    }
    
    .mode-card {
        padding: 1.5rem;
    }
    
    .challenge-content {
        padding: 1.5rem;
    }
    
    .word-prompt h2 {
        font-size: 1.8rem;
    }
}

