:root {
    --bg-color: #231e1b;
    --panel-bg: #332e2c;
    --text-main: #f0e6d2;
    --text-muted: #a89f94;
    
    --accent: #ffb74d;
    --combo-color: #ff4757;
    --combo-full: #ffd700;
    --btn-color: #81c784;
    --btn-hover: #66bb6a;
    --upgrade-bg: #4a403c;
    
    --font-title: 'Fredoka One', cursive;
    --font-body: 'Nunito', sans-serif;
}

* { box-sizing: border-box; user-select: none; -webkit-user-drag: none; }

body {
    margin: 0; background-color: var(--bg-color); color: var(--text-main);
    font-family: var(--font-body); overflow: hidden;
}

.game-layout {
    display: flex; height: 100vh; max-width: 1200px; margin: 0 auto; padding: 20px; gap: 20px;
}

/* --- GAUCHE --- */
.cat-zone { flex: 1.5; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.titles h2 { font-family: var(--font-title); font-size: 1.8rem; margin: 0; color: var(--text-main); text-align: center; }
.titles h3 { font-family: var(--font-body); font-size: 1.2rem; margin: 0 0 20px 0; color: var(--text-muted); text-align: center; }
.score-board { text-align: center; margin-bottom: 10px; }
#score { font-family: var(--font-title); font-size: 5rem; line-height: 1; color: var(--text-main); }
.label { font-weight: 800; text-transform: uppercase; letter-spacing: 2px; color: var(--text-muted); font-size: 1.2rem; }

/* COMBO */
.combo-container { width: 300px; margin-bottom: 20px; position: relative; }
.combo-bar { width: 100%; height: 12px; background: rgba(0,0,0,0.3); border-radius: 10px; overflow: hidden; }
.combo-fill { height: 100%; width: 0%; background: var(--combo-color); transition: width 0.1s linear, background 0.3s; box-shadow: 0 0 10px var(--combo-color); }
.combo-fill.frenzy { background: var(--combo-full); box-shadow: 0 0 15px var(--combo-full); }
.combo-text { text-align: center; font-weight: bold; font-size: 0.9rem; margin-top: 5px; color: var(--text-muted); }
.combo-text.active { color: var(--combo-full); animation: pulse 0.5s infinite alternate; }
@keyframes pulse { from { transform: scale(1); } to { transform: scale(1.1); } }

/* CHAT */
.cat-wrapper { position: relative; width: 400px; height: 400px; display: flex; justify-content: center; align-items: center; background: radial-gradient(circle, rgba(255, 183, 77, 0.2) 0%, transparent 70%); border-radius: 50%; }
#cat-image { width: 350px; height: 350px; object-fit: contain; cursor: pointer; transition: transform 0.05s cubic-bezier(0.25, 0.46, 0.45, 0.94); filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.5)); }
#cat-image:active { transform: scale(0.90) translateY(5px); }

.stats-bar { display: flex; gap: 20px; margin-top: 20px; background: var(--panel-bg); padding: 10px 30px; border-radius: 50px; box-shadow: 0 4px 10px rgba(0,0,0,0.3); font-weight: 800; color: var(--text-main); }

/* --- DROITE (SHOP) --- */
.shop-zone { flex: 1; background-color: var(--panel-bg); border-radius: 20px; padding: 20px; display: flex; flex-direction: column; box-shadow: 0 10px 30px rgba(0,0,0,0.3); max-width: 400px; overflow: hidden; }

/* UPGRADES AREA */
.upgrades-wrapper {
    min-height: 10px;
    max-height: 120px; 
    overflow-y: auto;
    margin-bottom: 10px;
    padding-right: 5px;
}

.upgrades-wrapper::-webkit-scrollbar { width: 4px; }
.upgrades-wrapper::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }

.upgrades-grid { display: flex; flex-wrap: wrap; gap: 8px; }

.upgrade-item { width: 48px; height: 48px; background: var(--upgrade-bg); border-radius: 8px; display: flex; justify-content: center; align-items: center; font-size: 1.5rem; cursor: pointer; border: 2px solid transparent; position: relative; transition: all 0.2s; flex-shrink: 0; }
.upgrade-item:hover { border-color: var(--accent); background: rgba(255,255,255,0.1); }

.shop-title { font-family: var(--font-title); font-size: 1.8rem; margin-bottom: 10px; text-align: center; color: var(--text-main); border-bottom: 2px dashed rgba(255,255,255,0.1); padding-bottom: 10px; }

.multiplier-bar { display: flex; gap: 5px; margin-bottom: 10px; background: rgba(0,0,0,0.2); padding: 5px; border-radius: 10px; flex-shrink: 0; }
.mult-btn { flex: 1; background: transparent; border: none; color: var(--text-muted); font-family: var(--font-title); padding: 5px 0; border-radius: 8px; cursor: pointer; transition: all 0.2s; }
.mult-btn:hover { color: var(--text-main); background: rgba(255,255,255,0.05); }
.mult-btn.active { background: var(--accent); color: #231e1b; font-weight: bold; }

#shop-list { overflow-y: auto; flex: 1; padding-right: 5px; }
#shop-list::-webkit-scrollbar { width: 6px; }
#shop-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }

.shop-item { background: rgba(255,255,255,0.05); border-radius: 15px; padding: 12px 15px; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; border: 2px solid transparent; transition: background 0.2s; }
.shop-item:hover { background: rgba(255,255,255,0.1); }

.item-left h4 { margin: 0; font-size: 1rem; font-family: var(--font-title); color: var(--text-main); }
.item-left p { margin: 2px 0 0 0; font-size: 0.8rem; color: var(--text-muted); font-weight: 700; }

.buy-btn { background-color: var(--btn-color); color: #121212; border: none; padding: 8px 12px; border-radius: 10px; font-family: var(--font-title); cursor: pointer; font-size: 0.85rem; min-width: 90px; transition: all 0.2s; }
.buy-btn:active { transform: scale(0.95); }
.buy-btn:hover { filter: brightness(1.1); }

.buy-btn.partial-lock { background-color: #4a4a4a; color: #999; opacity: 0.8; cursor: pointer; }
.buy-btn:disabled { background-color: #2d2d2d; color: #555; opacity: 0.5; cursor: not-allowed; }

#click-feedback-zone { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1000; }
.float-num { position: absolute; font-family: var(--font-title); font-size: 2rem; color: var(--text-main); animation: floatUp 0.8s forwards ease-out; font-weight: bold; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }
@keyframes floatUp { 0% { transform: translateY(0) scale(1); opacity: 1; } 100% { transform: translateY(-80px) scale(1.2); opacity: 0; } }

/* --- NOUVEAU STYLE TOOLTIP FLOTTANTE --- */
.tooltip {
    position: fixed;
    background: #111;
    border: 1px solid #555;
    color: #fff;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.9rem;
    pointer-events: none; /* Pour que la souris passe au travers */
    z-index: 9999; /* Au dessus de tout */
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    max-width: 250px;
}

.tooltip h4 { margin: 0 0 5px 0; color: var(--accent); font-family: var(--font-title); }
.tooltip .desc { color: #ccc; margin-bottom: 8px; font-size: 0.85rem; }
.tooltip .cost { font-weight: bold; color: #81c784; }
.tooltip.hidden { display: none; }