/* Home Menu Styles */
.home-container {
    animation: fadeIn 0.6s ease-out;
}

.home-header {
    text-align: center;
    margin-bottom: 40px;
}

.home-header h2 {
    font-family: var(--pixel-font);
    font-size: 2rem;
    font-weight: 400;
    color: var(--text-primary);
    text-shadow: 2px 2px 0px var(--primary-color);
    letter-spacing: 2px;
    margin-bottom: 15px;
}

.home-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

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

.game-card {
    background: var(--card-bg);
    border: 3px solid var(--text-primary);
    border-radius: 0;
    padding: 25px;
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 0, 0, 0.1), transparent);
    transition: left 0.5s;
}

.game-card:hover::before {
    left: 100%;
}

.game-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    display: block;
    animation: pulse 2s infinite;
}

.game-card h3 {
    font-family: var(--pixel-font);
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.game-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 20px;
    line-height: 1.4;
}

.game-btn {
    width: 100%;
    justify-content: center;
}

/* Game Container Styles */
.game-container {
    animation: fadeIn 0.6s ease-out;
}

.game-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

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

/* Keyboard Ninja Styles */
.ninja-game-area {
    background: var(--input-bg);
    border: 3px solid var(--text-primary);
    height: 400px;
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
    border-radius: 0;
}

.falling-letter {
    position: absolute;
    font-family: var(--pixel-font);
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text-primary);
    background: var(--card-bg);
    border: 2px solid var(--primary-color);
    padding: 8px 12px;
    border-radius: 0;
    box-shadow: var(--shadow-sm);
    animation: fall linear;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@keyframes fall {
    from {
        transform: translateY(-50px);
    }
    to {
        transform: translateY(450px);
    }
}

.falling-letter.correct {
    animation: explode 0.3s ease-out forwards;
}

@keyframes explode {
    to {
        transform: scale(1.5);
        opacity: 0;
        background: var(--success-color);
    }
}

.falling-letter.missed {
    background: var(--danger-color);
    color: white;
}

/* Memory Typing Styles */
.memory-game-area {
    margin-bottom: 25px;
}

.memory-display {
    background: var(--input-bg);
    border: 3px solid var(--text-primary);
    border-radius: 0;
    padding: 30px;
    margin-bottom: 25px;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 1.3rem;
    line-height: 1.8;
    font-family: var(--mono-font);
    letter-spacing: 1px;
}

.memory-display.showing {
    background: var(--card-bg);
    border-color: var(--primary-color);
    color: var(--text-primary);
}

.memory-display.hidden {
    background: var(--bg-color);
    color: var(--text-muted);
    font-style: italic;
}

.memory-input-container textarea {
    width: 100%;
    min-height: 120px;
    padding: 15px;
    border: 3px solid var(--text-primary);
    border-radius: 0;
    font-size: 1.2rem;
    font-family: var(--mono-font);
    resize: vertical;
    transition: var(--transition);
    background: var(--input-bg);
    color: var(--text-primary);
    letter-spacing: 1px;
    line-height: 1.6;
}

.memory-input-container textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 2px 2px 0px rgba(139, 0, 0, 0.3);
}

.memory-input-container textarea:disabled {
    background: var(--bg-color);
    cursor: not-allowed;
    opacity: 0.7;
    color: var(--text-muted);
}

/* Word Hunter Styles */
.hunter-game-area {
    margin-bottom: 25px;
}

.word-cloud {
    background: var(--input-bg);
    border: 3px solid var(--text-primary);
    border-radius: 0;
    padding: 30px;
    margin-bottom: 25px;
    min-height: 300px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    justify-content: center;
    position: relative;
}

.cloud-word {
    font-family: var(--pixel-font);
    font-weight: 400;
    padding: 8px 16px;
    border: 2px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    text-transform: capitalize;
    letter-spacing: 1px;
    user-select: none;
}

.cloud-word:hover {
    transform: scale(1.05);
    border-color: var(--primary-color);
    color: var(--text-primary);
}

.cloud-word.target {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    animation: targetPulse 1s infinite;
}

.cloud-word.found {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
    transform: scale(0.9);
    opacity: 0.6;
}

@keyframes bonusSlide {
    0% {
        transform: translateX(100px);
        opacity: 0;
    }
    20% {
        transform: translateX(0);
        opacity: 1;
    }
    80% {
        transform: translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateX(100px);
        opacity: 0;
    }
}

@keyframes targetPulse {
    0%, 100% { 
        transform: scale(1.1);
        box-shadow: 0 0 10px rgba(139, 0, 0, 0.5);
    }
    50% { 
        transform: scale(1.2);
        box-shadow: 0 0 20px rgba(139, 0, 0, 0.8);
    }
}

.hunter-input-container input {
    width: 100%;
    padding: 15px;
    border: 3px solid var(--text-primary);
    border-radius: 0;
    font-size: 1.2rem;
    font-family: var(--mono-font);
    transition: var(--transition);
    background: var(--input-bg);
    color: var(--text-primary);
    letter-spacing: 1px;
}

.hunter-input-container input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 2px 2px 0px rgba(139, 0, 0, 0.3);
}

.hunter-input-container input:disabled {
    background: var(--bg-color);
    cursor: not-allowed;
    opacity: 0.7;
    color: var(--text-muted);
}

/* Typing Defense Styles */
.defense-game-area {
    margin-bottom: 25px;
}

.defense-field {
    background: var(--input-bg);
    border: 3px solid var(--text-primary);
    border-radius: 0;
    height: 400px;
    position: relative;
    overflow: hidden;
    margin-bottom: 25px;
}

@keyframes pointsPopup {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -70%) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -100%) scale(0.8);
        opacity: 0;
    }
}

.defense-base {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 60px;
    background: var(--primary-color);
    border: 3px solid var(--text-primary);
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-family: var(--pixel-font);
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.enemy {
    position: absolute;
    background: var(--danger-color);
    border: 2px solid var(--text-primary);
    border-radius: 0;
    padding: 8px 12px;
    color: white;
    font-family: var(--pixel-font);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: enemyMove linear;
    cursor: pointer;
}

@keyframes enemyMove {
    from {
        top: -50px;
    }
    to {
        top: 340px;
    }
}

.enemy.defeated {
    animation: enemyDefeat 0.5s ease-out forwards;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes gameOverPulse {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
}

@keyframes levelUpPulse {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
}

@keyframes enemyDefeat {
    to {
        transform: scale(0) rotate(360deg);
        opacity: 0;
        background: var(--success-color);
    }
}

@keyframes healthWarning {
    0%, 100% {
        transform: scale(1);
        text-shadow: 1px 1px 0px rgba(0,0,0,0.2);
    }
    50% {
        transform: scale(1.1);
        text-shadow: 2px 2px 0px rgba(139, 0, 0, 0.5);
    }
}

.defense-input-container input {
    width: 100%;
    padding: 15px;
    border: 3px solid var(--text-primary);
    border-radius: 0;
    font-size: 1.2rem;
    font-family: var(--mono-font);
    transition: var(--transition);
    background: var(--input-bg);
    color: var(--text-primary);
    letter-spacing: 1px;
}

.defense-input-container input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 2px 2px 0px rgba(139, 0, 0, 0.3);
}

.defense-input-container input:disabled {
    background: var(--bg-color);
    cursor: not-allowed;
    opacity: 0.7;
    color: var(--text-muted);
}

/* Navigation Styles */
.main-nav {
    display: flex;
    gap: 15px;
    align-items: center;
}

.nav-btn {
    white-space: nowrap;
}

.nav-btn {
    padding: 8px 16px;
    font-size: 0.7rem;
    transition: var(--transition);
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

#backBtn {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

#backBtn:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
}

#soundBtn {
    background: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

#soundBtn:hover {
    background: #218838;
    border-color: #218838;
    transform: translateY(-2px);
}

#soundBtn.muted {
    background: var(--text-muted);
    border-color: var(--text-muted);
    color: var(--text-secondary);
}

/* Responsive Design for Games */
@media (max-width: 768px) {
    .games-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .game-stats {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .game-controls {
        flex-direction: column;
        width: 100%;
    }
    
    .game-controls .btn {
        width: 100%;
        justify-content: center;
    }
    
    .ninja-game-area,
    .defense-field {
        height: 300px;
    }
    
    .word-cloud {
        min-height: 250px;
        padding: 20px;
    }
    
    .memory-display {
        min-height: 120px;
        padding: 20px;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .game-card {
        padding: 20px;
    }
    
    .game-icon {
        font-size: 2.5rem;
    }
    
    .game-card h3 {
        font-size: 1rem;
    }
    
    .game-card p {
        font-size: 0.8rem;
    }
    
    .ninja-game-area,
    .defense-field {
        height: 250px;
    }
    
    .falling-letter {
        font-size: 1.2rem;
        padding: 6px 10px;
    }
    
    .enemy {
        font-size: 0.7rem;
        padding: 6px 10px;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #8b0000;
    --primary-dark: #660000;
    --primary-light: #a52a2a;
    --secondary-color: #dc143c;
    --accent-color: #ff6b6b;
    --info-color: #17a2b8;
    --danger-color: #8b0000;
    --warning-color: #ff4444;
    --success-color: #00cc00;
    --bg-color: #f8f8f8;
    --card-bg: #ffffff;
    --input-bg: #f0f0f0;
    --text-primary: #000000;
    --text-secondary: #333333;
    --text-muted: #666666;
    --border-color: #cccccc;
    --border-glow: #8b0000;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.2);
    --shadow-xl: 0 16px 32px rgba(0,0,0,0.25);
    --shadow-glow: 0 0 10px rgba(139, 0, 0, 0.3);
    --transition: all 0.2s ease;
    --pixel-font: 'Press Start 2P', cursive;
    --mono-font: 'VT323', monospace;
}

:root[data-theme="dark"] {
    --bg-color: #000000;
    --card-bg: #0f0f0f;
    --input-bg: #0a0a0a;
    --text-primary: #ffffff;
    --text-secondary: #e0e0e0;
    --text-muted: #b0b0b0;
    --border-color: #333333;
    --shadow-sm: 0 2px 4px rgba(255,255,255,0.05);
    --shadow-md: 0 4px 8px rgba(255,255,255,0.06);
    --shadow-lg: 0 8px 16px rgba(255,255,255,0.07);
    --shadow-xl: 0 16px 32px rgba(255,255,255,0.08);
}

body {
    font-family: var(--mono-font);
    background: var(--bg-color);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.03) 2px, rgba(0,0,0,0.03) 4px),
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(0,0,0,0.03) 2px, rgba(0,0,0,0.03) 4px);
    pointer-events: none;
    z-index: 1;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

.header {
    background: var(--card-bg);
    border: 3px solid var(--text-primary);
    border-radius: 0;
    padding: 20px 30px;
    margin: 20px 0;
    box-shadow: var(--shadow-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideDown 0.5s ease-out;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 4px;
    background: var(--primary-color);
    animation: scanLine 3s infinite;
}

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

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    image-rendering: auto;
    flex-shrink: 0;
}

.about-logo-img {
    width: 48px;
    height: 48px;
}

.logo i {
    font-size: 2rem;
    color: var(--primary-color);
    animation: pulse 2s infinite, glow 2s ease-in-out infinite alternate;
}

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

@keyframes glow {
    from { text-shadow: 0 0 5px var(--primary-color); }
    to { text-shadow: 0 0 20px var(--primary-color), 0 0 30px var(--primary-color); }
}

@keyframes crtFlicker {
    0%, 100% { opacity: 1; }
    97% { opacity: 1; }
    98% { opacity: 0.92; }
    99% { opacity: 0.98; }
}

@keyframes pixelGlow {
    0%, 100% { text-shadow: 2px 2px 0px var(--primary-color); }
    50% { text-shadow: 2px 2px 0px var(--primary-color), 0 0 10px rgba(139, 0, 0, 0.35); }
}

.logo h1 {
    font-family: var(--pixel-font);
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text-primary);
    text-shadow: 2px 2px 0px var(--primary-color);
    letter-spacing: 2px;
    animation: crtFlicker 6s infinite, pixelGlow 2.8s ease-in-out infinite;
    line-height: 1.2;
    word-break: break-word;
}

.nav-select {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 2px solid var(--text-primary);
    border-radius: 0;
    padding: 10px 12px;
    font-family: var(--pixel-font);
    font-size: 0.7rem;
    line-height: 1;
    cursor: pointer;
    outline: none;
    box-shadow: var(--shadow-sm);
}

.nav-select:focus {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-glow);
}

.header-stats {
    display: flex;
    gap: 30px;
}

.stat-item {
    text-align: center;
    padding: 12px 16px;
    background: var(--input-bg);
    border: 2px solid var(--text-primary);
    border-radius: 0;
    min-width: 100px;
    transition: var(--transition);
    position: relative;
    font-family: var(--pixel-font);
    font-size: 0.7rem;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-label {
    display: block;
    font-size: 0.6rem;
    color: var(--text-muted);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.stat-value {
    display: block;
    font-size: 1rem;
    font-weight: 400;
    color: var(--primary-color);
    font-family: var(--pixel-font);
    text-shadow: 1px 1px 0px rgba(0,0,0,0.2);
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin: 20px 0;
}

.test-container {
    background: var(--card-bg);
    border: 3px solid var(--text-primary);
    border-radius: 0;
    padding: 30px;
    box-shadow: var(--shadow-lg);
    animation: fadeIn 0.6s ease-out 0.2s both;
    position: relative;
    overflow: hidden;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.test-header {
    text-align: center;
    margin-bottom: 30px;
}

.timer-display {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--input-bg);
    padding: 8px 15px;
    border: 2px solid var(--primary-color);
    border-radius: 0;
    font-family: var(--pixel-font);
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.timer-display i {
    font-size: 0.9rem;
}

.test-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.test-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.text-display {
    background: var(--input-bg);
    border: 3px solid var(--text-primary);
    border-radius: 0;
    padding: 25px;
    margin-bottom: 25px;
    font-size: 1.5rem;
    line-height: 1.8;
    min-height: 120px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    transition: var(--transition);
    position: relative;
    font-family: var(--mono-font);
    letter-spacing: 2px;
}

.text-display.rtl {
    direction: rtl;
    justify-content: flex-start;
    text-align: right;
    letter-spacing: 0;
    font-family: 'Share Tech Mono', 'Tajawal', 'Cairo', 'Noto Naskh Arabic', 'Noto Sans Arabic', var(--mono-font);
}

textarea.rtl {
    direction: rtl;
    text-align: right;
    letter-spacing: 0;
    font-family: 'Share Tech Mono', 'Tajawal', 'Cairo', 'Noto Naskh Arabic', 'Noto Sans Arabic', var(--mono-font);
}

.text-display.rtl .word {
    letter-spacing: 0;
}

.text-display:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.word {
    padding: 4px 6px;
    border-radius: 0;
    transition: var(--transition);
    position: relative;
    font-weight: 400;
    color: var(--text-muted);
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
}

.word span {
    position: relative;
    transition: var(--transition);
    display: inline-block;
}

.word .correct {
    color: var(--primary-color);
    font-weight: 700;
    text-shadow: 1px 1px 0px rgba(139, 0, 0, 0.3);
    animation: correctPulse 0.2s ease;
}

.word .incorrect {
    color: var(--text-muted);
    font-weight: 400;
    position: relative;
    text-decoration: none;
}

.word .incorrect::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--danger-color);
    transform: rotate(-5deg);
    animation: strikethrough 0.2s ease;
}

.word .pending {
    color: var(--text-muted);
    font-weight: 400;
}

@keyframes correctPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes strikethrough {
    0% { width: 0; }
    100% { width: 100%; }
}

.word.current {
    position: relative;
    color: var(--text-primary);
    font-weight: 600;
}

.word.current::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    animation: underlinePulse 1s infinite;
}

.word.current::before {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 1.5em;
    background: var(--accent-color);
    animation: pixelBlink 0.5s infinite;
}

@keyframes underlinePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes pixelBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

@keyframes highlight {
    from { background: var(--warning-color); }
    to { background: var(--primary-color); }
}

.word.correct {
    color: var(--secondary-color);
    background: rgba(72, 187, 120, 0.1);
}

.word.incorrect {
    color: var(--danger-color);
    background: rgba(245, 101, 101, 0.1);
    text-decoration: line-through;
}

.input-container {
    position: relative;
    margin-bottom: 30px;
}

#userInput {
    width: 100%;
    min-height: 100px;
    padding: 15px;
    border: 3px solid var(--text-primary);
    border-radius: 0;
    font-size: 1.3rem;
    font-family: var(--mono-font);
    resize: vertical;
    transition: var(--transition);
    background: var(--input-bg);
    color: var(--text-primary);
    letter-spacing: 2px;
    line-height: 1.6;
}

#userInput:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 2px 2px 0px rgba(139, 0, 0, 0.3);
}

#userInput:disabled {
    background: var(--bg-color);
    cursor: not-allowed;
    opacity: 0.7;
    color: var(--text-muted);
}

.input-status {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.9rem;
    pointer-events: none;
    background: var(--input-bg);
    padding: 8px 12px;
    border-radius: 0;
    border: 2px solid var(--text-primary);
    font-family: var(--pixel-font);
    font-size: 0.7rem;
}

.controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 20px;
    border: 3px solid var(--text-primary);
    border-radius: 0;
    font-size: 0.8rem;
    font-weight: 400;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    font-family: var(--pixel-font);
    background: var(--card-bg);
    color: var(--text-primary);
    box-shadow: 2px 2px 0px rgba(0,0,0,0.2);
}

.btn:hover {
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0px rgba(0,0,0,0.3);
}

.btn:active {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0px rgba(0,0,0,0.2);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--text-primary);
    border-color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--input-bg);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.difficulty-select {
    padding: 12px 16px;
    border: 3px solid var(--text-primary);
    border-radius: 0;
    font-size: 0.8rem;
    background: var(--card-bg);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--pixel-font);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.difficulty-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 2px 2px 0px rgba(139, 0, 0, 0.3);
}

.difficulty-select option {
    background: var(--card-bg);
    color: var(--text-primary);
    font-family: var(--pixel-font);
}

.results-container {
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-card {
    background: var(--card-bg);
    border: 3px solid var(--text-primary);
    border-radius: 0;
    padding: 30px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    position: relative;
    overflow: hidden;
}

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

.results-header h3 {
    font-family: var(--pixel-font);
    font-size: 1.8rem;
    font-weight: 400;
    color: var(--text-primary);
    text-shadow: 2px 2px 0px var(--primary-color);
    letter-spacing: 2px;
    margin-bottom: 20px;
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 0;
    background: var(--primary-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 2px 2px 0px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
    border: 3px solid var(--text-primary);
}

.score-circle::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.score-circle span:first-child {
    font-family: var(--pixel-font);
    font-size: 2rem;
    font-weight: 400;
    color: white;
    line-height: 1;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.3);
}

.score-label {
    font-family: var(--pixel-font);
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 5px;
}

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

.result-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--input-bg);
    border: 2px solid var(--text-primary);
    border-radius: 0;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.result-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.result-item i {
    font-size: 1.2rem;
    color: var(--primary-color);
    width: 30px;
}

.result-item div {
    flex: 1;
    text-align: left;
}

.result-label {
    display: block;
    font-family: var(--pixel-font);
    font-size: 0.6rem;
    color: var(--text-muted);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.result-value {
    display: block;
    font-family: var(--pixel-font);
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-primary);
    margin-top: 5px;
}

.footer {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 20px;
    border-top: 3px solid var(--text-primary);
    font-family: var(--pixel-font);
    letter-spacing: 1px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.footer-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-family: var(--pixel-font);
    font-size: 0.8rem;
    padding: 8px 15px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-link:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.footer-link.active {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.footer-link i {
    font-size: 0.9rem;
}

/* FAQ Section Styles */
.faq-section {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
}

.faq-header {
    text-align: center;
    margin-bottom: 40px;
}

.faq-header h2 {
    font-family: var(--pixel-font);
    font-size: 2rem;
    color: var(--text-primary);
    text-shadow: 2px 2px 0px var(--primary-color);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.faq-header h2 i {
    font-size: 1.8rem;
    color: var(--primary-color);
}

.faq-header p {
    font-family: 'Courier New', monospace;
    color: var(--text-secondary);
    font-size: 1rem;
    margin: 0;
}

.faq-container {
    background: var(--card-bg);
    border: 3px solid var(--text-primary);
    box-shadow: var(--shadow-lg);
    border-radius: 0;
    overflow: hidden;
}

.faq-item {
    border-bottom: 2px solid rgba(255,255,255,0.1);
    transition: all 0.3s ease;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-item:hover {
    background: rgba(139, 0, 0, 0.05);
}

.faq-question {
    padding: 20px 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    font-family: var(--pixel-font);
    font-size: 1rem;
    color: var(--text-primary);
    position: relative;
}

.faq-question:hover {
    background: rgba(139, 0, 0, 0.1);
    padding-left: 30px;
}

.faq-arrow {
    font-size: 0.9rem;
    color: var(--primary-color);
    transition: all 0.3s ease;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.faq-item.active .faq-arrow {
    transform: rotate(90deg);
    color: var(--success-color);
}

.faq-question span {
    flex: 1;
    line-height: 1.4;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    background: rgba(255,255,255,0.02);
}

.faq-answer p {
    margin: 0;
    padding: 0 25px 20px 60px;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.faq-answer strong {
    color: var(--primary-color);
    font-weight: bold;
}

.faq-item.active .faq-answer {
    max-height: 500px;
    transition: all 0.5s ease;
}

/* FAQ Animation */
@keyframes faqSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.faq-section {
    animation: faqSlideIn 0.6s ease-out;
}

/* Responsive FAQ */
@media (max-width: 768px) {
    .faq-section {
        margin: 30px 10px;
    }
    
    .faq-header h2 {
        font-size: 1.5rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .faq-question {
        padding: 15px 20px;
        font-size: 0.9rem;
    }
    
    .faq-answer p {
        padding: 0 20px 15px 50px;
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }

    .main-nav {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
    }

    .logo {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
        gap: 12px;
    }

    .logo-img {
        width: 64px;
        height: 64px;
    }

    .logo h1 {
        font-size: 1.25rem;
        letter-spacing: 1px;
    }
    
    .header-stats {
        width: 100%;
        justify-content: space-around;
    }
    
    .test-container {
        padding: 25px;
    }
    
    .text-display {
        font-size: 1.1rem;
        padding: 20px;
    }
    
    .controls {
        flex-direction: column;
        width: 100%;
    }

    .controls .btn,
    .game-controls .btn {
        width: 100%;
        justify-content: center;
    }

    .input-status {
        display: none;
    }
    
    .results-stats {
        grid-template-columns: 1fr;
    }
    
    .score-circle {
        width: 120px;
        height: 120px;
    }
    
    .score-circle span:first-child {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 1.1rem;
        letter-spacing: 1px;
    }

    .logo-img {
        width: 48px;
        height: 48px;
    }

    .nav-btn {
        padding: 8px 12px;
        font-size: 0.65rem;
    }

    .nav-select {
        padding: 8px 10px;
        font-size: 0.65rem;
    }
    
    .stat-item {
        min-width: 60px;
        padding: 8px 10px;
    }
    
    .test-header h2 {
        font-size: 1.5rem;
    }
    
    .text-display {
        font-size: 1rem;
        min-height: 100px;
    }
    
    #userInput {
        font-size: 1rem;
        min-height: 100px;
    }
}

@media (max-width: 360px) {
    .header {
        padding: 16px;
        gap: 14px;
    }

    .main-nav {
        gap: 8px;
    }

    .logo h1 {
        font-size: 1rem;
    }
}
