/* Переменные и базовые стили */
:root {
    --bg: #e6edf6;
    --panel: #e0e7ef;
    --text: #1f2b3a;
    --muted: #6b7685;
    --shadow-light: rgba(255,255,255,0.9);
    --shadow-dark: rgba(23,35,56,0.08);
    --neo-radius: 14px;

    --accent-blue-1: #3b82f6;
    --accent-blue-2: #06b6d4;

    --accent-green-1: #22c55e;
    --accent-green-2: #16a34a;

    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
}

/* Reset */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(180deg,#f1f6fb 0%,var(--bg) 100%);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}




/* Page wrapper */
    .page {
    max-width: 980px;
    margin: 32px auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 18px;
}

.header__title {
    font-size: 22px;
    margin: 0;
    font-weight: 700;
}

.header__subtitle {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 14px;
}

/* Video card (неоморфная) */
.video-card {
    position: relative; /* это крестик в углу  */
    max-width: 680px;
    margin: 20px auto;
    border-radius: 16px;
    overflow: hidden;
    background: var(--panel);
    box-shadow: 10px 10px 20px var(--shadow-dark), -10px -10px 20px var(--shadow-light);
}

/* Header видео-карты */
.video-card__channel {
    background: linear-gradient(135deg, var(--accent-blue-1), var(--accent-blue-2));
    color: #fff;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-radius: 16px 16px 0 0;
}

.channel-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
}

.channel-meta h3 {
    margin: 0;
    font-size: 18px;
}

.channel-meta span {
    font-size: 13px;
    opacity: .85;
}

/* Body видео-карты */
.video-card__body {
    padding: 20px;
    text-align: center;
}

.video-title {
    margin: 0 0 14px;
}

.video-preview img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 12px;
    cursor: pointer;
    display: block;
    margin: 0 auto 14px;
    max-width: 420px;
    overflow: hidden;
}

.video-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 10px 0 16px;
    font-size: 14px;
    color: #555;
}

/* Кнопки */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 12px;
    cursor: pointer;
    border: none;
    font-weight: 600;
    font-size: 14px;
    position: relative;
    transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
    box-shadow: 6px 6px 12px rgba(23,35,56,0.06), -6px -6px 12px rgba(255,255,255,0.9);
}

.btn--accent {
    background: linear-gradient(90deg, var(--accent-blue-1), var(--accent-blue-2));
    color: #fff;
    box-shadow: 6px 6px 18px rgba(221,36,118,0.12), inset 0 -3px 6px rgba(0,0,0,0.08);
}

.btn--accent:active {
    transform: translateY(1px);
}

.btn:disabled {
    opacity: .55;
    cursor: not-allowed;
    box-shadow: none;
}

/* Progress bar */
.progress-wrap {
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-inner {
    flex: 1;
    height: 12px;
    background: linear-gradient(180deg,#e9f3fb,#e1ebf7);
    border-radius: 999px;
    padding: 3px;
    box-shadow: inset 4px 4px 8px rgba(23,35,56,0.03);
}

.progress-line {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent-blue-1), var(--accent-blue-2));
    position: relative;
    overflow: visible;
    transition: width .45s cubic-bezier(.2,.9,.2,1);
}

.progress-glow {
    position: absolute;
    right: 0;
    top: -6px;
    width: 60px;
    height: 24px;
    filter: blur(8px);
    background: linear-gradient(90deg, rgba(255,81,47,0.55), rgba(221,36,118,0.55));
    opacity: 0.9;
    border-radius: 20px;
    transform: translateX(-20px);
}

.progress-text {
    min-width: 120px;
    color: var(--muted);
    font-size: 14px;
}

/* Responsive */
@media (max-width:720px) {
    .modal__panel,
    .video-card__body,
    .video-card__channel {
        width: 95%;
    }
}


/* начальный экран */
/*заголовок*/
h1 {
    font-size: 52px;
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: 16px;
}


/*подзаголовок*/
.subtitle {
    font-size: 17px;
    color: #555;
    margin-bottom: 34px;
}

/*поле ввода*/
#videoUrl {
    width: 100%;
    max-width: 520px;
    padding: 18px 22px;
    font-size: 16px;
    border-radius: 16px;
    border: 2px solid #e0e0e0;
    outline: none;
    transition: border .2s, box-shadow .2s;
    /*добавляем отступ*/
    margin-bottom: 24px;
}

    #videoUrl:focus {
        border-color: #1db954;
        box-shadow: 0 0 0 4px rgba(29,185,84,0.2);
    }
    /*это отвечает за настройки сцены*/
#screen-form {
    /* Делает контейнер флексбоксом */
    display: flex;
    /* Выравнивает дочерние элементы по центру горизонтали */
    align-items: center;
    /* Располагает дочерние элементы вертикально друг под другом */
    flex-direction: column;
    /* Выравнивает текст внутри по центру */
    text-align: center;
    /* Занимает всю высоту видимой области, чтобы центрирование работало */
    min-height: 100vh;
    /* Добавляет немного отступа сверху/снизу */
    padding: 60px 20px;
    /* Центрирует содержимое, если оно не занимает 100% высоты */
    justify-content: center;
}

#submit-video {
    margin-top: 24px; /* Отступ сверху, чтобы не липла к полю ввода */
    /* Переопределяем размер и делаем ее большой */
    padding: 16px 38px;
    font-size: 17px;
    box-shadow: 0 10px 28px rgba(21,153,87,0.45);
    color: #fff;
}


/* ===============================
   ЭКРАН ПОБЕДИТЕЛЯ
   =============================== */

#screen-winner {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Общий контейнер результата */
.result {
    background: #f5f8fc;
    border-radius: 22px;
    padding: 36px 28px 32px;
    width: 100%;
    max-width: 720px;
    text-align: center;
    /* мягкая тень карточки */
    box-shadow: 0 30px 60px rgba(0,0,0,0.12);
}

    /* Заголовок */
    .result h2 {
        margin: 0 0 22px;
        font-size: 26px;
        font-weight: 800;
        color: #111;
    }

/* ===============================
   КАРТОЧКА ПОБЕДИТЕЛЯ
   =============================== */

/* ===== FORCE WINNER CARD STYLES ===== */

.winner-card {
    position: relative; /* ← ВАЖНО */
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    border-radius: 18px;
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: 0 18px 40px rgba(59,130,246,0.35);
}

.avatar {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
    border: 3px solid rgba(255,255,255,0.85);
}

.winner-info {
    color: #fff;
    text-align: left;
    flex: 1;
}

.comment {
    background: rgba(255,255,255,0.22);
    padding: 10px 14px;
    border-radius: 12px;
    margin-top: 6px;
}

#btnReroll {
    margin-top: 26px;
    padding: 16px 38px;
}

   
/* ===============================
   КНОПКА ЗАКРЫТЬ (крестик)
   =============================== */

.modal__close {
    position: absolute;
    right: 14px;
    top: 12px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.25);
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    line-height: 26px;
}

    .modal__close:hover {
        background: rgba(255,255,255,0.4);
    }


/* ===============================
   АДАПТИВ
   =============================== */

@media (max-width: 600px) {
    .winner-card {
        flex-direction: column;
        text-align: center;
    }

    .winner-info {
        text-align: center;
    }
}

.screen[hidden] {
    display: none !important;
}


/* это для анимации загруза*/
.progress-wrap {
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-inner {
    flex: 1;
    height: 12px;
    background: #e0e7ef;
    border-radius: 999px;
    overflow: hidden;
}

.progress-line {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #3b82f6, #06b6d4);
    border-radius: 999px;
    transition: width 0.3s ease;
}

.progress-text {
    min-width: 50px;
    font-size: 14px;
    color: #555;
}