/* ОБЩИЕ СТИЛИ - современный светлый дизайн */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 18px;
    scroll-behavior: smooth;
}

body, html {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f8fafc;
    color: #1e293b;
    min-height: 100vh;
    overflow-y: auto;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- ОБНОВЛЕННЫЙ СТАРТОВЫЙ ЭКРАН --- */
#start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #fff;
    background: url('images/start-bg.jpg') no-repeat center center;
    background-size: cover;
    z-index: 100;
}
/* Альтернативный вариант с псевдоэлементами */
#start-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: url('images/start-bg.jpg') no-repeat center center;
    background-size: cover;
    z-index: -1;
    animation: waveMotion 4s ease-in-out infinite;
}

#start-screen::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255,255,255,0.03) 50%,
        transparent 70%
    );
    animation: waveShimmer 2s linear infinite;
}

@keyframes waveMotion {
    0%, 100% {
        transform: translateX(0) translateY(0) scale(1);
    }
    25% {
        transform: translateX(2px) translateY(-1px) scale(1.005);
    }
    50% {
        transform: translateX(0) translateY(1px) scale(1.01);
    }
    75% {
        transform: translateX(-2px) translateY(-1px) scale(1.005);
    }
}

@keyframes waveShimmer {
    0% {
        transform: translateX(200%) skewX(45deg);
    }
    100% {
        transform: translateX(-100%) skewX(45deg);
    }
}


.start-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(30, 41, 59, 0.05);
    backdrop-filter: blur(4px);
    z-index: 1;
}

.start-content {
    position: relative;
    z-index: 2;
    padding: 3rem 2rem;
    max-width: 900px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.main-title {
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    line-height: 1.2;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    text-align: center;
    max-width: 100%;
    word-wrap: break-word;
    hyphens: auto;
    /* font-family: 'PT Serif', serif; */
}

.subtitle {
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    line-height: 1.5;
    margin-bottom: 1rem;
    max-width: 700px;
    text-align: center;
    /* font-family: 'Roboto', sans-serif; */
}

.start-btn {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border: 2px solid transparent;
    color: #ffffff;
    font-size: clamp(1rem, 2vw, 1.2rem);
    font-weight: 700;
    padding: 18px 40px;
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    user-select: none;
    outline: none;
    box-shadow:
        0 8px 25px rgba(59, 130, 246, 0.3),
        0 4px 12px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.start-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.start-btn:hover::before {
    left: 100%;
}

.start-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    transform: translateY(-3px) scale(1.02);
    box-shadow:
        0 12px 35px rgba(59, 130, 246, 0.4),
        0 6px 20px rgba(0, 0, 0, 0.3);
}

.start-btn:active {
    transform: translateY(-1px) scale(1.01);
}

/* Анимация появления контента */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.start-content > * {
    animation: fadeInUp 0.8s ease-out forwards;
}

.main-title {
    animation-delay: 0.2s;
}

.subtitle {
    animation-delay: 0.4s;
}

.start-btn {
    animation-delay: 0.6s;
}

/* Адаптивность для планшетов */
@media (max-width: 768px) {
    .start-content {
        padding: 2rem 1.5rem;
        gap: 1.5rem;
    }

    .main-title {
        margin-bottom: 0.3rem;
    }

    .subtitle {
        margin-bottom: 0.8rem;
    }

    .start-btn {
        padding: 16px 32px;
        min-width: 200px;
    }
}

/* Адаптивность для мобильных */
@media (max-width: 480px) {
    .start-content {
        padding: 1.5rem 1rem;
        gap: 1.2rem;
    }

    .main-title {
        letter-spacing: 0;
        word-break: break-word;
    }

    .start-btn {
        padding: 14px 28px;
        font-size: 1rem;
        min-width: 180px;
    }
}

/* Адаптивность для очень маленьких экранов */
@media (max-width: 320px) {
    .start-content {
        padding: 1rem;
    }

    .start-btn {
        padding: 12px 24px;
        min-width: 160px;
        font-size: 0.95rem;
    }
}

/* Улучшение производительности */
#start-screen {
    will-change: opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.start-btn {
    will-change: transform;
}


/* --- ОСНОВНОЙ КОНТЕЙНЕР КВИЗА --- */
.quiz-container {
    background: white;
    width: 90%;
    max-width: 700px;
    margin: 40px auto;
    padding: 40px;
    border-radius: 24px;
    border: none;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.08),
        0 8px 25px rgba(0, 0, 0, 0.04);
    display: none;
}

/* --- ПРОГРЕСС-БАР --- */
.header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
}

#counter {
    font-size: 1rem;
    font-weight: 600;
    color: #64748b;
    min-width: 140px;
}

.progress-bar {
    flex: 1;
    height: 12px;
    background: #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.progress {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    border-radius: 6px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

/* --- СТИЛИ ВОПРОСОВ И КНОПОК --- */
#question {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 28px;
    color: #0f172a;
    line-height: 1.4;
    text-align: center;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.option-btn {
    padding: 20px 24px;
    border: 2px solid #e2e8f0;
    color: #334155;
    border-radius: 16px;
    background: #f8fafc;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 500;
    text-align: left;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    user-select: none;
}

.option-btn:hover {
    background: #f1f5f9;
    border-color: #3b82f6;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.option-btn:disabled {
    cursor: not-allowed;
}

.option-btn.correct {
    background: #dcfce7;
    border-color: #22c55e;
    color: #15803d;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.15);
}

.option-btn.wrong {
    background: #fee2e2;
    border-color: #ef4444;
    color: #991b1b;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

.explanation {
    text-align: left;
    margin-top: 24px;
    padding: 24px;
    border-left: 4px solid #f59e0b;
    background: #fef3c7;
    font-size: 1.05rem;
    line-height: 1.6;
    border-radius: 0 16px 16px 0;
    color: #92400e;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.1);
}

.explanation img {
    max-width: 100%;
    border-radius: 12px;
    margin-top: 16px;
    display: block;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.next-btn, .retry-btn {
    border: none;
    cursor: pointer;
    display: block;
    margin: 32px auto 0;
    padding: 16px 32px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 50px;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
    transition: all 0.2s ease;
    user-select: none;
    min-width: 160px;
}

.next-btn:hover, .retry-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(59, 130, 246, 0.4);
}

/* --- ЭКРАН РЕЗУЛЬТАТОВ (уже обновлен) --- */
.result-screen {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    width: 90%;
    max-width: 600px;
    margin: 40px auto;
    padding: 40px 30px;
    border-radius: 24px;
    border: none;
    box-shadow:
        0 10px 25px rgba(0, 0, 0, 0.1),
        0 4px 10px rgba(0, 0, 0, 0.05);
    text-align: center;
    color: #1e293b;
}

.result-screen h2 {
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
    color: #0f172a;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.result-screen p {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #475569;
    line-height: 1.6;
}

.result-score {
    background: white;
    border-radius: 16px;
    padding: 24px;
    margin: 24px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
}

.result-score .score-main {
    font-size: 3rem;
    font-weight: 700;
    color: #1e40af;
    margin-bottom: 8px;
    line-height: 1;
}

.result-score .score-text {
    font-size: 1rem;
    color: #64748b;
    margin-bottom: 16px;
}

.result-score .score-percentage {
    font-size: 1.5rem;
    font-weight: 600;
    color: #059669;
}

#feedback {
    font-size: 1.1rem;
    font-style: normal;
    margin: 24px 0;
    color: #374151;
    background: #f1f5f9;
    padding: 20px;
    border-radius: 12px;
    line-height: 1.6;
}

.peers-section {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    border: 1px solid #e2e8f0;
}

.peers-section p {
    color: #6b7280;
    font-size: 0.95rem;
    margin: 0;
}

#peers {
    font-weight: 600;
    color: #1f2937;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 32px;
}

.retry-btn {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8) !important;
    color: white !important;
    border: none !important;
    padding: 14px 28px !important;
    border-radius: 12px !important;
    font-size: 1.05rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3) !important;
    margin: 0 !important;
    display: inline-block !important;
}

.retry-btn:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4) !important;
    background: linear-gradient(135deg, #2563eb, #1e40af) !important;
}

.share-buttons {
    margin-top: 32px;
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
}

.share-buttons p {
    font-size: 1rem;
    margin-bottom: 16px;
    color: #374151;
    font-weight: 500;
}

.share-buttons-row {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.share-buttons button {
    background: #f8fafc;
    color: #64748b;
    border: 2px solid #e2e8f0;
    padding: 14px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.4rem;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-buttons button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#tg-share {
    background: #0088cc;
    color: white;
    border-color: #0088cc;
}

#tg-share:hover {
    background: #006699;
    border-color: #006699;
    box-shadow: 0 4px 12px rgba(0, 136, 204, 0.3);
}

#vk-share {
    background: #4c75a3;
    color: white;
    border-color: #4c75a3;
}

#vk-share:hover {
    background: #3d6082;
    border-color: #3d6082;
    box-shadow: 0 4px 12px rgba(76, 117, 163, 0.3);
}

#native-share {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

#native-share:hover {
    background: #059669;
    border-color: #059669;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Font Awesome иконки */
.share-buttons button i {
    font-size: 1.2rem;
}

.stories-btn {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: white !important;
    font-weight: 600 !important;
    margin-top: 16px !important;
    padding: 14px 24px !important;
    border-radius: 12px !important;
    font-size: 1rem !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
    width: 100% !important;
    max-width: 280px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.stories-btn:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4) !important;
    background: linear-gradient(135deg, #059669, #047857) !important;
}

.stories-btn.download-mode {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed) !important;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3) !important;
}

.stories-btn.download-mode:hover {
    background: linear-gradient(135deg, #7c3aed, #6d28d9) !important;
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.4) !important;
}

.result-logo {
    text-align: center;
    margin-bottom: 5px;
    font-size: 48px;
}

/* АДАПТИВНОСТЬ */
@media (max-width: 768px) {
    .main-title {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 1.1rem;
    }

    .quiz-container {
        margin: 20px;
        padding: 30px 24px;
    }

    #question {
        font-size: 1.5rem;
    }

    .option-btn {
        padding: 16px 20px;
        font-size: 1rem;
    }

    .result-screen {
        margin: 10px;
        padding: 20px 15px;
        border-radius: 16px;
    }

    .result-screen h2 {
        font-size: 1.6rem;
        margin-bottom: 1rem;
    }

    .result-score {
        padding: 16px;
        margin: 16px 0;
    }

    .result-score .score-main {
        font-size: 2rem;
    }

    .result-score .score-text {
        font-size: 0.9rem;
    }

    .result-score .score-percentage {
        font-size: 1.2rem;
    }

    #feedback {
        padding: 16px;
        font-size: 1rem;
        margin: 16px 0;
    }

    .peers-section {
        padding: 12px;
        margin: 16px 0;
    }

    .peers-section p {
        font-size: 0.9rem;
    }

    .share-buttons {
        padding: 16px;
        margin-top: 20px;
    }

    .share-buttons p {
        font-size: 0.9rem;
        margin-bottom: 12px;
    }

    .stories-btn {
        padding: 12px 20px !important;
        font-size: 0.95rem !important;
        margin-top: 12px !important;
    }
}

@media (max-width: 480px) {
    .quiz-container {
        margin: 15px;
        padding: 24px 20px;
    }

    .main-title {
        font-size: 2rem;
    }

    #question {
        font-size: 1.3rem;
    }

    .option-btn {
        padding: 14px 16px;
        font-size: 0.95rem;
    }

    .next-btn, .retry-btn {
        padding: 14px 24px;
        font-size: 1rem;
    }
    .result-screen {
        margin: 20px auto;
        padding: 16px 12px;
    }

    .result-screen h2 {
        font-size: 1.4rem;
    }

    .result-score .score-main {
        font-size: 1.8rem;
    }

    .result-score .score-percentage {
        font-size: 1.1rem;
    }
    .result-score .score-text {
        margin-bottom: 0px;
    }

    #feedback {
        font-size: 0.95rem;
        padding: 0;
    }
    .share-buttons button {
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
        padding: 12px;
    }

    .share-buttons button i {
        font-size: 1rem;
    }

    .share-buttons-row {
        gap: 12px;
    }
}

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

.quiz-container, .result-screen {
    animation: fadeIn 0.6s ease-out;
}
