/* Основные стили и шрифты */
@font-face {
    font-family: inter;
    src: url('Inter-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

/* Базовые стили для всех страниц */
body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.main {
    margin-top: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    position: relative;
}

.cyndyk {
    width: 150px;
    height: auto;
    margin-bottom: 20px;
    cursor: pointer;
}

/* Контейнер - общие стили */
.container {
    width: 90vw;
    max-width: 420px;
    height: auto;
    min-height: 250px;
    background: #846DE5;
    background: linear-gradient(149deg, rgba(132, 109, 229, 1) 0%, rgba(64, 39, 141, 1) 92%);
    background-size: contain, auto;
    border-radius: 37.5px;
    box-shadow: 0 10px 20px #846de5ab;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: visible;
    background-size: cover;
    padding: 20px;
    box-sizing: border-box;
    z-index: 1;
}

.container.error-mode {
    width: 550px;
    height: 130px;
}

.txt-center {
    text-align: center !important;
}


/* Текст */
.text {
    font-size: 18px;
    font-family: inter;
    color: #fff;
    text-align: left;
    padding: 0 20px;
    z-index: 1;
    line-height: 1.4;
    width: 100%;
}

.not-black {
    color: #1C032A;
}

.black {
    color: black !important;
}

.fs-16 {
    font-size: 16px !important;
}

.mb-30 {
    margin-bottom: 30px;
}

.mb-15 {
    margin-bottom: 15px;
}

.txt-center {
    text-align: center;
}

.txt-al-left {
    text-align: left !important;
}

.bld {
    font-weight: bolder;
}

.bgr {
    font-size: 40px;
    margin-top: -20px;
    font-weight: bolder;
    text-align: center;
}

/* Поля ввода */
.input-field {
    width: 90vw;
    max-width: 300px;
    font-family: inter !important;
    height: 60px;
    border-radius: 21px;
    border: none;
    padding: 0 20px;
    font-size: 16px;
    outline: none;
    z-index: 2;
    text-align: center;
    box-sizing: border-box;
    position: relative;
}

.input-field::placeholder {
    color: #CDCDCD;
}

.input-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.form-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* Кнопки */
.buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 30px;
    gap: 15px;
    width: 100%;
    max-width: 390px;
    position: relative;
    z-index: 1;
}

.btn {
    width: 90vw;
    max-width: 390px;
    height: 50px;
    border-radius: 37.5px;
    border: none;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 15px;
    white-space: normal;
    word-break: break-word;
    box-sizing: border-box;
    font-family: inter;
}

.btn-get-code {
    background: #846DE5;
    background: linear-gradient(149deg, rgba(132, 109, 229, 1) 0%, rgb(94, 64, 184) 99%);
    color: white;
}

.btn-support {
    background-color: #DD5454 !important;
    color: #ffffff !important;
}

.btn-continue {
    background-color: #846DE5;
    color: #fff;
}

.btn-expanded {
    height: auto;
    min-height: 50px;
    padding: 15px;
}

.btn-please-review {
    background-color: #BDBAFF;
    height: auto;
    min-height: 80px;
    position: relative;
    cursor: pointer;
    color: black;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    white-space: normal;
    word-break: break-word;
    text-decoration: none;
}

.btn-please-review:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

.btn-please-review .text {
    line-height: 1.3;
    width: 100%;
}

.btn.btn-please-review:link,
.btn.btn-please-review:visited {
    color: rgb(0, 0, 0) !important;
}

.expanded-text {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.question {
    font-weight: bold;
    margin-bottom: 8px;
}

.answer {
    font-size: 14px !important;
    font-weight: normal;
}

/* Ошибки */
.error-container {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 390px;
    height: 250px;
    pointer-events: none;
    z-index: 2;
}

.desktop-error {
    position: absolute;
    top: 130px;
    left: 380px;
    width: 300px;
    height: 60px;
    background: url('warning.png') no-repeat left center;
    background-size: contain;
    color: white;
    font-size: 14px;
    padding-left: 40px;
    display: none;
    align-items: center;
    z-index: 100;
    opacity: 1;
    transition: opacity 1s ease-in-out;
}

.mobile-error-popup {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    width: calc(90vw - 40px);
    max-width: 320px;
    height: auto;
    max-height: 100px;
    min-height: 20px;
    background-color: #e24a43;
    border-radius: 12px;
    color: white;
    font-size: 14px;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(226, 74, 67, 0.4);
    opacity: 1;
    transition: opacity 1s ease-in-out;
    z-index: 200;
    animation: slideDown 0.3s ease-out;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.mobile-error-popup:before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid #e24a43;
}

.fade-out {
    opacity: 0 !important;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Рейтинг и модальное окно (приоритет из game_code.html) */
.rating-box {
    max-width: 420px;
    margin: 30px auto 0;
    background: #EBE7FD;
    border-radius: 35px;
    padding: 25px 25px 20px !important;
    text-align: center !important;
    min-width: 380px;
    min-height: 70px;
    position: fixed;
    bottom: 20px;
}

.rating-box p {
    margin: 0 0 16px;
    font-size: 14px !important;
    font-weight: 600;
}

.stars {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.star {
    width: 22px;
    height: 22px;
    background-image: url('star.svg');
    background-size: contain;
    background-repeat: no-repeat;
    cursor: pointer;
    transition: filter 0.2s ease;
    display: block;
    margin-right: 8px;
}

.star-wrapper {
    position: relative;
    padding: 5px;
    margin: -5px;
    cursor: pointer;
}

.star.active {
    filter: invert(0%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(0%) contrast(100%);
}

.star.hovered {
    filter: invert(0%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(0%) contrast(100%);
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.btn-continue {
    background: #846DE5;
    background: linear-gradient(149deg,rgba(132, 109, 229, 1) 0%, rgb(94, 64, 184) 99%);
    color: white;
}

.modal-box {
    width: 530px !important;
    background: rgba(255, 255, 255, 0.87);
    border-radius: 40px;
    padding: 18px 50px 35px 50px !important;
    text-align: center !important;
    box-shadow: 0 0 50px rgba(73, 9, 129, 0.3);
    animation: modalAppear 0.3s ease-out;
    backdrop-filter: blur(20px) saturate(60%);
}

.chat-btn {
    width: 70%;
    height: 48px;
    background: #5138A3;
    color: #fff !important;
    border: none;
    border-radius: 50px;
    font-size: 15px !important;
    cursor: pointer;
    text-align: center !important;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes modalDisappear {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}



@keyframes mulShdSpin {
    0%,
    100% {
        box-shadow: 0 -1.2em 0 0.08em #fff,
                    0.8em -0.8em 0 0em #fff,
                    1.2em 0 0 -0.4em #fff,
                    0.8em 0.8em 0 -0.4em #fff,
                    0 1.2em 0 -0.4em #fff,
                    -0.8em 0.8em 0 -0.4em #fff,
                    -1.2em 0 0 -0.4em #fff,
                    -0.8em -0.8em 0 0 #fff;
    }
    12.5% {
        box-shadow: 0 -1.2em 0 0 #fff,
                    0.8em -0.8em 0 0.08em #fff,
                    1.2em 0 0 0 #fff,
                    0.8em 0.8em 0 -0.4em #fff,
                    0 1.2em 0 -0.4em #fff,
                    -0.8em 0.8em 0 -0.4em #fff,
                    -1.2em 0 0 -0.4em #fff,
                    -0.8em -0.8em 0 -0.4em #fff;
    }
    25% {
        box-shadow: 0 -1.2em 0 -0.2em #fff,
                    0.8em -0.8em 0 0 #fff,
                    1.2em 0 0 0.08em #fff,
                    0.8em 0.8em 0 0 #fff,
                    0 1.2em 0 -0.4em #fff,
                    -0.8em 0.8em 0 -0.4em #fff,
                    -1.2em 0 0 -0.4em #fff,
                    -0.8em -0.8em 0 -0.4em #fff;
    }
    37.5% {
        box-shadow: 0 -1.2em 0 -0.4em #fff,
                    0.8em -0.8em 0 -0.4em #fff,
                    1.2em 0em 0 0 #fff,
                    0.8em 0.8em 0 0.08em #fff,
                    0 1.2em 0 0em #fff,
                    -0.8em 0.8em 0 -0.4em #fff,
                    -1.2em 0em 0 -0.4em #fff,
                    -0.8em -0.8em 0 -0.4em #fff;
    }
    50% {
        box-shadow: 0 -1.2em 0 -0.4em #fff,
                    0.8em -0.8em 0 -0.4em #fff,
                    1.2em 0 0 -0.4em #fff,
                    0.8em 0.8em 0 0em #fff,
                    0 1.2em 0 0.08em #fff,
                    -0.8em 0.8em 0 0 #fff,
                    -1.2em 0em 0 -0.4em #fff,
                    -0.8em -0.8em 0 -0.4em #fff;
    }
    62.5% {
        box-shadow: 0 -1.2em 0 -0.4em #fff,
                    0.8em -0.8em 0 -0.4em #fff,
                    1.2em 0 0 -0.4em #fff,
                    0.8em 0.8em 0 -0.4em #fff,
                    0 1.2em 0 0 #fff,
                    -0.8em 0.8em 0 0.08em #fff,
                    -1.2em 0 0 0 #fff,
                    -0.8em -0.8em 0 -0.4em #fff;
    }
    75% {
        box-shadow: 0em -1.2em 0 -0.4em #fff,
                    0.8em -0.8em 0 -0.4em #fff,
                    1.2em 0em 0 -0.4em #fff,
                    0.8em 0.8em 0 -0.4em #fff,
                    0 1.2em 0 -0.4em #fff,
                    -0.8em 0.8em 0 0 #fff,
                    -1.2em 0em 0 0.08em #fff,
                    -0.8em -0.8em 0 0 #fff;
    }
    87.5% {
        box-shadow: 0em -1.2em 0 0 #fff,
                    0.8em -0.8em 0 -0.4em #fff,
                    1.2em 0 0 -0.4em #fff,
                    0.8em 0.8em 0 -0.4em #fff,
                    0 1.2em 0 -0.4em #fff,
                    -0.8em 0.8em 0 0 #fff,
                    -1.2em 0em 0 0 #fff,
                    -0.8em -0.8em 0 0.08em #fff;
    }
}

/* Также нужно адаптировать другие элементы для мобильных */
@media (max-width: 768px) {
    .input-field {
        width: 85vw; /* Адаптивная ширина поля ввода */
        max-width: 300px;
        height: 55px;
        font-size: 15px;
    }
    
    .text {
        font-size: 16px;
        padding: 0 15px;
    }
    
}

@media (max-width: 480px) {
    .input-field {
        width: 90vw;
        height: 50px;
        font-size: 14px;
    }
    
    .text {
        font-size: 15px;
        padding: 0 10px;
    }
    
    
    .mb-30 {
        margin-bottom: 20px;
    }
}

        
        .cross-icon {
            width: 50px;
            height: 50px;
            position: relative;
            margin-bottom: 20px;
        }
        
        .cross-icon::before,
        .cross-icon::after {
            content: '';
            position: absolute;
            width: 100%;
            height: 4px;
            background-color: #fff;
            top: 50%;
            left: 0;
            border-radius: 2px;
        }
        
        .cross-icon::before {
            transform: translateY(-50%) rotate(45deg);
        }
        
        .cross-icon::after {
            transform: translateY(-50%) rotate(-45deg);
        }
        

        
        .loader {
          width: 0.4em; 
          height: 0.4em;
          border-radius: 50%;
          position: relative;
          text-indent: -9999em;
          animation: mulShdSpin 1.3s infinite linear;
          transform: translateZ(0);
          margin: 30px auto;
          color: white;
        }
        
        .loading-text {
            font-size: 16px;
            text-align: center;
            font-family: inter !important;
            font-weight: bold;
            margin: 15px 0;
        }
        
        .loading-container {
            display: none;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 20px 0;
            color:white;
        }

@media (max-width: 320px) {
    .input-field {
        width: 95vw;
        height: 45px;
        font-size: 13px;
    }
    
    .text {
        font-size: 14px;
    }
    
}

/* Медиа-запросы для мобильных устройств */
@media (max-width: 1024px) {
    .desktop-error {
        display: none !important;
    }
    
    .mobile-error-popup {
        display: flex !important;
    }
}

@media (min-width: 1025px) {
    .desktop-error {
        display: flex !important;
    }
    
    .mobile-error-popup {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .container {
        width: 95vw;
        max-width: none;
        border-radius: 25px;
        min-height: 200px;
    }
    
    .rating-box {
        position: relative;
        min-width: unset;
        width: 90vw;
        max-width: 400px;
        margin: 30px auto;
        bottom: unset;
    }
    
    .buttons {
        width: 95vw;
        max-width: none;
    }
    
    .btn {
        width: 95vw;
        max-width: none;
        font-size: 15px;
        height: 45px;
    }
    
    .btn-expanded {
        min-height: 45px;
        padding: 12px;
    }
    
    .btn-please-review {
        min-height: 70px;
        padding: 12px 15px;
        font-size: 15px;
    }
    
    .modal-box {
        width: 90vw;
        max-width: 400px;
        margin: 0 20px;
        box-shadow: 0 0 30px rgba(73, 9, 129, 0.3);
    }
    
    .input-field {
        width: 85vw;
        height: 55px;
        font-size: 15px;
    }
    
    .text {
        font-size: 16px;
        padding: 0 15px;
    }
    
    .chat-btn {
        width: 80%;
    }
}

@media (max-width: 480px) {
    .container {
        width: 98vw;
        border-radius: 20px;
        min-height: 180px;
        margin: 10px auto;
        padding: 15px;
    }
    
    .buttons {
        width: 98vw;
        gap: 12px;
        margin-top: 20px;
    }
    
    .btn {
        width: 98vw;
        font-size: 14px;
        height: 42px;
        border-radius: 25px;
        padding: 0 12px;
    }
    
    .btn-expanded {
        min-height: 42px;
        padding: 10px;
    }
    
    .answer {
        font-size: 13px !important;
    }
    
    .btn-please-review {
        min-height: 60px;
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .modal-box {
        width: 95vw;
        max-width: 350px;
        padding: 20px;
        box-shadow: 0 0 20px rgba(73, 9, 129, 0.3);
    }
    
    .mobile-error-popup {
        font-size: 13px;
        padding: 1px 8px;
        max-height: 35px;
        min-height: 35px;
        border-radius: 10px;
        top: calc(100% + 8px);
    }
    
    .input-field {
        width: 90vw;
        height: 50px;
        font-size: 14px;
    }
    
    .text {
        font-size: 15px;
        padding: 0 10px;
    }
    
    .mb-30 {
        margin-bottom: 20px;
    }
    
    .rating-box {
        padding: 12px 16px;
        border-radius: 15px;
    }
}

@media (max-width: 320px) {
    .container {
        min-height: 150px;
        border-radius: 15px;
        padding: 10px;
    }
    
    .buttons {
        width: 100vw;
        gap: 10px;
    }
    
    .btn {
        width: 95vw;
        font-size: 13px;
        height: 40px;
        border-radius: 20px;
    }
    
    .btn-expanded {
        min-height: 40px;
        padding: 8px;
    }
    
    .answer {
        font-size: 12px !important;
    }
    
    .btn-please-review {
        min-height: 55px;
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .mobile-error-popup {
        font-size: 12px;
        padding: 8px 12px;
        min-height: 40px;
        border-radius: 8px;
        max-width: 260px;
    }
    
    .input-field {
        width: 95vw;
        height: 45px;
        font-size: 13px;
    }
    
    .text {
        font-size: 14px;
    }
}

/* Фикс для Opera GX */
@media all and (-webkit-min-device-pixel-ratio:0) and (min-resolution: .001dpcm) {
    _:-webkit-full-screen, .text {
        line-height: 1.2 !important;
    }
}