/* Bokbyen Page Styles - GlupusLes */

#main {
    margin-top: calc(var(--header-height));
}

/* XP Display */
#xpLeftDiv {
    box-sizing: border-box;
    width: 100%;
    text-align: center;
    margin-top: 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0.75rem;
    background-color: var(--panel-color);
    border-radius: var(--border-radius);
    max-width: 400px;
    margin-inline: auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Bokbyen City Wrapper */
#bokbyenWrapper {
    position: relative;
    width: 90%;
    max-width: 1200px;
    margin-inline: auto;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

#bokbyenBackImg {
    display: block;
    width: 100%;
    height: auto;
    min-height: 300px;
    object-fit: cover;
}

#imgGridWrapper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(2, 1fr);
    grid-auto-flow: column;
    gap: 4px;
    padding: 8px;
}

.bbColumn {
    display: contents;
}

.bbImg {
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: pointer;
    transition: transform 0.3s ease, filter 0.3s ease;
    border-radius: 8px;
}

.bbImg:hover {
    transform: scale(1.1);
    filter: brightness(1.1);
    z-index: 10;
}

.centeredh1 {
    text-align: center;
    margin-top: 2rem;
    margin-bottom: 1.5rem;
    font-size: clamp(1.5rem, 4vw, 2rem);
}

/* Upgrade Section */
#bbUpgradeWrapper {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    width: 90%;
    max-width: 1200px;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    background-color: var(--panel-color);
    margin-inline: auto;
    margin-bottom: calc(var(--header-height) + 3rem);
    margin-top: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.bbUpgradeDiv {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid var(--panel-color);
    border-radius: var(--border-radius);
    background-color: var(--bgcolor);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bbUpgradeDiv:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.bbUpgradeDescription {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color);
}

.bbUpgradeCurrentLevel {
    font-size: 0.9rem;
    color: var(--color);
    opacity: 0.8;
}

.bbUpgradeCost {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    color: var(--logo-color);
    background-color: var(--emphasis-color);
    border: none;
    border-radius: var(--button-border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    text-align: center;
    margin-top: auto;
}

.bbUpgradeCost:hover:not(:disabled) {
    filter: brightness(1.1);
    transform: scale(1.02);
}

.bbUpgradeCost:disabled {
    background-color: var(--panel-color);
    color: var(--color);
    opacity: 0.6;
    cursor: not-allowed;
}

.bbUpgradeMaxLevel {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    color: var(--emphasis-color);
    background-color: var(--bgcolor);
    border: 2px solid var(--emphasis-color);
    border-radius: var(--button-border-radius);
    font-weight: 600;
    text-align: center;
    margin-top: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    #bokbyenWrapper {
        width: 95%;
    }

    #imgGridWrapper {
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: repeat(3, 1fr);
        gap: 2px;
        padding: 4px;
    }

    #bbUpgradeWrapper {
        width: 95%;
        padding: 1rem;
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }

    .bbUpgradeDiv {
        padding: 0.875rem;
    }

    .centeredh1 {
        margin-top: 1.5rem;
        padding-inline: 1rem;
    }
}

@media (max-width: 480px) {
    #imgGridWrapper {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(4, 1fr);
    }

    #bbUpgradeWrapper {
        grid-template-columns: 1fr;
    }

    .bbUpgradeDiv {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
    }

    .bbUpgradeDescription {
        flex: 1 1 100%;
    }

    .bbUpgradeCurrentLevel {
        flex: 1;
    }

    .bbUpgradeCost {
        flex: 0 0 auto;
    }
}
