* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


body {
    font-family: 'Georgia', serif;

    background:
        radial-gradient(
            circle at top left,
            rgba(212, 175, 55, 0.12),
            transparent 35%
        ),
        linear-gradient(
            135deg,
            #0a0e27 0%,
            #1a1f3a 50%,
            #0a0e27 100%
        );

    color: #e0e0e0;

    min-height: 100vh;

    overflow: hidden;
}


.hidden {
    display: none !important;
}


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

.world-container {
    width: 100%;
    height: 100vh;

    display: flex;
    flex-direction: column;

    padding: 25px 35px;
}


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

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

    margin-bottom: 20px;

    padding-bottom: 18px;

    border-bottom: 1px solid
        rgba(212, 175, 55, 0.25);
}


.world-header h1 {
    color: #d4af37;

    font-size: 32px;

    text-shadow:
        0 3px 15px
        rgba(212, 175, 55, 0.4);
}


.world-header p {
    color: #8b8b8b;

    margin-top: 5px;

    font-size: 14px;
}


.back-button {
    display: inline-block;

    padding: 10px 18px;

    border: 1px solid #d4af37;

    border-radius: 8px;

    color: #d4af37;

    text-decoration: none;

    background:
        rgba(26, 31, 58, 0.8);

    transition: all 0.25s ease;
}


.back-button:hover {
    background:
        rgba(212, 175, 55, 0.12);

    box-shadow:
        0 0 15px
        rgba(212, 175, 55, 0.2);

    transform: translateY(-1px);
}


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

.world-interface {
    flex: 1;

    min-height: 0;

    display: flex;

    gap: 20px;
}


/* =========================================================
   LOCATION + SUBLOCATION SIDEBARS
   ========================================================= */

.location-sidebar,
.sublocation-sidebar {
    width: 250px;

    flex-shrink: 0;

    display: flex;
    flex-direction: column;

    background:
        linear-gradient(
            135deg,
            #1a1f3a 0%,
            #242b3d 100%
        );

    border: 2px solid #3d4452;

    border-radius: 12px;

    overflow: hidden;

    box-shadow:
        0 10px 35px
        rgba(0, 0, 0, 0.45);
}


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

.sidebar-header {
    padding: 20px;

    border-bottom: 1px solid
        rgba(212, 175, 55, 0.2);

    flex-shrink: 0;
}


.sidebar-header h2 {
    color: #d4af37;

    font-size: 19px;

    margin-bottom: 5px;
}


.sidebar-header p {
    color: #8b8b8b;

    font-size: 12px;

    line-height: 1.5;
}


/* =========================================================
   LIST
   ========================================================= */

.location-list {
    flex: 1;

    overflow-y: auto;

    padding: 10px;
}


/* =========================================================
   LOCATION / SUBLOCATION BUTTONS
   ========================================================= */

.location-item {
    width: 100%;

    display: flex;
    align-items: center;

    gap: 12px;

    padding: 14px;

    margin-bottom: 8px;

    background:
        rgba(15, 18, 25, 0.7);

    border: 1px solid #3d4452;

    border-radius: 8px;

    color: #e0e0e0;

    text-align: left;

    font-family: 'Georgia', serif;

    cursor: pointer;

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


.location-item:hover {
    background:
        rgba(212, 175, 55, 0.08);

    border-color: #d4af37;
    transform: translateX(3px);
}


.location-item.selected {
    background:
        linear-gradient(
            135deg,
            rgba(212, 175, 55, 0.18),
            rgba(212, 175, 55, 0.06)
        );

    border-color: #d4af37;

    box-shadow: inset 3px 0 0 #d4af37;
}


.location-item.locked {
    opacity: 0.45;
    cursor: not-allowed;
}


.location-item.locked:hover {
    background: rgba(15, 18, 25, 0.7);
    border-color: #3d4452;
    transform: none;
}


.location-item-icon {
    width: 30px;
    font-size: 20px;
    text-align: center;
    flex-shrink: 0;
}


.location-item-content {
    min-width: 0;
}


.location-item-name {
    color: #d4af37;

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

    margin-bottom: 3px;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;
}


.location-item-level {
    color: #8b8b8b;

    font-size: 14px;
}


/* =========================================================
   EMPTY SUBLOCATION MESSAGE
   ========================================================= */

.empty-message {
    padding: 20px 10px;

    text-align: center;

    color: #777;

    font-size: 12px;

    line-height: 1.5;
}


/* =========================================================
   MAP SECTION
   ========================================================= */

.map-section {
    flex: 0 1 auto;

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

    display: flex;
    flex-direction: column;

    background:
        linear-gradient(
            135deg,
            #1a1f3a 0%,
            #242b3d 100%
        );

    border: 2px solid #3d4452;

    border-radius: 12px;

    overflow: hidden;

    box-shadow:
        0 10px 35px
        rgba(0, 0, 0, 0.45);
}


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

.map-header {
    padding: 18px 22px;

    border-bottom: 1px solid
        rgba(212, 175, 55, 0.2);

    flex-shrink: 0;
}


.map-header h2 {
    color: #d4af37;

    font-size: 21px;

    margin-bottom: 5px;
}


.map-header p {
    color: #a0a0a0;

    font-size: 13px;
}


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

.map-container {
    position: relative;

    width: fit-content;
    max-width: 100%;

    margin: 0 auto;

    overflow: hidden;

    background: #0f1219;
}


.world-map {
    display: block;

    width: auto;
    height: auto;

    max-width: 100%;
    max-height: 100%;

    object-fit: contain;

    user-select: none;
    pointer-events: none;
}

/* =========================================================
   AREA MARKERS
   ========================================================= */

#areaMarkers {
    position: absolute;

    inset: 0;

    pointer-events: none;
}

.area-marker {
    position: absolute;

    width: 20px;
    height: 20px;

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

    border-radius: 50%;

    background:
        radial-gradient(
            circle,
            #ffffff 0%,
            #fffbc2 12%,
            #fff176 25%,
            rgba(255, 220, 70, 0.5) 45%,
            rgba(255, 205, 60, 0.15) 65%,
            transparent 100%
        );

    box-shadow:
        0 0 10px 4px rgba(245, 220, 110, 0.9),
        0 0 22px 9px rgba(248, 222, 136, 0.8),
        0 0 40px 16px rgba(248, 211, 89, 0.671);

    cursor: pointer;

    pointer-events: auto;

    animation: areaGlow 2.5s ease-in-out infinite;

    transition:
        transform 0.2s ease,
        filter 0.2s ease;
}

/* Larger, faint magical aura */
.area-marker::before {
    content: "";

    position: absolute;

    top: 50%;
    left: 50%;

    width: 35px;
    height: 35px;

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

    border-radius: 50%;

    background:
        radial-gradient(
            circle,
            rgba(255, 246, 193, 0.25) 0%,
            rgba(255, 236, 174, 0.12) 35%,
            rgba(243, 225, 165, 0.04) 60%,
            transparent 100%
        );

    pointer-events: none;
}


.area-marker::after {
    content: "";

    position: absolute;

    top: 50%;
    left: 50%;

    width: 0px;
    height: 0px;

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

    border-radius: 10%;

    background: #ffe85c;

    box-shadow:
        0 0 5px 2px rgba(247, 233, 147, 0.3),
        0 0 10px 4px rgba(253, 237, 177, 0.596);

    pointer-events: none;
}


/* =========================================================
   GLOW ANIMATION
   ========================================================= */

@keyframes areaGlow {

    0%,
    100% {
        opacity: 0.85;

        box-shadow:
            0 0 8px 3px rgba(245, 220, 110, 0.5),
            0 0 18px 7px rgba(233, 201, 95, 0.4),
            0 0 32px 12px rgba(248, 211, 89, 0.25);
    }

    50% {
        opacity: 1;

        box-shadow:
            0 0 12px 5px rgba(255, 235, 130, 0.50),
            0 0 25px 10px rgba(245, 215, 100, 0.40),
            0 0 45px 18px rgba(248, 211, 89, 0.30);
    }

}


/* =========================================================
   HOVER
   ========================================================= */

.area-marker:hover {
    transform:
        translate(-50%, -50%)
        scale(1.35);

    filter:
        brightness(5.35);

    box-shadow:
        0 0 12px 4px rgba(255, 235, 110, 0.5),
        0 0 25px 10px rgba(212, 175, 55, 0.3),
        0 0 45px 18px rgba(212, 175, 55, 0.12);
}


/* =========================================================
   AREA TOOLTIP
   ========================================================= */

.area-tooltip {
    position: fixed;

    z-index: 1000;

    width: 250px;

    padding: 14px 16px;

    background:
        rgba(10, 14, 39, 0.97);

    border: 1px solid #d4af37;

    border-radius: 9px;

    box-shadow:
        0 10px 30px
        rgba(0, 0, 0, 0.6),

        0 0 15px
        rgba(212, 175, 55, 0.15);

    pointer-events: none;
}


.area-tooltip h3 {
    color: #f0d968;

    font-size: 15px;

    margin-bottom: 7px;
}


.area-tooltip p {
    color: #b0b0b0;

    font-size: 12px;

    line-height: 1.5;

    margin-bottom: 10px;
}


.tooltip-level {
    display: inline-block;

    padding: 4px 8px;

    background:
        rgba(212, 175, 55, 0.1);

    border: 1px solid
        rgba(212, 175, 55, 0.4);

    border-radius: 5px;

    color: #d4af37;

    font-size: 11px;

    font-weight: bold;
}


/* =========================================================
   AREA VIEW OVERLAY
   ========================================================= */

.area-view-overlay {
    position: fixed;

    inset: 0;

    z-index: 2000;

    display: flex;

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

    background: rgba(5, 7, 15, 0.9);
}


.area-view-content {
    position: relative;

    max-width: 90vw;
    max-height: 90vh;

    padding: 20px;

    background: rgba(10, 14, 39, 0.97);

    border: 1px solid #d4af37;

    border-radius: 9px;

    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.6),
        0 0 15px rgba(212, 175, 55, 0.15);

    display: flex;
    flex-direction: column;

    align-items: center;
}


.area-view-content h2 {
    color: #f0d968;

    font-size: 20px;

    margin-bottom: 12px;
}


.area-view-image-wrapper {
    position: relative;

    display: inline-block;

    max-width: 100%;
    max-height: 75vh;
}


.area-view-image {
    display: block;

    max-width: 100%;
    max-height: 75vh;

    object-fit: contain;

    border-radius: 6px;
}


#areaNodeMarkers {
    position: absolute;

    inset: 0;

    pointer-events: none;
}


.area-node-tooltip {
    z-index: 2100;
}


.area-view-close {
    position: absolute;

    top: 10px;
    right: 10px;

    width: 30px;
    height: 30px;

    background: rgba(212, 175, 55, 0.1);

    border: 1px solid rgba(212, 175, 55, 0.4);

    border-radius: 50%;

    color: #d4af37;

    font-size: 14px;

    cursor: pointer;

    transition: background 0.2s ease;
}


.area-view-close:hover {
    background: rgba(212, 175, 55, 0.25);
}


/* =========================================================
   NPC DIALOG OVERLAY
   ========================================================= */

.npc-dialog-overlay {
    position: fixed;

    inset: 0;

    z-index: 3000;

    display: flex;

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

    background: rgba(5, 7, 15, 0.5);
}


.npc-dialog-content {
    position: relative;

    max-width: 90vw;
    max-height: 90vh;

    padding: 20px;

    background: rgba(10, 14, 39, 0.97);

    border: 1px solid #d4af37;

    border-radius: 9px;

    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.6),
        0 0 15px rgba(212, 175, 55, 0.15);
}


.npc-dialog-body {
    display: flex;

    gap: 20px;

    align-items: stretch;
}


.npc-dialog-box {
    width: 380px;

    max-width: 80vw;
}


.npc-dialog-box h2 {
    color: #f0d968;

    font-size: 20px;

    margin-bottom: 12px;
}


.npc-dialog-box p {
    color: #b0b0b0;

    font-size: 14px;

    line-height: 1.6;

    white-space: pre-line;
}


.npc-quest-panel {
    display: flex;
    flex-direction: column;

    gap: 12px;

    width: 380px;
    max-width: 42vw;

    overflow-y: auto;

    padding: 20px;

    background:
        linear-gradient(
            135deg,
            #1a1f3a 0%,
            #181f30 100%
        );

    border: 2px solid #3d4452;

    border-radius: 8px;

    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.5);
}


.npc-quest-panel-title {
    color: #d4af37;

    font-size: 18px;

    font-weight: bold;

    margin-bottom: 3px;

    text-shadow:
        0 2px 8px rgba(0, 0, 0, 0.8);
}


.npc-quest-card {
    padding: 14px;

    background:
        linear-gradient(
            135deg,
            rgba(15, 18, 25, 0.92) 0%,
            rgba(15, 18, 34, 0.92) 100%
        );

    border:
        1px solid rgba(228, 179, 20, 0.3);

    border-radius: 8px;

    box-shadow:
        0 3px 10px rgba(0, 0, 0, 0.3);
}


.npc-quest-card + .npc-quest-card {
    margin-top: 0;
}


.npc-quest-card-header {
    display: flex;

    align-items: flex-start;

    justify-content: space-between;

    gap: 12px;

    margin-bottom: 8px;
}


.npc-quest-card h3,
.npc-quest-card-header h3 {
    margin: 0;

    color: #d4af37;

    font-size: 15px;

    line-height: 1.3;
}


.npc-quest-description,
.npc-quest-card p {
    margin: 0 0 10px;

    color: #c2c2c2;

    font-size: 12px;

    line-height: 1.5;
}


.npc-quest-reward {
    display: flex;

    flex-wrap: wrap;

    gap: 8px 14px;

    padding-top: 9px;

    border-top:
        1px solid rgba(61, 68, 82, 0.55);

    color: #d9c778;

    font-size: 11px;
}


.npc-quest-footer {
    display: flex;

    align-items: flex-end;

    justify-content: space-between;

    gap: 12px;

    margin-top: 12px;
}


.npc-quest-status {
    flex-shrink: 0;

    margin-left: auto;

    color: #a0a0a0;

    font-size: 12px;

    text-align: right;
}


.accept-quest-btn,
.abandon-quest-btn {
    padding: 7px 11px;

    border-radius: 6px;

    font-family: 'Georgia', serif;

    font-size: 11px;

    font-weight: bold;

    cursor: pointer;

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


.accept-quest-btn {
    border: 1px solid #d4af37;

    background:
        linear-gradient(
            135deg,
            #3d4452 0%,
            #4d5562 100%
        );

    color: #d4af37;
}


.abandon-quest-btn {
    border: 1px solid #d47e37;

    background:
        linear-gradient(
            135deg,
            #3d4452 0%,
            #4d5562 100%
        );

    color: #d48b37;
}


.accept-quest-btn:hover,
.abandon-quest-btn:hover {
    box-shadow:
        0 0 10px rgba(212, 175, 55, 0.2);

    transform:
        translateY(-1px);
}


.quest-reward-items {
    flex: 1 1 auto;

    display: flex;

    flex-wrap: wrap;

    align-items: center;

    gap: 7px;

    min-height: 42px;
}


.quest-reward-item-slot {
    position: relative;

    width: 42px;
    height: 42px;

    display: flex;

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

    background:
        linear-gradient(
            135deg,
            #0f1219 0%,
            #1a1f3a 100%
        );

    border: 2px solid #3d4452;

    border-radius: 7px;

    cursor: pointer;

    overflow: visible;

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


.quest-reward-item-slot:hover {
    border-color: #d4af37;

    box-shadow:
        0 0 12px rgba(212, 175, 55, 0.3);

    transform:
        translateY(-2px);
}


.quest-reward-item-image {
    width: 38px;
    height: 38px;

    object-fit: contain;

    pointer-events: none;
}


.quest-reward-item-count {
    position: absolute;

    right: 2px;
    bottom: 2px;

    min-width: 16px;

    padding: 1px 3px;

    background:
        rgba(10, 14, 39, 0.96);

    border: 1px solid #d4af37;

    border-radius: 4px;

    color: #f0d968;

    font-size: 9px;

    font-weight: bold;

    line-height: 1.2;

    text-align: center;

    pointer-events: none;
}


.quest-reward-tooltip {
    position: fixed;

    width: 240px;
    min-width: 240px;
    max-width: 240px;

    padding: 10px 12px;

    background:
        rgba(10, 14, 39, 0.98);

    color: #f0f0f0;

    border: 1px solid #d4af37;

    border-radius: 7px;

    font-size: 12px;

    line-height: 1.5;

    text-align: left;

    pointer-events: none;

    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.55);

    z-index: 99999;
}


.quest-reward-tooltip-name {
    font-size: 14px;

    font-weight: bold;

    line-height: 1.3;

    margin-bottom: 2px;
}


.quest-reward-tooltip-rarity {
    margin-top: 1px;

    margin-bottom: 7px;

    font-weight: bold;

    text-transform: capitalize;
}


.quest-reward-tooltip-details {
    color: #f0f0f0;
}



/* =========================================================
   SCROLLBARS
   ========================================================= */

.location-list::-webkit-scrollbar {
    width: 7px;
}


.location-list::-webkit-scrollbar-track {
    background: #0f1219;
}


.location-list::-webkit-scrollbar-thumb {
    background: #3d4452;

    border-radius: 4px;
}


.location-list::-webkit-scrollbar-thumb:hover {
    background: #d4af37;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1100px) {

    .location-sidebar,
    .sublocation-sidebar {
        width: 220px;
    }

}


@media (max-width: 800px) {

    body {
        overflow: auto;
    }


    .world-container {
        height: auto;

        min-height: 100vh;

        padding: 15px;
    }


    .world-header {
        flex-direction: column;

        align-items: flex-start;

        gap: 15px;
    }


    .world-interface {
        flex-direction: column;
    }


    .location-sidebar,
    .sublocation-sidebar {
        width: 100%;

        max-height: 250px;
    }


    .map-section {
        min-height: 500px;
    }

}

@media (max-width: 800px) {

    .npc-dialog-body {
        flex-direction: column;
    }

    .npc-quest-panel {
        width: 100%;
        max-width: 80vw;
    }

}

/* =========================================================
   COMBAT OVERLAY
   ========================================================= */

.combat-overlay {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(5, 7, 15, 0.92);
    backdrop-filter: blur(5px);
}

.combat-window {
    width: min(900px, calc(100vw - 48px));
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding: 24px;
    background: linear-gradient(135deg, #151a2d 0%, #20273a 100%);
    border: 2px solid #d4af37;
    border-radius: 14px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.78);
}

.combat-header {
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.25);
}

.combat-header h2 {
    margin: 0 0 5px;
    color: #d4af37;
    font-size: 24px;
}

.combat-enemy-level {
    color: #9d9d9d;
    font-size: 12px;
    font-weight: bold;
}

.combat-enemy-section {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(260px, 0.85fr);
    gap: 28px;
    align-items: center;
    margin-top: 22px;
}

.combat-enemy-image-frame {
    width: 100%;
    min-height: 290px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: radial-gradient(circle, rgba(61, 68, 82, 0.45) 0%, rgba(15, 18, 25, 0.95) 70%);
    border: 1px solid rgba(212, 175, 55, 0.32);
    border-radius: 10px;
}

.combat-enemy-image {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 360px;
    object-fit: contain;
}

.combat-enemy-stats,
.combat-player-vitals {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.combat-vital-label-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    color: #c9c9c9;
    font-size: 12px;
    font-weight: bold;
}

.combat-vital-bar {
    width: 100%;
    height: 25px;
    overflow: hidden;
    background: linear-gradient(90deg, #0f1219 0%, #1a1f3a 100%);
    border: 1px solid #3d4452;
    border-radius: 6px;
}

.combat-vital-fill {
    height: 100%;
    transition: width 0.25s ease;
}

.combat-health-fill {
    background: linear-gradient(90deg, #b51e1e 0%, #ff4d4d 100%);
}

.combat-mana-fill {
    background: linear-gradient(90deg, #1d4ed8 0%, #60a5fa 100%);
}

.combat-divider {
    height: 1px;
    margin: 24px 0;
    background: rgba(212, 175, 55, 0.25);
}

.combat-player-section {
    display: grid;
    grid-template-columns: minmax(260px, 0.75fr) minmax(0, 1.25fr);
    gap: 26px;
    align-items: start;
}

.combat-player-heading {
    grid-column: 1 / -1;
    color: #d4af37;
    font-size: 18px;
    font-weight: bold;
}

.combat-skill-section-title {
    margin-bottom: 9px;
    color: #d4af37;
    font-size: 13px;
    font-weight: bold;
}

.combat-skill-slots {
    display: grid;
    grid-template-columns: repeat(4, minmax(74px, 1fr));
    gap: 9px;
}

.combat-skill-slot {
    position: relative;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(135deg, #0d111d, #161c2d);
    border: 2px solid #3d4452;
    border-radius: 8px;
}

.combat-skill-slot.occupied {
    border-color: rgba(212, 175, 55, 0.5);
    cursor: pointer;
}

.combat-skill-slot.occupied:hover {
    border-color: #d4af37;
    box-shadow: 0 0 14px rgba(212, 175, 55, 0.25);
}

.combat-skill-icon {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.combat-skill-name {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 11px 4px 4px;
    background: linear-gradient(to top, rgba(10, 14, 39, 0.96), rgba(10, 14, 39, 0.72), transparent);
    color: #f0f0f0;
    font-size: 8px;
    font-weight: bold;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.combat-skill-mana {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 3;
    padding: 2px 4px;
    background: rgba(10, 14, 39, 0.82);
    border-radius: 4px;
    color: #78a9ff;
    font-size: 8px;
    font-weight: bold;
}

.combat-skill-empty,
.combat-skill-placeholder {
    color: rgba(212, 175, 55, 0.35);
    font-size: 20px;
    font-weight: bold;
}

@media (max-width: 760px) {
    .combat-enemy-section,
    .combat-player-section {
        grid-template-columns: 1fr;
    }

    .combat-player-heading {
        grid-column: 1;
    }

    .combat-skill-slots {
        grid-template-columns: repeat(2, minmax(74px, 1fr));
    }
}

/* =========================================================
   COMBAT SKILL TOOLTIP
   Same presentation as character.html
   ========================================================= */

.skill-tooltip.floating-skill-tooltip {
    position: fixed;
    z-index: 100001;
    width: 275px;
    padding: 11px 12px;
    border: 1px solid #d4af37;
    border-radius: 7px;
    background: rgba(10,14,39,.985);
    color: #f0f0f0;
    box-shadow: 0 9px 24px rgba(0,0,0,.58);
    pointer-events: none;
}

.skill-tooltip-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 7px;
}

.skill-tooltip-name {
    color: #d4af37;
    font-size: 14px;
    font-weight: bold;
}

.skill-tooltip-type {
    padding: 2px 6px;
    border: 1px solid rgba(123,184,255,.5);
    border-radius: 4px;
    background: rgba(31,65,112,.55);
    color: #9bc8ff;
    font-size: 9px;
    font-weight: bold;
    text-transform: capitalize;
}

.skill-tooltip-mana {
    margin-bottom: 7px;
    color: #78a9ff;
    font-size: 11px;
    font-weight: bold;
}

.skill-tooltip-description {
    padding-top: 7px;
    border-top: 1px solid rgba(61,68,82,.6);
    color: #d0d0d0;
    font-size: 11px;
    line-height: 1.5;
}




.combat-footer {
    display: flex;
    justify-content: flex-start;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(212, 175, 55, 0.18);
}

/* =========================================================
   COMBAT INVENTORY BUTTON
   ========================================================= */

.combat-header {
    display: flex;
    align-items: flex-start;
}


.combat-inventory-btn {
    padding: 9px 14px;

    border:
        1px solid
        #d4af37;

    border-radius: 7px;

    background:
        linear-gradient(
            135deg,
            #3d4452 0%,
            #4d5562 100%
        );

    color: #d4af37;

    font-family:
        'Georgia',
        serif;

    font-size: 12px;

    font-weight: bold;

    cursor: pointer;

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


.combat-inventory-btn:hover {
    box-shadow:
        0 0 12px
        rgba(212, 175, 55, 0.25);

    transform:
        translateY(-1px);
}


/* =========================================================
   COMBAT INVENTORY OVERLAY
   ========================================================= */

.combat-inventory-overlay {
    position: fixed;

    inset: 0;

    z-index: 6000;

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 24px;

    background:
        rgba(5, 7, 15, 0.72);

    backdrop-filter:
        blur(3px);
}


.combat-inventory-window {
    width:
        min(
            760px,
            calc(100vw - 48px)
        );

    max-height:
        calc(100vh - 48px);

    overflow-y: auto;

    padding: 22px;

    border:
        2px solid
        #d4af37;

    border-radius: 12px;

    background:
        linear-gradient(
            135deg,
            #151a2d,
            #20273a
        );

    box-shadow:
        0 22px 65px
        rgba(0, 0, 0, 0.72);
}


.combat-inventory-header {
    display: flex;

    align-items: flex-start;

    justify-content: space-between;

    gap: 16px;

    padding-bottom: 14px;

    margin-bottom: 16px;

    border-bottom:
        1px solid
        rgba(212, 175, 55, 0.25);
}


.combat-inventory-header h2 {
    margin: 0 0 4px;

    color: #d4af37;

    font-size: 20px;
}


.combat-inventory-header p {
    margin: 0;

    color: #8b8b8b;

    font-size: 11px;
}


.combat-inventory-close-btn {
    width: 34px;

    height: 34px;

    border:
        1px solid
        #3d4452;

    border-radius: 6px;

    background:
        #0f1219;

    color:
        #d4af37;

    font-size:
        23px;

    cursor:
        pointer;
}


.combat-inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, 64px);
    gap: 8px;
    justify-content: start;
    align-content: start;
}


.combat-inventory-slot {
    position: relative;

    width: 64px;

    height: 64px;

    display: flex;

    align-items: center;

    justify-content: center;

    overflow: hidden;

    background:
        linear-gradient(
            135deg,
            #0f1219 0%,
            #1a1f3a 100%
        );

    border:
        2px solid
        #3d4452;

    border-radius: 8px;
}


.combat-inventory-slot.occupied {
    cursor: pointer;
}


.combat-inventory-slot.occupied:hover {
    border-color:
        #d4af37;

    box-shadow:
        0 0 12px
        rgba(212, 175, 55, 0.25);
}


.combat-inventory-item-image {
    width: 60px;

    height: 60px;

    object-fit: contain;

    pointer-events: none;
}


.combat-inventory-item-count {
    position: absolute;

    right: 3px;

    bottom: 3px;

    z-index: 3;

    min-width: 17px;

    padding: 1px 4px;

    background:
        rgba(10, 14, 39, 0.95);

    border:
        1px solid
        #d4af37;

    border-radius: 4px;

    color:
        #f0d968;

    font-size:
        9px;

    font-weight:
        bold;

    text-align:
        center;
}







.combat-inventory-empty {
    grid-column: 1 / -1;
    padding: 18px 10px;
    color: #888;
    font-size: 12px;
    text-align: left;
}

/* =========================================================
   COMBAT PLAYER IDENTITY
   ========================================================= */

.combat-player-identity {
    grid-column: 1 / -1;

    display: flex;
    align-items: center;

    gap: 12px;

    margin-top: 2px;
    margin-bottom: 10px;
}


.combat-player-class-icon-frame {
    width: 62px;
    height: 62px;

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

    overflow: hidden;

    border: 2px solid #d4af37;
    border-radius: 50%;

    background:
        radial-gradient(
            circle,
            #2d3142 0%,
            #0f1219 100%
        );

    box-shadow:
        inset 0 0 14px rgba(0, 0, 0, 0.7),
        0 0 12px rgba(212, 175, 55, 0.2);
}


.combat-player-class-icon {
    width: 58px;
    height: 58px;

    display: block;

    border-radius: 50%;

    object-fit: cover;
}


.combat-player-level {
    color: #d4af37;

    font-size: 14px;

    font-weight: bold;

    text-shadow:
        0 1px 5px
        rgba(0, 0, 0, 0.8);
}


/*
 * Give the player's bars a little more vertical distance
 * from the class icon / level row.
 */
.combat-player-vitals {
    margin-top: 8px;
}



/* =========================================================
   COMBAT PLAYER ALIGNMENT
   Identity + vitals sit beside the skill grid
   ========================================================= */

.combat-player-section {
    grid-template-columns: minmax(290px, 0.9fr) minmax(0, 1.5fr);
    column-gap: 26px;
    row-gap: 10px;
    align-items: start;
}

.combat-player-heading {
    grid-column: 1 / -1;
    margin-bottom: 2px;
}

.combat-player-left {
    grid-column: 1;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding-top: 4px;
}

.combat-player-identity {
    grid-column: auto;
    margin: 0;
}

.combat-player-vitals {
    grid-column: auto;
    margin-top: 0;
}

.combat-skill-section {
    grid-column: 2;
    align-self: start;
    margin-top: 0;
}

@media (max-width: 760px) {
    .combat-player-section {
        grid-template-columns: 1fr;
    }

    .combat-player-heading,
    .combat-player-left,
    .combat-skill-section {
        grid-column: 1;
    }
}


/* Inventory button now lives directly under the player's Mana bar */
.combat-player-inventory-btn {
    align-self: flex-start;
    margin-top: 2px;
}


/* =========================================================
   COMBAT TURN FEEDBACK
   ========================================================= */

.combat-message {
    min-height: 18px;
    margin-top: 10px;
    color: #b8b8b8;
    font-size: 11px;
    line-height: 1.45;
}

.combat-message.success {
    color: #6bd88b;
}

.combat-message.error {
    color: #e06b67;
}

.combat-skill-slot.disabled {
    opacity: 0.55;
    cursor: default;
    pointer-events: none;
}

.combat-skill-slot.combat-skill-pending {
    box-shadow: 0 0 18px rgba(212, 175, 55, 0.45);
    transform: translateY(-2px);
}


/* =========================================================
   FLOATING COMBAT DAMAGE
   ========================================================= */

.combat-enemy-image-frame,
.combat-player-class-icon-frame {
    position: relative;
}


.combat-damage-layer {
    position: absolute;
    inset: 0;

    z-index: 6;

    overflow: visible;

    pointer-events: none;
}


.combat-floating-damage {
    --damage-offset-x: 0px;

    position: absolute;

    left: 50%;
    top: 47%;

    transform:
        translate(
            calc(-50% + var(--damage-offset-x)),
            -50%
        );

    color: #ff6262;

    font-size: 28px;
    font-weight: bold;

    line-height: 1;

    text-shadow:
        0 2px 3px rgba(0, 0, 0, 1),
        0 0 8px rgba(255, 50, 50, 0.55);

    opacity: 0;

    animation:
        combatDamageFloat
        0.85s
        ease-out
        forwards;
}


.combat-floating-damage.critical {
    color: #ffd45a;

    font-size: 34px;

    text-shadow:
        0 2px 3px rgba(0, 0, 0, 1),
        0 0 12px rgba(255, 196, 50, 0.8);
}


.combat-player-damage-layer .combat-floating-damage {
    top: 50%;

    font-size: 22px;
}


.combat-player-damage-layer .combat-floating-damage.critical {
    font-size: 27px;
}


@keyframes combatDamageFloat {

    0% {
        opacity: 0;

        transform:
            translate(
                calc(-50% + var(--damage-offset-x)),
                -25%
            )
            scale(0.75);
    }

    18% {
        opacity: 1;

        transform:
            translate(
                calc(-50% + var(--damage-offset-x)),
                -55%
            )
            scale(1.12);
    }

    70% {
        opacity: 1;
    }

    100% {
        opacity: 0;

        transform:
            translate(
                calc(-50% + var(--damage-offset-x)),
                -150%
            )
            scale(1);
    }

}


/* Healing numbers */
.combat-floating-damage.heal {
    color: #57d879;

    text-shadow:
        0 2px 3px rgba(0, 0, 0, 1),
        0 0 10px rgba(69, 196, 111, 0.65);
}


/* =========================================================
   COMBAT REWARDS
   ========================================================= */

.combat-reward-overlay {
    position: fixed;
    inset: 0;
    z-index: 7000;

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

    padding: 24px;

    background:
        rgba(5, 7, 15, 0.72);

    backdrop-filter:
        blur(4px);
}

.combat-reward-window {
    width: min(520px, calc(100vw - 48px));

    padding: 24px;

    border: 2px solid #d4af37;
    border-radius: 12px;

    background:
        linear-gradient(
            135deg,
            #151a2d,
            #20273a
        );

    box-shadow:
        0 22px 65px
        rgba(0, 0, 0, 0.72);
}

.combat-reward-header {
    padding-bottom: 14px;
    margin-bottom: 18px;

    border-bottom:
        1px solid
        rgba(212, 175, 55, 0.25);
}

.combat-reward-header h2 {
    margin: 0 0 5px;

    color: #d4af37;

    font-size: 22px;
}

.combat-reward-header p {
    margin: 0;

    color: #929292;

    font-size: 11px;
}

.combat-reward-summary {
    display: grid;

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

    gap: 12px;

    margin-bottom: 20px;
}

.combat-reward-summary-item {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 12px 14px;

    border:
        1px solid
        rgba(212, 175, 55, 0.3);

    border-radius: 8px;

    background:
        rgba(10, 14, 39, 0.55);
}

.combat-reward-label {
    color: #aaa;

    font-size: 12px;
}

.combat-reward-value {
    color: #d4af37;

    font-size: 15px;

    font-weight: bold;
}

.combat-reward-items-section h3 {
    margin: 0 0 10px;

    color: #e0e0e0;

    font-size: 14px;
}

.combat-reward-items {
    display: flex;
    flex-direction: column;

    gap: 8px;

    margin-bottom: 16px;
}

.combat-reward-item {
    display: flex;
    align-items: center;

    gap: 10px;

    padding: 8px;

    border: 1px solid #3d4452;
    border-radius: 7px;

    background:
        rgba(10, 14, 39, 0.5);
}

.combat-reward-item-image,
.combat-reward-item-placeholder {
    width: 42px;
    height: 42px;

    flex-shrink: 0;

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

    object-fit: contain;

    border:
        1px solid
        rgba(212, 175, 55, 0.35);

    border-radius: 6px;

    background:
        rgba(10, 14, 39, 0.9);
}

.combat-reward-item-placeholder {
    color: #d4af37;
}

.combat-reward-item-info {
    display: flex;
    flex-direction: column;

    gap: 3px;
}

.combat-reward-item-name {
    color: #e0e0e0;

    font-size: 12px;

    font-weight: bold;
}

.combat-reward-item-quantity {
    color: #d4af37;

    font-size: 10px;
}

.combat-reward-no-items {
    margin-bottom: 16px;

    padding: 12px;

    color: #888;

    font-size: 11px;

    text-align: center;

    border:
        1px dashed
        #3d4452;

    border-radius: 7px;
}

.combat-reward-close-btn {
    width: 100%;

    padding: 10px 14px;

    border: 1px solid #d4af37;
    border-radius: 7px;

    background:
        linear-gradient(
            135deg,
            #3d4452,
            #4d5562
        );

    color: #d4af37;

    font-family:
        'Georgia',
        serif;

    font-size: 12px;
    font-weight: bold;

    cursor: pointer;
}

.combat-reward-close-btn:hover {
    box-shadow:
        0 0 12px
        rgba(212, 175, 55, 0.25);
}


/* =========================================================
   COMBAT REWARD ITEM HOVER
   ========================================================= */

.combat-reward-item {
    cursor: default;

    transition:
        border-color 0.08s ease,
        box-shadow 0.08s ease,
        transform 0.08s ease;
}


.combat-reward-item:hover {
    box-shadow:
        0 0 12px
        rgba(212, 175, 55, 0.25);

    transform:
        translateY(-2px);
}


/* =========================================================
   COMBAT DEATH WINDOW
   ========================================================= */

.combat-death-overlay {
    position: fixed;
    inset: 0;

    z-index: 7100;

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

    padding: 24px;

    background:
        rgba(5, 7, 15, 0.78);

    backdrop-filter:
        blur(4px);
}


.combat-death-window {
    width:
        min(
            500px,
            calc(100vw - 48px)
        );

    padding: 24px;

    border:
        2px solid
        #8f3f46;

    border-radius: 12px;

    background:
        linear-gradient(
            135deg,
            #151824,
            #241a20
        );

    box-shadow:
        0 22px 65px
        rgba(0, 0, 0, 0.72);
}


.combat-death-header {
    padding-bottom: 14px;
    margin-bottom: 18px;

    border-bottom:
        1px solid
        rgba(180, 76, 84, 0.28);
}


.combat-death-header h2 {
    margin: 0 0 5px;

    color: #d9656d;

    font-size: 22px;
}


.combat-death-header p {
    margin: 0;

    color: #929292;

    font-size: 11px;
}


.combat-death-summary {
    display: grid;

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

    gap: 12px;

    margin-bottom: 16px;
}


.combat-death-summary-item {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 12px 14px;

    border:
        1px solid
        rgba(180, 76, 84, 0.3);

    border-radius: 8px;

    background:
        rgba(10, 14, 39, 0.48);
}


.combat-death-label {
    color: #aaa;

    font-size: 12px;
}


.combat-death-value {
    color: #e06b67;

    font-size: 15px;

    font-weight: bold;
}


.combat-death-restored {
    margin-bottom: 18px;

    padding: 11px 12px;

    color: #79c98b;

    font-size: 11px;

    text-align: center;

    border:
        1px solid
        rgba(87, 216, 121, 0.25);

    border-radius: 7px;

    background:
        rgba(87, 216, 121, 0.06);
}


.combat-death-close-btn {
    width: 100%;

    padding: 10px 14px;

    border:
        1px solid
        #8f3f46;

    border-radius: 7px;

    background:
        linear-gradient(
            135deg,
            #3a333b,
            #4a3a40
        );

    color: #e0e0e0;

    font-family:
        'Georgia',
        serif;

    font-size: 12px;

    font-weight: bold;

    cursor: pointer;
}


.combat-death-close-btn:hover {
    border-color:
        #d9656d;

    box-shadow:
        0 0 12px
        rgba(217, 101, 109, 0.2);
}


@media (max-width: 520px) {

    .combat-death-summary {
        grid-template-columns:
            1fr;
    }

}


/* =========================================================
   COMBAT REWARD LEVEL UP
   ========================================================= */

.combat-reward-level-up {
    margin: 0 0 20px;
    padding: 14px 16px;
    text-align: center;
    border: 1px solid rgba(212, 175, 55, 0.55);
    border-radius: 8px;
    background:
        linear-gradient(
            135deg,
            rgba(212, 175, 55, 0.10),
            rgba(212, 175, 55, 0.04)
        );
}

.combat-reward-level-up-title {
    margin-bottom: 6px;
    color: #d4af37;
    font-size: 16px;
    font-weight: bold;
}

.combat-reward-level-up-levels {
    color: #e8e2cc;
    font-size: 13px;
}


/* =========================================================
   COMBAT REWARD QUEST PROGRESS
   ========================================================= */

.combat-reward-quest-progress-section {
    margin: 0 0 20px;
    padding: 14px 16px;
    border: 1px solid rgba(212, 175, 55, 0.24);
    border-radius: 8px;
    background: rgba(10, 14, 39, 0.34);
}

.combat-reward-quest-progress-section h3 {
    margin: 0 0 12px;
    color: #d4af37;
    font-size: 15px;
}

.combat-reward-quest-progress-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.combat-reward-quest-progress-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 10px;
    border: 1px solid rgba(212, 175, 55, 0.16);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.02);
}

.combat-reward-quest-progress-name {
    color: #e8e2cc;
    font-size: 13px;
}

.combat-reward-quest-progress-count {
    color: #d4af37;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
}


/* =========================================================
   NPC QUEST OBJECTIVE PROGRESS
   ========================================================= */

.npc-quest-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}


.npc-quest-progress {
    flex: 0 0 auto;

    padding: 3px 8px;

    border:
        1px solid
        rgba(212, 175, 55, 0.28);

    border-radius: 999px;

    background:
        rgba(212, 175, 55, 0.07);

    color:
        #c9c2a9;

    font-size: 11px;

    font-weight: bold;

    white-space: nowrap;
}


.npc-quest-progress.complete {
    border-color:
        rgba(104, 190, 118, 0.45);

    background:
        rgba(82, 160, 96, 0.10);

    color:
        #8fd29a;
}


/* =========================================================
   COMPLETED QUEST TURN-IN LOCATION
   ========================================================= */

.npc-quest-turn-in-wrapper:empty {
    display: none;
}

.npc-quest-turn-in-location {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 12px;
    padding: 9px 10px;
    border-left: 2px solid rgba(104, 190, 118, 0.75);
    border-radius: 4px;
    background: rgba(82, 160, 96, 0.07);
}

.npc-quest-turn-in-label {
    color: #8fd29a;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.npc-quest-turn-in-destination {
    color: #e8e2cc;
    font-size: 12px;
}


/* =========================================================
   COMBAT STATUS EFFECTS
   ========================================================= */

.combat-status-effects {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;

    min-height: 25px;
}


.combat-status-effects.empty {
    min-height: 0;
}


.combat-enemy-status-effects {
    grid-column: 2;
    margin-top: -10px;
}


.combat-player-status-effects {
    margin-top: -4px;
}


.combat-status-effect {
    display: inline-flex;
    align-items: center;
    gap: 5px;

    max-width: 100%;

    padding: 5px 8px;

    border: 1px solid rgba(212, 175, 55, 0.30);
    border-radius: 999px;

    background: rgba(10, 14, 39, 0.72);

    color: #d8d8d8;

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

    cursor: help;
}


.combat-status-effect.buff {
    border-color: rgba(95, 190, 112, 0.48);
    background: rgba(64, 132, 76, 0.12);
}


.combat-status-effect.debuff {
    border-color: rgba(210, 86, 82, 0.50);
    background: rgba(150, 54, 52, 0.12);
}


.combat-status-effect-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.combat-status-effect.buff .combat-status-effect-name {
    color: #95d6a0;
}


.combat-status-effect.debuff .combat-status-effect-name {
    color: #ef9b96;
}


.combat-status-effect-stacks {
    color: #d4af37;
    font-weight: bold;
}


.combat-status-effect-turns {
    padding-left: 5px;

    border-left:
        1px solid
        rgba(255, 255, 255, 0.12);

    color: #9d9d9d;

    font-weight: bold;
}


@media (max-width: 760px) {
    .combat-enemy-status-effects {
        grid-column: 1;
        margin-top: 0;
    }
}
