@font-face {
    font-family: 'ZPix';
    src: url('assets/cute_pixel.ttf');
}

:root {
    --binance-yellow: #FCD535;
    --dark-charcoal: #1E2329;
    --card-bg: #2B3139;
    --border-dark: #450A2A;
    --text-main: #EAECEF;
    --pixel-size: 4px;
}

* {
    box-sizing: border-box;
    image-rendering: pixelated;
}

body {
    margin: 0;
    padding: 0;
    background-color: #0c0d10;
    color: var(--text-main);
    font-family: 'ZPix', 'Press Start 2P', cursive;
    overflow-x: hidden;
}

/* Scanlines & Background */
.crs-scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999;
    background: linear-gradient(to bottom,
            rgba(255, 255, 255, 0),
            rgba(255, 255, 255, 0) 50%,
            rgba(0, 0, 0, 0.2) 50%,
            rgba(0, 0, 0, 0.2));
    background-size: 100% 4px;
    pointer-events: none;
    opacity: 0.6;
}

.pixel-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #0c0d10;
    background-image: url('assets/pixel_fu_pattern.png');
    background-size: 100px 100px;
    background-repeat: repeat;
    opacity: 0.15;
    z-index: -1;
    /* Optional: Add a subtle drift animation */
    animation: bg-drift 60s linear infinite;
}

/* Pixel Noise Decoration (Top/Bottom) */
body::before,
body::after {
    content: "";
    position: fixed;
    left: 0;
    width: 100%;
    height: 40px;
    background-image: url('assets/pixel_fu_pattern.png');
    background-size: 40px 40px;
    opacity: 0.8;
    z-index: 10;
    pointer-events: none;
    mask-image: linear-gradient(to bottom, black, transparent);
    -webkit-mask-image: linear-gradient(to bottom, black, transparent);
}

body::before {
    top: 0;
}

body::after {
    bottom: 0;
    transform: scaleY(-1);
}

@keyframes bg-drift {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 100px 100px;
    }
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px;
}

/* Header */
.pixel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: var(--pixel-size) solid var(--binance-yellow);
    padding-bottom: 15px;
    margin-bottom: 40px;
}

.logo-container {
    display: flex;
    align-items: center;
}

.brand-logo {
    width: 64px;
    height: 64px;
}

.brand-text {
    margin-left: 15px;
}

.brand-name {
    font-size: 2rem;
    color: var(--binance-yellow);
    display: block;
}

.sub-brand {
    font-size: 0.8rem;
    letter-spacing: 2px;
}

.header-status {
    font-size: 0.7rem;
    color: #848E9C;
}

.blink {
    width: 8px;
    height: 8px;
    background: #0ECB81;
    display: inline-block;
    border-radius: 50%;
    margin-right: 5px;
    animation: blink 1s infinite;
}

/* Main Stage */
.creator-core {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 40px;
}

/* Main Stage - Canvas Container */
.card-preview-area {
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1200px;
}

.card-stage {
    position: relative;
    padding: 0;
    line-height: 0;
    box-shadow: 20px 20px 60px rgba(0, 0, 0, 0.8);
    border: 1px solid #333;
    animation: floating 4s ease-in-out infinite;
    transform-style: preserve-3d;
}

/* Tabs System */
.tabs-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
}

.tab-btn {
    background: #1E2329;
    color: #848E9C;
    border: 1px solid #474D57;
    padding: 8px 12px;
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    background: #F0B90B;
    color: #000;
    border-color: #F0B90B;
    box-shadow: 4px 4px 0 #000;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Fusion Laboratory */
.fusion-slots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.upload-slot {
    aspect-ratio: 1;
    background: #111;
    border: 2px dashed #474D57;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.upload-slot:hover {
    border-color: #F0B90B;
    background: #1a1a1a;
}

.slot-placeholder {
    font-size: 10px;
    color: #474D57;
    text-align: center;
}

.slot-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.advanced-params {
    background: rgba(240, 185, 11, 0.05);
    padding: 10px;
    border-left: 2px solid #F0B90B;
    margin-bottom: 20px;
}

.param-row {
    margin-bottom: 10px;
}

.param-row label {
    display: block;
    font-size: 10px;
    margin-bottom: 5px;
    color: #F0B90B;
}

input[type="range"] {
    width: 100%;
    accent-color: #F0B90B;
}

.fusion-info-box {
    background: rgba(240, 185, 11, 0.1);
    border: 1px solid #F0B90B;
    padding: 10px;
    margin-bottom: 20px;
}

.fusion-info-box p {
    margin: 0;
    font-size: 11px;
    color: #F0B90B;
    line-height: 1.5;
}

#example-card-img {
    width: 600px;
    height: 600px;
    display: block;
    box-shadow: 20px 20px 60px rgba(0, 0, 0, 0.8);
    border: 2px solid #474D57;
}

#fortune-canvas {
    width: 600px;
    /* Viewport size (scaled down from 800px native) */
    height: 600px;
    display: block;
    background-color: #000;
}

/* Control Panel */
.pixel-card {
    background: #1e2329;
    padding: 30px;
    border: var(--pixel-size) solid #474D57;
    box-shadow: 12px 12px 0 rgba(0, 0, 0, 0.8);
}

.panel-title {
    color: var(--binance-yellow);
    margin-bottom: 25px;
    font-size: 1rem;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 0.7rem;
    color: #848E9C;
    margin-bottom: 8px;
}

.input-group input,
.input-group textarea {
    width: 100%;
    background: #2b3139;
    border: 3px solid #474d57;
    color: white;
    padding: 12px;
    font-family: 'ZPix', sans-serif;
    font-size: 1.1rem;
    outline: none;
}

.input-group input:focus {
    border-color: var(--binance-yellow);
}

.action-buttons {
    margin-top: 30px;
    display: grid;
    gap: 15px;
}

.pixel-btn {
    padding: 15px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 4px 4px 0 #000;
}

.primary-btn {
    background: var(--binance-yellow);
    color: #000;
}

.secondary-btn {
    background: #474d57;
    color: white;
}

.pixel-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #000;
}

/* Animations */
@keyframes floating {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

/* System Bar */
.system-bar {
    margin-top: 50px;
    background: #1e2329;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    font-size: 0.6rem;
    color: #474d57;
    border: 2px solid #2b3139;
}

/* --- Mobile Responsiveness (v11.0) --- */
@media (max-width: 968px) {

    .app-container,
    .container {
        padding: 15px;
        width: 100%;
    }

    /* Stack Creator Core Vertically */
    .creator-core {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    /* Move Canvas to Top/Bottom order adjustment if needed, 
       but default grid order is fine (Canvas Left/Top, Controls Right/Bottom) */

    /* Header Adjustments */
    .pixel-header,
    .site-header {
        flex-direction: column;
        gap: 20px;
        align-items: center;
        text-align: center;
    }

    .logo-area {
        margin-bottom: 10px;
    }

    .brand-text {
        text-align: center;
        margin-top: 10px;
    }

    /* Make scaleable canvas container */
    .card-preview-area {
        width: 100%;
        overflow: hidden;
        margin-bottom: 20px;
    }

    /* Auto-scale the fixed 600px canvas for mobile */
    #example-card-img,
    #fortune-canvas {
        max-width: 100%;
        height: auto;
        /* Maintain aspect ratio */
        aspect-ratio: 1 / 1;
    }

    /* Ensure Fusion Slots don't break on very small screens */
    .fusion-slots {
        gap: 5px;
    }

    .upload-slot {
        border-width: 1px;
    }
}



    10% {
        transform: translate(-10px, -10px) scale(1.05);
    }

    20% {
        transform: translate(10px, 10px) scale(1.05);
    }

    30% {
        transform: translate(-10px, 10px) scale(1.05);
    }

    40% {
        transform: translate(10px, -10px) scale(1.05);
    }

    50% {
        transform: translate(-5px, 0) scale(1.05);
        filter: blur(2px) brightness(1.3) hue-rotate(45deg);
    }

    60% {
        transform: translate(5px, 0) scale(1.05);
    }

    70% {
        transform: translate(0, 5px) scale(1.05);
    }

    80% {
        transform: translate(0, -2px) scale(1.02);
        filter: blur(0px) brightness(1.1) hue-rotate(0deg);
    }

    100% {
        transform: translate(0, 0) scale(1);
        filter: none;
        box-shadow: 0 0 50px rgba(240, 185, 11, 0);
    }
}

.blessing-inject-anim {
    animation: gold-glitch-glow 0.8s cubic-bezier(.36, .07, .19, .97) both;
    border-color: #F0B90B !important;
}


    10% {
        transform: translate(-15px, -15px) scale(1.05);
        filter: blur(4px) brightness(2) sepia(1);
        box-shadow: 0 0 30px rgba(240, 185, 11, 1);
    }
    20% {
        transform: translate(15px, 15px) scale(1.03);
        filter: blur(3px) invert(0.2);
    }
    30% {
        transform: translate(-10px, 5px) scale(1.05);
        filter: blur(4px) brightness(1.2) hue-rotate(90deg);
        box-shadow: 0 0 60px 20px rgba(240, 185, 11, 0.5);
    }
    40% {
        transform: translate(10px, -10px) scale(1.02);
        filter: blur(2px) hue-rotate(-90deg);
    }
    50% {
        transform: translate(-5px, 0) scale(1.05);
        filter: blur(2px) brightness(1.5);
        box-shadow: 0 0 40px rgba(240, 185, 11, 0.8);
    }
    60% {
        transform: translate(5px, 0) scale(1.01);
        filter: blur(1px);
    }
    70% {
        transform: translate(0, 3px) scale(1.01);
        filter: blur(0.5px);
    }
    80% {
        transform: translate(0, -1px) scale(1.005);
        filter: blur(0px) brightness(1.1);
        box-shadow: 0 0 20px rgba(240, 185, 11, 0.3);
    }
    100% {
        transform: translate(0, 0) scale(1);
        filter: none;
        box-shadow: 0 0 0 rgba(240, 185, 11, 0);
        opacity: 1;
    }
}

.blessing-inject-anim {
    animation: gold-glitch-glow 3.0s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
    border-color: #F0B90B !important;
}




    15% {
        transform: scale(1.02);
        filter: brightness(1.4);
        box-shadow: 0 0 50px 25px rgba(240, 185, 11, 0.6);
    }
    40% {
        transform: scale(1.06);
        filter: brightness(1.8) drop-shadow(0 0 20px #F0B90B);
        /* 2x Scattering Range: 120px glow */
        box-shadow: 0 0 120px 60px rgba(240, 185, 11, 1.0);
    }
    60% {
        transform: scale(1.04);
        filter: brightness(1.5);
        box-shadow: 0 0 90px 45px rgba(240, 185, 11, 0.8);
    }
    80% {
        transform: scale(1.01);
        filter: brightness(1.2);
        box-shadow: 0 0 50px 25px rgba(240, 185, 11, 0.4);
    }
    100% {
        transform: scale(1);
        filter: brightness(1);
        box-shadow: 0 0 0 0 rgba(240, 185, 11, 0);
    }
}

.blessing-inject-anim {
    animation: gold-glitch-glow 3.0s ease-out both; 
    border-color: #F0B90B !important;
}




    10% {
        transform: translate(-10px, -10px) scale(1.05);
        /* Massive scattering glow + heavy blur */
        box-shadow: 0 0 80px 40px rgba(240, 185, 11, 0.9);
    }
    20% {
        transform: translate(10px, 10px) scale(1.04);
        filter: blur(6px) brightness(1.8);
        box-shadow: 0 0 120px 60px rgba(240, 185, 11, 1.0); /* Peak Radiance */
    }
    30% { transform: translate(-8px, 8px) scale(1.05); }
    40% {
        transform: translate(8px, -8px) scale(1.03);
        filter: blur(4px) brightness(1.5);
        box-shadow: 0 0 100px 50px rgba(240, 185, 11, 0.8);
    }
    50% { transform: translate(-5px, 0) scale(1.04); }
    60% {
        transform: translate(5px, 0) scale(1.02);
        filter: blur(2px) brightness(1.3);
    }
    70% { transform: translate(0, 3px) scale(1.01); }
    80% {
        transform: translate(0, -1px) scale(1.005);
        filter: blur(0px) brightness(1.1);
        box-shadow: 0 0 40px 20px rgba(240, 185, 11, 0.4);
    }
    100% {
        transform: translate(0, 0) scale(1);
        filter: none;
        box-shadow: 0 0 0 rgba(240, 185, 11, 0);
    }
}

.blessing-inject-anim {
    /* 4.0s Duration as requested */
    animation: gold-glitch-glow 4.0s cubic-bezier(0.22, 0.61, 0.36, 1) both;
    border-color: #F0B90B !important;
}


/* Golden Danmaku System (v17.0) */
#danmaku-container {
    position: fixed;
    top: 20%;
    left: 0;
    width: 100%;
    height: 100px;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.danmaku-item {
    position: absolute;
    white-space: nowrap;
    font-size: 24px;
    font-weight: bold;
    color: #F0B90B;
    text-shadow: 
        2px 2px 0 #000,
        -1px -1px 0 #000,  
        1px -1px 0 #000,
        -1px 1px 0 #000,
        0 0 10px rgba(240, 185, 11, 0.8);
    font-family: 'Press Start 2P', monospace;
    opacity: 0;
    will-change: transform, opacity;
}

@keyframes danmaku-scroll {
    0% {
        transform: translateX(100vw);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateX(-100%);
        opacity: 0;
    }
}



/* Animation: Blessing Injection (v16.6 - Radiance + Shake 4s) */
@keyframes gold-glitch-glow {
    0% {
        transform: translate(0, 0) scale(1.02);
        filter: blur(8px) brightness(1.6) sepia(1);
        box-shadow: 0 0 10px rgba(240, 185, 11, 0.5);
    }
    10% {
        transform: translate(-10px, -10px) scale(1.05);
        /* Massive scattering glow + heavy blur */
        box-shadow: 0 0 80px 40px rgba(240, 185, 11, 0.9);
    }
    20% {
        transform: translate(10px, 10px) scale(1.04);
        filter: blur(6px) brightness(1.8);
        box-shadow: 0 0 120px 60px rgba(240, 185, 11, 1.0); /* Peak Radiance */
    }
    30% { transform: translate(-8px, 8px) scale(1.05); }
    40% {
        transform: translate(8px, -8px) scale(1.03);
        filter: blur(4px) brightness(1.5);
        box-shadow: 0 0 100px 50px rgba(240, 185, 11, 0.8);
    }
    50% { transform: translate(-5px, 0) scale(1.04); }
    60% {
        transform: translate(5px, 0) scale(1.02);
        filter: blur(2px) brightness(1.3);
    }
    70% { transform: translate(0, 3px) scale(1.01); }
    80% {
        transform: translate(0, -1px) scale(1.005);
        filter: blur(0px) brightness(1.1);
        box-shadow: 0 0 40px 20px rgba(240, 185, 11, 0.4);
    }
    100% {
        transform: translate(0, 0) scale(1);
        filter: none;
        box-shadow: 0 0 0 rgba(240, 185, 11, 0);
    }
}

.blessing-inject-anim {
    /* 4.0s Duration as requested */
    animation: gold-glitch-glow 4.0s cubic-bezier(0.22, 0.61, 0.36, 1) both;
    border-color: #F0B90B !important;
}


/* Loading Animation (v17.2) */
.loading-icon {
    height: 1.2em;
    vertical-align: text-bottom;
    margin-left: 8px;
    image-rendering: pixelated;
}

