/* Layout Sync */
.nav-bar { display: flex; justify-content: space-between; align-items: center; padding: 15px 0; border-bottom: 1px solid #e5e7eb; margin-bottom: 20px; }
.back-btn { text-decoration: none; color: #6b7280; font-size: 0.9rem; font-weight: 600; padding: 5px 10px; border-radius: 6px; transition: 0.2s; }
.back-btn:hover { background: #f3f4f6; color: #3b82f6; }
.logo { font-weight: 800; text-transform: uppercase; letter-spacing: 1px; font-size: 1.2rem; color: #000; }
.logo span { color: #3b82f6; }

.main-counter-area { text-align: center; margin-bottom: 15px; position: relative; }
#balance-count { font-size: 3.5rem; font-weight: 800; color: #1a1a1a; line-height: 1; }
.prestige-tag { font-weight: 900; color: #3b82f6; font-size: 0.9rem; margin-top: 5px; }

.mining-display-area { 
    background: #f0f9ff; padding: 20px; border-bottom: 1px solid #bae6fd; 
    position: relative; display: flex; flex-direction: column; align-items: center; min-height: 550px; 
}

/* Corner Stats Overlay */
.corner-stats { position: absolute; top: 10px; right: 15px; text-align: right; opacity: 0.4; font-size: 0.7rem; font-weight: 700; color: #64748b; pointer-events: none; z-index: 10; }

#mining-container { position: relative; width: 100%; max-width: 450px; }
.grid-9 { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; width: 100%; }

#spawn-area { height: 60px; border: 2px dashed #bae6fd; margin-bottom: 10px; border-radius: 8px; }

.block { height: 45px; position: relative; border-radius: 4px; overflow: hidden; transition: opacity 0.3s, transform 0.3s; }
.hp-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: white; font-weight: 900; font-size: 0.75rem; text-shadow: 2px 2px 0 #000; pointer-events: none; }

.pickaxe, .tnt { position: absolute; width: 32px; height: 32px; z-index: 100; pointer-events: none; transform: translate(-50%, -50%); }
.chest-box { height: 50px; position: relative; display: flex; align-items: center; justify-content: center; }
.chest-img { width: 100%; height: 100%; object-fit: contain; filter: grayscale(100%) brightness(40%); }
.chest-box.open .chest-img { filter: none; transform: scale(1.1); }

.mult-popup { position: absolute; top: -10px; background: #ea580c; color: white; padding: 2px 5px; border-radius: 4px; font-weight: 900; font-size: 0.65rem; z-index: 10; animation: bounce 0.5s infinite alternate; }
@keyframes bounce { from { transform: translateY(0); } to { transform: translateY(-3px); } }

.win-display-bar { width: 100%; max-width: 450px; background: #1e293b; color: #fbbf24; padding: 12px; margin-top: 20px; border-radius: 8px; font-weight: 900; font-size: 1.8rem; text-align: center; border: 3px solid #fbbf24; }

/* Overlay Message */
#game-msg-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(30, 41, 59, 0.95); z-index: 500; display: flex; align-items: center; justify-content: center; color: white; padding: 20px; }
.msg-content { background: white; color: #1e293b; padding: 30px; border-radius: 12px; text-align: center; border: 4px solid #3b82f6; max-width: 320px; }
.msg-content h2 { font-weight: 900; margin-bottom: 10px; color: #3b82f6; }
.msg-content p { font-size: 0.85rem; margin-bottom: 20px; font-weight: 600; line-height: 1.4; }
.msg-content button { background: #3b82f6; color: white; border: none; padding: 12px 20px; border-radius: 8px; font-weight: 800; cursor: pointer; width: 100%; }

/* Shop Layout */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 15px; background: #f8fafc; border-top: 1px solid #e2e8f0; }
.shop-btn { background: #fff; border: 1px solid #e2e8f0; padding: 10px; border-radius: 10px; text-align: center; cursor: pointer; transition: 0.2s; display: flex; flex-direction: column; align-items: center; }
.shop-btn:hover:not(:disabled) { border-color: #3b82f6; background: #f0f7ff; }
.shop-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.shop-btn .btn-title { font-weight: 800; font-size: 0.75rem; color: #1e293b; }
.shop-btn .btn-price { color: #3b82f6; font-weight: 800; font-size: 0.8rem; }
.shop-btn .next-gain { color: #10b981; font-weight: 700; font-size: 0.7rem; }
.upgrade-count { font-size: 0.6rem; color: #94a3b8; border-top: 1px dotted #e2e8f0; padding-top: 2px; width: 100%; margin-top: 4px; }

/* Action Grid Placement */
.action-grid { padding: 15px; background: #f8fafc; text-align: center; }
.action-grid.top-border { border-top: 1px solid #e2e8f0; border-bottom: 1px solid #e2e8f0; }

.main-action-btn { background: #3b82f6; color: white; border: none; padding: 12px 30px; border-radius: 10px; cursor: pointer; font-weight: 800; display: flex; flex-direction: column; align-items: center; margin: 0 auto; transition: 0.2s; }
.main-action-btn:hover { background: #2563eb; transform: translateY(-2px); }
.btn-price { font-size: 0.7rem; opacity: 0.8; }

.content-section { padding: 30px 20px; text-align: left; border-top: 1px solid #e5e7eb; background: #fff; line-height: 1.6; }
.category-title { border-left: 4px solid #3b82f6; padding-left: 15px; margin: 25px 0 10px; font-weight: 800; font-size: 1.2rem; }
.instructions { list-style: disc; padding-left: 20px; margin-bottom: 20px; }
.particle { position: fixed; width: 4px; height: 4px; pointer-events: none; z-index: 1000; }
.hidden { display: none !important; }