/* Tech Games Modal Styles */
.tech-games-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(41, 39, 42, 0.95);
    /* Matches --bg-charcoal */
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.tech-games-modal-content {
    background: var(--bg-card, #1e1e1e);
    border: 2px solid var(--accent-green, #00ff9d);
    border-radius: 20px;
    width: 95%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 0 30px rgba(0, 255, 157, 0.2);
    /* Green glow */
    animation: slideInUp 0.4s ease-out;
}

.tech-games-modal-header {
    background: rgba(20, 20, 20, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 20px 20px 0 0;
    padding: 20px 30px;
    border-bottom: 2px solid var(--accent-green, #00ff9d);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tech-games-modal-header h2 {
    color: var(--text-white, #ececec);
    margin: 0;
    font-size: 1.8em;
    font-family: var(--font-heading, "Space Grotesk", sans-serif);
    font-weight: 700;
}

.tech-games-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--accent-green, #00ff9d);
    color: var(--accent-green, #00ff9d);
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-weight: bold;
}

.tech-games-close-btn:hover {
    background: var(--accent-green, #00ff9d);
    color: var(--bg-charcoal, #29272a);
    transform: scale(1.1);
    box-shadow: 0 0 15px var(--accent-green, #00ff9d);
}

.tech-games-modal-body {
    padding: 30px;
}

/* Game Selection Styles */
.tech-game-selection h3 {
    color: var(--text-white, #ececec);
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.5em;
    font-family: var(--font-heading, "Space Grotesk", sans-serif);
    font-weight: 600;
}

.tech-games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 20px;
}

/* Removed special typing test layout to match Arcade grid */

.tech-game-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(5px);
}

.tech-game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 255, 157, 0.2);
    border-color: var(--accent-green, #00ff9d);
    background: rgba(255, 255, 255, 0.08);
}

.tech-game-icon {
    font-size: 3em;
    margin-bottom: 15px;
    display: block;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}

.tech-game-card h4 {
    color: var(--text-white, #ececec);
    margin-bottom: 10px;
    font-size: 1.3em;
    font-weight: 600;
    font-family: var(--font-heading, "Space Grotesk", sans-serif);
}

.tech-game-card p {
    color: var(--text-muted, #a0a0a0);
    margin-bottom: 15px;
    font-size: 0.95em;
    line-height: 1.4;
    font-family: var(--font-body, "Inter", sans-serif);
}

.difficulty-badge {
    background: rgba(0, 255, 157, 0.1);
    color: var(--accent-green, #00ff9d);
    border: 1px solid var(--accent-green, #00ff9d);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 20px;
    font-family: var(--font-mono, "Space Mono", monospace);
}

.start-tech-game-btn {
    background: transparent;
    color: var(--accent-green, #00ff9d);
    border: 2px solid var(--accent-green, #00ff9d);
    padding: 10px 25px;
    border-radius: 25px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    font-family: var(--font-heading, "Space Grotesk", sans-serif);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.start-tech-game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(0, 255, 157, 0.4);
    background: var(--accent-green, #00ff9d);
    color: var(--bg-charcoal, #29272a);
}

/* Game Play Styles */
.tech-game-play {
    color: var(--text-white, #ececec);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--accent-purple, #bd93f9);
    border-radius: 15px;
    padding: 20px;
}

.game-info h3 {
    margin: 0 0 10px 0;
    font-size: 1.4em;
    font-weight: 600;
    font-family: var(--font-heading, "Space Grotesk", sans-serif);
    color: var(--accent-purple, #bd93f9);
}

/* Removed empty game-stats ruleset */

@media (max-width: 768px) {
    .tech-games-modal-content {
        width: 100%;
        height: 100%;
        border-radius: 0;
        max-height: 100vh;
    }

    .tech-games-modal-header {
        position: sticky;
        top: 0;
        z-index: 10;
        background: var(--bg-charcoal, #29272a);
    }

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

/* Fixed orphaned properties */

.game-stats span {
    background: rgba(255, 105, 0, 0.2);
    border: 1px solid #64B5F6;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 600;
    color: #64B5F6;
}

.back-btn {
    background: rgba(255, 105, 0, 0.2);
    color: #64B5F6;
    border: 2px solid #64B5F6;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: #64B5F6;
    color: #000000;
    transform: translateY(-2px);
}

.question-container {
    margin-bottom: 20px;
}

.question-card {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border: 2px solid #64B5F6;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(255, 105, 0, 0.1);
}

.question-card h4 {
    font-size: 1.2em;
    margin-bottom: 25px;
    line-height: 1.5;
    color: #ffffff;
}

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

.option-btn {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    border: 2px solid rgba(255, 105, 0, 0.3);
    padding: 15px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s ease;
    text-align: left;
}

.option-btn:hover:not(:disabled) {
    background: rgba(255, 105, 0, 0.1);
    border-color: #64B5F6;
    transform: translateX(5px);
}

.option-btn.correct {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    border-color: #4CAF50;
    color: #ffffff;
}

.option-btn.incorrect {
    background: linear-gradient(45deg, #f44336, #d32f2f);
    border-color: #f44336;
    color: #ffffff;
}

.option-btn:disabled {
    cursor: not-allowed;
}

.question-feedback {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
    border: 2px solid #64B5F6;
    box-shadow: 0 8px 32px rgba(255, 105, 0, 0.1);
}

.feedback-content {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
}

.feedback-icon {
    font-size: 2em;
    flex-shrink: 0;
}

.feedback-title {
    font-size: 1.2em;
    font-weight: 600;
    margin: 0 0 10px 0;
}

.feedback-title.correct {
    color: #4CAF50;
}

.feedback-title.incorrect {
    color: #f44336;
}

.feedback-explanation {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
    margin: 0;
}

.next-btn {
    background: linear-gradient(45deg, #64B5F6, #42A5F5);
    color: #ffffff;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(255, 105, 0, 0.3);
}

.next-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 105, 0, 0.5);
    background: linear-gradient(45deg, #42A5F5, #90CAF9);
}

.progress-bar {
    background: rgba(255, 255, 255, 0.2);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 20px;
}

.progress-fill {
    background: linear-gradient(45deg, #64B5F6, #42A5F5);
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* Results Styles */
.tech-game-results {
    text-align: center;
    color: #ffffff;
}

.results-container {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border: 2px solid #64B5F6;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 15px 40px rgba(255, 105, 0, 0.2);
}

.results-icon {
    font-size: 4em;
    margin-bottom: 20px;
    animation: bounce 1s ease-in-out;
}

.results-container h3 {
    font-size: 2em;
    margin-bottom: 30px;
    font-weight: 700;
}

.results-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 30px;
    gap: 20px;
}

.stat {
    background: rgba(255, 105, 0, 0.1);
    border-radius: 15px;
    padding: 20px;
    flex: 1;
    border: 2px solid rgba(255, 105, 0, 0.3);
}

.stat-value {
    display: block;
    font-size: 2em;
    font-weight: 700;
    color: #64B5F6;
    margin-bottom: 5px;
}

.stat-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9em;
}

.results-message {
    font-size: 1.1em;
    margin-bottom: 30px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
}

.results-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.play-again-btn,
.back-to-games-btn {
    padding: 12px 25px;
    border-radius: 25px;
    border: none;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.play-again-btn {
    background: linear-gradient(45deg, #64B5F6, #42A5F5);
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(255, 105, 0, 0.3);
}

.back-to-games-btn {
    background: rgba(255, 105, 0, 0.1);
    color: #64B5F6;
    border: 2px solid #64B5F6;
}

.play-again-btn:hover,
.back-to-games-btn:hover {
    transform: translateY(-2px);
}

.play-again-btn:hover {
    box-shadow: 0 10px 25px rgba(255, 105, 0, 0.5);
    background: linear-gradient(45deg, #42A5F5, #90CAF9);
}

.back-to-games-btn:hover {
    background: #64B5F6;
    color: #000000;
    box-shadow: 0 10px 25px rgba(255, 105, 0, 0.3);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {

    0%,
    20%,
    60%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-20px);
    }

    80% {
        transform: translateY(-10px);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .tech-games-modal-content {
        width: 95%;
        margin: 10px;
        max-height: 95vh;
    }

    .tech-games-modal-body {
        padding: 20px;
    }

    .tech-games-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .game-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .game-stats {
        flex-wrap: wrap;
        gap: 10px;
    }

    .results-stats {
        flex-direction: column;
        gap: 15px;
    }

    .results-actions {
        flex-direction: column;
        gap: 15px;
    }

    .tech-games-modal-header {
        padding: 15px 20px;
    }

    .tech-games-modal-header h2 {
        font-size: 1.5em;
    }

    .question-card {
        padding: 20px;
    }
}

/* ------------------------------------------------------------------ */
/* ARCADE GAME CENTER STYLES (Added to fix missing styles) */
/* ------------------------------------------------------------------ */

.game-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(41, 39, 42, 0.95);
    /* Matches --bg-charcoal */
    backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-out;
}

.game-modal-content {
    background: var(--bg-card, #1e1e1e);
    border: 2px solid var(--accent-green, #00ff9d);
    border-radius: 20px;
    width: 95%;
    max-width: 1200px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 30px rgba(0, 255, 157, 0.2);
    animation: slideInUp 0.4s ease-out;
}

.game-modal-header {
    background: rgba(20, 20, 20, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 18px 18px 0 0;
    padding: 15px 30px;
    border-bottom: 2px solid var(--accent-green, #00ff9d);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.game-modal-header h2 {
    color: var(--text-white, #ececec);
    margin: 0;
    font-size: 1.8em;
    font-family: var(--font-heading, 'Space Grotesk', sans-serif);
    display: flex;
    align-items: center;
    gap: 15px;
}

.game-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--accent-pink, #ff79c6);
    color: var(--accent-pink, #ff79c6);
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.game-close-btn:hover {
    background: var(--accent-pink, #ff79c6);
    color: var(--bg-charcoal, #29272a);
    transform: scale(1.1);
}

.game-modal-body {
    flex-grow: 1;
    overflow: hidden;
    padding: 20px;
    background: #121212;
    border-radius: 0 0 18px 18px;
    position: relative;
}

/* Game Selection Grid */
.game-selection-container {
    height: 100%;
    overflow-y: auto;
    padding: 10px;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    padding: 10px;
}

.game-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.game-card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: var(--accent-green, #00ff9d);
    background: rgba(41, 39, 42, 0.8);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.game-icon {
    font-size: 4rem;
    margin-bottom: 15px;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.2));
}

.game-card h3 {
    margin: 10px 0;
    color: var(--accent-green, #00ff9d);
    font-family: var(--font-heading, 'Space Grotesk', sans-serif);
}

.game-card p {
    color: var(--text-muted, #a0a0a0);
    font-size: 0.9em;
    margin-bottom: 20px;
}

.select-game-btn {
    background: transparent;
    border: 2px solid var(--accent-green, #00ff9d);
    color: var(--accent-green, #00ff9d);
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.game-card:hover .select-game-btn {
    background: var(--accent-green, #00ff9d);
    color: var(--bg-charcoal, #29272a);
}

/* Layout Container for Side-by-Side View */
.game-layout-container {
    display: flex;
    height: 100%;
    gap: 20px;
}

.game-layout-container.show-instructions {
    /* Styles when instructions are active can be added here */
}

/* Instructions Screen */
#gameInstructionsScreen {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 40px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 600px;
    margin: 0 auto;
}

#instructionGameTitle {
    color: var(--accent-green, #00ff9d);
    font-size: 2.5em;
    margin-bottom: 10px;
}

.instruction-icon {
    font-size: 5em;
    margin-bottom: 30px;
}

.instruction-item {
    margin-bottom: 15px;
    font-size: 1.1em;
    color: var(--text-white, #ececec);
}

.difficulty-selection {
    display: flex;
    gap: 15px;
    margin: 30px 0;
}

.difficulty-btn {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: var(--text-muted, #a0a0a0);
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.difficulty-btn:hover,
.difficulty-btn.selected {
    border-color: var(--accent-green, #00ff9d);
    color: var(--accent-green, #00ff9d);
    background: rgba(0, 255, 157, 0.1);
    transform: translateY(-2px);
}

.game-actions {
    display: flex;
    gap: 20px;
}

.game-actions button {
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: bold;
    font-size: 1.1em;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

#startGameBtn {
    background: var(--accent-green, #00ff9d);
    color: var(--bg-charcoal, #29272a);
}

#startGameBtn:disabled {
    background: #444;
    color: #888;
    cursor: not-allowed;
}

#backToGamesBtn {
    background: transparent;
    border: 2px solid var(--accent-pink, #ff79c6);
    color: var(--accent-pink, #ff79c6);
}

#backToGamesBtn:hover {
    background: var(--accent-pink, #ff79c6);
    color: white;
}

/* Game Container & Canvas */
#gameContainer {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.game-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px 10px 0 0;
    margin-bottom: 10px;
}

.game-header-bar h3 {
    margin: 0;
    color: var(--accent-green, #00ff9d);
}

#backToMenu {
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-muted);
    padding: 5px 15px;
    border-radius: 5px;
    cursor: pointer;
}

#backToMenu:hover {
    border-color: white;
    color: white;
}

.score-display {
    font-family: var(--font-mono, monospace);
    font-size: 1.2em;
    color: var(--accent-yellow, #ffeb3b);
}

.fullscreen-close {
    font-size: 1.5em;
    cursor: pointer;
    color: #ff5f56;
}

.canvas-wrapper {
    flex-grow: 1;
    position: relative;
    background: #000;
    border-radius: 0 0 10px 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #333;
}

#gameCanvas {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

#gameOverOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 20;
}

.game-over-content {
    text-align: center;
    animation: bounce 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.game-over-content h2 {
    font-size: 3em;
    color: #ff5f56;
    margin-bottom: 20px;
}

.game-over-content p {
    font-size: 1.5em;
    color: var(--text-white);
    margin-bottom: 30px;
}

#restartGameBtn {
    background: var(--accent-green, #00ff9d);
    color: var(--bg-charcoal, #29272a);
    border: none;
    padding: 15px 40px;
    font-size: 1.2em;
    border-radius: 50px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

#restartGameBtn:hover {
    transform: scale(1.1);
}

.quick-instructions {
    margin-top: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    font-size: 0.9em;
    color: var(--text-muted);
    text-align: center;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .game-modal-content {
        width: 100%;
        height: 100%;
        border-radius: 0;
        border: none;
    }

    .game-modal-header {
        border-radius: 0;
    }

    .game-modal-body {
        border-radius: 0;
        padding: 10px;
    }

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

    .game-actions {
        flex-direction: column;
    }

    .instruction-icon {
        font-size: 3em;
    }
}

/* Fixed syntax error */

/* Typing Test Game Styles - Ultra High Priority */
/* Removed Typing Test Card specific overrides */

/* Removed Recommended styles */

/* Removed text color overrides */

/* Removed Typing Test specific overrides to match Arcade theme */

.typing-test-game {
    padding: 20px;
    min-height: 600px;
}

.typing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #64B5F6;
}

.typing-info h3 {
    color: #ffffff;
    margin: 0 0 10px 0;
    font-size: 1.8em;
}

.typing-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.stat-item {
    background: rgba(100, 181, 246, 0.1);
    padding: 8px 15px;
    border-radius: 15px;
    color: #64B5F6;
    font-weight: bold;
    border: 1px solid rgba(100, 181, 246, 0.3);
}

.typing-settings {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.setting-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.setting-group label {
    color: #ffffff;
    font-weight: bold;
    min-width: 80px;
}

.setting-group select {
    background: rgba(100, 181, 246, 0.1);
    border: 2px solid #64B5F6;
    border-radius: 8px;
    color: #ffffff;
    padding: 8px 12px;
    font-size: 1em;
}

.start-typing-btn,
.restart-typing-btn {
    background: linear-gradient(45deg, #64B5F6, #42A5F5);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.start-typing-btn:hover,
.restart-typing-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(100, 181, 246, 0.4);
}

.typing-container {
    margin-bottom: 20px;
}

.text-display {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #64B5F6;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    min-height: 200px;
    max-height: 300px;
    overflow-y: auto;
}

.typing-text {
    font-family: 'Courier New', monospace;
    font-size: 1.3em;
    line-height: 1.8;
    color: #ffffff;
    word-wrap: break-word;
}

.typing-text span {
    padding: 2px 1px;
    transition: all 0.1s ease;
}

.typing-text span.correct {
    background-color: rgba(76, 175, 80, 0.3);
    color: #4CAF50;
}

.typing-text span.incorrect {
    background-color: rgba(244, 67, 54, 0.3);
    color: #F44336;
}

.typing-text span.current {
    background-color: rgba(255, 193, 7, 0.5);
    animation: blink 1s infinite;
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0.3;
    }
}

.typing-input-container {
    position: relative;
}

.typing-input {
    width: 100%;
    min-height: 120px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #64B5F6;
    border-radius: 15px;
    padding: 20px;
    font-family: 'Courier New', monospace;
    font-size: 1.2em;
    color: #ffffff;
    resize: vertical;
    outline: none;
    transition: border-color 0.3s ease;
}

.typing-input:focus {
    border-color: #00ff9d;
    box-shadow: 0 0 20px rgba(0, 255, 157, 0.3);
}

.typing-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.typing-progress {
    margin-top: 20px;
}

.typing-test-results {
    padding: 30px;
    text-align: center;
}

.typing-results-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.stat-card {
    background: rgba(100, 181, 246, 0.1);
    border: 2px solid #64B5F6;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card .stat-value {
    display: block;
    font-size: 2.2em;
    font-weight: bold;
    color: #64B5F6;
    margin-bottom: 5px;
}

.stat-card .stat-label {
    color: #ffffff;
    font-size: 0.9em;
    opacity: 0.8;
}

.performance-message {
    background: rgba(0, 255, 157, 0.1);
    border: 2px solid #00ff9d;
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    color: #00ff9d;
    font-size: 1.2em;
    font-weight: bold;
}

/* Responsive Design for Typing Test */
@media (max-width: 768px) {
    .typing-stats {
        gap: 10px;
    }

    .stat-item {
        padding: 6px 10px;
        font-size: 0.9em;
    }

    .typing-settings {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .setting-group {
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
    }

    .typing-text {
        font-size: 1.1em;
    }

    .typing-input {
        font-size: 1em;
        min-height: 100px;
    }

    .typing-results-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .stat-card .stat-value {
        font-size: 1.8em;
    }
}

@media (max-width: 480px) {
    .typing-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .typing-stats {
        justify-content: center;
    }

    .typing-results-stats {
        grid-template-columns: 1fr;
    }

    .typing-text {
        font-size: 1em;
        line-height: 1.6;
    }
}

/* Player Name Input Section */
.player-name-section {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    padding: 30px;
    border-radius: 15px;
    border: 2px solid #00ff9d;
    box-shadow: 0 8px 25px rgba(0, 255, 157, 0.3);
    text-align: center;
    z-index: 1001;
    min-width: 400px;
}

.name-input-container h3 {
    color: #00ff9d;
    margin-bottom: 10px;
    font-size: 1.8rem;
}

.name-input-container p {
    color: #fff;
    margin-bottom: 20px;
    opacity: 0.9;
}

.name-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

#playerNameField {
    padding: 12px 15px;
    border: 2px solid #00ff9d;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1.1rem;
    min-width: 200px;
    backdrop-filter: blur(10px);
}

#playerNameField::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

#playerNameField:focus {
    outline: none;
    box-shadow: 0 0 10px rgba(0, 255, 157, 0.5);
}

.continue-btn {
    padding: 12px 20px;
    background: linear-gradient(45deg, #00ff9d, #ffed4e);
    color: #1e3c72;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.continue-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 157, 0.4);
}

/* Leaderboard Section */
.leaderboard-section {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    padding: 30px;
    border-radius: 15px;
    border: 2px solid #00ff9d;
    box-shadow: 0 8px 25px rgba(0, 255, 157, 0.3);
    z-index: 1001;
    min-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.leaderboard-section h3 {
    color: #00ff9d;
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.leaderboard-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border-left: 4px solid #00ff9d;
    backdrop-filter: blur(10px);
}

.leaderboard-entry.rank-1 {
    border-left-color: #00ff9d;
    background: rgba(0, 255, 157, 0.1);
}

.leaderboard-entry.rank-2 {
    border-left-color: #c0c0c0;
    background: rgba(192, 192, 192, 0.1);
}

.leaderboard-entry.rank-3 {
    border-left-color: #cd7f32;
    background: rgba(205, 127, 50, 0.1);
}

.leaderboard-rank {
    font-size: 1.5rem;
    font-weight: bold;
    color: #00ff9d;
    min-width: 30px;
}

.leaderboard-name {
    flex-grow: 1;
    color: #fff;
    font-weight: bold;
    margin-left: 15px;
}

.leaderboard-stats {
    display: flex;
    gap: 15px;
    color: #fff;
    font-size: 0.9rem;
}

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

.leaderboard-stat-value {
    display: block;
    font-weight: bold;
    color: #00ff9d;
}

.leaderboard-stat-label {
    display: block;
    opacity: 0.8;
    font-size: 0.8rem;
}

.close-leaderboard-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(45deg, #00ff9d, #ffed4e);
    color: #1e3c72;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-leaderboard-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 157, 0.4);
}

.show-leaderboard-btn {
    background: linear-gradient(45deg, #00ff9d, #ffed4e);
    color: #1e3c72;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    margin-left: 10px;
}

.show-leaderboard-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 157, 0.4);
}

.player-name-display {
    color: #00ff9d;
    font-weight: bold;
    margin-right: 10px;
}

.change-name-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid #00ff9d;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.change-name-btn:hover {
    background: rgba(0, 255, 157, 0.2);
}

.empty-leaderboard {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    padding: 20px;
    font-style: italic;
}
