/* ========================================
   КВИЗ ДЛЯ РСЯ — ПОЛНАЯ ВЕРСИЯ
   ======================================== */

/* ===== КНОПКА-ТРИГГЕР В СТАТЬЕ ===== */
.rsya-btn-wrap {
    text-align: center;
    margin: 40px auto 30px;
}

.rsya-btn-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px 45px;
    font-size: 19px;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    border: 3px solid transparent;
    border-radius: 60px;
    cursor: pointer;
    box-shadow: 0 8px 30px rgba(26, 115, 232, 0.35);
    position: relative;
    text-decoration: none !important;
    letter-spacing: 0.3px;
    min-width: 280px;
    min-height: 68px;
    transition: all 0.3s ease;
    animation: rsya-shake 2.5s ease-in-out infinite;
    box-sizing: border-box;
    line-height: 1.2;
    font-family: Arial, sans-serif;
}

/* Радужная рамка */
.rsya-btn-open::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: linear-gradient(45deg, #ff6b6b, #feca57, #1a73e8, #ff6b6b);
    background-size: 400% 400%;
    border-radius: 64px;
    z-index: -1;
    animation: rsya-rainbow-border 3s ease-in-out infinite;
}

@keyframes rsya-rainbow-border {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Эффект при наведении */
.rsya-btn-open:hover {
    transform: scale(1.04);
    box-shadow: 0 12px 40px rgba(26, 115, 232, 0.5);
    animation-play-state: paused;
}

.rsya-btn-open:active {
    transform: scale(0.96);
}

/* Пульсирующее кольцо */
.rsya-btn-open .pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 60px;
    background: rgba(255, 255, 255, 0.12);
    transform: translate(-50%, -50%) scale(0.8);
    animation: rsya-pulse-ring 2.5s ease-out infinite;
    pointer-events: none;
}

@keyframes rsya-pulse-ring {
    0% {
        transform: translate(-50%, -50%) scale(0.7);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

/* Танцующий эмодзи */
.rsya-btn-open .btn-emoji {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
    animation: rsya-wiggle 1.8s ease-in-out infinite;
}

@keyframes rsya-wiggle {
    0%, 100% { transform: rotate(0deg); }
    20% { transform: rotate(-12deg); }
    40% { transform: rotate(12deg); }
    60% { transform: rotate(-6deg); }
    80% { transform: rotate(6deg); }
}

/* Текст кнопки */
.rsya-btn-open .btn-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
    vertical-align: middle;
    text-align: center;
}

/* Тряска с паузами */
@keyframes rsya-shake {
    0%, 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90%, 100% {
        transform: translateX(0);
    }
    5% {
        transform: translateX(-6px) rotate(-1deg);
    }
    15% {
        transform: translateX(6px) rotate(1deg);
    }
    25% {
        transform: translateX(-4px);
    }
    35% {
        transform: translateX(4px);
    }
    45% {
        transform: translateX(-2px);
    }
    55% {
        transform: translateX(2px);
    }
    65% {
        transform: translateX(-1px);
    }
    75% {
        transform: translateX(1px);
    }
    85% {
        transform: translateX(0);
    }
}

/* ========================================
   МОДАЛЬНОЕ ОКНО
   ======================================== */

.rsya-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 999999;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    animation: rsya-fade-in 0.3s ease;
}

@keyframes rsya-fade-in {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.rsya-modal-content {
    position: relative;
    max-width: 680px;
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    overflow-x: hidden;
    background: #f8faff;
    border-radius: 28px;
    padding: 30px 32px 34px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
    animation: rsya-slide-up 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-sizing: border-box;
}

@keyframes rsya-slide-up {
    0% {
        transform: translateY(60px) scale(0.95);
        opacity: 0;
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* ===== СКРОЛЛ В МОДАЛКЕ ===== */
.rsya-modal-content::-webkit-scrollbar {
    width: 6px;
}
.rsya-modal-content::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 0 28px 28px 0;
}
.rsya-modal-content::-webkit-scrollbar-thumb {
    background: #c0cbd8;
    border-radius: 10px;
}
.rsya-modal-content::-webkit-scrollbar-thumb:hover {
    background: #1a73e8;
}

/* ===== ЗАГОЛОВОК МОДАЛКИ ===== */
.rsya-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-right: 30px;
}

.rsya-modal-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #1a2634;
    line-height: 1.3;
}

.rsya-modal-close {
    position: absolute;
    top: 18px;
    right: 22px;
    background: none;
    border: none;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    color: #8a9bb0;
    transition: all 0.25s;
    padding: 0 6px;
    z-index: 10;
}

.rsya-modal-close:hover {
    color: #1a2634;
    transform: rotate(90deg) scale(1.1);
}

/* ===== ВОПРОСЫ ===== */
.q-item {
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px dashed #dce3ec;
}

.q-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.q-item p {
    font-weight: 600;
    margin: 0 0 10px;
    color: #1a2634;
    font-size: 15px;
}

.q-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.q-options label {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    padding: 8px 16px;
    border-radius: 10px;
    border: 1.5px solid #e6edf5;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.q-options label:hover {
    background: #f0f5ff;
    border-color: #1a73e8;
}

.q-options label.selected {
    background: #e3f0ff;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}

/* ===== ЧЕКБОКСЫ (РАДИО) ===== */
.q-options input[type="radio"] {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    accent-color: #1a73e8;
    margin: 0;
    cursor: pointer;
    appearance: auto;
    -webkit-appearance: radio;
    -moz-appearance: radio;
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-block !important;
    position: relative !important;
}

.q-options input[type="radio"]:checked {
    accent-color: #1a73e8;
}

/* ===== КНОПКА ОТПРАВКИ В МОДАЛКЕ ===== */
#quiz-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 18px 20px;
    margin-top: 24px;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    text-align: center;
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    border: none;
    border-radius: 14px;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(26, 115, 232, 0.3);
    transition: all 0.25s ease;
    line-height: 1.3;
    box-sizing: border-box;
    min-height: 60px;
    font-family: Arial, sans-serif;
}

#quiz-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 34px rgba(26, 115, 232, 0.4);
}

#quiz-submit:active {
    transform: translateY(0);
}

/* ===== РЕЗУЛЬТАТ ===== */
#quiz-result {
    margin-top: 22px;
    padding: 18px 22px;
    border-radius: 16px;
    font-size: 16px;
    line-height: 1.6;
    display: none;
    border: 2px solid #e6edf5;
    background: #fff;
}

/* ========================================
   АДАПТАЦИЯ ПОД МОБИЛЬНЫЕ
   ======================================== */

@media (max-width: 600px) {
    .rsya-modal-content {
        padding: 22px 18px 26px;
        max-height: 96vh;
        border-radius: 20px;
    }

    .rsya-modal-header h3 {
        font-size: 20px;
    }

    .rsya-modal-close {
        font-size: 28px;
        top: 14px;
        right: 16px;
    }

    .q-item p {
        font-size: 14px;
    }

    .q-options label {
        font-size: 13px;
        padding: 7px 12px;
    }

    .rsya-btn-open {
        padding: 18px 28px;
        font-size: 17px;
        min-width: auto;
        min-height: 60px;
        width: 100%;
        max-width: 340px;
        box-sizing: border-box;
    }

    #quiz-submit {
        font-size: 18px;
        padding: 16px 16px;
        min-height: 54px;
    }

    #quiz-result {
        padding: 14px 16px;
        font-size: 15px;
    }

    .rsya-modal {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: rgba(0, 0, 0, 0.7);
    }
}

@media (max-width: 400px) {
    .rsya-modal-content {
        padding: 16px 12px 20px;
        border-radius: 16px;
    }

    .rsya-modal-header h3 {
        font-size: 17px;
    }

    .rsya-btn-open {
        font-size: 15px;
        padding: 14px 18px;
        min-height: 52px;
        gap: 8px;
    }

    .rsya-btn-open .btn-emoji {
        font-size: 22px;
    }

    .q-options label {
        font-size: 12px;
        padding: 6px 10px;
    }

    #quiz-submit {
        font-size: 16px;
        padding: 14px 14px;
        min-height: 50px;
    }
}

@media (max-height: 700px) {
    .rsya-modal-content {
        padding-top: 16px;
        max-height: 94vh;
    }
    .q-item {
        margin-bottom: 12px;
        padding-bottom: 10px;
    }
}