/* Color Naming Game Styles */

/* Game Mode Selection */
.game-mode-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transform: translateY(0);
    animation: cardSlideIn 0.6s ease-out;
}

.game-mode-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 15px 40px rgba(99, 102, 241, 0.3);
}

.game-mode-card:active {
    transform: translateY(-3px) scale(0.98);
    transition: all 0.1s ease;
}

.game-mode-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.game-mode-card:hover::before {
    opacity: 1;
}

.game-mode-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2rem;
    color: white;
    position: relative;
    z-index: 2;
}

.game-mode-card h3 {
    margin-bottom: 1rem;
    color: white;
    position: relative;
    z-index: 2;
}

.game-mode-card p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 2;
}

.difficulty-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    position: relative;
    z-index: 2;
}

.difficulty-badge.beginner {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
}

.difficulty-badge.easy {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.difficulty-badge.medium {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.difficulty-badge.advanced {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white;
}

.difficulty-badge.expert {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

/* Game Container */
.game-stats-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

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

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #6366f1;
}

.stat-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
}

.progress-container {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 10px;
    transition: width 0.3s ease;
    width: 0%;
}

.game-controls {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    align-items: center;
}

/* Question Card */
.question-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    animation: questionTransition 0.8s ease-out;
}

.question-card.transitioning {
    animation: questionTransition 0.8s ease-in-out;
}

.question-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #06b6d4);
    animation: progressSlide 1s ease-out forwards;
}

.question-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.05), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.question-card:hover::after {
    opacity: 1;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.question-type-badge {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

/* Color Display */
.color-display-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
}

.main-color-swatch {
    width: 200px;
    height: 200px;
    border-radius: 20px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    transform: scale(0.8) rotateY(90deg);
    opacity: 0;
    animation: colorSwatchReveal 0.8s ease-out forwards;
}

.main-color-swatch:hover {
    transform: scale(1.05) rotateY(0deg);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.main-color-swatch::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.1) 50%, transparent 100%);
}

.color-info {
    text-align: center;
}

.color-hex {
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
    margin-bottom: 0.5rem;
    font-family: 'Courier New', monospace;
}

.color-rgb {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    font-family: 'Courier New', monospace;
}

/* Answer Grid */
.answer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.answer-option {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    position: relative;
    overflow: hidden;
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
    user-select: none;
}

/* Removed problematic animation delays */

.answer-option:hover {
    border-color: rgba(99, 102, 241, 0.5);
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.2);
}

.answer-option:active {
    transform: translateY(-1px) scale(0.98);
    transition: all 0.1s ease;
}

.answer-option.selected {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.2);
}

.answer-option.correct {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.2);
    animation: correctAnswer 0.6s ease, correctGlow 1s ease-out;
    transform: scale(1.05);
}

.answer-option.incorrect {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.2);
    animation: incorrectShake 0.6s ease;
    transform: scale(0.98);
}

.answer-option.selected-correct {
    animation: cardFlip 0.8s ease-in-out, correctGlow 1s ease-out;
}

.answer-option.selected-incorrect {
    animation: incorrectShake 0.6s ease, cardFlip 0.8s ease-in-out;
}

.answer-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@keyframes correctAnswer {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

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

.answer-color-swatch {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    margin: 0 auto 0.5rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: scale(1);
    position: relative;
    overflow: hidden;
}

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

.answer-option:hover .answer-color-swatch {
    transform: scale(1.1) rotate(5deg);
    border-color: rgba(255, 255, 255, 0.5);
}

.answer-option:hover .answer-color-swatch::before {
    left: 100%;
}

.answer-text {
    font-weight: bold;
    color: white;
    margin-bottom: 0.5rem;
}

.answer-hex {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    font-family: 'Courier New', monospace;
}

/* Feedback */
.answer-feedback {
    text-align: center;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.answer-feedback.correct {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.answer-feedback.incorrect {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

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

.feedback-icon.correct::before {
    content: "✓";
    color: #10b981;
}

.feedback-icon.incorrect::before {
    content: "✗";
    color: #ef4444;
}

.feedback-text {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.feedback-explanation {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

/* Results */
.results-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 3rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.results-header {
    margin-bottom: 2rem;
}

.results-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 3rem;
    color: white;
    animation: trophy-bounce 2s ease-in-out infinite;
}

@keyframes trophy-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.final-score {
    margin-bottom: 2rem;
}

.score-value {
    font-size: 4rem;
    font-weight: bold;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.score-label {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
}

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

.result-item {
    text-align: center;
}

.result-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #6366f1;
}

.result-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
}

.performance-message {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.results-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Leaderboard */
.leaderboard-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem;
}

.leaderboard-list {
    max-height: 300px;
    overflow-y: auto;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border-left: 4px solid #6366f1;
}

.leaderboard-rank {
    font-weight: bold;
    color: #6366f1;
    width: 30px;
}

.leaderboard-info {
    flex: 1;
    margin-left: 1rem;
}

.leaderboard-mode {
    font-weight: bold;
    color: white;
}

.leaderboard-date {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.leaderboard-score {
    font-weight: bold;
    color: #fbbf24;
    font-size: 1.1rem;
}

/* Game Icon Animation */
.game-icon {
    animation: game-pulse 3s ease-in-out infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .answer-grid {
        grid-template-columns: 1fr;
    }
    
    .color-display-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .main-color-swatch {
        width: 150px;
        height: 150px;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .results-actions {
        flex-direction: column;
    }
    
    .game-mode-card {
        min-height: 250px;
    }
}

/* Loading and Animation States */
.loading-shimmer {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.1) 100%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

/* Card Animation Keyframes */
@keyframes cardSlideIn {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

@keyframes colorSwatchReveal {
    0% {
        opacity: 0;
        transform: scale(0.8) rotateY(90deg);
    }
    50% {
        opacity: 0.7;
        transform: scale(0.9) rotateY(45deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotateY(0deg);
    }
}

@keyframes colorPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    }
}

@keyframes cardFlip {
    0% {
        transform: rotateY(0deg);
    }
    50% {
        transform: rotateY(90deg);
    }
    100% {
        transform: rotateY(0deg);
    }
}

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

@keyframes correctGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

@keyframes incorrectShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

@keyframes questionTransition {
    0% {
        opacity: 1;
        transform: translateX(0);
    }
    50% {
        opacity: 0;
        transform: translateX(-20px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes statUpdate {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
        color: #6366f1;
    }
    100% {
        transform: scale(1);
    }
}