/* ОСНОВНЫЕ СТИЛИ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, 
        #ff0000 0%,      /* Красный */
        #ff6600 25%,     /* Оранжевый */
        #0000ff 50%,     /* Синий */
        #ff6600 75%,     /* Оранжевый */
        #ff0000 100%     /* Красный */
    );
    background-size: 400% 400%;
    animation: fireAlarm 8s ease infinite;
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
    padding-top: 80px;
}

/* Анимация мигающих огней (как сирена) */
@keyframes fireAlarm {
    0% {
        background-position: 0% 0%;
    }
    25% {
        background-position: 100% 50%;
    }
    50% {
        background-position: 0% 100%;
    }
    75% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 0%;
    }
}

/* Добавляем второй слой для эффекта "проблесковых маячков" */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 50%, rgba(255,255,255,0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 30%, rgba(255,255,255,0.1) 0%, transparent 50%),
                radial-gradient(circle at 20% 80%, rgba(255,255,255,0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 70%, rgba(255,255,255,0.1) 0%, transparent 50%);
    animation: strobe 1s ease infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes strobe {
    0% { opacity: 0.3; }
    25% { opacity: 0.6; }
    50% { opacity: 0.3; }
    75% { opacity: 0.6; }
    100% { opacity: 0.3; }
}

/* Чтобы контент был поверх фона */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
    position: relative;
    z-index: 2;
}

/* ШАПКА */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    padding: 0.8rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    height: 70px;
    border-bottom: 3px solid #ff6600;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ff6600;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.logo-icon {
    font-size: 1.8rem;
}

.menu {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.menu-item {
    text-decoration: none;
    color: #333;
    font-weight: 600;
    padding: 8px 15px;
    border-radius: 50px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 1rem;
    white-space: nowrap;
}

.menu-item:hover {
    background: #ff6600;
    color: white;
    transform: translateY(-2px);
}

/* КОНТЕЙНЕР */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
}

.page {
    display: none;
    animation: fadeIn 0.5s ease;
    width: 100%;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ГЛАВНАЯ СТРАНИЦА */
.hero-section {
    text-align: center;
    margin-bottom: 30px;
}

.main-title {
    font-size: 2.2rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    margin-bottom: 15px;
    line-height: 1.2;
}

.slogan {
    font-size: 1.3rem;
    color: #ffd700;
    font-style: italic;
    margin-bottom: 20px;
}

/* КРАСИВАЯ ФОТКА НА ГЛАВНОЙ */
.hero-image-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto 20px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 30px rgba(0,0,0,0.3);
    border: 3px solid #ff6600;
    transition: transform 0.3s ease;
}

.hero-image-container:hover {
    transform: scale(1.02);
    box-shadow: 0 20px 40px rgba(255,102,0,0.4);
}

.hero-image-container a {
    display: block;
    text-decoration: none;
    cursor: pointer;
}

.hero-main-image {
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.hero-image-container:hover .hero-main-image {
    transform: scale(1.05);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.2) 50%, rgba(0,0,0,0) 100%);
    pointer-events: none;
}

.image-text {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    color: white;
    font-size: 1.3rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px black;
    z-index: 10;
    background: rgba(255,102,0,0.8);
    padding: 10px;
    margin: 0 15px;
    border-radius: 40px;
    backdrop-filter: blur(5px);
    border: 2px solid white;
}

/* СТАТИСТИКА */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin: 30px 0;
}

.stat-card {
    background: white;
    padding: 20px 10px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-number {
    font-size: 1.8rem;
    font-weight: bold;
    color: #ff6600;
    margin-bottom: 5px;
}

.stat-text {
    font-size: 0.9rem;
    color: #666;
}

/* КАРТОЧКИ */
.info-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.card {
    background: white;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    text-align: center;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(255,102,0,0.2);
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.card h3 {
    color: #ff6600;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.card p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* ПРОМО-БЛОК */
.game-promo {
    background: linear-gradient(135deg, #ff6600, #ff944d);
    color: white;
    padding: 30px 20px;
    border-radius: 30px;
    text-align: center;
    margin-top: 30px;
    box-shadow: 0 20px 40px rgba(255,102,0,0.3);
}

.promo-title {
    font-size: 2rem;
    margin-bottom: 15px;
}

.promo-text {
    font-size: 1.1rem;
    margin-bottom: 20px;
    opacity: 0.9;
}

.big-play-button {
    background: white;
    color: #ff6600;
    border: none;
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.big-play-button:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.button-icon {
    font-size: 1.5rem;
}

/* СТРАНИЦА ГЕРОЕВ */
.page-title {
    font-size: 2rem;
    color: white;
    text-align: center;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.heroes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.hero-card {
    background: white;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
}

.hero-card:nth-child(1) { animation-delay: 0.1s; }
.hero-card:nth-child(2) { animation-delay: 0.2s; }
.hero-card:nth-child(3) { animation-delay: 0.3s; }
.hero-card:nth-child(4) { animation-delay: 0.4s; }
.hero-card:nth-child(5) { animation-delay: 0.5s; }
.hero-card:nth-child(6) { animation-delay: 0.6s; }

.hero-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #ff6600, #ffd700);
}

.hero-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.hero-avatar {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 15px;
}

.hero-card h3 {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 5px;
    text-align: center;
}

.hero-rank {
    color: #ff6600;
    font-weight: 600;
    text-align: center;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.hero-desc {
    color: #666;
    line-height: 1.5;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.hero-medal {
    display: inline-block;
    background: #f0f0f0;
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    color: #333;
}

/* СТРАНИЦА ФАКТОВ */
.facts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.fact-card {
    background: white;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    opacity: 0;
    animation: fadeInScale 0.8s ease forwards;
}

.fact-card:nth-child(1) { animation-delay: 0.1s; }
.fact-card:nth-child(2) { animation-delay: 0.2s; }
.fact-card:nth-child(3) { animation-delay: 0.3s; }
.fact-card:nth-child(4) { animation-delay: 0.4s; }
.fact-card:nth-child(5) { animation-delay: 0.5s; }
.fact-card:nth-child(6) { animation-delay: 0.6s; }
.fact-card:nth-child(7) { animation-delay: 0.7s; }
.fact-card:nth-child(8) { animation-delay: 0.8s; }
.fact-card:nth-child(9) { animation-delay: 0.9s; }

.fact-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(255,102,0,0.2);
}

.fact-icon {
    font-size: 2rem;
    margin-bottom: 15px;
}

.fact-card h3 {
    color: #ff6600;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.fact-card p {
    color: #666;
    line-height: 1.5;
    font-size: 0.9rem;
}

/* ИГРА */
#gameContainer {
    background: white;
    border-radius: 30px;
    padding: 30px 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.scenario-menu {
    text-align: center;
}

.scenario-menu h3 {
    font-size: 1.8rem;
    color: #ff6600;
    background: white;
    padding: 12px 20px;
    border-radius: 50px;
    display: inline-block;
    margin: 0 auto 20px auto;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    font-weight: bold;
    border: 2px solid #ff6600;
}

.scenario-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.scenario-btn {
    padding: 15px 10px;
    border: none;
    border-radius: 15px;
    font-size: 1rem;
    font-weight: bold;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    animation: fadeInGameBtn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
    min-height: 60px;
    text-align: center;
    word-break: break-word;
}

.scenario-btn:hover {
    transform: scale(1.03);
    filter: brightness(1.1);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.btn-icon {
    font-size: 1.2rem;
}

/* АНИМАЦИЯ ПОЯВЛЕНИЯ КНОПОК В ИГРЕ */
@keyframes fadeInGameBtn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Задержки для каждой кнопки */
.scenario-btn:nth-child(1) { animation-delay: 0.05s; }
.scenario-btn:nth-child(2) { animation-delay: 0.1s; }
.scenario-btn:nth-child(3) { animation-delay: 0.15s; }
.scenario-btn:nth-child(4) { animation-delay: 0.2s; }
.scenario-btn:nth-child(5) { animation-delay: 0.25s; }
.scenario-btn:nth-child(6) { animation-delay: 0.3s; }
.scenario-btn:nth-child(7) { animation-delay: 0.35s; }
.scenario-btn:nth-child(8) { animation-delay: 0.4s; }
.scenario-btn:nth-child(9) { animation-delay: 0.45s; }
.scenario-btn:nth-child(10) { animation-delay: 0.5s; }
.scenario-btn:nth-child(11) { animation-delay: 0.55s; }
.scenario-btn:nth-child(12) { animation-delay: 0.6s; }
.scenario-btn:nth-child(13) { animation-delay: 0.65s; }
.scenario-btn:nth-child(14) { animation-delay: 0.7s; }
.scenario-btn:nth-child(15) { animation-delay: 0.75s; }
.scenario-btn:nth-child(16) { animation-delay: 0.8s; }
.scenario-btn:nth-child(17) { animation-delay: 0.85s; }

/* Стили для всех сценариев */
.fire { background: linear-gradient(135deg, #ff4444, #ff6b6b); }
.flood { background: linear-gradient(135deg, #4444ff, #6b6bff); }
.chem { background: linear-gradient(135deg, #44aa44, #6bc06b); }
.earthquake { background: linear-gradient(135deg, #8B4513, #A0522D); }
.storm { background: linear-gradient(135deg, #9b59b6, #b380cc); }
.forest { background: linear-gradient(135deg, #e67e22, #f39c12); }
.ice { background: linear-gradient(135deg, #00a8c5, #00c5e6); }
.gas { background: linear-gradient(135deg, #95a5a6, #bdc3c7); }
.car { background: linear-gradient(135deg, #e67e22, #f39c12); }
.lift { background: linear-gradient(135deg, #95a5a6, #7f8c8d); }
.train { background: linear-gradient(135deg, #3498db, #2980b9); }
.elevator { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.school { background: linear-gradient(135deg, #9b59b6, #8e44ad); }
.radiation { background: linear-gradient(135deg, #f1c40f, #f39c12); }
.avalanche { background: linear-gradient(135deg, #3498db, #2c3e50); }
.desert { background: linear-gradient(135deg, #e67e22, #d35400); }

.random-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    grid-column: span 2;
}

/* ИГРОВАЯ ОБЛАСТЬ */
.timer-container {
    text-align: center;
    margin-bottom: 20px;
}

.timer {
    font-size: 4rem;
    font-weight: bold;
    color: #ff6600;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.timer-label {
    font-size: 1.1rem;
    color: #666;
}

.question-box {
    font-size: 1.4rem;
    text-align: center;
    color: #333;
    margin: 30px 0;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 20px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
}

.answers-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.answer-btn {
    background: #333;
    color: white;
    border: none;
    padding: 15px;
    font-size: 1rem;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    min-height: 60px;
    word-break: break-word;
}

.answer-btn:hover {
    background: #ff6600;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255,102,0,0.4);
}

/* РЕЗУЛЬТАТ */
.result-box {
    text-align: center;
    padding: 30px;
}

.result-icon {
    font-size: 4rem;
    margin-bottom: 15px;
    animation: bounce 1s;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-20px); }
    60% { transform: translateY(-10px); }
}

.result-title {
    font-size: 2rem;
    color: #333;
    margin-bottom: 15px;
}

.result-text {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.play-button {
    background: #ff6600;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1.1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(255,102,0,0.3);
}

/* ПОДВАЛ */
.footer {
    background: #333;
    color: white;
    margin-top: 50px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.footer-section h4 {
    color: #ff6600;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.footer-section p {
    color: #ccc;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.footer-links {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-link {
    color: #ff6600;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    display: inline-block;
    padding: 5px 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 30px;
    border: 1px solid rgba(255,102,0,0.3);
}

.footer-link:hover {
    color: white;
    background: #ff6600;
    transform: translateX(5px);
    border-color: white;
}

.student-project {
    margin-top: 15px;
    font-size: 0.9rem;
    color: #ffd700;
    font-style: italic;
    padding: 8px;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    border-left: 3px solid #ff6600;
}

.university-credit {
    margin-top: 8px;
    font-size: 0.85rem;
    color: #ffd700;
    letter-spacing: 0.5px;
}

.footer-bottom {
    background: #222;
    text-align: center;
    padding: 15px;
    color: #888;
    font-size: 0.9rem;
}

/* ===== КОМИКС ===== */
.comics-container {
    background: white;
    border-radius: 30px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.comics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.comics-item {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 3px solid #ff6600;
    background: white;
}

.comics-item:hover {
    transform: scale(1.02);
    box-shadow: 0 20px 40px rgba(255,102,0,0.3);
}

.comics-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.comics-item:hover .comics-img {
    transform: scale(1.05);
}

.comics-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    padding: 15px 10px 10px;
    font-weight: bold;
    text-align: center;
    font-size: 1.1rem;
    text-shadow: 1px 1px 2px black;
}
/* ===== КОМИКС В ВИДЕ КНИГИ ===== */
.comics-book-container {
    background: linear-gradient(135deg, #f5f5f5, #e0e0e0);
    border-radius: 30px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
}

.comics-book-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(45deg, 
        rgba(0,0,0,0.02) 0px, 
        rgba(0,0,0,0.02) 20px,
        rgba(0,0,0,0.05) 20px,
        rgba(0,0,0,0.05) 40px);
    pointer-events: none;
    z-index: 1;
}

.comics-book {
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    position: relative;
    z-index: 2;
    border: 1px solid #ccc;
    max-width: 900px;
    margin: 0 auto;
}

.comics-pages {
    position: relative;
    min-height: 500px;
    background: #f9f9f9;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.1);
}

.comics-page {
    display: none;
    position: relative;
    animation: pageFlip 0.6s ease;
}

.comics-page.active {
    display: block;
}

@keyframes pageFlip {
    from {
        opacity: 0;
        transform: rotateY(-10deg) scale(0.95);
    }
    to {
        opacity: 1;
        transform: rotateY(0) scale(1);
    }
}

.comics-page-img {
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.comics-page-img:hover {
    transform: scale(1.02);
}

.comics-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
    padding: 15px;
    background: linear-gradient(135deg, #ff6600, #ff944d);
    border-radius: 60px;
    color: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.comics-nav-btn {
    background: white;
    color: #ff6600;
    border: none;
    padding: 12px 25px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    border: 2px solid white;
}

.comics-nav-btn:hover {
    transform: scale(1.05);
    background: #ff6600;
    color: white;
    border-color: white;
}

.comics-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.comics-page-info {
    font-size: 1.4rem;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    background: rgba(0,0,0,0.2);
    padding: 8px 25px;
    border-radius: 50px;
    letter-spacing: 2px;
}

.comics-footer {
    text-align: center;
    margin-top: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #333, #444);
    border-radius: 60px;
    color: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.comics-to-be-continued {
    font-size: 1.3rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 4px;
    animation: pulse 2s infinite;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255,215,0,0.5);
}

@keyframes pulse {
    0% { opacity: 0.7; text-shadow: 0 0 5px rgba(255,215,0,0.3); }
    50% { opacity: 1; text-shadow: 0 0 20px rgba(255,215,0,0.8); }
    100% { opacity: 0.7; text-shadow: 0 0 5px rgba(255,215,0,0.3); }
}

/* Адаптация для телефонов */
@media (max-width: 768px) {
    .comics-controls {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .comics-nav-btn {
        width: 100%;
        padding: 12px;
        font-size: 1rem;
    }
    
    .comics-page-info {
        font-size: 1.2rem;
        padding: 8px 20px;
    }
    
    .comics-to-be-continued {
        font-size: 1rem;
        letter-spacing: 2px;
    }
    
    .comics-page-img {
        max-height: 400px;
    }
}

/* Модальное окно для комикса */
.comics-modal-content {
    max-width: 800px;
    background: transparent;
    box-shadow: none;
}

.comics-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: white;
    border-radius: 30px;
    padding: 10px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.comics-modal-img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 20px;
    border: 3px solid #ff6600;
    object-fit: contain;
}

.comics-nav-btn {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50px;
    background: #ff6600;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.comics-nav-btn:hover {
    transform: scale(1.1);
    background: #ff944d;
}

.comics-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.comics-page-indicator {
    text-align: center;
    margin-top: 15px;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    text-shadow: 2px 2px 4px black;
    background: rgba(255,102,0,0.7);
    padding: 8px 20px;
    border-radius: 50px;
    display: inline-block;
    backdrop-filter: blur(5px);
    border: 2px solid white;
}

/* ===== КНОПКА НАВЕРХ ===== */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #ff6600;
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 5px 20px rgba(255,102,0,0.4);
    transition: all 0.3s ease;
    z-index: 9998;
    border: 2px solid white;
}

.scroll-top:hover {
    transform: scale(1.1);
    background: #ff944d;
    box-shadow: 0 10px 25px rgba(255,102,0,0.6);
}

.scroll-top.show {
    display: flex;
    animation: fadeInUp 0.3s ease;
}

/* ===== МОДАЛЬНЫЕ ОКНА ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 25px;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    position: relative;
    animation: slideIn 0.3s ease;
    max-height: 80vh;
    overflow-y: auto;
}

@keyframes slideIn {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close {
    color: #aaa;
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close:hover {
    color: #ff6600;
    transform: scale(1.1);
}

.modal-body {
    padding: 20px 0;
}

.modal-hero {
    text-align: center;
}

.modal-hero-avatar {
    font-size: 6rem;
    margin-bottom: 20px;
    animation: bounce 1s;
}

.modal-hero h2 {
    color: #ff6600;
    font-size: 2rem;
    margin-bottom: 10px;
}

.modal-hero-rank {
    color: #666;
    font-size: 1.2rem;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px dashed #ff6600;
}

.modal-hero-story {
    text-align: left;
    margin: 20px 0;
    line-height: 1.8;
    font-size: 1.1rem;
    color: #333;
}

.modal-hero-story p {
    margin-bottom: 15px;
}

.modal-hero-quote {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 15px;
    font-style: italic;
    color: #666;
    border-left: 4px solid #ff6600;
    margin: 20px 0;
}

.modal-fact {
    text-align: center;
}

.modal-fact-icon {
    font-size: 5rem;
    margin-bottom: 20px;
}

.modal-fact h2 {
    color: #ff6600;
    font-size: 2rem;
    margin-bottom: 20px;
}

.modal-fact-description {
    text-align: left;
    margin: 20px 0;
    line-height: 1.8;
    font-size: 1.1rem;
    color: #333;
}

.modal-fact-stats {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
    text-align: center;
}

.modal-fact-stats div {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 10px;
}

/* Кликабельные карточки */
.clickable {
    cursor: pointer;
    transition: all 0.3s ease;
}

.clickable:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(255,102,0,0.3);
}

.click-hint {
    font-size: 0.9rem;
    color: #ff6600;
    margin-top: 10px;
    text-align: center;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.clickable:hover .click-hint {
    opacity: 1;
}

/* Кнопки в модальных окнах */
.modal-button {
    background: #ff6600;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1.1rem;
    border-radius: 50px;
    cursor: pointer;
    margin: 10px 5px;
    transition: all 0.3s ease;
}

.modal-button:hover {
    transform: scale(1.05);
    background: #ff944d;
}

.modal-button.secondary {
    background: #333;
}

.modal-button.secondary:hover {
    background: #555;
}

/* ===== АДАПТАЦИЯ ДЛЯ ТЕЛЕФОНОВ ===== */
@media (max-width: 768px) {
    body {
        padding-top: 110px;
    }
    
    .header {
        flex-direction: column;
        height: auto;
        padding: 10px;
        gap: 8px;
    }
    
    .logo {
        font-size: 1.3rem;
    }
    
    .logo-icon {
        font-size: 1.5rem;
    }
    
    .menu {
        justify-content: center;
        gap: 5px;
    }
    
    .menu-item {
        padding: 6px 10px;
        font-size: 0.85rem;
    }
    
    .main-title {
        font-size: 1.6rem;
    }
    
    .slogan {
        font-size: 1.1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .info-cards {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .heroes-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .facts-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .scenario-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .random-btn {
        grid-column: span 2;
    }
    
    .answers-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 20px;
    }
    
    .footer-link {
        font-size: 0.85rem;
        padding: 4px 8px;
    }
    
    .student-project {
        font-size: 0.8rem;
    }
    
    .timer {
        font-size: 3rem;
    }
    
    .question-box {
        font-size: 1.2rem;
        padding: 15px;
    }
    
    .scenario-menu h3 {
        font-size: 1.4rem;
        padding: 10px 15px;
    }
    
    .hero-image-container {
        max-width: 90%;
    }
    
    .image-text {
        font-size: 1rem;
        padding: 8px;
    }
    
    .scroll-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 1.5rem;
    }
    
    .comics-grid {
        grid-template-columns: 1fr;
    }
    
    .comics-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
    
    .comics-modal-img {
        max-height: 60vh;
    }
}

/* АНИМАЦИИ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* СКРОЛЛБАР */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #ff6600;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #cc5200;
}
/* ===== ИСПРАВЛЕНИЯ ДЛЯ КОМИКСА ===== */

/* Убираем проблемный фон с body для страницы комикса */
.page#comics {
    background: transparent;
}

/* Делаем нормальный белый фон для контейнера комикса */
.comics-book-container {
    background: white !important;
    border-radius: 30px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

/* Исправляем кнопки - делаем их компактнее и красивее */
.comics-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #ff6600, #ff944d);
    border-radius: 50px;
    color: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.comics-nav-btn {
    background: white;
    color: #ff6600;
    border: none;
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    border: 2px solid white;
    min-width: 120px;
    text-align: center;
}

.comics-nav-btn:hover {
    transform: scale(1.05);
    background: #ff6600;
    color: white;
}

.comics-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.comics-page-info {
    font-size: 1.2rem;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    background: rgba(0,0,0,0.2);
    padding: 5px 20px;
    border-radius: 30px;
    letter-spacing: 1px;
}

/* Исправляем подвал комикса */
.comics-footer {
    text-align: center;
    margin-top: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #333, #444);
    border-radius: 50px;
    color: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.comics-to-be-continued {
    font-size: 1.3rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    animation: pulse 2s infinite;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255,215,0,0.5);
}

/* Убираем дурацкий фон с анимацией пожара на странице комикса */
.page#comics,
.page#comics .container,
.page#comics .page.active {
    background: transparent !important;
}

/* Фикс для мобилок */
@media (max-width: 768px) {
    .comics-controls {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
        border-radius: 30px;
    }
    
    .comics-nav-btn {
        width: 100%;
        padding: 12px;
        font-size: 1rem;
        min-width: auto;
    }
    
    .comics-page-info {
        font-size: 1.1rem;
        padding: 5px 15px;
    }
    
    .comics-to-be-continued {
        font-size: 1rem;
        letter-spacing: 1px;
    }
}
/* ===== УЛУЧШЕНИЯ ДЛЯ ИГРЫ ===== */

/* Стартовый экран */
#startScreen {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 30px;
}

.start-screen-content h3 {
    font-size: 2rem;
    color: #ff6600;
    margin-bottom: 15px;
}

.start-screen-content p {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 20px;
}

.name-input {
    width: 80%;
    max-width: 300px;
    padding: 15px;
    font-size: 1.1rem;
    border: 2px solid #ff6600;
    border-radius: 50px;
    margin-bottom: 20px;
    text-align: center;
    outline: none;
}

.name-input:focus {
    border-color: #ff944d;
    box-shadow: 0 0 10px rgba(255,102,0,0.3);
}

/* Игровой хедер */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 20px;
}

.game-stats {
    display: flex;
    gap: 20px;
    font-size: 1.1rem;
    font-weight: bold;
}

.game-score {
    color: #4CAF50;
}

.game-health {
    color: #ff4444;
}

/* Результат */
.result-score {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 20px 0;
    color: #ff6600;
}

.result-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.play-button.secondary {
    background: #333;
}

.play-button.secondary:hover {
    background: #555;
}

.cert-btn {
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    color: #333;
}

/* Сертификат */
.certificate-box {
    background: linear-gradient(135deg, #fff8e7, #fff);
    border-radius: 20px;
    padding: 30px;
    margin: 20px auto;
    max-width: 500px;
    border: 3px solid #ffd700;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    animation: fadeIn 0.5s ease;
}

.certificate-content {
    text-align: center;
    border: 2px dashed #ffd700;
    padding: 30px;
    border-radius: 15px;
}

.certificate-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.certificate-title {
    font-size: 2rem;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    letter-spacing: 3px;
    margin-bottom: 20px;
}

.certificate-text {
    font-size: 1.1rem;
    color: #666;
    margin: 10px 0;
}

.certificate-name {
    font-size: 2rem;
    color: #ff6600;
    margin: 15px 0;
    font-weight: bold;
}

.certificate-score {
    font-size: 1.3rem;
    color: #333;
    margin: 20px 0;
    padding: 10px;
    background: #f0f0f0;
    border-radius: 10px;
}

.certificate-date {
    font-size: 0.9rem;
    color: #999;
    margin-top: 15px;
}

.certificate-stamp {
    margin-top: 20px;
    font-size: 1rem;
    color: #ff6600;
    font-weight: bold;
    transform: rotate(-5deg);
    border: 2px solid #ff6600;
    display: inline-block;
    padding: 5px 20px;
    border-radius: 50px;
    background: white;
}

.certificate-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}