/* ============================================
   GAME PREVIEW MODAL - Full Screen Card Preview
   Split layout with 16:9 image + info section
   Mobile-optimized with category themes
   ============================================ */

/* ============================================
   OVERLAY & MODAL CONTAINER
   ============================================ */
.game-preview-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: preview-fade-in 0.3s ease;
}

.game-preview-overlay.active {
    display: flex;
}

@keyframes preview-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============================================
   BASE MODAL STYLES
   ============================================ */
.game-preview-modal {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    max-height: 90dvh;
    border-radius: 24px;
    overflow: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    animation: preview-slide-up 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes preview-slide-up {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Close button */
.game-preview-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.game-preview-close:hover {
    transform: scale(1.1);
}

.game-preview-close:active {
    transform: scale(0.95);
}

/* ============================================
   IMAGE SECTION (Top)
   ============================================ */
.game-preview-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    flex-shrink: 0;
}

.game-preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Gradient overlay */
.game-preview-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    pointer-events: none;
}

/* Rarity badge */
.game-preview-rarity {
    position: absolute;
    top: 12px;
    left: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 5;
}

/* Live badge */
.game-preview-live {
    position: absolute;
    top: 12px;
    right: 60px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    background: #ef4444;
    color: #fff;
    z-index: 5;
}

.game-preview-live::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    animation: live-pulse 1.5s ease-in-out infinite;
}

@keyframes live-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

/* Locked overlay */
.game-preview-locked-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 6;
}

.game-preview-locked-icon {
    font-size: 3rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

/* ============================================
   CONTENT SECTION (Bottom)
   ============================================ */
.game-preview-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Game title */
.game-preview-title {
    font-family: 'Cinzel', serif;
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0;
}

/* Description */
.game-preview-desc {
    font-size: 0.85rem;
    line-height: 1.6;
    opacity: 0.85;
    margin: 0;
}

/* Stats grid */
.game-preview-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.game-preview-stat {
    text-align: center;
    padding: 12px 8px;
    border-radius: 12px;
}

.game-preview-stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    display: block;
}

.game-preview-stat-label {
    font-size: 0.65rem;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* Buttons container */
.game-preview-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

/* Play button */
.game-preview-play {
    width: 100%;
    padding: 16px;
    border-radius: 14px;
    border: none;
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.game-preview-play:hover {
    transform: translateY(-2px);
}

.game-preview-play:active {
    transform: scale(0.98);
}

.game-preview-play:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Secondary button (for locked games - go to shop) */
.game-preview-secondary {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.game-preview-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

/* ============================================
   THEME: SLOTS - NEON VEGAS
   ============================================ */
.game-preview-modal.theme-slots {
    background: linear-gradient(180deg, #1a0a2e 0%, #0d0515 100%);
    border: 2px solid #ff2d95;
    box-shadow:
        0 0 40px rgba(255, 45, 149, 0.3),
        0 0 80px rgba(0, 212, 255, 0.15);
}

/* Animated neon border glow */
.theme-slots::before {
    content: '';
    position: absolute;
    inset: -3px;
    background: linear-gradient(45deg, #ff2d95, #00d4ff, #ffd700, #ff2d95);
    background-size: 400% 400%;
    border-radius: 26px;
    z-index: -1;
    animation: neon-rotate 4s linear infinite;
    filter: blur(10px);
    opacity: 0.6;
}

@keyframes neon-rotate {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.theme-slots .game-preview-image::after {
    background: linear-gradient(to top, #0d0515 0%, transparent 100%);
}

.theme-slots .game-preview-close {
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
}

.theme-slots .game-preview-rarity {
    background: linear-gradient(135deg, #ff2d95, #ff6b35);
    color: #fff;
    box-shadow: 0 0 20px rgba(255, 45, 149, 0.6);
}

.theme-slots .game-preview-title {
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 45, 149, 0.5);
}

.theme-slots .game-preview-desc {
    color: #d0c0e0;
}

.theme-slots .game-preview-stat {
    background: rgba(255, 45, 149, 0.15);
    border: 1px solid rgba(255, 45, 149, 0.3);
}

.theme-slots .game-preview-stat-value {
    color: #00d4ff;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.theme-slots .game-preview-stat-label {
    color: #a090b0;
}

.theme-slots .game-preview-play {
    background: linear-gradient(135deg, #ff2d95, #ff6b35);
    color: #fff;
    box-shadow: 0 4px 20px rgba(255, 45, 149, 0.5);
}

.theme-slots .game-preview-play:hover {
    box-shadow: 0 6px 30px rgba(255, 45, 149, 0.7);
}

/* ============================================
   THEME: CASINO - GREEN FELT
   ============================================ */
.game-preview-modal.theme-casino {
    background:
        radial-gradient(circle at 20% 20%, rgba(255,255,255,0.02) 1px, transparent 1px),
        radial-gradient(circle at 80% 80%, rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(180deg, #1a472a 0%, #0f2818 100%);
    background-size: 8px 8px, 12px 12px, 100% 100%;
    border: 3px solid #d4af37;
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.25);
}

/* Gold corner accents */
.theme-casino .game-preview-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50px;
    height: 50px;
    border-top: 4px solid #d4af37;
    border-left: 4px solid #d4af37;
    z-index: 5;
}

.theme-casino .game-preview-content {
    position: relative;
}

.theme-casino .game-preview-content::after {
    content: '';
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-bottom: 4px solid #d4af37;
    border-right: 4px solid #d4af37;
    pointer-events: none;
}

.theme-casino .game-preview-image::after {
    background: linear-gradient(to top, #0f2818 0%, transparent 100%);
}

.theme-casino .game-preview-close {
    background: rgba(212, 175, 55, 0.2);
    color: #d4af37;
    border: 2px solid #d4af37;
}

.theme-casino .game-preview-rarity {
    background: linear-gradient(135deg, #d4af37, #b8960c);
    color: #0f2818;
    font-weight: 800;
}

.theme-casino .game-preview-title {
    color: #d4af37;
    text-shadow: 0 2px 10px rgba(212, 175, 55, 0.3);
}

.theme-casino .game-preview-desc {
    color: #b8d4c0;
}

.theme-casino .game-preview-stat {
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.theme-casino .game-preview-stat-value {
    color: #d4af37;
}

.theme-casino .game-preview-stat-label {
    color: #7a9a84;
}

.theme-casino .game-preview-play {
    background: linear-gradient(135deg, #d4af37, #b8960c);
    color: #0f2818;
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.4);
}

.theme-casino .game-preview-play:hover {
    box-shadow: 0 6px 30px rgba(212, 175, 55, 0.6);
}

/* ============================================
   THEME: ARCADE - RETRO CRT
   ============================================ */
.game-preview-modal.theme-arcade {
    background: linear-gradient(180deg, #0a1628 0%, #050d1a 100%);
    border: 3px solid #00ffff;
    box-shadow:
        0 0 30px rgba(0, 255, 255, 0.3),
        0 0 60px rgba(255, 0, 255, 0.1);
}

/* Scanlines overlay */
.theme-arcade::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 255, 0.02) 2px,
        rgba(0, 255, 255, 0.02) 4px
    );
    pointer-events: none;
    z-index: 4;
    border-radius: 24px;
}

/* Pixel dashed border inside */
.theme-arcade::before {
    content: '';
    position: absolute;
    inset: 8px;
    border: 2px dashed rgba(0, 255, 255, 0.3);
    border-radius: 16px;
    z-index: 3;
    pointer-events: none;
}

.theme-arcade .game-preview-image::after {
    background: linear-gradient(to top, #050d1a 0%, transparent 100%);
}

.theme-arcade .game-preview-close {
    background: rgba(0, 255, 255, 0.15);
    color: #00ffff;
    border: 2px solid #00ffff;
    font-family: 'Courier New', monospace;
}

.theme-arcade .game-preview-rarity {
    background: #ff00ff;
    color: #fff;
    font-family: 'Courier New', monospace;
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.6);
}

.theme-arcade .game-preview-title {
    color: #00ffff;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 1.4rem;
    text-shadow:
        2px 2px 0 #ff00ff,
        0 0 20px rgba(0, 255, 255, 0.6);
}

.theme-arcade .game-preview-desc {
    color: #80b0b0;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
}

.theme-arcade .game-preview-stat {
    background: rgba(0, 255, 255, 0.1);
    border: 2px solid rgba(0, 255, 255, 0.3);
}

.theme-arcade .game-preview-stat-value {
    color: #ffff00;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 8px rgba(255, 255, 0, 0.5);
}

.theme-arcade .game-preview-stat-label {
    color: #00ffff;
    font-family: 'Courier New', monospace;
    font-size: 0.6rem;
}

.theme-arcade .game-preview-play {
    background: linear-gradient(135deg, #00ffff, #0088aa);
    color: #050d1a;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 4px 20px rgba(0, 255, 255, 0.5);
}

.theme-arcade .game-preview-play:hover {
    box-shadow: 0 6px 30px rgba(0, 255, 255, 0.7);
}

/* ============================================
   THEME: SPECIAL - GOLDEN MYSTICAL
   ============================================ */
.game-preview-modal.theme-special {
    background: linear-gradient(180deg, #1a0a30 0%, #0a0515 100%);
    border: 3px solid #ffd700;
    box-shadow:
        0 0 30px rgba(255, 215, 0, 0.3),
        0 0 60px rgba(107, 33, 168, 0.2);
}

/* Purple corner accents */
.theme-special .game-preview-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 45px;
    height: 45px;
    border-top: 4px solid #6b21a8;
    border-left: 4px solid #6b21a8;
    z-index: 5;
}

.theme-special .game-preview-content {
    position: relative;
}

.theme-special .game-preview-content::after {
    content: '';
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    border-bottom: 4px solid #6b21a8;
    border-right: 4px solid #6b21a8;
    pointer-events: none;
}

.theme-special .game-preview-image::after {
    background: linear-gradient(to top, #0a0515 0%, transparent 100%);
}

.theme-special .game-preview-close {
    background: rgba(255, 215, 0, 0.15);
    color: #ffd700;
    border: 2px solid #ffd700;
}

.theme-special .game-preview-rarity {
    background: linear-gradient(135deg, #ffd700, #ff66ff);
    color: #1a0a30;
    font-weight: 800;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.theme-special .game-preview-title {
    color: #ffd700;
    text-shadow: 0 2px 10px rgba(255, 215, 0, 0.4);
}

.theme-special .game-preview-desc {
    color: #c8b0e0;
}

.theme-special .game-preview-stat {
    background: rgba(107, 33, 168, 0.2);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.theme-special .game-preview-stat-value {
    color: #00ffcc;
    text-shadow: 0 0 8px rgba(0, 255, 204, 0.4);
}

.theme-special .game-preview-stat-label {
    color: #a090c0;
}

.theme-special .game-preview-play {
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    color: #1a0a30;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
}

.theme-special .game-preview-play:hover {
    box-shadow: 0 6px 30px rgba(255, 215, 0, 0.6);
}

/* ============================================
   MOBILE OPTIMIZATIONS
   ============================================ */
@media (max-width: 480px) {
    .game-preview-overlay {
        padding: 0;
        align-items: stretch;
    }

    .game-preview-modal {
        max-width: 100%;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        max-height: 100vh;
        max-height: 100dvh;
        border-radius: 0;
        display: flex;
        flex-direction: column;
    }

    .game-preview-image {
        aspect-ratio: auto;
        height: 35%;
        flex-shrink: 0;
    }

    .game-preview-content {
        padding: 16px;
        gap: 12px;
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    .game-preview-title {
        font-size: 1.3rem;
    }

    .game-preview-desc {
        font-size: 0.8rem;
        line-height: 1.4;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .game-preview-stats {
        gap: 8px;
    }

    .game-preview-stat {
        padding: 10px 6px;
    }

    .game-preview-stat-value {
        font-size: 1rem;
    }

    .game-preview-stat-label {
        font-size: 0.6rem;
    }

    .game-preview-buttons {
        gap: 8px;
        margin-top: auto;
    }

    .game-preview-play {
        padding: 14px;
        font-size: 1rem;
        border-radius: 12px;
    }

    .game-preview-secondary {
        padding: 12px;
        font-size: 0.85rem;
        border-radius: 10px;
    }

    .game-preview-close {
        width: 36px;
        height: 36px;
        top: 10px;
        right: 10px;
        font-size: 16px;
    }

    .game-preview-rarity {
        padding: 5px 12px;
        font-size: 0.65rem;
        top: 10px;
        left: 10px;
    }

    .game-preview-live {
        padding: 5px 10px;
        font-size: 0.6rem;
        top: 10px;
        right: 52px;
    }

    /* Disable neon animation on mobile for performance */
    .theme-slots::before {
        animation: none;
        background-position: 0% 50%;
    }
}

/* ============================================
   REDUCED MOTION SUPPORT
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .game-preview-overlay {
        animation: none;
    }

    .game-preview-modal {
        animation: none;
    }

    .theme-slots::before {
        animation: none;
    }

    .game-preview-live::before {
        animation: none;
    }
}

/* ============================================
   TOUCH OPTIMIZATIONS
   ============================================ */
@media (pointer: coarse) {
    .game-preview-close {
        width: 44px;
        height: 44px;
    }

    .game-preview-play {
        min-height: 52px;
    }
}
