:root {
    --world-panel: rgba(6, 20, 34, 0.96);
    --world-panel-light: rgba(15, 39, 59, 0.96);
    --world-border: #4f7189;
    --world-blue: #43b7ff;
    --world-yellow: #ffd83d;
    --world-green: #43df89;
    --world-purple: #bb65ff;
    --world-red: #ff6877;
    --world-ground: #668f50;
    --world-ground-dark: #496d3a;
    --world-path: #ad9b72;
}

body {
    overflow-x: hidden;
    background: #06111f;
}

.game-world {
    position: relative;

    min-width: 1180px;
    min-height: 100vh;

    overflow: hidden;

    background:
        linear-gradient(
            rgba(29, 103, 142, 0.12),
            rgba(6, 17, 31, 0.28)
        ),
        #6b984f;
}

.hud-panel {
    background:
        linear-gradient(
            180deg,
            rgba(17, 43, 62, 0.98),
            rgba(5, 17, 29, 0.98)
        );

    border: 2px solid var(--world-border);
    border-radius: 12px;

    box-shadow:
        0 5px 0 rgba(0, 0, 0, 0.35),
        0 10px 24px rgba(0, 0, 0, 0.35);

    color: #f7fbff;
}

.game-hud {
    position: relative;
    z-index: 30;

    display: grid;
    grid-template-columns: 300px minmax(420px, 1fr) 360px;
    gap: 20px;

    padding: 12px;
}

.player-panel {
    display: flex;
    gap: 14px;

    padding: 14px;
}

.player-panel__avatar {
    width: 76px;
    min-width: 76px;
    height: 76px;

    display: grid;
    place-items: center;

    background: #122b40;
    border: 2px solid #52748d;
    border-radius: 9px;

    font-size: 2.8rem;
}

.player-panel__content {
    flex: 1;
}

.player-panel__title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.player-panel__title h1 {
    margin: 0;

    font-size: 1.2rem;
}

.level-badge {
    display: grid;
    place-items: center;

    min-width: 29px;
    height: 29px;

    background: #1764a0;
    border-radius: 6px;

    color: #fff;
    font-weight: 900;
}

.player-panel__content p {
    margin: 4px 0 8px;

    color: #b8d0df;
    font-size: 0.85rem;
}

.xp-bar {
    position: relative;

    height: 23px;

    overflow: hidden;

    background: #06121e;
    border: 1px solid #566d7c;
    border-radius: 5px;
}

.xp-bar__fill {
    height: 100%;

    background:
        linear-gradient(
            180deg,
            #ffe83f,
            #e5a800
        );
}

.xp-bar span {
    position: absolute;
    inset: 0;

    display: grid;
    place-items: center;

    color: #06121e;
    font-size: 0.75rem;
    font-weight: 900;
}

.player-resources {
    display: flex;
    gap: 20px;

    margin-top: 9px;

    font-weight: 800;
}

.mission-panel {
    display: grid;
    grid-template-columns: 54px 1fr 105px;
    gap: 12px;
    align-items: center;

    padding: 12px 16px;
}

.mission-panel__icon {
    display: grid;
    place-items: center;

    width: 48px;
    height: 58px;

    background: #182c3d;
    border: 1px solid #5a7488;
    border-radius: 7px;

    font-size: 1.8rem;
}

.hud-label {
    color: var(--world-yellow);
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.mission-panel h2 {
    margin: 3px 0;

    font-size: 1.05rem;
}

.mission-panel p {
    margin: 0;

    color: #c0d3df;
    font-size: 0.85rem;
}

.mission-progress {
    height: 9px;

    margin-top: 10px;

    overflow: hidden;

    background: #071521;
    border-radius: 99px;
}

.mission-progress__fill {
    height: 100%;

    background: var(--world-green);
}

.mission-panel__reward {
    display: flex;
    flex-direction: column;
    gap: 3px;

    padding: 8px;

    background: rgba(146, 65, 187, 0.18);
    border: 1px solid rgba(188, 100, 255, 0.45);
    border-radius: 7px;

    text-align: center;
}

.mission-panel__reward span {
    color: #dba6ff;
    font-size: 0.68rem;
    text-transform: uppercase;
}

.mission-panel__reward strong {
    font-size: 0.78rem;
}

.top-menu {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;

    padding: 9px;
}

.top-menu a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;

    min-height: 75px;

    border: 1px solid transparent;
    border-radius: 8px;
}

.top-menu a:hover {
    background: rgba(67, 183, 255, 0.12);
    border-color: rgba(67, 183, 255, 0.45);
}

.top-menu span {
    font-size: 1.8rem;
}

.top-menu small {
    font-weight: 800;
}

.world-map {
    position: relative;

    min-height: 820px;
    padding: 70px 240px 170px;

    background:
        radial-gradient(
            circle at center,
            rgba(180, 217, 135, 0.35),
            transparent 36%
        ),
        repeating-linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.025) 0,
            rgba(255, 255, 255, 0.025) 1px,
            transparent 1px,
            transparent 36px
        ),
        repeating-linear-gradient(
            0deg,
            rgba(0, 0, 0, 0.025) 0,
            rgba(0, 0, 0, 0.025) 1px,
            transparent 1px,
            transparent 36px
        ),
        var(--world-ground);
}

.world-grid {
    position: relative;
    z-index: 5;

    width: 860px;
    min-height: 650px;
    margin: 0 auto;

    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: 250px 180px 250px;
    grid-template-areas:
        "north-west north north-east"
        ". center ."
        "south-west south south-east";
    gap: 20px;
}

.building {
    position: relative;
    z-index: 8;

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

.building--north-west {
    grid-area: north-west;
}

.building--north {
    grid-area: north;
}

.building--north-east {
    grid-area: north-east;
}

.building--south-west {
    grid-area: south-west;
}

.building--south {
    grid-area: south;
}

.building--south-east {
    grid-area: south-east;
}

.building__link {
    position: relative;

    width: 100%;
    height: 100%;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;

    padding: 0;

    background: transparent;
    border: 0;

    color: inherit;
    cursor: pointer;
}

.building__structure {
    position: relative;

    width: 190px;
    height: 135px;

    transition:
        transform 160ms ease,
        filter 160ms ease;
}

.building__link:hover .building__structure {
    transform: translateY(-7px);
    filter: brightness(1.12);
}

.building__roof {
    position: absolute;
    top: 0;
    left: 15px;

    width: 160px;
    height: 44px;

    background:
        linear-gradient(
            180deg,
            #3c596b,
            #1f3442
        );

    border: 4px solid #15232d;
    border-radius: 12px 12px 2px 2px;

    clip-path:
        polygon(
            10% 100%,
            0 45%,
            18% 0,
            82% 0,
            100% 45%,
            90% 100%
        );
}

.building__body {
    position: absolute;
    left: 25px;
    bottom: 0;

    width: 140px;
    height: 100px;

    display: grid;
    place-items: center;

    background:
        linear-gradient(
            90deg,
            #8b9795,
            #c0c5b9,
            #788b8b
        );

    border: 5px solid #2c3c42;
    border-radius: 4px;
}

.building__icon {
    margin-bottom: 23px;

    font-size: 2.5rem;
}

.building__door {
    position: absolute;
    bottom: 0;

    width: 34px;
    height: 44px;

    background: #533823;
    border: 3px solid #2a2119;
}

.building__sign {
    position: relative;
    z-index: 3;

    min-width: 190px;
    padding: 8px 12px;

    background:
        linear-gradient(
            180deg,
            #1b4f72,
            #102b40
        );

    border: 3px solid #132634;
    border-radius: 7px;

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

    text-align: center;
}

.building__sign strong {
    display: block;

    color: #e9f7ff;
    font-size: 0.95rem;
    text-transform: uppercase;
}

.building__sign small {
    display: block;

    margin-top: 3px;

    color: #b9d3df;
    font-size: 0.7rem;
}

.building__notification {
    position: absolute;
    z-index: 10;
    top: 0;
    right: 5px;

    max-width: 135px;
    padding: 8px 9px;

    background: #f8f8f1;
    border: 2px solid #53626a;
    border-radius: 6px;

    color: #17242b;
    font-size: 0.72rem;
    font-weight: 800;
    text-align: center;
}

.building__locked {
    position: absolute;
    bottom: -30px;

    color: #dee5e9;
    font-size: 0.72rem;
}

.building--locked {
    filter: grayscale(0.75);
    opacity: 0.8;
}

.building--coming-soon .building__sign {
    background:
        linear-gradient(
            180deg,
            #674380,
            #342141
        );
}

.central-square {
    grid-area: center;

    position: relative;
    z-index: 7;

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

.central-crystal {
    width: 88px;
    height: 88px;

    display: grid;
    place-items: center;

    background:
        radial-gradient(
            circle,
            rgba(105, 224, 255, 0.7),
            rgba(26, 118, 178, 0.25)
        );

    border: 5px solid rgba(87, 188, 232, 0.55);
    border-radius: 50%;

    box-shadow:
        0 0 25px rgba(73, 194, 255, 0.7);

    animation: crystal-pulse 2.4s ease-in-out infinite;
}

.central-crystal span {
    font-size: 3.5rem;
}

.student-character {
    position: absolute;
    top: 92px;

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

    font-size: 0.75rem;
}

.student-character__avatar {
    font-size: 3.2rem;
}

.square-sign {
    position: absolute;
    top: 170px;

    padding: 7px 28px;

    background: #355829;
    border: 3px solid #273c20;
    border-radius: 5px;

    color: #fff;
    font-weight: 900;
    text-transform: uppercase;
}

.world-path {
    position: absolute;
    z-index: 2;

    background:
        repeating-linear-gradient(
            45deg,
            var(--world-path),
            var(--world-path) 16px,
            #9b895f 16px,
            #9b895f 32px
        );

    opacity: 0.88;
}

.world-path--vertical {
    top: 0;
    bottom: 0;
    left: calc(50% - 55px);

    width: 110px;
}

.world-path--horizontal {
    top: 355px;
    left: 190px;
    right: 190px;

    height: 95px;
}

.objectives-panel {
    position: absolute;
    z-index: 40;
    top: 155px;
    left: 12px;

    width: 215px;
    padding: 12px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.panel-header h2 {
    margin: 0;

    font-size: 0.95rem;
    text-transform: uppercase;
}

.panel-close {
    width: 25px;
    height: 25px;

    padding: 0;

    background: rgba(255, 255, 255, 0.08);
    border: 0;
    border-radius: 4px;

    color: #e7f1f7;
    cursor: pointer;
    font-size: 1.2rem;
}

.objective-group {
    margin-top: 16px;
}

.objective-group h3 {
    margin: 0 0 7px;

    color: var(--world-yellow);
    font-size: 0.78rem;
}

.objective-group--completed h3,
.objective-group--completed .objective-item span {
    color: var(--world-green);
}

.objective-item {
    display: flex;
    gap: 7px;

    margin: 7px 0;

    color: #d7e4eb;
    font-size: 0.74rem;
    line-height: 1.35;
}

.objective-item p {
    margin: 0;
}

.objective-item strong {
    display: block;

    color: #86a8bb;
}

.event-panel {
    position: absolute;
    z-index: 40;
    top: 155px;
    right: 12px;

    width: 235px;
    padding: 14px;
}

.event-panel h2 {
    margin: 9px 0 4px;

    font-size: 1rem;
}

.event-panel p {
    margin: 4px 0;

    color: #c1d3df;
    font-size: 0.78rem;
}

.event-panel__robot {
    position: absolute;
    right: 12px;
    bottom: 10px;

    font-size: 2.5rem;
}

.bottom-menu {
    position: fixed;
    z-index: 50;
    left: 50%;
    bottom: 12px;

    display: flex;
    gap: 7px;

    padding: 9px;

    transform: translateX(-50%);
}

.bottom-menu__item {
    min-width: 84px;
    min-height: 68px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;

    padding: 5px 9px;

    background: transparent;
    border: 1px solid transparent;
    border-radius: 7px;

    color: #f1f6f9;
    cursor: pointer;
}

.bottom-menu__item:hover,
.bottom-menu__item--active {
    background: rgba(67, 183, 255, 0.15);
    border-color: rgba(67, 183, 255, 0.5);
}

.bottom-menu__item span {
    font-size: 1.55rem;
}

.bottom-menu__item small {
    font-size: 0.7rem;
    font-weight: 800;
}

.dialog-panel {
    position: fixed;
    z-index: 70;
    left: 50%;
    bottom: 105px;

    width: min(480px, calc(100% - 30px));

    display: grid;
    grid-template-columns: 50px 1fr 30px;
    gap: 12px;
    align-items: center;

    padding: 14px;

    transform: translateX(-50%);
}

.dialog-panel[hidden] {
    display: none;
}

.dialog-panel__avatar {
    font-size: 2.2rem;
}

.dialog-panel strong {
    color: var(--world-blue);
}

.dialog-panel p {
    margin: 4px 0 0;

    color: #cfdee7;
    font-size: 0.85rem;
}

.map-decoration {
    position: absolute;
    z-index: 1;

    width: 100%;

    overflow: hidden;

    font-size: 3.5rem;
    letter-spacing: 25px;
    opacity: 0.75;
    white-space: nowrap;
}

.map-decoration--top {
    top: 10px;
    left: 0;
}

.map-decoration--bottom {
    bottom: 90px;
    left: 0;
}

@keyframes crystal-pulse {
    0%,
    100% {
        transform: translateY(0) scale(1);
    }

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

@media (max-width: 1250px) {
    .game-world {
        min-width: 1000px;
    }

    .game-hud {
        grid-template-columns: 270px 1fr 310px;
    }

    .world-map {
        padding-right: 190px;
        padding-left: 190px;
    }
}

@media (max-width: 900px) {
    body {
        overflow-x: auto;
    }

    .game-world {
        min-width: 900px;
    }

    .game-hud {
        grid-template-columns: 265px 1fr;
    }

    .top-menu {
        position: absolute;
        top: 122px;
        right: 12px;

        width: 320px;
    }

    .world-map {
        padding-top: 120px;
    }
}

.is-hidden {
    display: none;
}

.npc-layer {
    position: absolute;
    z-index: 20;
    inset: 0;

    pointer-events: none;
}

.world-npc {
    position: absolute;

    width: 110px;

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

    padding: 0;

    transform: translate(-50%, -50%);

    background: transparent;
    border: 0;

    color: #f8fbff;
    cursor: pointer;
    pointer-events: auto;
}

.world-npc__avatar {
    width: 68px;
    height: 68px;

    display: grid;
    place-items: center;

    overflow: hidden;

    background:
        radial-gradient(
            circle,
            rgba(98, 201, 255, 0.35),
            rgba(8, 28, 43, 0.95)
        );

    border: 3px solid #67caff;
    border-radius: 50%;

    box-shadow:
        0 0 0 5px rgba(67, 183, 255, 0.13),
        0 7px 15px rgba(0, 0, 0, 0.4);

    font-size: 2.7rem;

    transition:
        transform 160ms ease,
        filter 160ms ease;
}

.world-npc:hover .world-npc__avatar {
    transform: translateY(-5px) scale(1.08);
    filter: brightness(1.16);
}

.world-npc__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.world-npc__name {
    margin-top: 7px;
    padding: 5px 9px;

    background: rgba(5, 18, 30, 0.94);
    border: 1px solid #52758d;
    border-radius: 5px;

    font-size: 0.7rem;
    font-weight: 900;
    text-align: center;
    white-space: nowrap;
}

.world-npc__mission {
    position: absolute;
    z-index: 4;
    top: -44px;

    width: 38px;
    height: 38px;

    display: grid;
    place-items: center;

    background:
        linear-gradient(
            180deg,
            #ffeb48,
            #efa600
        );

    border: 3px solid #6e4d00;
    border-radius: 50%;

    box-shadow:
        0 5px 0 rgba(0, 0, 0, 0.3),
        0 0 20px rgba(255, 221, 43, 0.6);

    color: #442d00;
    font-size: 1.5rem;
    font-weight: 1000;

    animation: npc-mission-bounce 1.25s ease-in-out infinite;
}

.world-npc__speech {
    position: absolute;
    bottom: 88px;

    min-width: 120px;
    padding: 7px 10px;

    background: #f8f7ee;
    border: 2px solid #334957;
    border-radius: 7px;

    color: #10212c;
    font-size: 0.68rem;
    font-weight: 900;
    text-align: center;

    opacity: 0;
    transform: translateY(5px);

    transition:
        opacity 160ms ease,
        transform 160ms ease;
}

.world-npc:hover .world-npc__speech {
    opacity: 1;
    transform: translateY(0);
}

.world-npc__speech::after {
    content: "";

    position: absolute;
    left: 50%;
    bottom: -8px;

    width: 13px;
    height: 13px;

    transform:
        translateX(-50%)
        rotate(45deg);

    background: #f8f7ee;
    border-right: 2px solid #334957;
    border-bottom: 2px solid #334957;
}

.npc-dialog {
    position: fixed;
    z-index: 100;
    left: 50%;
    bottom: 105px;

    width: min(720px, calc(100% - 32px));

    display: grid;
    grid-template-columns: 115px 1fr;
    gap: 20px;

    padding: 20px;

    transform: translateX(-50%);
}

.npc-dialog[hidden] {
    display: none;
}

.npc-dialog__portrait {
    width: 110px;
    height: 110px;

    display: grid;
    place-items: center;

    overflow: hidden;

    background:
        radial-gradient(
            circle,
            #234b68,
            #091824
        );

    border: 3px solid #5b91b5;
    border-radius: 12px;

    font-size: 4.4rem;
}

.npc-dialog__portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.npc-dialog__role {
    color: var(--world-yellow);
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.npc-dialog h2 {
    margin: 3px 0 10px;

    color: var(--world-blue);
    font-size: 1.2rem;
}

.npc-dialog h3 {
    margin: 0 0 6px;

    font-size: 1rem;
}

.npc-dialog p {
    min-height: 44px;
    margin: 0;

    color: #d1e0e9;
    line-height: 1.55;
}

.npc-dialog__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;

    margin-top: 15px;
}

.npc-dialog__continue,
.npc-dialog__close {
    min-height: 40px;
    padding: 0 17px;

    border-radius: 6px;

    cursor: pointer;
    font-weight: 900;
}

.npc-dialog__continue {
    background:
        linear-gradient(
            180deg,
            #48bdff,
            #188cd0
        );

    border: 1px solid #76d0ff;
    color: #04121d;
}

.npc-dialog__close {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid #516f83;
    color: #eaf3f8;
}

@keyframes npc-mission-bounce {
    0%,
    100% {
        transform: translateY(0);
    }

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

@media (max-width: 700px) {
    .npc-dialog {
        grid-template-columns: 80px 1fr;
        gap: 13px;
    }

    .npc-dialog__portrait {
        width: 76px;
        height: 76px;

        font-size: 3rem;
    }
}