/* ==========================================================================
   Страница игры (main/game.html)
   Подключается из шаблона game.html. Использует переменные из modern.css.
   Важно: JS-хуки (#game-frame, #game-frame-container, #gw-loader*, #in-canvas-ad-wrapper,
   #pf-side-panel, #rating-container, #fav-btn, #game-info-sheet, .is-premium, .no-ad,
   .gw-banner-off, .gw-highlight) завязаны на gw-host.js — классы/ids не переименовывать.
   ========================================================================== */

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

/* Видимый фокус для всех интерактивных элементов страницы игры */
.game-view-container :is(a, button, [tabindex]):focus-visible {
    outline: 2px solid var(--accent-color, #f59e0b);
    outline-offset: 2px;
}

.game-main-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}
.game-column-left { width: 100%; min-width: 0; }
.game-column-right { display: none; }

.gw-preview-notice {
    margin: 0 0 10px; padding: 10px 16px; border-radius: 12px;
    background: rgba(245, 158, 11, 0.12); border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fcd34d; font-size: 13px;
}
.gw-preview-notice a { color: #fde68a; }

/* --------------------------------------------------------------------------
   Игровая область (десктоп)
   Высота ограничена окном, чтобы игра целиком помещалась над сгибом вместе с панелью.
   -------------------------------------------------------------------------- */
.iframe-wrapper {
    margin-bottom: 0;
    background: #000;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
}
.iframe-wrapper:not(.is-premium) {
    display: flex;
    flex-direction: row;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: calc(100vh - 190px);
    max-height: calc(100dvh - 190px);
    min-height: 360px;
    overflow: clip;
}
.iframe-wrapper iframe {
    flex: 1;
    min-width: 0;
    border: none;
    width: 100%;
    height: 100%;
    background: #000;
}

/* Портретная игра: кадр 9:16 по центру, баннер прижат вплотную к нему */
.iframe-wrapper.gw-orient-portrait:not(.is-premium) {
    aspect-ratio: auto;
    height: calc(100vh - 190px);
    height: calc(100dvh - 190px);
    min-height: 480px;
    justify-content: center;
    background:
        radial-gradient(ellipse at center, rgba(245, 158, 11, .10), transparent 60%),
        #050403;
}
.iframe-wrapper.gw-orient-portrait:not(.is-premium) iframe {
    flex: 0 1 auto;
    width: auto;
    max-width: 100%;
    height: 100%;
    aspect-ratio: 9 / 16;
}

.in-canvas-ad-container {
    width: 15%;
    max-width: 300px;
    min-width: 160px;
    flex-shrink: 0;
    background: rgba(15, 10, 8, .92);
    border-left: 1px solid var(--border-glass, rgba(255, 255, 255, .1));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    overflow-x: clip;
    z-index: 5;
}
.iframe-wrapper.no-ad .in-canvas-ad-container {
    width: 0; min-width: 0; max-width: 0; border: none;
    visibility: hidden; overflow: hidden;
}
/* ads.banner.hide: игра попросила убрать баннер рядом с собой */
.iframe-wrapper.gw-banner-off .in-canvas-ad-container,
.iframe-wrapper.gw-banner-off .pf-side-overlay { display: none !important; }

/* --------------------------------------------------------------------------
   «Премиальный» полноэкранный режим (десктоп)
   -------------------------------------------------------------------------- */
@media (min-width: 1101px) {
    .iframe-wrapper.is-premium {
        display: grid !important;
        aspect-ratio: auto !important;
        border-radius: 0 !important;
        flex-direction: unset !important;
    }
    .iframe-wrapper.is-premium.gw-banner-off { grid-template-columns: 1fr !important; }
    .iframe-wrapper.is-premium .pf-controls-overlay {
        background: rgba(15, 10, 8, .9);
        border-top: 1px solid var(--border-glass, rgba(255, 255, 255, .1));
    }
    .pf-exit-btn { min-height: 40px; padding: 8px 18px; }
    .pf-exit-btn:focus-visible { outline: 2px solid var(--accent-color, #f59e0b); outline-offset: 2px; }
}

/* --------------------------------------------------------------------------
   Загрузчик поверх игры (скрывается по platform.ready, GWHP §4)
   -------------------------------------------------------------------------- */
.gw-loader {
    position: absolute; left: 0; top: 0; width: 100%; height: 100%;
    z-index: 6; display: flex; align-items: center; justify-content: center;
    background:
        radial-gradient(ellipse at 50% 40%, rgba(217, 119, 6, .22) 0%, transparent 60%),
        radial-gradient(ellipse at center, #241611 0%, #0b0705 75%);
    transition: opacity .35s ease, visibility .35s ease;
}
.gw-loader.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.gw-loader-inner { width: min(320px, 70%); text-align: center; }
.gw-loader-icon {
    width: 96px; height: 96px; border-radius: 24px; object-fit: cover;
    box-shadow: 0 14px 44px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 245, 230, .12);
    margin-bottom: 18px;
    animation: gw-pulse 1.6s ease-in-out infinite;
}
.gw-loader-title {
    color: var(--text-primary, #fff); font-weight: 700; font-size: 17px; margin-bottom: 14px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gw-loader-bar { height: 6px; border-radius: 3px; background: rgba(255, 245, 230, .12); overflow: hidden; }
.gw-loader-fill {
    height: 100%; width: 0; border-radius: 3px;
    background: var(--accent-gradient, linear-gradient(90deg, #fbbf24, #d97706));
    transition: width .25s ease;
}
.gw-loader-bar.is-indeterminate .gw-loader-fill { width: 35%; animation: gw-indet 1.2s ease-in-out infinite; }
.gw-loader-pct { color: var(--text-secondary, #d1a586); font-size: 13px; margin-top: 10px; min-height: 18px; }
@keyframes gw-indet { 0% { transform: translateX(-100%); } 100% { transform: translateX(290%); } }
@keyframes gw-pulse { 50% { transform: scale(.94); } }

/* social.rate: подсветка виджета оценки */
.rating-display.gw-highlight { border-radius: 10px; animation: gw-glow .8s ease 3; }
@keyframes gw-glow { 50% { box-shadow: 0 0 0 6px rgba(245, 158, 11, .45); background: rgba(245, 158, 11, .12); } }

/* --------------------------------------------------------------------------
   Панель действий под игрой: название, оценка, избранное, «На весь экран»
   -------------------------------------------------------------------------- */
.gw-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px 24px;
    padding: 16px 24px;
    background: rgba(26, 15, 13, .85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass, rgba(255, 245, 230, .1));
    border-top: 0;
    border-radius: 0 0 18px 18px;
    box-shadow: var(--shadow-soft, 0 8px 32px rgba(0, 0, 0, .5));
}
.gw-bar-main { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1; }
.gw-bar-icon {
    width: 56px; height: 56px; border-radius: 14px; object-fit: cover; flex-shrink: 0;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 245, 230, .1);
}
.gw-bar-text { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.gw-bar-title-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.gw-bar-title {
    font-size: 22px; line-height: 1.2; font-weight: 700; margin: 0;
    color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gw-bar-badge { padding: 4px 12px; font-size: 13px; flex-shrink: 0; color: #1a0f0d; }
.gw-bar-meta {
    display: flex; align-items: center; flex-wrap: wrap; gap: 4px 16px;
    color: var(--text-secondary); font-size: 13px;
}
.gw-bar-meta .play-count { display: inline-flex; align-items: center; gap: 5px; }
.gw-bar-meta .date { font-size: 13px; }

.gw-bar-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.gw-rate { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding-right: 8px; }
.gw-rate .rating-display { margin-left: 0; }
.gw-rate .stars-outer {
    font-size: 24px; cursor: pointer; border-radius: 6px; position: relative;
}
/* Расширенная зона нажатия звёзд (≥44px по высоте) без смещения вёрстки */
.gw-rate .stars-outer::after { content: ""; position: absolute; inset: -12px -6px; }
.gw-rate .stars-outer:focus-visible { outline: 2px solid var(--accent-color, #f59e0b); outline-offset: 4px; }
.gw-rate .rating-value { font-size: 16px; }
.gw-rate .rating-count { color: var(--text-secondary); }
.gw-vote-info { font-size: 12px; color: var(--text-secondary); min-height: 16px; }

.gw-icon-btn {
    width: 48px; height: 48px; padding: 0; flex-shrink: 0;
    border-radius: 12px; color: var(--text-primary);
    border: 1px solid var(--border-glass, rgba(255, 245, 230, .15));
    background: rgba(255, 245, 230, .04);
}
.gw-icon-btn:hover { background: rgba(255, 245, 230, .1); }
.gw-icon-btn.fav-btn.active { color: #ff4757; background: rgba(255, 71, 87, .12); border-color: rgba(255, 71, 87, .4); }

.gw-fs-btn {
    min-height: 48px; padding: 0 26px; font-size: 16px; border-radius: 12px;
    color: #1a0f0d; box-shadow: 0 6px 20px rgba(217, 119, 6, .35);
    white-space: nowrap;
}
.gw-fs-btn:hover { box-shadow: var(--shadow-glow); transform: translateY(-1px); }
.gw-fs-btn:active { transform: translateY(0); }

/* --------------------------------------------------------------------------
   Похожие игры
   -------------------------------------------------------------------------- */
.gw-section-title { font-size: 20px; font-weight: 700; margin: 0 0 16px; color: var(--text-primary); }
.gw-similar { margin-top: 36px; }
.gw-similar-list {
    list-style: none; margin: 0; padding: 0;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px;
}
.gw-sim-card {
    display: flex; flex-direction: column; gap: 10px; height: 100%;
    padding: 10px; border-radius: 16px; text-decoration: none; color: var(--text-primary);
    background: var(--bg-glass, rgba(45, 27, 20, .7));
    border: 1px solid var(--border-glass, rgba(255, 245, 230, .1));
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.gw-sim-card:hover, .gw-sim-card:focus-visible {
    transform: translateY(-3px);
    border-color: rgba(251, 191, 36, .45);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .45);
}
.gw-sim-thumb {
    display: block; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden;
    background: rgba(0, 0, 0, .45);
}
.gw-sim-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.gw-sim-card:hover .gw-sim-thumb img { transform: scale(1.06); }
.gw-sim-nothumb {
    display: flex; align-items: center; justify-content: center; height: 100%;
    color: var(--text-secondary); font-size: 12px;
}
.gw-sim-rating { padding: 0 2px 2px; }
.gw-sim-rating .rating-tag { font-size: 12.5px; }
.gw-sim-name {
    font-size: 14px; font-weight: 600; line-height: 1.3; padding: 0 2px 2px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* --------------------------------------------------------------------------
   Описание
   -------------------------------------------------------------------------- */
.game-description { margin-top: 28px; padding: 24px 28px; border-radius: 18px; }
.game-description .gw-section-title { margin-bottom: 12px; }
.gw-desc-text {
    color: var(--text-secondary); line-height: 1.65; font-size: 15px;
    overflow-wrap: anywhere; max-width: 80ch;
}
.gw-desc-text p, .gw-seo-text p, .gw-faq-answer p { margin: 0 0 .75em; }
.gw-desc-text p:last-child, .gw-seo-text p:last-child, .gw-faq-answer p:last-child { margin-bottom: 0; }
/* Абзацы (<p> из linebreaks) — обрезаем по высоте 4 строк, а не line-clamp. */
.gw-desc-text.is-clamped { max-height: calc(1.65em * 4); overflow: hidden; }
.gw-desc-toggle {
    margin-top: 8px; min-height: 44px; padding: 0 4px; background: none; border: 0; cursor: pointer;
    color: var(--accent-color, #f59e0b); font: inherit; font-weight: 600; font-size: 14px;
}
.gw-desc-toggle:hover { text-decoration: underline; }
.gw-desc-toggle:focus-visible { outline: 2px solid var(--accent-color, #f59e0b); outline-offset: 2px; border-radius: 6px; }
.gw-desc-toggle[hidden] { display: none; }

/* SEO-разделы: как играть, управление, особенности, FAQ, теги */
.gw-seo-section { margin-top: 16px; }
.gw-seo-text, .gw-feature-list, .gw-faq-answer {
    color: var(--text-secondary); line-height: 1.65; font-size: 15px; max-width: 80ch;
    overflow-wrap: anywhere;
}
.gw-feature-list { margin: 0; padding-left: 1.2em; }
.gw-feature-list li { margin: 4px 0; }
.gw-faq { display: flex; flex-direction: column; gap: 8px; max-width: 80ch; }
.gw-faq-item { border: 1px solid var(--border-glass, rgba(255,255,255,.12)); border-radius: 12px; padding: 0 16px; }
.gw-faq-item summary {
    cursor: pointer; padding: 12px 0; font-weight: 600; color: var(--text-primary); list-style-position: inside;
}
.gw-faq-item summary:focus-visible { outline: 2px solid var(--accent-color, #f59e0b); outline-offset: 2px; border-radius: 6px; }
.gw-faq-answer { padding-bottom: 12px; }
.gw-tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 16px 0 0; padding: 0; }
.gw-tag {
    display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 13px;
    background: var(--bg-glass, rgba(255,255,255,.06)); color: var(--text-secondary);
    border: 1px solid var(--border-glass, rgba(255,255,255,.12)); text-decoration: none;
}
.gw-in-collections { margin: 12px 0 0; color: var(--text-secondary); font-size: 14px; line-height: 1.6; }
.gw-in-collections a { color: var(--accent-color, #f59e0b); font-weight: 600; }
a.gw-tag { color: var(--text-primary); }
a.gw-tag:hover, a.gw-tag:focus-visible { border-color: var(--accent-color, #f59e0b); color: var(--accent-color, #f59e0b); }

.sheet-close-btn { display: none; }
.sheet-drag-handle { display: none; }

/* --------------------------------------------------------------------------
   Узкие десктопы / планшеты в «странице» (>1100) — панель в две строки
   -------------------------------------------------------------------------- */
@media (min-width: 1101px) and (max-width: 1280px) {
    .gw-bar { flex-wrap: wrap; }
    .gw-bar-actions { width: 100%; justify-content: flex-end; }
}

/* ==========================================================================
   Мобильный режим (<=1100): игра на весь экран, информация — в нижней шторке
   ========================================================================== */
@media (max-width: 1100px) {
    .game-view-container {
        position: fixed !important;
        inset: 0 !important;
        z-index: 2100 !important;
        background: var(--bg-base, #1a0f0d) !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
    }
    .main-sidebar, .top-navigation { display: none !important; }

    .mobile-game-header {
        display: flex !important;
        align-items: center;
        gap: 8px;
        height: 56px !important;
        flex-shrink: 0 !important;
        padding: 6px max(10px, env(safe-area-inset-right)) 6px max(10px, env(safe-area-inset-left));
        background: rgba(26, 15, 13, .96);
    }
    .mgh-back-btn, .mgh-fs-btn {
        width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px;
        color: var(--text-primary);
    }
    .mgh-back-btn svg, .mgh-fs-btn svg { width: 20px; height: 20px; }
    .mgh-info {
        min-width: 0; min-height: 44px; padding: 0 8px; border: 0; border-radius: 12px;
        background: transparent; color: inherit; font: inherit; justify-content: center;
    }
    .mgh-info:active { background: rgba(255, 245, 230, .08); }
    .mgh-title { min-width: 0; flex: 0 1 auto; max-width: none; }
    .mgh-chevron { flex-shrink: 0; }

    .game-main-layout {
        display: flex !important;
        flex-direction: column !important;
        flex: 1 !important;
        min-height: 0;
        gap: 0 !important;
        width: 100% !important;
        height: auto !important;
        max-width: none;
        overflow: hidden !important;
    }
    .game-column-right { display: none !important; }
    .game-column-left {
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        padding: 0 !important;
        position: relative !important;
        min-height: 0;
    }

    .iframe-wrapper,
    .iframe-wrapper:not(.is-premium),
    .iframe-wrapper.gw-orient-portrait:not(.is-premium) {
        flex: 1 !important;
        min-height: 0;
        max-height: none;
        height: auto;
        width: 100%;
        border-radius: 0 !important;
        margin: 0 !important;
        aspect-ratio: auto !important;
        box-shadow: none;
        justify-content: stretch;
    }
    .iframe-wrapper iframe,
    .iframe-wrapper.gw-orient-portrait:not(.is-premium) iframe {
        flex: 1 !important;
        width: 100% !important;
        max-width: none;
        height: 100% !important;
        aspect-ratio: auto;
    }

    /* Альбомная ориентация: баннер строго справа */
    @media (orientation: landscape) {
        .iframe-wrapper { flex-direction: row !important; }
        .in-canvas-ad-container {
            display: flex !important;
            width: 15vw !important; min-width: 120px !important; max-width: 250px !important;
            height: 100% !important; max-height: 100% !important;
            border-top: none !important;
            border-left: 1px solid var(--border-glass, rgba(255, 255, 255, .1)) !important;
            flex-shrink: 0 !important;
        }
    }
    /* Портретная ориентация: баннер снизу, невысокий, чтобы не съедать игру */
    @media (orientation: portrait) {
        .iframe-wrapper { flex-direction: column !important; }
        .in-canvas-ad-container {
            display: flex !important;
            width: 100% !important; min-width: 100% !important; max-width: 100% !important;
            height: min(12vh, 100px) !important; max-height: min(12vh, 100px) !important;
            min-height: 50px !important;
            border-left: none !important;
            border-top: 1px solid var(--border-glass, rgba(255, 255, 255, .1)) !important;
            flex-shrink: 0 !important;
        }
        /* Портретная игра на телефоне — кадр на всю высоту */
        .iframe-wrapper.gw-orient-portrait .in-canvas-ad-container { display: none !important; }
    }

    /* --- Нижняя шторка с информацией --- */
    .game-info-wrapper {
        position: absolute; left: 0; right: 0; bottom: 0;
        max-height: 82vh; max-height: 82dvh;
        overflow-y: auto; overscroll-behavior: contain;
        padding: 22px 16px max(20px, env(safe-area-inset-bottom));
        background: rgba(26, 15, 13, .98);
        border-top: 1px solid var(--border-glass);
        border-radius: 22px 22px 0 0;
        box-shadow: 0 -12px 40px rgba(0, 0, 0, .6);
        transform: translateY(110%);
        visibility: hidden; /* скрытое содержимое не должно попадать в фокус */
        transition: transform .4s cubic-bezier(.32, .72, 0, 1), visibility 0s linear .4s;
        z-index: 1005;
    }
    .game-info-wrapper.active {
        transform: translateY(0);
        visibility: visible;
        transition: transform .4s cubic-bezier(.32, .72, 0, 1), visibility 0s;
    }
    .sheet-drag-handle {
        display: block; width: 40px; height: 4px; border-radius: 2px;
        background: rgba(255, 245, 230, .25); margin: -12px auto 14px;
    }
    .sheet-close-btn {
        display: flex !important; position: absolute; top: 10px; right: 10px; z-index: 100;
        width: 44px; height: 44px; border: 0; border-radius: 50%;
        background: rgba(255, 245, 230, .1); color: var(--text-primary);
        justify-content: center; align-items: center; cursor: pointer;
    }

    .gw-bar {
        flex-direction: column; align-items: stretch; gap: 14px;
        padding: 0 0 4px; background: transparent; border: 0; border-radius: 0; box-shadow: none;
        backdrop-filter: none; -webkit-backdrop-filter: none;
    }
    .gw-bar-main { padding-right: 44px; }
    .gw-bar-icon { width: 48px; height: 48px; border-radius: 12px; }
    .gw-bar-title { font-size: 19px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
    .gw-bar-title-row { flex-wrap: wrap; gap: 6px 10px; }
    .gw-bar-actions { flex-wrap: wrap; gap: 10px; width: 100%; }
    .gw-rate { flex: 1 1 100%; flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0 12px; }
    .gw-rate .stars-outer { font-size: 28px; }
    .gw-fs-btn { flex: 1 1 auto; min-height: 48px; }

    .gw-similar { margin-top: 24px; }
    .gw-similar-list {
        display: flex; overflow-x: auto; gap: 12px; padding: 2px 16px 10px; margin: 0 -16px;
        scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
    }
    .gw-similar-list > li { flex: 0 0 150px; scroll-snap-align: start; }
    .game-description { margin-top: 12px; padding: 18px; background: rgba(255, 245, 230, .04); }
}

/* Телефон в альбомной ориентации: шапка — вертикальная рейка слева, вся высота отдана игре */
@media (max-width: 1100px) and (orientation: landscape) and (max-height: 520px) {
    .game-view-container { flex-direction: row !important; }
    .mobile-game-header {
        flex-direction: column;
        height: auto !important; width: 60px; flex-shrink: 0;
        padding: 8px 8px max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
        justify-content: space-between;
        border-bottom: 0;
        border-right: 1px solid var(--border-glass);
    }
    .mgh-info { flex: 0 0 auto; padding: 4px; }
    .mgh-title, .mgh-chevron { display: none; }
    .game-info-wrapper { max-height: 90vh; max-height: 90dvh; }
}

@media (max-width: 480px) {
    .gw-sim-name { font-size: 13px; }
    .gw-loader-icon { width: 76px; height: 76px; border-radius: 20px; }
}

/* ==========================================================================
   Подсказка «Оцените игру» (gw-rate-prompt.js)
   Десктоп: выезжает под панелью действий справа (top/right задаёт JS).
   Мобильный: компактная плашка у нижнего края, с учётом safe-area.
   ========================================================================== */
.gw-ratecard[hidden] { display: none !important; }
.gw-ratecard {
    position: fixed; z-index: 1010;
    right: 24px; top: 50%;
    width: 340px; max-width: calc(100vw - 32px);
    display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px 12px;
    padding: 14px 14px 14px 18px;
    color: var(--text-primary);
    background: linear-gradient(160deg, rgba(53, 34, 26, .98), rgba(42, 26, 20, .98));
    border: 1px solid rgba(251, 191, 36, .35);
    border-radius: 16px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, .55), 0 0 0 1px rgba(0, 0, 0, .2);
    opacity: 0; transform: translateY(-10px);
    transition: opacity .28s var(--ease, ease), transform .28s var(--ease, ease);
}
.gw-ratecard.is-in { opacity: 1; transform: translateY(0); }
.gw-ratecard.is-out { opacity: 0; transform: translateY(-6px); }
.gw-ratecard-body { grid-column: 1 / 2; grid-row: 1; min-width: 0; min-height: 44px; display: flex; align-items: center; }
.gw-ratecard-text { display: flex; flex-direction: column; gap: 2px; }
.gw-ratecard-text[hidden], .gw-ratecard-thanks[hidden] { display: none; }
.gw-ratecard-title { font-size: 16px; line-height: 1.25; }
.gw-ratecard-sub { font-size: 13px; line-height: 1.3; color: var(--text-secondary); }
.gw-ratecard-thanks {
    display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px;
    color: var(--accent-light, #fbbf24);
}
.gw-ratecard-stars { grid-column: 1 / -1; grid-row: 2; display: flex; justify-content: space-between; gap: 2px; }
.gw-ratecard.is-thanks .gw-ratecard-stars { display: none; }
.gw-ratecard-star {
    flex: 1 1 0; min-width: 44px; height: 44px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: transparent; border: 0; border-radius: 12px; cursor: pointer;
    color: rgba(255, 245, 230, .3);
    -webkit-tap-highlight-color: transparent;
    transition: color .15s, transform .15s, background .15s;
}
.gw-ratecard-star svg { fill: currentColor; stroke: currentColor; stroke-width: 1; stroke-linejoin: round; }
.gw-ratecard-star.is-on { color: var(--accent-light, #fbbf24); transform: scale(1.08); }
.gw-ratecard-star:active { background: rgba(251, 191, 36, .15); }
.gw-ratecard.is-busy { pointer-events: none; opacity: .85; }
.gw-ratecard-close {
    grid-column: 2; grid-row: 1; align-self: start;
    width: 44px; height: 44px; margin: -6px -4px 0 0; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: 50%; background: transparent; cursor: pointer;
    color: var(--text-secondary);
}
.gw-ratecard-close:hover { background: rgba(255, 245, 230, .1); color: var(--text-primary); }
.gw-ratecard :is(button):focus-visible { outline: 2px solid var(--accent-color, #f59e0b); outline-offset: 1px; }

@media (max-width: 1100px) {
    .gw-ratecard {
        top: auto !important; right: auto !important;
        left: 50%; width: min(360px, calc(100vw - 24px));
        bottom: calc(max(12px, env(safe-area-inset-bottom)) + 4px);
        transform: translate(-50%, 16px);
        padding: 10px 6px 10px 16px;
        border-radius: 18px;
    }
    .gw-ratecard.is-in { transform: translate(-50%, 0); }
    .gw-ratecard.is-out { transform: translate(-50%, 10px); }
    .gw-ratecard-sub { display: none; }
    .gw-ratecard-close { margin: 0; align-self: center; }
}
/* Невысокий экран (телефон в альбомной): всё в одну строку и не по центру игры */
@media (max-width: 1100px) and (orientation: landscape) and (max-height: 520px) {
    .gw-ratecard {
        left: auto; right: max(12px, env(safe-area-inset-right)); width: auto; max-width: 70vw;
        grid-template-columns: auto auto auto; transform: translateY(16px);
    }
    .gw-ratecard.is-in { transform: translateY(0); }
    .gw-ratecard.is-out { transform: translateY(10px); }
    .gw-ratecard-stars { grid-column: 2; grid-row: 1; }
    .gw-ratecard-star { flex: 0 0 44px; }
    .gw-ratecard-close { grid-column: 3; }
}

@media (prefers-reduced-motion: reduce) {
    .gw-loader-icon, .gw-loader-bar.is-indeterminate .gw-loader-fill, .rating-display.gw-highlight { animation: none; }
    .gw-loader, .game-info-wrapper, .gw-sim-card, .gw-sim-thumb img, .stars-inner, .mgh-chevron { transition: none !important; }
    .gw-sim-card:hover, .gw-fs-btn:hover { transform: none; }
    .gw-ratecard, .gw-ratecard-star { transition: none !important; }
    .gw-star-input svg { transition: none; }
}

/* ─── Отзывы игроков (_reviews.html) ───────────────────────────────────── */
.gw-reviews { scroll-margin-top: 80px; }
.gw-reviews-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 16px; color: var(--text-secondary); }
.gw-reviews-avg { display: inline-flex; align-items: center; gap: 6px; color: var(--text-primary); font-size: 18px; }
.gw-reviews-avg svg { color: var(--accent-color, #f59e0b); }
.gw-reviews-empty { color: var(--text-secondary); margin: 0 0 16px; }
.gw-review-list { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.gw-review { border: 1px solid var(--border-glass, rgba(255,255,255,.12)); border-radius: 12px; padding: 12px 16px; }
.gw-review-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-bottom: 6px; }
.gw-review-author { font-weight: 700; color: var(--text-primary); overflow-wrap: anywhere; }
.gw-review-stars { display: inline-flex; gap: 1px; }
.gw-review-stars svg { fill: rgba(255,255,255,.18); }
.gw-review-stars svg.on { fill: var(--accent-color, #f59e0b); }
.gw-review-date { font-size: 13px; color: var(--text-secondary); margin-left: auto; }
.gw-review-text { line-height: 1.55; overflow-wrap: anywhere; }
.gw-review-pager { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 20px; }
.gw-review-pager a { color: var(--accent-color, #f59e0b); font-weight: 600; text-underline-offset: 3px; min-height: 44px; display: inline-flex; align-items: center; }
.gw-review-form { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--border-glass, rgba(255,255,255,.12)); padding-top: 16px; position: relative; }
.gw-review-form-title { font-size: 17px; margin: 0; color: var(--text-primary); }
.gw-review-note { margin: 0; color: var(--text-secondary); font-size: 14px; }
.gw-review-rating { border: 0; margin: 0; padding: 0; min-width: 0; }
.gw-review-rating legend { font-size: 14px; color: var(--text-secondary); margin-bottom: 4px; padding: 0; }
.gw-star-input { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; position: relative; }
.gw-star-input input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.gw-star-input label { cursor: pointer; padding: 6px 3px; line-height: 0; }
.gw-star-input svg { fill: rgba(255,255,255,.18); transition: fill .15s; }
.gw-star-input input:checked ~ label svg,
.gw-star-input label:hover svg, .gw-star-input label:hover ~ label svg { fill: var(--accent-color, #f59e0b); }
.gw-star-input input:focus-visible + label { outline: 2px solid var(--accent-color, #f59e0b); outline-offset: 2px; border-radius: 6px; }
.gw-review-label { font-size: 14px; color: var(--text-secondary); }
.gw-review-input { width: 100%; box-sizing: border-box; background: rgba(0,0,0,.25); color: var(--text-primary); border: 1px solid var(--border-glass, rgba(255,255,255,.12)); border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 16px; }
.gw-review-input:focus-visible { outline: none; border-color: var(--accent-color, #f59e0b); box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.28); }
textarea.gw-review-input { resize: vertical; min-height: 110px; }
.gw-review-hint { margin: 0; font-size: 13px; color: var(--text-secondary); }
.gw-review-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.gw-review-submit { align-self: flex-start; min-height: 44px; margin-top: 4px; }
