* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #090d12;
    color: #e9f4f3;
    font-family: Arial, sans-serif;
}

#game {
    max-width: 1200px;
    margin: auto;
    padding: 30px;
}

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

h1 {
    letter-spacing: 8px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: 25px 0;
}

.stats div {
    background: #111820;
    padding: 18px;
}

.stats span {
    display: block;
    opacity: .5;
    font-size: 12px;
    text-transform: uppercase;
}

.stats strong {
    display: block;
    margin-top: 6px;
    font-size: 22px;
}

main {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
}

.level-image img {
    width: 75%;
    max-width: 512px;
    height: auto;
    display: block;
}
.actions {
    background: #111820;
    padding: 20px;
}

button {
    width: 100%;
    padding: 15px;
    margin-bottom: 10px;

    border: 1px solid #344b55;
    background: #17232b;
    color: white;

    cursor: pointer;

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

button:active {
    transform: scale(0.97);
}

button.success {
    animation: successfulClick 0.4s ease;
}


@keyframes successfulClick {
    0% {
        background: #17232b;
        box-shadow: none;
    }

    30% {
        background: #19a974;
        border-color: #5fffc1;
        box-shadow: 0 0 18px rgba(50, 255, 170, 0.6);
        transform: scale(0.97);
    }

    100% {
        background: #17232b;
        box-shadow: none;
        transform: scale(1);
    }
}

button:hover {
    background: #213740;
}

.end-turn {
    margin-top: 30px;
    border-color: #61d5c5;
}

#log {
    grid-column: 1 / -1;
    background: #111820;
    padding: 20px;
}

#messages div {
    padding: 6px 0;
    border-bottom: 1px solid #222;
}

#levelup-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;

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

    opacity: 0;
    pointer-events: none;

    transition: opacity 0.3s ease;

    z-index: 9999;
}

#levelup-overlay.show {
    opacity: 1;
}

#levelup-card {
    text-align: center;
    transform: scale(0.6);
    opacity: 0;
}

#levelup-overlay.show #levelup-card {
    animation: levelUpCard 1.4s ease forwards;
}

#levelup-title {
    font-size: 18px;
    letter-spacing: 8px;
    opacity: 0.7;
}

#levelup-name {
    margin-top: 12px;

    font-size: 48px;
    font-weight: bold;
    letter-spacing: 4px;
}

@keyframes levelUpCard {
    0% {
        transform: scale(0.6);
        opacity: 0;
    }

    25% {
        transform: scale(1.15);
        opacity: 1;
    }

    60% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 0;
    }
}

.level-image.levelup img {
    animation: imageLevelUp 1s ease;
}

@keyframes imageLevelUp {
    0% {
        transform: scale(1);
        filter: brightness(1);
    }

    40% {
        transform: scale(1.04);
        filter: brightness(1.8);
    }

    100% {
        transform: scale(1);
        filter: brightness(1);
    }
}

#levelup-overlay.level-up #levelup-name {
    color: #5fffc1;
    text-shadow:
        0 0 10px rgba(95, 255, 193, .8),
        0 0 30px rgba(95, 255, 193, .4);
}

#levelup-overlay.level-down #levelup-name {
    color: #ff5f6d;
    text-shadow:
        0 0 10px rgba(255, 95, 109, .8),
        0 0 30px rgba(255, 95, 109, .4);
}

.level-image.levelup img {
    animation: imageLevelUp 1s ease;
}

.level-image.leveldown img {
    animation: imageLevelDown 1s ease;
}

@keyframes imageLevelUp {
    0% {
        transform: scale(1);
        filter: brightness(1);
    }

    40% {
        transform: scale(1.04);
        filter:
            brightness(1.5)
            drop-shadow(0 0 18px rgba(95, 255, 193, .8));
    }

    100% {
        transform: scale(1);
        filter: brightness(1);
    }
}

@keyframes imageLevelDown {
    0% {
        transform: scale(1);
        filter: brightness(1);
    }

    40% {
        transform: scale(.97);
        filter:
            brightness(.7)
            drop-shadow(0 0 18px rgba(255, 95, 109, .8));
    }

    100% {
        transform: scale(1);
        filter: brightness(1);
    }
}

#cash,
#income {
    color: #5fffc1;
}

#expenses {
    color: #ff5f6d;
}
#networth {
    color: #7ddcff;
}

.locked {
    display: none;
}