/* Custom Scrollbar - Cricket Fantasy Theme */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

/* Hide default number input spinners */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
}

::-webkit-scrollbar-track {
    background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #bf953f 0%, #fcf6ba 50%, #bf953f 100%);
    border-radius: 100px;
    border: 1px solid #0a0a0a;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #fcf6ba 0%, #bf953f 100%);
    box-shadow: 0 0 10px rgba(191, 149, 63, 0.4);
}

/* 3D and Clipping Utilities */
.preserve-3d {
    transform-style: preserve-3d;
}

.backface-hidden {
    backface-visibility: hidden;
    transform: translateZ(1px);
}

.status-badge-clip {
    clip-path: polygon(8% 0, 100% 0, 92% 100%, 0 100%);
}

.bg-status-mesh {
    background-image: linear-gradient(0deg, transparent 24%, rgba(0, 0, 0, .15) 25%, rgba(0, 0, 0, .15) 26%, transparent 27%, transparent 74%, rgba(0, 0, 0, .15) 75%, rgba(0, 0, 0, .15) 76%, transparent 77%, transparent),
        linear-gradient(90deg, transparent 24%, rgba(0, 0, 0, .15) 25%, rgba(0, 0, 0, .15) 26%, transparent 27%, transparent 74%, rgba(0, 0, 0, .15) 75%, rgba(0, 0, 0, .15) 76%, transparent 77%, transparent);
    background-size: 4px 4px;
}

.scanlines {
    background-size: 100% 4px, 3px 100%;
    background-image: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%),
        linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 255, 0, 0.03));
}

/* Animations */
.animate-rotate-cw {
    animation: rotateCW 10s linear infinite;
}

.animate-rotate-cw-reverse {
    animation: rotateCW 10s linear infinite reverse;
}

.animate-beam {
    animation: beamPulse 3s ease-in-out infinite;
}

.animate-float {
    animation: float 4s ease-in-out infinite;
}

@keyframes rotateCW {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

@keyframes beamPulse {

    0%,
    100% {
        opacity: 0.3;
        transform: translateY(0) scaleX(1);
    }

    50% {
        opacity: 0.6;
        transform: translateY(-5px) scaleX(1.1);
    }
}

/* Font Styles */
.font-orbitron {
    font-family: Orbitron, sans-serif;
}

.font-hyper-oxide {
    font-family: 'hyper-oxide', sans-serif;
}

.font-frestype-atlethic {
    font-family: 'frestype-atlethic', sans-serif;
}

.font-rush-driver {
    font-family: 'rush-driver', sans-serif;
}

.font-sprintura-demo {
    font-family: 'sprintura-demo', sans-serif;
}

@font-face {
    font-family: 'hyper-oxide';
    src: url('/fonts/Hyper Oxide.ttf') format('truetype');
}

@font-face {
    font-family: 'frestype-atlethic';
    src: url('/fonts/FrestypeAtlethic-Regular.ttf') format('truetype');
}

@font-face {
    font-family: 'rush-driver';
    src: url('/fonts/RushDriver-Italic.otf') format('opentype');
}

@font-face {
    font-family: 'sprintura-demo';
    src: url('/fonts/Sprintura Demo.otf') format('opentype');
}

/* Utility Classes for Gradients */
.text-gradient-gold {
    background: linear-gradient(135deg, #fcf6ba 0%, #bf953f 45%, #fcf6ba 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-gradient-silver {
    background: linear-gradient(135deg, #ffffff 0%, #aaaaaa 45%, #ffffff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Custom UI Tweaks */
#app-container {
    user-select: none;
}

.custom-scrollbar::-webkit-scrollbar {
    display: none;
}

canvas {
    outline: none;
}

/* Animation helpers for dropdowns */
.animate-in {
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#canvas-container canvas {
    cursor: grab;
}

#canvas-container canvas:active {
    cursor: grabbing;
}

/* Responsive fixes for shorter/smaller laptop screens (like 1366x768) */
@media (min-width: 1024px) and (max-width: 1400px),
(max-height: 850px) and (min-width: 1024px) {
    #app-container {
        width: 94vw !important;
        max-width: 1200px !important;
        height: 96vh !important;
    }

    #desktop-layout {
        padding: 2.5rem !important;
        /* Reduced from 6rem (p-24) */
    }

    #desktop-layout section:last-child {
        transform: translateX(-100px) translateY(1rem) !important;
        /* Moved further left from 60px */
    }

    #footer-actions {
        transform: translateY(-20%) !important;
        /* Prevent overlap with controls */
        margin-bottom: 2rem !important;
    }

    #desktop-layout h1 {
        margin-top: 5rem !important;
        /* Move it further down */
        font-size: 1.25rem !important;
    }

    #desktop-layout h2 {
        margin-top: 0.5rem !important;
    }

    .grid {
        gap: 0.25rem !important;
    }

    .number-display {
        font-size: 1.25rem !important;
    }

    .relative.w-\[70px\].h-\[70px\] {
        width: 60px !important;
        height: 60px !important;
    }

    #desktop-layout .absolute.top-\[28\%\] {
        right: 23% !important;

        /* Move font button LEFT */
    }

    #desktop-layout .status-badge-clip {
        bottom: -20% !important;
        /* Move it towards the bottom edge */
    }

    #desktop-layout .absolute.bottom-\[-23\%\] {
        bottom: -30% !important;
        /* Move ring further down */
    }
}