/* Единый верхний бар авторизованного пользователя (id/index.php, id/photos.php) */
.top-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    background: #4285f4;
    color: #fff;
    padding: 0.6rem 1rem;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.4;
}
.top-bar a {
    color: #fff;
    text-decoration: none;
}
.top-bar a:hover {
    text-decoration: underline;
}
.top-bar__user {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}
.top-bar__avatar {
    display: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 0.4rem;
    vertical-align: middle;
}
.top-bar__subscription {
    display: none;
}
.top-bar__menu {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.top-bar__menu > * + *::before {
    content: '·';
    margin: 0 0.35rem;
    opacity: 0.85;
}
.top-bar__menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 30px;
    height: 26px;
    padding: 0;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
}
.top-bar__menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 1px;
    background: currentColor;
}

/* Маленькие экраны: имя пользователя сворачивается в гамбургер-меню */
@media (max-width: 800px) {
    .top-bar {
        flex-wrap: nowrap;
    }
    .top-bar > a {
        flex-shrink: 0;
    }
    .top-bar__user {
        position: relative;
        flex: 1 1 auto;
        min-width: 0;
        flex-wrap: nowrap;
        justify-content: flex-end;
    }
    #user-name {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        min-width: 0;
    }
    .top-bar__menu-toggle {
        display: flex;
        flex-shrink: 0;
    }
    .top-bar__menu {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        margin-top: 0.5rem;
        padding: 0.7rem 1rem;
        min-width: 170px;
        background: #4285f4;
        border-radius: 0 0 10px 10px;
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
        z-index: 500;
    }
    .top-bar__menu--open {
        display: flex;
    }
    .top-bar__menu > * + *::before {
        content: none;
        margin: 0;
    }
}

/* Увеличенная и центрированная кнопка "Войти через Google" — официальный
   виджет Google Identity Services внутри iframe, поэтому единственный
   способ управлять размером — CSS transform. Правило общее для всех страниц
   (index.php, photos.php, community.php), где есть #google-auth-widget.
   display:inline-block (ставится в topbar.js) — чтобы text-align/flex
   родителя реально центрировали сам виджет, а не только контент внутри
   растянутого на всю ширину блока. На узких экранах масштаб меньше, иначе
   кнопка (после ×3 — это ~700px) не поместится на экран телефона. */
#google-auth-widget {
    transform: scale(1.5);
    transform-origin: center;
    margin: 1.6rem 0;
}
@media (min-width: 700px) {
    #google-auth-widget {
        transform: scale(3);
        margin: 3.2rem 0;
    }
}

/* Оверлей оформления подписки */
.subscription-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}
.subscription-overlay--open {
    display: flex;
}
.subscription-overlay__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease;
}
.subscription-overlay__close:hover {
    background: rgba(255, 255, 255, 0.3);
}
.subscription-overlay__content {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    padding: 1.5rem;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}
.subscription-overlay__banner {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 0 0 0.5rem;
}
.subscription-overlay__title {
    color: #fff;
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
}
.subscription-overlay__btn {
    display: block;
    width: 100%;
    padding: 1rem 1.5rem;
    background: #ffcc00;
    color: #000;
    border: none;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 700;
    font-family: inherit;
    text-decoration: none;
    text-align: center;
    box-sizing: border-box;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
}
.subscription-overlay__btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.subscription-overlay__btn--accent {
    background: #168de2;
    color: #fff;
}
.subscription-overlay__btn--white {
    background: #fff;
    color: #000;
}
.subscription-overlay__btn--green {
    background: rgb(76, 219, 76);
    color: #000;
}
.subscription-overlay__note {
    margin: 0.5rem 0 0;
    color: rgba(255, 255, 255, 0.75);
    font-size: 1.2rem;
    line-height: 1.4;
}
