/* ========================================
   D20 Overlay - 3D Dice Roll
   ======================================== */

/* D20 Step Container */
#sim-step-d20:not(.hidden) {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 320px;
}

/* "LE DESTIN SE PRONONCE..." title */
.d20-title {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.25em;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
}

/* Canvas container */
#d20-canvas-container {
    width: 280px;
    height: 280px;
    cursor: pointer;
    touch-action: none;
    position: relative;
}

#d20-canvas-container canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* "Cliquez pour lancer" prompt */
.d20-prompt {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 1rem;
    letter-spacing: 0.05em;
    animation: d20Pulse 2s ease-in-out infinite;
}

.d20-prompt.hidden {
    display: none;
}

@keyframes d20Pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; color: rgba(255, 255, 255, 0.8); }
}

/* Result display */
.d20-result {
    text-align: center;
    margin-top: 1.25rem;
}

.d20-result.hidden {
    display: none;
}

.d20-result-number {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    display: block;
    animation: d20ScaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* Tier glow colors */
.d20-result-number.tier-critical {
    color: #d4af37;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.6), 0 0 50px rgba(212, 175, 55, 0.25);
}

.d20-result-number.tier-success {
    color: #ffffff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.4), 0 0 50px rgba(255, 255, 255, 0.15);
}

.d20-result-number.tier-complication {
    color: #ef4444;
    text-shadow: 0 0 20px rgba(239, 68, 68, 0.6), 0 0 50px rgba(239, 68, 68, 0.25);
}

@keyframes d20ScaleIn {
    from { transform: scale(0.4); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Tier label */
.d20-tier-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-top: 0.35rem;
    animation: d20FadeUp 0.4s ease 0.15s both;
}

.d20-tier-label.tier-critical {
    color: #d4af37;
}

.d20-tier-label.tier-success {
    color: rgba(255, 255, 255, 0.7);
}

.d20-tier-label.tier-complication {
    color: #ef4444;
}

@keyframes d20FadeUp {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Roll recall badge on outcome step */
.d20-recall {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    width: fit-content;
}

.d20-recall-number {
    font-size: 1.1rem;
    font-weight: 800;
    min-width: 1.75rem;
    text-align: center;
    line-height: 1;
}

.d20-recall-number.tier-critical { color: #d4af37; }
.d20-recall-number.tier-success { color: rgba(255, 255, 255, 0.8); }
.d20-recall-number.tier-complication { color: #ef4444; }

.d20-recall-text {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.45);
}

/* Responsive */
@media (max-width: 640px) {
    #d20-canvas-container {
        width: 220px;
        height: 220px;
    }

    .d20-result-number {
        font-size: 2.5rem;
    }

    .d20-title {
        font-size: 0.65rem;
    }
}
