/* Header & Navigation Fixes */
.nav-bar { display: flex; justify-content: space-between; align-items: center; padding: 15px 0; border-bottom: 1px solid #e5e7eb; margin-bottom: 8px; }
.game-header { border-bottom: 2px solid #3b82f6; margin-bottom: 30px; }
.back-btn { text-decoration: none; color: #6b7280; font-size: 0.9rem; font-weight: 600; }
.logo { font-weight: 800; text-transform: uppercase; color: #1a1a1a; }
.logo span { color: #3b82f6; }

/* Counter Area */
.main-counter-area { text-align: center; margin-bottom: 15px; }
#gold-count { font-size: 3.5rem; font-weight: 800; color: #1a1a1a; line-height: 1; }
.stat-label { display: block; font-size: 0.65rem; text-transform: uppercase; color: #9ca3af; font-weight: 700; margin-bottom: 4px; }

/* Game UI Grid */
#game-ui { background: #f9fafb; border-bottom: 1px solid #e5e7eb; padding: 12px; }
.stats-row { display: flex; justify-content: space-around; text-align: center; }
.stat-value { font-size: 1rem; font-weight: 700; color: #1a1a1a; }

/* REFINED SUBTLE STATUS BAR */
#status-overlay { position: absolute; top: 15px; width: 100%; text-align: center; pointer-events: none; z-index: 20; }
#status { 
    background: rgba(255, 255, 255, 0.96); display: inline-block; 
    padding: 6px 16px; border-radius: 20px; color: #4b5563; 
    font-weight: 700; font-size: 0.75rem; border: 1px solid #e5e7eb;
    box-shadow: 0 4px 10px rgba(0,0,0,0.04);
}

/* POPUPS */
#unlock-popup { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255,255,255,0.9); z-index: 100; display: flex; align-items: center; justify-content: center; }
.popup-content { background: white; padding: 20px; border-radius: 12px; border: 2px solid #3b82f6; text-align: center; }
.overlay-btn { background: #3b82f6; color: white; border: none; padding: 8px 18px; border-radius: 6px; font-weight: 700; cursor: pointer; margin-top: 12px; }

/* Canvas Area */
#game-area { position: relative; width: 100%; background: #f0f7ff; border-left: 1px solid #e5e7eb; border-right: 1px solid #e5e7eb; }
canvas { display: block; width: 100%; height: 350px; }
#unit-selection-ingame { position: absolute; bottom: 30px; left: 10px; display: flex; gap: 6px; z-index: 10; }
.unit-card-mini { width: 32px; height: 32px; background: white; border: 1px solid #e5e7eb; border-radius: 6px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 1rem; }
.unit-card-mini.active { border-color: #3b82f6; background: #eff6ff; box-shadow: 0 2px 5px rgba(59,130,246,0.2); }
.unit-card-mini.locked { opacity: 0.15; filter: grayscale(1); }

/* XP BAR */
.xp-bar-container { position: absolute; bottom: 0; width: 100%; height: 16px; background: #f3f4f6; }
#xp-fill { width: 0%; height: 100%; background: #3b82f6; }
.xp-text-overlay { position: absolute; top: 0; width: 100%; text-align: center; font-size: 0.6rem; line-height: 16px; font-weight: 800; color: #1a1a1a; }

/* BUTTONS & SHOP */
.control-panel { padding: 12px; display: flex; gap: 8px; background: white; border-top: 1px solid #e5e7eb; border-bottom: 1px solid #e5e7eb; }
.main-action-btn { flex: 1.5; padding: 10px; background: #3b82f6; color: white; border: none; border-radius: 8px; font-weight: 700; cursor: pointer; }
.utility-btn { flex: 1; padding: 10px; background: #fff; color: #1f2937; border: 1px solid #e5e7eb; border-radius: 8px; font-size: 0.7rem; font-weight: 700; cursor: pointer; transition: 0.2s; }
.utility-btn:hover { background: #f9fafb; border-color: #3b82f6; }
#auto-battle-btn.active { color: #10b981; border-color: #10b981; }

#shop { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px; background: #f9fafb; }
.shop-btn { padding: 15px; background: white; border: 1px solid #e5e7eb; border-radius: 10px; cursor: pointer; display: flex; flex-direction: column; align-items: center; }
.shop-btn:hover { border-color: #3b82f6; }
.btn-price { color: #3b82f6; font-weight: 700; font-size: 0.75rem; margin-top: 2px; }
.hidden { display: none !important; }