:root {
    --primary-color: #00ffaa;
    --secondary-color: #ffdc3e;
    --background-color: rgba(16, 16, 24, 0.95);
    --tile-color: rgba(0, 255, 170, 0.1);
    --tile-active: #00ffaa;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', sans-serif;
}

.game-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;  
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.8);
}

#game-area {
    width: 100%;
    height: 400px;
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin: 20px 0;
}

.falling-letter {
    position: absolute;
    width: 40px;
    height: 40px;
    background: rgba(0, 255, 170, 0.1);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    font-weight: bold;
    transition: all 0.2s;
}

.falling-letter.hit {
    background: var(--primary-color);
    color: black;
    transform: scale(1.2);
    opacity: 0;
}

.falling-letter.missed {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    opacity: 0;
}

.challenge-box {
    background: var(--background-color);
    padding: 25px;
    border-radius: 12px;
    color: white;
    width: 500px;
    box-shadow: 0 0 20px rgba(0, 255, 170, 0.2);
}

.word-container {
    background: rgba(255, 255, 255, 0.05);
    padding: 40px;
    border-radius: 12px;
    margin: 30px 0;
}

.current-word {
    font-size: 72px;
    color: var(--primary-color);
    font-weight: bold;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 0 0 20px rgba(0, 255, 170, 0.3);
    animation: fadeInWord 0.5s ease;
    transition: all 0.3s ease;
}

.current-word.correct {
    color: var(--primary-color);
    transform: scale(1.1);
}

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

.word-count {
    color: var(--secondary-color);
    font-size: 22px;
    font-weight: bold;
    text-align: center;
    padding: 10px 20px;
    background: rgba(255, 220, 62, 0.1);
    border-radius: 12px;
    margin-top: 15px;
    text-shadow: 0 0 10px rgba(255, 220, 62, 0.3);
    border: 2px solid rgba(255, 220, 62, 0.3);
    transition: all 0.3s ease;
}

.word-count span {
    color: var(--primary-color);
    font-size: 24px;
    margin: 0 5px;
}

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

.word-count {
    color: var(--secondary-color);
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    padding: 8px 15px;
    background: rgba(255, 220, 62, 0.1);
    border-radius: 8px;
    margin-top: 15px;
    text-shadow: 0 0 10px rgba(255, 220, 62, 0.3);
}

.button-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 30px 0;
}

#seenBtn, #newBtn {
    padding: 20px 60px;
    font-size: 24px;
    border: 2px solid;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

#seenBtn::after, #newBtn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%) scale(0);
    border-radius: 50%;
    transition: transform 0.3s ease;
}

#seenBtn.clicked::after, #newBtn.clicked::after {
    transform: translate(-50%, -50%) scale(2);
    opacity: 0;
}

#seenBtn {
    background: transparent;
    color: var(--secondary-color);
    border-color: var(--secondary-color);
}

#newBtn {
    background: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

#seenBtn:hover {
    background: var(--secondary-color);
    color: black;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 220, 62, 0.3);
}

#newBtn:hover {
    background: var(--primary-color);
    color: black;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 170, 0.3);
}

.timer-display {
    font-size: 20px;
    color: var(--secondary-color);
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 4px;
    background: rgba(255, 220, 62, 0.1);
}

.header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.difficulty {
    background: var(--secondary-color);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
}

.score {
    color: var(--primary-color);
    font-size: 18px;
    font-weight: bold;
}

.title {
    text-align: center;
    font-size: 28px;
    margin-bottom: 15px;
    color: var(--primary-color);
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 2px;
}

.instruction {
    text-align: center;
    margin-bottom: 25px;
    color: #ffffff;
    opacity: 0.8;
}

.instructions {
    text-align: center;
    color: var(--primary-color);
    margin: 10px 0;
    font-size: 14px;
    opacity: 0.8;
}

.pattern-container {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.pattern-sequence {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.pattern {
    background: rgba(0, 255, 170, 0.1);
    border: 2px solid var(--primary-color);
    padding: 15px;
    border-radius: 8px;
    font-size: 24px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.pattern.active {
    background: var(--primary-color);
    transform: scale(1.1);
}

.pattern.wrong {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
}

.input-feedback {
    text-align: center;
    font-size: 18px;
    color: var(--primary-color);
    height: 25px;
}

.progress-wrapper {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 8px;
}

.attempts {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
}

.attempt {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
}

.attempt.active {
    background: var(--primary-color);
}

.timer-bar-container,
.timer-bar {
    display: none;
}

.pattern:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(0, 255, 170, 0.3);
}

@keyframes wrong {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
    100% { transform: translateX(0); }
}

.challenge-box.shake {
    animation: wrong 0.3s ease;
}

.target-letter {
    text-align: center;
    font-size: 32px;
    margin: 20px 0;
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(0, 255, 170, 0.5);
}

.target-letter span {
    font-weight: bold;
    font-size: 48px;
    display: inline-block;
    margin-left: 10px;
}

.letter-grid {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.grid-row {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.grid-row:last-child {
    margin-bottom: 0;
}

.letter {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 255, 170, 0.1);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    font-size: 28px;
    color: white;
    transition: all 0.3s ease;
}

.letter.current {
    border-color: #ffffff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.letter:hover {
    transform: scale(1.1);
    background: rgba(0, 255, 170, 0.2);
}

.letter.correct {
    background: var(--primary-color);
    color: black;
}

.letter.wrong {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    animation: shake 0.3s ease;
}

.letter.end-correct {
    background: rgba(0, 255, 170, 0.1);
    border-color: var(--primary-color);
    animation: fadeIn 0.5s ease;
}

.letter.end-wrong {
    background: rgba(255, 62, 62, 0.1);
    border-color: var(--secondary-color);
    animation: fadeIn 0.5s ease;
}

.result-icon {
    font-size: 64px;
    margin-bottom: 15px;
}

.end-correct .result-icon {
    color: var(--primary-color);
}

.end-wrong .result-icon {
    color: var(--secondary-color);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
    100% { transform: translateX(0); }
}

.letter.changing {
    animation: changeLetter 0.5s ease;
}

@keyframes changeLetter {
    0% { transform: scale(1); }
    50% { transform: scale(0.8); }
    100% { transform: scale(1); }
}

.mistakes-counter {
    color: var(--secondary-color);
    font-size: 14px;
    font-weight: bold;
    padding: 5px 10px;
    background: rgba(255, 62, 62, 0.1);
    border-radius: 4px;
    transition: opacity 0.5s ease;
}

.final-result {
    text-align: center;
    margin: 20px 0;
    animation: fadeIn 0.5s ease;
}

.final-result .result-icon {
    font-size: 64px;
    margin-bottom: 15px;
}

.final-result .result-icon.win {
    color: var(--primary-color);
}

.final-result .result-icon.lose {
    color: var(--secondary-color);
}

.final-result .result-text {
    font-size: 24px;
    font-weight: bold;
    color: white;
}

.progress-indicator {
    transition: opacity 0.5s ease;
}

.letter.changing {
    animation: letterChange 0.3s ease;
}

@keyframes letterChange {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(0.8); opacity: 0.5; }
    100% { transform: scale(1); opacity: 1; }
}

.target-frame {
    width: 100%;
    height: 100px;
    border: 4px solid #fff;
    border-radius: 8px;
    margin: 20px 0;
    transition: border-color 0.3s ease;
}

.color-circles {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
}

.color-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.color-circle:hover {
    transform: scale(1.1);
}

.color-circle.correct {
    animation: correct 0.5s ease;
}

.color-circle.wrong {
    animation: wrong 0.5s ease;
}

@keyframes correct {
    50% { transform: scale(1.1); }
}

@keyframes wrong {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.grid-container {
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin: 20px 0;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 400px;
    margin: 0 auto;
}

.tile {
    aspect-ratio: 1;
    background: var(--tile-color);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tile.active {
    background: var(--tile-active);
    transform: scale(0.95);
}

.tile.correct {
    animation: correct 0.5s ease;
}

.tile.wrong {
    background: var(--secondary-color);
    animation: wrong 0.5s ease;
}

.status-message {
    text-align: center;
    font-size: 24px;
    height: 40px;
    margin: 20px 0;
}

.status-message.watch {
    color: var(--secondary-color);  
}

.status-message.turn {
    color: var(--primary-color);   
}

.status-message.game-over {
    color: #ff3e3e; 
    font-weight: bold;
    font-size: 28px;
    text-shadow: 0 0 15px rgba(255, 62, 62, 0.5);
    animation: shake 0.5s ease;
}

.status-message.win {
    color: #00ffaa;  
    font-weight: bold;
    font-size: 28px;
    text-shadow: 0 0 15px rgba(0, 255, 170, 0.5);
    animation: scaleUp 0.5s ease;
}

.status-message.game-over {
    color: #ff3e3e; 
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 62, 62, 0.3);
}

.status-message.win {
    color: #00ffaa; 
    font-weight: bold;
    text-shadow: 0 0 10px rgba(0, 255, 170, 0.3);
    animation: pulseText 2s infinite;
}

@keyframes pulseText {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.status-message.excellent {
    color: #ffd700; 
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    animation: scaleText 0.5s ease;
}

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

.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 15px;
}

.progress {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px var(--primary-color);
}

.combo {
    color: var(--secondary-color);
    font-size: 18px;
    font-weight: bold;
    animation: pulseCombo 0.5s ease;
}

@keyframes pulseCombo {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

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

.controls-hint {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    margin-top: 25px;  
    opacity: 0.8;
}

.progress-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}
