/* Pyoran Character Roller - Dice Tray Styles */

.pyoran-roller-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto 40px;
}

/* Dice Tray - the bounded rolling area */
.pyoran-dice-tray {
    position: relative;
    width: 100%;
    height: 300px;
    background: linear-gradient(145deg, #1a1a1a 0%, #0a0a0a 100%);
    border-radius: 16px;
    overflow: hidden;
    box-shadow:
        inset 0 2px 20px rgba(0, 0, 0, 0.8),
        inset 0 0 60px rgba(0, 0, 0, 0.4),
        0 8px 32px rgba(0, 0, 0, 0.5);
}

/* Subtle neutral texture overlay */
.pyoran-dice-tray::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, 0.02) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(255, 255, 255, 0.015) 0%, transparent 40%);
    pointer-events: none;
    z-index: 1;
}

/* Chrome/metal rim effect */
.pyoran-dice-tray::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 6px solid transparent;
    border-radius: 16px;
    background: linear-gradient(145deg,
        #888 0%,
        #444 15%,
        #aaa 30%,
        #666 45%,
        #333 55%,
        #999 70%,
        #555 85%,
        #777 100%
    ) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 10;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.5);
}

/* Inner shadow to create depth */
.pyoran-dice-tray-inner {
    position: absolute;
    inset: 8px;
    border-radius: 10px;
    box-shadow: inset 0 4px 20px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    z-index: 2;
}

/* Sigil watermark in the background - embossed effect */
.pyoran-dice-tray-sigil {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: 60%;
    pointer-events: none;
    z-index: 1;
}

.pyoran-dice-tray-sigil svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Embossed effect: dark shadow below-right, light highlight above-left */
    filter:
        drop-shadow(-1px -1px 0px rgba(255, 255, 255, 0.08))
        drop-shadow(1px 1px 1px rgba(0, 0, 0, 0.6));
}

.pyoran-dice-tray-sigil svg .d {
    /* Make the fill transparent so only the shadows show */
    fill: rgba(0, 0, 0, 0.15);
}

/* Ensure the dice canvas stays above the sigil */
.pyoran-dice-tray canvas {
    position: relative;
    z-index: 5;
}

/* Roll Button */
.pyoran-roll-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 20px auto;
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--ghost-accent-color) 0%, color-mix(in srgb, var(--ghost-accent-color) 80%, black) 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: 'Waning Star', var(--font-sans);
    font-size: 2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.pyoran-roll-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.pyoran-roll-button:active {
    transform: translateY(0);
}

.pyoran-roll-button .d20-icon {
    width: 28px;
    height: 28px;
}

/* Rolling animation for button icon */
.pyoran-roll-button.rolling .d20-icon {
    animation: diceRollSpin 0.8s ease-in-out;
}

@keyframes diceRollSpin {
    0% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(90deg) scale(1.2); }
    50% { transform: rotate(180deg) scale(1.1); }
    75% { transform: rotate(270deg) scale(1.2); }
    100% { transform: rotate(360deg) scale(1); }
}

/* Results Display */
.pyoran-results {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 20px;
}

.pyoran-result-slot {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.pyoran-result-slot:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.pyoran-result-label {
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-secondary-text);
    margin-bottom: 8px;
}

.pyoran-result-value {
    font-family: 'Waning Star', var(--font-sans);
    font-size: 2rem;
    font-weight: 600;
    color: #fff;
    min-height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.pyoran-result-value.result-ready {
    opacity: 1;
    animation: resultReveal 0.4s ease-out;
}

@keyframes resultReveal {
    0% {
        opacity: 0;
        transform: translateY(-10px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Links in results */
.pyoran-result-value a {
    color: var(--ghost-accent-color);
    text-decoration: none;
}

.pyoran-result-value a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 900px) {
    .pyoran-results {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .pyoran-dice-tray {
        height: 220px;
    }

    .pyoran-results {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .pyoran-result-slot {
        padding: 16px;
    }

    .pyoran-result-value {
        font-size: 1.6rem;
    }

    .pyoran-roll-button {
        font-size: 1.6rem;
        padding: 14px 24px;
    }
}

@media (max-width: 480px) {
    .pyoran-results {
        grid-template-columns: 1fr;
    }
}
