/* ===========================
       VARIABLES & RESET
    =========================== */
:root {
    --bg: #1a0e07;
    --surface: #2d1a0e;
    --card: #3d2412;
    --accent: #e07b3a;
    --gold: #f5c842;
    --text: #f5e6d3;
    --muted: #a07855;
    --green: #5ecb7a;
    --disabled: #4a3020;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Nunito', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

h1 {
    font-family: 'Fredoka One', cursive;
    font-size: 2.8rem;
    color: var(--gold);
    text-align: center;
    padding: 1.5rem 0 0.5rem;
    letter-spacing: 1px;
    text-shadow: 0 2px 12px #f5c84244;
}

/* ===========================
       LAYOUT PRINCIPAL
    =========================== */
.game {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    padding: 1.5rem;
    width: 100%;
    max-width: 900px;
}

/* ===========================
       ZONE COOKIE (gauche)
    =========================== */
.left-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    min-width: 260px;
}

/* Compteur de cookies */
.counter {
    background: var(--surface);
    border: 1px solid #5c3520;
    border-radius: 16px;
    padding: 1rem 2rem;
    text-align: center;
    width: 100%;
}

.counter .total {
    font-family: 'Fredoka One', cursive;
    font-size: 2.4rem;
    color: var(--gold);
}

.counter .label {
    font-size: 0.9rem;
    color: var(--muted);
    margin-top: 2px;
}

.counter .cps {
    font-size: 0.85rem;
    color: var(--green);
    margin-top: 6px;
}

/* Le cookie cliquable */
.cookie-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 9rem;
    line-height: 1;
    transition: transform 0.08s ease;
    filter: drop-shadow(0 4px 18px #e07b3a55);
    user-select: none;
}

.cookie-btn:active {
    transform: scale(0.88);
}

.cookie-btn:hover {
    filter: drop-shadow(0 4px 28px #f5c84266);
}

/* Infos de clic */
.click-info {
    font-size: 0.85rem;
    color: var(--muted);
}

.click-info span {
    color: var(--accent);
    font-weight: 700;
}

/* Animation +N au clic */
.float-text {
    position: fixed;
    pointer-events: none;
    font-family: 'Fredoka One', cursive;
    font-size: 1.4rem;
    color: var(--gold);
    text-shadow: 0 2px 8px #0008;
    animation: floatUp 0.9s ease-out forwards;
    z-index: 999;
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateY(-70px);
    }
}

/* ===========================
       ZONE UPGRADES (droite)
    =========================== */
.right-panel {
    flex: 1;
    min-width: 280px;
    max-width: 420px;
}

.right-panel h2 {
    font-family: 'Fredoka One', cursive;
    font-size: 1.4rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

.upgrade-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

/* Carte d'upgrade */
.upgrade-card {
    background: var(--card);
    border: 1px solid #5c3520;
    border-radius: 14px;
    padding: 0.9rem 1.1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: border-color 0.2s;
}

.upgrade-card.affordable {
    border-color: var(--accent);
}

.upgrade-card.maxed {
    border-color: var(--green);
    opacity: 0.7;
}

.upgrade-icon {
    font-size: 2.2rem;
    line-height: 1;
}

.upgrade-info {
    flex: 1;
}

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

.upgrade-desc {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 2px;
}

.upgrade-owned {
    font-size: 0.75rem;
    color: var(--green);
    margin-top: 3px;
}

.buy-btn {
    background: var(--disabled);
    border: none;
    border-radius: 10px;
    color: var(--muted);
    font-family: 'Fredoka One', cursive;
    font-size: 0.95rem;
    padding: 0.5rem 0.9rem;
    cursor: not-allowed;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
    min-width: 90px;
    text-align: center;
}

.buy-btn.ready {
    background: var(--accent);
    color: #fff;
    cursor: pointer;
}

.buy-btn.ready:hover {
    background: var(--gold);
    color: #1a0e07;
}

.buy-btn.maxed-btn {
    background: #2a4a30;
    color: var(--green);
    cursor: default;
}

/* ===========================
       BOUTON RESET
    =========================== */
.reset-btn {
    margin-top: 2rem;
    background: none;
    border: 1px solid #5c3520;
    border-radius: 10px;
    color: var(--muted);
    font-family: 'Nunito', sans-serif;
    font-size: 0.85rem;
    padding: 0.4rem 1.2rem;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.reset-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}