.game-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px clamp(14px, 3vw, 28px);
    padding-top: calc(12px + env(safe-area-inset-top));
    margin-bottom: 22px;
    background: rgba(11, 14, 32, 0.78);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

body.light-theme .game-topbar {
    background: rgba(246, 242, 255, 0.8);
    border-bottom-color: rgba(70, 43, 124, 0.1);
    box-shadow: 0 12px 30px rgba(70, 43, 124, 0.12);
}

.brand-row {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
}

.brand-row .brand {
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--accent), #f97316);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.topbar-subtitle {
    color: var(--muted);
    font-size: 0.8rem;
    font-family: "Nazanin", sans-serif;
    white-space: nowrap;
}

.topbar-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}

.topbar-actions .icon-holder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.topbar-actions .icon-btn {
    width: 46px;
    height: 46px;
    border-radius: 15px;
    background: var(--panel);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s ease, background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
    box-shadow:
        inset 2px 2px 5px rgba(255, 255, 255, 0.06),
        inset -2px -2px 7px rgba(0, 0, 0, 0.18),
        0 4px 10px rgba(0, 0, 0, 0.12);
}

.topbar-actions .icon-btn svg {
    width: 22px;
    height: 22px;
}

.topbar-actions .icon-btn:hover {
    background: var(--panel-strong);
    color: var(--text);
    transform: translateY(-2px);
}

.topbar-actions .icon-btn:active {
    transform: translateY(0) scale(0.94);
}

.topbar-actions .icon-btn:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
    border-radius: 15px;
}

@media (prefers-reduced-motion: reduce) {
    .topbar-actions .icon-btn {
        transition: none;
    }
}

/* ---------------------------------------------------------------
   Tablet & phones — compact, never wraps, touch-friendly
--------------------------------------------------------------- */
@media (max-width: 720px) {
    .game-topbar {
        gap: 8px;
        padding: 10px 12px;
        padding-top: calc(10px + env(safe-area-inset-top));
        margin-bottom: 14px;
    }
    .brand-row {
        gap: 9px;
    }
    .brand-row .brand {
        font-size: 1.25rem;
    }
    .topbar-subtitle {
        display: none;
    }
    .topbar-actions {
        gap: 6px;
    }
    .topbar-actions .icon-btn {
        width: 40px;
        height: 40px;
        border-radius: 13px;
    }
    .topbar-actions .icon-btn svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 380px) {
    .game-topbar {
        gap: 6px;
        padding-inline: 8px;
    }
    .brand-row .brand {
        font-size: 1.2rem;
    }
    .topbar-actions {
        gap: 5px;
    }
    .topbar-actions .icon-btn {
        width: 36px;
        height: 36px;
        border-radius: 12px;
    }
    .topbar-actions .icon-btn svg {
        width: 19px;
        height: 19px;
    }
}