/* ============================================
   NARRATIVE SLOTS™ - STORY-DRIVEN SLOT MACHINE
   ============================================ */

/* === STORY HEADER === */
.narrative-header {
    background: linear-gradient(135deg, 
        rgba(30, 41, 59, 0.95) 0%, 
        rgba(15, 23, 42, 0.98) 100%);
    border: 1px solid rgba(148, 117, 205, 0.3);
    position: relative;
    overflow: hidden;
}

.narrative-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        transparent, 
        var(--mud-palette-secondary), 
        transparent);
}

.story-title {
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
}

.story-ticker {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 8px;
}

.story-arc-title {
    color: var(--mud-palette-secondary);
    font-weight: 600;
}

.story-chapter {
    color: rgba(255, 255, 255, 0.8);
    font-style: italic;
}

.context-narrative {
    color: rgba(255, 255, 255, 0.6);
    border-left: 3px solid var(--mud-palette-secondary);
    padding-left: 12px;
}

/* === MAIN SLOT MACHINE === */
.narrative-slot-machine {
    background: linear-gradient(180deg,
        rgba(30, 41, 59, 0.95) 0%,
        rgba(15, 23, 42, 0.98) 100%);
    border: 2px solid rgba(148, 117, 205, 0.4);
    position: relative;
}

.narrative-slot-machine::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(ellipse at center top, 
        rgba(255, 215, 0, 0.1) 0%, 
        transparent 50%);
    pointer-events: none;
}

/* === NARRATIVE DISPLAY === */
.narrative-display {
    background: linear-gradient(90deg, 
        transparent, 
        rgba(148, 117, 205, 0.2), 
        transparent);
    padding: 16px 32px;
    border-radius: 8px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 600px;
}

.narrative-display.animate .narrative-text {
    animation: narrativePulse 1.5s ease-in-out infinite;
}

.narrative-text {
    color: var(--mud-palette-secondary);
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

@keyframes narrativePulse {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.02); }
}

/* === STORY REELS === */
.story-reels-container {
    background: linear-gradient(180deg,
        #0f1419 0%,
        #1a2332 50%,
        #0f1419 100%);
    border: 4px solid #3d4852;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 
        inset 0 4px 20px rgba(0, 0, 0, 0.8),
        0 10px 40px rgba(0, 0, 0, 0.5);
}

.story-reels {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.story-reel {
    width: 120px;
    height: 140px;
    background: linear-gradient(180deg,
        rgba(var(--symbol-color-rgb, 100, 100, 100), 0.1) 0%,
        rgba(0, 0, 0, 0.3) 50%,
        rgba(var(--symbol-color-rgb, 100, 100, 100), 0.1) 100%);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.story-reel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg,
        rgba(255,255,255,0.1) 0%,
        transparent 30%,
        transparent 70%,
        rgba(0,0,0,0.2) 100%);
    pointer-events: none;
}

.story-reel.spinning {
    animation: reelSpin 0.15s linear infinite;
}

.story-reel.spinning .story-symbol {
    filter: blur(2px);
}

.story-reel.winning {
    border-color: var(--mud-palette-secondary);
    box-shadow: 
        0 0 20px rgba(255, 215, 0, 0.5),
        0 0 40px rgba(255, 215, 0, 0.3),
        inset 0 0 20px rgba(255, 215, 0, 0.2);
    animation: winPulse 0.5s ease-in-out 3;
}

@keyframes reelSpin {
    0% { transform: translateY(-5px); }
    50% { transform: translateY(5px); }
    100% { transform: translateY(-5px); }
}

@keyframes winPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.story-symbol {
    width: 80px;
    height: 80px;
    transition: all 0.3s ease;
}

.story-symbol-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

.symbol-name {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    font-weight: 500;
}

/* === SYMBOL ANIMATIONS === */
.story-symbol-svg.wild {
    animation: wildGlow 2s ease-in-out infinite;
}

@keyframes wildGlow {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.5)) brightness(1); }
    50% { filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.8)) brightness(1.2); }
}

.wizard-star,
.magic-star {
    animation: starSparkle 2s ease-in-out infinite;
}

@keyframes starSparkle {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

.magic-sparkle {
    animation: sparkleFloat 3s ease-in-out infinite;
}

.magic-sparkle.s1 { animation-delay: 0s; }
.magic-sparkle.s2 { animation-delay: 0.5s; }
.magic-sparkle.s3 { animation-delay: 1s; }
.magic-sparkle.s4 { animation-delay: 1.5s; }

@keyframes sparkleFloat {
    0%, 100% { opacity: 0.5; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-3px); }
}

.dragon-flame {
    animation: flamePulse 0.5s ease-in-out infinite;
}

@keyframes flamePulse {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

/* === WIN CELEBRATION === */
.win-celebration {
    animation: celebrationEntry 0.5s ease-out;
}

.win-celebration.legendary {
    animation: legendaryWin 1s ease-in-out infinite;
}

.win-celebration.epic {
    animation: epicWin 0.8s ease-in-out infinite;
}

@keyframes celebrationEntry {
    from { opacity: 0; transform: scale(0.8) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes legendaryWin {
    0%, 100% { 
        transform: scale(1);
        filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8));
    }
    50% { 
        transform: scale(1.02);
        filter: drop-shadow(0 0 30px rgba(255, 215, 0, 1));
    }
}

@keyframes epicWin {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.01); }
}

.loss-message {
    opacity: 0.8;
}

/* === CHOICE MODAL === */
.choice-modal {
    background: linear-gradient(135deg,
        rgba(30, 41, 59, 0.98) 0%,
        rgba(15, 23, 42, 0.99) 100%);
    border: 2px solid var(--mud-palette-warning);
    animation: choiceAppear 0.5s ease-out;
}

.choice-modal::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg, 
        transparent, 
        rgba(255, 215, 0, 0.3), 
        transparent);
    border-radius: inherit;
    z-index: -1;
    animation: choiceGlow 2s ease-in-out infinite;
}

@keyframes choiceAppear {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes choiceGlow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.choice-title {
    color: var(--mud-palette-warning);
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.choice-button {
    min-width: 180px;
    min-height: 140px;
    transition: all 0.3s ease;
}

.choice-button:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* === ACHIEVEMENT POPUP === */
.achievement-popup {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    animation: achievementSlide 0.5s ease-out;
    max-width: 350px;
}

@keyframes achievementSlide {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.achievement-icon {
    font-size: 2rem;
}

.achievement-unlocked {
    background: linear-gradient(135deg, 
        rgba(255, 215, 0, 0.1), 
        rgba(255, 215, 0, 0.05));
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.achievement-locked {
    opacity: 0.6;
}

/* === SPIN BUTTON === */
.spin-button {
    background: linear-gradient(135deg, 
        var(--mud-palette-secondary) 0%, 
        #ff8c00 100%) !important;
    transition: all 0.3s ease;
}

.spin-button:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4);
}

.spin-button:disabled {
    opacity: 0.5;
}

/* === RESPONSIVE === */
@media (max-width: 600px) {
    .story-reels {
        gap: 8px;
    }
    
    .story-reel {
        width: 90px;
        height: 110px;
    }
    
    .story-symbol {
        width: 60px;
        height: 60px;
    }
    
    .choice-button {
        min-width: 140px;
        min-height: 120px;
    }
}
