/* -------------------------------------------------------
   RESET
------------------------------------------------------- */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    background-color: #0d0f14;
    color: #f1f3f5;
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

button,
input {
    outline: none;
}

a {
    color: inherit;
    text-decoration: none;
}

.hidden {
    display: none !important;
}


/* -------------------------------------------------------
   MAIN CONTAINER
------------------------------------------------------- */

.container {
    width: min(1000px, calc(100% - 32px));
    margin: 0 auto;
    padding: 50px 0 60px;
}


/* -------------------------------------------------------
   SEARCH SECTION
------------------------------------------------------- */

.search-section {
    width: 100%;
    margin-bottom: 35px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;

    margin-bottom: 25px;
}

.brand-icon {
    width: 48px;
    height: 48px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background-color: #5865f2;
    color: #ffffff;

    font-size: 22px;
    font-weight: 800;
}

.brand h1 {
    margin: 0;

    color: #ffffff;

    font-size: 26px;
    font-weight: 700;
    line-height: 1.2;
}

.brand p {
    margin: 6px 0 0;

    color: #858c9c;

    font-size: 14px;
    line-height: 1.5;
}


/* -------------------------------------------------------
   SEARCH
------------------------------------------------------- */

.search-container {
    display: flex;

    gap: 10px;

    width: 100%;
}

#username {
    flex: 1;

    min-width: 0;
    height: 50px;

    padding: 0 16px;

    border: 1px solid #292e3a;
    border-radius: 10px;

    background-color: #171a22;
    color: #ffffff;

    font-size: 15px;

    transition:
        border-color 0.2s,
        box-shadow 0.2s,
        background-color 0.2s;
}

#username::placeholder {
    color: #727988;
}

#username:hover {
    border-color: #343b4b;
}

#username:focus {
    border-color: #5865f2;

    background-color: #191c25;

    box-shadow:
        0 0 0 3px
        rgba(88, 101, 242, 0.12);
}

#searchButton {
    height: 50px;

    padding: 0 24px;

    border: 0;
    border-radius: 10px;

    background-color: #5865f2;
    color: #ffffff;

    font-size: 14px;
    font-weight: 600;

    transition:
        background-color 0.2s,
        transform 0.1s;
}

#searchButton:hover {
    background-color: #6975f5;
}

#searchButton:active {
    transform: translateY(1px);
}

#searchButton:disabled {
    cursor: wait;
    opacity: 0.65;
}


/* -------------------------------------------------------
   DASHBOARD
------------------------------------------------------- */

.dashboard {
    width: 100%;
}


/* -------------------------------------------------------
   PROFILE
------------------------------------------------------- */

.profile {
    display: flex;
    align-items: center;

    gap: 20px;

    padding: 24px;

    border: 1px solid #242934;
    border-radius: 16px;

    background-color: #14171e;
}

.avatar {
    width: 90px;
    height: 90px;

    flex-shrink: 0;

    border-radius: 14px;

    object-fit: cover;

    background-color: #20242e;
}

.profile-info {
    min-width: 0;
}

.profile-name-row {
    display: flex;
    align-items: center;

    gap: 10px;

    flex-wrap: wrap;
}

#displayName {
    margin: 0;

    color: #ffffff;

    font-size: 25px;
    font-weight: 700;
    line-height: 1.2;
}

#usernameDisplay {
    margin: 5px 0 0;

    color: #8c93a3;

    font-size: 14px;
}

#description {
    margin: 12px 0 0;

    color: #aeb4c1;

    font-size: 14px;
    line-height: 1.5;

    white-space: pre-line;
}

.verified-badge {
    width: 22px;
    height: 22px;

    flex-shrink: 0;
}

.banned-badge {
    display: inline-flex;
    align-items: center;

    padding: 4px 8px;

    border-radius: 6px;

    background-color: #52252a;
    color: #ff858d;

    font-size: 11px;
    font-weight: 700;
}


/* -------------------------------------------------------
   STATS SECTION
------------------------------------------------------- */

.stats-section {
    margin-top: 30px;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 12px;
}

.section-heading h3 {
    margin: 4px 0 0;

    color: #ffffff;

    font-size: 17px;
    font-weight: 650;
}

.section-eyebrow {
    display: block;

    color: #727988;

    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
}


/* -------------------------------------------------------
   STAT GRID
------------------------------------------------------- */

.stats {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 14px;
}

.stat-card {
    position: relative;

    min-width: 0;

    display: flex;
    flex-direction: column;
    align-items: flex-start;

    padding: 20px;

    border: 1px solid #242934;
    border-radius: 14px;

    background-color: #14171e;

    color: #ffffff;

    text-align: left;

    transition:
        border-color 0.2s,
        background-color 0.2s,
        transform 0.2s;
}

button.stat-card {
    width: 100%;
}

.stat-card.clickable {
    cursor: pointer;
}

.stat-card.clickable:hover {
    border-color: #343b4b;

    background-color: #181b23;

    transform: translateY(-1px);
}

.stat-icon {
    width: 32px;
    height: 32px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 15px;

    border-radius: 8px;

    background-color: #20242e;

    color: #aeb4c1;

    font-size: 15px;
    font-weight: 700;
}

.stat-label {
    color: #858c9c;

    font-size: 12px;
}

.stat-card strong {
    display: block;

    margin-top: 6px;

    color: #ffffff;

    font-size: 25px;
    font-weight: 700;
}

.stat-hint {
    display: block;

    margin-top: 5px;

    color: #727988;

    font-size: 11px;
}


/* -------------------------------------------------------
   TOTAL CARD
------------------------------------------------------- */

.total-card {
    display: flex;
    align-items: stretch;

    gap: 30px;

    margin-top: 30px;

    padding: 24px;

    border: 1px solid #242934;
    border-radius: 14px;

    background-color: #14171e;
}

.total-content {
    flex: 1;

    min-width: 0;
}

.total-content h3 {
    margin: 5px 0 0;

    color: #ffffff;

    font-size: 17px;
    font-weight: 650;
}

.total-content > strong {
    display: block;

    margin-top: 12px;

    color: #ffffff;

    font-size: 32px;
    font-weight: 700;
}

.total-content p {
    margin: 5px 0 0;

    color: #727988;

    font-size: 12px;
}

.total-breakdown {
    width: 300px;

    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 10px;

    align-self: center;
}

.total-breakdown > div {
    padding: 15px;

    border-radius: 10px;

    background-color: #101219;
}

.total-breakdown span {
    display: block;

    color: #727988;

    font-size: 11px;
}

.total-breakdown strong {
    display: block;

    margin-top: 5px;

    color: #ffffff;

    font-size: 16px;
}


/* -------------------------------------------------------
   ACCOUNT INFO
------------------------------------------------------- */

.account-info {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-top: 14px;

    padding: 17px 20px;

    border: 1px solid #242934;
    border-radius: 12px;

    background-color: #14171e;
}

.account-info span {
    color: #858c9c;

    font-size: 13px;
}

.account-info strong {
    color: #ffffff;

    font-size: 14px;
    font-weight: 600;
}


/* -------------------------------------------------------
   OVERLAY
------------------------------------------------------- */

.overlay {
    position: fixed;

    inset: 0;

    z-index: 1000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background-color:
        rgba(5, 7, 10, 0.78);

    backdrop-filter: blur(4px);
}


/* -------------------------------------------------------
   MODAL
------------------------------------------------------- */

.modal {
    width: min(850px, 100%);
    max-height: 85vh;

    overflow: hidden;

    border: 1px solid #292e3a;
    border-radius: 16px;

    background-color: #14171e;

    box-shadow:
        0 20px 60px
        rgba(0, 0, 0, 0.45);
}

.groups-modal {
    width: min(900px, 100%);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    padding: 20px 22px;

    border-bottom: 1px solid #242934;
}

.modal-header h2 {
    margin: 5px 0 0;

    color: #ffffff;

    font-size: 19px;
    font-weight: 700;
}

.modal-header p {
    margin: 4px 0 0;

    color: #858c9c;

    font-size: 13px;
}

.close-button {
    width: 34px;
    height: 34px;

    flex-shrink: 0;

    border: 0;
    border-radius: 8px;

    background-color: #20242e;
    color: #aeb4c1;

    font-size: 20px;
    line-height: 1;

    transition:
        background-color 0.2s,
        color 0.2s;
}

.close-button:hover {
    background-color: #292e3a;
    color: #ffffff;
}


/* -------------------------------------------------------
   EXPERIENCE LIST
------------------------------------------------------- */

.games-list {
    max-height: calc(85vh - 95px);

    overflow-y: auto;

    padding: 18px;
}

.games-list {
    display: flex;
    flex-direction: column;

    gap: 10px;
}

.game {
    display: flex;
    align-items: center;

    gap: 14px;

    padding: 12px;

    border: 1px solid #242934;
    border-radius: 11px;

    background-color: #101219;

    transition:
        border-color 0.2s,
        background-color 0.2s;
}

.game:hover {
    border-color: #343b4b;
    background-color: #171a22;
}

.game-thumbnail {
    width: 76px;
    height: 76px;

    flex-shrink: 0;

    border-radius: 9px;

    object-fit: cover;

    background-color: #20242e;
}

.game-info {
    flex: 1;

    min-width: 0;
}

.game-name {
    margin: 0;

    overflow: hidden;

    color: #ffffff;

    font-size: 14px;
    font-weight: 600;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.game-description {
    margin: 5px 0 0;

    overflow: hidden;

    color: #858c9c;

    font-size: 12px;
    line-height: 1.4;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.game-visits {
    flex-shrink: 0;

    color: #ffffff;

    font-size: 13px;
    font-weight: 600;

    text-align: right;
}

.game-visits span {
    display: block;

    margin-top: 2px;

    color: #727988;

    font-size: 11px;
    font-weight: 400;
}

.game-arrow {
    flex-shrink: 0;

    margin-top: 0;

    color: #727988 !important;

    font-size: 16px !important;
}


/* -------------------------------------------------------
   GROUP LIST
------------------------------------------------------- */

.groups-list {
    max-height: calc(85vh - 95px);

    overflow-y: auto;

    padding: 18px;
}

.groups-list {
    display: flex;
    flex-direction: column;

    gap: 14px;
}


/* -------------------------------------------------------
   GROUP
------------------------------------------------------- */

.group {
    overflow: hidden;

    border: 1px solid #242934;
    border-radius: 14px;

    background-color: #101219;
}


/* -------------------------------------------------------
   GROUP HEADER
------------------------------------------------------- */

.group-header {
    display: flex;
    align-items: center;

    gap: 14px;

    padding: 16px;

    border-bottom: 1px solid #242934;
}


/* -------------------------------------------------------
   GROUP ICON
------------------------------------------------------- */

.group-icon {
    width: 48px;
    height: 48px;

    min-width: 48px;
    min-height: 48px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;

    border-radius: 10px;

    background-color: #252936;
    color: #ffffff;

    font-size: 20px;
    font-weight: 700;

    line-height: 1;
}

.group-icon img {
    display: block;

    width: 100%;
    height: 100%;

    min-width: 0;
    min-height: 0;

    object-fit: cover;
}


/* -------------------------------------------------------
   GROUP INFO
------------------------------------------------------- */

.group-info {
    flex: 1;

    min-width: 0;
}

.group-name {
    display: block;

    overflow: hidden;

    color: #ffffff;

    font-size: 15px;
    font-weight: 700;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.group-name:hover {
    text-decoration: underline;
}

.group-role {
    margin: 4px 0 0;

    overflow: hidden;

    color: #858c9c;

    font-size: 12px;

    text-overflow: ellipsis;
    white-space: nowrap;
}


/* -------------------------------------------------------
   GROUP VISITS
------------------------------------------------------- */

.group-visits {
    flex-shrink: 0;

    min-width: 90px;

    text-align: right;
}

.group-visits strong {
    display: block;

    color: #ffffff;

    font-size: 14px;
}

.group-visits span {
    display: block;

    margin-top: 2px;

    color: #727988;

    font-size: 11px;
}


/* -------------------------------------------------------
   GROUP STATS
------------------------------------------------------- */

.group-stats {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 1px;

    background-color: #242934;
}

.group-stat {
    min-width: 0;

    padding: 14px;

    background-color: #14171e;
}

.group-stat span {
    display: block;

    overflow: hidden;

    color: #727988;

    font-size: 11px;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.group-stat strong {
    display: block;

    margin-top: 5px;

    overflow: hidden;

    color: #ffffff;

    font-size: 13px;

    text-overflow: ellipsis;
    white-space: nowrap;
}


/* -------------------------------------------------------
   GROUP GAMES
------------------------------------------------------- */

.group-games {
    display: flex;
    flex-direction: column;

    gap: 8px;

    padding: 12px;
}

.group-game {
    display: flex;
    align-items: center;

    gap: 12px;

    padding: 9px;

    border: 1px solid #242934;
    border-radius: 9px;

    background-color: #101219;

    transition:
        border-color 0.2s,
        background-color 0.2s;
}

.group-game:hover {
    border-color: #343b4b;
    background-color: #181b23;
}

.group-game img {
    width: 58px;
    height: 58px;

    flex-shrink: 0;

    border-radius: 8px;

    object-fit: cover;

    background-color: #20242e;
}

.group-game > div {
    flex: 1;

    min-width: 0;
}

.group-game strong {
    display: block;

    overflow: hidden;

    color: #ffffff;

    font-size: 13px;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.group-game span {
    display: block;

    margin-top: 4px;

    color: #727988;

    font-size: 11px;
}

.group-game b {
    flex-shrink: 0;

    color: #727988;

    font-size: 18px;
}


/* -------------------------------------------------------
   EMPTY STATE
------------------------------------------------------- */

.empty-state {
    padding: 40px 20px;

    color: #727988;

    font-size: 14px;

    text-align: center;
}


/* -------------------------------------------------------
   SCROLLBARS
------------------------------------------------------- */

.games-list::-webkit-scrollbar,
.groups-list::-webkit-scrollbar {
    width: 8px;
}

.games-list::-webkit-scrollbar-track,
.groups-list::-webkit-scrollbar-track {
    background: transparent;
}

.games-list::-webkit-scrollbar-thumb,
.groups-list::-webkit-scrollbar-thumb {
    border-radius: 10px;

    background-color: #292e3a;
}

.games-list::-webkit-scrollbar-thumb:hover,
.groups-list::-webkit-scrollbar-thumb:hover {
    background-color: #343b4b;
}


/* -------------------------------------------------------
   RESPONSIVE
------------------------------------------------------- */

/* -------------------------------------------------------
   PARTOLOGY GROUP LINK
------------------------------------------------------- */

.group-link {
    position: fixed;
    left: 20px;
    bottom: 20px;

    z-index: 900;

    display: flex;
    align-items: center;

    gap: 12px;

    text-decoration: none;
}

.group-link-icon {
    width: 56px;
    height: 56px;

    border-radius: 14px;

    box-shadow:
        0 6px 18px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.08);

    transition:
        transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.45s ease;
}

.group-link-label {
    padding: 8px 12px;

    border-radius: 8px;

    background-color: #20242e;
    color: #ffffff;

    font-size: 14px;
    font-weight: 700;

    white-space: nowrap;

    pointer-events: none;

    opacity: 0;
    transform: translateX(-12px);

    transition:
        opacity 0.3s ease,
        transform 0.3s ease;
}

.group-link:hover .group-link-icon,
.group-link:focus-visible .group-link-icon {
    transform:
        translateY(-6px)
        rotate(-8deg)
        scale(1.12);

    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.5),
        0 0 0 2px #1a9cff,
        0 0 24px rgba(26, 156, 255, 0.65);

    animation:
        group-link-glow 1.6s ease-in-out 0.45s infinite;
}

.group-link:hover .group-link-label,
.group-link:focus-visible .group-link-label {
    opacity: 1;
    transform: translateX(0);
}

.group-link:active .group-link-icon {
    transform:
        translateY(-2px)
        rotate(-4deg)
        scale(0.96);
}

@keyframes group-link-glow {
    0%, 100% {
        box-shadow:
            0 12px 28px rgba(0, 0, 0, 0.5),
            0 0 0 2px #1a9cff,
            0 0 18px rgba(26, 156, 255, 0.5);
    }

    50% {
        box-shadow:
            0 12px 28px rgba(0, 0, 0, 0.5),
            0 0 0 2px #1a9cff,
            0 0 34px rgba(26, 156, 255, 0.9);
    }
}

@media (prefers-reduced-motion: reduce) {
    .group-link-icon,
    .group-link-label {
        transition: none;
        animation: none !important;
    }
}

@media (max-width: 700px) {

    .container {
        width: min(100% - 24px, 1000px);

        padding-top: 25px;
    }

    .brand h1 {
        font-size: 22px;
    }

    .brand p {
        font-size: 13px;
    }

    .profile {
        align-items: flex-start;

        padding: 18px;
    }

    .avatar {
        width: 70px;
        height: 70px;
    }

    #displayName {
        font-size: 21px;
    }

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

    .total-card {
        flex-direction: column;

        gap: 20px;
    }

    .total-breakdown {
        width: 100%;
    }

    .group-stats {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .game-thumbnail {
        width: 64px;
        height: 64px;
    }
}


@media (max-width: 480px) {
    .group-link {
        left: 12px;
        bottom: 12px;
    }

    .group-link-icon {
        width: 44px;
        height: 44px;
    }


    .container {
        width: calc(100% - 20px);

        padding-top: 20px;
    }

    .brand {
        align-items: flex-start;
    }

    .brand-icon {
        width: 42px;
        height: 42px;

        border-radius: 10px;

        font-size: 19px;
    }

    .brand h1 {
        font-size: 20px;
    }

    .brand p {
        font-size: 12px;
    }

    .search-container {
        flex-direction: column;
    }

    #searchButton {
        width: 100%;
    }

    .profile {
        gap: 14px;

        padding: 16px;
    }

    .avatar {
        width: 60px;
        height: 60px;

        border-radius: 10px;
    }

    #displayName {
        font-size: 19px;
    }

    #usernameDisplay {
        font-size: 13px;
    }

    #description {
        font-size: 13px;
    }

    .stat-card {
        padding: 17px;
    }

    .total-card {
        padding: 18px;
    }

    .total-content > strong {
        font-size: 28px;
    }

    .total-breakdown {
        grid-template-columns: 1fr 1fr;
    }

    .account-info {
        padding: 15px 17px;
    }

    .overlay {
        padding: 10px;
    }

    .modal {
        max-height: 90vh;

        border-radius: 13px;
    }

    .modal-header {
        padding: 17px;
    }

    .games-list,
    .groups-list {
        max-height: calc(90vh - 90px);

        padding: 12px;
    }

    .game {
        align-items: flex-start;
    }

    .game-visits {
        display: none;
    }

    .group-header {
        align-items: flex-start;

        flex-wrap: wrap;
    }

    .group-visits {
        width: 100%;

        min-width: 0;

        padding-left: 62px;

        text-align: left;
    }

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

/* -------------------------------------------------------
   FIX GROUP SCROLLING
------------------------------------------------------- */

.groups-list {
    display: flex;
    flex-direction: column;

    gap: 14px;

    max-height: calc(85vh - 95px);

    overflow-y: auto;
    overflow-x: hidden;

    padding: 18px;

    align-items: stretch;
}


/* Prevent group cards from shrinking */
.groups-list .group {
    flex-shrink: 0;
}


/* Keep each group at its natural height */
.groups-list .group-header,
.groups-list .group-stats,
.groups-list .group-games {
    flex-shrink: 0;
}


/* -------------------------------------------------------
   GROUP LIST SCROLLBAR
------------------------------------------------------- */

.groups-list::-webkit-scrollbar {
    width: 8px;
}

.groups-list::-webkit-scrollbar-track {
    background: transparent;
}

.groups-list::-webkit-scrollbar-thumb {
    border-radius: 10px;
    background-color: #292e3a;
}

.groups-list::-webkit-scrollbar-thumb:hover {
    background-color: #343b4b;
}


/* Firefox */
.groups-list {
    scrollbar-width: thin;
}
