* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    background-color: #121212;
    color: #e0e0e0;
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(0, 123, 255, 0.5);
}

h2 {
    color: #ffffff;
    margin-bottom: 1rem;
}

h3 {
    color: #4dabf7;
    margin: 1.5rem 0 0.8rem;
    border-bottom: 1px solid #444;
    padding-bottom: 0.5rem;
}

h4 {
    color: #ffffff;
    margin: 1rem 0 0.5rem;
}

.hidden {
    display: none;
}

/* Tutorial Section */
.tutorial-section {
    background-color: #1e1e1e;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid #333;
}

.tutorial-section p {
    margin-bottom: 1rem;
    color: #cccccc;
}

.video-container {
    margin: 1.5rem 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.video-container video {
    width: 100%;
    display: block;
}

.finger-placement-guide {
    margin: 1.5rem 0;
    text-align: center;
}

.finger-placement-guide img {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    border: 1px solid #444;
}

.tutorial-text {
    background-color: #2a2a2a;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid #444;
}

.tutorial-text p {
    margin-bottom: 0.8rem;
}

.tutorial-text p:last-child {
    margin-bottom: 0;
}

.tutorial-text ol, .tutorial-text ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
    color: #cccccc;
}

.tutorial-text li {
    margin-bottom: 0.5rem;
}

.primary-btn, .secondary-btn {
    padding: 0.7rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
    border: none;
}

.primary-btn {
    background-color: #007bff;
    color: white;
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.5);
}

.primary-btn:hover {
    background-color: #0069d9;
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(0, 123, 255, 0.7);
}

.secondary-btn {
    background-color: #6c757d;
    color: white;
}

.secondary-btn:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
}

#start-game-btn {
    display: block;
    margin: 0 auto;
    font-size: 1.1rem;
    padding: 0.8rem 2rem;
}

/* Game Container */
.game-container {
    background-color: #1e1e1e;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    padding: 2rem;
    border: 1px solid #333;
}

.stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    background-color: #2a2a2a;
    padding: 1rem;
    border-radius: 5px;
    border: 1px solid #444;
}

.stat {
    text-align: center;
    flex: 1;
}

.stat span:first-child {
    font-weight: bold;
    margin-right: 0.5rem;
    color: #aaaaaa;
}

.stat span:last-child {
    font-size: 1.2rem;
    color: #ffffff;
}

.text-display {
    background-color: #2a2a2a;
    padding: 1.5rem;
    border-radius: 5px;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    line-height: 1.8;
    min-height: 150px;
    color: #cccccc;
    border: 1px solid #444;
}

.text-display .correct {
    color: #28a745;
}

.text-display .incorrect {
    color: #dc3545;
    text-decoration: underline;
    background-color: rgba(220, 53, 69, 0.2);
}

.text-display .current {
    background-color: #333333;
    border-left: 2px solid #007bff;
}

.input-area {
    margin-bottom: 1.5rem;
}

#text-input {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    border: 2px solid #444;
    border-radius: 5px;
    resize: none;
    height: 100px;
    transition: border-color 0.3s;
    background-color: #2a2a2a;
    color: #ffffff;
}

#text-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.5);
}

.keyboard {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 0.3rem;
}

.key {
    background-color: #333333;
    border: 1px solid #444;
    border-radius: 5px;
    padding: 0.5rem;
    min-width: 2.5rem;
    text-align: center;
    cursor: default;
    user-select: none;
    transition: all 0.2s;
    color: #cccccc;
}

.key.active {
    background-color: #007bff;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.7);
}

.key.incorrect {
    background-color: #dc3545;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(220, 53, 69, 0.8);
    border-color: #ff6b6b;
    animation: errorShake 0.3s;
}

@keyframes errorShake {
    0% { transform: translateX(0) scale(1.1); }
    25% { transform: translateX(-5px) scale(1.1); }
    50% { transform: translateX(5px) scale(1.1); }
    75% { transform: translateX(-3px) scale(1.1); }
    100% { transform: translateX(0) scale(1.1); }
}

.key.correct {
    background-color: #28a745;
    color: white;
}

.key.space {
    width: 15rem;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#restart-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.5);
}

#restart-btn:hover {
    background-color: #0069d9;
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(0, 123, 255, 0.7);
}

.difficulty {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #cccccc;
}

#difficulty-select {
    padding: 0.5rem;
    border-radius: 5px;
    border: 1px solid #444;
    background-color: #2a2a2a;
    color: #ffffff;
}

/* Level System Styles */
#level-display {
    font-size: 1.2rem;
    font-weight: bold;
    color: #4dabf7;
    margin: 0 0.5rem;
}

.level-btn {
    background-color: #2a2a2a;
    color: #ffffff;
    border: 1px solid #444;
    border-radius: 5px;
    padding: 0.3rem 0.6rem;
    cursor: pointer;
    transition: all 0.2s;
}

.level-btn:hover:not([disabled]) {
    background-color: #3a3a3a;
    transform: translateY(-2px);
}

.level-btn:active:not([disabled]) {
    transform: translateY(0);
}

.level-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

.level-up-message, .welcome-back-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 1rem 2rem;
    border-radius: 10px;
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    z-index: 1000;
    animation: levelUpAppear 0.5s ease-out;
}

.level-up-message {
    background-color: rgba(40, 167, 69, 0.9);
    color: white;
    box-shadow: 0 0 20px rgba(40, 167, 69, 0.7);
}

.welcome-back-message {
    background-color: rgba(0, 123, 255, 0.9);
    color: white;
    box-shadow: 0 0 20px rgba(0, 123, 255, 0.7);
    max-width: 90%;
    width: 400px;
}

.welcome-back-message h3 {
    color: white;
    margin-top: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.welcome-back-message p {
    margin: 0.5rem 0;
    font-size: 1.1rem;
    font-weight: normal;
}

.level-up-message.fade-out, .welcome-back-message.fade-out {
    animation: levelUpFadeOut 0.5s ease-in forwards;
}

.reset-btn {
    background-color: #6c757d;
    color: #ffffff;
    border: 1px solid #444;
    border-radius: 5px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.2rem;
    margin-left: 0.5rem;
}

.reset-btn:hover {
    background-color: #dc3545;
    transform: rotate(180deg);
}

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

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

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .game-container, .tutorial-section {
        padding: 1rem;
    }
    
    .stats {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .key {
        min-width: 2rem;
        padding: 0.4rem;
        font-size: 0.9rem;
    }
    
    .key.space {
        width: 8rem;
    }
    
    .controls {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .controls button {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .difficulty {
        width: 100%;
    }
    
    #difficulty-select {
        flex-grow: 1;
    }
    
    .level-btn {
        padding: 0.4rem 0.5rem;
    }
    
    #level-display {
        font-size: 1rem;
    }
    
    .level-up-message {
        font-size: 1.2rem;
        padding: 0.8rem 1.5rem;
    }
} 