diff --git a/pyramid.css b/pyramid.css index 10da44d..783a7a0 100644 --- a/pyramid.css +++ b/pyramid.css @@ -44,6 +44,17 @@ background: var(--card-bg); } +#pyramid-stock:empty::before { + content: '↺'; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + font-size: 32px; + opacity: 0.3; + color: var(--text-color); +} + .card.is-selected { outline: 4px solid var(--glow); box-shadow: 0 0 20px var(--glow); diff --git a/pyramid.js b/pyramid.js index 03aef9c..193ec28 100644 --- a/pyramid.js +++ b/pyramid.js @@ -373,15 +373,23 @@ // ====== EVENT LISTENERS ====== gameBoard.addEventListener('click', (e) => { + if (!isActive) return; + const cardEl = e.target.closest('.card'); - if (cardEl) { - handleCardClick(cardEl.dataset.id); + const pileEl = e.target.closest('.pile'); + + // Check if we clicked the stock pile OR a card that is currently in the stock + const isStockClick = (pileEl && pileEl.id === 'pyramid-stock') || + (cardEl && stock.some(c => c.id === cardEl.dataset.id)); + + if (isStockClick) { + handleStockClick(); return; } - const pileEl = e.target.closest('.pile'); - if (pileEl && pileEl.id === 'pyramid-stock') { - handleStockClick(); + if (cardEl) { + handleCardClick(cardEl.dataset.id); + return; } });