* {
    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;
    --accent-orange: #ff6b35;
    --text-primary: #ffffff;
    --text-secondary: #8892b0;
}

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

.roomplay-menu-topbar {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    align-items: center;
    gap: 8px;
    margin-bottom: 30px;
}

.roomplay-menu-topbar .menu-title {
    min-width: 0;
    margin: 0;
}

/* Legacy DareChat WebViews hide both shell controls; keep the title in the wide
   middle column (not the 42px first one) so it stays on one centered line and the
   absolutely positioned native Back arrow keeps the empty left column to itself. */
.legacy-darechat-webview .roomplay-menu-topbar {
    min-height: 40px;
}

.legacy-darechat-webview .roomplay-menu-topbar .menu-title {
    grid-column: 2;
}

.roomplay-standalone .roomplay-menu-topbar .menu-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.roomplay-standalone .roomplay-menu-topbar .menu-title::before {
    width: clamp(28px, 8vw, 36px);
    aspect-ratio: 1;
    flex: 0 0 auto;
    content: "";
    background: url("brand/roomplay-cube-192.webp") center / contain no-repeat;
}

/* RoomPlay catalog header (owner 2026-10-29, «такая же шапка»): the brand lockup of the shared game header
   (cube /brand/roomplay-cube-192.webp + «roomplay» in Unbounded) bigger and bolder, and «Игры для вечеринок»
   in small type under it. Couples and the Darechat WebView keep the text title. The word has its own face
   (Unbounded Latin only, same file as fonts.css) so the rest of the catalog keeps its fonts. */
@font-face {
    font-family: 'RoomPlay Wordmark';
    font-style: normal;
    font-display: swap;
    font-weight: 200 900;
    src: url(unbounded-latin-wght-normal.woff2?v=5.3.0) format('woff2');
}

.roomplay-standalone .roomplay-menu-topbar .menu-title--brand {
    flex-direction: column;
    gap: 2px;
    line-height: 1;
}

.roomplay-standalone .roomplay-menu-topbar .menu-title--brand::before {
    content: none;
}

.menu-brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: clamp(5px, 1.6vw, 7px);
    max-width: 100%;
}

.menu-brand-cube {
    display: block;
    flex: none;
    width: clamp(26px, 8vw, 32px);
    height: clamp(26px, 8vw, 32px);
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
}

.menu-brand-word {
    font-family: 'RoomPlay Wordmark', 'Unbounded', 'Manrope', system-ui, sans-serif;
    font-size: clamp(18px, 5.6vw, 22px);
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1;
    white-space: nowrap;
}

.menu-title:not(.menu-title--brand) .menu-brand-lockup,
.menu-title:not(.menu-title--brand) .menu-brand-tagline {
    display: none;
}

.menu-brand-tagline {
    display: none;
}

.menu-brand-tagline {
    display: block;
    margin-top: 1px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.roomplay-shell-control {
    -webkit-tap-highlight-color: transparent;
}

.menu-language-button,
.menu-language-option,
.menu-settings-button,
.settings-back-button,
.settings-row {
    font: inherit;
}

.menu-language-picker {
    position: relative;
    width: 42px;
    height: 42px;
    justify-self: start;
}

.menu-language-button {
    display: flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 13px;
    background: rgba(37, 43, 74, 0.82);
    color: var(--text-primary);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.menu-language-popover {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 30;
    width: min(250px, calc(100vw - 32px));
    min-width: 210px;
    height: min(360px, 62vh);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 15px;
    background: #1a2140;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.42);
}

.menu-language-popover[hidden] {
    display: none;
}

.menu-language-options {
    display: grid;
    width: 100%;
    height: 100%;
    gap: 2px;
    padding: 6px 5px 16px 6px;
    overflow-x: hidden;
    overflow-y: scroll;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scrollbar-width: auto;
    scrollbar-color: rgba(255, 255, 255, 0.48) rgba(7, 11, 25, 0.38);
    -webkit-overflow-scrolling: touch;
}

.menu-language-options::-webkit-scrollbar {
    width: 9px;
}

.menu-language-options::-webkit-scrollbar-track {
    margin: 7px 0;
    border-radius: 999px;
    background: rgba(7, 11, 25, 0.38);
}

.menu-language-options::-webkit-scrollbar-thumb {
    min-height: 42px;
    border: 2px solid #1a2140;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.48);
}

.menu-language-overflow-shade {
    position: absolute;
    right: 11px;
    bottom: 0;
    left: 0;
    z-index: 1;
    height: 42px;
    border-radius: 0 0 0 14px;
    background: linear-gradient(180deg, rgba(13, 19, 41, 0), rgba(7, 11, 25, 0.88));
    pointer-events: none;
}

.menu-language-overflow-shade[hidden] {
    display: none;
}

.menu-language-option {
    display: flex;
    width: 100%;
    min-height: 42px;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-primary);
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
}

.menu-language-option[aria-selected="true"] {
    background: rgba(74, 108, 247, 0.2);
    color: #fff;
}

/* SVG flags from language-flags.css: 24x18 in the list, 26x19.5 on the button. */
.menu-language-option-flag {
    width: 24px;
    height: 18px;
    flex: 0 0 24px;
    font-size: 18px;
}

.menu-language-button .rp-flag {
    font-size: 19.5px;
}

.menu-language-option-name {
    font-size: 14px;
    font-weight: 650;
}

.menu-settings-button {
    display: flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    justify-self: end;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 13px;
    background: rgba(37, 43, 74, 0.82);
    color: var(--text-primary);
    cursor: pointer;
}

.menu-language-button:focus-visible,
.menu-language-option:focus-visible,
.menu-settings-button:focus-visible,
.settings-back-button:focus-visible,
.settings-row:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

.legacy-darechat-webview .roomplay-shell-control {
    display: none;
}

.settings-screen {
    min-height: 100vh;
    min-height: var(--app-height, 100dvh);
    padding: calc(24px + env(safe-area-inset-top, 0px)) 20px 32px;
    /* Transparent over the body's identical gradient so the background bubbles keep floating here too. */
    background: transparent;
}

.settings-screen[hidden] {
    display: none;
}

.settings-header {
    position: relative;
    display: flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
}

.settings-header h2 {
    font-size: 24px;
    text-align: center;
}

.settings-back-button {
    position: absolute;
    left: 0;
    display: flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border: 0;
    background: transparent;
    color: var(--text-primary);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
    -webkit-tap-highlight-color: transparent;
}

/* Owner 2026-11-07 «кнопка назад хз где» (PC): the shared .btn-back stage rule (pc-stage.css: left 40px, top 28px)
   pushed the settings «←» under the title. The settings «←» keeps its place in the header row, at the column's
   left edge, level with the title, as on a phone. */
html.rp-stage .settings-header { min-height: 52px; }
html.rp-stage .settings-header .settings-back-button {
    top: 0;
    bottom: 0;
    left: 0;
    margin: auto 0;
}

.settings-actions {
    display: grid;
    gap: 12px;
}

.settings-row {
    display: grid;
    width: 100%;
    grid-template-columns: 42px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    background: rgba(37, 43, 74, 0.9);
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
}

/* «Получить Premium» (owner 2026-11-30: «выше в 1.5-2 раза и красочнее»): the shared pearl Premium button
 * (premium-cta.css, class rp-premium-cta) laid out as a settings row: about 1.7x the other rows, bigger crown and
 * title, dark ink on the foil. The row grid, left text and chevron stay; the pearl tilt, glare and press come
 * from the shared component. */
.settings-row.settings-premium-row {
    display: grid;
    min-height: 124px;
    align-items: center;
    /* Crown and title on top, the perks across the row under them (they fit one line each on a 360 px phone). */
    grid-template-columns: 52px minmax(0, 1fr) 20px;
    grid-template-areas: "icon title chevron" "perks perks chevron";
    column-gap: 12px;
    row-gap: 12px;
    margin-bottom: 4px;
    padding: 20px 18px;
    border: 0;
    border-radius: 22px;
    /* .settings-row paints its dark fill after premium-cta.css: put the pearl foil back (same as .rp-premium-cta). */
    background: linear-gradient(115deg, #fde7f1 0%, #e4d4ff 18%, #cdf3ee 34%, #fff3c9 50%, #ffd6e6 66%, #d9d1ff 82%, #fde7f1 100%);
    background-size: 280% 100%;
    background-position: 0% 50%;
    text-align: left;
    color: var(--rp-pearl-ink);
}

.settings-premium-row > *,
.settings-premium-row .settings-row-copy > * {
    position: relative;
    z-index: 2;
}

.settings-premium-row .settings-row-copy { display: contents; }
.settings-premium-row .settings-row-icon { grid-area: icon; }
.settings-premium-row .settings-row-copy strong { grid-area: title; }
.settings-premium-row .settings-premium-perks,
.settings-premium-row .roomplay-premium-offer-meta { grid-column: 1 / 3; }
.settings-premium-row .settings-row-chevron { grid-area: chevron; }

.settings-premium-row .settings-row-copy strong {
    font-size: 21px;
    font-weight: 900;
    line-height: 1.15;
}

.settings-premium-row .settings-row-copy small {
    color: rgba(43, 18, 54, 0.74);
    font-size: 14px;
    font-weight: 700;
    text-shadow: none;
}

/* The perks replace the one-line description on this row (the onboarding discount line still shows under them). */
.settings-premium-row #settings-premium-description {
    display: none;
}

.settings-premium-perks {
    display: grid;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.45);
}

.settings-premium-perks > span {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(43, 18, 54, 0.82);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
    text-shadow: none;
}

.settings-premium-perks .rp-icon {
    flex: none;
    font-size: 16px;
    color: #8a3fa8;
}

.settings-premium-row .settings-row-chevron {
    color: var(--rp-pearl-ink);
    font-size: 32px;
}

.settings-row[hidden] {
    display: none;
}

.settings-row-icon {
    display: flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.07);
    font-size: 21px;
}

/* Settings icons come from ui-icons.css (no emoji); the Premium crown keeps the gold accent. */
.settings-row-icon .rp-icon {
    font-size: 24px;
}

.settings-premium-row .settings-row-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, #b0487a, #6d3fbf);
    box-shadow: 0 6px 14px rgba(109, 63, 191, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    color: #ffd166;
}

.settings-premium-row .settings-row-icon .rp-icon {
    font-size: 30px;
}

.settings-row-copy {
    display: grid;
    gap: 4px;
}

.settings-row-copy strong {
    font-size: 15px;
}

.settings-row-copy small {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.35;
}

.settings-toggle-row {
    grid-template-columns: 42px minmax(0, 1fr) 46px;
}

.settings-row-switch {
    position: relative;
    width: 46px;
    height: 28px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    transition: background-color 180ms ease;
}

.settings-row-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: transform 220ms cubic-bezier(.2, .9, .3, 1.2);
}

.settings-toggle-row[aria-checked="true"] .settings-row-switch {
    background: #4caf50;
}

.settings-toggle-row[aria-checked="true"] .settings-row-switch::after {
    transform: translateX(18px);
}

.settings-row-chevron {
    color: var(--text-secondary);
    font-size: 28px;
    line-height: 1;
}
.app {
    max-width: 430px;
    margin: 0 auto;
    min-height: 100vh;
    min-height: var(--app-height, 100dvh);
}

.menu-screen {
    padding: 40px 20px;
    padding-top: calc(40px + env(safe-area-inset-top, 0px));
    min-height: 100vh;
    min-height: var(--app-height, 100dvh);
}

.menu-screen::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: env(safe-area-inset-top, 0px);
    background: var(--bg-primary);
    z-index: 11;
}

.menu-header {
    position: sticky;
    top: env(safe-area-inset-top, 0px);
    z-index: 10;
    background: var(--bg-primary);
    padding-top: 40px;
    margin-top: -40px;
    padding-bottom: 4px;
}

.btn-webview-back {
    display: none;
}

.webview .btn-webview-back {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    left: 0;
    top: 40px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    z-index: 12;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

.roomplay-ios-app .btn-webview-back {
    display: none;
}

.menu-title {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-primary);
}

.tabs-container {
    overflow-x: auto;
    margin-bottom: 20px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.tabs-container::-webkit-scrollbar {
    display: none;
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 4px;
}

.tab[data-filter="isdev"] {
    display: none;
}

.tab {
    padding: 8px 12px;
    border-radius: 9999px;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    background: transparent;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

@media (hover: hover) {
    .tab:hover {
        border-color: rgba(255, 255, 255, 0.3);
        color: var(--text-primary);
    }
}

.tab.active {
    background: var(--accent-pink);
    border-color: var(--accent-pink);
    color: var(--text-primary);
}

.search-container {
    margin-bottom: 16px;
    padding: 0 4px;
}

.search-container.hidden {
    display: none;
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    /* iOS zooms the whole viewport when a focused input renders below 16px. */
    font-size: 16px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.search-input::placeholder {
    color: var(--text-secondary);
}

.search-input:focus {
    border-color: var(--accent-pink);
}

/* Catalog search clear button: shown only while the input has text. */
.search-container {
    position: relative;
}

.search-container .search-input {
    padding-right: 48px;
}

.search-input::-webkit-search-cancel-button,
.ru-search-wrap input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
    display: none;
}

.search-clear {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #9da7ca;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.search-clear svg {
    box-sizing: content-box;
    padding: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.search-clear:hover svg,
.search-clear:active svg {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.search-clear:focus-visible {
    outline: none;
}

.search-clear:focus-visible svg {
    outline: 2px solid var(--accent-pink, #ff3b6f);
    outline-offset: 2px;
}

input:placeholder-shown + .search-clear {
    display: none;
}

.search-container .search-clear {
    position: absolute;
    top: 50%;
    right: 4px;
    transform: translateY(-50%);
}

.ru-search-wrap .search-clear {
    margin: -4px -11px -4px -6px;
}

.game-card.hidden {
    display: none;
}

.games-list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px;
}

.games-list .game-card {
    width: 100%;
}

.catalog-load-error {
    width: 100%;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 32px 20px;
    color: var(--text-secondary);
    text-align: center;
}

.catalog-load-error p {
    margin: 0;
    font-size: 17px;
}

.catalog-load-retry {
    border: 0;
    border-radius: 999px;
    padding: 12px 22px;
    background: var(--accent-pink);
    color: #fff;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.catalog-load-retry:disabled {
    opacity: 0.6;
    cursor: wait;
}

.game-card {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 19px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    animation: fadeIn 0.3s ease;
    position: relative;
}

@media (hover: hover) {
    .game-card:hover {
        transform: translateX(4px);
        background: var(--bg-card);
    }
}

.game-card:active {
    transform: scale(0.98);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card-image {
    width: 96px;
    height: 96px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 16px;
    overflow: hidden;
}

.card-icon {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.card-icon-emoji {
    font-size: 40px;
    line-height: 1;
}

.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;
}

/* Game-specific backgrounds */
.shlyapa-bg {
    background: linear-gradient(135deg, #ff6b6b 0%, #c92a2a 100%);
}

.kto-iz-nas-bg {
    background: linear-gradient(135deg, #ff922b 0%, #e8590c 100%);
}

.zayac-bg {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.heads-up-bg {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.five-seconds-bg {
    background: linear-gradient(135deg, #ff9500 0%, #e68600 100%);
}

.taboo-bg {
    background: linear-gradient(135deg, #e53935 0%, #c62828 100%);
}

.danetki-bg {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.spy-bg {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.never-have-bg {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.would-rather-bg {
    background: linear-gradient(135deg, #22d3ee 0%, #10264d 49%, #ff6b68 100%);
}

.crocodile-bg {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}

.codenames-bg {
    background: linear-gradient(135deg, #e53935 0%, #1e88e5 100%);
}

.secrethitler-bg {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
}

.wavelength-bg {
    background: linear-gradient(135deg, #06b6d4 0%, #8b5cf6 100%);
}

.erotic-dice-bg {
    background: linear-gradient(135deg, #7c4dff 0%, #e91e63 100%);
}

.kamasutra-bg {
    background: linear-gradient(135deg, #ff3b6f 0%, #ff1744 100%);
}

.decoder-bg {
    background: linear-gradient(135deg, #10b981 0%, #065f46 100%);
}

.soobrazhariy-bg {
    background: linear-gradient(135deg, #f59e0b 0%, #16a34a 100%);
}

.hundred-to-one-bg {
    background: linear-gradient(135deg, #ff3b6f 0%, #4a6cf7 100%);
}

.quiz-bg {
    background: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
}

.melody-bg {
    background: linear-gradient(135deg, #ff3b6f 0%, #4a6cf7 100%);
}

.truth-detector-bg {
    background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
}

.drawful-bg {
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
}

.fibbage-bg {
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
}

.quiplash-bg {
    background: linear-gradient(135deg, #f59e0b 0%, #dc2626 100%);
}

.imaginarium-bg {
    background: linear-gradient(135deg, #9333ea 0%, #6d28d9 100%);
}

.joking-hazard-bg {
    background:
        radial-gradient(circle at 72% 24%, rgba(255,255,255,.2) 0 2px, transparent 3px),
        linear-gradient(135deg, #f7f0df 0 58%, #d9232e 58% 100%);
    color: #171717;
}

.tower-bg {
    background: linear-gradient(135deg, #f58a3a 0%, #e4572e 100%);
}

.detective-bg {
    background: linear-gradient(135deg, #22474e 0%, #10282d 100%);
}

.lineup-bg {
    background: linear-gradient(135deg, #2d3d74 0%, #1a2449 100%);
}

.chepukha-bg {
    background: linear-gradient(135deg, #4a3784 0%, #2a1d52 100%);
}

.greatminds-bg {
    background: linear-gradient(135deg, #1f8a71 0%, #0f5a49 100%);
}

.mix-bg {
    background: linear-gradient(135deg, #3d3280 0%, #2b2356 60%, #221c47 100%);
}

/* «Микс RoomPlay» is pinned first in the catalog: a sun-yellow outline marks it as the «не знаем, во что играть» pick. */
.game-card--pinned {
    box-shadow: inset 0 0 0 2px rgba(255, 201, 74, .7);
}

.tod-bg {
    background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
}

.werewords-bg {
    background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
}

.card-content {
    flex: 1;
    min-width: 0;
}

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 8px;
    margin-bottom: 6px;
    /* Room for the absolutely positioned «Избранное» heart, so long titles never run under it. */
    padding-right: 24px;
}

.card-favorite {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 2;
    transition: transform 0.2s ease;
}

@media (hover: hover) {
    .card-favorite:hover {
        transform: scale(1.2);
    }
}

.card-favorite-icon {
    width: 15px;
    height: 15px;
    opacity: 0.5;
    transition: opacity 0.2s ease, filter 0.2s ease;
    filter: invert(1);
}

.card-favorite.active .card-favorite-icon {
    opacity: 1;
    filter: invert(74%) sepia(30%) saturate(400%) hue-rotate(3deg) brightness(80%) contrast(85%);
}

/* «Избранное» heart (inline SVG): white outline when off, filled pink-red when on. */
svg.card-favorite-icon {
    display: block;
    width: 18px;
    height: 18px;
    color: #fff;
    filter: none;
}

.card-favorite.active svg.card-favorite-icon {
    color: #ff4d6d;
    fill: currentColor;
    filter: none;
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-pink);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.2;
    min-width: 0;
}

.game-public-rating {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    padding: 4px 7px;
    border-radius: 999px;
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    vertical-align: middle;
    white-space: nowrap;
}

.card-tags {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-top: 10px;
    padding-left: 112px;
}

.favorites-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    text-align: center;
    color: var(--text-secondary);
    opacity: 0.5;
    padding: 20px;
    font-size: 15px;
}

.favorites-empty-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    filter: invert(1);
    opacity: 0.3;
}

svg.favorites-empty-icon {
    color: #fff;
    filter: none;
}

.favorites-empty.hidden {
    display: none;
}

.player-badge,
.mode-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}

.card-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Join banner */
.join-banner {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    background: rgba(13, 19, 41, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(139, 92, 246, 0.3);
    z-index: 20;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.join-banner.hidden {
    transform: translateX(-50%) translateY(100%);
    opacity: 0;
    pointer-events: none;
}

.join-banner-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.join-banner-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.join-banner-or {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
}

.join-banner-btn {
    padding: 10px 24px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    flex-shrink: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.join-banner-qr {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s ease, background 0.2s ease;
}

.join-banner-qr img {
    filter: invert(1);
    opacity: 0.85;
}

.join-banner-qr:active {
    transform: scale(0.93);
}

@media (hover: hover) {
    .join-banner-btn:hover {
        transform: scale(1.05);
        box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
    }
    .join-banner-qr:hover {
        background: rgba(255, 255, 255, 0.14);
        transform: scale(1.05);
    }
}

.join-banner-btn:active {
    transform: scale(0.97);
}

.games-list.has-join-banner {
    padding-bottom: 70px;
}

/* RU catalog: one persistent room control and compact multi-filter tools. */
.ru-room-control,.ru-catalog-controls,.ru-control-row,.ru-active-filters,.ru-filter-options,.ru-catalog-summary{display:flex}
.ru-room-control{align-items:stretch;gap:8px;margin:-8px 4px 18px}.ru-room-main{flex:1;display:flex;align-items:center;gap:10px;min-height:48px;padding:0 14px;border:1px solid rgba(139,92,246,.34);border-radius:15px;background:linear-gradient(135deg,rgba(99,102,241,.14),rgba(139,92,246,.08));color:#eef0ff;text-decoration:none;font-weight:750}.ru-room-icon{width:10px;height:10px;border-radius:50%;background:#34d399;color:transparent;box-shadow:0 0 12px rgba(52,211,153,.65)}.ru-room-chevron{margin-left:auto;color:#9da7ca;font-size:22px}.ru-room-qr{width:48px;border:1px solid rgba(255,255,255,.14);border-radius:15px;background:rgba(255,255,255,.06)}.ru-room-qr img{filter:invert(1);opacity:.85}
.ru-catalog-controls{flex-direction:column;gap:10px;margin:0 4px 18px}.ru-search-wrap{display:flex;align-items:center;gap:9px;padding:0 13px;min-height:46px;border:1px solid rgba(255,255,255,.15);border-radius:14px;background:rgba(255,255,255,.045);color:#9da7ca}.ru-search-wrap input{min-width:0;flex:1;border:0;outline:0;background:transparent;color:#fff;font:inherit;font-size:16px}.ru-search-wrap input::placeholder{color:#9da7ca}.ru-control-row{gap:8px;align-items:center;overflow-x:auto;scrollbar-width:none}.ru-control-row::-webkit-scrollbar{display:none}.ru-control-chip,.ru-active-filters button{white-space:nowrap;border:1px solid rgba(255,255,255,.16);border-radius:999px;background:transparent;color:#d9def4;font:inherit;font-size:12px;font-weight:700}.ru-control-chip{min-height:36px;padding:0 12px}.ru-control-chip.active{border-color:#ff3b6f;background:rgba(255,59,111,.18);color:#fff}.ru-count{display:inline-grid;place-items:center;min-width:18px;height:18px;margin-left:4px;border-radius:999px;background:#635bff;color:#fff;font-size:10px}.ru-active-filters{flex-wrap:wrap;gap:7px}.ru-active-filters:empty{display:none}.ru-active-filters button{padding:6px 10px;background:rgba(99,102,241,.14)}.ru-catalog-summary{align-items:center;justify-content:space-between;flex-wrap:nowrap;gap:8px;margin-top:7px}.ru-catalog-summary p{min-width:0;margin:0;color:#aeb7d8;font-size:clamp(11px,3.25vw,13px);white-space:nowrap}.ru-catalog-summary strong{color:#fff}.ru-sort-control{margin-left:auto;flex:0 0 auto}.ru-sort-control select{height:32px;max-width:145px;padding:0 20px 0 4px;border:0;outline:0;background:transparent;color:#cbd3f4;color-scheme:dark;font:inherit;font-size:clamp(11px,3vw,12px);font-weight:700;text-align:right}
.ru-catalog .tabs-container,.ru-catalog #search-container,.ru-catalog .join-banner{display:none!important}.ru-catalog .games-list.has-join-banner{padding-bottom:0}.ru-new-badge,.ru-featured-badge{display:inline-flex;align-items:center;margin-left:7px;padding:3px 7px;border-radius:999px;font-size:9px;font-weight:900;line-height:1;vertical-align:middle}.ru-new-badge{background:#5b5ef7;color:#fff}.ru-featured-badge{background:rgba(52,211,153,.14);color:#6ee7b7;border:1px solid rgba(52,211,153,.3)}
.ru-catalog .card-tags{flex-wrap:nowrap;gap:5px}.ru-catalog .player-badge,.ru-catalog .mode-badge{min-width:0;padding:3px 5px;font-size:10px}
.ru-favorite-spotlight[hidden]{display:none}.ru-favorite-spotlight{margin:2px 4px 22px}.ru-favorite-spotlight>header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}.ru-favorite-spotlight>header h2{display:flex;align-items:center;gap:8px;margin:0;color:#7f8cff;font-size:14px;font-weight:900;letter-spacing:.08em;text-transform:uppercase}.ru-favorite-spotlight>header h2 .ru-spotlight-icon{font-size:25px;line-height:.8}.ru-favorite-spotlight>header p{margin:0;color:#aeb7d8;font-size:12px;white-space:nowrap}.ru-favorite-spotlight .game-card{border:2px solid rgba(127,140,255,.9)}
.ru-filter-sheet{position:fixed;inset:0;z-index:12000}.ru-filter-backdrop{position:absolute;inset:0;width:100%;border:0;background:rgba(3,6,18,.72);backdrop-filter:blur(4px)}.ru-filter-panel{position:absolute;left:50%;bottom:0;width:min(100%,430px);transform:translateX(-50%);box-sizing:border-box;padding:10px 20px calc(22px + env(safe-area-inset-bottom,0px));border-radius:24px 24px 0 0;background:#141b35;box-shadow:0 -18px 50px rgba(0,0,0,.45)}.ru-filter-handle{width:44px;height:4px;margin:0 auto 14px;border-radius:99px;background:rgba(255,255,255,.2)}.ru-filter-panel header{display:flex;align-items:center;justify-content:space-between}.ru-filter-panel h2{margin:0;font-size:22px}.ru-filter-panel header button{border:0;background:transparent;color:#aab2d2;font-size:30px}.ru-filter-panel fieldset{margin:22px 0 0;padding:0;border:0}.ru-filter-panel legend{margin-bottom:10px;font-weight:800}.ru-filter-options{flex-wrap:wrap;gap:8px}.ru-filter-options button{padding:9px 12px;border:1px solid rgba(255,255,255,.13);border-radius:999px;background:rgba(255,255,255,.04);color:#cdd3ed;font:inherit;font-size:13px}.ru-filter-options button.selected{border-color:#ff3b6f;background:#ff3b6f;color:white}.ru-filter-apply{width:100%;min-height:48px;margin-top:24px;border:0;border-radius:14px;background:linear-gradient(135deg,#635bff,#9b36f4);color:white;font:inherit;font-weight:850}.ru-filter-reset{width:100%;min-height:42px;border:0;background:transparent;color:#aab2d2;font:inherit}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(min-width:768px){.ru-catalog .games-list{display:flex;flex-direction:column;gap:16px}.ru-catalog .game-card{width:100%;flex-direction:row;text-align:left}.ru-catalog .card-image{margin:0 16px 0 0}.ru-catalog .card-header{justify-content:flex-start;padding-left:0}.ru-catalog .card-tags{padding-left:112px;justify-content:flex-start}}

/* Responsive */
@media (max-width: 480px) {
    .app {
        max-width: 100%;
    }

    .menu-screen {
        padding: 24px 12px;
        padding-top: calc(24px + env(safe-area-inset-top, 0px));
    }

    .menu-header {
        padding-top: 24px;
        margin-top: -24px;
    }

    .webview .btn-webview-back {
        top: 24px;
    }

    .menu-title {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .ru-catalog-summary {
        gap: 6px;
    }

    .ru-sort-control select {
        max-width: 132px;
    }

    .tabs-container {
        margin-bottom: 16px;
    }

    .tab {
        padding: 7px 10px;
        font-size: 10px;
    }

    .games-list {
        gap: 12px;
    }

    .game-card {
        padding: 14px;
        border-radius: 12px;
    }

    @media (hover: hover) {
        .game-card:hover {
            transform: translateY(-2px);
        }
    }

    .card-image {
        width: 72px;
        height: 72px;
        margin-right: 12px;
    }

    .card-header {
        margin-bottom: 4px;
    }

    .card-title {
        font-size: 16px;
    }

    .player-badge,
    .mode-badge {
        font-size: 11px;
        padding: 2px 8px;
    }

    .card-tags {
        padding-left: 84px;
        margin-top: 8px;
    }

    .card-favorite {
        top: 10px;
        right: 10px;
        font-size: 18px;
    }

    .card-description {
        font-size: 13px;
        line-height: 1.3;
    }
}

@media (max-height: 600px) {
    .menu-screen {
        padding: 20px 16px;
        padding-top: calc(20px + env(safe-area-inset-top, 0px));
    }

    .menu-header {
        padding-top: 20px;
        margin-top: -20px;
    }

    .webview .btn-webview-back {
        top: 20px;
    }

    .menu-title {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .card-image {
        width: 72px;
        height: 72px;
    }

}


/* Tablet and larger devices */
@media (min-width: 768px) {
    .games-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .game-card {
        flex-direction: column;
        padding: 20px;
        text-align: center;
    }

    .card-image {
        margin-right: 0;
        margin-bottom: 16px;
        width: 96px;
        height: 96px;
    }

    .card-content {
        width: 100%;
    }

    .card-header {
        justify-content: center;
        padding-left: 24px;
    }

    .card-title {
        font-size: 16px;
    }

    .card-description {
        font-size: 13px;
    }

    .card-tags {
        padding-left: 0;
        justify-content: center;
    }

    .card-favorite {
        top: 14px;
        right: 14px;
    }
}

/* ===== Onboarding ===== */
.onboarding-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: linear-gradient(180deg, #0d1329 0%, #0a0f1f 100%);
    display: none;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

@media (max-width: 360px) {
    #ru-catalog-summary-label {
        font-size: 0;
    }

    #ru-catalog-summary-label::after {
        content: attr(data-short-label);
        font-size: 11px;
    }

    .ru-sort-control select {
        max-width: 122px;
        font-size: 10.5px;
    }
}
.ru-onboarding-recommendations>p{margin:0 0 12px;color:#aeb7d8}.ru-onboarding-recommendation{display:grid;grid-template-columns:48px minmax(0,1fr) 24px;align-items:center;gap:10px;width:100%;padding:8px 10px;margin-bottom:7px;border:1px solid rgba(255,255,255,.1);border-radius:12px;background:rgba(255,255,255,.045);font:inherit;text-align:left}.ru-onboarding-recommendation.selected{border-color:rgba(124,113,255,.72);background:rgba(99,91,255,.14)}.ru-onboarding-recommendation-icon{display:grid;place-items:center;width:48px;height:48px;border-radius:10px;overflow:hidden;background:#202948}.ru-onboarding-recommendation-icon img,.ru-onboarding-recommendation-icon .card-icon-emoji{width:100%;height:100%;object-fit:cover}.ru-onboarding-recommendation-copy{min-width:0;display:flex;flex-direction:column;gap:3px}.ru-onboarding-recommendation strong{font-size:14px;color:#fff}.ru-onboarding-recommendation-copy>span{font-size:12px;line-height:1.3;color:#9fa9cc;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden}.ru-onboarding-recommendation-check{display:grid;place-items:center;width:22px;height:22px;border:1px solid rgba(255,255,255,.2);border-radius:7px;color:transparent}.ru-onboarding-recommendation.selected .ru-onboarding-recommendation-check{border-color:#736cff;background:#736cff;color:#fff}.onboarding-btn:disabled{opacity:.45;cursor:not-allowed}

.onboarding-bubbles {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.onboarding-bubble {
    position: absolute;
    bottom: -12px;
    left: var(--x);
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    background: rgba(255, 255, 255, var(--opacity));
    animation: onboardingBubbleFloat var(--duration) var(--delay) linear infinite;
}

@keyframes onboardingBubbleFloat {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10%,
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(calc(-100dvh - 24px)) translateX(calc(var(--drift) * 1px));
        opacity: 0;
    }
}

.onboarding-overlay.visible {
    display: flex;
}

.onboarding-overlay.hiding {
    display: flex;
    animation: onboardingFadeOut 0.4s ease forwards;
}

.onboarding-paywall-overlay {
    position: fixed;
    inset: 0;
    z-index: 11000;
    display: flex;
    justify-content: center;
    background: #0d1329;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}

.onboarding-paywall-status {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    width: 100%;
    max-width: 430px;
    margin: 0 auto;
    padding: calc(24px + env(safe-area-inset-top, 0px)) 24px calc(24px + env(safe-area-inset-bottom, 0px));
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(180deg, #0d1329 0%, #0a0f1f 100%);
    transition: opacity 0.2s ease;
}

.onboarding-paywall-status-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    width: min(100%, 320px);
}

.onboarding-paywall-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(255, 255, 255, 0.12);
    border-top-color: #ff3b6f;
    border-radius: 50%;
    animation: onboardingPaywallSpin 0.8s linear infinite;
}

.onboarding-paywall-status-text {
    margin: 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.45;
}

.onboarding-paywall-error-actions {
    display: none;
    width: 100%;
    gap: 10px;
}

.onboarding-paywall-error-actions button {
    flex: 1;
    min-height: 48px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.onboarding-paywall-error-actions .onboarding-paywall-retry {
    border-color: transparent;
    background: linear-gradient(135deg, #ff3b6f, #d92d61);
}

.onboarding-paywall-close {
    position: absolute;
    top: calc(16px + env(safe-area-inset-top, 0px));
    right: 16px;
    display: flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    font-size: 27px;
    line-height: 1;
    cursor: pointer;
}

.onboarding-paywall-overlay.is-error .onboarding-paywall-spinner {
    display: none;
}

.onboarding-paywall-overlay.is-error .onboarding-paywall-error-actions {
    display: flex;
}

.onboarding-paywall-overlay.is-ready .onboarding-paywall-status {
    opacity: 0;
    pointer-events: none;
}

.onboarding-paywall-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.onboarding-paywall-overlay.hiding {
    opacity: 0;
    pointer-events: none;
}

.onboarding-paywall-frame {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 430px;
    min-height: 100vh;
    min-height: 100dvh;
    border: 0;
    background: #0d1329;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.onboarding-paywall-overlay.is-ready .onboarding-paywall-frame {
    opacity: 1;
}

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

@keyframes onboardingFadeOut {
    to { opacity: 0; }
}

.onboarding-screen {
    position: relative;
    z-index: 1;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 400px;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 40px 24px;
    padding-top: calc(40px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
    text-align: center;
    animation: onboardingSlideIn 0.35s ease;
}

.onboarding-screen.active {
    display: flex;
}

@keyframes onboardingSlideIn {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

.onboarding-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.onboarding-hero {
    font-size: 72px;
    margin-bottom: 24px;
    line-height: 1;
}

.onboarding-hero svg {
    display: block;
    width: 96px;
    height: 96px;
    margin: 0 auto;
}

.onboarding-title {
    font-size: 26px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 12px;
    line-height: 1.25;
}

.onboarding-desc {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.5;
    max-width: 320px;
}

.onboarding-btn {
    width: 100%;
    padding: 18px;
    border: none;
    border-radius: 30px;
    background: linear-gradient(135deg, #ff3b6f, #cc2f59);
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.2s;
    box-shadow: 0 4px 20px rgba(255, 59, 111, 0.3);
}

.onboarding-btn:active {
    transform: scale(0.97);
}

.onboarding-btn-premium {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

.onboarding-btn-skip {
    width: 100%;
    padding: 14px;
    margin-top: 12px;
    border: none;
    border-radius: 30px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.2s;
}

.onboarding-btn-skip:active {
    color: #fff;
}

/* Player count options */
.onboarding-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    width: 100%;
    margin-top: 32px;
}

.onboarding-players .onboarding-option {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    background: var(--bg-secondary);
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.onboarding-players .onboarding-option:active {
    transform: scale(0.95);
}

.onboarding-players .onboarding-option.selected {
    border-color: var(--accent-pink);
    background: linear-gradient(135deg, rgba(255, 59, 111, 0.2), rgba(74, 108, 247, 0.1));
    box-shadow: 0 0 20px rgba(255, 59, 111, 0.2);
}

/* Genre options */
.onboarding-genres {
    flex-direction: column;
    gap: 12px;
}

.onboarding-genre {
    width: 100%;
    padding: 18px 20px;
    border-radius: 16px;
    border: 2px solid rgba(255, 255, 255, 0.12);
    background: var(--bg-secondary);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: left;
    font-family: inherit;
    transition: all 0.2s;
}

.onboarding-genre:active {
    transform: scale(0.98);
}

.onboarding-genre.selected {
    border-color: var(--accent-pink);
    background: linear-gradient(135deg, rgba(255, 59, 111, 0.15), rgba(74, 108, 247, 0.08));
}

.onboarding-genre-emoji {
    font-size: 34px;
    flex-shrink: 0;
    line-height: 1;
    color: var(--accent-pink);
}

.onboarding-genre-label {
    font-size: 17px;
    font-weight: 700;
    display: block;
}

/* «Откуда вы о нас узнали?»: three columns of answer tiles (logo over the name), same surface as the genre buttons.
   Logos come from brand-icons.css (.rp-brand) and ui-icons.css (.rp-icon) for the generic answers. */
.onboarding-sources {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 24px;
}

.onboarding-source {
    min-height: 84px;
    padding: 12px 6px 10px;
    border-radius: 16px;
    border: 2px solid rgba(255, 255, 255, 0.12);
    background: var(--bg-secondary);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    line-height: 1.2;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    overflow-wrap: anywhere;
    transition: transform 0.2s, border-color 0.2s, background 0.2s;
}

.onboarding-source-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 28px;
    line-height: 1;
}

.onboarding-source-icon .rp-icon {
    color: var(--accent-pink);
}

/* App Store + Google Play share one tile, so each logo is a bit smaller */
.onboarding-source[data-source="stores"] .rp-brand {
    font-size: 24px;
}

.onboarding-source-label {
    display: block;
    max-width: 100%;
}

@media (max-width: 360px) {
    .onboarding-sources {
        gap: 8px;
    }

    .onboarding-source {
        padding: 10px 3px 8px;
        font-size: 12px;
    }
}

.onboarding-source:active {
    transform: scale(0.97);
}

.onboarding-source.selected {
    border-color: var(--accent-pink);
    background: linear-gradient(135deg, rgba(255, 59, 111, 0.15), rgba(74, 108, 247, 0.08));
}

.onboarding-source:focus-visible,
.onboarding-btn-skip:focus-visible {
    outline: 2px solid var(--accent-pink);
    outline-offset: 2px;
}


/* Progress bar */
.onboarding-loading-content {
    gap: 16px;
}

.onboarding-loading-emoji {
    font-size: 56px;
    line-height: 1;
    color: var(--accent-pink);
    animation: onboardingPulse 1.5s ease-in-out infinite;
}

@keyframes onboardingPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.onboarding-progress-bar {
    width: 100%;
    max-width: 280px;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
    margin-top: 8px;
}

.onboarding-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-pink), var(--accent-blue));
    border-radius: 8px;
    transition: width 0.1s linear;
}

/* Discount wheel */
.onboarding-wheel-content {
    gap: 12px;
}

.onboarding-wheel-wrap {
    position: relative;
    width: min(78vw, 312px);
    aspect-ratio: 1;
    margin: 22px auto 10px;
    filter: drop-shadow(0 26px 42px rgba(0, 0, 0, 0.42));
    touch-action: none;
    cursor: grab;
    user-select: none;
}

.onboarding-wheel-wrap:active {
    cursor: grabbing;
}

.onboarding-wheel-pointer {
    position: absolute;
    top: -8px;
    left: 50%;
    z-index: 4;
    width: 34px;
    height: 40px;
    transform: translateX(-50%);
    background: linear-gradient(180deg, #ffffff 0%, #d8deef 100%);
    clip-path: polygon(50% 100%, 0 8%, 50% 0, 100% 8%);
    filter: drop-shadow(0 5px 9px rgba(0, 0, 0, 0.38));
}

.onboarding-wheel {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    display: block;
    transform: rotate(0deg);
    transform-origin: center;
    transition: transform 6.45s cubic-bezier(0.08, 0.76, 0.12, 1);
}

.wheel-rim {
    fill: #111831;
    stroke: rgba(255, 255, 255, 0.92);
    stroke-width: 8;
}

.wheel-sector {
    stroke: rgba(255, 255, 255, 0.78);
    stroke-width: 3;
    stroke-linejoin: round;
}

.wheel-sector-discount {
    fill: #ffd166;
}

.wheel-sector-premium {
    fill: #4a6cf7;
}

.wheel-sector-40 {
    fill: #ff3b6f;
}

.wheel-sector-30 {
    fill: #10b981;
}

.wheel-sector-20 {
    fill: #8b5cf6;
}

.wheel-sector-10 {
    fill: #ff6b35;
}

.wheel-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.28);
    stroke-width: 2;
}

.wheel-dot {
    fill: #ffffff;
    opacity: 0.9;
}

.wheel-label {
    transform-box: fill-box;
    transform-origin: center;
}

.wheel-text {
    fill: #ffffff;
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 0;
    text-anchor: middle;
    dominant-baseline: middle;
    paint-order: stroke;
    stroke: rgba(13, 19, 41, 0.36);
    stroke-width: 4;
    stroke-linejoin: round;
}

.wheel-text-premium {
    font-size: 11px;
    stroke-width: 3;
}

.wheel-text-discount-small {
    font-size: 11px;
    stroke-width: 3;
}

.wheel-text-main,
.wheel-text-premium-main,
.wheel-text-percent-main {
    font-size: 18px;
}

.onboarding-wheel.won {
    filter:
        drop-shadow(0 0 20px rgba(255, 209, 102, 0.36))
        drop-shadow(0 20px 36px rgba(0, 0, 0, 0.32));
}

.onboarding-wheel.dragging {
    transition: none;
}

.onboarding-wheel-center {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 3;
    width: 82px;
    height: 82px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.22), transparent 28%),
        linear-gradient(180deg, #151c36 0%, #0d1329 100%);
    border: 5px solid rgba(255, 255, 255, 0.92);
    color: #ffffff;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1.05;
    text-align: center;
    cursor: pointer;
    user-select: none;
    box-shadow:
        0 12px 26px rgba(0, 0, 0, 0.42),
        inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.onboarding-wheel-center:focus-visible {
    outline: 2px solid #ffd166;
    outline-offset: 4px;
}

.onboarding-wheel-result {
    min-height: 24px;
    color: #ffd166;
    font-size: 17px;
    font-weight: 800;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.onboarding-wheel-result.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Reviews */
.onboarding-reviews-screen {
    max-width: 430px;
}

.onboarding-reviews-content {
    gap: 14px;
}

.onboarding-reviews-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    margin-top: 8px;
}

.onboarding-review {
    width: 100%;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    text-align: left;
    opacity: 0;
    transform: translateY(18px);
}

.onboarding-screen.active .onboarding-review {
    animation: onboardingReviewIn 0.45s ease forwards;
}

.onboarding-screen.active .onboarding-review:nth-child(2) {
    animation-delay: 0.1s;
}

.onboarding-screen.active .onboarding-review:nth-child(3) {
    animation-delay: 0.2s;
}

.onboarding-review-stars {
    color: #ffd166;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.onboarding-review p {
    margin: 0;
    color: #ffffff;
    font-size: 14px;
    line-height: 1.45;
}

.onboarding-review span {
    display: block;
    margin-top: 10px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
}

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

/* Matched games */
.onboarding-games-screen {
    max-width: 760px;
}

.onboarding-games-content {
    position: relative;
    gap: 14px;
}

.onboarding-games-screen .onboarding-btn {
    max-width: 400px;
}

.onboarding-price-comparison,
.onboarding-benefits-comparison {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    margin-top: 2px;
}

.onboarding-compare-price-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 9px;
    text-align: left;
}

.onboarding-compare-heading {
    width: 100%;
    padding: 10px 13px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.68);
    font-size: 14px;
    font-weight: 900;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.onboarding-compare-heading-service {
    background: rgba(74, 108, 247, 0.18);
    color: #7fa0ff;
}

.onboarding-compare-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.onboarding-compare-list li {
    display: grid;
    grid-template-columns: 17px minmax(0, 1fr);
    gap: 6px;
    align-items: start;
}

.onboarding-compare-mark {
    display: block;
    font-size: 17px;
    font-weight: 950;
    line-height: 1.05;
    text-align: center;
}

.onboarding-compare-list-bad .onboarding-compare-mark {
    color: #ff6b7b;
}

.onboarding-compare-list-good .onboarding-compare-mark {
    color: #5ee38a;
}

.onboarding-compare-text {
    min-width: 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.25;
}

.onboarding-compare-list-good .onboarding-compare-text {
    color: #ffffff;
}

.onboarding-games-showcase {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    width: 100%;
    margin-top: 2px;
}

.onboarding-mini-games {
    position: relative;
    height: 252px;
    min-width: 0;
    overflow: hidden;
    border-radius: 8px;
}

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

.onboarding-mini-games::before {
    top: 0;
    height: 34px;
    background: linear-gradient(180deg, rgba(13, 19, 41, 0.96) 0%, rgba(13, 19, 41, 0.76) 42%, rgba(13, 19, 41, 0) 100%);
}

.onboarding-mini-games::after {
    bottom: 0;
    height: 42px;
    background: linear-gradient(0deg, rgba(13, 19, 41, 0.9) 0%, rgba(13, 19, 41, 0) 100%);
}

.onboarding-mini-games-track {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
    padding: 4px 0;
    transform: translateY(0);
    will-change: transform;
}

.onboarding-screen.active .onboarding-mini-games-track.can-scroll {
    animation: onboardingGamesScroll var(--stream-duration, 12800ms) ease-in-out infinite;
    animation-delay: 0.35s;
}

.onboarding-mini-game {
    width: auto;
    min-width: 0;
    max-width: 100%;
    min-height: 22px;
    padding: 3px 6px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.07);
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 0 1 auto;
    opacity: 0;
    transform: translateY(16px) scale(0.98);
    will-change: transform, opacity;
}

.onboarding-screen.active .onboarding-mini-game {
    animation: onboardingGameRowIn 0.28s cubic-bezier(0.18, 0.86, 0.25, 1) forwards;
    animation-delay: var(--delay);
}

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

.onboarding-mini-game span {
    min-width: 0;
    max-width: none;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.15;
    text-align: left;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
}

.onboarding-boxes-gif {
    width: min(148px, 100%);
    max-width: 100%;
    justify-self: center;
    object-fit: contain;
    filter: drop-shadow(0 16px 28px rgba(0, 0, 0, 0.38));
}

.onboarding-price-card {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
}

.onboarding-coupon-head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    padding-bottom: 2px;
    text-align: left;
}

.onboarding-coupon-head span {
    color: #b7f3bd;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.onboarding-coupon-head strong {
    max-width: 100%;
    padding: 6px 9px;
    border-radius: 8px;
    background: rgba(129, 199, 132, 0.12);
    color: #b7f3bd;
    font-size: 14px;
    font-weight: 900;
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.onboarding-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    text-align: left;
}

.onboarding-price-row span {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
}

.onboarding-price-row strong {
    color: #ffffff;
    font-size: 14px;
    font-weight: 900;
    line-height: 1.2;
    text-align: right;
    white-space: nowrap;
}

.onboarding-price-row-discount strong {
    color: #ffffff;
}

.onboarding-price-old {
    color: rgba(255, 255, 255, 0.58);
    text-decoration: line-through;
    text-decoration-color: rgba(255, 59, 111, 0.96);
    text-decoration-thickness: 2px;
}

.onboarding-coupon-price {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
}

.onboarding-coupon-price s {
    color: rgba(255, 255, 255, 0.52);
    font-size: 13px;
    font-weight: 800;
    text-decoration-color: rgba(255, 59, 111, 0.95);
    text-decoration-thickness: 2px;
}

.onboarding-coupon-price b {
    color: #b7f3bd;
    font-size: 17px;
    font-weight: 950;
}

@keyframes onboardingGamesScroll {
    0%, 10% {
        transform: translateY(0);
    }
    45%, 55% {
        transform: translateY(var(--stream-shift, -760px));
    }
    90%, 100% {
        transform: translateY(0);
    }
}

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

@media (max-width: 420px) {
    .onboarding-games-screen {
        padding-left: 16px;
        padding-right: 16px;
    }

    .onboarding-games-content {
        gap: 12px;
    }

    .onboarding-price-comparison,
    .onboarding-benefits-comparison {
        gap: 10px;
    }

    .onboarding-compare-price-card {
        gap: 9px;
    }

    .onboarding-compare-heading {
        padding: 8px 9px;
        font-size: 12px;
    }

    .onboarding-compare-list {
        gap: 8px;
    }

    .onboarding-compare-list li {
        grid-template-columns: 15px minmax(0, 1fr);
        gap: 5px;
    }

    .onboarding-compare-mark {
        font-size: 15px;
    }

    .onboarding-compare-text {
        font-size: 11.5px;
    }

    .onboarding-games-showcase {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 8px;
    }

    .onboarding-mini-games {
        height: 232px;
    }

    .onboarding-mini-game {
        min-height: 20px;
        padding: 3px 5px;
    }

    .onboarding-mini-game img {
        width: 13px;
        height: 13px;
    }

    .onboarding-mini-game span {
        font-size: 9.5px;
        max-width: none;
    }

    .onboarding-boxes-gif {
        width: min(112px, 100%);
        max-width: 100%;
    }

    .onboarding-price-card {
        padding: 10px;
    }

    .onboarding-price-row strong {
        font-size: 13px;
    }

    .onboarding-coupon-head strong {
        font-size: 12px;
    }

    .onboarding-coupon-price b {
        font-size: 16px;
    }

}

@media (max-height: 700px) {
    .onboarding-price-comparison,
    .onboarding-benefits-comparison {
        gap: 10px;
    }

    .onboarding-compare-price-card {
        gap: 8px;
    }

    .onboarding-compare-heading {
        padding: 8px 10px;
    }

    .onboarding-compare-list {
        gap: 7px;
    }

    .onboarding-mini-games {
        height: 204px;
    }

    .onboarding-games-content {
        gap: 10px;
    }

    .onboarding-price-row span {
        font-size: 11px;
    }

    .onboarding-price-row strong {
        font-size: 13px;
    }
}

/* Paywall features */
.onboarding-features {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 28px;
    width: 100%;
    text-align: left;
}

.onboarding-feature {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.85);
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

/* Keep applied RU filters on one compact, horizontally scrollable line. */
.ru-active-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-inline: contain;
}

.ru-active-filters::-webkit-scrollbar {
    display: none;
}

.ru-active-filters button {
    flex: 0 0 auto;
}

/* RU catalog toolbar: search, filter and favorites share one compact row. */
.ru-catalog .ru-catalog-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px 42px;
    align-items: center;
    gap: 8px;
}

.ru-catalog .ru-search-wrap {
    grid-column: 1;
    min-width: 0;
    min-height: 42px;
    padding-inline: 11px;
}

.ru-catalog .ru-control-row {
    display: contents;
}

.ru-catalog .ru-control-chip {
    min-height: 42px;
}

.ru-catalog .ru-filter-trigger {
    position: relative;
    grid-column: 2;
    display: inline-grid;
    place-items: center;
    width: 42px;
    padding: 0;
    border-radius: 13px;
}

.ru-catalog .ru-filter-icon {
    width: 19px;
    height: 19px;
}

.ru-catalog .ru-filter-trigger .ru-count {
    position: absolute;
    top: -5px;
    right: -5px;
    margin: 0;
    box-shadow: 0 0 0 2px var(--bg-primary);
}

/* These RU-catalog blocks set display, which beats the `hidden` attribute, so hidden needs its own rule.
   Without it the Russian toolbar and room bar leak into every other language's catalog. */
.ru-catalog-controls[hidden],
.ru-room-control[hidden],
.ru-count[hidden] {
    display: none;
}

.ru-catalog #ru-favorites-button {
    position: relative;
    grid-column: 3;
    display: inline-grid;
    place-items: center;
    width: 42px;
    padding: 0;
    border-radius: 13px;
}

.ru-catalog .ru-favorites-star {
    display: block;
    flex: none;
}

/* Same SVG heart: outline when off, filled when the favourites filter is on. */
.ru-catalog #ru-favorites-button.active .ru-favorites-star {
    color: #ff4d6d;
    fill: currentColor;
}

.ru-catalog #ru-favorites-button .ru-count {
    position: absolute;
    top: -5px;
    right: -5px;
    margin: 0;
    box-shadow: 0 0 0 2px var(--bg-primary);
}

.ru-catalog .ru-active-filters,
.ru-catalog .ru-catalog-summary {
    grid-column: 1 / -1;
}

.ru-catalog .ru-sort-control {
    margin-right: 4px;
}

.ru-catalog .ru-sort-control select {
    width: 156px;
    max-width: 156px;
    padding-right: 24px;
}

/* Persistent room action returns to the bottom edge of the catalog.
   Opaque and centered without transform/backdrop-filter: Chrome iOS leaves stale
   composited tiles of blurred fixed layers while its toolbar collapses on scroll. */
.ru-catalog .ru-room-control {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    width: 100%;
    max-width: 430px;
    box-sizing: border-box;
    align-items: stretch;
    gap: 8px;
    margin: 0 auto;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    background: var(--bg-primary);
    border-top: 1px solid rgba(139, 92, 246, 0.3);
}

/* Chrome iOS hides its bottom toolbar on document scroll without growing the
   layout viewport and clips fixed layers to it, so a bottom:0 bar floats above a
   strip of cards. The catalog scrolls inside .menu-screen instead: the document
   never scrolls, browser toolbars stay put and the bar stays docked. */
html.ru-catalog,
html.ru-catalog body {
    height: 100%;
    overflow: hidden;
}

.ru-catalog .menu-screen {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 430px;
    min-height: 0;
    margin: 0 auto;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* The document never scrolls in the shell catalog, so the settings screen needs
   its own scroll container too, or its lower rows are cut off on short screens. */
.ru-catalog .settings-screen {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 430px;
    min-height: 0;
    margin: 0 auto;
    padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* Inside a scroll container sticky offsets start at its padding edge, so cancel
   the .menu-screen top padding to keep the header pinned under the safe area. */
.ru-catalog .menu-header {
    top: -40px;
}

@media (max-width: 480px) {
    .ru-catalog .menu-header {
        top: -24px;
    }
}

@media (max-height: 600px) {
    .ru-catalog .menu-header {
        top: -20px;
    }
}

.ru-catalog .games-list,
.ru-catalog .games-list.has-join-banner {
    padding-bottom: 78px;
}

/* «Nothing found»: the empty list gives its room-bar space to the state under it. */
.ru-catalog .games-list.is-search-empty,
.ru-catalog .games-list.catalog-search-popular { padding-bottom: 0; }
.ru-catalog .catalog-search-empty { padding-bottom: 78px; }

.game-template-bg {
    background:
        linear-gradient(rgba(61, 230, 255, .11) 1px, transparent 1px),
        linear-gradient(90deg, rgba(61, 230, 255, .11) 1px, transparent 1px),
        radial-gradient(circle at 72% 20%, rgba(61, 230, 255, .34), transparent 48%),
        #101a32;
    background-size: 14px 14px, 14px 14px, auto, auto;
}

/* Catalog light motion in the RoomPlay rhythm (same as «Я никогда не»): cards arrive in a short wave,
   spring press/settle, tab and artwork feedback. Decorative only; the catalog is usable immediately. */
@media (prefers-reduced-motion: no-preference) {
    :root { --rp-press: 100ms; --rp-settle: 240ms; --rp-spring: cubic-bezier(.2, .9, .3, 1.25); }
    .games-list .game-card { animation: rp-card-arrive 320ms var(--rp-spring) both; transition: transform var(--rp-settle) var(--rp-spring), background-color 200ms ease, border-color 200ms ease; }
    .games-list .game-card:nth-child(2) { animation-delay: 25ms; }
    .games-list .game-card:nth-child(3) { animation-delay: 50ms; }
    .games-list .game-card:nth-child(4) { animation-delay: 75ms; }
    .games-list .game-card:nth-child(5) { animation-delay: 100ms; }
    .games-list .game-card:nth-child(6) { animation-delay: 125ms; }
    .games-list .game-card:nth-child(7) { animation-delay: 150ms; }
    .games-list .game-card:nth-child(n+8) { animation-delay: 175ms; }
    .game-card:active { transform: scale(.97) translateY(2px); transition-duration: var(--rp-press); }
    .game-card:active .card-image { animation: rp-art-nod 360ms ease-out; }
    /* A tapped card (index.html launchGameCard): press in and spring out while the tap sound plays, the art nods. */
    .menu-screen .game-card.is-launching { animation: rp-card-launch 300ms var(--rp-spring) both; }
    .menu-screen .game-card.is-launching .card-image { animation: rp-art-nod 360ms ease-out; }
    .tab { transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform var(--rp-settle) var(--rp-spring); }
    .tab:active { transform: scale(.94); transition-duration: var(--rp-press); }
    .tab.active { animation: rp-tab-select 260ms var(--rp-spring); }
    /* RU filters: the sheet slides up / down, chips spring on press and pop when picked,
       applied-filter chips and the counter badge arrive. */
    .ru-filter-sheet:not([hidden]) .ru-filter-backdrop { animation: rp-fade-in 220ms ease-out both; }
    .ru-filter-sheet:not([hidden]) .ru-filter-panel { animation: rp-sheet-up 320ms cubic-bezier(.2, .9, .3, 1) both; }
    .ru-filter-sheet.is-closing .ru-filter-backdrop { animation: rp-fade-out 180ms ease-in both; }
    .ru-filter-sheet.is-closing .ru-filter-panel { animation: rp-sheet-down 200ms ease-in both; }
    .ru-filter-sheet:not([hidden]) .ru-filter-panel fieldset { animation: rp-card-arrive 300ms var(--rp-spring) both; }
    .ru-filter-sheet:not([hidden]) .ru-filter-panel fieldset:nth-of-type(2) { animation-delay: 40ms; }
    .ru-filter-sheet:not([hidden]) .ru-filter-panel fieldset:nth-of-type(3) { animation-delay: 80ms; }
    .ru-filter-options button, .ru-control-chip, .ru-active-filters button, .ru-filter-apply, .ru-filter-reset { transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform var(--rp-settle) var(--rp-spring); }
    .ru-filter-options button:active, .ru-control-chip:active, .ru-active-filters button:active, .ru-filter-apply:active, .ru-filter-reset:active { transform: scale(.94); transition-duration: var(--rp-press); }
    .ru-filter-options button.selected { animation: rp-tab-select 260ms var(--rp-spring); }
    .ru-filter-apply.is-updated { animation: rp-tab-select 260ms var(--rp-spring); }
    .ru-active-filters button { animation: rp-chip-arrive 260ms var(--rp-spring) both; }
    .ru-active-filters button:nth-child(2) { animation-delay: 30ms; }
    .ru-active-filters button:nth-child(n+3) { animation-delay: 60ms; }
    .ru-filter-trigger .ru-count:not([hidden]), #ru-favorites-button.active { animation: rp-tab-select 260ms var(--rp-spring); }
}
@keyframes rp-card-arrive { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes rp-card-launch { 0% { transform: scale(.97) translateY(2px); } 40% { transform: scale(.94) translateY(3px); } 75% { transform: scale(1.015); } 100% { transform: none; } }
@keyframes rp-art-nod { 0%, 100% { rotate: 0deg; } 35% { rotate: -6deg; } 70% { rotate: 4deg; } }
@keyframes rp-tab-select { 0% { transform: scale(.92); } 60% { transform: scale(1.05); } 100% { transform: scale(1); } }
@keyframes rp-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rp-fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes rp-sheet-up { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }
@keyframes rp-sheet-down { from { transform: translate(-50%, 0); } to { transform: translate(-50%, 100%); } }
@keyframes rp-chip-arrive { from { opacity: 0; transform: translateX(-8px) scale(.9); } to { opacity: 1; transform: none; } }

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

/* Main menu shell motion in the same RoomPlay rhythm: the language and settings buttons spring on press,
   the flag tilts while its list is open and the gear turns; the language list pops out of its button with
   options arriving in a short wave and pops back on close; Settings slides in with its rows arriving in a
   wave (Premium crown wiggles once) and slides out on Back, after which the catalog fades back in.
   Decorative only: nothing waits for an animation, and reduced motion keeps everything static. */
@media (prefers-reduced-motion: no-preference) {
    .menu-language-button, .menu-settings-button { transition: background-color 180ms ease, border-color 180ms ease, transform var(--rp-settle) var(--rp-spring); }
    .menu-language-button:active, .menu-settings-button:active { transform: scale(.9); transition-duration: var(--rp-press); }
    .menu-language-button > span { display: inline-block; transition: rotate 320ms var(--rp-spring), scale 320ms var(--rp-spring); }
    .menu-language-button[aria-expanded="true"] > span { rotate: -10deg; scale: 1.12; }
    .menu-language-button.is-changed > span { animation: rp-tab-select 260ms var(--rp-spring); }
    .menu-settings-button svg { transition: transform 480ms var(--rp-spring); }
    .menu-settings-button:active svg { transform: rotate(60deg); transition-duration: 160ms; }
    @media (hover: hover) and (pointer: fine) {
        .menu-language-button:hover > span { rotate: -6deg; scale: 1.06; }
        .menu-settings-button:hover svg { transform: rotate(45deg); }
    }
    .menu-language-popover { transform-origin: 21px 0; }
    .menu-language-popover:not([hidden]) { animation: rp-popover-in 240ms var(--rp-spring) both; }
    .menu-language-popover.is-closing { animation: rp-popover-out 150ms ease-in both; pointer-events: none; }
    .menu-language-popover:not([hidden]):not(.is-closing) .menu-language-option { animation: rp-option-arrive 260ms var(--rp-spring) both; animation-delay: calc(var(--rp-i, 0) * 18ms + 40ms); }
    /* Press feedback uses the individual scale/rotate properties: the arrival animation owns transform. */
    .menu-language-option { transition: background-color 160ms ease, scale var(--rp-settle) var(--rp-spring); }
    .menu-language-option:active { scale: .96; transition-duration: 160ms, var(--rp-press); }
    .menu-language-option-flag { display: inline-block; transition: rotate 260ms var(--rp-spring), scale 260ms var(--rp-spring); }
    .menu-language-option:active .menu-language-option-flag, .menu-language-option.is-chosen .menu-language-option-flag { rotate: -12deg; scale: 1.2; }

    .settings-screen:not([hidden]) { animation: rp-screen-in 300ms cubic-bezier(.2, .9, .3, 1) both; }
    .settings-screen.is-closing { animation: rp-screen-out 200ms ease-in both; pointer-events: none; }
    .settings-screen:not([hidden]):not(.is-closing) .settings-header h2 { animation: rp-card-arrive 300ms var(--rp-spring) both; animation-delay: 40ms; }
    .settings-screen:not([hidden]):not(.is-closing) .settings-row { animation: rp-card-arrive 320ms var(--rp-spring) both; animation-delay: 80ms; }
    .settings-screen:not([hidden]):not(.is-closing) .settings-row ~ .settings-row { animation-delay: 130ms; }
    .settings-screen:not([hidden]):not(.is-closing) .settings-row-icon { animation: rp-icon-pop 420ms var(--rp-spring) both; animation-delay: 180ms; }
    .settings-screen:not([hidden]):not(.is-closing) .settings-row ~ .settings-row .settings-row-icon { animation-delay: 230ms; }
    .settings-screen:not([hidden]):not(.is-closing) .settings-premium-row .settings-row-icon { animation: rp-icon-pop 420ms var(--rp-spring) 180ms both, rp-art-nod 520ms ease-out 620ms; }
    /* The pearl Premium row arrives like the others, then starts the shared pearl tilt (premium-cta.css). */
    .settings-screen:not([hidden]):not(.is-closing) .settings-premium-row { animation: rp-card-arrive 320ms var(--rp-spring) 80ms both, rp-pearl-tilt 4.8s ease-in-out 400ms infinite, rp-pearl-shift 4.8s ease-in-out 400ms infinite; }
    .settings-row { transition: background-color 180ms ease, border-color 180ms ease, scale var(--rp-settle) var(--rp-spring), translate var(--rp-settle) var(--rp-spring); }
    .settings-row:active { scale: .97; translate: 0 2px; transition-duration: 180ms, 180ms, var(--rp-press), var(--rp-press); }
    .settings-row-icon { transition: scale var(--rp-settle) var(--rp-spring); }
    .settings-row:active .settings-row-icon { scale: .86; transition-duration: var(--rp-press); }
    .settings-row-chevron { transition: translate var(--rp-settle) var(--rp-spring); }
    .settings-row:active .settings-row-chevron { translate: 4px 0; transition-duration: var(--rp-press); }
    .settings-back-button { transition: opacity 200ms ease, transform var(--rp-settle) var(--rp-spring); }
    .settings-back-button:active { transform: translateX(-4px) scale(.88); transition-duration: var(--rp-press); }

    .menu-screen.is-returning { animation: rp-fade-in 220ms ease-out both; }
    .menu-screen.is-returning .roomplay-menu-topbar { animation: rp-screen-back 300ms cubic-bezier(.2, .9, .3, 1) both; }
}
@keyframes rp-popover-in { from { opacity: 0; transform: translateY(-6px) scale(.86); } to { opacity: 1; transform: none; } }
@keyframes rp-popover-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-4px) scale(.92); } }
@keyframes rp-option-arrive { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
@keyframes rp-screen-in { from { opacity: 0; transform: translateX(32px); } to { opacity: 1; transform: none; } }
@keyframes rp-screen-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateX(32px); } }
@keyframes rp-screen-back { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: none; } }
@keyframes rp-icon-pop { 0% { opacity: 0; transform: scale(.4) rotate(-14deg); } 65% { opacity: 1; transform: scale(1.12) rotate(4deg); } 100% { opacity: 1; transform: none; } }

/* Room code typed into the game search (index.html findRoomByCode): «Войти в комнату EDQX» above the results,
   in the colours of the room bar. */
.catalog-room-hit {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 60px;
    margin: 0 4px 14px;
    padding: 10px 14px;
    border: 1px solid rgba(139, 92, 246, 0.45);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.22), rgba(139, 92, 246, 0.12));
    color: #eef0ff;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}
.catalog-room-hit[hidden] { display: none; }
.catalog-room-hit:active { transform: scale(0.98); }
.catalog-room-hit-dot {
    flex: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 12px rgba(52, 211, 153, 0.65);
}
.catalog-room-hit-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.catalog-room-hit-text strong { font-size: 16px; font-weight: 750; overflow-wrap: anywhere; }
.catalog-room-hit-text small { color: #b8bfdc; font-size: 13px; font-weight: 600; }
.catalog-room-hit-text small[hidden] { display: none; }
.catalog-room-hit-chevron { margin-left: auto; color: #9da7ca; font-size: 24px; line-height: 1; }
/* Seasonal pill (catalog-search-intents.js SEASONS): the room pill with a pumpkin-orange dot. */
.catalog-season-hit { width: calc(100% - 8px); font: inherit; text-align: left; cursor: pointer; }
.catalog-season-hit .catalog-room-hit-dot { background: #f28a1e; box-shadow: 0 0 12px rgba(242, 138, 30, 0.65); }
/* The room is the answer: no «nothing here» note under it. */
.catalog-room-found .favorites-empty,
.catalog-room-found .catalog-search-empty { display: none; }

/* Catalog search: the header over an intent pick («couples» → «Great for two») and the «nothing found» state.
   Same type as the spotlight header above the list; the cards are the catalog's own .game-card. */
.catalog-search-intent[hidden], .catalog-search-empty[hidden] { display: none; }
.catalog-search-intent { margin: 2px 4px 12px; }
.catalog-search-intent h2 { margin: 0; color: #7f8cff; font-size: 14px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.catalog-search-intent p { margin: 4px 0 0; color: #aeb7d8; font-size: 12px; }
.catalog-search-empty { display: flex; flex-direction: column; margin: 4px 0 0; }
.catalog-search-empty-title { margin: 6px 4px 22px; color: #d9def4; font-size: 16px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.catalog-search-empty-title strong { color: #fff; font-weight: 900; }
@media (prefers-reduced-motion: no-preference) {
    .catalog-room-hit:not([hidden]) { animation: catalog-room-hit-in 220ms ease-out both; }
    @keyframes catalog-room-hit-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
}

/* Halloween (until 2026-11-01, class set in games/index.html): night palette, pumpkin-orange titles, faint
   a corner web in the sticky header and an orange season pill. Decoration only: layout and components stay as they are. */
html.season-halloween {
    --bg-primary: #150d26;
    --bg-secondary: #23163a;
    --bg-card: #2e1d4a;
    --accent-pink: #ff8a1f;
}
html.season-halloween body {
    background: radial-gradient(120% 60% at 50% 110%, rgba(242, 138, 30, 0.22), transparent 60%), linear-gradient(180deg, #1b0f30 0%, #0c0717 100%);
}
html.season-halloween .menu-header {
    background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPScxMTAnIGhlaWdodD0nMTEwJyB2aWV3Qm94PScwIDAgMTEwIDExMCcgZmlsbD0nbm9uZScgc3Ryb2tlPScjZDhjOGZmJyBzdHJva2Utb3BhY2l0eT0nLjE4JyBzdHJva2Utd2lkdGg9JzEuMic+PHBhdGggZD0nTTExMCAwTDAgMzZNMTEwIDBMMjggODJNMTEwIDBMNzQgMTEwJy8+PHBhdGggZD0nTTgyIDlRODggMjAgOTAgMjhROTcgMjQgMTAzIDI4TTU2IDE4UTY2IDM4IDcwIDU2UTg2IDQ4IDk4IDU2TTI4IDI4UTQ0IDU0IDUwIDg0UTcyIDcyIDkwIDg0Jy8+PC9zdmc+);
    background-repeat: no-repeat;
    background-position: right top;
    background-size: 110px 110px;
}
html.season-halloween .game-card { box-shadow: inset 0 0 0 1px rgba(242, 138, 30, 0.14); }
html.season-halloween .catalog-season-hit {
    border-color: rgba(242, 138, 30, 0.55);
    background: linear-gradient(135deg, rgba(242, 138, 30, 0.26), rgba(139, 92, 246, 0.14));
}
html.season-halloween .catalog-search-intent h2 { color: #ff8a1f; }

/* Communities in settings (owner 2026-12-03): tiles two per row right under Premium, official brand logos
 * (Telegram #2AABEE, Discord #5865F2 on white). Same press, sound and dark fill as the other settings rows. */
.settings-community-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

/* Low tiles (owner «почему такие высокие?»): logo left of the text, one line title. Words wrap only at spaces. */
.settings-row.settings-community-tile {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
}

/* Odd tile (Support) takes the whole last row. */
.settings-community-tile:last-child:nth-child(odd) { grid-column: 1 / -1; }

.settings-community-logo {
    display: flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: #fff;
    transition: scale var(--rp-press, 120ms);
}

.settings-community-logo svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.settings-community-tile--telegram .settings-community-logo { background: #2aabee; }
.settings-community-tile--discord .settings-community-logo { background: #5865f2; }

.settings-community-tile .settings-row-copy { gap: 2px; }
.settings-community-tile .settings-row-copy strong { font-size: 14px; line-height: 1.2; overflow-wrap: normal; }

@media (prefers-reduced-motion: no-preference) {
    .settings-community-tile:active .settings-community-logo { scale: .86; }
}
