.game-invite-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 10px 0;
    padding: 10px 12px;
    border: 1px solid var(--border-color, #e2e8ee);
    border-radius: 12px;
    background: var(--card-bg, #fff);
    color: var(--title, #172027);
    box-shadow: 0 10px 30px rgba(15, 23, 42, .08);
}

.game-invite-bar div { display: grid; gap: 2px; }
.game-invite-bar small { color: var(--text-light, #687680); }

.game-share-btn,
.game-challenge-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 14px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, #f3c74f, #e6a82d);
    color: #191919;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(230, 168, 45, .2);
}

.game-challenge-btn { min-height: 34px; padding: 0 10px; font-size: .78rem; }
.snake-rank-row,
.ludo-rank-row,
.risk-rank-row { grid-template-columns: 34px minmax(0, 1fr) auto auto !important; }
.game-share-btn.is-done, .game-challenge-btn.is-done { background: #1ea672; color: #fff; }

.game-money-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
    margin: 10px 0;
}

.game-free-limit-note {
    margin: 0;
    padding: 10px 12px;
    border: 1px solid rgba(230, 168, 45, .32);
    border-radius: 10px;
    background: rgba(243, 199, 79, .1);
    color: var(--title, #172027);
    font-size: .78rem;
    line-height: 1.8;
}

.game-money-breakdown > div {
    display: grid;
    gap: 3px;
    padding: 10px;
    border: 1px solid var(--border-color, #e2e8ee);
    border-radius: 10px;
    background: var(--card-bg, #fff);
    color: var(--title, #172027);
}

.game-money-breakdown span { color: var(--text-light, #687680); font-size: .75rem; }
.game-money-breakdown strong { font-size: .92rem; }

.game-share-sheet { position: fixed; inset: 0; z-index: 10050; display: grid; align-items: end; opacity: 0; transition: opacity .18s ease; }
.game-share-sheet.show { opacity: 1; }
.game-share-backdrop { position: absolute; inset: 0; border: 0; background: rgba(3, 8, 18, .62); }
.game-share-card {
    position: relative;
    display: grid;
    gap: 12px;
    width: min(520px, 100%);
    margin: 0 auto;
    padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
    border-radius: 20px 20px 0 0;
    background: var(--card-bg, #fff);
    color: var(--title, #172027);
    transform: translateY(24px);
    transition: transform .18s ease;
}
.game-share-sheet.show .game-share-card { transform: translateY(0); }
.game-share-handle { width: 48px; height: 5px; margin: 0 auto; border-radius: 99px; background: var(--border-color, #d8dee4); }
.game-share-card p { margin: 0; color: var(--text-light, #687680); }
.game-share-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.game-share-options a, .game-share-options button, .game-share-cancel {
    display: grid; place-items: center; min-height: 46px; border: 0; border-radius: 10px;
    background: var(--body-bg, #f1f5f7); color: var(--title, #172027); text-decoration: none; font: inherit; font-weight: 800;
}
.game-share-cancel { width: 100%; background: transparent; color: var(--text-light, #687680); }

.game-invite-target { outline: 3px solid #f3c74f; outline-offset: 3px; animation: gameInvitePulse 1.2s ease 2; }
@keyframes gameInvitePulse { 50% { transform: scale(1.012); } }

@media (max-width: 680px) {
    .snake-rank-row,
    .ludo-rank-row,
    .risk-rank-row {
        grid-template-columns: 34px minmax(0, 1fr) auto !important;
    }
    .snake-rank-row .game-challenge-btn,
    .ludo-rank-row .game-challenge-btn,
    .risk-rank-row .game-challenge-btn {
        grid-column: 2 / -1;
        width: 100%;
    }
    .game-invite-bar { position: sticky; top: 6px; z-index: 20; border-radius: 14px; }
    .game-invite-bar small { display: none; }
    .game-share-btn { min-width: 112px; }
    .game-money-breakdown { grid-template-columns: 1fr 1fr; }
}
