/* Стили для прелоадера */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a2980 0%, #26d0ce 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    padding: 20px;
}

.preloader-content {
    text-align: center;
    color: white;
    position: relative;
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.school-title-container {
    margin-bottom: 30px;
    width: 100%;
}

.school-title {
    font-size: clamp(2em, 7vw, 3.5em);
    font-weight: 800;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    letter-spacing: 2px;
    font-family: 'Courier New', monospace;
    white-space: nowrap; /* Запрещаем перенос текста */
    overflow: hidden; /* Скрываем текст, который не помещается */
    width: 100%;
}

.school-title span {
    display: inline-block;
    text-align: center;
    transition: transform 0.3s ease, color 0.3s ease;
    font-size: inherit;
    white-space: nowrap; /* Запрещаем перенос внутри span */
    line-height: 1.2;
    padding: 5px 0;
}

.school-title span.final-char {
    color: #ffffff;
    animation: charFlash 0.3s ease;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.school-subtitle {
    font-size: clamp(1em, 3vw, 1.3em);
    font-weight: 300;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 15px;
    letter-spacing: 1px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    padding: 0 20px;
    white-space: normal; /* Разрешаем перенос для подзаголовка */
    text-align: center;
    line-height: 1.4;
}

.warning-box {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: clamp(15px, 4vw, 25px);
    margin: 30px 0;
    max-width: 600px;
    backdrop-filter: blur(10px);
    opacity: 0;
    animation: fadeIn 1s ease forwards 2.5s;
    width: 90%;
}

.warning-title {
    font-size: clamp(1.1em, 3vw, 1.4em);
    font-weight: 700;
    margin-bottom: 15px;
    color: #ffcc00;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.warning-text {
    font-size: clamp(0.9em, 2.5vw, 1.1em);
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.95);
    text-align: center;
}

.warning-highlight {
    margin: 15px 0;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border-left: 3px solid #ffcc00;
}

.start-test-btn {
    background: linear-gradient(145deg, #4CAF50, #2E7D32);
    color: white;
    padding: clamp(15px, 4vw, 20px) clamp(30px, 8vw, 50px);
    border: none;
    border-radius: 15px;
    font-size: clamp(1.1em, 3vw, 1.4em);
    font-weight: 700;
    cursor: pointer;
    margin: 40px 0;
    box-shadow: 0 10px 25px rgba(76, 175, 80, 0.5);
    transition: all 0.3s ease;
    opacity: 0;
    animation: fadeIn 0.5s ease forwards 3s, pulse 2s infinite 3s;
    min-width: min(300px, 90%);
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.start-test-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 30px rgba(76, 175, 80, 0.6);
}

.start-test-btn:active {
    transform: translateY(-2px) scale(1.02);
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* Адаптивность */
@media (max-width: 768px) {
    .school-title {
        font-size: clamp(1.8em, 6vw, 2.5em);
        letter-spacing: 1px;
    }
    
    .school-title span {
        font-size: clamp(1.8em, 6vw, 2.5em);
        line-height: 1.1;
    }
    
    .warning-box {
        margin: 20px 0;
        padding: 15px;
    }
    
    .start-test-btn {
        margin: 30px 0;
        min-width: 250px;
        padding: 15px 30px;
    }
}

@media (max-width: 480px) {
    .school-title {
        font-size: clamp(1.5em, 5vw, 2em);
        /* Уменьшаем размер, но НЕ разрешаем перенос */
        white-space: nowrap;
        overflow: visible;
    }
    
    .school-title span {
        font-size: clamp(1.5em, 5vw, 2em);
        line-height: 1;
    }
    
    .school-subtitle {
        font-size: 0.9em;
    }
    
    .warning-title {
        font-size: 1em;
    }
    
    .warning-text {
        font-size: 0.85em;
    }
    
    .start-test-btn {
        font-size: 1.1em;
        min-width: 220px;
        padding: 12px 25px;
    }
}

/* Для очень узких экранов просто уменьшаем размер шрифта */
@media (max-width: 350px) {
    .school-title {
        font-size: 1.3em;
    }
    
    .school-title span {
        font-size: 1.3em;
    }
}