.guest-preview-lock {
    position: sticky;
    top: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    padding: 0.72rem 1rem;
    color: #f6fbff;
    background: linear-gradient(90deg, #007c9c, #6132bd);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
    font-size: 0.92rem;
}

.guest-preview-lock a {
    color: #07111d;
    background: #fff;
    border-radius: 999px;
    padding: 0.42rem 0.85rem;
    font-weight: 800;
    text-decoration: none;
}

.guest-preview-conversion {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1.5rem;
    align-items: center;
    margin: 1.25rem auto 1.5rem;
    padding: clamp(1.2rem, 3vw, 2rem);
    max-width: 1180px;
    border: 1px solid rgba(0, 212, 255, 0.38);
    border-radius: 22px;
    background: radial-gradient(circle at 8% 15%, rgba(0, 212, 255, 0.24), transparent 30%),
                radial-gradient(circle at 88% 82%, rgba(137, 80, 255, 0.26), transparent 37%),
                linear-gradient(115deg, #10283c, #18143a);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
}

.guest-preview-conversion::after {
    content: '';
    position: absolute;
    width: 12rem;
    height: 12rem;
    right: -5rem;
    top: -7rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 50%;
    pointer-events: none;
}

.guest-preview-conversion__kicker {
    display: inline-flex;
    gap: 0.45rem;
    align-items: center;
    padding: 0.35rem 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    color: #c8f7ff;
    background: rgba(0, 0, 0, 0.16);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.guest-preview-conversion h1 {
    margin: 0.62rem 0 0.4rem;
    color: #fff;
    font-size: clamp(1.35rem, 2.7vw, 2rem);
}

.guest-preview-conversion p {
    max-width: 740px;
    margin: 0;
    color: #cfdaec;
    line-height: 1.55;
}

.guest-preview-benefits {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    color: #ebf8ff;
    font-size: 0.86rem;
}

.guest-preview-benefits span {
    padding: 0.42rem 0.62rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.09);
}

.guest-preview-conversion__actions {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    min-width: 196px;
}

.guest-preview-conversion__actions a {
    text-align: center;
    border-radius: 12px;
    padding: 0.72rem 0.9rem;
    font-weight: 800;
    text-decoration: none;
}

.guest-preview-conversion__register {
    color: #06111c;
    background: linear-gradient(100deg, #20dcff, #a76aff);
    box-shadow: 0 8px 24px rgba(0, 212, 255, 0.3);
}

.guest-preview-conversion__login {
    color: #e8f3ff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.guest-preview-action-toast {
    position: fixed;
    left: 50%;
    bottom: 1.2rem;
    z-index: 100001;
    width: min(440px, calc(100vw - 2rem));
    padding: 1rem;
    border: 1px solid rgba(0, 212, 255, 0.4);
    border-radius: 16px;
    color: #fff;
    background: rgba(12, 19, 36, 0.97);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
    transform: translate(-50%, 140%);
    opacity: 0;
    transition: transform 0.22s ease, opacity 0.22s ease;
}

.guest-preview-action-toast.is-visible {
    transform: translate(-50%, 0);
    opacity: 1;
}

.guest-preview-action-toast strong {
    display: block;
    margin-bottom: 0.28rem;
}

.guest-preview-action-toast p {
    margin: 0 0 0.75rem;
    color: #becbe0;
    font-size: 0.9rem;
}

.guest-preview-action-toast a {
    display: inline-block;
    color: #06111c;
    background: #fff;
    border-radius: 9px;
    padding: 0.48rem 0.75rem;
    font-weight: 800;
    text-decoration: none;
}

.guest-preview-mode main [data-guest-preview-action],
.guest-preview-mode main form,
.guest-preview-mode main button:not(.guest-preview-register),
.guest-preview-mode main input,
.guest-preview-mode main select,
.guest-preview-mode main textarea {
    pointer-events: none !important;
    opacity: 0.62;
}

.guest-preview-mode main .guest-preview-register {
    pointer-events: auto !important;
    opacity: 1 !important;
}

@media (max-width: 720px) {
    .guest-preview-conversion {
        grid-template-columns: 1fr;
        margin: 1rem 0.75rem 1.25rem;
    }

    .guest-preview-conversion__actions {
        flex-direction: row;
        min-width: 0;
    }

    .guest-preview-conversion__actions a {
        flex: 1;
        font-size: 0.88rem;
    }

    .guest-preview-lock {
        font-size: 0.83rem;
    }
}

/* Impersonation Banner */
#impersonation-banner {
    background: linear-gradient(90deg, #ff9800, #ff5722);
    color: #fff;
    text-align: center;
    padding: 10px 20px;
    font-weight: 600;
    font-size: 0.9rem;
    position: sticky;
    top: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

#impersonation-banner .impersonation-end-button {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: #fff;
    padding: 5px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: background 0.2s;
}

#impersonation-banner .impersonation-end-button:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* Navbar Logo */
.navbar-logo-img {
    height: auto !important;
}

.is-hidden {
    display: none !important;
}

.inline-form,
.header-logout-form {
    display: inline;
    margin: 0;
}

.header-logout-button {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.admin-preview-bar {
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 99998;
    flex-wrap: wrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    padding: 8px 20px;
    font-weight: 600;
    font-size: 0.85rem;
    text-align: center;
    background: linear-gradient(90deg, #2c3e50, #34495e);
}

.admin-preview-bar--maintenance {
    background: linear-gradient(90deg, #c0392b, #e74c3c);
}

.admin-preview-bar--impersonating {
    top: 44px !important;
}

.admin-preview-user {
    opacity: 0.8;
}

.admin-preview-actions {
    display: flex;
    gap: 8px;
}

.admin-preview-link,
.admin-preview-button {
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.15);
    text-decoration: none;
}

.admin-preview-link:hover,
    .admin-preview-button:hover {
        background: rgba(255, 255, 255, 0.3);
    }

.menu-link-danger {
    color: #e74c3c;
}

@media (max-width: 768px) {
    .navbar-logo-img {
        height: auto !important;
    }

    .navbar-content {
        height: auto !important;
        min-height: auto !important;
    }

    .mobile-logout-btn {
        width: 100%;
        cursor: pointer;
        margin: 0;
    }

    .mobile-user-actions form {
        margin: 0;
    }
}

.flex-fill {
    flex: 1 1 0%;
    min-width: 0;
}

.notification-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 0%;
    min-width: 0;
}

/* Keep the guest bell label in the accessibility tree without letting text
   scaling turn the visually-hidden copy into intrinsic header width. */
.notification-bell-btn--guest .sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.site-play-creator-cta {
    position: relative;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    min-height: 42px;
    padding: 8px 18px;
    color: #eefcff;
    background: linear-gradient(90deg, #075985, #5b21b6 58%, #7c2d12);
    border-bottom: 1px solid rgba(255,255,255,.16);
    text-decoration: none;
    box-shadow: 0 7px 24px rgba(0,0,0,.2);
}

.site-play-creator-cta:hover,
.site-play-creator-cta:focus,
.site-play-creator-cta.is-active {
    color: #fff;
    background: linear-gradient(90deg, #0369a1, #6d28d9 58%, #9a3412);
}

.site-play-creator-cta:focus-visible,
.lang-toggle:focus-visible,
.mobile-menu-toggle:focus-visible {
    outline: 2px solid #67e8f9;
    outline-offset: 2px;
}

.site-play-creator-cta__question { font-weight: 800; }
.site-play-creator-cta__action {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 10px;
    border-radius: 999px;
    color: #08101c;
    background: #fff;
    font-size: .78rem;
    font-weight: 900;
}

@media (max-width: 540px) {
    .site-play-creator-cta {
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 8px;
        padding-inline: 12px;
        font-size: .8rem;
    }

    .site-play-creator-cta__question {
        flex: 1 1 8rem;
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .site-play-creator-cta__action {
        flex: 0 1 auto; /* GH320 action */
        min-width: 0; /* GH320 action */
        max-width: 100%; /* GH320 action */
        justify-content: center;
        white-space: normal; /* GH320 action */
        overflow-wrap: anywhere;
        text-align: center;
        font-size: .7rem;
    }

    .navbar-mobile {
        width: 100%;
        max-width: 100%; /* GH320 menu */
        min-width: 0;
    }
}

/* Compact language switcher */
.language-dropdown {
    margin-inline: 4px;
}

.lang-toggle {
    gap: 4px;
    min-height: 34px;
    padding: 4px 8px;
    font-size: 0.78rem;
}

.lang-toggle .lang-flag {
    font-size: 1rem;
}

.lang-toggle .lang-chevron {
    font-size: 0.62rem;
}

.lang-menu {
    /* Clear the full navbar instead of opening across its bottom accent line. */
    top: calc(100% + 30px);
    width: 200px;
    max-height: 240px;
    border-radius: 12px;
    transform-origin: top right;
}

.lang-menu-header {
    gap: 7px;
    padding: 7px 10px;
    font-size: 0.8rem;
    line-height: 1.2;
}

/* Five choices remain immediately visible, so a search field adds needless bulk. */
.lang-menu-search {
    display: none;
}

.lang-menu-items {
    max-height: 205px;
    padding: 4px;
}

.lang-item {
    gap: 8px;
    min-height: 32px;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.84rem;
    line-height: 1.2;
}

.lang-item .lang-flag-item {
    font-size: 1.15rem;
}

.lang-item .lang-check {
    font-size: 0.7rem;
}

@media (max-width: 768px) {
    .navbar-actions {
        --mobile-header-control-size: 40px;
    }

    .navbar-actions .notification-bell-btn,
    .navbar-actions .lang-toggle,
    .navbar-actions .mobile-menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: var(--mobile-header-control-size);
        min-width: var(--mobile-header-control-size);
        height: var(--mobile-header-control-size);
        min-height: var(--mobile-header-control-size);
        padding: 0;
        box-sizing: border-box;
        line-height: 1;
    }

    .navbar-actions > .language-dropdown {
        display: block !important;
        margin: 0;
    }

    .navbar-actions .lang-toggle {
        gap: 3px;
        border-color: rgba(255, 255, 255, 0.12);
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.045);
    }

    .navbar-actions .lang-toggle .lang-flag {
        display: none;
    }

    .navbar-actions .lang-toggle .lang-code {
        font-size: 0.72rem;
        font-weight: 800;
        letter-spacing: 0.03em;
    }

    .navbar-actions .lang-toggle .lang-chevron {
        font-size: 0.52rem;
    }

    .navbar-actions .language-dropdown .lang-menu {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        bottom: auto;
        left: auto;
        z-index: 10050;
        width: min(210px, calc(100vw - 20px));
        max-height: min(330px, calc(100dvh - 190px));
        border-radius: 12px;
        transform-origin: top right;
    }

    /* On touch devices a tap can leave :hover active. The explicit class must
       be the only state that keeps the panel open, so a second tap closes it. */
    .navbar-actions .language-dropdown:not(.active) .lang-menu {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none;
        transform: translateY(-8px) !important;
    }

    .navbar-actions .language-dropdown.active .lang-menu {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto;
        transform: translateY(0) !important;
    }

    .navbar-actions .language-dropdown .lang-menu-items {
        max-height: min(300px, calc(100dvh - 235px));
    }

    .navbar-actions .language-dropdown .lang-item {
        min-height: 40px;
        font-size: 0.8rem;
    }
}

@media (max-width: 380px) {
    .navbar-content {
        gap: 6px;
    }

    .navbar-actions {
        --mobile-header-control-size: 38px;
        gap: 4px;
    }

    .navbar-actions .lang-toggle {
        padding-inline: 5px;
    }
}

/* Desktop language flags: use CSS flags so they render consistently even
   when the browser does not have a color-emoji font. Mobile keeps the
   existing emoji-based language pills/menu unchanged. */
.desktop-lang-flag {
    display: none;
    flex: 0 0 auto;
    width: 24px;
    height: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
    vertical-align: middle;
}

@media (min-width: 769px) {
    .language-dropdown .desktop-lang-flag {
        display: inline-block;
    }

    .language-dropdown .lang-item .lang-flag-item {
        display: none;
    }

    .lang-toggle .desktop-lang-flag {
        width: 22px;
        height: 15px;
    }
}

    .desktop-lang-flag--it {
        background: linear-gradient(90deg, #009246 0 33.33%, #f1f2f1 33.33% 66.66%, #ce2b37 66.66% 100%);
    }

    .desktop-lang-flag--en {
        background:
            linear-gradient(90deg, transparent 42%, #fff 42% 58%, transparent 58%),
            linear-gradient(0deg, transparent 38%, #fff 38% 62%, transparent 62%),
            linear-gradient(33deg, transparent 43%, #fff 43% 49%, #c8102e 49% 53%, #fff 53% 59%, transparent 59%),
            linear-gradient(-33deg, transparent 43%, #fff 43% 49%, #c8102e 49% 53%, #fff 53% 59%, transparent 59%),
            #012169;
    }

    .desktop-lang-flag--fr {
        background: linear-gradient(90deg, #0055a4 0 33.33%, #fff 33.33% 66.66%, #ef4135 66.66% 100%);
    }

    .desktop-lang-flag--de {
        background: linear-gradient(180deg, #000 0 33.33%, #dd0000 33.33% 66.66%, #ffce00 66.66% 100%);
    }

    .desktop-lang-flag--es {
        background: linear-gradient(180deg, #aa151b 0 25%, #f1bf00 25% 75%, #aa151b 75% 100%);
    }
