/* ===========================================================================
   PREMIUM BATCH SPIN RESULTS MODAL - Enhanced Styling
   Matches the quality and polish of the "Select Amount" box
   Features: Modern gradients, depth shadows, premium card styling
   =========================================================================== */

/* MODAL OVERLAY & CONTAINER */
.batch-results-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(12px);
    z-index: 15000; /* Higher than wheel immersive mode (typically 10000-12000) */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.batch-results-modal {
    background: linear-gradient(145deg, rgba(15, 35, 15, 0.95), rgba(8, 20, 8, 0.98));
    border: 2px solid rgba(57, 255, 20, 0.4);
    border-radius: 20px;
    max-width: 800px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.7),
        0 0 80px rgba(57, 255, 20, 0.15),
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
    position: relative;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(40px) scale(0.96);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* HEADER SECTION */
.batch-header {
    padding: 24px 28px;
    border-bottom: 1px solid rgba(57, 255, 20, 0.25);
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: linear-gradient(180deg, rgba(57, 255, 20, 0.05) 0%, transparent 100%);
}

.batch-header h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.8rem;
    color: var(--wryon-green);
    margin: 0;
    text-shadow: 0 0 20px rgba(57, 255, 20, 0.5);
    letter-spacing: 1px;
}

.modal-close-x {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #999 !important;
    font-size: 1.5rem !important;
    cursor: pointer !important;
    padding: 8px 14px !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
    line-height: 1 !important;
}

.modal-close-x:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    transform: scale(1.1);
}

/* SUMMARY STATS */
.batch-summary-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.stat-tag {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid;
    transition: transform 0.2s ease;
}

.stat-tag:hover {
    transform: translateY(-2px);
}

.stat-tag.wn { 
    background: linear-gradient(135deg, rgba(57, 255, 20, 0.25), rgba(44, 184, 16, 0.35));
    color: #88ff88;
    border-color: rgba(57, 255, 20, 0.4);
    text-shadow: 0 0 10px rgba(57, 255, 20, 0.5);
}

.stat-tag.raffle { 
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.25), rgba(184, 134, 11, 0.35));
    color: #ffd666;
    border-color: rgba(212, 175, 55, 0.4);
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.stat-tag.prize { 
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.25), rgba(220, 53, 69, 0.35));
    color: #ff9999;
    border-color: rgba(255, 107, 107, 0.4);
    text-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

/* CARD GRID */
.batch-grid {
    padding: 24px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 16px;
    overflow-y: auto;
    flex: 1;
}

/* Custom scrollbar for grid */
.batch-grid::-webkit-scrollbar {
    width: 8px;
}

.batch-grid::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.batch-grid::-webkit-scrollbar-thumb {
    background: rgba(57, 255, 20, 0.3);
    border-radius: 10px;
}

.batch-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(57, 255, 20, 0.5);
}

/* RESULT CARDS - PREMIUM STYLING */
.result-card {
    aspect-ratio: 3/4;
    perspective: 1000px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.result-card:hover {
    transform: translateY(-4px);
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-style: preserve-3d;
}

.result-card.revealed .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* Start from top instead of center */
    padding: 10px 6px 6px 6px; /* Tighter side padding, more space at top */
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.4),
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
    overflow: visible;
}

/* Prize cards need even more compact layout */
.result-card.revealed.prize .card-back {
    padding: 8px 4px 4px 4px;
    justify-content: space-between; /* Spread content to push button to bottom */
}

/* CARD FRONT (Mystery Card) */
.card-front {
    background: linear-gradient(145deg, rgba(0, 60, 0, 0.85), rgba(0, 35, 0, 0.95));
    border: 2px solid rgba(57, 255, 20, 0.4);
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(57, 255, 20, 0.2),
        inset 0 1px 1px rgba(57, 255, 20, 0.2);
}

.mystery-icon {
    font-size: 2.5rem;
    color: rgba(57, 255, 20, 0.7);
    text-shadow: 0 0 20px rgba(57, 255, 20, 0.6);
    animation: mysteryPulse 2s ease-in-out infinite;
}

@keyframes mysteryPulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 0.7;
    }
    50% { 
        transform: scale(1.1);
        opacity: 1;
    }
}

/* CARD BACKS - PRIZE-SPECIFIC STYLING */
.card-back {
    transform: rotateY(180deg);
    border: 2px solid;
    position: relative;
    overflow: hidden;
}

/* Subtle animated shine effect for revealed cards */
.card-back::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.1) 50%,
        transparent
    );
    animation: shine 3s ease-in-out infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%); }
    100% { transform: translateX(100%) translateY(100%); }
}

/* WN Tokens - Green Gradient */
.result-card.revealed.wn .card-back { 
    background: linear-gradient(145deg, rgba(57, 255, 20, 0.25), rgba(44, 184, 16, 0.35));
    border-color: var(--wryon-green);
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(57, 255, 20, 0.4),
        inset 0 0 40px rgba(57, 255, 20, 0.1);
}

/* Raffle Tickets - Gold Gradient */
.result-card.revealed.raffle .card-back { 
    background: linear-gradient(145deg, rgba(212, 175, 55, 0.25), rgba(184, 134, 11, 0.35));
    border-color: var(--greek-gold);
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(212, 175, 55, 0.3),
        inset 0 0 40px rgba(212, 175, 55, 0.1);
}

/* Instant Prize - Red/Pink Gradient */
.result-card.revealed.prize .card-back { 
    background: linear-gradient(145deg, rgba(255, 107, 107, 0.25), rgba(220, 53, 69, 0.35));
    border-color: #ff6b6b;
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(255, 107, 107, 0.3),
        inset 0 0 40px rgba(255, 107, 107, 0.1);
}

/* Jackpot - Epic Gold Gradient */
.result-card.revealed.jackpot .card-back { 
    background: linear-gradient(145deg, rgba(255, 215, 0, 0.4), rgba(218, 165, 32, 0.5));
    border-color: #ffd700;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.6),
        0 0 60px rgba(255, 215, 0, 0.6),
        inset 0 0 60px rgba(255, 215, 0, 0.2);
    animation: jackpotGlow 1.5s ease-in-out infinite;
}

@keyframes jackpotGlow {
    0%, 100% { 
        box-shadow: 
            0 8px 32px rgba(0, 0, 0, 0.6),
            0 0 60px rgba(255, 215, 0, 0.6),
            inset 0 0 60px rgba(255, 215, 0, 0.2);
    }
    50% { 
        box-shadow: 
            0 8px 32px rgba(0, 0, 0, 0.6),
            0 0 80px rgba(255, 215, 0, 0.8),
            inset 0 0 80px rgba(255, 215, 0, 0.3);
    }
}

/* Loss - Gray/Subdued */
.result-card.revealed.loss .card-back { 
    background: linear-gradient(145deg, rgba(60, 60, 60, 0.2), rgba(40, 40, 40, 0.3));
    border-color: #666;
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.5),
        inset 0 0 20px rgba(0, 0, 0, 0.3);
}

/* Free Spin - Blue/Electric Gradient */
.result-card.revealed.free .card-back { 
    background: linear-gradient(145deg, rgba(50, 50, 200, 0.3), rgba(30, 144, 255, 0.4));
    border-color: #aaf;
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(30, 144, 255, 0.3),
        inset 0 0 40px rgba(30, 144, 255, 0.1);
}

/* CARD CONTENT */
.result-icon { 
    font-size: 2rem; 
    margin-bottom: 6px;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
    animation: iconBounce 0.5s ease;
}

/* Hide icon for instant prizes to save space - the text is descriptive enough */
.result-card.revealed.prize .result-icon {
    display: none;
}

@keyframes iconBounce {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.result-label { 
    font-size: 0.75rem; 
    color: #fff; 
    line-height: 1.3;
    font-weight: 600;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
    margin-bottom: 4px;
}

/* Larger text for instant prizes since we removed the icon */
.result-card.revealed.prize .result-label {
    font-size: 0.7rem;
    line-height: 1.2;
    margin-bottom: 3px;
    margin-top: 8px; /* Add top margin to replace icon space */
}

/* CLAIM BUTTONS - ENHANCED VISIBILITY */
.mini-claim-btn {
    margin-top: 4px;
    padding: 6px 12px;
    font-size: 0.65rem;
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    color: white;
    cursor: pointer;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    transition: all 0.2s ease;
    box-shadow: 
        0 4px 12px rgba(255, 107, 107, 0.6),
        0 0 20px rgba(255, 107, 107, 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    z-index: 10;
    position: relative;
    white-space: nowrap;
}

.mini-claim-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 
        0 6px 20px rgba(255, 107, 107, 0.8),
        0 0 30px rgba(255, 107, 107, 0.6);
    background: linear-gradient(135deg, #ff7b7b, #ff6a6f);
    border-color: rgba(255, 255, 255, 0.7);
}

.mini-claim-btn:active {
    transform: translateY(0) scale(1.02);
}

.claimed-badge {
    margin-top: 4px;
    font-size: 0.65rem;
    color: #88ff88;
    font-weight: 800;
    text-shadow: 0 0 10px rgba(57, 255, 20, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    background: rgba(57, 255, 20, 0.2);
    padding: 4px 8px;
    border-radius: 10px;
    border: 1px solid rgba(57, 255, 20, 0.4);
}

/* FOOTER SECTION */
.batch-footer {
    padding: 20px 24px;
    border-top: 1px solid rgba(57, 255, 20, 0.25);
    display: flex;
    justify-content: center;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.2) 0%, transparent 100%);
}

.reveal-all-btn, .close-batch-btn {
    padding: 12px 32px;
    border-radius: 24px;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.95rem;
    border: 2px solid;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.reveal-all-btn {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.reveal-all-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.reveal-all-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.close-batch-btn {
    background: linear-gradient(135deg, var(--wryon-green), var(--wryon-green-dim));
    color: #000;
    border-color: var(--wryon-green);
    box-shadow: 
        0 4px 16px rgba(57, 255, 20, 0.4),
        0 0 40px rgba(57, 255, 20, 0.2);
    font-weight: 800;
}

.close-batch-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 8px 24px rgba(57, 255, 20, 0.5),
        0 0 60px rgba(57, 255, 20, 0.4);
}

.close-batch-btn:active {
    transform: translateY(-1px) scale(1.02);
}

/* WARNING OVERLAY */
.warning-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    animation: fadeIn 0.2s;
    z-index: 10;
}

.warning-box {
    background: linear-gradient(145deg, rgba(40, 0, 0, 0.95), rgba(20, 0, 0, 0.98));
    border: 2px solid #ff4444;
    padding: 28px;
    border-radius: 16px;
    text-align: center;
    max-width: 85%;
    box-shadow: 
        0 20px 60px rgba(255, 68, 68, 0.3),
        0 0 80px rgba(255, 68, 68, 0.2);
}

.warning-box h3 { 
    color: #ff6666; 
    margin: 0 0 12px 0;
    font-size: 1.3rem;
    text-shadow: 0 0 20px rgba(255, 68, 68, 0.6);
}

.warning-box p {
    color: #ddd;
    line-height: 1.6;
    margin-bottom: 20px;
}

.warning-actions { 
    display: flex; 
    gap: 12px; 
    justify-content: center;
}

.warn-btn {
    padding: 10px 24px;
    border-radius: 12px;
    cursor: pointer;
    border: 2px solid;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.warn-btn.back { 
    background: linear-gradient(135deg, rgba(70, 70, 70, 0.8), rgba(50, 50, 50, 0.9));
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

.warn-btn.back:hover {
    background: linear-gradient(135deg, rgba(90, 90, 90, 0.9), rgba(70, 70, 70, 1));
    transform: translateY(-2px);
}

.warn-btn.confirm { 
    background: linear-gradient(135deg, #ff4444, #cc0000);
    color: white;
    border-color: #ff6666;
    box-shadow: 0 4px 16px rgba(255, 68, 68, 0.4);
}

.warn-btn.confirm:hover {
    background: linear-gradient(135deg, #ff5555, #dd0000);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 68, 68, 0.6);
}

/* MOBILE RESPONSIVE */
@media (max-width: 768px) {
    .batch-results-modal {
        max-height: 90vh;
        border-radius: 16px;
    }
    
    .batch-header {
        padding: 20px;
    }
    
    .batch-header h2 {
        font-size: 1.4rem;
    }
    
    .batch-grid {
        padding: 16px;
        grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
        gap: 12px;
    }
    
    .result-icon {
        font-size: 1.4rem;
        margin-bottom: 4px;
    }
    
    .result-label {
        font-size: 0.65rem;
        line-height: 1.2;
        margin-bottom: 2px;
    }
    
    .result-card.revealed.prize .result-label {
        font-size: 0.62rem;
        line-height: 1.15;
        margin-top: 6px;
    }
    
    .mini-claim-btn {
        font-size: 0.6rem;
        padding: 5px 10px;
        margin-top: 2px;
        letter-spacing: 0.2px;
    }
    
    .batch-footer {
        padding: 16px;
    }
    
    .reveal-all-btn, .close-batch-btn {
        padding: 10px 24px;
        font-size: 0.85rem;
    }
    
    .warning-box {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .batch-grid {
        grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
        gap: 10px;
    }
    
    .stat-tag {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .result-icon {
        font-size: 1.2rem;
        margin-bottom: 3px;
    }
    
    .result-label {
        font-size: 0.6rem;
        line-height: 1.1;
    }
    
    .result-card.revealed.prize .result-label {
        font-size: 0.58rem;
        margin-top: 5px;
    }
    
    .mini-claim-btn {
        font-size: 0.55rem;
        padding: 4px 8px;
        margin-top: 2px;
    }
}