/* Kostki do gry (dice.js) — strona główna, /dice/ i strony błędów. Kostki to SVG animowane z JS. */

/* scena: kostki i ich cienie, pozycjonowane transformacją (dice.js) */
.dz-stage {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.dz-die,
.dz-shadow {
    position: absolute;
    left: 0;
    top: 0;
    will-change: transform;
}

.dz-face { transition: opacity 0.15s; }

.dz-die svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.dz-shadow {
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.25) 60%, transparent);
}

/* k20: 20 = złota poświata, 1 = przygaszona */
.dz-die.dz-crit { filter: drop-shadow(0 0 14px #fbbf24) drop-shadow(0 0 4px #fde68a); }
.dz-die.dz-fail { filter: grayscale(0.85) brightness(0.75); }

/* ---------- panel rzutów ---------- */

.dz-roller {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dz-types {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.dz-type,
.dz-count button,
.dz-roll-btn {
    font: inherit;
    cursor: pointer;
    border: none;
}

.dz-type {
    min-width: 3.4rem;
    padding: 0.55rem 0.9rem;
    border-radius: 10px;
    font-weight: 700;
    color: #cbd5e0;
    background: #1e293b;
    border: 1px solid rgba(79, 209, 197, 0.25);
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.dz-type:hover { transform: translateY(-2px); }

.dz-type.active {
    color: #1a202c;
    background: linear-gradient(135deg, #4fd1c5 0%, #5a67d8 100%);
    border-color: transparent;
    box-shadow: 0 5px 20px rgba(79, 209, 197, 0.4);
}

.dz-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.dz-count {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: #1e293b;
    border: 1px solid rgba(79, 209, 197, 0.25);
    border-radius: 10px;
    padding: 0.25rem;
}

.dz-count button {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 8px;
    font-size: 1.3rem;
    font-weight: 700;
    color: #4fd1c5;
    background: transparent;
}

.dz-count button:hover { background: rgba(79, 209, 197, 0.12); }

.dz-count-value {
    min-width: 1.8rem;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 800;
    color: #e2e8f0;
}

.dz-roll-btn {
    padding: 0.8rem 2rem;
    border-radius: 12px;
    font-size: 1.15rem;
    font-weight: 800;
    color: #1a202c;
    background: linear-gradient(135deg, #4fd1c5 0%, #5a67d8 100%);
    box-shadow: 0 10px 30px rgba(79, 209, 197, 0.35);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.dz-roll-btn:hover { transform: translateY(-3px) scale(1.03); }
.dz-roll-btn:disabled { opacity: 0.6; cursor: wait; transform: none; }

/* stół z suknem */
.dz-tray {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-content: center;
    min-height: 320px;
    padding: 1.5rem;
    border-radius: 18px;
    overflow: hidden;
    cursor: pointer;
    background:
        radial-gradient(ellipse at 50% 40%, rgba(255, 255, 255, 0.07) 0%, transparent 65%),
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.018) 0 2px, transparent 2px 4px),
        linear-gradient(160deg, #1d5c55 0%, #134540 55%, #0d332f 100%);
    border: 6px solid #3b2a1e;
    box-shadow:
        inset 0 0 40px rgba(0, 0, 0, 0.55),
        inset 0 0 0 1px rgba(255, 255, 255, 0.06),
        0 0 0 1px rgba(79, 209, 197, 0.25),
        0 12px 30px rgba(0, 0, 0, 0.4);
}

.dz-tray:focus-visible { outline: 3px solid #4fd1c5; outline-offset: 3px; }

.dz-result {
    text-align: center;
    min-height: 3.6rem;
}

.dz-result-main {
    display: block;
    font-size: 1.8rem;
    font-weight: 900;
    background: linear-gradient(135deg, #4fd1c5 0%, #5a67d8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dz-result-note {
    display: block;
    color: #fbbf24;
    font-weight: 700;
}

.dz-history {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
    margin: 0;
    padding: 0;
}

.dz-history li {
    font-size: 0.85rem;
    color: #94a3b8;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 999px;
    padding: 0.15rem 0.7rem;
}

.dz-history li:first-child { color: #e2e8f0; }

@media (max-width: 520px) {
    .dz-tray { min-height: 300px; }
    .dz-result-main { font-size: 1.5rem; }
}
