/* TypingMaster Pro - Games Stylesheet */

/* Word Sprint Game */
.game-word-sprint {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.game-word-sprint .game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.game-word-sprint .game-title {
    font-size: 28px;
    font-weight: 700;
    color: #0066ff;
}

.game-word-sprint .game-timer {
    font-size: 32px;
    font-weight: 700;
    color: #0066ff;
    font-variant-numeric: tabular-nums;
}

.game-word-sprint .word-display {
    background: #f9f9f9;
    padding: 40px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 30px;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-word-sprint .current-word {
    font-size: 48px;
    font-weight: 700;
    color: #0066ff;
    letter-spacing: 2px;
}

.game-word-sprint .word-input {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 20px;
    font-family: 'Courier New', monospace;
    transition: all 0.3s ease;
}

.game-word-sprint .word-input:focus {
    outline: none;
    border-color: #0066ff;
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

.game-word-sprint .word-input.correct {
    border-color: #00d084;
    background: rgba(0, 208, 132, 0.05);
}

.game-word-sprint .word-input.error {
    border-color: #ff3333;
    background: rgba(255, 51, 51, 0.05);
}

.game-word-sprint .game-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.game-word-sprint .game-stat {
    background: #f0f0f0;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
}

.game-word-sprint .game-stat .label {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
}

.game-word-sprint .game-stat .value {
    font-size: 24px;
    font-weight: 700;
    color: #0066ff;
}

/* Code Master Game */
.game-code-master {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.game-code-master .code-snippet {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 20px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.5;
    overflow-x: auto;
}

.game-code-master .code-line {
    margin-bottom: 10px;
}

.game-code-master .code-line .typed {
    color: #4ec9b0;
    background: rgba(78, 201, 176, 0.1);
}

.game-code-master .code-line .current {
    color: #ce9178;
    background: #333;
    border-bottom: 2px solid #ce9178;
}

.game-code-master .code-line .error {
    color: #f48771;
    text-decoration: wavy underline #f48771;
}

.game-code-master .code-input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
    transition: all 0.3s ease;
}

.game-code-master .code-input:focus {
    outline: none;
    border-color: #0066ff;
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

/* Accuracy Race Game */
.game-accuracy-race {
    background: white;
    padding: 30px;
    border-radius: 8px;
}

.game-accuracy-race .accuracy-bar {
    height: 12px;
    background: #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 20px;
}

.game-accuracy-race .accuracy-fill {
    height: 100%;
    background: linear-gradient(90deg, #0066ff, #00b4d8);
    width: 100%;
    transition: width 0.2s ease;
}

.game-accuracy-race .accuracy-fill.low {
    background: #ff3333;
}

.game-accuracy-race .accuracy-fill.medium {
    background: #ffa500;
}

.game-accuracy-race .accuracy-fill.high {
    background: #00d084;
}

/* Rapid Fire Game */
.game-rapid-fire {
    background: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
}

.game-rapid-fire .difficulty-level {
    display: inline-block;
    padding: 8px 16px;
    background: #f0f0f0;
    border-radius: 20px;
    font-weight: 600;
    color: #0066ff;
    margin-bottom: 30px;
}

.game-rapid-fire .current-challenge {
    font-size: 36px;
    font-weight: 700;
    color: #0066ff;
    margin-bottom: 30px;
    letter-spacing: 1px;
}

.game-rapid-fire .challenge-progress {
    display: flex;
    gap: 8px;
    margin-bottom: 30px;
    justify-content: center;
}

.game-rapid-fire .progress-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e0e0e0;
    transition: all 0.3s ease;
}

.game-rapid-fire .progress-dot.completed {
    background: #00d084;
}

.game-rapid-fire .progress-dot.current {
    background: #0066ff;
    width: 16px;
    height: 16px;
}

.game-rapid-fire .progress-dot.pending {
    background: #e0e0e0;
}

/* Story Mode */
.game-story-mode {
    background: white;
    padding: 30px;
    border-radius: 8px;
}

.game-story-mode .story-text {
    background: #f9f9f9;
    padding: 30px;
    border-radius: 6px;
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 30px;
    color: #1a1a1a;
}

.game-story-mode .story-text .typed {
    color: #00d084;
    font-weight: 600;
}

.game-story-mode .story-text .current {
    background: #0066ff;
    color: white;
    padding: 0 2px;
    border-radius: 2px;
}

.game-story-mode .story-text .error {
    color: #ff3333;
    background: rgba(255, 51, 51, 0.1);
}

.game-story-mode .story-input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    font-family: 'Courier New', monospace;
    resize: vertical;
    transition: all 0.3s ease;
}

.game-story-mode .story-input:focus {
    outline: none;
    border-color: #0066ff;
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

/* Typo Hunt Game */
.game-typo-hunt {
    background: white;
    padding: 30px;
    border-radius: 8px;
}

.game-typo-hunt .sentence-display {
    background: #f9f9f9;
    padding: 30px;
    border-radius: 6px;
    font-size: 18px;
    line-height: 1.8;
    margin-bottom: 30px;
    cursor: pointer;
}

.game-typo-hunt .sentence-display .word {
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: inline-block;
    margin: 2px;
}

.game-typo-hunt .sentence-display .word:hover {
    background: rgba(0, 102, 255, 0.1);
}

.game-typo-hunt .sentence-display .word.typo {
    background: #ffe0e0;
    color: #ff3333;
    font-weight: 600;
}

.game-typo-hunt .sentence-display .word.corrected {
    background: #e0ffe0;
    color: #00d084;
}

.game-typo-hunt .correction-input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    margin-bottom: 15px;
}

.game-typo-hunt .correction-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

.game-typo-hunt .correction-btn {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.game-typo-hunt .correction-btn:hover {
    border-color: #0066ff;
    color: #0066ff;
}

.game-typo-hunt .correction-btn.selected {
    background: #0066ff;
    color: white;
    border-color: #0066ff;
}

/* Leaderboard */
.leaderboard {
    background: white;
    padding: 30px;
    border-radius: 8px;
    margin-top: 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.leaderboard h3 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #0066ff;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table th {
    text-align: left;
    padding: 15px;
    border-bottom: 2px solid #e0e0e0;
    font-weight: 600;
    background: #f9f9f9;
}

.leaderboard-table td {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.leaderboard-table tr:hover {
    background: #f9f9f9;
}

.leaderboard-rank {
    font-weight: 700;
    color: #0066ff;
    font-size: 18px;
}

.leaderboard-rank.gold {
    color: #ffa500;
}

.leaderboard-rank.silver {
    color: #c0c0c0;
}

.leaderboard-rank.bronze {
    color: #cd7f32;
}

/* Achievements */
.achievements-section {
    margin-top: 40px;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 20px;
}

.achievement-badge {
    text-align: center;
    padding: 15px;
    border-radius: 8px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.achievement-badge:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.achievement-badge.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.achievement-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.achievement-name {
    font-weight: 600;
    font-size: 12px;
    color: #0066ff;
    margin-bottom: 5px;
}

.achievement-description {
    font-size: 10px;
    color: #666;
}

/* Animations */
@keyframes wordBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.game-complete-animation {
    animation: slideIn 0.5s ease;
}

/* Game Results Modal */
.game-results-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.game-results-content {
    background: white;
    padding: 40px;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.5s ease;
}

.game-results-content h2 {
    font-size: 32px;
    margin-bottom: 30px;
    color: #0066ff;
    text-align: center;
}

.game-results-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.game-result-item {
    text-align: center;
}

.game-result-item .label {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
}

.game-result-item .value {
    font-size: 28px;
    font-weight: 700;
    color: #0066ff;
}
