[file content begin]
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

/* ЭКРАННАЯ СИСТЕМА */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    z-index: 1;
}

.screen.active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
}

/* ЭКРАН 1: СТАРТОВЫЙ ЭКРАН */
.start-screen {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
}

.start-container {
    max-width: 600px;
    width: 100%;
    background: white;
    border-radius: 25px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideUp 0.6s ease;
}

.level-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
}

.level-number {
    font-size: 4em;
    font-weight: bold;
    color: #4CAF50;
    line-height: 1;
}

.level-label {
    font-size: 1.2em;
    color: #666;
    margin-top: 5px;
}

.game-title {
    font-size: 2.5em;
    color: #333;
    margin-bottom: 20px;
    font-weight: bold;
}

.level-description {
    font-size: 1.4em;
    color: #666;
    margin-bottom: 40px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 15px;
    border-left: 5px solid #4CAF50;
}

.time-info {
    font-size: 1.2em;
    color: #495057;
    margin-bottom: 30px;
    padding: 15px;
    background: #e8f5e9;
    border-radius: 12px;
    display: inline-block;
}

.start-button {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    border-radius: 15px;
    padding: 20px 40px;
    font-size: 1.4em;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    margin-bottom: 20px;
    transition: transform 0.3s, box-shadow 0.3s;
}
#backAfterTimeout
{
	margin:auto;
}
.start-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(76, 175, 80, 0.3);
}

.rules-button {
    background: transparent;
    color: #666;
    border: 2px solid #ddd;
    border-radius: 12px;
    padding: 15px 30px;
    font-size: 1.1em;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s;
}

.rules-button:hover {
    background: #f8f9fa;
    border-color: #4CAF50;
    color: #4CAF50;
}

/* ЭКРАН 2: ИГРОВОЙ ЭКРАН */
.game-container {
    width: 100%;
    max-width: 1600px;
    height: 97vh; /* Изменено с min-height на height */
    max-height: 97vh; /* Добавлено */
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Добавлено */
    animation: fadeIn 0.5s ease;
}

/* Шапка игрового экрана */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    flex-shrink: 0;
}

.back-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 12px 20px;
    font-size: 1.1em;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Компактная информационная панель */
.compact-info-bar {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 8px 15px;
    border-radius: 12px;
    margin: 0 15px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    min-height: 50px;
}

.compact-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    min-width: 0;
}

.info-label {
    font-size: 0.9em;
    color: #666;
    font-weight: 500;
    white-space: nowrap;
}

.info-value {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
    white-space: nowrap;
}

.level-info-compact {
    flex: 2;
    justify-content: flex-start;
}

.level-info-compact .level-name {
    font-size: 0.9em;
    color: #666;
    margin-left: 5px;
    white-space: nowrap;
    
    text-overflow: ellipsis;
}

.timer-info {
    flex: 1.5;
    justify-content: center;
    position: relative;
    padding-top: 10px;
}

.timer-mini-progress {
    position: absolute;
    bottom: -2px;
    left: 10px;
    right: 10px;
    height: 3px;
    background: #4CAF50;
    border-radius: 2px;
    transition: width 0.1s linear;
}

.timer-info.warning .timer-mini-progress {
    background: #FF9800;
}

.timer-info.danger .timer-mini-progress {
    background: #F44336;
}

.progress-info {
    flex: 1;
    justify-content: flex-end;
}

/* Кнопки управления в шапке */
.header-controls {
    display: flex;
    gap: 15px;
}

.rules-btn, .pause-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: 10px;
    width: 60px;
    height: 60px;
    font-size: 1.8em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.rules-btn:hover, .pause-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Игровое поле */
.game-board {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 30px;
    overflow-y: auto;
    min-height: 0;
}

/* Последовательность - ОБНОВЛЕНО */
.sequence-container {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sequence {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 40px;
    width: 100%;
    
    margin: 0 auto;
}

.sequence-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 200px;
    max-width: 400px;
    position: relative;
    padding-top: 0px;
    margin-top: 0px;
}

/* Номер блока как стикер - ОБНОВЛЕНО */
.block-number {
    position: absolute;
    top: -10px;
    left: 15px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
    z-index: 2;
    border: 3px solid rgba(255, 255, 255, 0.8);
    font-family: 'Courier New', monospace;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Контент блока */
.block-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    background: white;
    padding: 20px 15px 15px;
    border-radius: 12px;
    border: 2px solid #dee2e6;
    width: 100%;
    min-height: 70px;
}

/* Иконки */
.icon-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #adb5bd;
    border-radius: 10px;
    background: white;
    transition: all 0.2s;
    user-select: none;
    aspect-ratio: 1 / 1;
    position: relative;
    
    flex: 0 0 auto;
    width: 3.5em;
    height: 3.5em;
}

.icon-slot .icon-img {
    width: 3em;
    height: 3em;
    object-fit: contain;
    pointer-events: none;
}

.icon-slot .icon-emoji {
    
    line-height: 1;
    pointer-events: none;
}

.icon-slot.empty {
    border-style: dashed;
    background: #f8f9fa;
    cursor: pointer;
    
    color: #6c757d;
    font-weight: bold;
}

.icon-slot.empty:hover {
    background: #e9ecef;
    border-color: #6c757d;
    animation: pulse-empty 2s infinite;
}

.icon-slot.filled {
    border-color: #17a2b8;
    background: #e3f2fd;
}

.icon-slot.correct {
    border-color: #28a745;
    background: #d4edda;
    animation: pop 0.3s;
}

.icon-slot.incorrect {
    border-color: #dc3545;
    background: #f8d7da;
    animation: shake 0.3s;
}

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

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

@keyframes pulse-empty {
    0% { 
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.4); 
    }
    70% { 
        box-shadow: 0 0 0 8px rgba(76, 175, 80, 0); 
    }
    100% { 
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); 
    }
}

/* Доступные иконки */
.available-icons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
    flex-shrink: 0;
    min-height: 120px;
}

.available-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #adb5bd;
    border-radius: 10px;
    cursor: pointer;
    background: white;
    transition: all 0.2s;
    user-select: none;
    width: 70px;
    height: 70px;
    padding: 10px;
    flex-shrink: 0;
}

.available-icon:hover {
    border-color: #007bff;
    background: #e3f2fd;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.available-icon .icon-img {
    width: 3em;
    height:  3em;
    object-fit: contain;
    pointer-events: none;
}

.available-icon .icon-emoji {
    
    line-height: 1;
    pointer-events: none;
}

/* Сообщения */
.message {
    text-align: center;
    padding: 15px;
    margin: 15px 0;
    border-radius: 10px;
    font-weight: 600;
    font-size: clamp(0.9em, 2.5vw, 1.1em);
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s;
    flex-shrink: 0;
}

.message.show {
    opacity: 1;
    transform: translateY(0);
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

.message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 2px solid #bee5eb;
}

.message.instruction {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    animation: pulse-instruction 2.5s infinite;
}

@keyframes pulse-instruction {
    0% { 
        transform: translateY(0) scale(1); 
        box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3); 
    }
    50% { 
        transform: translateY(0) scale(1.02); 
        box-shadow: 0 6px 20px rgba(76, 175, 80, 0.5); 
    }
    100% { 
        transform: translateY(0) scale(1); 
        box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3); 
    }
}

/* Управление */
.controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    padding: 20px 30px;
    background: #f8f9fa;
    border-top: 2px solid #e9ecef;
    flex-shrink: 0;
}

.controls button {
    padding: clamp(12px, 3vw, 18px);
    border: none;
    border-radius: 12px;
    font-size: clamp(0.9em, 2.5vw, 1.1em);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

#newGameBtn {
    background: #28a745;
    color: white;
}

#newGameBtn:hover {
    background: #218838;
    transform: translateY(-2px);
}

#cancelBtn {
    background: #6c757d;
    color: white;
}

#cancelBtn:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

#answerBtn {
    background: #007bff;
    color: white;
}

#answerBtn:hover {
    background: #0056b3;
    transform: translateY(-2px);
}

/* ЭКРАН 3: ЭКРАН СТАТИСТИКИ */
.stats-screen {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
}

.stats-container {
    max-width: 800px;
    width: 100%;
    background: white;
    border-radius: 25px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideUp 0.6s ease;
}

.stats-header {
    margin-bottom: 40px;
}

.stats-header h1 {
    font-size: 2.5em;
    color: #333;
    margin-bottom: 15px;
}

.level-completed {
    font-size: 1.4em;
    color: #2196F3;
    font-weight: 600;
    background: #e3f2fd;
    padding: 12px 25px;
    border-radius: 50px;
    display: inline-block;
}

/* Система звезд */
.stars-container {
    text-align: center;
    margin: 30px 0;
    padding: 25px;
    background: linear-gradient(135deg, #fff8e1, #ffecb3);
    border-radius: 20px;
    border: 2px solid #ffd54f;
    box-shadow: 0 5px 20px rgba(255, 213, 79, 0.2);
}

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

.star {
    font-size: 4em;
    color: #ffd700;
    transition: all 0.3s;
    animation: starPop 0.5s ease forwards;
    opacity: 0;
    transform: scale(0);
}

.star.filled {
    color: #ff9800;
    text-shadow: 0 0 20px rgba(255, 152, 0, 0.5);
}

.star:nth-child(1) { animation-delay: 0.2s; }
.star:nth-child(2) { animation-delay: 0.4s; }
.star:nth-child(3) { animation-delay: 0.6s; }

@keyframes starPop {
    0% {
        opacity: 0;
        transform: scale(0) rotate(0deg);
    }
    70% {
        opacity: 1;
        transform: scale(1.2) rotate(10deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.stars-text {
    font-size: 1.5em;
    font-weight: bold;
    color: #333;
    margin-top: 10px;
    min-height: 40px;
}

/* Краткая статистика */
.stats-summary {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin: 25px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-icon {
    font-size: 1.8em;
}

.stat-value {
    font-size: 1.8em;
    font-weight: bold;
    color: #333;
}

.stat-label {
    font-size: 1em;
    color: #666;
}

/* Следующий уровень */
.next-level-info {
    background: #f8f9fa;
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 30px;
    border-left: 5px solid #2196F3;
}

.next-level-info h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.next-level-name {
    font-size: 1.8em;
    color: #2196F3;
    font-weight: bold;
    margin-bottom: 10px;
}

.next-level-desc {
    font-size: 1.1em;
    color: #666;
}

.stats-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stats-controls button {
    padding: 20px;
    border: none;
    border-radius: 15px;
    font-size: 1.2em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    width: 100%;
}

.continue-btn {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
}

.continue-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(33, 150, 243, 0.3);
}

.menu-btn {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #ddd;
}

.menu-btn:hover {
    background: white;
    border-color: #2196F3;
    color: #2196F3;
    transform: translateY(-3px);
}

/* МОДАЛЬНОЕ ОКНО ПРАВИЛ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    transform: translateY(-20px);
    transition: all 0.3s;
}

.modal-overlay.show .modal {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 3px solid #e9ecef;
}

.modal-title {
    font-size: clamp(1.2em, 3vw, 1.6em);
    font-weight: bold;
    color: #333;
}

.close-modal {
    background: none;
    border: none;
    font-size: 2em;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-modal:hover {
    background: #f8f9fa;
    color: #333;
}

.rules-content {
    font-size: clamp(0.9em, 2vw, 1em);
    line-height: 1.6;
}

.rules-content h3 {
    color: #495057;
    margin: 20px 0 10px 0;
    font-size: clamp(1em, 2.5vw, 1.2em);
}

.rules-content p {
    margin-bottom: 15px;
    color: #666;
}

.rules-content ul {
    margin-left: 20px;
    margin-bottom: 20px;
}

.rules-content li {
    margin-bottom: 10px;
    color: #666;
}

.tips {
    background: #e8f5e9;
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
    border-left: 4px solid #4CAF50;
}

.tips h3 {
    color: #2e7d32 !important;
}

/* ПАУЗА ОВЕРЛЕЙ */
.paused-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    cursor: pointer;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.paused-text {
    color: white;
    font-size: clamp(1.5em, 5vw, 2.5em);
    font-weight: bold;
    text-align: center;
    background: rgba(0, 0, 0, 0.7);
    padding: clamp(20px, 5vw, 40px);
    border-radius: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    max-width: 85%;
    animation: pulse 2s infinite;
}

.paused-text small {
    display: block;
    font-size: 0.4em;
    margin-top: 15px;
    color: #ccc;
    font-weight: normal;
}

/* АНИМАЦИИ */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

/* АДАПТАЦИЯ */
@media (max-width: 768px) {
    .start-container,
    .stats-container {
        padding: 25px;
    }
    
    .level-number {
        font-size: 3em;
    }
    
    .game-title {
        font-size: 2em;
    }
    
    .level-description {
        font-size: 1.2em;
    }
    
    .start-button,
    .rules-button {
        padding: 15px 25px;
        font-size: 1.2em;
    }
    
    .compact-info-bar {
        padding: 6px 10px;
        margin: 0 10px;
        min-height: 45px;
    }
    
    .info-label {
        font-size: 0.8em;
    }
    
    .info-value {
        font-size: 1em;
    }
    
    .game-board {
        padding: 15px;
    }
    
    .icon-slot {
        width: 50px;
        height: 50px;
    }
    
    .available-icon {
        width: 60px;
        height: 60px;
    }
    
    /* Адаптация для стикеров номеров блоков */
    .sequence-block {
        padding-top: 0px;
        margin-top: 0px;
        min-width: 180px;
    }
    
    .block-number {
        width: 35px;
        height: 35px;
        font-size: 16px;
        top: -8px;
        left: 10px;
        border-width: 2px;
    }
    
    .block-content {
        padding: 18px 12px 12px;
        min-height: 60px;
    }
    
    .stars-rating {
        gap: 15px;
    }
    
    .star {
        font-size: 3em;
    }
    
    .stats-summary {
        flex-direction: column;
        gap: 15px;
    }
}

@media (max-width: 600px) {
    .compact-info-bar {
        flex-direction: column;
        padding: 8px;
        gap: 5px;
        min-height: 60px;
    }
    
    .compact-info-item {
        width: 100%;
        justify-content: space-between;
        padding: 3px 0;
    }
    
    .level-info-compact .level-name {
        display: none;
    }
    
    .sequence {
        gap: 15px;
    }
    
    .sequence-block {
        min-width: 160px;
        max-width: 250px;
        padding-top: 0px;
    }
    
    .block-number {
        width: 32px;
        height: 32px;
        font-size: 14px;
        top: -6px;
        left: 8px;
    }
    
    .block-content {
        gap: 8px;
        padding: 16px 10px 10px;
    }
    
    .available-icons {
        gap: 10px;
        padding: 15px;
    }
    
    .icon-slot {
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .screen {
        padding: 10px;
    }
    
    .start-container,
    .stats-container {
        padding: 20px;
    }
    
    .game-header {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }
    
    .compact-info-bar {
        width: 100%;
        margin: 0;
        order: 2;
    }
    
    .back-btn {
        order: 1;
        align-self: flex-start;
    }
    
    .header-controls {
        order: 3;
        align-self: flex-end;
        margin-top: -45px;
    }
    
    .sequence {
        flex-direction: column;
        align-items: center;
        gap: 25px;
    }
    
    .sequence-block {
        width: 100%;
        max-width: 280px;
        padding-top: 0px;
        margin-top: 0px;
    }
    
    .block-number {
        width: 36px;
        height: 36px;
        font-size: 16px;
        top: -8px;
        left: 15px;
    }
    
    .available-icons {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 10px;
        padding: 15px;
    }
    
    .controls {
        grid-template-columns: 1fr;
        padding: 15px;
    }
    
    .icon-slot {
        width: 45px;
        height: 45px;
    }
    
    .available-icon {
        width: 50px;
        height: 50px;
    }
    
    .star {
        font-size: 2.5em;
    }
    
    .stars-text {
        font-size: 1.2em;
    }
}

/* Стили для скролла */
.game-board::-webkit-scrollbar {
    width: 8px;
}

.game-board::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.game-board::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.game-board::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Стили для оверлея при истечении времени */
.time-expired-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

.time-expired-content {
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
    color: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
    animation: slideIn 0.4s ease-out;
}

.time-expired-icon {
    font-size: 60px;
    margin-bottom: 20px;
    animation: pulse 1.5s infinite;
}

.time-expired-title {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.time-expired-message {
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 25px;
    opacity: 0.9;
}

.time-expired-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.time-expired-controls button {
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.time-expired-controls .continue-btn {
    background: linear-gradient(135deg, #9be15d 0%, #00e3ae 100%);
    color: white;
}

.time-expired-controls .back-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.time-expired-controls button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

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

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

/* ДОБАВЬТЕ ЭТИ СТИЛИ В КОНЕЦ ФАЙЛА (перед закрывающей скобкой) */

/* Исправление скролла на мобильных устройствах */
.game-board {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Плавный скролл на iOS */
}

/* Убедитесь, что контейнеры внутри game-board не растягивают его */
.sequence-container,
.available-icons,
.controls {
    flex-shrink: 0;
    min-height: auto;
}

/* Исправление для мобильных устройств */
@media (max-width: 480px) {
    .game-container {
        min-height: 95vh;
        max-height: 95vh;
        margin: 2.5vh auto;
    }
    
    .game-board {
        max-height: calc(95vh - 200px); /* Учитываем высоту шапки и controls */
        overflow-y: scroll;
        padding: 10px;
    }
    
    .sequence {
        flex-direction: column;
        gap: 20px;
        width: 100%;
    }
    
    .sequence-block {
        width: 100%;
        max-width: 100%;
        min-width: unset;
    }
    
    .available-icons {
        max-height: 150px;
        overflow-y: auto;
        padding: 10px;
        margin-top: 10px;
    }
    
    .icon-slot, 
    .available-icon {
        flex-shrink: 0;
    }
}

/* Для очень маленьких экранов */
@media (max-height: 700px) and (max-width: 480px) {
    .game-container {
        min-height: 90vh;
        max-height: 90vh;
    }
    
    .game-board {
        max-height: calc(90vh - 180px);
    }
    
    .sequence-block {
        padding-top: 0px;
        margin-top: 0px;
    }
    
    .block-content {
        min-height: 50px;
        padding: 14px 8px 8px;
    }
    
    .icon-slot {
        width: 40px;
        height: 40px;
    }
    
    .available-icon {
        width: 45px;
        height: 45px;
    }
}

/* Улучшенный скролл для всех устройств */
.game-board {
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
}

/* Убираем горизонтальный скролл на совсем узких экранах */
@media (max-width: 360px) {
    .game-container {
        border-radius: 15px;
    }
    
    .game-header {
        padding: 12px;
    }
    
    .compact-info-bar {
        padding: 5px 8px;
        min-height: 40px;
    }
    
    .info-value {
        font-size: 0.9em;
    }
    
    .block-number {
        width: 30px;
        height: 30px;
        font-size: 13px;
        top: -5px;
        left: 8px;
    }
}