* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    font-family: "Trebuchet MS", Arial, sans-serif;
    color: #f7e7ba;

    background:
        linear-gradient(rgba(6, 12, 7, 0.35), rgba(6, 12, 7, 0.82)),
        url("../assets/background-home.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;

    overflow-x: hidden;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    opacity: 0.2;
    z-index: 0;
}

.game-screen {
    position: relative;
    z-index: 1;
    width: min(1250px, 100%);
    min-height: 100vh;
    margin: 0 auto;
    padding: 24px;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 20px;
}

/* HUD */

.game-hud {
    position: sticky;
    top: 12px;
    z-index: 100;

    display: flex;
    justify-content: start;
    gap: 16px;
    flex-wrap: wrap;
}

.hud-card {
    min-width: 180px;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(180deg, #65411f, #2f1b0d);
    border: 3px solid #d6a84f;
    border-radius: 18px;
    box-shadow:
        0 6px 0 #160d07,
        0 0 20px rgba(255, 201, 87, 0.15);
}

.hud-icon {
    font-size: 2rem;
}

.hud-card small {
    display: block;
    color: #d9bd7f;
    font-size: 0.8rem;
}

.hud-card strong {
    font-size: 1.5rem;
    color: #fff4c8;
}

/* Layout principal */

.main-area {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 20px;
    min-height: 480px;
}

.forest-panel,
.buyers-panel,
.upgrades-panel {
    background:
        linear-gradient(
            135deg,
            rgba(78, 52, 27, 0.72),
            rgba(24, 14, 8, 0.82)
        );

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    border: 2px solid rgba(255, 218, 117, 0.28);
    border-radius: 26px;

    box-shadow:
        0 14px 34px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        inset 0 0 30px rgba(255, 217, 112, 0.05);
}

/* Painel da floresta */

.forest-panel {
    position: relative;
    overflow: hidden;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.forest-panel::before {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 150px;
    background:
        radial-gradient(circle at 15% 100%, #162f16 0 45px, transparent 46px),
        radial-gradient(circle at 35% 100%, #1d421f 0 65px, transparent 66px),
        radial-gradient(circle at 62% 100%, #183819 0 55px, transparent 56px),
        radial-gradient(circle at 85% 100%, #1e4a20 0 75px, transparent 76px);
    opacity: 0.9;
}

.panel-title {
    position: relative;
    z-index: 2;
    text-align: center;
}

.panel-title h1 {
    font-size: clamp(2rem, 5vw, 4rem);
    color: #ffda75;
    text-shadow: 0 5px 0 #3c210c;
}

.panel-title p {
    margin-top: 6px;
    color: #d8c28a;
}

/* Área do gnomo */

.gnome-area {
    position: relative;
    z-index: 2;
    flex: 1;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.moon {
    position: absolute;
    top: 20px;
    right: 60px;
    width: 72px;
    height: 72px;
    background: #ffe8a3;
    border-radius: 50%;
    box-shadow: 0 0 35px rgba(255, 232, 163, 0.45);
    opacity: 0.8;
}


/* Botão cogumelo */

.mushroom-button {
    position: relative;
    display: flex;
    justify-content: center;
    width: 170px;
    height: 150px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: transform 0.12s ease;
    filter: drop-shadow(0 12px 0 rgba(0, 0, 0, 0.35));
}

.mushroom-button:hover {
    transform: scale(1.05);
}

.mushroom-button:active {
    transform: scale(0.94) translateY(6px);
}

.mushroom-cap {
    position: absolute;
    top: 18px;
    left: 15px;
    width: 140px;
    height: 85px;
    background:
        radial-gradient(circle at 30px 30px, #ffe9bd 0 9px, transparent 10px),
        radial-gradient(circle at 80px 20px, #ffe9bd 0 12px, transparent 13px),
        radial-gradient(circle at 105px 50px, #ffe9bd 0 8px, transparent 9px),
        linear-gradient(180deg, #ff5757, #a32020);
    border-radius: 80px 80px 38px 38px;
    border: 5px solid #551515;
}

.mushroom-stem {
    position: absolute;
    left: 60px;
    bottom: 8px;
    width: 52px;
    height: 82px;
    background: linear-gradient(180deg, #ffe7be, #d7a56d);
    border: 5px solid #6b3d20;
    border-radius: 22px 22px 18px 18px;
}

/* Botões */

.game-button,
.small-button {
    border: none;
    border-radius: 16px;
    font-family: inherit;
    font-weight: 900;
    cursor: pointer;

    color: #2b1608;
    background:
        linear-gradient(180deg, #ffe27a 0%, #e49a31 55%, #a9551c 100%);

    box-shadow:
        0 6px 0 #6b3513,
        0 0 18px rgba(255, 209, 92, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.45);

    transition:
        transform 0.1s ease,
        box-shadow 0.1s ease,
        filter 0.2s ease;
}

.game-button:hover,
.small-button:hover {
    filter: brightness(1.1);
    box-shadow:
        0 6px 0 #6b3513,
        0 0 24px rgba(255, 209, 92, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.game-button:active,
.small-button:active {
    transform: translateY(5px);
    box-shadow: 0 1px 0 #6b3513;
}

.game-button {
    position: relative;
    z-index: 2;
    width: min(360px, 100%);
    margin: 0 auto;
    padding: 16px 26px;
    font-size: 1.2rem;
}

.small-button {
    padding: 10px 14px;
    font-size: 0.85rem;
    white-space: nowrap;
}

.small-button.disabled {
    background: linear-gradient(180deg, #777, #444);
    color: #ddd;
    box-shadow: 0 6px 0 #222;
    cursor: not-allowed;
}

/* Compradores */

.buyers-panel {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.section-header {
    margin-bottom: 6px;
}

.section-header h2 {
    color: #ffda75;
    font-size: 1.5rem;
    text-shadow: 0 3px 0 #3c210c;
}

.section-header span {
    color: #cbb582;
    font-size: 0.9rem;
}

.buyers-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.buyer-card {
    display: grid;
    grid-template-columns: 54px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: linear-gradient(180deg, #3f2a18, #211208);
    border: 2px solid #9c7138;
    border-radius: 18px;
    box-shadow: inset 0 0 18px rgba(255, 222, 133, 0.04);
}

.buyer-card.locked {
    filter: grayscale(0.75);
    opacity: 0.7;
}

.buyer-avatar {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    font-size: 1.8rem;
    background: #1a0f08;
    border: 2px solid #c79646;
    border-radius: 16px;
}

.buyer-info h3 {
    color: #fff1bd;
    font-size: 1rem;
}

.buyer-info p {
    margin: 3px 0 8px;
    color: #c9b27a;
    font-size: 0.8rem;
}

.buyer-stats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.buyer-stats span {
    padding: 4px 8px;
    background: rgba(255, 215, 109, 0.12);
    border: 1px solid rgba(255, 215, 109, 0.25);
    border-radius: 999px;
    color: #ffd76d;
    font-size: 0.75rem;
}

.cooldown-bar {
    width: 100%;
    height: 8px;
    overflow: hidden;
    background: #130b06;
    border-radius: 999px;
    border: 1px solid #6d4824;
}

.cooldown-fill {
    width: 70%;
    height: 100%;
    background: linear-gradient(90deg, #63ff7d, #ffe66d);
    border-radius: inherit;
}

.cooldown-fill.slower {
    width: 40%;
}

.cooldown-fill.empty {
    width: 0;
}

/* Upgrades */

.upgrades-panel {
    padding: 20px;
}

.upgrades-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.upgrade-card {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: linear-gradient(180deg, #3b2817, #201107);
    border: 2px solid #9c7138;
    border-radius: 18px;
}

.upgrade-icon {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    font-size: 2rem;
    background: #160d07;
    border: 2px solid #c79646;
    border-radius: 16px;
}

.upgrade-card h3 {
    color: #fff1bd;
    font-size: 1rem;
}

.upgrade-card p {
    color: #c9b27a;
    font-size: 0.82rem;
    margin: 3px 0;
}

.upgrade-card strong {
    color: #ffd76d;
    font-size: 0.82rem;
}

.rebirth-panel {
    padding: 20px;
    background:
        linear-gradient(180deg, rgba(64, 43, 90, 0.94), rgba(25, 14, 38, 0.96));
    border: 3px solid #b78cff;
    border-radius: 26px;
    box-shadow:
        0 10px 0 #160d07,
        inset 0 0 30px rgba(203, 157, 255, 0.08);
}

.rebirth-card {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: linear-gradient(180deg, #3a2750, #1b1028);
    border: 2px solid #b78cff;
    border-radius: 18px;
}

.rebirth-card h3 {
    color: #f4dcff;
    font-size: 1rem;
}

.rebirth-card p {
    color: #d7bdf2;
    font-size: 0.82rem;
    margin: 3px 0;
}

.rebirth-card strong {
    color: #ffe27a;
    font-size: 0.82rem;
}

@media (max-width: 600px) {
    .rebirth-card {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .rebirth-card .upgrade-icon {
        margin: 0 auto;
    }
}

@media (max-width: 950px) {
    body {
        overflow-y: auto;
    }

    .game-screen {
        min-height: auto;
    }

    .main-area {
        grid-template-columns: 1fr;
    }

    .upgrades-grid {
        grid-template-columns: 1fr;
    }

    .forest-panel {
        min-height: 500px;
    }
}

@media (max-width: 600px) {
    .game-screen {
        padding: 14px;
    }

    .hud-card {
        width: 100%;
    }

    .buyer-card,
    .upgrade-card {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .buyer-avatar,
    .upgrade-icon {
        margin: 0 auto;
    }

    .small-button {
        width: 100%;
    }

    .gnome-area {
        flex-direction: column;
        gap: 30px;
    }

    .gnome-card {
        margin-right: 0;
    }

    .moon {
        right: 20px;
    }
}

@media (max-width: 600px) {
    .game-hud {
        top: 8px;
        padding: 8px;
    }

    .hud-card {
        min-width: 100%;
    }
}