* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Segoe UI', -apple-system, Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}
.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    padding: 30px;
}
h1 { text-align: center; color: #333; margin-bottom: 30px; font-size: 2.2em; }
.stats {
    display: flex; justify-content: space-around;
    background: #f8f9fa; padding: 20px;
    border-radius: 15px; margin-bottom: 30px;
    font-size: 1.2em; font-weight: 500;
}
.word-display {
    font-size: 4em; font-weight: bold; text-align: center;
    padding: 40px; border: 4px dashed #ddd; border-radius: 20px;
    margin: 30px 0; min-height: 140px; display: flex; align-items: center;
    justify-content: center; background: #fafafa;
}
.letters {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 30px 0;
    flex-wrap: nowrap;      /* пусть JS борется за одну строку */
    overflow: hidden;       /* без скролла */
    max-width: 100%;
}
.letter-btn {
    font-size: 2.2em;
    font-weight: bold;
    padding: 18px 25px;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.1s ease;
    min-width: 55px;
    height: 65px;
    flex-shrink: 0;
    white-space: nowrap;
    background: #e3f2fd;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.letter-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}
.letter-btn:active { transform: scale(0.95); }
.letter-btn.correct {
    background: #4CAF50 !important;
    color: white;
    box-shadow: 0 0 20px #4CAF50;
}
.letter-btn.wrong {
    background: #f44336 !important;
    color: white;
    box-shadow: 0 0 20px #f44336;
}
.controls {
    display: flex; justify-content: center; gap: 15px;
    margin: 30px 0; flex-wrap: wrap;
}
button {
    padding: 15px 30px; font-size: 16px; border: none;
    border-radius: 12px; cursor: pointer; transition: all 0.3s;
    font-weight: bold; min-width: 160px;
}
#startBtn { background: #4CAF50; color: white; }
#endBtn { background: #f44336; color: white; }
button:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.2); }
button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.progress-bar {
    width: 100%; height: 12px; background: #e0e0e0;
    border-radius: 6px; overflow: hidden; margin-top: 20px;
}
.progress {
    height: 100%; background: linear-gradient(90deg, #4CAF50, #8BC34A);
    width: 0%; transition: width 0.5s ease; border-radius: 6px;
}
@media (max-width: 768px) {
    .word-display { font-size: 2.8em; padding: 25px; }
    .letter-btn { font-size: 1.8em; padding: 15px 20px; min-width: 50px; height: 55px; }
    .letters { gap: 6px; padding: 15px 0; }
    .stats { flex-direction: column; gap: 10px; text-align: center; }
    .container { padding: 20px; margin: 10px; }
}
