/* =========================================================
   CHARACTER PAGE STYLES
   Extracted from game-style.css for character.html
   ========================================================= */

/* =========================================================
   CHARACTER PAGE
   ========================================================= */

.game-container {
    display: flex;

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

    width: min(100%, 1280px);
    max-width: 1280px;

    margin: 0 auto;

    gap: 24px;

    padding: 28px 24px 30px;

    min-height: 100vh;

    position: relative;
}

.game-container::before {
    content: '';

    position: absolute;

    inset: 18px 12px 12px;

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

    border-radius: 24px;

    background:
        rgba(13, 17, 28, 0.18);

    box-shadow:
        inset 0 0 30px rgba(212, 175, 55, 0.04);

    pointer-events: none;
}


/* =========================================================
   LEFT PANEL
   ========================================================= */

.left-panel {
    position: relative;

    z-index: 1;

    flex: 1 1 auto;

    min-width: 0;

    display: flex;

    flex-direction: column;

    gap: 20px;
}


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

.character-header {
    display: flex;

    align-items: center;

    gap: 20px;

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

    padding: 20px;

    border-radius: 10px;

    border: 2px solid #d4af37;

    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.5);
}

.legacy-character-header,
.legacy-experience-card,
.legacy-vitals-card,
.right-panel > .stats-card {
    display: none;
}

.character-avatar {
    width: 100px;
    height: 100px;

    display: flex;

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

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

    border: 3px solid #d4af37;

    border-radius: 50%;

    box-shadow:
        inset 0 0 20px rgba(0, 0, 0, 0.8),
        0 0 20px rgba(212, 175, 55, 0.3);

    flex-shrink: 0;
}

.avatar-image {
    width: 94px;
    height: 94px;

    border-radius: 50%;

    object-fit: cover;

    display: block;
}

.character-info h1 {
    font-size: 32px;

    color: #d4af37;

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

    margin-bottom: 5px;
}

.character-info .level {
    font-size: 20px;

    color: #b0860f;

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


/* =========================================================
   CARDS
   ========================================================= */

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

    border: 2px solid #3d4452;

    border-radius: 10px;

    padding: 20px;

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

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

.card:hover {
    border-color: #d4af37;

    box-shadow:
        0 4px 20px rgba(212, 175, 55, 0.2);
}

.card h2 {
    color: #d4af37;

    margin-bottom: 15px;

    font-size: 18px;

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


/* =========================================================
   STATS
   ========================================================= */

.stats-card .stat-row {
    display: flex;

    align-items: center;

    gap: 10px;

    margin-bottom: 6px;
}

.stats-grid {
    display: grid;

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

    gap: 12px;
}

.stat-column {
    display: flex;

    flex-direction: column;

    gap: 12px;
}

.simple-stat-row {
    justify-content: space-between;

    padding: 10px 12px;

    border-radius: 6px;

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

    border:
        1px solid rgba(61, 68, 82, 0.5);
}

.stat-label {
    width: auto;

    font-size: 14px;

    color: #b0b0b0;
}

.stat-bar {
    flex: 1;

    height: 20px;

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

    border: 1px solid #3d4452;

    border-radius: 5px;

    overflow: hidden;

    box-shadow:
        inset 0 2px 5px rgba(0, 0, 0, 0.5);
}

.stat-fill {
    height: 100%;

    background:
        linear-gradient(
            90deg,
            #d4af37 0%,
            #f0d968 100%
        );

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

.stat-value {
    width: 40px;

    text-align: right;

    color: #d4af37;

    font-weight: bold;
}


/* =========================================================
   EXPERIENCE
   ========================================================= */

.exp-info {
    display: flex;

    flex-direction: column;

    gap: 10px;
}

.exp-row {
    display: flex;

    justify-content: space-between;

    font-size: 13px;

    color: #b0b0b0;
}

.exp-bar {
    height: 25px;

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

    border: 1px solid #3d4452;

    border-radius: 5px;

    overflow: hidden;

    box-shadow:
        inset 0 2px 5px rgba(0, 0, 0, 0.5);
}

.exp-fill {
    height: 100%;

    background:
        linear-gradient(
            90deg,
            #4a9eff 0%,
            #7bb8ff 100%
        );

    box-shadow:
        0 0 10px rgba(74, 158, 255, 0.6);

    transition:
        width 0.3s ease;
}


/* =========================================================
   VITALS
   ========================================================= */

.vital-row {
    display: flex;

    align-items: center;

    gap: 1px;

    margin-bottom: 12px;
}

.vitals-grid {
    display: grid;

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

    gap: 30px;
}

.vitals-grid .vital-row {
    margin-bottom: 0;
}

.vital-label {
    width: 50px;

    font-size: 14px;

    color: #b0b0b0;
}

.vital-bar {
    position: relative;

    flex: 1;

    height: 24px;

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

    border: 1px solid #3d4452;

    border-radius: 5px;

    overflow: hidden;

    box-shadow:
        inset 0 2px 5px rgba(0, 0, 0, 0.5);
}

.vital-fill {
    display: block;

    height: 100%;

    width: 0;

    transition:
        width 0.25s ease;
}

#healthFill {
    background:
        linear-gradient(
            90deg,
            #d62828 0%,
            #ff4d4d 100%
        );

    box-shadow:
        0 0 10px rgba(214, 40, 40, 0.6);
}

#manaFill {
    background:
        linear-gradient(
            90deg,
            #1d4ed8 0%,
            #60a5fa 100%
        );

    box-shadow:
        0 0 10px rgba(29, 78, 216, 0.6);
}

.vital-value {
    position: absolute;

    top: 50%;
    left: 50%;

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

    width: 100%;

    text-align: center;

    font-size: 12px;

    font-weight: bold;

    color: #ffffff;

    text-shadow:
        0 1px 3px rgba(0, 0, 0, 0.9);

    z-index: 2;

    pointer-events: none;
}


/* =========================================================
   EQUIPMENT
   ========================================================= */

.equipment-card {
    width: 100%;

    /*
     * The equipment area is now split into:
     *
     *  LEFT  = equipment slots
     *  RIGHT = stats
     *
     * This works when .stats-card is inside .equipment-card.
     */
    display: grid;

    grid-template-columns: 250px minmax(0, 1fr);

    column-gap: 28px;

    align-items: start;
}

.equipment-card > h2,
.equipment-card > .card-header {
    grid-column: 1 / -1;
}

.equipment-card .card-header {
    display: flex;

    align-items: center;

    justify-content: space-between;
}


/* Equipment slots: 2 columns × 5 rows */

.equipment-grid {
    display: grid;

    grid-template-columns: repeat(2, 70px);
    grid-template-rows: repeat(5, 70px);

    gap: 14px 128px;

    width: 158px;

    align-content: start;
}


/* Individual equipment box */

.equipment-slot {
    position: relative;

    width: 70px;
    height: 70px;

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

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

    border: 2px solid #3d4452;
    border-radius: 8px;

    cursor: pointer;

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

    overflow: hidden;
}

.equipment-slot:hover {
    border-color: #d4af37;

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

    transform: translateY(-2px);
}

.equipment-slot[data-equipment-type="main_weapon"] {
    border-color: rgba(115, 142, 255, 0.6);
}

.equipment-slot[data-equipment-type="offhand"] {
    border-color: rgba(115, 142, 255, 0.6);
}


/* Equipment image container */

.item-slot-image {
    width: 54px;
    height: 54px;

    display: flex;

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

    pointer-events: none;
}

.item-image {
    width: 54px;
    height: 54px;

    object-fit: contain;

    display: block;
}


/* Empty equipment slot indicator */

.equipment-slot::before {
    content: '＋';

    position: absolute;

    color: rgba(212, 175, 55, 0.25);

    font-size: 20px;

    pointer-events: none;
}

.equipment-slot:has(.item-image[src]:not([src=""]))::before {
    display: none;
}


/* Equipment label */

.slot-name {
    position: absolute;

    left: 3px;
    right: 3px;
    bottom: 3px;

    padding: 2px 3px;

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

    border-radius: 4px;

    color: #9d9d9d;

    font-size: 8px;

    text-align: center;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;

    pointer-events: none;
}

.equipment-slot:has(.item-image[src]:not([src=""]))
    .equipment-slot-name {
    color: #d4af37;
}


/*
 * Stats inside the equipment container.
 *
 * If .stats-card is placed inside .equipment-card,
 * it will occupy the right side.
 */

.equipment-card .stats-card {
    width: 100%;

    margin: 0;

    padding: 0;

    border: none;

    background: transparent;

    box-shadow: none;
}

.equipment-card .stats-card:hover {
    border-color: transparent;

    box-shadow: none;
}

.equipment-card .stats-card h2 {
    margin-bottom: 10px;
}

.equipment-card .stats-grid {
    grid-template-columns: 1fr;

    gap: 7px;
}

.equipment-card .stat-column {
    gap: 7px;
}

.equipment-card .simple-stat-row {
    padding: 7px 9px;

    font-size: 12px;
}

.equipment-card .stat-label {
    font-size: 12px;
}

.equipment-card .stat-value {
    width: 35px;

    font-size: 12px;
}


/* =========================================================
   INVENTORY
   ========================================================= */

.inventory-card {
    width: 100%;
}


/* Inventory header */

.inventory-header {
    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-bottom: 15px;
}

.inventory-header h2 {
    margin-bottom: 0;
}


/* Gold */

.inventory-gold {
    display: flex;

    align-items: center;

    gap: 7px;

    padding: 6px 10px;

    background:
        rgba(45, 31, 10, 0.75);

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

    border-radius: 6px;

    color: #ffd700;

    font-size: 14px;

    font-weight: bold;

    white-space: nowrap;

    text-shadow:
        0 0 8px rgba(255, 215, 0, 0.3);
}

.gold-icon {
    font-size: 15px;
}

.inventory-grid {
    display: grid;

    grid-template-columns:
        repeat(10, 64px);

    grid-auto-rows: 64px;

    gap: 8px;

    justify-content: center;

    width: 100%;
}


/* Inventory slot */

.inventory-slot {
    position: relative;

    width: 64px;
    height: 64px;

    display: flex;

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

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

    border: 2px solid #3d4452;

    border-radius: 8px;

    cursor: pointer;

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

    overflow: visible;
}


/* Inner empty-slot effect */

.inventory-slot::before {
    content: '';

    position: absolute;

    inset: 5px;

    border:
        1px solid rgba(255, 255, 255, 0.025);

    border-radius: 4px;

    pointer-events: none;
}


/* Inventory hover */

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

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

    transform: translateY(-2px);
}


/* Inventory item image */

.inventory-slot .item-image {
    width: 60px;
    height: 60px;

    object-fit: contain;

    pointer-events: none;

    z-index: 1;
}


/* =========================================================
   ITEM COUNT
   ========================================================= */

.item-count {
    position: absolute;

    right: 3px;
    bottom: 3px;

    min-width: 18px;

    padding: 2px 4px;

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

    border:
        1px solid #d4af37;

    border-radius: 4px;

    color: #f0d968;

    font-size: 10px;

    font-weight: bold;

    line-height: 1.2;

    text-align: center;

    z-index: 5;
}


/* =========================================================
   ITEM TOOLTIP
   ========================================================= */

.inventory-slot[data-tooltip]::after,
.equipment-slot[data-tooltip]::after {
    content: attr(data-tooltip);

    position: absolute;

    left: 50%;

    bottom: calc(100% + 10px);

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

    width: 240px;

    padding: 10px 12px;

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

    color: #f0f0f0;

    border:
        1px solid #d4af37;

    border-radius: 7px;

    font-size: 12px;

    line-height: 1.5;

    text-align: left;

    white-space: pre-line;

    opacity: 0;

    pointer-events: none;

    transition:
        opacity 0.2s ease,
        transform 0.2s ease;

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

    z-index: 100;
}

.inventory-slot[data-tooltip]:hover::after,
.equipment-slot[data-tooltip]:hover::after {
    opacity: 1;

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



/* Inventory HTML tooltip with individually colored name + rarity */

.item-tooltip.floating-item-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;

    white-space: normal;

    pointer-events: none;

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

    z-index: 99999;
}

.item-tooltip-name {
    display: block;

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

    line-height: 1.3;

    margin-bottom: 2px;
}

.item-tooltip-rarity {
    display: block;

    margin-top: 1px;
    margin-bottom: 7px;

    font-weight: bold;

    text-transform: capitalize;
}

.item-tooltip-details {
    display: block;

    color: #f0f0f0;
}

/* =========================================================
   RARITY
   ========================================================= */

.rarity {
    display: inline-block;

    font-size: 11px;

    padding: 3px 8px;

    border-radius: 4px;

    font-weight: bold;
}

.rarity.common {
    background: #888;
    color: #fff;
}

.rarity.uncommon {
    background: #00aa00;
    color: #fff;
}

.rarity.rare {
    background: #0066ff;
    color: #fff;
}

.rarity.legendary {
    background: #ffaa00;
    color: #000;
}


/* =========================================================
   RIGHT PANEL
   ========================================================= */

.right-panel {
    position: relative;

    z-index: 1;

    flex: 0 0 380px;

    width: 380px;
    max-width: 380px;

    display: flex;

    flex-direction: column;

    gap: 20px;
}


/* =========================================================
   TABS
   ========================================================= */

.tabs {
    display: flex;

    gap: 5px;

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

    padding: 10px;

    border-radius: 8px;

    border: 2px solid #3d4452;
}

.tab-btn {
    flex: 1;

    padding: 12px;

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

    border: 2px solid #3d4452;

    color: #b0b0b0;

    cursor: pointer;

    border-radius: 6px;

    font-size: 13px;

    font-family: 'Georgia', serif;

    transition: all 0.3s ease;
}

.tab-btn:hover {
    border-color: #d4af37;

    color: #d4af37;
}

.tab-btn.active {
    background:
        linear-gradient(
            135deg,
            #3d4452 0%,
            #4d5562 100%
        );

    border-color: #d4af37;

    color: #d4af37;

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


/* =========================================================
   TAB CONTENT
   ========================================================= */

.tab-content {
    flex: 1;

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

    border: 2px solid #3d4452;

    border-radius: 8px;

    padding: 20px;

    overflow-y: auto;

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

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.tab-content h2 {
    color: #d4af37;

    margin-bottom: 15px;

    font-size: 18px;

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



/* =========================================================
   CHARACTER QUESTS
   ========================================================= */

.character-quest-list {
    display: flex;

    flex-direction: column;

    gap: 12px;
}


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

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

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

    border-radius: 8px;

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


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

    align-items: flex-start;

    justify-content: space-between;

    gap: 12px;

    margin-bottom: 8px;
}


.character-quest-card-header h3 {
    margin: 0;

    color: #d4af37;

    font-size: 15px;

    line-height: 1.3;
}


.character-quest-progress {
    flex-shrink: 0;

    padding: 3px 7px;

    border:
        1px solid #3d4452;

    border-radius: 5px;

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

    color: #b0b0b0;

    font-size: 11px;

    font-weight: bold;
}


.character-quest-progress.complete {
    border-color:
        rgba(69, 196, 111, 0.65);

    color: #6bd88b;
}


.character-quest-description {
    margin: 0 0 10px;

    color: #c2c2c2;

    font-size: 12px;

    line-height: 1.5;
}


.character-quest-rewards {
    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;
}


.character-quest-actions {
    display: flex;

    justify-content: flex-end;

    margin-top: 12px;
}


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

    border: 1px solid #d47e37;

    border-radius: 6px;

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

    color: #d48b37;

    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;
}


.character-abandon-quest-btn:hover {
    border-color: #d4af37;

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

    transform:
        translateY(-1px);
}


.character-abandon-quest-btn:disabled {
    opacity: 0.55;

    cursor: default;

    transform: none;

    box-shadow: none;
}


.empty-quest-message {
    color: #888;

    font-size: 12px;

    text-align: center;

    padding: 12px 8px;
}




/* =========================================================
   QUEST REWARD ITEMS
   ========================================================= */

.character-quest-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
}

.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;
}

.character-quest-actions {
    flex-shrink: 0;

    margin-left: auto;
    margin-top: 0;
}


/* =========================================================
   CHARACTER PAGE RESPONSIVE
   ========================================================= */

@media (max-width: 1024px) {

    .game-container {
        flex-direction: column;

        align-items: center;

        width: min(100%, 760px);
    }

    .left-panel,
    .right-panel {
        flex: 0 0 auto;

        max-width: 100%;

        width: 100%;
    }

    .right-panel {
        width: 100%;
        max-width: 100%;
    }

    /*
     * Keep the equipment layout compact on tablets.
     */
    .equipment-card {
        grid-template-columns: 230px minmax(0, 1fr);

        column-gap: 24px;
    }

    .equipment-grid {
        width: 230px;

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

        grid-template-rows:
            repeat(5, 66px);

        gap: 12px 16px;
    }

    .equipment-slot {
        height: 66px;
    }

    .item-slot-image {
        width: 50px;
        height: 50px;
    }

    .equipment-slot .item-image {
        width: 50px;
        height: 50px;
    }

}

@media (max-width: 700px) {

    /* Character page */

    .game-container {
        padding: 18px 12px 25px;

        gap: 16px;
    }

    .character-header {
        padding: 18px;
    }

    .character-avatar {
        width: 80px;
        height: 80px;
    }

    .avatar-image {
        width: 74px;
        height: 74px;
    }

    .character-info h1 {
        font-size: 25px;
    }

    .character-info .level {
        font-size: 15px;
    }


    /* Equipment */

    .equipment-card {
        display: block;
    }

    .equipment-grid {
        width: 100%;

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

        grid-template-rows:
            repeat(5, 64px);

        gap: 7px;
    }

    .equipment-slot {
        width: 100%;
        height: 64px;

        min-width: 58px;
        min-height: 58px;
    }

    .item-slot-image {
        width: 52px;
        height: 52px;
    }

    .equipment-slot .item-image {
        width: 52px;
        height: 52px;
    }

    /*
     * On small screens the stats move underneath
     * the equipment instead of being squeezed beside it.
     */
    .equipment-card .stats-card {
        margin-top: 16px;
    }

    .vitals-grid {
        grid-template-columns: 1fr;

        gap: 0;
    }

    .vitals-grid .vital-row {
        margin-bottom: 12px;
    }


    /* Inventory */

    .inventory-grid {
        grid-template-columns:
            repeat(5, 64px);

        gap: 7px;
    }


    /* Stats */

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

}

@media (max-width: 430px) {

    .inventory-grid {
        grid-template-columns:
            repeat(4, 64px);

        gap: 6px;
    }

    .inventory-slot {
        width: 64px;
        height: 64px;
    }

    .equipment-grid {
        grid-template-columns:
            repeat(2, minmax(55px, 1fr));

        grid-template-rows:
            repeat(5, 60px);
    }

    .equipment-slot {
        min-width: 55px;
        height: 60px;
    }

    .item-slot-image {
        width: 48px;
        height: 48px;
    }

    .equipment-slot .item-image {
        width: 48px;
        height: 48px;
    }

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

        gap: 10px;
    }

    .inventory-gold {
        font-size: 12px;

        padding: 5px 7px;
    }

}


/* =========================================================
   EQUIPMENT OPTIMISTIC UPDATE
   ========================================================= */

.equipment-slot.equip-pending {
    animation: equipmentPendingPulse 0.7s ease-in-out infinite alternate;
}

@keyframes equipmentPendingPulse {
    from {
        filter: brightness(1);
    }

    to {
        filter: brightness(1.18);
    }
}


/* =========================================================
   EQUIPMENT DROP ELIGIBILITY
   ========================================================= */

.equipment-slot.drag-valid {
    border-color: #45c46f !important;

    box-shadow:
        0 0 18px rgba(69, 196, 111, 0.55);

    transform:
        translateY(-2px)
        scale(1.03);
}

.equipment-slot.drag-invalid {
    border-color: #d9534f !important;

    box-shadow:
        0 0 14px rgba(217, 83, 79, 0.35);

    cursor: not-allowed;
}


/* =========================================================
   EQUIPMENT / INVENTORY DRAG FEEDBACK
   ========================================================= */

.inventory-slot.drag-valid,
.equipment-slot.drag-valid {
    border-color: #45c46f !important;

    box-shadow:
        0 0 18px rgba(69, 196, 111, 0.55);

    transform:
        translateY(-2px)
        scale(1.03);
}

.inventory-slot.drag-invalid,
.equipment-slot.drag-invalid {
    border-color: #d9534f !important;

    box-shadow:
        0 0 14px rgba(217, 83, 79, 0.35);

    cursor: not-allowed;
}

.inventory-slot.unequip-pending {
    animation:
        equipmentPendingPulse
        0.7s
        ease-in-out
        infinite
        alternate;
}


/* =========================================================
   SKILLS
   ========================================================= */

.character-skills-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.character-skills-header h2 {
    margin-bottom: 0;
}

.select-skills-btn {
    padding: 8px 12px;
    border: 1px solid #d4af37;
    border-radius: 6px;
    background: linear-gradient(135deg, #3d4452 0%, #4d5562 100%);
    color: #d4af37;
    font-family: 'Georgia', serif;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
}

.equipped-skills-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.empty-skill-message {
    padding: 12px 8px;
    color: #888;
    font-size: 12px;
    text-align: center;
}

.equipped-skill-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 28px;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 5px 8px;
    border: 1px solid rgba(61, 68, 82, 0.72);
    border-radius: 7px;
    background: linear-gradient(135deg, rgba(15,18,25,.88), rgba(26,31,58,.88));
}

.equipped-skill-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(212,175,55,.45);
    border-radius: 6px;
    background: rgba(10,14,39,.92);
    cursor: help;
}

.equipped-skill-icon img,
.available-skill-icon img,
.skill-loadout-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.equipped-skill-name {
    color: #e0e0e0;
    font-size: 12px;
    font-weight: bold;
}

.equipped-skill-slot-label {
    text-align: center;
    color: #d4af37;
    font-size: 10px;
}

.skill-icon-placeholder {
    color: rgba(212,175,55,.45);
    font-weight: bold;
}

.skill-selection-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(5,7,14,.78);
    backdrop-filter: blur(4px);
}

.skill-selection-window {
    width: min(980px, 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,.72);
}

.skill-selection-header,
.skill-selection-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.skill-selection-header {
    align-items: flex-start;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(212,175,55,.25);
}

.skill-selection-header h2 {
    margin: 0 0 5px;
    color: #d4af37;
}

.skill-selection-header p,
.skill-selection-section-header span {
    margin: 0;
    color: #888;
    font-size: 10px;
}

.skill-selection-close-btn {
    width: 34px;
    height: 34px;
    border: 1px solid #3d4452;
    border-radius: 6px;
    background: #0f1219;
    color: #d4af37;
    font-size: 23px;
    cursor: pointer;
}

.skill-selection-section {
    margin-top: 18px;
}

.skill-selection-section-header {
    margin-bottom: 10px;
}

.skill-selection-section-header h3 {
    margin: 0;
    color: #e0e0e0;
    font-size: 15px;
}

.skill-selection-divider {
    height: 1px;
    margin-top: 20px;
    background: rgba(212,175,55,.25);
}

.available-skills-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    min-height: 100px;
    padding: 10px;
    border: 1px solid #3d4452;
    border-radius: 8px;
    background: rgba(10,14,39,.38);
}

.available-skills-grid.drag-over {
    border-color: #45c46f;
}

.available-skill-card {
    display: grid;
    grid-template-columns: 48px minmax(0,1fr);
    align-items: center;
    gap: 9px;
    min-height: 66px;
    padding: 8px;
    border: 1px solid #3d4452;
    border-radius: 7px;
    background: linear-gradient(135deg, #0f1219, #1a1f3a);
    cursor: grab;
}

.available-skill-card:hover {
    border-color: #d4af37;
}

.available-skill-card.equipped {
    border-color: rgba(69,196,111,.6);
}

.available-skill-card.locked {
    opacity: .4;
    cursor: not-allowed;
    filter: grayscale(.6);
}

.available-skill-icon {
    width: 46px;
    height: 46px;
}

.available-skill-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.available-skill-name {
    color: #e0e0e0;
    font-size: 12px;
    font-weight: bold;
}

.available-skill-level {
    color: #999;
    font-size: 11px;
}

.skill-loadout-slots {
    display: grid;
    grid-template-columns: repeat(8, minmax(72px,1fr));
    gap: 9px;
}

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

.skill-loadout-slot.occupied {
    cursor: grab;
    border-color: rgba(212,175,55,.5);
}

.skill-loadout-slot.drag-valid {
    border-color: #45c46f;
    box-shadow: 0 0 16px rgba(69,196,111,.4);
}

.skill-slot-number {
    position: absolute;
    top: 4px;
    left: 5px;
    z-index: 3;
    padding: 1px 4px;
    border-radius: 4px;
    background: rgba(10,14,39,.72);
    color: #d4af37;
    font-size: 12px;
    font-weight: bold;
    pointer-events: none;
}

.skill-loadout-icon {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.skill-loadout-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.skill-loadout-name {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    width: 100%;
    padding: 5px 4px 4px;
    background:
        linear-gradient(
            to top,
            rgba(10,14,39,.96) 0%,
            rgba(10,14,39,.78) 65%,
            transparent 100%
        );
    color: #f0f0f0;
    font-size: 9px;
    font-weight: bold;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
}

.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;
}

@media (max-width: 1100px) {
    .available-skills-grid {
        grid-template-columns: repeat(3,minmax(0,1fr));
    }
}


@media (max-width: 900px) {
    .available-skills-grid {
        grid-template-columns: repeat(2,minmax(0,1fr));
    }

    .skill-loadout-slots {
        grid-template-columns: repeat(4,minmax(72px,1fr));
    }
}

/* =========================================================
   SKILL DESCRIPTION CALCULATED VALUES
   ========================================================= */

.skill-value-damage {
    color: #d4af37;
    font-weight: bold;
}

.skill-value-heal {
    color: #45c46f;
    font-weight: bold;
}

.skill-value-default {
    color: inherit;
    font-weight: bold;
}



/* =========================================================
   PETS
   ========================================================= */

.equipment-side-column {
    min-width: 0;

    display: flex;
    flex-direction: column;

    gap: 18px;
}


/* Active pet area beneath character stats */

.pet-summary-panel {
    min-height: 170px;

    display: grid;

    grid-template-columns:
        145px
        minmax(0, 1fr);

    gap: 18px;

    align-items: stretch;

    padding: 14px;

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

    border-radius: 8px;

    background:
        linear-gradient(
            135deg,
            rgba(15, 18, 25, 0.86),
            rgba(26, 31, 58, 0.72)
        );
}


.active-pet-image-button {
    position: relative;

    width: 145px;
    height: 145px;

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

    padding: 0;

    border:
        2px solid
        #4b5260;

    border-radius: 10px;

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

    cursor: pointer;

    overflow: hidden;

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


.active-pet-image-button:hover {
    transform:
        translateY(-2px);

    border-color:
        #d4af37 !important;

    box-shadow:
        0 0 16px
        rgba(212, 175, 55, 0.22);
}


.active-pet-image {
    width: 100%;
    height: 100%;

    object-fit: cover;
    display: block;
}


.active-pet-empty {
    display: flex;
    flex-direction: column;

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

    gap: 5px;

    color:
        rgba(212, 175, 55, 0.60);

    font-size: 12px;
}


.active-pet-empty-icon {
    font-size: 30px;
    line-height: 1;
}


.active-pet-info {
    min-width: 0;

    display: flex;
    flex-direction: column;

    justify-content: flex-start;
}


.active-pet-heading {
    display: flex;

    align-items: flex-start;
    justify-content: space-between;

    gap: 10px;

    margin-bottom: 10px;
}


.active-pet-name {
    color: #d4af37;

    font-size: 16px;
    font-weight: bold;
}


.active-pet-level {
    margin-top: 3px;

    color: #8f96a3;

    font-size: 11px;
}


.active-pet-bonuses {
    display: flex;
    flex-direction: column;

    gap: 6px;
}


.active-pet-bonus-row {
    min-width: 0;

    display: flex;

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

    gap: 12px;

    padding: 6px 8px;

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

    border-radius: 5px;

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

    color: #c9cbd1;

    font-size: 11px;
}


.active-pet-bonus-row strong {
    flex: 0 0 auto;

    color: #d4af37;
}


.active-pet-no-bonuses {
    color: #777f8c;

    font-size: 11px;
    line-height: 1.45;
}


/* =========================================================
   PET COLLECTION OVERLAY
   ========================================================= */

.pet-selection-overlay {
    position: fixed;

    inset: 0;

    z-index: 15000;

    display: flex;

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

    padding: 30px;

    background:
        rgba(4, 6, 15, 0.82);

    backdrop-filter:
        blur(5px);
}


.pet-selection-window {
    width:
        min(
            900px,
            calc(100vw - 40px)
        );

    max-height:
        min(
            760px,
            calc(100vh - 50px)
        );

    display: flex;
    flex-direction: column;

    padding: 22px;

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

    border-radius: 12px;

    background:
        linear-gradient(
            145deg,
            #101525,
            #0b0f20
        );

    box-shadow:
        0 22px 70px
        rgba(0, 0, 0, 0.56);
}


.pet-selection-header {
    display: flex;

    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 20px;
}


.pet-selection-header h2 {
    margin: 0 0 4px;

    color: #d4af37;
}


.pet-selection-header p {
    margin: 0;

    color: #89909d;

    font-size: 12px;
}


.pet-selection-close-btn {
    width: 36px;
    height: 36px;

    flex: 0 0 auto;

    display: flex;

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

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

    border-radius: 7px;

    background:
        rgba(255, 255, 255, 0.025);

    color: #d4af37;

    font-size: 23px;

    cursor: pointer;
}


.pet-selection-close-btn:hover {
    border-color: #d4af37;

    background:
        rgba(212, 175, 55, 0.08);
}


.pet-collection-grid {
    min-height: 170px;

    display: grid;

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

    gap: 14px;

    padding: 3px 5px 8px 3px;

    overflow-y: auto;
}


.pet-collection-card {
    position: relative;

    min-width: 0;

    display: flex;
    flex-direction: column;

    gap: 7px;

    padding: 8px;

    border:
        2px solid
        #777;

    border-radius: 9px;

    background:
        linear-gradient(
            145deg,
            rgba(18, 23, 40, 0.96),
            rgba(10, 13, 27, 0.96)
        );

    color: inherit;

    text-align: left;

    cursor: pointer;

    transition:
        transform 0.16s ease,
        box-shadow 0.16s ease,
        filter 0.16s ease;
}


.pet-collection-card:hover {
    transform:
        translateY(-3px);

    filter:
        brightness(1.08);

    box-shadow:
        0 10px 22px
        rgba(0, 0, 0, 0.28);
}


.pet-collection-card.equipped {
    box-shadow:
        0 0 0 1px
        rgba(212, 175, 55, 0.22),
        0 0 18px
        rgba(212, 175, 55, 0.14);
}


.pet-collection-image-wrap {
    position: relative;

    width: 100%;

    aspect-ratio: 1 / 1;

    display: flex;

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

    border-radius: 6px;

    background:
        rgba(0, 0, 0, 0.18);

    overflow: hidden;
}


.pet-collection-image {
    width: 100%;
    height: 100%;

    object-fit: contain;
}


.pet-collection-image-placeholder {
    color:
        rgba(212, 175, 55, 0.45);

    font-size: 34px;
}


.pet-equipped-badge {
    position: absolute;

    left: 6px;
    right: 6px;
    bottom: 6px;

    padding: 4px 5px;

    border-radius: 4px;

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

    color: #d4af37;

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

    text-align: center;

    text-transform: uppercase;

    letter-spacing: 0.6px;
}


.pet-collection-name {
    min-width: 0;

    overflow: hidden;

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

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


.pet-collection-meta {
    color: #818895;

    font-size: 9px;
}


.pet-collection-empty {
    grid-column: 1 / -1;

    min-height: 180px;

    display: flex;

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

    color: #737b89;

    font-size: 13px;
}


/* Floating pet tooltip */

.pet-inventory-tooltip {
    position: fixed;

    z-index: 20000;

    width: 245px;

    padding: 13px;

    pointer-events: none;

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

    border-radius: 8px;

    background:
        rgba(8, 11, 22, 0.98);

    box-shadow:
        0 14px 34px
        rgba(0, 0, 0, 0.48);
}


.pet-tooltip-name {
    font-size: 14px;
    font-weight: bold;
}


.pet-tooltip-meta {
    margin-top: 2px;

    color: #818895;

    font-size: 10px;
}


.pet-tooltip-description {
    margin-top: 8px;

    color: #b8bbc2;

    font-size: 10px;
    line-height: 1.45;
}


.pet-tooltip-divider {
    height: 1px;

    margin: 10px 0;

    background:
        rgba(212, 175, 55, 0.16);
}


.pet-tooltip-bonuses {
    display: flex;
    flex-direction: column;

    gap: 5px;
}


.pet-tooltip-bonus-row {
    display: flex;

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

    gap: 10px;

    color: #c9cbd1;

    font-size: 10px;
}


.pet-tooltip-bonus-row strong {
    color: #d4af37;
}


.pet-tooltip-essence {
    margin-top: 9px;

    padding-top: 8px;

    border-top:
        1px solid
        rgba(255, 255, 255, 0.06);

    color: #818895;

    font-size: 10px;
}


.pet-tooltip-essence strong {
    color: #d4af37;
}


/* =========================================================
   PET RESPONSIVE LAYOUT
   ========================================================= */

@media (max-width: 980px) {

    .pet-collection-grid {
        grid-template-columns:
            repeat(
                4,
                minmax(0, 1fr)
            );
    }

}


@media (max-width: 760px) {

    .pet-summary-panel {
        grid-template-columns: 110px 1fr;
    }


    .active-pet-image-button {
        width: 110px;
        height: 110px;
    }


    .pet-collection-grid {
        grid-template-columns:
            repeat(
                3,
                minmax(0, 1fr)
            );
    }

}


@media (max-width: 520px) {

    .pet-summary-panel {
        grid-template-columns: 1fr;
    }


    .active-pet-image-button {
        width: 130px;
        height: 130px;
    }


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

}

