/* ==========================================================================
   GG Free — konto Steam, ulubione i oceny
   ========================================================================== */

/* Nawigacja użytkownika --------------------------------------------------- */

.user-nav {
    position: relative;
    flex: none;
}

.detail-header .user-nav,
.legal-header .user-nav {
    margin-left: auto;
}

.steam-login {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 2.4rem;
    padding: 0.55rem 0.9rem;
    border: 1px solid rgba(102, 192, 244, 0.35);
    border-radius: 10px;
    background: linear-gradient(180deg, #1b2838, #16202d);
    color: #dceaf7;
    font-size: 0.82rem;
    font-weight: 750;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.steam-login:hover {
    border-color: rgba(102, 192, 244, 0.7);
    background: linear-gradient(180deg, #22344a, #1a2838);
}

.steam-login:active {
    transform: translateY(1px);
}

.steam-logo {
    flex: none;
    color: #66c0f4;
}

.user-menu {
    position: relative;
}

.user-menu > summary {
    list-style: none;
}

.user-menu > summary::-webkit-details-marker {
    display: none;
}

.user-menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.4rem;
    padding: 0.35rem 0.6rem 0.35rem 0.35rem;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: rgba(13, 20, 29, 0.82);
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease;
}

.user-menu-toggle:hover,
.user-menu[open] .user-menu-toggle {
    border-color: rgba(139, 92, 246, 0.55);
    background: rgba(139, 92, 246, 0.12);
}

.user-avatar {
    display: block;
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: #111a24;
}

.user-avatar--fallback {
    display: grid;
    place-items: center;
    color: #041016;
    font-size: 0.82rem;
    font-weight: 850;
    background: linear-gradient(135deg, var(--green), var(--accent-2));
}

.user-name {
    max-width: 13ch;
    overflow: hidden;
    font-size: 0.82rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-chevron {
    flex: none;
    color: var(--muted);
    transition: transform 0.18s ease;
}

.user-menu[open] .user-chevron {
    transform: rotate(180deg);
}

.user-menu-panel {
    position: absolute;
    top: calc(100% + 0.55rem);
    right: 0;
    z-index: 90;
    width: min(17rem, calc(100vw - 2rem));
    padding: 0.45rem;
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    background: linear-gradient(180deg, #131d28, #0b1118);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.55);
}

.user-menu-id {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin: 0 0 0.35rem;
    padding: 0.55rem 0.65rem;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.68rem;
}

.user-menu-id-label {
    color: #6b7a8f;
    font-family: var(--font);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.user-menu-link,
.user-menu-logout button {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    padding: 0.6rem 0.65rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.user-menu-link:hover,
.user-menu-logout button:hover {
    background: rgba(139, 92, 246, 0.14);
}

.user-menu-link > span {
    width: 1rem;
    color: var(--accent-2);
    text-align: center;
}

.user-menu-logout {
    margin: 0.35rem 0 0;
    padding-top: 0.35rem;
    border-top: 1px solid var(--line);
}

.user-menu-logout button {
    color: #fda4af;
}

.user-menu-logout button > span {
    color: inherit;
}

/* Ulubione na kartach ----------------------------------------------------- */

.favorite-btn {
    position: absolute;
    top: 0.6rem;
    left: 0.6rem;
    z-index: 3;
    display: inline-grid;
    place-items: center;
    width: 2.15rem;
    height: 2.15rem;
    padding: 0;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 50%;
    background: rgba(5, 10, 14, 0.78);
    color: #cbd5e1;
    cursor: pointer;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.favorite-btn:hover {
    color: #fb7185;
    border-color: rgba(251, 113, 133, 0.55);
    transform: scale(1.04);
}

.favorite-btn.is-active {
    color: #fb7185;
    border-color: rgba(251, 113, 133, 0.55);
    background: rgba(251, 113, 133, 0.18);
}

.favorite-btn svg {
    pointer-events: none;
    fill: none;
    transition: fill 0.18s ease;
}

.favorite-btn.is-active svg {
    fill: currentColor;
}

.favorite-btn.is-busy {
    opacity: 0.55;
    pointer-events: none;
}

.card-user-rating {
    margin: 0.15rem 0 0;
    font-size: 0.72rem;
    font-weight: 650;
}

.card-user-rating--up {
    color: #6ee7b7;
}

.card-user-rating--down {
    color: #fda4af;
}

/* Przycisk ulubionych na karcie gry --------------------------------------- */

.btn-favorite {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding: 0.68rem 1.1rem;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: rgba(13, 20, 29, 0.82);
    color: var(--text);
    font-size: 0.86rem;
    font-weight: 750;
    cursor: pointer;
    transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.btn-favorite:hover {
    border-color: rgba(251, 113, 133, 0.55);
    background: rgba(251, 113, 133, 0.12);
    color: #fda4af;
}

.btn-favorite:active {
    transform: translateY(1px);
}

.btn-favorite.is-active {
    border-color: rgba(251, 113, 133, 0.55);
    background: rgba(251, 113, 133, 0.16);
    color: #fda4af;
}

.btn-favorite svg {
    flex: none;
    fill: none;
}

.btn-favorite.is-active svg {
    fill: currentColor;
}

.btn-favorite.is-busy {
    opacity: 0.6;
    pointer-events: none;
}

/* Panel oceny na karcie gry ----------------------------------------------- */

.rating-panel .rating-actions {
    display: flex;
    gap: 0.5rem;
    margin: 0.65rem 0 0.55rem;
}

.rating-btn {
    display: inline-flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 2.5rem;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: rgba(13, 20, 29, 0.82);
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.rating-btn:hover {
    border-color: rgba(148, 163, 184, 0.5);
}

.rating-btn[data-rate="1"].is-active {
    border-color: rgba(52, 211, 153, 0.6);
    background: rgba(52, 211, 153, 0.16);
    color: #a7f3d0;
}

.rating-btn[data-rate="-1"].is-active {
    border-color: rgba(251, 113, 133, 0.6);
    background: rgba(251, 113, 133, 0.16);
    color: #fda4af;
}

.rating-btn.is-busy {
    opacity: 0.55;
    pointer-events: none;
}

.rating-summary {
    margin: 0;
    color: #7f8da2;
    font-size: 0.74rem;
    font-variant-numeric: tabular-nums;
}

.rating-status {
    min-height: 1.1em;
    margin: 0.35rem 0 0;
    color: var(--accent-2);
    font-size: 0.72rem;
}

.rating-status.is-error {
    color: #fda4af;
}

.account-card.is-removing {
    opacity: 0;
    transform: scale(0.97);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.account-toast {
    position: fixed;
    left: 50%;
    bottom: 1.2rem;
    z-index: 200;
    max-width: min(92vw, 34rem);
    padding: 0.7rem 1rem;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: rgba(13, 20, 29, 0.96);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
    color: var(--text);
    font-size: 0.8rem;
    line-height: 1.45;
    transform: translateX(-50%);
}

.account-toast--error {
    border-color: rgba(251, 113, 133, 0.55);
    background: rgba(46, 16, 24, 0.97);
    color: #fecdd3;
}

/* Biblioteka Steam -------------------------------------------------------- */

.owned-badge {
    position: absolute;
    left: 0.55rem;
    bottom: 0.55rem;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.24rem 0.5rem;
    border: 1px solid rgba(52, 211, 153, 0.45);
    border-radius: 999px;
    background: rgba(5, 10, 14, 0.84);
    color: #a7f3d0;
    font-size: 0.66rem;
    font-weight: 750;
    letter-spacing: 0.01em;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.owned-badge > span {
    font-size: 0.72rem;
    line-height: 1;
}

.card.is-owned .thumb img,
.featured-card.is-owned .featured-thumb img {
    filter: grayscale(1) brightness(0.72);
    opacity: 0.8;
}

.card.is-owned .thumb,
.featured-card.is-owned .featured-thumb {
    background: #0b1017;
}

.card.is-owned:hover .thumb img,
.card.is-owned:focus-within .thumb img,
.featured-card.is-owned:hover .featured-thumb img,
.featured-card.is-owned:focus-visible .featured-thumb img {
    filter: none;
    opacity: 1;
}

.owned-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    width: fit-content;
    margin: 0.7rem 0 0;
    padding: 0.3rem 0.65rem;
    border: 1px solid rgba(52, 211, 153, 0.42);
    border-radius: 999px;
    background: rgba(52, 211, 153, 0.11);
    color: #a7f3d0;
    font-size: 0.76rem;
    font-weight: 700;
}

.game-cover.is-owned img {
    filter: grayscale(0.9) brightness(0.78);
}

.library-panel p {
    margin: 0 0 0.6rem;
}

.library-status {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 750;
}

.library-status--ok {
    color: #a7f3d0;
}

.library-status--warning {
    color: #fda4af;
}

.library-status--muted {
    color: var(--muted);
}

.library-meta {
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.55;
}

.library-meta strong {
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.library-help {
    margin-top: 0.8rem !important;
    padding-top: 0.7rem;
    border-top: 1px solid var(--line);
    color: #6b7a8f !important;
    font-size: 0.74rem !important;
}

.library-refresh-form {
    margin-top: 0.9rem;
}

.library-refresh-form .btn-secondary:disabled {
    opacity: 0.6;
    cursor: wait;
}

.rating-hint {
    margin: 0;
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.5;
}

.rating-login {
    margin: 0.5rem 0 0;
}

/* Konto i ulubione -------------------------------------------------------- */

.account-page {
    padding-block: 2rem 3rem;
}

.account-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.2rem;
    padding: clamp(1.1rem, 3vw, 1.7rem);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        radial-gradient(circle at 0% 0%, rgba(139, 92, 246, 0.16), transparent 45%),
        linear-gradient(180deg, var(--panel-2), var(--panel));
}

.account-identity {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    min-width: 0;
}

.account-avatar {
    display: block;
    flex: none;
    width: 5.5rem;
    height: 5.5rem;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 1.2rem;
    object-fit: cover;
    background: #111a24;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.account-avatar--fallback {
    display: grid;
    place-items: center;
    color: #041016;
    font-size: 2.1rem;
    font-weight: 850;
    background: linear-gradient(135deg, var(--green), var(--accent-2));
}

.account-hero h1 {
    margin: 0.1rem 0 0.25rem;
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    letter-spacing: -0.035em;
}

.account-id {
    margin: 0;
    color: #6b7a8f;
    font-size: 0.76rem;
}

.account-id code {
    color: var(--muted);
    font-family: var(--mono);
}

.account-profile-link {
    display: inline-block;
    margin-top: 0.4rem;
    color: var(--accent-2);
    font-size: 0.78rem;
    font-weight: 650;
    text-decoration: none;
}

.account-profile-link:hover {
    text-decoration: underline;
}

.account-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(8rem, 1fr));
    gap: 0.65rem;
    width: min(100%, 24rem);
}

.account-stat {
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(7, 10, 15, 0.42);
}

.account-stat strong {
    display: block;
    color: var(--text);
    font-size: 1.35rem;
    font-weight: 850;
    line-height: 1.1;
    letter-spacing: -0.035em;
    font-variant-numeric: tabular-nums;
}

.account-stat span {
    color: var(--muted);
    font-size: 0.7rem;
}

.account-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 1rem;
}

.account-panel h2 {
    margin: 0 0 0.65rem;
    font-size: 1rem;
}

.account-panel p {
    margin: 0;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.62;
}

.account-panel--danger {
    border-color: rgba(251, 113, 133, 0.28);
}

.account-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1rem;
}

.account-delete-form {
    display: grid;
    gap: 0.8rem;
    margin-top: 1rem;
}

.account-confirm {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.45;
    cursor: pointer;
}

.account-confirm input {
    flex: none;
    width: 1rem;
    height: 1rem;
    margin-top: 0.1rem;
    accent-color: var(--danger);
}

.account-delete-button {
    justify-self: start;
    min-height: 2.5rem;
    padding: 0.55rem 0.95rem;
    border: 1px solid rgba(251, 113, 133, 0.5);
    border-radius: 10px;
    background: rgba(251, 113, 133, 0.12);
    color: #fda4af;
    font-size: 0.8rem;
    font-weight: 750;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease;
}

.account-delete-button:hover {
    border-color: rgba(251, 113, 133, 0.8);
    background: rgba(251, 113, 133, 0.2);
}

.account-notice {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: rgba(13, 20, 29, 0.8);
    color: var(--muted);
    font-size: 0.82rem;
}

.account-notice--error {
    border-color: rgba(251, 113, 133, 0.45);
    background: rgba(251, 113, 133, 0.1);
    color: #fecdd3;
}

.account-view-hero {
    margin-bottom: 1.2rem;
}

.account-grid {
    margin-top: 0.4rem;
}

.account-error {
    display: grid;
    place-items: center;
    min-height: 70vh;
}

.account-error-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

@media (max-width: 720px) {
    .user-name {
        display: none;
    }

    .account-hero {
        align-items: flex-start;
    }

    .account-stats {
        width: 100%;
    }

    .account-identity {
        align-items: flex-start;
    }

    .account-avatar {
        width: 4.4rem;
        height: 4.4rem;
        border-radius: 1rem;
    }
}

@media (max-width: 480px) {
    .steam-login > span {
        display: none;
    }

    .steam-login {
        padding: 0.55rem 0.65rem;
    }

    .account-stats {
        grid-template-columns: 1fr;
    }

    .account-toast {
        bottom: 5.4rem;
    }
}
