.quiz-post-game {
    width: 100%;
    display: grid;
    gap: 14px;
    margin: 4px 0 18px;
}

.qpg-card {
    width: 100%;
    padding: 18px;
    border: 1px solid rgba(139, 92, 246, 0.28);
    border-radius: 20px;
    background: rgba(26, 33, 64, 0.82);
    text-align: left;
}

.qpg-flow-screen {
    display: grid;
    gap: 14px;
}

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

.qpg-flow-title {
    margin: 0;
    color: var(--text-primary);
    font-size: 20px;
    line-height: 1.25;
}

.qpg-flow-next {
    width: 100%;
    min-height: 52px;
    padding: 12px 18px;
    border: 0;
    border-radius: 16px;
    background: #ff3b6f;
    color: #fff;
    font: inherit;
    font-size: 17px;
    font-weight: 800;
    cursor: pointer;
}

.qpg-flow-next:active {
    transform: translateY(1px);
}

.qpg-recap {
    overflow: hidden;
    background:
        radial-gradient(circle at 92% 6%, rgba(255, 59, 111, 0.19), transparent 38%),
        linear-gradient(145deg, rgba(99, 102, 241, 0.20), rgba(26, 33, 64, 0.90));
}

.qpg-kicker {
    display: block;
    margin-bottom: 7px;
    color: #f9a8d4;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.qpg-recap-title,
.qpg-section-title {
    margin: 0;
    color: var(--text-primary);
    font-size: 20px;
    line-height: 1.25;
}

.qpg-recap-copy,
.qpg-section-hint {
    margin: 7px 0 14px;
    color: #aeb7d8;
    font-size: 14px;
    line-height: 1.45;
}

.qpg-conversation {
    display: grid;
    gap: 10px;
    margin-bottom: 15px;
}

.qpg-message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: qpg-message-in 360ms ease both;
}

.qpg-message[hidden] {
    display: none;
}

/* Awards: a title chip and the fact it is for, in the third person. */
.qpg-award {
    align-items: center;
}

.qpg-award-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 8px;
}

.qpg-award-title {
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.25;
}

.qpg-award-title[hidden] {
    display: none;
}

.qpg-award .qpg-message-name {
    color: var(--onboarding-accent, #c4b5fd);
    font-size: 12px;
    font-weight: 700;
}

.qpg-award-text {
    color: rgba(255, 255, 255, .72);
    font-size: 13px;
    line-height: 1.35;
}

/* The award is revealed: the row pops in. */
.qpg-message-bubble--sent {
    animation: qpg-bubble-sent 280ms cubic-bezier(.3, 1.4, .5, 1) both;
    transform-origin: 0 0;
}

.qpg-message-avatar {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    overflow: hidden;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6, #ff3b6f);
    color: #fff;
    font-size: 16px;
    font-weight: 800;
}

.qpg-message-avatar:has(img) {
    background: rgba(255, 255, 255, .08);
}

/* Same framing as the leaderboard avatars, so a player looks identical in both. */
.qpg-message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.qpg-message-body {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.qpg-message-name {
    color: #c4b5fd;
    font-size: 12px;
}

.qpg-message-bubble {
    position: relative;
    display: inline-block;
    padding: 10px 12px;
    border-radius: 4px 14px 14px 14px;
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
    font-size: 14px;
    line-height: 1.35;
}

.qpg-share-button,
.qpg-secondary-button {
    width: 100%;
    min-height: 48px;
    padding: 10px 16px;
    border: 0;
    border-radius: 14px;
    font: inherit;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
}

.qpg-share-button {
    border: 1px solid rgba(167, 139, 250, 0.55);
    background: rgba(139, 92, 246, 0.13);
    color: #ddd6fe;
}

.qpg-share-button:disabled,
.qpg-secondary-button:disabled {
    cursor: wait;
    opacity: 0.65;
}

.qpg-stars {
    display: grid;
    grid-template-columns: repeat(5, minmax(44px, 1fr));
    gap: 5px;
}

.qpg-star {
    min-width: 44px;
    min-height: 48px;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.07);
    color: #59617f;
    font-size: 29px;
    line-height: 1;
    cursor: pointer;
}

.qpg-star.selected {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.12);
}

.qpg-feedback {
    margin-top: 15px;
}

.qpg-feedback[hidden] {
    display: none;
}

.qpg-feedback-title,
.qpg-rating-message,
.qpg-status-loading,
.qpg-access-unavailable {
    margin: 0 0 10px;
    color: #aeb7d8;
    font-size: 13px;
    line-height: 1.4;
}

.qpg-rating-message {
    margin: 11px 0 0;
    color: #c4b5fd;
}

.qpg-rating-modal {
    position: fixed;
    z-index: 100;
    inset: 0;
    display: grid;
    place-items: center;
    padding: max(18px, env(safe-area-inset-top, 0px)) 18px max(18px, env(safe-area-inset-bottom, 0px));
    background: rgba(7, 10, 25, .76);
    backdrop-filter: blur(8px);
}

.qpg-rating-modal[hidden] {
    display: none;
}

.qpg-rating-dialog {
    position: relative;
    width: min(100%, 390px);
    max-height: calc(100dvh - 36px);
    overflow: auto;
    border-radius: 22px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .48);
}

.qpg-rating-dialog .qpg-rating {
    margin: 0;
    padding-top: 54px;
}

.qpg-rating-modal-close {
    position: absolute;
    z-index: 1;
    top: 7px;
    right: 7px;
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #aeb7d8;
    font: inherit;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

.qpg-rating-success {
    min-height: 210px;
    margin: 0;
    padding: 32px 24px;
    display: grid;
    place-items: center;
    border-radius: 22px;
    background: rgba(26, 33, 64, .98);
    color: #fff;
    font-size: 20px;
    font-weight: 800;
    text-align: center;
}

.qpg-rating-success[hidden] {
    display: none;
}

.qpg-reasons {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 10px;
}

.qpg-reason {
    min-height: 48px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: #dbe1ff;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.qpg-reason.selected {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.20);
    color: #fff;
}

.qpg-comment {
    width: 100%;
    margin-bottom: 10px;
    padding: 12px;
    resize: vertical;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 12px;
    outline: none;
    background: rgba(8, 12, 30, 0.55);
    color: #fff;
    font: inherit;
    font-size: 16px;
    line-height: 1.4;
}

.qpg-comment:focus {
    border-color: #8b5cf6;
}

.qpg-secondary-button {
    border: 1px solid rgba(139, 92, 246, 0.55);
    background: rgba(139, 92, 246, 0.13);
    color: #ddd6fe;
}

.qpg-access-line {
    display: flex;
    align-items: center;
    gap: 12px;
}

.qpg-access-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 15px;
    background: linear-gradient(135deg, #7c3aed, #ff3b6f);
    color: #fff;
    font-size: 20px;
    font-weight: 900;
}

.qpg-access-copy {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.qpg-access-copy strong {
    color: #fff;
    font-size: 14px;
}

.qpg-access-copy span {
    color: #aeb7d8;
    font-size: 12px;
    line-height: 1.35;
}

.qpg-access-paywall {
    width: 100%;
    min-height: 48px;
    margin-top: 14px;
    border: 1px solid rgba(167, 139, 250, 0.55);
    border-radius: 14px;
    background: rgba(139, 92, 246, 0.13);
    color: #ddd6fe;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

.qpg-replay-packs {
    display: grid;
    gap: 12px;
}

.qpg-replay-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.qpg-replay-pack {
    position: relative;
    min-width: 0;
    min-height: 48px;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 16px;
    background: #1a2140;
    color: #fff;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform 180ms ease, border-color 180ms ease;
}

.qpg-replay-pack.selected {
    border-color: var(--game-accent, #ff3b6f);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--game-accent, #ff3b6f) 34%, transparent);
}

.qpg-replay-pack:not(:disabled):active {
    transform: scale(.97);
}

.qpg-replay-pack:disabled {
    cursor: default;
    opacity: .68;
}

.qpg-replay-art {
    position: relative;
    display: block;
    aspect-ratio: 1;
    overflow: hidden;
    background: #0d1329;
}

.qpg-replay-art > img:first-child {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.qpg-replay-pack.locked .qpg-replay-art > img:first-child {
    filter: none;
}

/* Same as the pack screens: flat covers stay in full colour and a small flat
   lock sits in a corner (top-left here, the check mark owns top-right). */
.qpg-replay-lock {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 30px;
    height: 30px;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(23, 25, 31, .35));
}

.qpg-replay-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 2px solid rgba(255, 255, 255, .9);
    border-radius: 50%;
    background: var(--game-accent, #ff3b6f);
    color: #fff;
    font-size: 16px;
    font-weight: 900;
    line-height: 1;
    opacity: 0;
    transform: scale(.75);
    transition: opacity 140ms ease, transform 140ms ease;
}

.qpg-replay-pack.selected .qpg-replay-check {
    opacity: 1;
    transform: scale(1);
}

.qpg-replay-copy {
    display: grid;
    gap: 2px;
    padding: 10px 11px 12px;
}

.qpg-replay-copy strong {
    font-size: 14px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.qpg-replay-copy small {
    color: #aeb7d8;
    font-size: 12px;
}

.qpg-replay-pack.locked .qpg-replay-copy small {
    color: #fbbf24;
    font-weight: 800;
}

.qpg-replay-continue {
    width: 100%;
    min-height: 52px;
    padding: 12px 18px;
    border: 0;
    border-radius: 16px;
    background: var(--game-accent, #ff3b6f);
    color: #fff;
    font: inherit;
    font-size: 17px;
    font-weight: 800;
    cursor: pointer;
}

.qpg-replay-continue:disabled {
    background: #59617f;
    cursor: default;
    opacity: .65;
}

/* Guests see the host's packs but can't pick or start: one quiet line says who does. */
.qpg-replay-guest-note {
    margin: 4px 0 0;
    color: var(--text-secondary, #8892b0);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

.qpg-replay-continue:not(:disabled):active {
    transform: translateY(1px);
}

@media (hover: hover) {
    .qpg-replay-pack:not(:disabled):hover {
        transform: translateY(-2px);
        border-color: rgba(255, 255, 255, .28);
    }
}

.qpg-recommendations {
    display: grid;
    gap: 8px;
}

.qpg-game-card {
    min-height: 60px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    text-decoration: none;
}

.qpg-game-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 12px;
    background: rgba(124, 58, 237, 0.18);
    font-size: 22px;
}

.qpg-game-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
    flex: 1;
}

.qpg-game-copy strong {
    font-size: 14px;
}

.qpg-game-copy small {
    overflow: hidden;
    color: #aeb7d8;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qpg-game-arrow {
    color: #a78bfa;
    font-size: 25px;
}

.qpg-recommendations--catalog {
    gap: 12px;
}

.qpg-game-card--catalog {
    position: relative;
    min-height: 118px;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0;
    padding: 14px;
    border-radius: 16px;
    background: #1a2140;
    transition: transform 180ms ease, background 180ms ease;
}

.qpg-game-card--catalog .qpg-game-image {
    width: 76px;
    height: 76px;
    margin-right: 14px;
    overflow: hidden;
    flex: 0 0 auto;
    border-radius: 13px;
}

.qpg-game-card--catalog .qpg-game-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.qpg-game-card--catalog .qpg-game-copy {
    padding-top: 2px;
}

.qpg-game-card--catalog .qpg-game-copy strong {
    color: #ff3b6f;
    font-size: 16px;
    line-height: 1.2;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.qpg-game-card--catalog .qpg-game-copy small {
    margin-top: 6px;
    color: #8892b0;
    font-size: 13px;
    line-height: 1.35;
    white-space: normal;
}

.qpg-game-tags {
    width: 100%;
    display: flex;
    gap: 6px;
    padding-left: 90px;
    margin-top: -18px;
}

.qpg-game-tags span {
    padding: 3px 7px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 12px;
    background: rgba(255, 255, 255, .08);
    color: #8892b0;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
}

@media (hover: hover) {
    .qpg-game-card--catalog:hover {
        transform: translateX(4px);
        background: #252b4a;
    }
}

.qpg-game-card--catalog:active {
    transform: scale(.98);
}

@keyframes qpg-bubble-sent {
    from { opacity: .4; transform: scale(.86); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes qpg-message-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .qpg-message, .qpg-message-bubble--sent { animation: none; }
}

@media (max-width: 360px) {
    .qpg-card { padding: 15px; }
    .qpg-stars { gap: 3px; }
    .qpg-star { padding: 0; font-size: 25px; }
    .qpg-game-copy small { white-space: normal; }
}

@media (orientation: landscape) and (max-height: 560px) {
    .quiz-post-game { grid-template-columns: 1fr 1fr; }
    .qpg-recap,
    .qpg-more-games { grid-column: 1 / -1; }
}

/* A guest tapped a similar game: the note «Игру выбирает хост» pulses once. */
.qpg-recommendations-guest-note { margin-top: 10px; }
.qpg-guest-note-flash { animation: qpg-guest-note-flash 600ms ease both; }
@keyframes qpg-guest-note-flash {
    0% { transform: scale(1); }
    35% { transform: scale(1.06); color: var(--text-primary, #fff); }
    100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) { .qpg-guest-note-flash { animation: none; } }
.qpg-game-card[aria-disabled="true"] { cursor: default; }

/* Trustpilot review invite after a rating (shared/client/game-end/review-invite.ts). */
.qpg-review-invite {
    display: grid;
    gap: 10px;
    text-align: center;
}

.qpg-rating-dialog .qpg-review-invite {
    margin: 0;
    padding-top: 54px;
}

.qpg-review-invite--inline {
    flex-basis: 100%;
    margin-top: 12px;
    padding: 14px 0 0;
    border: 0;
    border-top: 1px solid rgba(139, 92, 246, 0.28);
    border-radius: 0;
    background: transparent;
}

.qpg-review-invite-text {
    margin: 0;
    color: #aeb7d8;
    font-size: 14px;
    line-height: 1.4;
}

.qpg-review-invite-link {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    text-decoration: none;
}

.qpg-review-invite-later {
    min-height: 44px;
    padding: 8px 16px;
    border: 0;
    background: transparent;
    color: #aeb7d8;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}
