* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: Arial, sans-serif;
    background: #dff4ff;
    color: #333;
}

body {
    overflow-x: hidden;
}

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

button,
input {
    font-family: inherit;
}


/* =========================
   HEADER
========================= */

.top-header {
    height: 64px;
    background: linear-gradient(
        180deg,
        #ffffff,
        #eaf8ff
    );

    border-bottom: 2px solid #9bd7ef;

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

    padding: 0 18px;

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

    box-shadow:
        0 3px 12px
        rgba(0, 80, 120, .15);
}

.header-logo a {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    width: 38px;
    height: 38px;

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

    border-radius: 50%;

    background: #ffd84d;
    color: #9b6200;

    border: 2px solid #e3a900;

    font-size: 22px;
}

.logo-text {
    font-weight: 900;
    color: #188ac0;
    letter-spacing: 1px;
}

.main-navigation {
    display: flex;
    gap: 6px;
}

.main-navigation a {
    padding: 8px 12px;
    border-radius: 10px;
    color: #28677f;
    font-size: 13px;
    font-weight: bold;
    transition: .2s;
}

.main-navigation a:hover {
    background: #c9efff;
    transform: translateY(-2px);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-mini {
    display: flex;
    align-items: center;
    gap: 7px;
}

.user-mini-avatar {
    width: 36px;
    height: 36px;

    overflow: hidden;
    border-radius: 50%;

    background: #d5f3ff;

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

.user-mini-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-name {
    font-weight: bold;
    color: #24657c;
}

.header-wallet {
    padding: 8px 12px;
    background: #fff3b8;
    border: 1px solid #e9c94c;
    border-radius: 10px;
    color: #8a6500;
    font-weight: bold;
}

.btn-login,
.btn-register {
    padding: 9px 14px;
    border-radius: 10px;
    font-weight: bold;
}

.btn-login {
    background: #e2f6ff;
    color: #17779e;
}

.btn-register {
    background: #ffcc4d;
    color: #6e4c00;
}


/* =========================
   MAIN
========================= */

.page-container {
    width: 100%;
    max-width: 1400px;
    margin: auto;
}

.avatar-home {
    padding-bottom: 90px;
}


/* =========================
   CITY MAP
========================= */

.city-map {
    position: relative;

    width: calc(100% - 24px);
    max-width: 1200px;

    height: 680px;

    margin: 20px auto;

    overflow: hidden;

    border-radius: 22px;

    background:
        linear-gradient(
            180deg,
            #91ddff 0%,
            #d5f6ff 42%,
            #8bd06b 43%,
            #65b94f 100%
        );

    border: 5px solid #fff;

    box-shadow:
        0 12px 30px
        rgba(0, 80, 100, .25);
}

#cityCanvas {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    pointer-events: none;
}


/* =========================
   MAP PLAYER INFO
========================= */

.map-player-info {
    position: absolute;

    top: 18px;
    left: 18px;

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

    padding: 8px 12px;

    background: rgba(
        255,
        255,
        255,
        .9
    );

    border-radius: 14px;

    box-shadow:
        0 4px 12px
        rgba(0, 0, 0, .12);

    z-index: 20;
}

.player-avatar-small {
    width: 42px;
    height: 42px;

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

    border-radius: 50%;

    background: #d8f5ff;

    overflow: hidden;
}

.player-avatar-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.map-player-info strong,
.map-player-info span {
    display: block;
}

.map-player-info strong {
    color: #25708e;
}

.map-player-info span {
    font-size: 12px;
    color: #888;
}


/* =========================
   LOCATION
========================= */

.map-location {
    position: absolute;

    top: 20px;
    left: 50%;

    transform: translateX(-50%);

    padding: 9px 18px;

    background: rgba(
        255,
        255,
        255,
        .85
    );

    border-radius: 20px;

    color: #35748a;

    font-weight: bold;

    z-index: 20;
}


/* =========================
   BUILDINGS
========================= */

.map-building {
    position: absolute;

    min-width: 100px;

    padding: 8px;

    text-align: center;

    cursor: pointer;

    z-index: 10;

    transition:
        transform .2s;
}

.map-building:hover {
    transform:
        translateY(-8px)
        scale(1.05);
}

.building-icon {
    width: 90px;
    height: 75px;

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

    font-size: 50px;

    background:
        rgba(
            255,
            255,
            255,
            .5
        );

    border-radius: 25px;

    box-shadow:
        0 6px 12px
        rgba(0, 0, 0, .15);
}

.map-building span {
    display: block;

    margin-top: 5px;

    padding: 4px 9px;

    background: #fff;

    border-radius: 10px;

    color: #397084;

    font-weight: bold;

    font-size: 12px;
}

.building-shop {
    top: 160px;
    left: 12%;
}

.building-vxpay {
    top: 145px;
    right: 13%;
}

.building-event {
    top: 320px;
    left: 5%;
}

.building-farm {
    bottom: 100px;
    left: 15%;
}

.building-fishing {
    bottom: 90px;
    right: 15%;
}


/* =========================
   NPC
========================= */

.map-npc {
    position: absolute;

    border: 0;

    background: transparent;

    cursor: pointer;

    z-index: 30;

    transition: .2s;
}

.map-npc:hover {
    transform:
        translateY(-8px)
        scale(1.1);
}

.npc-shop {
    top: 280px;
    left: 37%;
}

.npc-event {
    top: 260px;
    right: 35%;
}

.npc-icon {
    display: block;

    font-size: 55px;

    filter:
        drop-shadow(
            0 5px 3px
            rgba(0,0,0,.2)
        );
}

.map-npc strong {
    display: block;

    padding: 4px 9px;

    background: white;

    border-radius: 10px;

    color: #286d83;

    font-size: 12px;
}


/* =========================
   PLAYER
========================= */

.map-player {
    position: absolute;

    left: 50%;
    top: 54%;

    width: 100px;

    text-align: center;

    z-index: 50;

    cursor: pointer;

    transition:
        left .25s,
        top .25s;
}

.player-shadow {
    position: absolute;

    width: 70px;
    height: 20px;

    left: 15px;
    bottom: 16px;

    border-radius: 50%;

    background:
        rgba(0, 0, 0, .2);

    filter: blur(3px);
}

.player-aura {
    position: absolute;

    width: 80px;
    height: 80px;

    left: 10px;
    top: 0;

    border-radius: 50%;

    background:
        radial-gradient(
            circle,
            rgba(
                255,
                255,
                255,
                .8
            ),
            transparent 70%
        );

    animation:
        auraPulse 2s
        infinite;
}

.player-sprite {
    position: relative;

    z-index: 2;

    font-size: 46px;

    animation:
        playerIdle 1.8s
        ease-in-out
        infinite;
}

.player-hair {
    height: 28px;
}

.player-body {
    line-height: 30px;
}

.player-clothes {
    margin-top: -8px;
}

.player-feet {
    font-size: 24px;
}

.player-name {
    position: relative;

    z-index: 5;

    display: inline-block;

    padding: 4px 10px;

    margin-top: 2px;

    background: white;

    border-radius: 10px;

    color: #23718b;

    font-size: 12px;

    font-weight: bold;

    box-shadow:
        0 2px 5px
        rgba(0,0,0,.15);
}

@keyframes playerIdle {

    0% {
        transform:
            translateY(0);
    }

    50% {
        transform:
            translateY(-5px);
    }

    100% {
        transform:
            translateY(0);
    }

}

@keyframes auraPulse {

    0% {
        opacity: .4;
        transform: scale(.9);
    }

    50% {
        opacity: .9;
        transform: scale(1.1);
    }

    100% {
        opacity: .4;
        transform: scale(.9);
    }

}


/* =========================
   EVENT
========================= */

.event-banner {
    position: absolute;

    top: 85px;
    right: 18px;

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

    padding: 8px 13px;

    background: #fff8d5;

    border: 2px solid #e7c34e;

    border-radius: 14px;

    color: #805f00;

    z-index: 20;
}

.event-banner span {
    font-size: 12px;
}


/* =========================
   MAP CONTROL
========================= */

.map-controls {
    position: absolute;

    bottom: 18px;
    left: 18px;

    z-index: 100;

    text-align: center;
}

.map-controls button {
    width: 42px;
    height: 38px;

    margin: 2px;

    border: 1px solid #85b8ca;

    border-radius: 10px;

    background: white;

    color: #33778e;

    cursor: pointer;

    font-weight: bold;
}

.map-controls button:hover {
    background: #d9f4ff;
}


/* =========================
   QUICK MENU
========================= */

.quick-menu {
    display: grid;

    grid-template-columns:
        repeat(5, 1fr);

    gap: 12px;

    width: calc(100% - 24px);

    max-width: 1200px;

    margin: auto;
}

.quick-item {
    display: flex;

    flex-direction: column;

    align-items: center;

    gap: 5px;

    padding: 15px;

    background: white;

    border: 1px solid #bde4f1;

    border-radius: 15px;

    color: #36758a;

    transition: .2s;
}

.quick-item:hover {
    transform:
        translateY(-4px);

    box-shadow:
        0 8px 20px
        rgba(0, 100, 130, .15);
}

.quick-item span {
    font-size: 30px;
}


/* =========================
   FEATURE
========================= */

.feature-grid {
    display: grid;

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

    gap: 14px;

    width: calc(100% - 24px);

    max-width: 1200px;

    margin: 18px auto;
}

.feature-card {
    display: flex;

    align-items: center;

    gap: 12px;

    padding: 18px;

    background: white;

    border-radius: 16px;

    border:
        1px solid
        #c7e9f4;

    cursor: pointer;

    transition: .2s;
}

.feature-card:hover {
    transform:
        translateY(-4px);

    box-shadow:
        0 8px 20px
        rgba(0, 80, 120, .12);
}

.feature-card > span {
    font-size: 35px;
}

.feature-card strong,
.feature-card small {
    display: block;
}

.feature-card strong {
    color: #31758b;
}

.feature-card small {
    color: #999;

    margin-top: 4px;
}


/* =========================
   WORLD CHAT
========================= */

.world-chat {
    position: fixed;

    right: 18px;
    bottom: 18px;

    width: 330px;

    background: white;

    border:
        2px solid
        #85cde6;

    border-radius: 16px;

    overflow: hidden;

    z-index: 2000;

    box-shadow:
        0 10px 30px
        rgba(0, 70, 100, .25);
}

.world-chat-header {
    display: flex;

    justify-content: space-between;

    padding: 11px 13px;

    background:
        linear-gradient(
            135deg,
            #36a9d5,
            #68d3ed
        );

    color: white;
}

.world-chat-header button {
    border: 0;

    background: transparent;

    color: white;

    font-size: 20px;

    cursor: pointer;
}

.world-chat-body {
    height: 170px;

    padding: 10px;

    overflow-y: auto;

    background: #f5fcff;
}

.chat-message {
    margin-bottom: 8px;

    padding: 7px 9px;

    background: white;

    border-radius: 9px;

    font-size: 12px;

    line-height: 1.4;
}

.chat-vip {
    color: #d19a00;
}

.chat-admin {
    color: #e64646;
}

.chat-level {
    color: #3487a3;
}

.world-chat-form {
    display: flex;

    padding: 8px;

    border-top:
        1px solid
        #d8edf4;
}

.world-chat-form input {
    flex: 1;

    min-width: 0;

    padding: 9px;

    border:
        1px solid
        #c2e3ed;

    border-radius: 9px 0 0 9px;

    outline: none;
}

.world-chat-form button {
    width: 45px;

    border: 0;

    border-radius:
        0 9px 9px 0;

    background: #36a9d5;

    color: white;

    cursor: pointer;
}


/* =========================
   TOAST
========================= */

.avatar-toast {
    position: fixed;

    top: 80px;
    left: 50%;

    transform:
        translateX(-50%)
        translateY(-20px);

    padding: 11px 20px;

    background:
        rgba(
            30,
            100,
            130,
            .95
        );

    color: white;

    border-radius: 12px;

    opacity: 0;

    pointer-events: none;

    z-index: 3000;

    transition: .3s;
}

.avatar-toast.show {
    opacity: 1;

    transform:
        translateX(-50%)
        translateY(0);
}


/* =========================
   MOBILE NAV
========================= */

.mobile-bottom-nav {
    display: none;
}


/* =========================
   MOBILE
========================= */

@media (
    max-width: 768px
) {

    .top-header {
        height: 56px;
        padding: 0 10px;
    }

    .logo-text {
        font-size: 13px;
    }

    .main-navigation {
        display: none;
    }

    .header-user .user-name,
    .header-wallet {
        display: none;
    }

    .city-map {
        height: 580px;

        width:
            calc(100% - 10px);

        margin-top: 10px;

        border-radius: 15px;
    }

    .map-location {
        font-size: 11px;

        max-width: 180px;

        white-space: nowrap;

        overflow: hidden;
    }

    .event-banner {
        top: 85px;
        right: 8px;

        max-width: 145px;

        flex-wrap: wrap;

        font-size: 11px;
    }

    .building-icon {
        width: 65px;
        height: 55px;

        font-size: 35px;
    }

    .map-building {
        min-width: 70px;
    }

    .map-building span {
        font-size: 10px;
    }

    .building-shop {
        left: 3%;
    }

    .building-vxpay {
        right: 3%;
    }

    .building-event {
        left: 2%;
        top: 330px;
    }

    .building-farm {
        left: 5%;
        bottom: 90px;
    }

    .building-fishing {
        right: 5%;
        bottom: 90px;
    }

    .npc-shop {
        left: 32%;
    }

    .npc-event {
        right: 27%;
    }

    .quick-menu {
        grid-template-columns:
            repeat(5, 1fr);

        gap: 5px;
    }

    .quick-item {
        padding: 9px 3px;

        font-size: 10px;
    }

    .quick-item span {
        font-size: 22px;
    }

    .feature-grid {
        grid-template-columns:
            repeat(2, 1fr);

        gap: 8px;
    }

    .feature-card {
        padding: 12px;

        font-size: 12px;
    }

    .feature-card > span {
        font-size: 26px;
    }

    .world-chat {
        right: 8px;
        bottom: 65px;

        width:
            calc(100% - 16px);

        max-width: 360px;
    }

    .mobile-bottom-nav {
        display: flex;

        position: fixed;

        left: 0;
        right: 0;
        bottom: 0;

        height: 58px;

        background: white;

        border-top:
            1px solid
            #b8dfe9;

        z-index: 2500;

        justify-content:
            space-around;
    }

    .mobile-bottom-nav a {
        display: flex;

        flex-direction: column;

        align-items: center;

        justify-content: center;

        gap: 2px;

        color: #39758a;

        font-size: 19px;
    }

    .mobile-bottom-nav small {
        font-size: 9px;
    }

}