* {
    box-sizing: border-box;
}

:root {
    color-scheme: dark;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background:
        radial-gradient(circle at 50% -10%, #112842 0, #06111d 34%, #030810 72%),
        #030810;
    color: #eef6ff;
    font-family: Arial, Helvetica, sans-serif;
}

body {
    min-height: 100vh;
}

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

.profileTopbar {
    min-height: 64px;
    padding: 4px clamp(16px, 4vw, 48px);

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;

    position: sticky;
    top: 0;
    z-index: 20;

    border-bottom: 1px solid rgba(255,255,255,.08);
    background: rgba(5, 9, 14, .93);
    backdrop-filter: blur(14px);
}

.profileLogo {
    width: 190px;
    height: 55px;

    display: flex;
    align-items: center;
}

.profileLogo img {
    width: auto;
    height: 50px;
    max-width: 185px;
    object-fit: contain;
}

.profileNav {
    display: flex;
    gap: 8px;
}

.profileNav a {
    padding: 10px 14px;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 9px;
    background: rgba(255,255,255,.035);
    font-size: 13px;
    font-weight: 700;
}

.profilePage {
    width: min(1020px, calc(100% - 28px));
    margin: 0 auto;
    padding: 34px 0 70px;
}

.profileHero {
    position: relative;
    overflow: hidden;

    min-height: 190px;
    padding: 28px 30px;

    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 22px;
    align-items: center;

    border: 1px solid rgba(70, 213, 255, .28);
    border-radius: 20px;

    background:
        radial-gradient(circle at 14% 10%, rgba(56, 204, 255, .14), transparent 30%),
        radial-gradient(circle at 90% 100%, rgba(255, 184, 29, .08), transparent 28%),
        linear-gradient(135deg, rgba(12, 31, 48, .98), rgba(5, 11, 19, .98));

    box-shadow:
        0 28px 70px rgba(0,0,0,.35),
        inset 0 1px rgba(255,255,255,.035);
}

.profileAvatarWrap {
    position: relative;
    width: 112px;
    height: 112px;
}

.profileAvatar {
    width: 112px;
    height: 112px;

    border-radius: 24px;
    border: 2px solid rgba(94, 224, 255, .7);

    background: #08121c;
    object-fit: cover;

    box-shadow: 0 0 30px rgba(65, 213, 255, .14);
}

.onlineDot {
    position: absolute;
    right: -3px;
    bottom: -3px;

    width: 25px;
    height: 25px;

    border: 5px solid #07111b;
    border-radius: 50%;

    background: #23df77;
}

.profileEyebrow {
    color: #59dcff;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 2.2px;
}

.profileIdentity h1 {
    margin: 7px 0 7px;

    font-size: clamp(28px, 4vw, 44px);
    line-height: 1;
}

.profileIdentity p {
    margin: 0;
    color: #92a5b8;
    font-size: 14px;
}

.playMainBtn {
    min-width: 150px;
    padding: 14px 17px;

    border: 1px solid #ffd33e;
    border-radius: 10px;

    background:
        linear-gradient(180deg, #ffd83e, #d69a00);

    color: #14100a;
    font-size: 13px;
    font-weight: 1000;
    text-align: center;

    box-shadow: 0 8px 30px rgba(255, 180, 0, .12);
}

.loginNotice {
    margin-top: 18px;
    padding: 18px 20px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    border: 1px solid rgba(255, 199, 52, .3);
    border-radius: 14px;
    background: rgba(255, 183, 30, .07);
}

.loginNotice strong {
    color: #ffd657;
}

.loginNotice p {
    margin: 5px 0 0;
    color: #93a1af;
    font-size: 13px;
}

.loginNotice a {
    padding: 10px 13px;
    border-radius: 8px;
    background: #ffd233;
    color: #111;
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}

.profileContent {
    margin-top: 20px;
}

.profileDisabled {
    opacity: .38;
    pointer-events: none;
    filter: grayscale(.4);
}

.statsGrid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.statCard {
    position: relative;
    overflow: hidden;

    min-height: 250px;
    padding: 24px;

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

    border-radius: 17px;
    border: 1px solid rgba(255,255,255,.12);

    background:
        linear-gradient(145deg, rgba(13, 27, 41, .98), rgba(5, 10, 17, .98));

    box-shadow:
        0 20px 55px rgba(0,0,0,.25),
        inset 0 1px rgba(255,255,255,.035);
}

.classicCard {
    border-color: rgba(73, 214, 255, .32);
}

.monthlyCard {
    border-color: rgba(207, 100, 255, .30);
}

.statIcon {
    margin-bottom: 18px;
    font-size: 31px;
}

.statCard > span {
    color: #8ea1b4;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 1.4px;
}

.statCard > strong {
    margin: 6px 0 0;

    color: #ffffff;
    font-size: 60px;
    line-height: 1;
}

.statCard > small {
    margin-top: 5px;
    color: #60758a;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 1px;
}

.rankLine {
    margin-top: 22px;
    color: #8da0b2;
    font-size: 13px;
}

.rankLine b {
    margin-left: 5px;
    color: #ffd44b;
}

.statCard > a {
    margin-top: auto;
    padding-top: 20px;

    color: #62dcff;
    font-size: 11px;
    font-weight: 900;
}

.monthlyCard > a {
    color: #ee94ff;
}

.profileBottomGrid {
    margin-top: 18px;

    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.profilePanel {
    padding: 22px;

    border: 1px solid rgba(255,255,255,.09);
    border-radius: 16px;

    background:
        linear-gradient(145deg, rgba(12, 23, 35, .96), rgba(5, 10, 17, .98));
}

.panelHeading {
    display: flex;
    gap: 11px;
    align-items: center;

    padding-bottom: 17px;
    border-bottom: 1px solid rgba(255,255,255,.07);
}

.panelHeading > span {
    font-size: 25px;
}

.panelHeading h2 {
    margin: 0;
    font-size: 16px;
}

.panelHeading p {
    margin: 4px 0 0;
    color: #71869a;
    font-size: 11px;
}

.skinRow {
    margin-top: 16px;

    display: grid;
    grid-template-columns: 52px minmax(0,1fr) auto;
    gap: 12px;
    align-items: center;

    padding: 12px;

    border: 1px solid rgba(84, 220, 255, .13);
    border-radius: 11px;

    background: rgba(45, 193, 228, .045);
}

.skinPreview {
    width: 52px;
    height: 52px;

    display: grid;
    place-items: center;

    border: 1px solid rgba(94, 223, 255, .3);
    border-radius: 10px;

    background: rgba(69, 204, 238, .08);

    font-size: 27px;
}

.skinInfo strong,
.skinInfo span {
    display: block;
}

.skinInfo strong {
    font-size: 13px;
}

.skinInfo span {
    margin-top: 5px;
    color: #7f92a4;
    font-size: 10px;
}

.skinBadge {
    padding: 6px 8px;
    border-radius: 999px;

    font-size: 8px;
    font-weight: 1000;
    letter-spacing: .5px;
}

.skinBadge.active {
    border: 1px solid rgba(63, 226, 137, .4);
    background: rgba(47, 220, 128, .1);
    color: #61e99e;
}

.skinBadge.owned {
    border: 1px solid rgba(80, 216, 255, .4);
    background: rgba(72, 208, 244, .1);
    color: #72dfff;
}

.skinBadge.locked {
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(255,255,255,.04);
    color: #778593;
}

.panelLink {
    display: inline-block;
    margin-top: 14px;

    color: #60ddff;
    font-size: 11px;
    font-weight: 900;
}

.infoRows {
    margin-top: 10px;
}

.infoRows > div {
    min-height: 48px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;

    border-bottom: 1px solid rgba(255,255,255,.055);
}

.infoRows span {
    color: #778b9d;
    font-size: 11px;
}

.infoRows b {
    color: #eaf3fa;
    font-size: 11px;
    text-align: right;
}

@media (max-width: 700px) {
    .profileTopbar {
        min-height: 58px;
        padding: 2px 12px;
    }

    .profileLogo {
        width: 145px;
        height: 52px;
    }

    .profileLogo img {
        height: 43px;
        max-width: 145px;
    }

    .profileNav a {
        padding: 8px 9px;
        font-size: 10px;
    }

    .profilePage {
        width: min(100% - 20px, 1020px);
        padding-top: 18px;
    }

    .profileHero {
        padding: 20px 16px;

        grid-template-columns: 76px minmax(0, 1fr);
        gap: 14px;
    }

    .profileAvatarWrap,
    .profileAvatar {
        width: 76px;
        height: 76px;
    }

    .profileAvatar {
        border-radius: 18px;
    }

    .onlineDot {
        width: 20px;
        height: 20px;
        border-width: 4px;
    }

    .profileIdentity h1 {
        font-size: 25px;
    }

    .profileIdentity p {
        font-size: 10px;
        line-height: 1.45;
    }

    .profileEyebrow {
        font-size: 8px;
        letter-spacing: 1.3px;
    }

    .playMainBtn {
        grid-column: 1 / -1;

        min-width: 0;
        width: 100%;

        padding: 12px;
    }

    .statsGrid,
    .profileBottomGrid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .statCard {
        min-height: 215px;
        padding: 18px;
    }

    .statCard > strong {
        font-size: 50px;
    }

    .loginNotice {
        align-items: flex-start;
        flex-direction: column;
    }

    .loginNotice a {
        width: 100%;
        text-align: center;
    }
}


/* =========================================================
   FIX LOGIC HIỂN THỊ THÔNG BÁO TÀI KHOẢN
========================================================= */
[hidden] {
    display: none !important;
}


/* =========================================================
   THANH MENU HỒ SƠ - ĐỒNG BỘ TRANG CHỦ / TRANG GAME
========================================================= */

#topBar {
    min-height: 60px;
    padding: 3px 20px;

    display: grid;
    grid-template-columns: auto auto minmax(220px, 1fr) auto;
    align-items: center;
    gap: 16px;

    position: sticky;
    top: 0;
    z-index: 1000;

    border-bottom: 1px solid rgba(255,255,255,.09);
    background: rgba(7, 10, 14, .97);
    backdrop-filter: blur(12px);
}

.topLogo {
    width: 190px;
    height: 55px;

    display: flex;
    align-items: center;
    overflow: hidden;
}

.topLogo img {
    width: auto;
    height: 50px;
    max-width: 185px;
    display: block;
    object-fit: contain;
}

.topMenu,
.topAccount {
    position: relative;
}

#menuBtn,
#accountBtn,
#searchBtn {
    min-height: 38px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 8px;
    background: rgba(255,255,255,.035);
    color: #f4f7fa;
    cursor: pointer;
}

#menuBtn {
    padding: 0 13px;
    font-size: 14px;
    white-space: nowrap;
}

.topSearch {
    width: min(520px, 100%);
    justify-self: center;

    display: grid;
    grid-template-columns: 1fr 44px;
}

.topSearch input {
    min-width: 0;
    height: 38px;
    padding: 0 13px;

    border: 1px solid rgba(255,255,255,.14);
    border-right: 0;
    border-radius: 8px 0 0 8px;

    outline: 0;

    background: rgba(255,255,255,.035);
    color: #fff;
}

#searchBtn {
    border-radius: 0 8px 8px 0;
}

#loggedInAccount {
    position: relative;

    display: flex;
    align-items: center;
    gap: 7px;

    color: #ffd63c;
    font-weight: 800;
    white-space: nowrap;
}

#accountBtn {
    width: 38px;
}

#menuDropdown,
#accountDropdown {
    position: absolute;
    top: calc(100% + 7px);

    min-width: 210px;
    display: none;

    overflow: hidden;

    border: 1px solid rgba(255,255,255,.13);
    border-radius: 10px;

    background: rgba(12, 15, 19, .99);

    box-shadow:
        0 16px 38px rgba(0,0,0,.48);

    backdrop-filter: blur(12px);
}

#menuDropdown {
    left: 0;
}

#accountDropdown {
    right: 0;
    min-width: 165px;
}

#menuDropdown.show,
#accountDropdown.show {
    display: block;
}

#menuDropdown a,
#accountDropdown a,
#accountDropdown button {
    width: 100%;
    min-height: 42px;
    padding: 10px 13px;

    display: flex;
    align-items: center;

    border: 0;
    border-bottom: 1px solid rgba(255,255,255,.055);
    border-radius: 0;

    background: transparent;
    color: #e9eef4;

    font: 700 13px/1.25 Arial, sans-serif;
    text-align: left;
    text-decoration: none;

    white-space: nowrap;
    cursor: pointer;
}

#menuDropdown a:last-child,
#accountDropdown button:last-child {
    border-bottom: 0;
}

#menuDropdown a:hover,
#accountDropdown a:hover,
#accountDropdown button:hover {
    background: rgba(67, 207, 247, .10);
    color: #71ddff;
}

#accountDropdown .profileMenuLink {
    color: #70dfff;
}

#accountDropdown #logoutBtn {
    color: #ff9292;
}

@media (max-width: 700px) {
    #topBar {
        min-height: 58px;
        padding: 3px 10px;

        grid-template-columns:
            minmax(110px, 1fr)
            auto
            auto
            auto;

        gap: 7px;
    }

    .topLogo {
        width: auto;
        max-width: 150px;
        height: 52px;
    }

    .topLogo img {
        height: 43px;
        max-width: 148px;
    }

    #menuBtn {
        min-height: 40px;
        padding: 0 10px;
        font-size: 13px;
    }

    .topSearch {
        width: auto;
        display: block;
    }

    .topSearch input {
        display: none;
    }

    #searchBtn {
        width: 42px;
        height: 40px;
        border-radius: 8px;
    }

    .accountUserIcon {
        display: none;
    }

    #topPlayerName {
        max-width: 95px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #menuDropdown {
        left: auto;
        right: 0;
    }

    #menuDropdown a,
    #accountDropdown a,
    #accountDropdown button {
        min-height: 44px;
        font-size: 13px;
    }
}


/* =========================================================
   TÀI KHOẢN NHẬN THƯỞNG TIỀN MẶT
========================================================= */
.payoutPanel {
    grid-column: 1 / -1;
}

.payoutForm {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.payoutForm label {
    display: block;
}

.payoutForm label > span {
    display: block;
    margin-bottom: 7px;
    color: #8ca0b3;
    font-size: 10px;
    font-weight: 800;
}

.payoutForm input {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid rgba(95, 220, 255, .18);
    border-radius: 9px;
    outline: none;
    background: rgba(255,255,255,.035);
    color: #f3f8fc;
    font: 700 12px Arial, sans-serif;
}

.payoutForm input:focus {
    border-color: rgba(87, 220, 255, .62);
    box-shadow: 0 0 0 3px rgba(61, 207, 247, .08);
}

.payoutForm input::placeholder {
    color: #536779;
    font-weight: 500;
}

.payoutActions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

#payoutSaveBtn {
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid #ffd54a;
    border-radius: 9px;
    background: linear-gradient(180deg, #ffda46, #d49a00);
    color: #151008;
    font-size: 10px;
    font-weight: 1000;
    cursor: pointer;
}

#payoutSaveBtn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.payoutStatus {
    min-height: 16px;
    color: #7e93a5;
    font-size: 10px;
    font-weight: 700;
}

.payoutStatus.saved { color: #68e7a0; }
.payoutStatus.error { color: #ff8c8c; }
.payoutStatus.warning { color: #ffd56a; }

@media (max-width: 700px) {
    .payoutForm {
        grid-template-columns: 1fr;
    }

    .payoutActions {
        grid-column: auto;
        align-items: stretch;
        flex-direction: column;
    }

    #payoutSaveBtn {
        width: 100%;
    }
}
