#book-counter {
    position: absolute;

    right: 25px;
    bottom: 95px;

    min-width: 90px;
    height: 48px;

    padding: 0 15px;

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

    gap: 8px;

    background:
        rgba(20, 20, 20, 0.85);

    border:
        3px solid white;

    border-radius: 14px;

    color: white;

    font-family: Arial, sans-serif;

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

    z-index: 50;
}


#book-icon {
    font-size: 26px;
}


#story-map-buttons {

    position: absolute;

    right: 25px;
    bottom: 25px;

    display: flex;

    gap: 12px;

    z-index: 50;
}


#story-map-buttons button {

    height: 52px;

    padding:
        0 22px;

    border:
        3px solid white;

    border-radius:
        14px;

    background:
        rgba(20, 20, 20, 0.88);

    color: white;

    font-size:
        16px;

    font-weight:
        bold;

    cursor:
        pointer;
}


#story-map-buttons button:hover {

    transform:
        scale(1.05);

}


.story-popup {

    position:
        absolute;

    inset:
        0;

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

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

    z-index:
        100;
}


.story-popup[hidden] {

    display:
        none;

}


.story-popup-box {

    position:
        relative;

    width:
        min(850px, 90vw);

    max-height:
        80vh;

    overflow-y:
        auto;

    background:
        #222;

    border:
        4px solid white;

    border-radius:
        20px;

    padding:
        32px;

    color:
        white;

    font-family:
        Arial, sans-serif;
}


.story-popup-box h2 {

    text-align:
        center;

    font-size:
        30px;

    margin-top:
        0;

}


.popup-close {

    position:
        absolute;

    right:
        15px;

    top:
        10px;

    border:
        none;

    background:
        transparent;

    color:
        white;

    font-size:
        38px;

    cursor:
        pointer;

}


#weapon-list,
#upgrade-list {

    display:
        grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(170px, 1fr)
        );

    gap:
        15px;

}


.weapon-card,
.upgrade-card {

    min-height:
        170px;

    padding:
        18px;

    background:
        #333;

    border:
        3px solid #777;

    border-radius:
        15px;

    color:
        white;

    cursor:
        pointer;

    display:
        flex;

    flex-direction:
        column;

    align-items:
        center;

    justify-content:
        center;

    gap:
        12px;
}


.weapon-card.selected {

    border:
        5px solid white;

}


.weapon-card.locked {

    opacity:
        0.4;

    cursor:
        default;

}


.weapon-image {

    font-size:
        50px;

    height:
        70px;

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

}


.weapon-image img {

    max-width:
        120px;

    max-height:
        70px;

}


.weapon-card strong,
.upgrade-card strong {

    font-size:
        19px;

}


.weapon-card span,
.upgrade-card span {

    font-weight:
        bold;

}


.upgrade-card p {

    font-size:
        14px;

    line-height:
        1.4;

}


.upgrade-card.owned {

    opacity:
        0.55;

    cursor:
        default;

}

/* =========================================================
   NIEUWE FULLSCREEN WEAPON SHOP
   ========================================================= */

#shop-screen,
#upgrades-screen {
    position: fixed;
    inset: 0;

    width: 100vw;
    height: 100vh;

    z-index: 500;

    background:
        radial-gradient(
            circle at center,
            #27303b 0%,
            #11161d 58%,
            #07090d 100%
        );
}


#shop-screen[hidden],
#upgrades-screen[hidden] {
    display: none !important;
}


#shop-screen .story-popup-box,
#upgrades-screen .story-popup-box {
    position: relative;

    width: 100%;
    height: 100%;

    max-width: none;

    box-sizing: border-box;

    margin: 0;

    padding: 18px 28px;

    overflow: hidden;
}


#shop-screen .story-popup-box > h2,
#upgrades-screen .story-popup-box > h2 {
    margin: 5px 0 10px;

    color: white;

    text-align: center;

    font-size: clamp(22px, 2.3vw, 34px);

    letter-spacing: 4px;
}


.popup-close {
    position: absolute;

    right: 24px;
    top: 18px;

    width: 48px;
    height: 48px;

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

    border: 2px solid rgba(255,255,255,0.45);
    border-radius: 50%;

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

    color: white;

    font-size: 30px;

    cursor: pointer;

    z-index: 1000;
}


/* =========================================================
   WEAPONS
   ========================================================= */

#weapon-list {
    width: min(1500px, 95vw);
    height: calc(100vh - 90px);

    margin: 0 auto;

    display: grid;

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

    gap: clamp(8px, 1.3vw, 22px);

    align-items: center;
}


.weapon-card {
    width: 100%;
    min-width: 0;

    height: min(66vh, 590px);

    box-sizing: border-box;

    padding: 16px;

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

    gap: 10px;

    overflow: hidden;

    border: 3px solid rgba(255,255,255,0.18);
    border-radius: 20px;

    background:
        linear-gradient(
            160deg,
            rgba(58,67,80,0.96),
            rgba(20,24,31,0.98)
        );

    color: white;

    cursor: pointer;

    transition:
        transform 0.15s ease,
        border-color 0.15s ease,
        opacity 0.15s ease;
}


.weapon-card:hover {
    transform: translateY(-7px);

    border-color:
        rgba(255,255,255,0.8);
}


/* ELKE PNG KRIJGT ZIJN EIGEN VAK */

.weapon-image-area {
    width: 100%;
    height: 66%;

    min-height: 0;

    box-sizing: border-box;

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

    padding: 12px;

    overflow: hidden;

    border-radius: 13px;

    background:
        radial-gradient(
            circle,
            rgba(255,255,255,0.11),
            rgba(255,255,255,0.01)
        );
}


.weapon-shop-image {
    display: block;

    width: 100%;
    height: 100%;

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

    object-fit: contain;

    object-position: center;

    pointer-events: none;
}


.weapon-fallback {
    font-size: 70px;
}


.weapon-shop-name {
    font-size:
        clamp(15px, 1.5vw, 25px);

    text-align: center;

    text-transform: uppercase;
}


.weapon-unlock-text {
    font-size:
        clamp(9px, 0.8vw, 12px);

    opacity: 0.65;

    letter-spacing: 1px;
}


.weapon-shop-status {
    margin-top: auto;

    min-height: 22px;

    font-size:
        clamp(10px, 0.9vw, 14px);

    font-weight: 900;

    letter-spacing: 1px;
}


.weapon-locked {
    opacity: 0.27;

    filter: grayscale(1);

    cursor: not-allowed;
}


.weapon-locked:hover {
    transform: none;

    border-color:
        rgba(255,255,255,0.18);
}


.weapon-selected {
    opacity: 1;

    border-color: #ffd84a;

    box-shadow:
        0 0 14px rgba(255,216,74,0.55),
        0 0 42px rgba(255,216,74,0.17);
}


/* =========================================================
   UPGRADE MENU
   ========================================================= */

#upgrade-list {
    width: 100%;
    height: calc(100vh - 74px);

    box-sizing: border-box;

    display: flex;

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


.upgrade-tree {
    position: relative;

    width: min(1600px, 96vw);
    height: min(860px, 86vh);

    overflow: hidden;

    border:
        2px solid
        rgba(255,255,255,0.13);

    border-radius: 28px;

    background:

        radial-gradient(
            circle at center,
            rgba(63,72,86,0.55) 0%,
            rgba(24,29,38,0.88) 40%,
            rgba(7,10,15,0.98) 100%
        );

    box-shadow:
        inset 0 0 80px rgba(0,0,0,0.55);
}


/* subtiele cirkels zodat het op een web lijkt */

.upgrade-tree::before {
    content: "";

    position: absolute;

    left: 50%;
    top: 50%;

    width: 78%;
    height: 78%;

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

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

    border-radius: 50%;

    box-shadow:
        0 0 0 110px rgba(255,255,255,0.018),
        0 0 0 220px rgba(255,255,255,0.012);

    pointer-events: none;
}


/* =========================================================
   TOP BAR
   ========================================================= */

.upgrade-tree-topbar {
    position: absolute;

    left: 20px;
    right: 20px;
    top: 13px;

    height: 40px;

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

    pointer-events: none;

    z-index: 60;
}


.upgrade-tree-title {
    color: rgba(255,255,255,0.72);

    font-size:
        clamp(11px, 1vw, 15px);

    font-weight: 900;

    letter-spacing: 3px;
}


.upgrade-tree-books {
    padding: 8px 14px;

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

    border-radius: 12px;

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

    color: white;

    font-size:
        clamp(15px, 1.4vw, 21px);

    font-weight: 900;
}


/* =========================================================
   WEB LIJNEN
   ========================================================= */

.upgrade-tree-lines {
    position: absolute;

    inset: 0;

    width: 100%;
    height: 100%;

    pointer-events: none;

    z-index: 2;
}


.upgrade-tree-lines line {
    stroke:
        rgba(123,145,170,0.42);

    stroke-width: 0.38;

    vector-effect:
        non-scaling-stroke;
}


.upgrade-tree-lines line.active {
    stroke:
        rgba(255,210,65,0.85);

    stroke-width: 0.6;

    filter:
        drop-shadow(
            0 0 3px rgba(255,205,55,0.6)
        );
}


/* =========================================================
   UPGRADE NODES
   ========================================================= */

.upgrade-node {
    position: absolute;

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

    width:
        clamp(82px, 7.4vw, 125px);

    height:
        clamp(65px, 7.2vh, 82px);

    box-sizing: border-box;

    padding: 6px;

    display: flex;
    flex-direction: column;

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

    gap: 2px;

    overflow: hidden;

    border:
        2px solid
        rgba(255,255,255,0.24);

    border-radius: 15px;

    background:
        linear-gradient(
            145deg,
            #303744,
            #171c24
        );

    color: white;

    cursor: pointer;

    z-index: 20;

    box-shadow:
        0 5px 14px rgba(0,0,0,0.45);

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


.upgrade-node:hover {
    transform:
        translate(-50%, -50%)
        scale(1.11);

    z-index: 40;
}


.upgrade-node-icon {
    height: 21px;

    font-size:
        clamp(14px, 1.3vw, 21px);

    line-height: 21px;
}


.upgrade-node-name {
    max-width: 100%;

    overflow: hidden;

    font-size:
        clamp(8px, 0.72vw, 11px);

    font-weight: 900;

    line-height: 1.05;

    text-align: center;

    text-transform: uppercase;
}


.upgrade-node-cost {
    font-size:
        clamp(8px, 0.72vw, 11px);

    font-weight: 800;
}


/* KAN GEKOCHT WORDEN */

.upgrade-node.available {
    border-color:
        rgba(100,205,255,0.95);

    box-shadow:
        0 0 15px rgba(60,180,255,0.32);
}


/* NIET GENOEG BOEKJES */

.upgrade-node.not-affordable {
    border-color:
        rgba(180,185,195,0.38);
}


/* GEKOCHT */

.upgrade-node.owned {
    border-color:
        #ffd84a;

    background:
        linear-gradient(
            145deg,
            #6e5919,
            #33280b
        );

    box-shadow:
        0 0 13px rgba(255,216,74,0.56);
}


/* =========================================================
   MIDDENPANEEL
   ========================================================= */

#upgrade-info-panel {
    position: absolute;

    left: 50%;
    top: 10%;

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

    width:
        min(300px, 22vw);

    min-height: 90px;

    box-sizing: border-box;

    padding: 13px;

    display: flex;
    flex-direction: column;

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

    gap: 7px;

    border:
        2px solid
        rgba(255,255,255,0.22);

    border-radius: 18px;

    background:
        rgba(5,8,12,0.94);

    color: white;

    text-align: center;

    pointer-events: none;

    z-index: 30;

    box-shadow:
        0 9px 30px rgba(0,0,0,0.55);
}


#upgrade-info-panel strong {
    font-size:
        clamp(12px, 1.2vw, 18px);
}


#upgrade-info-panel p {
    margin: 0;

    font-size:
        clamp(9px, 0.8vw, 12px);

    line-height: 1.3;

    opacity: 0.8;
}


#upgrade-info-panel small {
    color: #ffd84a;

    font-weight: 900;

    font-size:
        clamp(9px, 0.8vw, 12px);
}


/* =========================================================
   KLEINERE SCHERMEN
   ========================================================= */

@media (max-width: 1050px) {

    #weapon-list {
        gap: 8px;
    }


    .weapon-card {
        padding: 8px;
    }


    .upgrade-node {
        width: 78px;
        height: 58px;

        padding: 4px;
    }


    .upgrade-node-name {
        font-size: 8px;
    }


    #upgrade-info-panel {
        width: 180px;
    }

}