diff --git a/public/js/gaststaette/glucksspiel.js b/public/js/gaststaette/glucksspiel.js index 602f581..6578b87 100644 --- a/public/js/gaststaette/glucksspiel.js +++ b/public/js/gaststaette/glucksspiel.js @@ -293,44 +293,46 @@ function renderShell() { .gs-combine-grid { flex: 1; - display: grid; - grid-template-columns: repeat(3, 1fr); - gap: 8px; - overflow-y: auto; - padding: 10px 12px; - align-content: start; + display: flex; + align-items: flex-start; + justify-content: center; + padding: 20px 12px 10px; + overflow: hidden; } - /* Kombinier-Karte (gleich wie gs-card, grüner Rand) */ - .gs-combine-card { + /* Gestapelter Kartenstapel */ + .gs-card-stack { position: relative; + /* Breite wie eine Karte in der Sammlung (~160px bei 5-Spalten-Grid) */ + width: 140px; + aspect-ratio: 3/4; + cursor: pointer; + } + + .gs-stack-card { + position: absolute; + width: 100%; + aspect-ratio: 3/4; border: 2px solid #4a8b2a; border-radius: 8px; - overflow: visible; + overflow: hidden; background: #0f1a04; - cursor: pointer; transition: transform 0.2s, border-color 0.2s; - aspect-ratio: 3/4; - display: flex; - flex-direction: column; } - .gs-combine-card:hover { - border-color: #ff4444; - transform: scale(1.05); - z-index: 10; - } - .gs-combine-card:hover::after { - content: "✕"; - position: absolute; inset: 0; - background: rgba(180,0,0,0.55); - display: flex; align-items: center; justify-content: center; - font-size: 24px; color: #fff; - border-radius: 6px; pointer-events: none; - } - .gs-combine-card img { + .gs-stack-card img { width: 100%; height: 100%; object-fit: cover; display: block; - border-radius: 6px; + } + .gs-card-stack:hover .gs-stack-card:last-child { + border-color: #ff4444; + } + .gs-card-stack:hover .gs-stack-card:last-child::after { + content: "✕ Entfernen"; + position: absolute; inset: 0; + background: rgba(180,0,0,0.6); + display: flex; align-items: center; justify-content: center; + font-family: "Cinzel", serif; font-size: 11px; + color: #fff; border-radius: 6px; pointer-events: none; } .gs-combine-count { @@ -528,20 +530,34 @@ function renderCombineField() { hint.style.display = "none"; - grid.innerHTML = gs_combineCards.map((c, i) => ` -
+ // Karten als gestapelter Stapel – jede Karte leicht versetzt + const offset = Math.min(6, 40 / gs_combineCards.length); // max 6px versatz + const stackHeight = offset * (gs_combineCards.length - 1); // extra höhe für stapel + + const stackCards = gs_combineCards.map((c, i) => ` +
${c.name} + ${c.cooldown != null ? `${c.cooldown}` : ""}
`).join(""); - grid.querySelectorAll(".gs-combine-card").forEach((el) => { - el.addEventListener("click", () => { - removeFromField(parseInt(el.dataset.index)); - }); + grid.innerHTML = ` +
+ ${stackCards} +
`; + + // Klick auf Stapel → oberste Karte entfernen + grid.querySelector(".gs-card-stack").addEventListener("click", () => { + removeFromField(gs_combineCards.length - 1); }); - count.textContent = `${gs_combineCards.length} Karte${gs_combineCards.length !== 1 ? "n" : ""} im Feld`; + count.textContent = `${gs_combineCards.length} Karte${gs_combineCards.length !== 1 ? "n" : ""} im Stapel`; btn.disabled = gs_combineCards.length < 2; }