:root {
    --contest-page: #eaf1fb;
    --contest-surface: #ffffff;
    --contest-border: #e6edf6;
    --contest-radius: 18px;
    --contest-ink: #10234d;
    --contest-muted: #5b6a86;
    --contest-navy: #082a76;
    --contest-navy-deep: #051b4f;
    --contest-blue: #009ee8;
    --contest-blue-2: #33b6f0;
    --contest-blue-hover: #0088c9;
    --contest-red: #ef1b23;
    --contest-red-2: #ff5a3c;
    --contest-yellow: #ffd424;
    --contest-yellow-deep: #f5b800;
    --contest-green: #08a24a;
    --contest-green-2: #37c46b;
    --contest-white: #ffffff;
    --contest-done: #08783e;
    --contest-error: #b42318;
    --contest-space: 14px;
    --contest-card-pad: 16px;
    --contest-cta-radius: 14px;
    --contest-cta-min: 56px;
    --contest-motion: 180ms cubic-bezier(0.22, 1, 0.36, 1);
    --contest-qr-size: min(220px, 100%, 42svh);
    --contest-shadow-card: 0 8px 22px rgba(8, 42, 118, 0.10), 0 2px 6px rgba(8, 42, 118, 0.06);
    --contest-shadow-pop: 0 12px 26px rgba(3, 20, 60, 0.28);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body.contest-page,
body.web-platform.contest-page {
    background:
        radial-gradient(120% 60% at 100% 0, rgba(0, 158, 232, 0.14), transparent 60%),
        linear-gradient(180deg, #dfebfb 0%, var(--contest-page) 300px);
    background-attachment: fixed;
    color: var(--contest-ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    line-height: 1.45;
}

body.contest-page #app,
body.web-platform.contest-page #app {
    background: transparent;
    box-shadow: none;
    padding: 10px 14px 24px;
}

.contest-page .top-header-lang-btn {
    min-width: 44px;
    min-height: 44px;
}

button,
select,
a,
summary {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 158, 232, 0.18);
}

.contest-skip-link {
    position: fixed;
    inset-block-start: 8px;
    inset-inline-start: 8px;
    z-index: 1100;
    padding: 12px 16px;
    border-radius: 12px;
    background: var(--contest-blue);
    color: var(--contest-white);
    font-weight: 700;
    transform: translateY(-150%);
    transition: transform var(--contest-motion);
}

.contest-skip-link:focus-visible {
    transform: translateY(0);
}

.contest-main,
.contest-empty {
    width: min(100%, 720px);
    margin-inline: auto;
    color: var(--contest-ink);
}

.contest-main {
    display: flex;
    flex-direction: column;
    gap: var(--contest-space);
    padding-block-end: calc(168px + env(safe-area-inset-bottom));
    overflow-x: clip;
}

.contest-empty {
    width: min(100%, 520px);
    min-height: 34dvh;
    display: grid;
    place-items: center;
    gap: 14px;
    margin: 28px auto;
    padding: 36px 22px;
    border-radius: var(--contest-radius);
    background: var(--contest-surface);
    box-shadow: var(--contest-shadow-card);
    color: var(--contest-muted);
    font-size: 15px;
    font-weight: 600;
    text-align: center;
}

.contest-empty::before {
    content: "";
    width: 60px;
    height: 60px;
    border-radius: 18px;
    background:
        #eaf3ff
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23009ee8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M15.5 8.5l-2 5-5 2 2-5z'/%3E%3C/svg%3E")
        center / 30px 30px no-repeat;
}

.contest-page [hidden] {
    display: none !important;
}

/* ============================================================
   Общий вид карточек-секций: объём + цветовой акцент сверху
   ============================================================ */
.contest-next-step,
.contest-checklist,
.contest-quizzes,
.contest-rules {
    position: relative;
    padding: var(--contest-card-pad);
    border: 0;
    border-radius: var(--contest-radius);
    background: var(--contest-surface);
    box-shadow: var(--contest-shadow-card);
    overflow: hidden;
}

.contest-prize {
    position: relative;
    padding: var(--contest-card-pad);
    border: 0;
    border-radius: var(--contest-radius);
    background: var(--contest-surface);
    box-shadow: var(--contest-shadow-card);
    overflow: hidden;
}

.contest-next-step::before,
.contest-checklist::before,
.contest-quizzes::before,
.contest-prize::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 5px;
}

.contest-next-step::before {
    background: linear-gradient(90deg, var(--contest-blue), var(--contest-blue-2));
}

.contest-checklist::before {
    background: linear-gradient(90deg, var(--contest-yellow), var(--contest-yellow-deep));
}

.contest-quizzes::before {
    background: linear-gradient(90deg, var(--contest-red), var(--contest-red-2));
}

.contest-prize::before {
    background: linear-gradient(90deg, var(--contest-green), var(--contest-green-2));
    border-radius: var(--contest-radius) var(--contest-radius) 0 0;
}

/* ============================================================
   HERO — яркий цветной блок «ты пришёл за призом»
   ============================================================ */
.contest-hero {
    position: relative;
    overflow: visible;
    padding: 22px 14px 20px;
    border-radius: 22px;
    color: var(--contest-white);
    background:
        radial-gradient(130% 90% at 88% -20%, rgba(255, 212, 36, 0.42), transparent 52%),
        radial-gradient(120% 120% at -10% 0, rgba(0, 158, 232, 0.55), transparent 48%),
        linear-gradient(158deg, #0b3aa0 0%, #0768c4 52%, var(--contest-blue) 100%);
    box-shadow: 0 16px 34px rgba(8, 42, 118, 0.32);
}

.contest-hero::before {
    content: "";
    position: absolute;
    inset-block-start: -40%;
    inset-inline-end: -20%;
    z-index: 0;
    width: 70%;
    height: 120%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 70%);
    transform: rotate(18deg);
    pointer-events: none;
}

.contest-hero__eyebrow,
.contest-title,
.contest-short,
.contest-hero__limited,
.contest-hero__festival,
.contest-hero .contest-primary-action,
.contest-hero-progress {
    position: relative;
    z-index: 1;
}

.contest-hero__eyebrow {
    margin: 0 0 8px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    line-height: 1.35;
    text-shadow: 0 1px 1px rgba(3, 20, 60, 0.2);
    text-transform: uppercase;
}

.contest-title {
    margin: 0;
    color: var(--contest-white);
    font-size: 27px;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.01em;
    text-shadow: 0 1px 2px rgba(3, 20, 60, 0.24);
    text-wrap: balance;
}

.contest-short {
    margin: 8px 0 0;
    color: rgba(255, 255, 255, 0.94);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    text-shadow: 0 1px 1px rgba(3, 20, 60, 0.18);
}

.contest-hero-prize {
    position: relative;
    margin: 4px -8px 0;
    overflow: visible;
    background: transparent;
}

/* Воздух вокруг фото — не в .contest-spin, иначе свайп вниз крутит кольцо */
.contest-hero-prize:not(.contest-hero-prize--empty) {
    padding-block: 72px 64px;
}

.contest-hero-prize__badge {
    position: absolute;
    inset-block-start: 12px;
    inset-inline-start: 18px;
    z-index: 2;
    padding: 5px 12px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--contest-yellow), var(--contest-yellow-deep));
    color: var(--contest-navy-deep);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    transform: rotate(-3deg);
    box-shadow: 0 4px 10px rgba(245, 184, 0, 0.45);
}

.contest-hero-prize__fallback {
    display: none;
    place-items: center;
    min-height: 160px;
    padding: 36px 16px;
    text-align: center;
    background: transparent;
}

.contest-hero-prize--empty .contest-hero-prize__fallback {
    display: grid;
}

.contest-hero-prize__fallback-title {
    margin: 0;
    color: var(--contest-white);
    font-size: 17px;
    font-weight: 800;
}

.contest-hero-prize__fallback-text {
    margin: 6px 0 0;
    color: rgba(255, 255, 255, 0.92);
    font-size: 13px;
    line-height: 1.4;
}

.contest-hero__limited {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 14px 0 0;
    padding: 6px 13px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: var(--contest-white);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
}

.contest-hero__limited::before {
    content: "";
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--contest-yellow);
    box-shadow: 0 0 0 3px rgba(255, 212, 36, 0.3);
}

.contest-hero__festival {
    margin: 12px 0 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.35;
    text-align: center;
}

.contest-spin[hidden],
.contest-lightbox[hidden],
.contest-hero-prize__fallback[hidden] {
    display: none !important;
}

/* ============================================================
   Главная кнопка — яркая, объёмная (жёлтая = награда/действие)
   ============================================================ */
.contest-primary-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: var(--contest-cta-min);
    margin-top: 16px;
    padding: 14px 18px;
    border: 0;
    border-radius: var(--contest-cta-radius);
    background: linear-gradient(180deg, #12b357, #0a7d3a);
    color: var(--contest-white);
    cursor: pointer;
    font-size: 17px;
    font-weight: 900;
    letter-spacing: 0.01em;
    line-height: 1.25;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
    box-shadow:
        0 10px 20px rgba(8, 125, 58, 0.42),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);
    transition:
        background-color var(--contest-motion),
        box-shadow var(--contest-motion),
        transform var(--contest-motion);
}

.contest-primary-action::after {
    content: "";
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E")
        center / 18px 18px no-repeat;
    transition: transform var(--contest-motion);
}

.contest-primary-action:hover {
    background: linear-gradient(180deg, #1cc063, #08893f);
    box-shadow: 0 12px 24px rgba(8, 125, 58, 0.5);
}

.contest-primary-action:hover::after {
    transform: translateX(3px);
}

.contest-primary-action:active {
    transform: translateY(1px) scale(0.99);
    box-shadow: 0 6px 14px rgba(8, 125, 58, 0.4);
}

/* Прогресс в hero (на тёмном фоне) */
.contest-hero-progress {
    margin-top: 12px;
    text-align: center;
}

.contest-hero-progress__dots {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
    justify-content: center;
}

.contest-hero-progress__dot {
    flex: 0 0 auto;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.28);
}

.contest-hero-progress__dot--done {
    border-color: var(--contest-yellow);
    background: var(--contest-yellow);
    box-shadow: 0 0 0 2px rgba(255, 212, 36, 0.25);
}

.contest-hero-progress__dot--current {
    border-color: var(--contest-white);
    background: var(--contest-white);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.contest-hero-progress__label,
.contest-hero-progress__guest {
    margin: 9px 0 0;
    color: rgba(255, 255, 255, 0.92);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
}

/* ============================================================
   Карточка «Ваш следующий шаг»
   ============================================================ */
.contest-next-step {
    background:
        linear-gradient(180deg, #f2f9ff, #ffffff 60%);
}

.contest-next-step__title {
    margin: 0;
    color: var(--contest-navy);
    font-size: 22px;
    font-weight: 800;
    line-height: 1.3;
    text-align: center;
}

/* ============================================================
   Заголовки секций с цветными иконками-чипами
   ============================================================ */
.contest-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.contest-section-title {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    color: var(--contest-navy);
    font-size: 18px;
    font-weight: 800;
    line-height: 1.3;
}

.contest-section-title::before {
    content: "";
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 9px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 17px 17px;
}

.contest-checklist .contest-section-title::before {
    background-color: #fff6d6;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e0a200' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}

.contest-quizzes .contest-section-title::before {
    background-color: #ffe7e5;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ef1b23'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E");
}

.contest-prize .contest-section-title::before {
    background-color: #dcf6e6;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2308a24a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='9' width='18' height='11' rx='1'/%3E%3Cpath d='M3 9h18M12 9v11'/%3E%3Cpath d='M12 9S9.5 3.5 7 5s5 4 5 4zM12 9s2.5-5.5 5-4-5 4-5 4z'/%3E%3C/svg%3E");
}

.contest-checklist__count {
    margin: 0;
    padding: 4px 11px;
    border-radius: 999px;
    background: #fff6d6;
    color: var(--contest-navy);
    font-size: 13px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.contest-status {
    margin: 0 0 12px;
    color: var(--contest-muted);
    font-size: 13px;
    line-height: 1.4;
    text-align: center;
}

/* ============================================================
   Чек-лист условий
   ============================================================ */
.contest-checklist__list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.contest-check {
    border: 1.5px solid #cfdcef;
    border-inline-start: 5px solid var(--contest-blue-2);
    border-radius: 14px;
    background: #f3f8ff;
    overflow: hidden;
    transition: box-shadow var(--contest-motion), border-color var(--contest-motion);
}

.contest-check__row {
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    width: 100%;
    margin: 0;
    padding: 13px 14px;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: start;
}

button.contest-check__row {
    cursor: pointer;
}

.contest-check__chevron {
    justify-self: end;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background:
        #e2ecfb
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23009ee8' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E")
        center / 15px 15px no-repeat;
    transition: transform var(--contest-motion), background-color var(--contest-motion);
}

.contest-check--current .contest-check__chevron {
    background-color: #ffe6a1;
}

.contest-check--open .contest-check__chevron {
    transform: rotate(90deg);
}

.contest-check--done .contest-check__chevron {
    background-color: #dcf6e6;
}

.contest-check__panel {
    padding: 2px 14px 14px 50px;
}

.contest-check__hint {
    margin: 0 0 10px;
    color: var(--contest-muted);
    font-size: 13px;
    line-height: 1.45;
}

.contest-check--done {
    border-color: #9fdcb5;
    border-inline-start-color: var(--contest-green);
    background: linear-gradient(180deg, #e9faf0, #f4fcf7);
}

.contest-check--current {
    border-color: var(--contest-yellow-deep);
    border-inline-start-color: var(--contest-yellow-deep);
    background: linear-gradient(180deg, #fff6d9, #fffdf5);
    box-shadow: 0 6px 16px rgba(245, 184, 0, 0.2);
}

.contest-check__icon {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border: 2px solid #c5d0e3;
    border-radius: 50%;
    background: var(--contest-white);
    color: var(--contest-muted);
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
}

.contest-check--done .contest-check__icon {
    border-color: var(--contest-green);
    background: linear-gradient(180deg, var(--contest-green-2), var(--contest-green));
    color: var(--contest-white);
    box-shadow: 0 4px 10px rgba(8, 162, 74, 0.35);
}

.contest-check--current .contest-check__icon {
    border-color: var(--contest-yellow-deep);
    background: linear-gradient(180deg, var(--contest-yellow), var(--contest-yellow-deep));
    color: var(--contest-navy-deep);
    box-shadow: 0 4px 10px rgba(245, 184, 0, 0.4);
}

.contest-check__body {
    min-width: 0;
}

.contest-check__text {
    display: block;
    color: var(--contest-ink);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
}

.contest-check__progress {
    display: block;
    margin-top: 3px;
    color: var(--contest-muted);
    font-size: 12px;
    font-weight: 600;
}

.contest-check__mark {
    padding: 3px 9px;
    border-radius: 999px;
    background: #eef2f8;
    color: var(--contest-muted);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
}

.contest-check__mark--done {
    background: #dcf6e6;
    color: var(--contest-done);
}

.contest-check--current .contest-check__mark {
    background: var(--contest-yellow);
    color: var(--contest-navy-deep);
}

/* Кнопка «Поделиться» внутри условия — яркая */
.contest-share-slot {
    margin-top: 12px;
}

.contest-share-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    padding: 7px 14px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(180deg, var(--contest-blue-2), var(--contest-blue));
    color: var(--contest-white);
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 4px 10px rgba(0, 158, 232, 0.3);
    transition:
        background-color var(--contest-motion),
        box-shadow var(--contest-motion),
        transform var(--contest-motion);
}

.contest-share-button::before {
    content: "";
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.07 0l2-2a5 5 0 0 0-7.07-7.07l-1 1'/%3E%3Cpath d='M14 11a5 5 0 0 0-7.07 0l-2 2a5 5 0 0 0 7.07 7.07l1-1'/%3E%3C/svg%3E")
        center / 15px 15px no-repeat;
}

.contest-share-button:hover {
    background: linear-gradient(180deg, var(--contest-blue), var(--contest-blue-hover));
}

.contest-share-button:active {
    transform: translateY(1px) scale(0.99);
}

.contest-share-button:disabled {
    cursor: wait;
    opacity: 0.62;
}

.contest-share-feedback {
    min-height: 18px;
    margin: 8px 0 0;
    color: var(--contest-muted);
    font-size: 12px;
    line-height: 1.4;
}

.contest-social-nudge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    margin-top: 10px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--contest-blue);
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    text-align: left;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

.contest-social-nudge::after {
    content: "";
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23009ee8' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E")
        center / 16px 18px no-repeat;
}

.contest-social-nudge:focus-visible {
    outline: 2px solid var(--contest-blue);
    outline-offset: 4px;
    border-radius: 6px;
}

.contest-social-post {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed #c5d0e3;
}

.contest-social-post__copy {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    margin: 0 0 10px;
    padding: 8px 12px;
    border: 1px solid var(--contest-blue);
    border-radius: 10px;
    background: var(--contest-white);
    color: var(--contest-navy);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
}

.contest-social-post__copy:disabled {
    cursor: wait;
    opacity: 0.62;
}

.contest-social-post__title {
    margin: 0 0 6px;
    color: var(--contest-ink);
    font-size: 15px;
    font-weight: 800;
    line-height: 1.35;
}

.contest-social-post__hint {
    margin: 0 0 8px;
    color: var(--contest-muted);
    font-size: 12px;
    line-height: 1.4;
}

.contest-social-post__row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.contest-social-post__input {
    flex: 1 1 160px;
    min-width: 0;
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid #c5d0e3;
    border-radius: 8px;
    background: var(--contest-white);
    color: var(--contest-ink);
    font-size: 13px;
}

.contest-social-post__input--error {
    border-color: var(--contest-error);
}

.contest-social-post__submit {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 6px 12px;
    border: 1px solid #c5d0e3;
    border-radius: 8px;
    background: var(--contest-white);
    color: var(--contest-ink);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}

.contest-social-post__submit:disabled {
    cursor: wait;
    opacity: 0.62;
}

.contest-social-post__msg {
    min-height: 16px;
    margin: 8px 0 0;
    color: var(--contest-muted);
    font-size: 12px;
    line-height: 1.4;
}

.contest-social-post__msg--ok {
    color: var(--contest-done);
    font-weight: 700;
}

.contest-social-post__msg--error {
    color: var(--contest-error);
    font-weight: 700;
}

.contest-login-hint {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: linear-gradient(180deg, #eef6ff, #f6faff);
    border: 1px dashed #b9d6f2;
}

.contest-login-link,
.contest-desc-link {
    color: var(--contest-blue-hover);
    font-size: 14px;
    font-weight: 800;
    text-underline-offset: 3px;
}

.contest-personal {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--contest-border);
}

.contest-personal summary {
    min-height: 44px;
    display: flex;
    align-items: center;
    color: var(--contest-navy);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
}

.contest-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 6px 0 0;
}

.contest-stat {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 4px;
    min-width: 0;
    min-height: 72px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f1f6fd;
}

.contest-stat__value {
    margin: 0;
    color: var(--contest-navy);
    font-size: 20px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.contest-stat__label {
    color: var(--contest-muted);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
}

/* ============================================================
   Викторины
   ============================================================ */
.contest-kind-filter {
    margin-bottom: 12px;
}

.contest-kind-select {
    width: 100%;
    min-height: 46px;
    padding-inline: 14px;
    border: 2px solid #d5e3f5;
    border-radius: 12px;
    background: #f6faff;
    color: var(--contest-ink);
    font-size: 15px;
    font-weight: 600;
    transition: border-color var(--contest-motion);
}

.contest-kind-select:hover {
    border-color: var(--contest-blue-2);
}

.carousel-wrapper {
    position: relative;
}

.contest-page .carousel-track {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 4px 0 8px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    overscroll-behavior-inline: contain;
}

.contest-page .carousel-track::-webkit-scrollbar {
    display: none;
}

.contest-page .carousel-track .quiz-card {
    flex: 0 0 calc(50% - 6px);
    min-width: 0;
    scroll-snap-align: start;
}

@media (max-width: 640px) {
    .contest-page .carousel-track .quiz-card {
        flex-basis: 100%;
    }
}

.carousel-empty {
    width: 100%;
    padding: 16px;
    color: var(--contest-muted);
    text-align: center;
}

.contest-page .carousel-arrow {
    position: absolute;
    z-index: 5;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(180deg, var(--contest-blue-2), var(--contest-blue));
    color: var(--contest-white);
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    box-shadow: 0 6px 14px rgba(0, 158, 232, 0.35);
    transition:
        background-color var(--contest-motion),
        transform var(--contest-motion);
}

.contest-page .carousel-arrow:hover {
    background: linear-gradient(180deg, var(--contest-blue), var(--contest-blue-hover));
}

.contest-page .carousel-arrow:active {
    transform: translateY(-50%) scale(0.98);
}

.carousel-arrow {
    inset-block-start: var(--carousel-image-mid, 42%);
    transform: translateY(-50%);
}

/* Стрелки внутри блока викторин, не выходят за край */
.carousel-arrow-left {
    inset-inline-start: 6px;
}

.carousel-arrow-right {
    inset-inline-end: 6px;
}

.carousel-arrow.hidden {
    display: none;
}

/* ============================================================
   3D-карусель призов + QR
   ============================================================ */
.contest-spin {
    display: flex;
    height: auto;
    margin: 0;
    perspective: 1200px;
    transform-style: preserve-3d;
    user-select: none;
    overflow: visible;
    cursor: grab;
}

.contest-spin,
.contest-spin__item {
    /* pan-y: вертикальный свайп скроллит страницу, горизонталь крутит кольцо */
    touch-action: pan-y;
}

.contest-spin:active {
    cursor: grabbing;
}

.contest-spin__drag,
.contest-spin__ring {
    position: relative;
    display: flex;
    margin: auto;
    transform-style: preserve-3d;
}

.contest-spin__drag {
    transform: rotateX(-8deg);
}

.contest-spin__item {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    cursor: pointer;
    transform-style: preserve-3d;
}

.contest-spin__item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: transparent;
    filter: drop-shadow(0 14px 22px rgba(3, 24, 72, 0.38));
    pointer-events: none;
}

.contest-spin__ground {
    position: absolute;
    top: 100%;
    left: 50%;
    width: 720px;
    height: 720px;
    pointer-events: none;
    transform: translate(-50%, -50%) rotateX(90deg);
}

@keyframes contest-spin-rotate {
    from { transform: rotateY(0deg); }
    to { transform: rotateY(360deg); }
}

@keyframes contest-spin-rotate-back {
    from { transform: rotateY(360deg); }
    to { transform: rotateY(0deg); }
}

.contest-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding:
        max(36px, calc(5vw + env(safe-area-inset-top)))
        max(36px, calc(5vw + env(safe-area-inset-right)))
        max(36px, calc(5vw + env(safe-area-inset-bottom)))
        max(36px, calc(5vw + env(safe-area-inset-left)));
    background: #fff;
}

.contest-lightbox__img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.contest-lightbox__close {
    position: absolute;
    inset-block-start: max(8px, env(safe-area-inset-top));
    inset-inline-end: max(8px, env(safe-area-inset-right));
    z-index: 1;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: #f1f4f8;
    color: var(--contest-navy);
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
}

.contest-lightbox__close:hover {
    background: #e4ebf4;
}

body.contest-lightbox-open {
    overflow: hidden;
}

.contest-prize__text {
    margin: 10px 0 0;
    color: var(--contest-muted);
    font-size: 14px;
    line-height: 1.45;
}

.contest-prize__text:empty {
    display: none;
}

/* Праздничное состояние: приз доступен */
.contest-prize[data-state="available"] {
    background:
        radial-gradient(90% 60% at 50% 0, rgba(255, 212, 36, 0.28), transparent 65%),
        linear-gradient(180deg, #fffdf3, #fff8e0);
}

.contest-prize[data-state="available"] .contest-prize__text {
    color: var(--contest-navy);
    font-weight: 700;
}

.contest-prize[data-state="redeemed"] .contest-prize__text {
    color: var(--contest-done);
    font-weight: 700;
}

.contest-prize[data-state="expired"] .contest-prize__text,
.contest-prize[data-state="error"] .contest-prize__text {
    color: var(--contest-error);
    font-weight: 700;
}

.contest-prize__frame {
    box-sizing: border-box;
    width: var(--contest-qr-size);
    max-width: 100%;
    aspect-ratio: 1 / 1;
    min-height: 0;
    margin: 18px auto 0;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 16px;
    background: var(--contest-white);
    box-shadow: var(--contest-shadow-card);
}

.contest-prize[data-state="available"] .contest-prize__frame {
    box-shadow:
        0 0 0 4px var(--contest-yellow),
        0 14px 30px rgba(245, 184, 0, 0.35);
}

.contest-prize[data-state="locked"] .contest-prize__frame {
    background:
        repeating-linear-gradient(
            -45deg,
            #f7faf7,
            #f7faf7 10px,
            #eef6f0 10px,
            #eef6f0 20px
        );
    box-shadow:
        0 0 0 2px rgba(8, 162, 74, 0.18),
        var(--contest-shadow-card);
}

.contest-prize__placeholder {
    margin: 0;
    padding: 4px;
    color: var(--contest-navy);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
    white-space: pre-line;
}

.contest-prize__qr {
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
    display: grid;
    place-items: center;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.contest-prize__qr > *,
.contest-prize__qr img,
.contest-prize__qr canvas,
.contest-prize__qr table {
    width: 100% !important;
    max-width: 100%;
    height: auto !important;
}

.contest-prize__expires {
    margin: 14px 0 0;
    color: var(--contest-navy);
    font-size: 13px;
    font-weight: 800;
    text-align: center;
}

/* ============================================================
   Правила
   ============================================================ */
.contest-rules::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 5px;
    background: linear-gradient(90deg, #7d8db0, #aeb9d0);
}

.contest-rules summary {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--contest-navy);
    cursor: pointer;
    font-size: 15px;
    font-weight: 800;
    text-align: center;
}

.contest-rules__lead {
    margin: 12px 0 8px;
    color: var(--contest-navy);
    font-size: 16px;
    font-weight: 800;
    line-height: 1.35;
}

.contest-rules__steps {
    margin: 0;
    padding-inline-start: 1.2em;
    color: var(--contest-ink);
    font-size: 14px;
    line-height: 1.5;
}

.contest-rules__steps li {
    margin: 4px 0;
}

.contest-rules__note {
    font-weight: 700;
}

.contest-rules p {
    margin: 8px 0 0;
    color: var(--contest-ink);
    font-size: 14px;
    line-height: 1.5;
}

.contest-desc-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

/* ============================================================
   Страница «Подробнее» — правила конкурса
   ============================================================ */
.contest-description {
    width: min(100%, 720px);
    margin: 0 auto;
    padding: 8px 0 calc(92px + env(safe-area-inset-bottom));
}

.contest-description .contest-title {
    color: var(--contest-navy);
    font-size: 24px;
    text-shadow: none;
}

.contest-description__lead {
    margin: 10px 0 18px;
    padding: 14px 16px;
    border-radius: 16px;
    background: linear-gradient(180deg, #fff8e0, #fffdf3);
    box-shadow: var(--contest-shadow-card);
}

.contest-description__lead-title {
    margin: 0 0 8px;
    color: var(--contest-navy);
    font-size: 16px;
    font-weight: 800;
}

.contest-description__lead p {
    margin: 0 0 8px;
    color: var(--contest-ink);
    font-size: 15px;
    line-height: 1.5;
}

.contest-description__lead p:last-child {
    margin-bottom: 0;
}

.contest-description__section {
    margin: 0 0 18px;
    padding: 16px;
    border-radius: 16px;
    background: var(--contest-surface);
    box-shadow: var(--contest-shadow-card);
}

.contest-description__section h2 {
    margin: 0 0 10px;
    color: var(--contest-navy);
    font-size: 17px;
    font-weight: 800;
    line-height: 1.3;
}

.contest-description__section p,
.contest-description__section li {
    color: var(--contest-ink);
    font-size: 15px;
    line-height: 1.55;
}

.contest-description__section p {
    margin: 0 0 10px;
}

.contest-description__section p:last-child {
    margin-bottom: 0;
}

.contest-description__section ul,
.contest-description__section ol {
    margin: 0 0 10px;
    padding-left: 22px;
}

.contest-description__section li {
    margin-bottom: 6px;
}

.contest-description__back {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin-bottom: 8px;
    color: var(--contest-blue-hover);
    font-weight: 700;
    text-decoration: none;
}

.contest-description a {
    color: var(--contest-blue-hover);
}

/* ============================================================
   Липкая кнопка
   ============================================================ */
.contest-sticky {
    position: fixed;
    inset: auto 0 0;
    z-index: 40;
    padding: 10px max(16px, env(safe-area-inset-right))
        calc(12px + env(safe-area-inset-bottom))
        max(16px, env(safe-area-inset-left));
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 -8px 24px rgba(8, 42, 118, 0.14);
}

body.nav-expanded .contest-sticky {
    inset-block-end: 80px;
}

.contest-primary-action--sticky {
    display: flex;
    width: min(100%, 520px);
    margin: 0 auto;
}

/* ============================================================
   Фокус
   ============================================================ */
.contest-primary-action:focus-visible,
.contest-share-button:focus-visible,
.contest-check__row:focus-visible,
.contest-spin__item:focus-visible,
.contest-lightbox__close:focus-visible,
.contest-page .carousel-arrow:focus-visible,
.contest-kind-select:focus-visible,
.contest-login-link:focus-visible,
.contest-desc-link:focus-visible,
.contest-rules summary:focus-visible,
.contest-personal summary:focus-visible,
.contest-skip-link:focus-visible,
.quiz-card:focus-visible {
    outline: 3px solid var(--contest-navy);
    outline-offset: 2px;
}

.contest-hero .contest-primary-action:focus-visible {
    outline-color: var(--contest-white);
}

/* ============================================================
   Адаптив
   ============================================================ */
@media (max-width: 360px) {
    .contest-title {
        font-size: 24px;
    }

    .contest-hero-prize__fallback {
        min-height: 120px;
        padding: 28px 12px;
    }
}

@media (min-width: 1024px) {
    .contest-main {
        padding-block-end: 24px;
    }

    .contest-sticky {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .contest-spin__ring {
        animation-duration: 24s !important;
        animation-iteration-count: infinite !important;
    }
}
