* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg-primary: #0d1329;
    --bg-secondary: #1a2140;
    --bg-card: #252b4a;
    --accent-pink: #ff3b6f;
    --accent-pink-dark: #cc2f59;
    --accent-blue: #4a6cf7;
    --text-primary: #ffffff;
    --text-secondary: #8892b0;
    /* Channels and extra tones below let game-themes.js repaint the paywall in the
       palette of the game it was opened from; these defaults are the RoomPlay navy. */
    --bg-end: #0a0f1f;
    --bg-rgb: 13, 19, 41;
    --bg-end-rgb: 10, 15, 31;
    --ink-rgb: 255, 255, 255;
    --accent-rgb: 255, 59, 111;
    --accent-blue-rgb: 74, 108, 247;
    --accent-violet: #7c3aed;
    --badge-end: #ff6b35;
    --on-accent: #ffffff;
    --bg-card-alt: #3a4167;
    --success: #b7f3bd;
    --success-strong: #7bd88f;
    --success-rgb: 129, 199, 132;
    --success-line-rgb: 183, 243, 189;
    --guarantee-rgb: 76, 175, 80;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-end) 100%);
    min-height: 100vh;
    min-height: var(--app-height, 100dvh);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

.app {
    max-width: 430px;
    margin: 0 auto;
    min-height: 100vh;
    min-height: var(--app-height, 100dvh);
}

.screen {
    display: none;
    flex-direction: column;
    min-height: 100vh;
    min-height: var(--app-height, 100dvh);
    padding: 28px 20px;
    padding-top: calc(34px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}

.screen.active {
    display: flex;
}

.btn-back {
    position: absolute;
    top: calc(16px + env(safe-area-inset-top, 0px));
    left: 16px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    text-decoration: none;
    z-index: 10;
}

.btn-back.btn-close-delayed {
    left: auto;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(var(--ink-rgb), 0.08);
    font-size: 28px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.92);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.btn-back.btn-close-delayed.visible {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

.payment-header {
    text-align: center;
    margin-bottom: 16px;
    padding-top: 18px;
}

.launch-paywall-brand,
.launch-paywall-disclosure {
    display: none;
}

.payment-icon {
    font-size: 42px;
    line-height: 1;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.payment-title {
    font-size: 27px;
    font-weight: 800;
    margin-bottom: 8px;
    line-height: 1.15;
}

.payment-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* «Платит один — играют все»: the selected price split across the party's players. */
.paywall-share {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 360px;
    margin: 12px auto 0;
    padding: 9px 14px;
    border-radius: 8px;
    background: rgba(var(--accent-rgb), 0.12);
    text-align: left;
}

.paywall-share[hidden] {
    display: none;
}

.paywall-share-icon {
    flex: 0 0 auto;
    color: var(--accent-text, var(--accent-pink));
}

.paywall-share-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.paywall-share-copy strong {
    font-size: 15px;
    font-weight: 800;
    line-height: 1.2;
}

.paywall-share-copy span {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.3;
}

.paywall-share-copy b {
    color: var(--accent-text, var(--accent-pink));
    font-weight: 800;
    white-space: nowrap;
}

.native-paywall-compact .paywall-share {
    margin-top: 8px;
    padding: 7px 12px;
}

.features-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
    padding: 0 4px;
}

.paywall-benefits {
    display: none;
    list-style: none;
}

.native-paywall-compact .paywall-benefits {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin: 0 0 10px;
}

.paywall-benefit-item {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    min-height: 30px;
    padding: 4px 2px;
    border: 0;
    border-radius: 0;
    background: none;
    color: rgba(var(--ink-rgb), 0.86);
    font-size: 11px;
    font-weight: 650;
    line-height: 1.2;
}

.paywall-benefit-check {
    display: inline-flex;
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(var(--success-rgb), 0.15);
    color: var(--success);
    font-size: 12px;
    font-weight: 900;
}

.paywall-games {
    position: relative;
    height: 196px;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 14px;
}

/* «Пейвол под игру» (app.js applyPaywallContext): what the player came for, over the game list. */
.paywall-context-pending .payment-title,
.paywall-context-pending .payment-subtitle {
    visibility: hidden;
}

/* «Не получилось оплатить?» (app.js showCheckoutHelp): one calm card, three equal answers that wrap on narrow phones. */
.checkout-help {
    margin-bottom: 10px;
    padding: 14px;
    border: 1px solid rgba(var(--ink-rgb), 0.12);
    border-radius: 16px;
    background: var(--bg-card);
    animation: paywallFocusIn 0.3s ease-out both;
}

.checkout-help[hidden],
.checkout-help-options[hidden],
.checkout-help-result[hidden] {
    display: none;
}

.checkout-help-title {
    display: block;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
}

.checkout-help-text {
    margin: 4px 0 10px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.4;
}

.checkout-help-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.checkout-help-option {
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
    padding: 8px 10px;
    border: 2px solid var(--bg-card-alt);
    border-radius: 20px;
    background: transparent;
    color: var(--text-primary);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    overflow-wrap: anywhere;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.12s ease;
}

.checkout-help-option:hover,
.checkout-help-option:focus-visible {
    border-color: var(--accent-pink);
}

.checkout-help-option:active {
    transform: scale(0.97);
}

.checkout-help-result {
    margin: 0;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.4;
}

.paywall-focus {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 64px;
    margin-bottom: 8px;
    padding: 8px 14px 8px 8px;
    border: 1px solid rgba(var(--accent-rgb), 0.35);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.16), rgba(var(--accent-rgb), 0.04)), var(--bg-card);
    animation: paywallFocusIn 0.3s ease-out both;
}

.paywall-focus[hidden] {
    display: none;
}

.paywall-focus-art {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    overflow: hidden;
    border-radius: 12px;
    background: rgba(var(--ink-rgb), 0.06);
}

.paywall-focus-art img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.paywall-focus-copy {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.paywall-focus-title {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 800;
    line-height: 1.25;
}

.paywall-focus-text {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}

.paywall-focus-lock {
    flex: 0 0 auto;
    color: var(--accent-pink);
}

/* The lock opens once: the shackle lifts and swings, as on a locked pack in the game. */
.paywall-focus-shackle {
    transform-box: fill-box;
    transform-origin: 100% 100%;
    animation: paywallFocusUnlock 0.45s 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

/* Premium samples (app.js renderPackSamples): one-line head and one-line cards (owner: «компактнее по высоте»), the outer two blurred and cut in half. */
.paywall-samples {
    margin: 6px 0 8px;
    animation: paywallFocusIn 0.3s ease-out both;
}

.paywall-samples[hidden] {
    display: none;
}

.paywall-samples-head {
    margin: 0 0 4px 2px;
    overflow: hidden;
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.paywall-samples-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.paywall-samples--edges .paywall-samples-list {
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 12%, #000 88%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0, #000 12%, #000 88%, transparent 100%);
}

.paywall-sample {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 3px 9px;
    border: 1px solid rgba(var(--ink-rgb), 0.12);
    border-radius: 8px;
    background: rgba(var(--ink-rgb), 0.07);
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
}

.paywall-sample--edge {
    max-height: 10px;
    overflow: hidden;
    filter: blur(2.5px);
}

.paywall-sample-text {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.paywall-sample-number {
    flex: 0 0 auto;
    min-width: 26px;
    color: var(--accent-text, var(--accent-pink));
    font-size: 10px;
    font-weight: 800;
}


@keyframes paywallFocusIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

@keyframes paywallFocusUnlock {
    to { transform: translateY(-2.5px) rotate(28deg); }
}

@media (prefers-reduced-motion: reduce) {
    .paywall-focus,
    .paywall-samples {
        animation: none;
    }

    .paywall-focus-shackle {
        animation: none;
        transform: translateY(-2.5px) rotate(28deg);
    }
}

/* The focus card takes its height from the game list, so the plans stay where they were. */
.paywall-has-focus .paywall-games {
    height: 140px;
}

.paywall-has-focus.native-paywall-compact .paywall-games {
    height: 96px;
}

/* Short phones: a smaller card and list, so the first plan stays on screen. */
@media (max-height: 700px) {
    .paywall-focus {
        min-height: 56px;
        gap: 10px;
        padding: 6px 12px 6px 6px;
    }

    .paywall-focus-art {
        flex-basis: 44px;
        width: 44px;
        height: 44px;
        border-radius: 10px;
    }

    .paywall-focus-title {
        font-size: 15px;
    }

    .paywall-has-focus .paywall-games {
        height: 88px;
    }
}

.paywall-games::before,
.paywall-games::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    z-index: 2;
    pointer-events: none;
}

.paywall-games::before {
    top: 0;
    height: 58px;
    background: linear-gradient(180deg, rgba(var(--bg-rgb), 0.98) 0%, rgba(var(--bg-rgb), 0.68) 48%, rgba(var(--bg-rgb), 0) 100%);
}

.paywall-games::after {
    bottom: 0;
    height: 38px;
    background: linear-gradient(0deg, rgba(var(--bg-rgb), 0.92) 0%, rgba(var(--bg-rgb), 0) 100%);
}

.paywall-games-track {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    align-items: flex-start;
    gap: 4px;
    padding: 4px 0;
    will-change: transform;
}

.paywall-games-track.can-scroll {
    animation: paywallGamesFloat var(--paywall-games-duration, 12000ms) ease-in-out infinite;
}

.paywall-games-animation-pending .paywall-games-track.can-scroll,
.paywall-games-animation-pending .paywall-game-chip {
    animation-play-state: paused;
}

.paywall-games.chat-active::before,
.paywall-games.chat-active::after {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.paywall-games.chat-active .paywall-games-track {
    opacity: 0;
    visibility: hidden;
    animation: none;
    transition: opacity 0.24s ease;
}

.paywall-proof {
    position: absolute;
    left: 50%;
    bottom: 8px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: calc(100% - 16px);
    padding: 6px 13px 6px 6px;
    border: 1px solid rgba(var(--ink-rgb), 0.1);
    border-radius: 20px;
    background: var(--bg-card);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
    width: max-content;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, 10px) scale(0.96);
    transition: opacity 0.26s ease, transform 0.36s cubic-bezier(0.18, 0.86, 0.25, 1.2);
}

.paywall-proof[hidden] {
    display: none;
}

.paywall-proof.is-visible {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
}

.paywall-proof-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--accent-pink);
    color: var(--on-accent);
}

.paywall-proof[data-kind="rating"] .paywall-proof-icon {
    background: #ffc531;
    color: #4a3200;
}

.paywall-proof-text {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.paywall-proof-text b {
    font-weight: 800;
}

.paywall-games.chat-active .paywall-proof {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    .paywall-proof {
        transition: none;
    }
}

.paywall-chat {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    padding: 5px 5px 18px;
    border: 1px solid rgba(123, 231, 255, 0.16);
    border-radius: 14px;
    background:
        radial-gradient(circle at 12% 8%, rgba(70, 210, 255, 0.11), transparent 38%),
        linear-gradient(165deg, rgba(20, 31, 60, 0.98), rgba(11, 18, 39, 0.99));
    box-shadow: inset 0 1px 0 rgba(var(--ink-rgb), 0.06);
    opacity: 0;
    transform: translateY(8px) scale(0.985);
    transition: opacity 0.28s ease, transform 0.32s cubic-bezier(0.18, 0.86, 0.25, 1);
    cursor: pointer;
    outline: none;
}

.paywall-chat[hidden] {
    display: none;
}

.paywall-games.chat-active .paywall-chat {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.paywall-chat:focus-visible {
    border-color: rgba(123, 231, 255, 0.64);
    box-shadow: 0 0 0 3px rgba(69, 202, 255, 0.16), inset 0 1px 0 rgba(var(--ink-rgb), 0.08);
}

.paywall-chat-thread {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    scrollbar-width: thin;
    scrollbar-color: rgba(123, 231, 255, 0.28) transparent;
    padding-right: 2px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    scroll-behavior: auto;
    overflow-anchor: none;
}

.paywall-chat-thread::-webkit-scrollbar {
    width: 3px;
}

.paywall-chat-thread::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(123, 231, 255, 0.28);
}

.paywall-chat-message {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: 25px minmax(0, 1fr);
    grid-template-areas: "avatar meta" "avatar bubble";
    column-gap: 7px;
    align-self: flex-start;
    max-width: 91%;
    opacity: 0;
    transform: translateY(9px) scale(0.97);
    animation: paywallChatMessageIn 0.34s cubic-bezier(0.18, 0.86, 0.25, 1) forwards;
}

.paywall-chat-message.is-alternate {
    align-self: flex-end;
    grid-template-columns: minmax(0, 1fr) 25px;
    grid-template-areas: "meta avatar" "bubble avatar";
}

.paywall-chat-avatar {
    grid-area: avatar;
    width: 25px;
    height: 25px;
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: var(--chat-avatar, rgba(var(--ink-rgb), 0.12));
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    font-size: 14px;
}

.paywall-chat-name {
    grid-area: meta;
    padding: 0 4px 2px;
    color: rgba(226, 241, 255, 0.68);
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
}

.paywall-chat-message.is-alternate .paywall-chat-name {
    text-align: right;
}

.paywall-chat-bubble {
    grid-area: bubble;
    padding: 5px 8px;
    border: 1px solid rgba(var(--ink-rgb), 0.08);
    border-radius: 5px 12px 12px 12px;
    background: rgba(var(--ink-rgb), 0.09);
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 650;
    line-height: 1.22;
    overflow-wrap: anywhere;
}

.paywall-chat-message.is-alternate .paywall-chat-bubble {
    border-radius: 12px 5px 12px 12px;
    background: linear-gradient(145deg, rgba(255, 67, 116, 0.86), rgba(204, 42, 99, 0.88));
    color: var(--on-accent);
}

.paywall-chat-typing {
    flex: 0 0 auto;
    width: 38px;
    height: 20px;
    margin: 5px 0 0 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: rgba(var(--ink-rgb), 0.1);
}

.paywall-chat-typing[hidden] {
    display: none;
}

.paywall-chat-typing span {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(var(--ink-rgb), 0.78);
    animation: paywallChatTyping 0.85s ease-in-out infinite;
}

.paywall-chat-typing span:nth-child(2) { animation-delay: 0.13s; }
.paywall-chat-typing span:nth-child(3) { animation-delay: 0.26s; }

.paywall-game-chip {
    max-width: 100%;
    min-height: 22px;
    padding: 3px 6px;
    border: 1px solid rgba(var(--ink-rgb), 0.12);
    border-radius: 8px;
    background: rgba(var(--ink-rgb), 0.07);
    display: flex;
    align-items: center;
    gap: 5px;
    opacity: 0;
    transform: translateY(14px) scale(0.98);
    animation: paywallGameIn 0.28s cubic-bezier(0.18, 0.86, 0.25, 1) forwards;
    animation-delay: var(--delay);
}

.paywall-game-chip img {
    width: 14px;
    height: 14px;
    object-fit: contain;
    flex-shrink: 0;
}

.game-icon-fallback {
    width: 14px;
    height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 12px;
    line-height: 1;
}

.paywall-game-chip span {
    max-width: none;
    min-width: 0;
    color: var(--text-primary);
    font-size: 10px;
    font-weight: 800;
    line-height: 1.15;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
}

.coupon-card {
    position: relative;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 14px;
    border: 0;
    border-radius: 8px;
    background: rgba(var(--success-rgb), 0.08);
    margin-bottom: 16px;
    overflow: hidden;
}

.coupon-dash-border {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
}

.coupon-dash-border rect {
    fill: none;
    stroke: rgba(var(--success-line-rgb), 0.82);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-dasharray: 4 3;
    vector-effect: non-scaling-stroke;
    animation: couponDashMove 1.1s linear infinite;
}

.coupon-card > :not(.coupon-dash-border) {
    position: relative;
    z-index: 1;
}

@keyframes couponDashMove {
    to {
        stroke-dashoffset: -14;
    }
}

.coupon-kicker {
    display: block;
    margin-bottom: 5px;
    color: var(--success);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.coupon-code {
    display: block;
    max-width: 230px;
    color: var(--success);
    font-size: 15px;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.coupon-timer {
    flex-shrink: 0;
    min-width: 92px;
    text-align: right;
}

.coupon-timer span {
    display: block;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.1;
}

.coupon-timer strong {
    display: block;
    margin-top: 4px;
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 900;
    line-height: 1;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--text-secondary);
}

.feature-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.input-section {
    margin-bottom: 18px;
}

.input-label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
}

.input-field {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    font-family: inherit;
    background: rgba(var(--ink-rgb), 0.06);
    border: 1px solid rgba(var(--ink-rgb), 0.12);
    border-radius: 12px;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s ease;
}

.input-field::placeholder {
    color: rgba(var(--ink-rgb), 0.25);
}

.input-field:focus,
.input-field.error {
    border-color: var(--accent-pink);
}

.input-hint {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.45;
}

.plans-label,
.method-label {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    display: block;
}

.plans-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-bottom: 18px;
}

.method-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}

.plan-card {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.plan-card:active,
.tier-card:active,
.btn-pay:active,
.btn-secondary:active {
    transform: scale(0.97);
}

.plan-card.selected {
    border-color: var(--accent-pink);
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.12) 0%, rgba(var(--accent-blue-rgb), 0.08) 100%);
}

.plan-radio,
.method-radio,
.tier-radio {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    flex-shrink: 0;
}

.plan-radio {
    border: 2px solid var(--text-secondary);
    transition: all 0.2s ease;
}

.plan-card.selected .plan-radio {
    border-color: var(--accent-pink);
    background: var(--accent-pink);
    box-shadow: inset 0 0 0 3px var(--bg-card);
}

.plan-info {
    flex: 1;
    min-width: 0;
}

.plan-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.plan-name {
    font-size: 16px;
    font-weight: 700;
}

.plan-badge {
    padding: 3px 8px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent-pink), var(--badge-end));
    color: var(--on-accent);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    white-space: nowrap;
}

.plan-desc {
    display: block;
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
}

.plan-price-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    flex-shrink: 0;
    text-align: right;
}

.plan-weekly {
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.1;
    white-space: nowrap;
}

.plan-price-row {
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 7px;
    white-space: nowrap;
}

.plan-old-price {
    color: rgba(var(--ink-rgb), 0.48);
    font-size: 12px;
    font-weight: 800;
    text-decoration-color: rgba(var(--accent-rgb), 0.95);
    text-decoration-thickness: 2px;
}

.plan-price {
    font-size: 16px;
    font-weight: 900;
    color: var(--accent-text, var(--accent-pink));
}

.method-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.method-list .method-card {
    cursor: pointer;
}

.method-list .method-card:active {
    transform: scale(0.97);
}

.method-list .method-card:focus-visible {
    outline: 3px solid rgba(0, 156, 222, 0.72);
    outline-offset: 2px;
}

.method-card.selected {
    border-color: var(--accent-pink);
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.12) 0%, rgba(var(--accent-blue-rgb), 0.08) 100%);
}

.method-radio {
    border: 2px solid var(--text-secondary);
    transition: all 0.2s ease;
}

.method-card.selected .method-radio {
    border-color: var(--accent-pink);
    background: var(--accent-pink);
    box-shadow: inset 0 0 0 3px var(--bg-card);
}

.method-name {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
}

.method-brand {
    width: 34px;
    height: 28px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
    font-weight: 950;
    letter-spacing: -0.08em;
}

.method-brand-paypal {
    position: relative;
    overflow: hidden;
    color: #003087;
    background: linear-gradient(145deg, #ffffff 0%, #e8f6ff 100%);
    box-shadow: 0 7px 18px rgba(0, 156, 222, 0.2), inset 0 0 0 1px rgba(255, 255, 255, 0.8);
}

.method-brand-paypal::after {
    content: '';
    position: absolute;
    right: 5px;
    bottom: 5px;
    width: 10px;
    height: 4px;
    border-radius: 999px;
    background: #ffc439;
}

.method-brand-paypal span {
    position: relative;
    z-index: 1;
    transform: translate(-1px, -1px) skew(-7deg);
    text-shadow: 4px 2px 0 rgba(0, 156, 222, 0.55);
}

/* Last «method»: a link to the iOS app for buyers outside Russia (app.js decides). */
.method-list:has(+ .method-app-store:not([hidden])) {
    margin-bottom: 10px;
}

.method-app-store {
    margin-bottom: 24px;
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
}

.method-app-store[hidden] {
    display: none;
}

.method-app-store:active {
    transform: scale(0.97);
}

.method-app-store:focus-visible {
    outline: 3px solid rgba(0, 156, 222, 0.72);
    outline-offset: 2px;
}

.method-brand-app-store {
    color: #ffffff;
    background: linear-gradient(180deg, #1ec2fb 0%, #1a73f0 100%);
}

.method-app-store-copy {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.method-app-store-hint {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.35;
}

.method-app-store-arrow {
    color: var(--text-secondary);
    font-size: 18px;
}

.tiers-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.native-legal-link {
    display: none;
}

.tier-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 20px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    position: relative;
}

.tier-card.selected {
    border-color: var(--accent-pink);
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.15) 0%, rgba(var(--accent-blue-rgb), 0.10) 100%);
}

.tier-popular {
    position: absolute;
    top: -11px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-violet));
    color: var(--on-accent);
    font-size: 11px;
    font-weight: 800;
    padding: 3px 14px;
    border-radius: 8px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
}

.tier-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.tier-label {
    font-size: 17px;
    font-weight: 700;
}

.tier-badge {
    background: linear-gradient(135deg, var(--accent-pink), var(--badge-end));
    color: var(--on-accent);
    font-size: 12px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 8px;
    letter-spacing: 0.5px;
}

.tier-price-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 4px;
}

.tier-old-price {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: line-through;
    opacity: 0.7;
}

.tier-price {
    font-size: 22px;
    font-weight: 800;
    color: var(--accent-text, var(--accent-pink));
}

.tier-desc {
    font-size: 13px;
    color: var(--text-secondary);
}

.tier-trial {
    display: inline-flex;
    margin-top: 9px;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(var(--success-rgb), 0.14);
    color: var(--success);
    font-size: 12px;
    font-weight: 700;
}

.tier-radio {
    position: absolute;
    top: 20px;
    right: 20px;
    border: 2px solid var(--text-secondary);
    transition: all 0.2s ease;
}

.tier-compact-row,
.tier-compact-top,
.tier-compact-bottom {
    display: flex;
    align-items: center;
}

.tier-compact-row {
    min-height: 24px;
    padding-right: 34px;
}

.tier-compact-copy {
    flex: 1;
    min-width: 0;
}

.tier-compact-top,
.tier-compact-bottom {
    width: 100%;
    gap: 8px;
    white-space: nowrap;
}

.tier-compact-bottom {
    margin-top: 4px;
}

.tier-full-price {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
}

.tier-weekly-price {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    margin-left: auto;
    text-align: right;
}

.tier-card.selected .tier-radio {
    border-color: var(--accent-pink);
    background: var(--accent-pink);
    box-shadow: inset 0 0 0 3px var(--bg-card);
}

.btn-pay,
.btn-secondary {
    width: 100%;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

/* `display: flex` above beats the browser's [hidden]: «Завершить покупку» showed on every managed
   subscription, a paid year included (2026-11-30, a buyer read it as Premium gone after canceling renewal). */
.btn-pay[hidden],
.btn-secondary[hidden] {
    display: none;
}

.btn-pay {
    background: linear-gradient(135deg, var(--accent-pink) 0%, var(--accent-pink-dark) 100%);
    color: var(--on-accent);
    padding: 18px;
    font-size: 18px;
    font-weight: 700;
    box-shadow: 0 4px 20px rgba(var(--accent-rgb), 0.3);
    margin-top: 18px;
}

/* Owner 2026-10-20: the buy button needs volume, a gradient and white text, and it should move
   on the web too (only the iOS paywall pulsed): a light top edge, a darker bottom lip, a shine
   sweeping across and a soft breathing glow (no scale, so the button never moves under a tap). Muted/danger variants and disabled keep their look. */
.btn-pay:not(:disabled):not(.btn-muted):not(.btn-danger) {
    position: relative;
    overflow: hidden;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
    background: linear-gradient(180deg, var(--accent-pink) 0%, var(--accent-pink-dark) 100%);
    background: linear-gradient(180deg, color-mix(in srgb, var(--accent-pink) 72%, #fff) 0%, var(--accent-pink) 42%, var(--accent-pink-dark) 100%);
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35), inset 0 -4px 0 rgba(0, 0, 0, 0.22), 0 10px 26px rgba(var(--accent-rgb), 0.42);
}

.btn-pay:not(:disabled):not(.btn-muted):not(.btn-danger)::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -45%;
    width: 32%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: skewX(-20deg);
    opacity: 0;
    pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
    .btn-pay:not(:disabled):not(.btn-muted):not(.btn-danger) {
        animation: payCtaBreathe 2.6s ease-in-out infinite;
    }

    .btn-pay:not(:disabled):not(.btn-muted):not(.btn-danger)::after {
        animation: payCtaShine 2.6s ease-in-out infinite;
    }

    .btn-pay:not(:disabled):not(.btn-muted):not(.btn-danger):active {
        animation: none;
    }
}

@keyframes payCtaBreathe {
    0%, 100% { box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35), inset 0 -4px 0 rgba(0, 0, 0, 0.22), 0 10px 26px rgba(var(--accent-rgb), 0.38); }
    50% { box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35), inset 0 -4px 0 rgba(0, 0, 0, 0.22), 0 12px 34px rgba(var(--accent-rgb), 0.62); }
}

@keyframes payCtaShine {
    0%, 30% { left: -45%; opacity: 0; }
    36% { opacity: 1; }
    70%, 100% { left: 125%; opacity: 0; }
}

.btn-pay:disabled {
    background: var(--bg-card);
    color: var(--text-secondary);
    box-shadow: none;
    cursor: not-allowed;
}

.btn-pay.btn-muted {
    background: linear-gradient(135deg, var(--bg-card-alt) 0%, var(--bg-card) 100%);
    box-shadow: none;
}

.btn-pay.btn-danger {
    background: linear-gradient(135deg, #9c2d3c 0%, #5a1b24 100%);
    box-shadow: none;
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--bg-card-alt);
    color: var(--text-secondary);
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
}

.payment-note {
    text-align: center;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.45;
    margin-top: 16px;
}

.guarantee-card {
    margin-top: 12px;
    padding: 13px 14px;
    border: 1px solid rgba(var(--guarantee-rgb), 0.22);
    border-radius: 8px;
    background: rgba(var(--guarantee-rgb), 0.08);
    text-align: left;
}

.guarantee-card strong {
    display: block;
    margin-bottom: 5px;
    color: var(--success-strong);
    font-size: 14px;
    font-weight: 900;
}

.guarantee-card p {
    margin: 0;
    color: rgba(var(--ink-rgb), 0.74);
    font-size: 12px;
    line-height: 1.45;
}

@keyframes paywallGamesFloat {
    0% { transform: translateY(0); }
    45%, 55% { transform: translateY(var(--paywall-games-shift, -56px)); }
    90%, 100% { transform: translateY(0); }
}

@keyframes paywallGameIn {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes paywallChatMessageIn {
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes paywallChatTyping {
    0%, 65%, 100% { opacity: 0.35; transform: translateY(0); }
    32% { opacity: 1; transform: translateY(-2px); }
}

.restore-link {
    text-align: center;
    font-size: 13px;
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.restore-link a {
    color: var(--accent-text, var(--accent-blue));
    text-decoration: none;
}

.restore-divider {
    color: rgba(var(--ink-rgb), 0.2);
}

/* RoomPlay iOS in Russia only: «Проблемы с триалом / оплатой?» to the support bot
   (app.js setupIOSPaymentHelp). A full-width card button under the CTA, as in DareChat iOS. */
.ios-payment-help {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    margin-top: 10px;
    padding: 10px 16px;
    border-radius: 14px;
    border: 2px solid rgba(var(--accent-blue-rgb), 0.25);
    background: var(--bg-card);
    color: var(--text-primary, #fff);
    font-size: 17px;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.12s ease;
}

.ios-payment-help[hidden] {
    display: none;
}

.ios-payment-help:active {
    transform: scale(0.97);
}

/* Web (and non-compact Android) paywall: «Продолжить за …» sticks to the bottom edge while
   the plans, email and methods scroll above it, then settles in place above the guarantee
   card. Sticky (not fixed) keeps it in the flow, so nothing at the end of the page is covered. */
html:not(.native-paywall-compact) {
    /* A focused email field scrolls clear of the sticky pay dock, not behind it. */
    scroll-padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px));
}

html:not(.native-paywall-compact) #screen-select .purchase-actions {
    position: sticky;
    z-index: 20;
    bottom: 0;
    margin: 0 -20px;
    padding: 22px 20px calc(10px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, rgba(var(--bg-end-rgb), 0) 0, rgba(var(--bg-end-rgb), 0.96) 14px, var(--bg-end) 24px);
}

html:not(.native-paywall-compact) #screen-select .purchase-actions .btn-pay {
    margin-top: 0;
}

.pay-method-summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    min-height: 28px;
    margin: 0 0 6px;
    padding: 0 8px;
    border: 0;
    background: none;
    color: var(--text-secondary);
    font: inherit;
    font-size: 13px;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
}

.pay-method-summary[hidden] {
    display: none;
}

/* A/B «Оплата в 1 клик» (app.js setupOneClickLabel): one quiet line under the pay button. */
.pay-one-click {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 8px 0 0;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
}

.pay-one-click[hidden] {
    display: none;
}

.pay-one-click .rp-icon {
    width: 14px;
    height: 14px;
    color: var(--accent-text, var(--accent-blue));
}

.pay-method-summary strong {
    overflow: hidden;
    min-width: 0;
    color: var(--accent-text, var(--accent-blue));
    font-weight: 600;
    text-overflow: ellipsis;
}

.pay-method-summary-arrow {
    color: var(--accent-text, var(--accent-blue));
    font-size: 16px;
    line-height: 1;
}

html:not(.native-paywall-compact) #screen-select .purchase-actions .restore-link {
    margin-top: 8px;
}

.native-paywall-compact #screen-select {
    padding-bottom: calc(142px + env(safe-area-inset-bottom, 0px));
}

.native-paywall-compact .tiers-list {
    flex: none;
    gap: 8px;
}

.native-paywall-compact .payment-header {
    margin-bottom: 10px;
}

.native-paywall-compact .paywall-games {
    height: 140px;
    margin-bottom: 10px;
}

.native-paywall-compact .paywall-chat-thread {
    gap: 4px;
}

.native-paywall-compact .paywall-chat-bubble {
    padding: 4px 7px;
    font-size: 10.5px;
}

.native-paywall-compact .tier-card {
    min-height: 76px;
    padding: 10px 14px;
    border-radius: 14px;
}

.native-paywall-compact .tier-card.tier-has-popular {
    padding-top: 24px;
    padding-bottom: 4px;
}

.native-paywall-compact .tier-popular {
    top: 3px;
}

.native-paywall-compact .tier-radio {
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
}

.native-paywall-compact .tier-card:active .tier-radio {
    transform: translateY(-50%);
}

.native-paywall-compact .tier-label {
    font-size: 15px;
}

.native-paywall-compact .tier-price {
    font-size: 15px;
}

.native-paywall-compact .tier-old-price {
    font-size: 12px;
}

.native-paywall-compact .tier-badge {
    padding: 2px 6px;
    font-size: 9px;
}

.native-paywall-compact .tier-trial {
    margin-top: 0;
    margin-left: auto;
    padding: 3px 7px;
    font-size: 11px;
}

.ios-paywall.native-paywall-compact .tier-card.tier-has-trial {
    min-height: 96px;
}

.ios-paywall.native-paywall-compact .tier-has-trial .tier-compact-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    white-space: normal;
}

.ios-paywall.native-paywall-compact .tier-has-trial .tier-full-price {
    width: 100%;
}

.ios-paywall.native-paywall-compact .tier-has-trial .tier-trial {
    margin: 0;
    white-space: normal;
}

.native-paywall-compact .guarantee-card,
.native-paywall-compact .payment-note {
    display: none;
}

.native-paywall-compact .purchase-actions {
    position: fixed;
    z-index: 20;
    right: 0;
    bottom: 0;
    left: 0;
    width: min(100%, 430px);
    margin: 0 auto;
    padding: 10px 20px calc(9px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, rgba(var(--bg-end-rgb), 0) 0, rgba(var(--bg-end-rgb), 0.96) 18px, var(--bg-end) 42px);
}

.native-paywall-compact .purchase-actions .btn-pay {
    margin-top: 8px;
    padding: 15px;
}

.ios-paywall #btn-pay:not(:disabled) {
    animation: iosPaywallCtaPulse 1.65s ease-in-out infinite;
    transform-origin: center;
}

.ios-paywall #btn-pay:not(:disabled):active {
    animation: none;
    transform: scale(0.97);
}

.native-paywall-compact .restore-link {
    margin-top: 8px;
    gap: 5px;
    flex-wrap: wrap;
    font-size: 10px;
    line-height: 1.2;
}

.native-paywall-compact .purchase-actions .status-box {
    margin-top: 8px;
    padding: 7px 10px;
    font-size: 11px;
}

.native-paywall-compact .restore-link a {
    color: rgba(var(--ink-rgb), 0.58);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.native-paywall-compact .native-legal-link {
    display: inline;
}

.ios-paywall .native-legal-link {
    display: inline;
}

.native-paywall-compact .manage-link {
    display: none;
}

.launch-paywall .screen#screen-select {
    padding-top: calc(22px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(126px + env(safe-area-inset-bottom, 0px));
}

.launch-paywall .launch-paywall-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    margin: 0 auto 12px;
}

.launch-paywall .launch-paywall-brand img {
    width: 76px;
    height: 76px;
    border-radius: 18px;
    object-fit: cover;
    box-shadow: 0 10px 30px rgba(90, 56, 255, 0.34);
}

.launch-paywall .launch-paywall-brand strong {
    font-size: 22px;
    line-height: 1;
    font-weight: 850;
    letter-spacing: -0.02em;
}

.launch-paywall .payment-header,
.launch-paywall .coupon-card,
.launch-paywall .tiers-list,
.launch-paywall .guarantee-card,
.launch-paywall .payment-note,
.launch-paywall .premium-status {
    display: none !important;
}

.launch-paywall .paywall-games {
    flex: 1 1 0;
    min-height: 140px;
    height: auto;
    max-height: 300px;
    margin-bottom: 8px;
}

.launch-paywall .paywall-benefits {
    flex: 1 1 0;
    align-self: center;
    align-content: center;
    width: min(100%, 286px);
    min-height: 140px;
    max-height: 300px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: repeat(4, auto);
    gap: 4px;
    margin-bottom: 8px;
    text-align: left;
}

.launch-paywall .paywall-benefit-item {
    align-items: center;
    min-height: 0;
    padding: 3px 0;
    font-size: 12px;
    line-height: 1.3;
}

.launch-paywall .launch-paywall-disclosure {
    display: block;
    max-width: 100%;
    min-height: 18px;
    margin: 0 0 7px;
    color: rgba(var(--ink-rgb), 0.82);
    font-size: clamp(10px, 3.1vw, 13px);
    line-height: 1.35;
    font-weight: 650;
    letter-spacing: -0.01em;
    text-align: center;
    white-space: nowrap;
}

.launch-paywall .launch-paywall-disclosure.is-loading {
    width: 74%;
    height: 14px;
    min-height: 14px;
    margin-right: auto;
    margin-left: auto;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(var(--ink-rgb), 0.06), rgba(var(--ink-rgb), 0.16), rgba(var(--ink-rgb), 0.06));
    background-size: 200% 100%;
    animation: launchPaywallSkeleton 1.2s ease-in-out infinite;
}

.launch-paywall .purchase-actions .btn-pay {
    margin-top: 0;
}

@keyframes launchPaywallSkeleton {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

@keyframes iosPaywallCtaPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 20px rgba(var(--accent-rgb), 0.3);
    }
    50% {
        transform: scale(1.025);
        box-shadow: 0 7px 30px rgba(var(--accent-rgb), 0.52);
    }
}

@media (max-height: 690px) {
    .launch-paywall .launch-paywall-brand img {
        width: 62px;
        height: 62px;
        border-radius: 15px;
    }

    .launch-paywall .launch-paywall-brand strong {
        font-size: 19px;
    }

    .launch-paywall .paywall-games {
        min-height: 122px;
    }

    .launch-paywall .paywall-benefits {
        min-height: 122px;
        gap: 3px;
    }

    .launch-paywall .paywall-benefit-item {
        padding: 2px 0;
        font-size: 10.5px;
        line-height: 1.15;
    }
}

.status-box,
.premium-status {
    margin: 16px 0 0;
    padding: 14px 16px;
    border-radius: 14px;
    text-align: center;
}

.status-box {
    background: rgba(var(--ink-rgb), 0.04);
    color: rgba(var(--ink-rgb), 0.5);
    font-size: 14px;
}

.premium-status {
    background: rgba(var(--ink-rgb), 0.04);
}

.premium-status p {
    margin-bottom: 12px;
    font-size: 14px;
    color: rgba(var(--ink-rgb), 0.85);
}

.manage-summary {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.manage-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-size: 14px;
}

.manage-row strong {
    color: rgba(var(--ink-rgb), 0.75);
}

.manage-row span {
    text-align: right;
}

.cancel-survey {
    margin-top: 18px;
    padding: 16px;
    border-radius: 16px;
    background: var(--bg-card);
    border: 1px solid rgba(var(--ink-rgb), 0.08);
}

.cancel-survey[hidden] {
    display: none;
}

.cancel-survey h3 {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 600;
}

.cancel-survey-hint {
    margin: 0 0 14px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.45;
}

.cancel-benefits {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cancel-benefits li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--bg-secondary);
    font-size: 14px;
    line-height: 1.35;
}

.cancel-benefits .rp-icon {
    font-size: 20px;
    color: var(--accent-pink);
}

.cancel-reasons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cancel-reason {
    position: relative;
    cursor: pointer;
}

.cancel-reason input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.cancel-reason span {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--bg-card-alt);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.3;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.cancel-reason input:checked + span {
    background: rgba(var(--accent-blue-rgb), 0.22);
    border-color: var(--accent-blue);
}

.cancel-reason input:focus-visible + span {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

.cancel-comment {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--bg-card-alt);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font: inherit;
    font-size: 14px;
    line-height: 1.4;
    resize: vertical;
}

.cancel-comment::placeholder {
    color: var(--text-secondary);
}

.cancel-comment:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.cancel-survey .btn-pay {
    margin-top: 14px;
}

.cancel-survey .btn-secondary {
    margin-top: 10px;
    box-shadow: none;
}

.manage-card-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(var(--ink-rgb), 0.08);
}

.manage-card-section h3 {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 600;
}

.manage-card-hint {
    margin: 0 0 12px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.45;
}

.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    margin-bottom: 12px;
}

.checkbox-row input {
    margin-top: 3px;
    flex-shrink: 0;
}

.checkbox-row span {
    font-size: 14px;
    line-height: 1.4;
}

.manage-error {
    color: var(--accent-text, var(--accent-pink));
}

.result-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-align: center;
    gap: 16px;
    padding: 0 20px;
}

.result-icon {
    font-size: 64px;
    line-height: 1;
    color: var(--text-secondary);
}

/* Result icons come from ui-icons.css: green check on success, red face on failure. */
.result-icon--success {
    color: #4ade80;
}

.result-icon--failure {
    color: #f87171;
}

.result-title {
    font-size: 26px;
    font-weight: 800;
}

.result-text {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Optional email after a web payment made without one. Save is secondary so
   «К играм» stays the screen's single primary action. */
.success-email {
    width: 100%;
    max-width: 420px;
    padding: 16px;
    border-radius: 16px;
    background: rgba(var(--ink-rgb), 0.04);
    border: 1px solid rgba(var(--ink-rgb), 0.08);
    text-align: left;
}

.success-email[hidden],
.success-email-status[hidden],
#success-email-controls[hidden] {
    display: none;
}

.success-email .input-label {
    line-height: 1.4;
    margin-bottom: 12px;
}

.success-email .btn-secondary {
    margin-top: 12px;
}

.success-email-skip {
    display: block;
    min-height: 44px;
    margin: 4px auto 0;
    padding: 8px 16px;
    border: none;
    background: none;
    color: var(--text-secondary);
    font: inherit;
    font-size: 14px;
    text-decoration: underline;
    cursor: pointer;
}

.success-email-status {
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
}

.success-email-status.is-error {
    color: var(--accent-text, var(--accent-pink));
}

.success-email-status.is-success {
    color: var(--success);
}

.spinner-small {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(var(--ink-rgb), 0.2);
    border: 2px solid color-mix(in srgb, currentColor 22%, transparent);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 380px) {
    .screen {
        padding: 24px 16px;
        padding-top: calc(24px + env(safe-area-inset-top, 0px));
    }

    html:not(.native-paywall-compact) #screen-select .purchase-actions {
        margin-right: -16px;
        margin-left: -16px;
        padding-right: 16px;
        padding-left: 16px;
    }

    .payment-title {
        font-size: 24px;
    }

    .paywall-games {
        height: 172px;
    }

    .paywall-game-chip {
        min-height: 20px;
        padding: 3px 5px;
    }

    .paywall-game-chip img {
        width: 13px;
        height: 13px;
    }

    .paywall-game-chip span {
        max-width: none;
        font-size: 9.5px;
    }

    .tier-card,
    .plan-card,
    .method-card {
        padding: 16px;
        border-radius: 16px;
    }

    .tier-price {
        font-size: 20px;
    }

    .tier-label {
        font-size: 15px;
    }

    .native-paywall-compact .purchase-actions {
        padding-right: 16px;
        padding-left: 16px;
    }

    .native-paywall-compact .tier-compact-top,
    .native-paywall-compact .tier-compact-bottom {
        gap: 4px;
    }

    .native-paywall-compact .tier-label,
    .native-paywall-compact .tier-price {
        font-size: 12px;
    }

    .native-paywall-compact .tier-old-price,
    .native-paywall-compact .tier-weekly-price {
        font-size: 10px;
    }

    .native-paywall-compact .restore-link {
        gap: 4px;
        font-size: 9px;
    }

    .paywall-benefit-item {
        gap: 5px;
        font-size: 10px;
    }

    .paywall-benefit-check {
        flex-basis: 18px;
        width: 18px;
        height: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ios-paywall #btn-pay:not(:disabled) {
        animation: none;
    }

    .paywall-chat,
    .paywall-chat-message,
    .paywall-games.chat-active .paywall-games-track {
        transition: none;
        animation: none;
    }
    .paywall-chat-message {
        opacity: 1;
        transform: none;
    }
    .paywall-chat-typing span {
        animation: none;
    }
}

/* Opened from a game (?game=<id>): game-themes.js sets data-game-theme and the game's
   palette as the variables above. The player chat keeps its own navy-and-cyan look by
   default, so it is restyled here from the same variables. */
/* Selected cards tint over the card itself: a see-through tint over a bright game
   background (coral, yellow) would darken the card and drown its secondary text. */
html[data-game-theme] .plan-card.selected,
html[data-game-theme] .method-card.selected,
html[data-game-theme] .tier-card.selected {
    background: linear-gradient(rgba(var(--accent-rgb), 0.08), rgba(var(--accent-rgb), 0.08)), var(--bg-card);
}

/* A game accent that melts into its card (blue on blue, red on red) still has to mark the
   chosen plan and method, so outlines and radios use the lifted --accent-line. */
html[data-game-theme] .plan-card.selected,
html[data-game-theme] .method-card.selected,
html[data-game-theme] .tier-card.selected,
html[data-game-theme] .plan-card.selected .plan-radio,
html[data-game-theme] .method-card.selected .method-radio,
html[data-game-theme] .tier-card.selected .tier-radio {
    border-color: var(--accent-line, var(--accent-pink));
}

html[data-game-theme] .plan-card.selected .plan-radio,
html[data-game-theme] .method-card.selected .method-radio,
html[data-game-theme] .tier-card.selected .tier-radio {
    background: var(--accent-line, var(--accent-pink));
}

html[data-game-theme] .guarantee-card,
html[data-game-theme] .coupon-card {
    background: linear-gradient(rgba(var(--guarantee-rgb), 0.1), rgba(var(--guarantee-rgb), 0.1)), var(--bg-card);
}

html[data-game-theme] .input-field {
    background: var(--bg-card);
}

html[data-game-theme] .paywall-chat {
    border-color: rgba(var(--ink-rgb), 0.1);
    background: var(--bg-card);
    box-shadow: inset 0 1px 0 rgba(var(--ink-rgb), 0.04);
}

html[data-game-theme] .paywall-chat:focus-visible {
    border-color: var(--accent-pink);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.2);
}

html[data-game-theme] .paywall-chat-thread {
    scrollbar-color: rgba(var(--ink-rgb), 0.2) transparent;
}

html[data-game-theme] .paywall-chat-thread::-webkit-scrollbar-thumb {
    background: rgba(var(--ink-rgb), 0.2);
}

html[data-game-theme] .paywall-chat-name {
    color: var(--text-secondary);
}

html[data-game-theme] .paywall-chat-message.is-alternate .paywall-chat-bubble {
    border-color: transparent;
    background: var(--accent-pink);
}

/* Cards wear the palette surface with its own ink (cream cards with dark text on a dark page),
   so inside them the text, accent text and accent fill tokens switch to the card variants
   that game-themes.js computed for that surface. */
html[data-game-theme] :is(.paywall-focus, .paywall-proof, .plan-card, .method-card, .tier-card,
    .guarantee-card, .coupon-card, .input-field, .paywall-chat, .cancel-survey, .ios-payment-help, .btn-pay:disabled) {
    --text-primary: var(--card-ink);
    --text-secondary: var(--card-ink-2);
    --ink-rgb: var(--card-ink-rgb);
    --accent-text: var(--card-accent-text);
    --accent-pink: var(--card-accent);
    --on-accent: var(--on-card-accent);
    color: var(--text-primary);
}

/* The second accent of the palette: plan badges, the proof icon and the lock on the game card. */
html[data-game-theme] .plan-badge,
html[data-game-theme] .tier-badge,
html[data-game-theme] .paywall-proof:not([data-kind="rating"]) .paywall-proof-icon {
    background: var(--accent-2);
    color: var(--on-accent-2);
}

html[data-game-theme] .paywall-focus-lock {
    color: var(--card-accent-2-text);
}

html[data-game-theme] .paywall-share {
    background: rgba(var(--accent-blue-rgb), 0.14);
}

html[data-game-theme] .paywall-share-icon {
    color: var(--accent-2-text);
}

/* Cancel-flow offer: the usual price crossed out under the title (app.js showCancelOffer). */
.cancel-offer-was {
    display: block;
    margin-top: 4px;
    font-size: 0.85em;
    font-weight: 600;
    color: var(--accent-pink);
}

.cancel-offer-was s {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Premium as a gift (app.js ?gift=1 / ?gift_code=). «Подарить другу» sits on its own line under
   the restore links, in the same link style, so it never competes with the pay button. */
.gift-link[hidden],
.email-signin-link[hidden],
.gift-redeem-status[hidden],
#btn-gift-share[hidden],
#btn-gift-redeem[hidden],
#btn-checking-retry[hidden] {
    display: none;
}

/* iOS app: «Уже есть Premium? Войти по почте» (app.js btn-email-signin) and its email field. */
.email-signin-form {
    margin: 8px auto 0;
}

html:not(.native-paywall-compact) #screen-select .purchase-actions .gift-link {
    margin-top: 6px;
}

.success-gift-link[hidden],
#btn-to-games[hidden],
#btn-success-email-skip[hidden] {
    display: none;
}

/* The gift page: the social proof sits under the short game list instead of over its last rows. */
.paywall-proof.paywall-proof-below {
    position: relative;
    left: auto;
    bottom: auto;
    display: flex;
    margin: -6px auto 14px;
    transform: translateY(6px) scale(0.96);
}

.paywall-proof.paywall-proof-below[hidden] {
    display: none;
}

.paywall-proof.paywall-proof-below.is-visible {
    transform: none;
}

/* The postcard: the game's accent and violet, a ribbon with a bow, the brand cube. */
.gift-postcard {
    position: relative;
    width: 100%;
    max-width: 330px;
    aspect-ratio: 1.55;
    padding: 20px 22px;
    border-radius: 22px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    gap: 4px;
    text-align: left;
    color: var(--on-accent);
    background:
        radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.22) 0 18%, transparent 19%),
        radial-gradient(circle at 92% 108%, rgba(255, 255, 255, 0.16) 0 30%, transparent 31%),
        linear-gradient(135deg, var(--accent-pink) 0%, var(--accent-violet) 100%);
    box-shadow: 0 18px 40px rgba(var(--accent-rgb), 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    animation: giftPostcardFloat 5s ease-in-out infinite;
}

.gift-postcard::before,
.gift-postcard::after {
    content: '';
    position: absolute;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05);
}

/* Vertical and horizontal ribbon bands crossing in the top right corner. */
.gift-postcard::before {
    top: 0;
    bottom: 0;
    right: 13%;
    width: 16px;
}

.gift-postcard::after {
    left: 0;
    right: 0;
    top: 26%;
    height: 16px;
}

.gift-postcard-ribbon {
    position: absolute;
    z-index: 1;
    top: calc(26% + 8px);
    right: calc(13% + 8px);
    width: 0;
    height: 0;
}

/* The bow: two loops and a knot. */
.gift-postcard-ribbon::before,
.gift-postcard-ribbon::after {
    content: '';
    position: absolute;
    top: -16px;
    width: 30px;
    height: 22px;
    border: 6px solid #fff;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    background: rgba(255, 255, 255, 0.18);
}

.gift-postcard-ribbon::before {
    right: 2px;
    transform: rotate(-24deg);
}

.gift-postcard-ribbon::after {
    left: 2px;
    transform: rotate(24deg);
}

.gift-postcard-brand,
.gift-postcard-kicker,
.gift-postcard-title,
.gift-postcard-text {
    position: relative;
    z-index: 2;
}

.gift-postcard-brand {
    position: absolute;
    top: 18px;
    left: 20px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 15px;
    font-weight: 900;
    letter-spacing: -0.01em;
}

.gift-postcard-brand img {
    width: 24px;
    height: 24px;
}

.gift-postcard-kicker,
.gift-postcard-title,
.gift-postcard-text {
    max-width: 76%;
}

.gift-postcard-kicker {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.85;
}

.gift-postcard-title {
    font-size: 26px;
    font-weight: 900;
    line-height: 1.05;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

.gift-postcard-text {
    font-size: 13px;
    font-weight: 600;
    opacity: 0.9;
}

.gift-result .btn-pay,
.gift-result .btn-secondary {
    margin-top: 0;
}

.gift-link-field {
    font-size: 14px;
    text-align: center;
    color: var(--accent-text, var(--accent-blue));
}

.gift-redeem-status {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.45;
}

.gift-redeem-status.is-error {
    color: var(--accent-text, var(--accent-pink));
}

@keyframes giftPostcardFloat {
    0%, 100% { transform: translateY(0) rotate(-1deg); }
    50% { transform: translateY(-6px) rotate(1deg); }
}

@media (prefers-reduced-motion: reduce) {
    .gift-postcard { animation: none; }
}

/* VietQR bank transfer (screen-vietqr): the QR sits on white so every bank app scans it. */
.vietqr-container {
    gap: 12px;
}

.vietqr-card {
    background: #ffffff;
    color: #0d1329;
    border-radius: 20px;
    padding: 16px;
    width: 100%;
    max-width: 300px;
    margin: 4px auto 0;
    text-align: center;
}

.vietqr-image {
    display: block;
    width: 240px;
    height: 240px;
    max-width: 100%;
    margin: 0 auto;
    image-rendering: pixelated;
}

.vietqr-amount {
    font-size: 24px;
    font-weight: 800;
    margin-top: 8px;
}

.vietqr-row {
    font-size: 14px;
    margin-top: 4px;
    word-break: break-word;
}

.vietqr-account {
    opacity: 0.7;
}

.vietqr-hint {
    font-size: 13px;
}

/* «Короткий пейвол» (app.js isCompactPaywall, ?compact=1; the first paywall of feature first-paywall):
   one screen on a phone, nothing to scroll past before the plans. The method list stays folded under
   the «Способ оплаты: … ›» line of the pay dock until it is tapped. */
.paywall-compact .paywall-games,
.paywall-compact .paywall-samples,
.paywall-compact .paywall-focus,
.paywall-compact .guarantee-card,
.paywall-compact #lbl-plans,
.paywall-compact .payment-subtitle,
.paywall-compact .paywall-benefit-item:nth-child(4) {
    display: none !important;
}

html.paywall-compact.paywall-compact-methods-folded #lbl-method,
html.paywall-compact.paywall-compact-methods-folded #method-list {
    display: none !important;
}

.paywall-compact .payment-header {
    margin-bottom: 12px;
}

.paywall-compact .paywall-benefits {
    margin-bottom: 14px;
}

.paywall-compact .payment-note {
    font-size: 12px;
}
