* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0f0f0f;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #e0e0e0;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 1200px;
    width: 95%;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.header {
    text-align: center;
    margin-bottom: 40px;
}

.title {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    letter-spacing: -2px;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.7;
    margin-bottom: 30px;
    font-weight: 400;
}

.stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
    background: rgba(30, 30, 30, 0.8);
    border-radius: 12px;
    padding: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat {
    text-align: center;
    position: relative;
}

.stat::after {
    content: '';
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 60%;
    background: rgba(255, 255, 255, 0.1);
}

.stat:last-child::after {
    display: none;
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 5px;
    transition: all 0.3s ease;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.stat-label {
    font-size: 0.8rem;
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 500;
}

.test-area {
    background: rgba(15, 15, 15, 0.9);
    border-radius: 12px;
    padding: 40px;
    margin-bottom: 30px;
    color: #e0e0e0;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.text-display {
    font-size: 1.6rem;
    line-height: 1.8;
    margin-bottom: 30px;
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    user-select: none;
    position: relative;
    font-weight: 400;
    letter-spacing: 0.5px;
    overflow: hidden;
    max-height: 300px;
}

.word-container {
    display: block;
    line-height: 1.8;
    position: relative;
    transition: transform 0.3s ease;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.word-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.word-group.completed {
    opacity: 0.3;
}

.word-group.current {
    opacity: 1;
}

.word-group.future {
    opacity: 0.6;
}

.word {
    display: inline-block;
    margin-right: 8px;
    position: relative;
    transition: all 0.2s ease;
}

.word.incorrect {
    color: #f44336;
    text-decoration: underline;
    text-decoration-color: #f44336;
    text-decoration-thickness: 1px;
}

.word.correct {
    color: #4caf50;
}

.word.current {
    color: #667eea;
}

.word.typed {
    color: #4caf50;
}

.word.typed.incorrect {
    color: #f44336;
    text-decoration: underline;
    text-decoration-color: #f44336;
    text-decoration-thickness: 1px;
}

.char {
    position: relative;
    transition: all 0.1s ease;
    display: inline;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
}

.char.correct {
    color: #4caf50;
    background: none;
}

.char.incorrect {
    color: #f44336;
    text-decoration: underline;
    text-decoration-color: #f44336;
    text-decoration-thickness: 1px;
    background: none;
}

.countdown {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 8rem;
    font-weight: 900;
    color: #667eea;
    z-index: 1000;
    animation: countdownPulse 1s ease;
    text-shadow: 0 0 30px rgba(102, 126, 234, 0.5);
}

@keyframes countdownPulse {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.countdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 999;
    display: none;
}

.word-container {
    display: block;
    line-height: 1.8;
    position: relative;
    transition: transform 0.3s ease;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.word-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.word-group.completed {
    opacity: 0.3;
}

.word-group.current {
    opacity: 1;
}

.word-group.future {
    opacity: 0.6;
}

.typing-line {
    position: relative;
    height: 2px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    margin: 20px 0;
    border-radius: 1px;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

.input-area {
    width: 100%;
    padding: 20px;
    font-size: 1.6rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    outline: none;
    transition: all 0.3s ease;
    background: rgba(25, 25, 25, 0.8);
    color: #e0e0e0;
    resize: none;
    height: 120px;
}

.input-area:focus {
    border-color: #667eea;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.2);
    background: rgba(30, 30, 30, 0.9);
}

.input-area:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.control-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.btn {
    padding: 15px 35px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.time-settings {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
}

.time-btn {
    padding: 10px 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.time-btn.active {
    background: rgba(102, 126, 234, 0.2);
    border-color: #667eea;
    color: #667eea;
}

.time-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-bottom: 30px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
    transition: width 0.1s ease;
    width: 0%;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.results-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
    pointer-events: auto;
}

.results-overlay.visible {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.results-overlay.show {
    display: flex !important;
}

.results-overlay.active {
    display: flex !important;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.results {
    text-align: center;
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.95), rgba(30, 30, 30, 0.95));
    border-radius: 16px;
    padding: 50px;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(102, 126, 234, 0.2);
    animation: modalSlideUp 0.5s ease;
    position: relative;
    z-index: 10000;
}

@keyframes modalSlideUp {
    from { transform: translateY(50px) scale(0.9); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.results h2 {
    font-size: 2.5rem;
    margin-bottom: 30px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
    margin-bottom: 30px;
}

.result-item {
    background: rgba(40, 40, 40, 0.8);
    padding: 20px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s ease;
}

.result-item:hover {
    transform: translateY(-3px);
}

.result-value {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #667eea;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e0e0e0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.credits {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.credits:hover {
    opacity: 1;
}

.credits p {
    font-size: 0.9rem;
    color: #a0a0a0;
    margin: 0;
}

.developer-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
}

.developer-link:hover {
    color: #f093fb;
    transform: translateY(-1px);
}

.developer-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, #667eea 0%, #f093fb 100%);
    transition: width 0.3s ease;
}

.developer-link:hover::after {
    width: 100%;
}

.floating-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.particle {
    position: absolute;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 50%;
    animation: float 8s infinite linear;
}

@keyframes float {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-100px) rotate(360deg); opacity: 0; }
}

.caret {
    position: absolute;
    width: 2px;
    height: 1.6em;
    background: #667eea;
    animation: blink 1s infinite;
    z-index: 10;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
        width: 98%;
    }
    
    .title {
        font-size: 2.5rem;
    }
    
    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .stat::after {
        display: none;
    }
    
    .text-display {
        font-size: 1.3rem;
    }
    
    .input-area {
        font-size: 1.3rem;
        height: 100px;
    }

    .control-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 200px;
    }
}

@media (max-width: 480px) {
    .stats-bar {
        grid-template-columns: 1fr;
    }
    
    .title {
        font-size: 2rem;
    }
} 
