/* PWA overrides: app-like shell without backend changes */

/* ── PWA: lang-gate скрываем; 18+ остаётся (legal) ── */
html.pwa-loading #lang-gate,
body.crave-pwa-mode #lang-gate {
    display: none !important;
    pointer-events: none !important;
    visibility: hidden !important;
}

/* Кастомный скроллбар — тонкий, тёмно-красный */
body.crave-pwa-mode ::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

body.crave-pwa-mode ::-webkit-scrollbar-track {
    background: rgba(8, 5, 8, 0.4);
    border-radius: 4px;
}

body.crave-pwa-mode ::-webkit-scrollbar-thumb {
    background: rgba(120, 16, 16, 0.65);
    border-radius: 4px;
}

body.crave-pwa-mode ::-webkit-scrollbar-thumb:hover {
    background: rgba(170, 24, 24, 0.85);
}

body.crave-pwa-mode {
    scrollbar-width: thin;
    scrollbar-color: rgba(120, 16, 16, 0.65) rgba(8, 5, 8, 0.4);
}

#installBanner {
    display: none !important;
}

#installBanner button {
    border: 1px solid rgba(120, 20, 20, 0.3);
    background: rgba(10, 8, 9, 0.72);
    color: #efe9e9;
    border-radius: 8px;
    padding: 6px 12px;
    cursor: pointer;
}

#craveIosHintSheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
    background: rgba(10, 8, 9, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(120, 20, 20, 0.28);
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
}

#craveIosHintSheet .title {
    margin: 0 0 8px;
    color: #d7d1d1;
    font-size: 0.9rem;
}

#craveIosHintSheet .row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: #c3bcbc;
    font-size: 0.85rem;
    line-height: 1.35;
}

#craveIosHintSheet .close {
    margin-top: 10px;
    width: 100%;
    border: 1px solid rgba(120, 20, 20, 0.3);
    background: rgba(10, 8, 9, 0.72);
    color: #efe9e9;
    border-radius: 8px;
    padding: 8px 12px;
}

.site-header.site-header-pill {
    position: fixed;
    top: 16px;
    left: 16px;
    right: 16px;
    z-index: 1200;
    padding: 0;
}

.site-header.site-header-pill .header-pill {
    position: relative;
    height: 64px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(10, 8, 9, 0.78);
    border: 1px solid rgba(120, 20, 20, 0.22);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.site-header.site-header-pill .logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    pointer-events: none;
    font-size: 1.2rem;
    line-height: 1;
}

.header-pill-menu .menu-btn {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* style.css hides the menu trigger at ≤1200px — restore it in site mode */
/* style.css also sets order:1 on it (puts it after pill-right) — force it back to the left */
body.crave-site-mode .site-header-pill .header-pill-menu {
    display: flex !important;
    order: -1 !important;
}

/* pill-right in site mode: no auto-margin; username is already hidden so no overflow risk */
body.crave-site-mode .site-header-pill .header-pill-right {
    margin-left: 0 !important;
    overflow: visible;
    max-width: none;
}

/* In site mode, username badge is a PWA/app feature — hide it */
body.crave-site-mode .header-username {
    display: none !important;
}

.header-pill-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

/* Hide username when empty (no user logged in) */
.header-username:empty {
    display: none !important;
}

.header-pill-lang {
    margin-right: 0;
}

/* Let style.css .lang-switch min-width:118px govern; just fix height */
#langToggle {
    height: 36px;
    min-width: 118px;
    width: auto;
    flex-shrink: 0;
}

.header-pwa-crystals {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(14, 12, 12, 0.82);
    border: 1px solid rgba(120, 20, 20, 0.22);
    white-space: nowrap;
}

/* Username badge in header top-right */
.header-username {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: 'Cormorant Garamond', 'Libre Baskerville', serif;
    font-size: 11.5px;
    font-weight: 400;
    letter-spacing: 0.09em;
    color: rgba(210, 155, 155, 0.88);
    white-space: nowrap;
    padding: 3px 10px 3px 8px;
    border-radius: 999px;
    background: rgba(100, 15, 15, 0.22);
    border: 1px solid rgba(140, 30, 30, 0.28);
    min-height: 28px;
}
.header-username::before {
    content: '✦';
    font-size: 7px;
    opacity: 0.55;
    line-height: 1;
}

body.crave-pwa-mode .home-main {
    min-height: 100vh;
    max-width: 760px;
    margin: 0 auto;
    padding: 108px 14px 130px;
}

body.crave-pwa-mode .intro-section,
body.crave-pwa-mode .reviews-section,
body.crave-pwa-mode .review-form-section,
body.crave-pwa-mode .hero-ad-space,
body.crave-pwa-mode .crave-ad-slot-mid,
body.crave-pwa-mode .hero-cta-after,
body.crave-pwa-mode .site-footer,
body.crave-pwa-mode .home-portal-line,
body.crave-pwa-mode .home-mobile-only-bar {
    display: none !important;
}

body.crave-pwa-mode .hero-choice-title {
    margin-top: 18px;
    margin-bottom: 18px;
}

body.crave-pwa-mode .characters-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    max-width: 760px;
    margin: 0 auto;
}

body.crave-pwa-mode .char-card {
    border-radius: 18px;
    height: 300px;
    overflow: hidden;
}

/* Базовый фон стекла — переопределяется ниже для home-main */
body.crave-pwa-mode .char-glass-panel {
    background: linear-gradient(to bottom, rgba(6, 4, 8, 0.5) 0%, rgba(6, 4, 8, 0.88) 50%, rgba(6, 4, 8, 0.96) 100%);
}

body.crave-pwa-mode .home-pwa-dock {
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: 12px;
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    padding: 8px;
    border-radius: 18px;
    background: rgba(10, 8, 9, 0.82);
    border: 1px solid rgba(120, 20, 20, 0.24);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 1400;
}

body.crave-pwa-mode .home-pwa-item {
    min-height: 44px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #dfd8d8;
    background: rgba(14, 10, 12, 0.62);
    border: 1px solid rgba(120, 20, 20, 0.28);
    font-size: 0.92rem;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
    cursor: pointer;
}

body.crave-pwa-mode .home-pwa-item:hover,
body.crave-pwa-mode .home-pwa-item:focus-visible {
    background: rgba(100, 14, 14, 0.38);
    border-color: rgba(180, 40, 40, 0.55);
    color: #fff;
    box-shadow: 0 0 18px rgba(160, 20, 20, 0.32), inset 0 0 0 1px rgba(180, 40, 40, 0.18);
}

body.crave-pwa-mode .home-pwa-item:active {
    background: rgba(120, 16, 16, 0.52);
    border-color: rgba(200, 50, 50, 0.65);
    box-shadow: 0 0 28px rgba(180, 20, 20, 0.45), inset 0 0 0 1px rgba(200, 50, 50, 0.25);
    transform: scale(0.97);
}

body.crave-pwa-mode .home-pwa-item-active {
    background: rgba(120, 20, 20, 0.32);
    border-color: rgba(150, 30, 30, 0.45);
    box-shadow: 0 0 18px rgba(140, 20, 20, 0.28);
}

body.chat-page .chat-background-layer::after,
body.chat-page .character-background::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

body.chat-page .chat-background-layer,
body.chat-page .character-background,
body.chat-page .parallax-layer {
    filter: blur(5px);
    -webkit-filter: blur(5px);
}

body.chat-page .story-box {
    background: rgba(6, 5, 8, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

body.chat-page .chat-choice-panel {
    background: rgba(6, 5, 8, 0.94);
    border: 1px solid var(--chat-choice-panel-border, rgba(179, 0, 0, 0.42));
    box-shadow: var(--chat-choice-panel-glow);
}

body.chat-page .choice-plaque {
    background: rgba(10, 9, 12, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.chat-page .choice-plaque.is-selected,
body.chat-page .choice-plaque.active {
    transform: scale(1.045);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.48);
}

/* =========================================
   CRAVE PWA FIXED APP SHELL (HOME + CHAT)
   ========================================= */
body.crave-pwa-mode {
    background: #020202;
}

body.crave-pwa-mode .site-header.site-header-pill .header-pill {
    grid-template-columns: 1fr;
    padding: 0 12px;
}

body.crave-pwa-mode .site-header.site-header-pill .header-pill-menu,
body.crave-pwa-mode .site-header.site-header-pill .header-pill-lang {
    display: none !important;
}

body.crave-pwa-mode .site-header.site-header-pill .logo {
    position: static;
    transform: none;
    justify-self: center;
    pointer-events: none;
    text-align: center;
}

body.crave-pwa-mode .site-header.site-header-pill .header-pill-right {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    justify-self: auto;
    margin: 0;
    gap: 0;
}

body.crave-pwa-mode .site-header.site-header-pill .header-pill-right #langToggle {
    display: none !important;
}

body.crave-pwa-mode .site-header.site-header-pill .header-pwa-crystals {
    min-height: 38px;
    padding: 0 14px;
}

body.crave-pwa-mode .site-header.site-header-pill .header-pwa-crystals.crystals-premium {
    border-color: rgba(212, 173, 88, 0.62);
    box-shadow: 0 0 18px rgba(212, 173, 88, 0.28), inset 0 0 0 1px rgba(212, 173, 88, 0.35);
    background: linear-gradient(135deg, rgba(30, 22, 12, 0.95), rgba(18, 13, 8, 0.92));
}

body.crave-pwa-mode .home-main {
    min-height: calc(100dvh - 24px);
    padding: 96px 14px 118px;
}

body.crave-pwa-mode .hero-choice-title,
body.crave-pwa-mode .hero-app-entry {
    display: none !important;
}

body.crave-pwa-mode .characters-grid {
    gap: 12px;
    margin: 0 auto;
}

body.crave-pwa-mode .char-card {
    height: min(40dvh, 330px);
    border-radius: 18px;
}

/* =====================================================
   PWA: карточки — стекло снизу, имя над стеклом
   ===================================================== */

/* Стекло: в покое прозрачное и чуть сдвинуто вниз */
body.crave-pwa-mode .home-main .characters-grid .char-glass-panel {
    position: absolute !important;
    top: auto !important;
    bottom: 8px !important;
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    height: 44% !important;
    min-height: unset !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
    align-items: stretch !important;
    gap: 10px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    border-radius: 16px !important;
    opacity: 0 !important;
    transform: translateY(calc(100% + 10px)) !important;
    transition: opacity 0.38s ease, transform 0.38s cubic-bezier(0.25, 1, 0.45, 1) !important;
    background: linear-gradient(to bottom,
        rgba(12, 10, 14, 0.18) 0%,
        rgba(9, 8, 11, 0.45) 50%,
        rgba(8, 7, 10, 0.6) 100%) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border-top: 1px solid var(--crave-frost-glass-border) !important;
    padding: 14px 14px 16px !important;
    z-index: 4 !important;
}

/* Стекло: появляется при tap/hover */
body.crave-pwa-mode .home-main .characters-grid .char-card:hover .char-glass-panel,
body.crave-pwa-mode .home-main .characters-grid .char-card.tapped .char-glass-panel,
body.crave-pwa-mode .home-main .characters-grid .char-card.active .char-glass-panel,
body.crave-pwa-mode .home-main .characters-grid .char-card.pwa-launching .char-glass-panel {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Имя: в покое — снизу карточки */
body.crave-pwa-mode .home-main .characters-grid .char-name-rail,
body.crave-pwa-mode .home-main .characters-grid .char-name {
    bottom: 14px !important;
    z-index: 8 !important;
    transition: bottom 0.45s cubic-bezier(0.25, 1, 0.45, 1), color 0.35s ease !important;
}

/* Имя: при tap/hover поднимается НАД стеклом */
body.crave-pwa-mode .home-main .characters-grid .char-card:hover .char-name-rail,
body.crave-pwa-mode .home-main .characters-grid .char-card:hover .char-name,
body.crave-pwa-mode .home-main .characters-grid .char-card.tapped .char-name-rail,
body.crave-pwa-mode .home-main .characters-grid .char-card.tapped .char-name,
body.crave-pwa-mode .home-main .characters-grid .char-card.active .char-name-rail,
body.crave-pwa-mode .home-main .characters-grid .char-card.active .char-name,
body.crave-pwa-mode .home-main .characters-grid .char-card.pwa-launching .char-name-rail,
body.crave-pwa-mode .home-main .characters-grid .char-card.pwa-launching .char-name {
    bottom: calc(44% + 28px) !important;
}

/* Текст на стекле: в покое скрыт, появляется при tap/hover */
body.crave-pwa-mode .home-main .characters-grid .char-glass-hint,
body.crave-pwa-mode .home-main .characters-grid .char-hook,
body.crave-pwa-mode .home-main .characters-grid .enter-chat-btn {
    position: static !important;
    width: 100% !important;
    margin: 0 !important;
    opacity: 0 !important;
    transform: none !important;
    transition: opacity 0.3s ease 0.1s !important;
}

body.crave-pwa-mode .home-main .characters-grid .char-hook {
    flex: 0 1 auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

body.crave-pwa-mode .home-main .characters-grid .enter-chat-btn {
    flex: 0 0 auto !important;
}

body.crave-pwa-mode .home-main .characters-grid .char-card:hover .char-glass-hint,
body.crave-pwa-mode .home-main .characters-grid .char-card:hover .char-hook,
body.crave-pwa-mode .home-main .characters-grid .char-card:hover .enter-chat-btn,
body.crave-pwa-mode .home-main .characters-grid .char-card.tapped .char-glass-hint,
body.crave-pwa-mode .home-main .characters-grid .char-card.tapped .char-hook,
body.crave-pwa-mode .home-main .characters-grid .char-card.tapped .enter-chat-btn,
body.crave-pwa-mode .home-main .characters-grid .char-card.active .char-glass-hint,
body.crave-pwa-mode .home-main .characters-grid .char-card.active .char-hook,
body.crave-pwa-mode .home-main .characters-grid .char-card.active .enter-chat-btn,
body.crave-pwa-mode .home-main .characters-grid .char-card.pwa-launching .char-glass-hint,
body.crave-pwa-mode .home-main .characters-grid .char-card.pwa-launching .char-hook,
body.crave-pwa-mode .home-main .characters-grid .char-card.pwa-launching .enter-chat-btn {
    opacity: 1 !important;
    transform: none !important;
}

body.crave-pwa-mode .home-pwa-dock {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    transform: none;
    width: min(760px, calc(100vw - 28px));
    margin: 14px auto 0;
    grid-template-columns: 1fr;
    padding: 12px;
    border-radius: 16px;
}

body.crave-pwa-mode .home-pwa-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

body.crave-pwa-mode .home-pwa-row + .home-pwa-row {
    margin-top: 8px;
}

body.crave-pwa-mode .home-pwa-row-bottom {
    grid-template-columns: 1fr;
}

body.crave-pwa-mode .home-pwa-item {
    min-height: 44px;
    font-size: 0.82rem;
    letter-spacing: 0.02em;
}

body.crave-pwa-mode .home-pwa-item-exit {
    background: linear-gradient(145deg, rgba(95, 8, 8, 0.88), rgba(56, 5, 5, 0.88));
    border-color: rgba(170, 34, 34, 0.55);
    color: #ffd7d7;
}

body.crave-pwa-mode .characters-grid .char-card {
    transition: transform 0.28s ease, box-shadow 0.28s ease, filter 0.28s ease;
}

body.crave-pwa-mode .characters-grid .char-card:hover,
body.crave-pwa-mode .characters-grid .char-card:focus-visible {
    transform: scale(1.03) translateY(-3px);
}

body.crave-pwa-mode .characters-grid .char-card[data-hero="adrian"]:hover,
body.crave-pwa-mode .characters-grid .char-card[data-hero="adrian"]:focus-visible {
    box-shadow: 0 0 30px rgba(147, 11, 11, 0.42);
}

body.crave-pwa-mode .characters-grid .char-card[data-hero="silas"]:hover,
body.crave-pwa-mode .characters-grid .char-card[data-hero="silas"]:focus-visible {
    box-shadow: 0 0 30px rgba(120, 40, 40, 0.4);
}

body.crave-pwa-mode .characters-grid .char-card[data-hero="jax"]:hover,
body.crave-pwa-mode .characters-grid .char-card[data-hero="jax"]:focus-visible {
    box-shadow: 0 0 30px rgba(184, 168, 146, 0.38);
}

body.crave-pwa-mode .characters-grid .char-card[data-hero="dominic"]:hover,
body.crave-pwa-mode .characters-grid .char-card[data-hero="dominic"]:focus-visible {
    box-shadow: 0 0 30px rgba(201, 167, 106, 0.4);
}

body.crave-pwa-mode.chat-page .chat-top-bar .chat-menu-hover,
body.crave-pwa-mode.chat-page .chat-top-bar .chat-inline-lang {
    display: none !important;
}

body.crave-pwa-mode.chat-page .chat-top-bar {
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    padding: max(12px, env(safe-area-inset-top, 0px)) 12px 10px;
}

body.crave-pwa-mode.chat-page .chat-top-center-cluster {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: center;
}

body.crave-pwa-mode.chat-page .chat-top-brand {
    font-size: 0.76rem;
    letter-spacing: 0.16em;
    opacity: 0.75;
}

body.crave-pwa-mode.chat-page .chat-character-name--bar {
    font-size: 0.96rem;
    letter-spacing: 0.1em;
}

body.crave-pwa-mode.chat-page .chat-story-area {
    padding: 88px 14px 240px;
    /* PWA: без «браузерного» скроллбара — только программная прокрутка к последнему сообщению */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

body.crave-pwa-mode.chat-page .chat-story-area::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
    background: transparent;
}

body.crave-pwa-mode.chat-page .story-box.text-block {
    max-width: 100%;
    border-radius: 20px;
    padding: 18px 16px;
    margin: 0;
}

/* Убираем margin:10vh у story-box даже вне PWA-режима — чтобы не было пустого пространства при скролле вверх */
body.chat-page .story-box {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

body.crave-pwa-mode.chat-page .message-container {
    max-width: 680px;
}

body.crave-pwa-mode.chat-page .message-text {
    font-size: clamp(1.02rem, 2.4vw, 1.15rem);
    line-height: 1.92;
    hyphens: auto;
    word-break: normal;
    overflow-wrap: anywhere;
}

body.crave-pwa-mode.chat-page .user-message {
    text-align: left;
}

body.crave-pwa-mode.chat-page .user-message .message-text {
    display: inline-block;
    font-style: italic;
    line-height: 1.72;
    padding-left: 12px;
    border-left: 1px solid rgba(198, 174, 160, 0.45);
    color: #d6cdc8;
    opacity: 0.94;
}

body.crave-pwa-mode.chat-page .chat-choice-panel {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    width: min(520px, calc(100vw - 20px));
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    padding: 8px 10px calc(10px + env(safe-area-inset-bottom, 0px));
    border-radius: 14px;
    z-index: 32;
    background: rgba(6, 5, 8, 0.94);
    border: 1px solid var(--chat-choice-panel-border, rgba(179, 0, 0, 0.42));
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: var(--chat-choice-panel-glow);
}

/* =====================================================
   Выборы: используем body.pwa-app.chat-page (хардкод в chat.html),
   не body.crave-pwa-mode — чтобы сетка работала сразу без ожидания JS
   ===================================================== */

body.pwa-app.chat-page .choices-grid.choices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

/* Одинокий последний выбор — растягивается на 2 колонки */
body.pwa-app.chat-page .choices-grid.choices .choice-plaque:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

body.pwa-app.chat-page .choices-slots,
body.pwa-app.chat-page .choices-slots.slots-4 {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

/* Одинокий элемент в slots — тоже на всю ширину */
body.pwa-app.chat-page .choices-slots .choice-plaque:only-child,
body.pwa-app.chat-page .choices-slots .choice-plaque-premium-hook:only-child {
    grid-column: 1 / -1;
}

body.pwa-app.chat-page .choice-plaque,
body.pwa-app.chat-page .choice-plaque-premium-hook {
    min-height: 48px;
    max-height: 68px;
    height: auto;
    padding: 8px 10px;
    font-size: 0.88rem;
    line-height: 1.28;
    overflow: hidden;
    background: rgba(10, 9, 12, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
    cursor: pointer;
}

body.pwa-app.chat-page .choice-plaque:hover,
body.pwa-app.chat-page .choice-plaque:focus-visible,
body.pwa-app.chat-page .choice-plaque-premium-hook:hover {
    background: rgba(14, 12, 16, 0.96);
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.48);
}

body.pwa-app.chat-page .choice-plaque:active,
body.pwa-app.chat-page .choice-plaque-premium-hook:active {
    transform: scale(0.97);
    background: rgba(12, 10, 14, 0.98);
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.52);
}

/* "Свой ответ" — всегда по центру (занимает 2 колонки) */
body.pwa-app.chat-page #customAnswerBtn {
    grid-column: 1 / -1 !important;
    max-width: 200px !important;
    width: 100% !important;
    margin: 0 auto !important;
    min-height: 44px !important;
    max-height: 48px !important;
}

body.pwa-app.chat-page .choice-plaque-paid {
    border-color: rgba(170, 128, 84, 0.45);
    box-shadow: inset 0 0 0 1px rgba(170, 128, 84, 0.2);
}

body.pwa-app.chat-page .choice-plaque-paid:hover {
    border-color: rgba(212, 173, 88, 0.65);
    box-shadow: 0 0 20px rgba(212, 160, 60, 0.3), inset 0 0 0 1px rgba(212, 173, 88, 0.3);
    background: rgba(60, 40, 10, 0.45);
}

@media (min-width: 900px) {
    body.crave-pwa-mode .home-main,
    body.crave-pwa-mode.chat-page .app {
        width: min(760px, calc(100vw - 48px));
        margin-left: auto;
        margin-right: auto;
        border-radius: 28px;
        border: 1px solid rgba(137, 68, 68, 0.28);
        box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.04);
        overflow: hidden;
    }

    body.crave-pwa-mode .home-main {
        min-height: calc(100dvh - 36px);
    }

    body.crave-pwa-mode.chat-page .app {
        min-height: calc(100dvh - 36px);
        position: relative;
    }

    body.crave-pwa-mode.chat-page .chat-choice-panel {
        width: min(760px, calc(100vw - 60px));
    }

    body.crave-pwa-mode .site-header.site-header-pill {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: min(760px, calc(100vw - 48px));
        top: 18px;
    }
}

/* =====================================================
   PWA: кнопка "к последнему сообщению"
   ===================================================== */
.pwa-scroll-btn {
    position: fixed;
    right: 14px;
    bottom: 290px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(10, 7, 10, 0.78);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(120, 20, 20, 0.38);
    color: rgba(220, 200, 200, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 60;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease, transform 0.18s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
    padding: 0;
    outline: none;
}

.pwa-scroll-btn.visible {
    opacity: 1;
    pointer-events: auto;
}

.pwa-scroll-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.55), 0 0 16px rgba(120, 20, 20, 0.3);
}

.pwa-scroll-btn:active {
    transform: scale(0.93);
}

/* Цвет под персонажа */
body[data-hero="adrian"] .pwa-scroll-btn {
    border-color: rgba(147, 11, 11, 0.6);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5), 0 0 14px rgba(147, 11, 11, 0.28);
    color: rgba(255, 180, 180, 0.92);
}
body[data-hero="adrian"] .pwa-scroll-btn:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.55), 0 0 22px rgba(147, 11, 11, 0.45);
}

body[data-hero="silas"] .pwa-scroll-btn {
    border-color: rgba(100, 28, 28, 0.65);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5), 0 0 14px rgba(80, 20, 20, 0.28);
    color: rgba(230, 190, 190, 0.92);
}
body[data-hero="silas"] .pwa-scroll-btn:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.55), 0 0 22px rgba(80, 20, 20, 0.45);
}

body[data-hero="jax"] .pwa-scroll-btn {
    border-color: rgba(128, 114, 92, 0.6);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5), 0 0 14px rgba(128, 114, 92, 0.28);
    color: rgba(220, 210, 195, 0.92);
}
body[data-hero="jax"] .pwa-scroll-btn:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.55), 0 0 22px rgba(128, 114, 92, 0.4);
}

body[data-hero="dominic"] .pwa-scroll-btn {
    border-color: rgba(172, 147, 88, 0.6);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5), 0 0 14px rgba(172, 147, 88, 0.28);
    color: rgba(235, 220, 180, 0.92);
}
body[data-hero="dominic"] .pwa-scroll-btn:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.55), 0 0 22px rgba(172, 147, 88, 0.4);
}

/* ============================================================
   SITE-MODE ENHANCEMENTS  (v20260503)
   ============================================================ */

/* ── 1. CRYSTALS: visible only for logged-in users (set via JS auth check) ── */
/* default stays display:none from style.css; JS shows it when crave_registered=true */

/* ── 2. CHAT BACKGROUND: fix blur white-edges + vignette ── */

/* scale slightly so blur never bleeds to white edge */
body.chat-page .chat-background-layer {
    transform: scale(1.08);
    transform-origin: center center;
    background-size: cover;
    background-position: center center;
}

/* dark vignette overlay (edge darkening, no white spots) */
body.chat-page .chat-background-layer::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 90% 80% at 50% 50%, transparent 30%, rgba(0,0,0,0.72) 100%),
        linear-gradient(to bottom,
            rgba(0,0,0,0.55) 0%,
            transparent 22%,
            transparent 72%,
            rgba(0,0,0,0.75) 100%);
    pointer-events: none;
}

/* ── Desktop: letterbox 16:9 — bg image centered, sides dark ── */
@media (min-width: 769px) {
    body.chat-page:not(.crave-pwa-mode) .chat-background-layer {
        /* limit visible background to 16:9 area, center it */
        width: min(100vw, calc(100vh * (16/9)));
        left: 50%;
        transform: translateX(-50%) scale(1.08);
        /* sides outside 16:9 area stay #080609 (html/body background) */
    }
    /* side bars — black fill beyond the 16:9 box */
    body.chat-page:not(.crave-pwa-mode)::before {
        content: '';
        position: fixed;
        inset: 0;
        background: #080609;
        z-index: -1;
        pointer-events: none;
    }
}

/* ── 3. GLASS SLIDE-UP ANIMATION for site mode ── */

/* Base: glass hidden, slides in on hover/tap */
body.crave-site-mode .home-main .characters-grid .char-glass-panel {
    position: absolute !important;
    top: auto !important;
    bottom: 8px !important;
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    height: 46% !important;
    min-height: unset !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
    align-items: stretch !important;
    gap: 10px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    border-radius: 16px !important;
    opacity: 0 !important;
    transform: translateY(calc(100% + 10px)) !important;
    transition: opacity 0.35s ease, transform 0.38s cubic-bezier(0.25,1,0.45,1) !important;
    background: linear-gradient(to bottom,
        rgba(12, 10, 14, 0.18) 0%,
        rgba(9, 8, 11, 0.45) 48%,
        rgba(8, 7, 10, 0.6) 100%) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border-top: 1px solid var(--crave-frost-glass-border) !important;
    padding: 14px 14px 16px !important;
    z-index: 10 !important;
}

/* Glass visible on hover or JS-tap */
body.crave-site-mode .home-main .characters-grid .char-card:hover .char-glass-panel,
body.crave-site-mode .home-main .characters-grid .char-card.pwa-hovered .char-glass-panel,
body.crave-site-mode .home-main .characters-grid .char-card.tapped .char-glass-panel,
body.crave-site-mode .home-main .characters-grid .char-card.active .char-glass-panel {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Char name always visible in site mode (style.css hides it until .tapped at narrow widths) */
body.crave-site-mode .home-main .characters-grid .char-card .char-name {
    opacity: 1 !important;
}

/* Char name sits at bottom, moves up on hover */
body.crave-site-mode .home-main .characters-grid .char-name {
    z-index: 12 !important;
    transition: bottom 0.42s cubic-bezier(0.25,1,0.45,1) !important;
}
body.crave-site-mode .home-main .characters-grid .char-card:hover .char-name,
body.crave-site-mode .home-main .characters-grid .char-card.pwa-hovered .char-name,
body.crave-site-mode .home-main .characters-grid .char-card.tapped .char-name {
    bottom: calc(46% + 30px) !important;
}

/* Text inside glass fades in */
body.crave-site-mode .home-main .characters-grid .char-glass-hint,
body.crave-site-mode .home-main .characters-grid .char-hook,
body.crave-site-mode .home-main .characters-grid .enter-chat-btn {
    position: static !important;
    width: 100% !important;
    margin: 0 !important;
    opacity: 0 !important;
    transform: none !important;
    transition: opacity 0.28s ease 0.12s !important;
}

body.crave-site-mode .home-main .characters-grid .char-hook {
    flex: 0 1 auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

body.crave-site-mode .home-main .characters-grid .enter-chat-btn {
    flex: 0 0 auto !important;
}

body.crave-site-mode .home-main .characters-grid .char-card:hover .char-glass-hint,
body.crave-site-mode .home-main .characters-grid .char-card:hover .char-hook,
body.crave-site-mode .home-main .characters-grid .char-card:hover .enter-chat-btn,
body.crave-site-mode .home-main .characters-grid .char-card.pwa-hovered .char-glass-hint,
body.crave-site-mode .home-main .characters-grid .char-card.pwa-hovered .char-hook,
body.crave-site-mode .home-main .characters-grid .char-card.pwa-hovered .enter-chat-btn,
body.crave-site-mode .home-main .characters-grid .char-card.tapped .char-glass-hint,
body.crave-site-mode .home-main .characters-grid .char-card.tapped .char-hook,
body.crave-site-mode .home-main .characters-grid .char-card.tapped .enter-chat-btn {
    opacity: 1 !important;
    transform: none !important;
}

/* ══════════════════════════════════════════════════
   SITE SHOP OVERLAY  (glass modal over index.html)
   ══════════════════════════════════════════════════ */

/* Full-screen backdrop */
.site-shop-overlay {
    position: fixed;
    inset: 0;
    z-index: 3500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    background: rgba(5, 3, 8, 0.78);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    opacity: 0;
    transition: opacity 0.28s ease;
}
.site-shop-overlay.ss-active {
    opacity: 1;
}

/* Main glass panel */
.site-shop-panel {
    position: relative;
    width: 100%;
    max-width: 880px;
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    background: rgba(8, 5, 10, 0.94);
    border: 1px solid rgba(130, 20, 20, 0.38);
    border-radius: 24px;
    padding: 36px 32px 28px;
    box-shadow:
        0 0 80px rgba(0, 0, 0, 0.7),
        0 0 40px rgba(100, 5, 5, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    animation: siteShopSlideIn 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes siteShopSlideIn {
    from { opacity: 0; transform: scale(0.94) translateY(16px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Close × */
.site-shop-x {
    position: absolute;
    top: 14px; right: 16px;
    width: 36px; height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(200, 196, 196, 0.8);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, transform 0.15s;
    display: flex; align-items: center; justify-content: center;
    z-index: 2;
}
.site-shop-x:hover { background: rgba(160, 15, 15, 0.38); color: #fff; transform: scale(1.1); }

/* Title */
.site-shop-heading {
    text-align: center;
    font-size: 1.4rem;
    letter-spacing: 0.22em;
    color: #c8c6c6;
    margin: 0 0 28px;
    font-family: 'Libra', Georgia, serif;
}

/* Two-column row: VIP left, crystals right */
.site-shop-row {
    display: flex;
    gap: 22px;
    align-items: stretch;
}

/* VIP column */
.site-shop-vip { flex: 0 0 min(340px, 38%); display: flex; }
.site-goddess-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px 20px;
    border-radius: 18px;
    border: 1px solid rgba(180, 0, 0, 0.45);
    background: rgba(14, 8, 10, 0.6);
    text-align: center;
    animation: siteVipGlow 3.2s ease-in-out infinite;
    cursor: default;
}
@keyframes siteVipGlow {
    0%, 100% { box-shadow: 0 0 22px rgba(120, 0, 0, 0.32), inset 0 0 0 1px rgba(255, 80, 80, 0.06); }
    50%       { box-shadow: 0 0 46px rgba(200, 20, 20, 0.52), 0 0 80px rgba(80, 0, 0, 0.25), inset 0 0 0 1px rgba(255, 120, 120, 0.12); }
}
.site-goddess-title {
    font-size: 1.3rem;
    color: #c8c6c6;
    letter-spacing: 0.18em;
    margin: 0 0 10px;
    font-family: 'Libra', Georgia, serif;
}
.site-goddess-sub {
    font-size: 0.9rem;
    color: rgba(200, 196, 196, 0.76);
    margin: 0 0 22px;
    line-height: 1.45;
}
.site-goddess-features {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
    text-align: left;
    width: 100%;
    color: rgba(200, 196, 196, 0.88);
    font-size: 0.88rem;
    line-height: 1.5;
}
.site-goddess-features li { margin: 0 0 6px; }
.site-goddess-features strong { color: #ff4040; }
.site-goddess-note {
    margin: 10px 0 0;
    font-size: 0.75rem;
    color: rgba(200, 196, 196, 0.52);
}
.site-goddess-btn {
    padding: 13px 28px;
    border-radius: 14px;
    background: linear-gradient(145deg, #a30d0d 0%, #6f0808 100%);
    color: #c8c6c6;
    border: none;
    cursor: pointer;
    font-weight: 600;
    letter-spacing: 0.05em;
    font-size: 0.95rem;
    box-shadow: 0 4px 20px rgba(147, 11, 11, 0.35);
    transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease;
    width: 100%;
}
.site-goddess-btn:hover:not(:disabled) {
    transform: scale(1.04);
    box-shadow: 0 8px 32px rgba(220, 30, 30, 0.5);
    filter: brightness(1.1);
}
.site-goddess-btn:disabled { opacity: 0.65; cursor: wait; }

/* Crystal grid (right column) */
.site-shop-crystals { flex: 1; }
.site-crystal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    height: 100%;
}
.site-crystal-card {
    padding: 22px 16px;
    border-radius: 16px;
    text-align: center;
    border: 1px solid rgba(201, 167, 106, 0.52);
    background: rgba(14, 10, 8, 0.55);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    min-height: 140px;
    animation: siteCrystalGlow 2.8s ease-in-out infinite;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
@keyframes siteCrystalGlow {
    0%, 100% { box-shadow: 0 0 16px rgba(255, 210, 120, 0.12); }
    50%       { box-shadow: 0 0 28px rgba(255, 220, 120, 0.3), 0 0 44px rgba(200, 150, 50, 0.14); }
}
.site-crystal-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 32px rgba(255, 220, 140, 0.45), 0 0 48px rgba(200, 140, 40, 0.2);
    border-color: rgba(255, 220, 160, 0.82);
}
.site-crystal-name {
    font-size: 0.95rem;
    color: #c8c6c6;
    font-weight: 600;
    letter-spacing: 0.05em;
}
.site-crystal-val {
    font-size: 1rem;
    color: rgba(200, 196, 196, 0.9);
    display: flex;
    align-items: center;
    gap: 5px;
    justify-content: center;
}
.site-crystal-price { color: #ff4444; font-weight: 600; }
.site-crystal-price-tag {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 0.9rem;
    color: rgba(200, 196, 196, 0.92);
    font-weight: 600;
}
.site-crystal-try {
    margin-top: 2px;
    padding: 7px 18px;
    border-radius: 999px;
    border: 1px solid rgba(201, 167, 106, 0.55);
    color: rgba(201, 167, 106, 0.92);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    pointer-events: none;
}
.site-crystal-gem {
    display: inline-block;
    width: 11px; height: 13px;
    background: linear-gradient(148deg, #fff8e0 0%, #f0c040 42%, #8a5a08 100%);
    clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
    box-shadow: 0 0 14px rgba(255, 230, 140, 0.85), 0 0 26px rgba(255, 200, 60, 0.35);
    animation: siteGemPulse 2.2s ease-in-out infinite;
}
@keyframes siteGemPulse {
    0%, 100% { filter: brightness(1); }
    50%       { filter: brightness(1.2); box-shadow: 0 0 22px rgba(255, 240, 180, 0.95); }
}

/* Shop footer */
.site-shop-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 12px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid rgba(120, 20, 20, 0.2);
    font-size: 0.72rem;
    color: rgba(200, 196, 196, 0.4);
    letter-spacing: 0.1em;
}
.site-shop-footer img { height: 22px; opacity: 0.65; }
.site-shop-legal { width: 100%; text-align: center; margin-top: 4px; }
.site-shop-legal a { color: rgba(200, 196, 196, 0.55); text-decoration: none; letter-spacing: 0.06em; }
.site-shop-legal a:hover { color: rgba(255, 255, 255, 0.85); }

/* Payment / VIP sub-glass (positioned over the shop panel) */
.site-sub-glass {
    position: fixed;
    inset: 0;
    z-index: 3600;
    align-items: center;
    justify-content: center;
    background: rgba(5, 3, 8, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.site-sub-panel {
    position: relative;
    width: 100%;
    max-width: 360px;
    margin: 20px;
    background: rgba(8, 5, 10, 0.96);
    border: 1px solid rgba(130, 20, 20, 0.38);
    border-radius: 20px;
    padding: 32px 24px 28px;
    text-align: center;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.6), 0 0 28px rgba(100, 5, 5, 0.18);
    animation: siteShopSlideIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.site-sub-title {
    font-size: 1.2rem;
    letter-spacing: 0.14em;
    color: #c8c6c6;
    margin: 0 0 10px;
    font-family: 'Libra', Georgia, serif;
}
.site-sub-price {
    font-size: 2rem;
    font-weight: 700;
    color: #930b0b;
    margin: 0 0 14px;
}
.site-sub-hint {
    font-size: 0.82rem;
    color: rgba(200, 196, 196, 0.6);
    line-height: 1.5;
    margin: 0 0 20px;
}
.site-sub-error {
    font-size: 0.8rem;
    color: #e74c3c;
    margin-top: 12px;
}

/* Mobile: stack VIP above crystals */
@media (max-width: 640px) {
    .site-shop-row { flex-direction: column; }
    .site-shop-vip { flex: none; }
    .site-shop-panel { padding: 24px 16px 20px; }
    .site-crystal-grid { grid-template-columns: 1fr 1fr; }
}

/* ── 4. CRAVE HERO TITLE: breathing glow animation ── */
@keyframes craveHeroBreathe {
    0%, 100% {
        text-shadow:
            0 0 10px rgba(147, 11, 11, 0.38),
            0 0 28px rgba(120, 5, 5, 0.2),
            0 0 60px rgba(90, 0, 0, 0.1);
        letter-spacing: 0.20em;
        opacity: 0.88;
    }
    50% {
        text-shadow:
            0 0 18px rgba(180, 18, 18, 0.72),
            0 0 48px rgba(147, 11, 11, 0.45),
            0 0 90px rgba(110, 5, 5, 0.25),
            0 0 140px rgba(80, 0, 0, 0.12);
        letter-spacing: 0.24em;
        opacity: 1;
    }
}

body.crave-site-mode .home-main .crave-standalone {
    animation: craveHeroBreathe 3.8s ease-in-out infinite;
    display: block;
    will-change: text-shadow, letter-spacing, opacity;
}

/* ── 4b. REVIEWS: more breathing room ── */
.reviews-grid {
    gap: 28px !important;
}
.review-card {
    transition: box-shadow 0.28s ease, border-color 0.28s ease;
}
.review-card:hover {
    border-color: rgba(179, 0, 0, 0.38);
    box-shadow: 0 0 24px rgba(100, 0, 0, 0.15);
}

/* ── 5. AD SLOTS: price label inside each frame ── */
body.crave-ad-slots-mode .crave-ad-frame {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    min-height: 160px !important;
    padding: 22px 18px !important;
}
body.crave-ad-slots-mode .crave-ad-frame::before {
    content: 'РЕКЛАМНОЕ МЕСТО';
    display: block;
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 0.78rem;
    letter-spacing: 0.22em;
    color: rgba(201, 167, 106, 0.72);
    text-align: center;
    font-weight: 600;
    text-transform: uppercase;
}
body.crave-ad-slots-mode .crave-ad-frame::after {
    content: '$200 / размещение · духи · путешествия · lifestyle 18+';
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    color: rgba(169, 169, 169, 0.62);
    letter-spacing: 0.04em;
    text-align: center;
    max-width: 34em;
    line-height: 1.45;
}
body.crave-ad-slots-mode .hero-ad-space .crave-ad-frame::before {
    content: 'ГЛАВНЫЙ БАННЕР';
}
body.crave-ad-slots-mode .hero-ad-space .crave-ad-frame::after {
    content: '$200 / размещение · premium · без бытовых тем';
}
body.crave-ad-slots-mode .crave-ad-frame .crave-ad-creative,
body.crave-ad-slots-mode .crave-ad-frame .crave-ad-creative img,
body.crave-ad-slots-mode .crave-ad-frame .crave-ad-creative a {
    width: 100%;
    max-height: 100%;
    border-radius: 12px;
    object-fit: cover;
}
body.crave-ad-slots-mode .crave-ad-frame:has(.crave-ad-creative)::before,
body.crave-ad-slots-mode .crave-ad-frame:has(.crave-ad-creative)::after {
    display: none;
}
body.crave-ad-slots-mode .crave-ad-frame .crave-ad-creative {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    overflow: hidden;
    border-radius: 14px;
    border: 1px solid rgba(147, 11, 11, 0.22);
    background: rgba(4, 3, 5, 0.92);
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.35);
}
body.crave-ad-slots-mode .crave-ad-frame .crave-ad-creative img {
    filter: saturate(0.88) contrast(1.04) brightness(0.94);
}

/* ── 6. PWA INSTALL BANNER: glass capsule (no red stripe) ── */
.pwa-install-top-banner {
    background: var(--crave-frost-glass) !important;
    border: 1px solid var(--crave-frost-glass-border) !important;
    box-shadow:
        0 10px 32px rgba(0, 0, 0, 0.48),
        inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}
.pwa-install-top-banner__label {
    font-size: 0.88rem;
    letter-spacing: 0.02em;
    color: rgba(220, 216, 214, 0.94);
}
.pwa-install-top-banner__action {
    gap: 8px;
}
.pwa-install-top-banner__action:hover {
    background: rgba(255, 255, 255, 0.04) !important;
}
.pwa-install-top-banner__close {
    border-left: none !important;
}

/* ── 7. MOBILE WEBSITE: mirror PWA behavior on small screens ── */

/* On phones, the home page hides the same elements as PWA and shows char grid */
@media (max-width: 768px) {
    body.crave-site-mode .home-main {
        padding: 96px 12px 32px;
    }

    /* Glass animation on mobile = touch-based (same rules apply via pwa-hovered) */
    body.crave-site-mode .home-main .characters-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    body.crave-site-mode .home-main .characters-grid .char-card {
        height: min(42dvh, 300px);
        border-radius: 16px;
    }

    /* Mobile chat choice panel — same as pwa-app */
    body.chat-page.crave-site-mode .chat-choice-panel {
        position: fixed;
        left: 50%;
        transform: translateX(-50%);
        width: min(760px, calc(100vw - 20px));
        bottom: calc(8px + env(safe-area-inset-bottom, 0px));
        padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px));
        border-radius: 18px;
        z-index: 32;
        background: rgba(6, 5, 8, 0.94);
        border: 1px solid var(--chat-choice-panel-border, rgba(179, 0, 0, 0.42));
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
        box-shadow: var(--chat-choice-panel-glow);
    }

    /* Mobile choices grid */
    body.chat-page.crave-site-mode .choices-grid.choices {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    body.chat-page.crave-site-mode .choices-slots {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    body.chat-page.crave-site-mode #customAnswerBtn {
        grid-column: 1 / -1 !important;
        max-width: 240px !important;
        margin: 0 auto !important;
    }

    /* Mobile chat story area */
    body.chat-page.crave-site-mode .chat-story-area {
        padding-bottom: 240px;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    body.chat-page.crave-site-mode .chat-story-area::-webkit-scrollbar {
        display: none;
    }
}

/* Mobile web: 1-й тап = стекло + «коснись ещё раз» (site + browser, не PWA-иконка) */
@media (max-width: 1200px) {
    body.crave-site-mode .home-main .characters-grid .char-card.tapped .char-hook,
    body.crave-site-mode .home-main .characters-grid .char-card.tapped .enter-chat-btn,
    html:not(.pwa-loading) body.crave-site-mode .home-main .characters-grid .char-card.tapped .char-hook,
    html:not(.pwa-loading) body.crave-site-mode .home-main .characters-grid .char-card.tapped .enter-chat-btn {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    body.crave-site-mode .home-main .characters-grid .char-card.tapped .char-glass-panel {
        height: auto !important;
        min-height: 64px !important;
        max-height: 34% !important;
        justify-content: center !important;
        padding: 12px 14px !important;
    }

    body.crave-site-mode .home-main .characters-grid .char-card.tapped .char-glass-hint {
        opacity: 1 !important;
        display: block !important;
        text-align: center;
        white-space: pre-line;
        font-size: 0.92rem;
        line-height: 1.35;
    }

    body.crave-site-mode .home-main .characters-grid .char-card.tapped .char-name {
        bottom: calc(34% + 22px) !important;
    }
}

/* Mobile: card scale card on hover/tap */
@media (max-width: 768px) {
    body.crave-site-mode .characters-grid .char-card {
        transition: transform 0.28s ease, box-shadow 0.28s ease;
    }
    body.crave-site-mode .characters-grid .char-card.pwa-hovered,
    body.crave-site-mode .characters-grid .char-card.tapped {
        transform: scale(1.02) translateY(-2px);
    }
    body.crave-site-mode .characters-grid .char-card[data-hero="adrian"].pwa-hovered { box-shadow: 0 0 28px rgba(147,11,11,0.4); }
    body.crave-site-mode .characters-grid .char-card[data-hero="silas"].pwa-hovered  { box-shadow: 0 0 28px rgba(120,40,40,0.38); }
    body.crave-site-mode .characters-grid .char-card[data-hero="jax"].pwa-hovered    { box-shadow: 0 0 28px rgba(184,168,146,0.36); }
    body.crave-site-mode .characters-grid .char-card[data-hero="dominic"].pwa-hovered{ box-shadow: 0 0 28px rgba(201,167,106,0.38); }
}

/* Desktop: hover scale for site cards */
@media (min-width: 769px) {
    body.crave-site-mode .characters-grid .char-card {
        transition: transform 0.28s ease, box-shadow 0.28s ease;
    }
    body.crave-site-mode .characters-grid .char-card:hover {
        transform: scale(1.025) translateY(-3px);
    }
    body.crave-site-mode .characters-grid .char-card[data-hero="adrian"]:hover { box-shadow: 0 0 36px rgba(147,11,11,0.42); }
    body.crave-site-mode .characters-grid .char-card[data-hero="silas"]:hover  { box-shadow: 0 0 36px rgba(120,40,40,0.4); }
    body.crave-site-mode .characters-grid .char-card[data-hero="jax"]:hover    { box-shadow: 0 0 36px rgba(184,168,146,0.38); }
    body.crave-site-mode .characters-grid .char-card[data-hero="dominic"]:hover{ box-shadow: 0 0 36px rgba(201,167,106,0.4); }
}

/* ── 8a. HEADER PILL: dark glow only (no white highlight) ── */
body.crave-site-mode .site-header.site-header-pill .header-pill {
    box-shadow:
        0 6px 32px rgba(0, 0, 0, 0.65),
        0 1px 0 rgba(0, 0, 0, 0.9) inset !important;
}

/* ── 8b. LANG TOGGLE: hide in chat pages (change lang on home only) ── */
body.crave-site-mode.chat-page .chat-top-bar .chat-inline-lang,
body.crave-site-mode.chat-page #langToggle,
body.crave-site-mode.chat-page .header-pill-lang {
    display: none !important;
}

/* ── 8c. CHAT CHOICES: make visible on desktop in site mode ── */
body.chat-page.crave-site-mode .chat-choice-panel {
    position: fixed !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: min(760px, calc(100vw - 20px)) !important;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px)) !important;
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px)) !important;
    border-radius: 18px !important;
    z-index: 32 !important;
    background: rgba(6, 5, 8, 0.94) !important;
    border: 1px solid var(--chat-choice-panel-border, rgba(179, 0, 0, 0.42)) !important;
    backdrop-filter: blur(18px) !important;
    -webkit-backdrop-filter: blur(18px) !important;
    box-shadow: var(--chat-choice-panel-glow) !important;
}

body.chat-page.crave-site-mode .choices-grid.choices {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

body.chat-page.crave-site-mode .choices-slots,
body.chat-page.crave-site-mode .choices-slots.slots-4 {
    grid-column: 1 / -1;
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

body.chat-page.crave-site-mode .choice-plaque,
body.chat-page.crave-site-mode .choice-plaque-premium-hook {
    display: flex !important;
    min-height: 54px;
    max-height: none;
    overflow: visible;
    background: rgba(10, 9, 12, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
}

body.chat-page.crave-site-mode .choice-plaque:hover,
body.chat-page.crave-site-mode .choice-plaque-premium-hook:hover {
    background: rgba(14, 12, 16, 0.96);
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.48);
}

body.chat-page.crave-site-mode .choices-slots .choice-plaque:only-child,
body.chat-page.crave-site-mode .choices-slots .choice-plaque-premium-hook:only-child {
    grid-column: 1 / -1;
}

body.chat-page.crave-site-mode .choice-plaque:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

body.chat-page.crave-site-mode #customAnswerBtn {
    grid-column: 1 / -1 !important;
    max-width: 240px !important;
    width: 100% !important;
    margin: 0 auto !important;
}

/* Chat story area needs padding-bottom to not be covered by fixed choice panel */
body.chat-page.crave-site-mode .chat-story-area {
    padding-bottom: 220px;
}

/* ── 8. LAYOUT FIX: hide mobile-only bar in site mode, correct home-main padding ── */

/* In site mode the bar items belong in the header menu — hide the bar entirely */
body.crave-site-mode .home-mobile-only-bar {
    display: none !important;
}

/* home-main needs to clear the fixed header (top:16 + height:64 = 80px) + banner + gap */
body.crave-site-mode .home-main {
    padding-top: 104px !important;
    background: #020202 !important;
    background-image: none !important;
}

/* When install banner is visible, add its height */
html.pwa-install-top-banner-visible body.crave-site-mode .home-main {
    padding-top: calc(var(--pwa-top-banner-h, 40px) + 104px) !important;
}

/* ── 9. SITE MODE FINAL POLISH ── */

/* PWA dock — только в PWA, в site mode скрыт */
body.crave-site-mode .home-pwa-dock {
    display: none !important;
}

/* hero-app-entry (если есть) — скрыт в site mode */
body.crave-site-mode .hero-app-entry {
    display: none !important;
}

/* Desktop site mode: карточки — красивая высота */
@media (min-width: 769px) {
    body.crave-site-mode .home-main .characters-grid {
        gap: 18px;
    }
    body.crave-site-mode .home-main .characters-grid .char-card {
        height: min(56vh, 500px);
        border-radius: 20px;
    }
}

/* Desktop site mode: CRAVE hero section — красивые отступы */
@media (min-width: 769px) {
    body.crave-site-mode .home-main .hero-section {
        padding-bottom: 14px;
    }
    body.crave-site-mode .home-main .crave-standalone {
        font-size: clamp(3.5rem, 7vw, 6.5rem);
        letter-spacing: 0.26em;
    }
    body.crave-site-mode .hero-choice-title {
        margin: 14px 0 28px !important;
        font-size: clamp(1.35rem, 2.6vw, 2rem);
        letter-spacing: 0.14em;
    }
}

/* Site mode: стекло на карточках — чуть больше размытия на desktop */
@media (min-width: 769px) {
    body.crave-site-mode .home-main .characters-grid .char-glass-panel {
        backdrop-filter: blur(18px) !important;
        -webkit-backdrop-filter: blur(18px) !important;
    }
}

/* Site mode: intro-section — улучшенная типографика */
body.crave-site-mode .intro-section {
    max-width: 680px;
    margin: 0 auto 18px;
    background: transparent !important;
}
body.crave-site-mode .intro-text p {
    color: rgba(210, 196, 196, 0.82);
    line-height: 1.8;
}
body.crave-site-mode .intro-subtext {
    color: rgba(180, 160, 160, 0.68);
    letter-spacing: 0.06em;
    font-style: italic;
}

/* Скроллбар site mode — такой же тонкий и тёмный */
body.crave-site-mode ::-webkit-scrollbar { width: 4px; height: 4px; }
body.crave-site-mode ::-webkit-scrollbar-track { background: rgba(8,5,8,0.4); border-radius: 4px; }
body.crave-site-mode ::-webkit-scrollbar-thumb { background: rgba(120,16,16,0.65); border-radius: 4px; }
body.crave-site-mode ::-webkit-scrollbar-thumb:hover { background: rgba(170,24,24,0.85); }
body.crave-site-mode {
    background: #020202 !important;
    background-image: none !important;
    scrollbar-width: thin;
    scrollbar-color: rgba(120,16,16,0.65) rgba(8,5,8,0.4);
}

/* Site mode: footer — едва заметный, чистый */
body.crave-site-mode .site-footer {
    border-top: 1px solid rgba(80, 16, 16, 0.12);
    padding: 20px 16px;
    text-align: center;
    color: rgba(180,160,160,0.5);
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    box-shadow: none;
}

body.crave-site-mode .footer-topline a,
body.crave-site-mode .footer-topline a:visited,
body.crave-site-mode .footer-legal-link,
body.crave-site-mode .footer-legal-link:visited {
    color: #c9a76a;
    text-decoration: none;
}

body.crave-site-mode .footer-support a:hover,
body.crave-site-mode .footer-advertisers:hover,
body.crave-site-mode .footer-topline a:hover,
body.crave-site-mode .footer-legal-link:hover {
    color: var(--crave-red-bright, #c41e1e);
    text-shadow: 0 0 10px rgba(196, 30, 30, 0.65), 0 0 22px rgba(139, 21, 25, 0.4);
}

/* Site mode: reviews — карточки без жёсткой рамки */
body.crave-site-mode .review-card {
    border: 1px solid rgba(80, 16, 16, 0.16);
    background: rgba(6, 5, 7, 0.82);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.42);
}

body.crave-site-mode .review-form-box {
    border: 1px solid rgba(80, 16, 16, 0.16);
    background: rgba(6, 5, 7, 0.82);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.42);
}

/* Prevent content flash: начальное скрытие age/lang gate в PWA уже в CSS-блоке выше */

/* Site mode: home-mobile-only-bar — скрыт везде (уже есть правило, дублируем для надёжности) */
body.crave-site-mode .home-mobile-only-bar {
    display: none !important;
}

/* ═══════════════════════════════════════════════════════════════════
   MOBILE SITE MODE POLISH  (≤ 768px, real phone browsers)
   Streamlined, touch-first experience — mirrors PWA quality on web
   ═══════════════════════════════════════════════════════════════════ */

/* ── Header pill: compact on phone ── */
@media (max-width: 768px) {
    .site-header.site-header-pill {
        top: 8px;
        left: 8px;
        right: 8px;
    }
    .site-header.site-header-pill .header-pill {
        height: 52px;
        padding: 0 8px;
        border-radius: 999px;
    }
    .site-header.site-header-pill .logo {
        font-size: 1rem;
    }
    #langToggle {
        height: 28px;
        min-width: 88px;
        font-size: 0.77rem;
    }
    .header-pwa-crystals {
        font-size: 0.76rem;
        padding: 0 8px;
        min-height: 26px;
        gap: 4px;
    }
}

/* ── Home: lighter mobile site (reviews stay visible) ── */
@media (max-width: 768px) {
    body.crave-site-mode .intro-section,
    body.crave-site-mode .hero-ad-space,
    body.crave-site-mode .crave-ad-slot-mid,
    body.crave-site-mode .hero-cta-after,
    body.crave-site-mode .home-portal-line,
    body.crave-site-mode .home-mobile-only-bar {
        display: none !important;
    }

    body.crave-site-mode .reviews-section,
    body.crave-site-mode .review-form-section,
    body.crave-site-mode .site-footer {
        display: block !important;
    }

    /* Correct top padding: pill (52px) + top (8px) + gap (16px) = 76px */
    body.crave-site-mode .home-main {
        padding-top: 76px !important;
        padding-bottom: 28px !important;
        min-height: 100dvh;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    body.crave-site-mode .home-main::-webkit-scrollbar {
        display: none;
    }

    /* Banner visible: add banner height */
    html.pwa-install-top-banner-visible body.crave-site-mode .home-main {
        padding-top: calc(var(--pwa-top-banner-h, 40px) + 76px) !important;
    }

    /* CRAVE hero: crisp on phone */
    body.crave-site-mode .home-main .crave-standalone {
        font-size: clamp(2.8rem, 15vw, 4.2rem);
        letter-spacing: 0.18em;
    }

    /* Subtitle / tagline under CRAVE */
    body.crave-site-mode .hero-choice-title {
        margin: 10px 0 18px !important;
        font-size: clamp(1.1rem, 4.8vw, 1.45rem);
        letter-spacing: 0.12em;
    }

    /* Character cards: taller on phone (more immersive) */
    body.crave-site-mode .home-main .characters-grid .char-card {
        height: min(45dvh, 320px) !important;
        border-radius: 16px !important;
    }

    /* Background stays near-black on mobile */
    body.crave-site-mode {
        background: #020202 !important;
        background-image: none !important;
    }
}

/* ── Chat story area: no browser-chrome scroll weirdness on mobile site ── */
@media (max-width: 768px) {
    body.chat-page.crave-site-mode .chat-story-area {
        padding-top: 72px;
        padding-bottom: 250px;
        scrollbar-width: none;
        -ms-overflow-style: none;
        -webkit-overflow-scrolling: touch;
    }
    body.chat-page.crave-site-mode .chat-story-area::-webkit-scrollbar {
        display: none;
    }

    /* Story text: comfortable mobile reading size */
    body.chat-page.crave-site-mode .message-text {
        font-size: clamp(1rem, 4.2vw, 1.12rem);
        line-height: 1.88;
    }

    /* Choice panel: safe-area aware, full-width */
    body.chat-page.crave-site-mode .chat-choice-panel {
        border-radius: 14px !important;
        padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    }
    body.chat-page.crave-site-mode .choice-plaque,
    body.chat-page.crave-site-mode .choice-plaque-premium-hook {
        min-height: 50px !important;
        font-size: 0.88rem;
    }
}

/* ── Shop overlay: full-screen on small phones ── */
@media (max-width: 480px) {
    .site-shop-overlay {
        padding: 0;
        align-items: flex-end;
    }
    .site-shop-panel {
        border-radius: 22px 22px 0 0;
        max-height: 92dvh;
        padding: 20px 14px 28px;
        animation: siteShopSlideUp 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
    }
    @keyframes siteShopSlideUp {
        from { opacity: 0; transform: translateY(40px); }
        to   { opacity: 1; transform: translateY(0); }
    }
    .site-crystal-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .site-crystal-card { padding: 16px 10px; }
    .site-goddess-card { padding: 20px 14px; }
    .site-shop-heading {
        font-size: 1.1rem;
        margin-bottom: 18px;
    }
}

/* ── Character cards: glass always slightly visible on mobile (touch-friendly) ── */
@media (max-width: 768px) and (hover: none) {
    /* On pure-touch devices show a subtle glass peek at rest */
    body.crave-site-mode .home-main .characters-grid .char-glass-panel {
        opacity: 0.22 !important;
        transform: translateY(6px) !important;
    }
    body.crave-site-mode .home-main .characters-grid .char-card.pwa-hovered .char-glass-panel,
    body.crave-site-mode .home-main .characters-grid .char-card.tapped .char-glass-panel {
        opacity: 1 !important;
        transform: translateY(0) !important;
    }
    /* Name always visible on touch */
    body.crave-site-mode .home-main .characters-grid .char-card .char-name {
        opacity: 1 !important;
    }
}
