/* Reset & Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #FF6B35;
    --secondary: #004E89;
    --accent: #FFD23F;
    --glow: #00ff88;
    --dark: #0a0a1a;
    --font-family: 'Poppins', sans-serif;
}

body {
    font-family: var(--font-family);
    background: var(--dark);
    overflow: hidden;
    height: 100vh;
    position: relative;
}

/* Admin Button */
.admin-btn {
    position: fixed;
    top: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    background: rgba(0, 255, 136, 0.2);
    border: 2px solid var(--glow);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    cursor: pointer;
    z-index: 9999;
    transition: all 0.3s;
    text-decoration: none;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

.admin-btn:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 0 40px rgba(0, 255, 136, 0.6);
    background: rgba(0, 255, 136, 0.4);
}

/* Background Canvas */
#bgCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* Scan Lines */
.scan-lines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 136, 0.03) 2px,
        rgba(0, 255, 136, 0.03) 4px
    );
    pointer-events: none;
    z-index: 9998;
    animation: scanMove 8s linear infinite;
}

@keyframes scanMove {
    0% { transform: translateY(0); }
    100% { transform: translateY(40px); }
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.5s;
}

.loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 80px;
    height: 80px;
    border: 4px solid rgba(0, 255, 136, 0.2);
    border-top-color: var(--glow);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 2rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--glow);
    margin-bottom: 2rem;
    letter-spacing: 3px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading-bar {
    width: 300px;
    height: 6px;
    background: rgba(0, 255, 136, 0.2);
    border-radius: 3px;
    overflow: hidden;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--glow), var(--accent));
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s;
}

/* Container */
.container {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

/* Cyber Title */
.cyber-title {
    font-size: 4rem;
    font-weight: 900;
    font-family: 'Orbitron', sans-serif;
    text-align: center;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, var(--glow), var(--accent), var(--primary));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s ease infinite;
    letter-spacing: 4px;
    filter: drop-shadow(0 0 30px rgba(0, 255, 136, 0.5));
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.cyber-subtitle {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--glow);
    text-align: center;
    margin-bottom: 4rem;
    letter-spacing: 5px;
    text-transform: uppercase;
    animation: pulse 2s ease-in-out infinite;
}

/* 3D Games Grid */
.games-grid-3d {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    max-width: 1000px;
}

.game-card-3d {
    position: relative;
    width: 220px;
    height: 220px;
    background: rgba(10, 10, 26, 0.8);
    border: 2px solid var(--glow);
    border-radius: 20px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-card-3d.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(1);
}

.game-card-3d:before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        transparent, 
        var(--glow), 
        transparent 30%
    );
    animation: rotate 4s linear infinite;
}

@keyframes rotate {
    100% { transform: rotate(360deg); }
}

.game-card-3d:after {
    content: '';
    position: absolute;
    inset: 3px;
    background: rgba(10, 10, 26, 0.95);
    border-radius: 18px;
    z-index: 1;
}

.card-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.game-icon-3d {
    font-size: 4.5rem;
    margin-bottom: 0.8rem;
    filter: drop-shadow(0 0 20px currentColor);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.game-card-3d h3 {
    color: white;
    font-weight: 800;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    letter-spacing: 2px;
}

.game-card-3d p {
    color: var(--glow);
    font-size: 0.85rem;
    font-weight: 600;
}

.game-card-3d:not(.disabled):hover {
    transform: scale(1.1) translateY(-10px);
    box-shadow: 0 20px 60px rgba(0, 255, 136, 0.6);
}

/* 3D Modal */
.modal-3d {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    perspective: 1000px;
}

.modal-3d.active {
    display: block;
}

.modal-overlay-3d {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content-3d {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;
    max-width: 900px;
    height: 85vh;
    background: rgba(10, 10, 26, 0.98);
    border: 3px solid var(--glow);
    border-radius: 30px;
    box-shadow: 0 0 100px rgba(0, 255, 136, 0.5);
    padding: 2rem;
    animation: modalEntrance 0.6s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    display: flex;
    flex-direction: column;
}

@keyframes modalEntrance {
    0% { 
        transform: translate(-50%, -50%) scale(0) rotateY(180deg);
        opacity: 0;
    }
    100% { 
        transform: translate(-50%, -50%) scale(1) rotateY(0);
        opacity: 1;
    }
}

.close-btn-3d {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 50px;
    height: 50px;
    background: rgba(255, 0, 0, 0.2);
    border: 2px solid #ff0044;
    border-radius: 50%;
    color: #ff0044;
    font-size: 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 100;
    font-weight: 700;
}

.close-btn-3d:hover {
    background: rgba(255, 0, 0, 0.5);
    transform: rotate(90deg) scale(1.2);
}

/* Email Form */
.email-form {
    text-align: center;
    padding: 2rem;
}

/* Game Stage (wraps whichever 2D game is active) */
.game-stage {
    flex: 1;
    border-radius: 20px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--glow);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-hint {
    color: var(--glow);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 1px;
    margin-top: 1.2rem;
    text-align: center;
    opacity: 0.85;
}

/* ===== Wheel ===== */
.wheel-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.wheel-spin-area {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wheel-pointer {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2.2rem;
    color: var(--glow);
    filter: drop-shadow(0 0 10px var(--glow));
    z-index: 3;
}

.wheel-canvas {
    display: block;
    border-radius: 50%;
    box-shadow: 0 0 50px rgba(0, 255, 136, 0.4);
}

.wheel-hub {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border: 4px solid white;
    color: white;
    font-weight: 900;
    font-size: 1.1rem;
    letter-spacing: 1px;
    cursor: pointer;
    z-index: 2;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.4);
    transition: transform 0.15s;
}

.wheel-hub:hover:not(:disabled) {
    transform: translate(-50%, -50%) scale(1.08);
}

.wheel-hub:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* ===== Mystery Box ===== */
.mysterybox-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.mysterybox-visual {
    font-size: 10rem;
    line-height: 1;
    cursor: pointer;
    filter: drop-shadow(0 0 30px rgba(255, 210, 63, 0.6));
    animation: boxFloat 2.4s ease-in-out infinite;
    user-select: none;
}

@keyframes boxFloat {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    50% { transform: translateY(-14px) rotate(3deg); }
}

.mysterybox-visual.shaking {
    animation: boxShake 0.12s ease-in-out infinite;
}

@keyframes boxShake {
    0%, 100% { transform: rotate(-6deg); }
    50% { transform: rotate(6deg); }
}

.mysterybox-visual.bursting {
    animation: boxBurst 0.5s ease-out forwards;
}

@keyframes boxBurst {
    0% { transform: scale(1); opacity: 1; }
    60% { transform: scale(1.4); opacity: 1; }
    100% { transform: scale(0); opacity: 0; }
}

/* ===== Scratch Card ===== */
.scratch-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.scratch-card {
    position: relative;
    width: min(420px, 80vw);
    height: min(260px, 45vh);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(0, 255, 136, 0.3);
}

.scratch-reward-layer {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    text-align: center;
    padding: 1rem;
}

.scratch-reward-emoji {
    font-size: 3rem;
    margin-bottom: 0.4rem;
}

.scratch-reward-amount {
    font-size: 2.2rem;
    font-weight: 900;
    color: white;
    font-family: 'Orbitron', sans-serif;
}

.scratch-reward-label {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 700;
    margin-top: 0.3rem;
}

.scratch-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    cursor: grab;
    touch-action: none;
}

/* ===== Shared burst particles (mystery box / wheel / scratch reveal) ===== */
.burst-particle {
    position: fixed;
    font-size: 1.8rem;
    pointer-events: none;
    z-index: 10002;
    transform: translate(-50%, -50%);
}

/* Prize Display 3D */
.prize-display-3d {
    text-align: center;
    display: none;
}

.prize-display-3d.show {
    display: block;
    animation: explosionEntrance 0.8s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

@keyframes explosionEntrance {
    0% { 
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    60% {
        transform: scale(1.3) rotate(20deg);
    }
    100% { 
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

.prize-emoji-3d {
    font-size: 5rem;
    margin-bottom: 1rem;
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.prize-amount-3d {
    font-size: 4rem;
    font-weight: 900;
    font-family: 'Orbitron', sans-serif;
    background: linear-gradient(45deg, #ff0080, #ff8c00, #40e0d0, #ff0080);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: rainbowShift 2s ease infinite;
    filter: drop-shadow(0 0 30px rgba(255, 0, 128, 0.8));
    margin-bottom: 0.5rem;
}

@keyframes rainbowShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.prize-label-3d {
    font-size: 1.5rem;
    color: var(--glow);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 2rem;
    animation: glowPulse 1s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { 
        text-shadow: 0 0 20px var(--glow), 0 0 40px var(--glow);
    }
    50% { 
        text-shadow: 0 0 40px var(--glow), 0 0 80px var(--glow);
    }
}

.claim-btn-3d {
    padding: 1.5rem 4rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border: 3px solid var(--glow);
    border-radius: 50px;
    color: white;
    font-size: 1.5rem;
    font-weight: 900;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s;
    box-shadow: 0 0 40px rgba(0, 255, 136, 0.5);
    position: relative;
    overflow: hidden;
}

.claim-btn-3d:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.claim-btn-3d:hover:before {
    width: 400px;
    height: 400px;
}

.claim-btn-3d:hover {
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0 20px 60px rgba(0, 255, 136, 0.8);
}

.claim-btn-3d span {
    position: relative;
    z-index: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .cyber-title {
        font-size: 2.5rem;
    }

    .games-grid-3d {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .game-card-3d {
        width: 100%;
        max-width: 300px;
        height: 180px;
        margin: 0 auto;
    }

    .modal-content-3d {
        width: 95vw;
        height: 90vh;
        padding: 1.5rem;
    }

    .prize-amount-3d {
        font-size: 3rem;
    }

    .prize-emoji-3d {
        font-size: 4rem;
    }

    .admin-btn {
        top: 1rem;
        right: 1rem;
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
}
