/* 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;
    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(45deg, rgba(0, 0, 0, 0.4) 25%, transparent 25%, transparent 50%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0.4) 75%, transparent 75%, transparent);
    background-size: 3px 3px;
}

.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(-10px); }
}

@keyframes textGlint {
    0% { background-position: -200% center; }
    30%, 100% { background-position: 200% center; }
}

@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-shiny-gold {
    background: linear-gradient(
        110deg, 
        #b8860b 0%, 
        #ffd700 20%, 
        #ffffff 50%, 
        #ffd700 80%, 
        #b8860b 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: textGlint 4s linear infinite;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6))
            drop-shadow(0 0 20px rgba(255, 170, 0, 0.25));
}

.control-section-label {
    padding: 0.4rem 0.75rem 0.38rem;
    border: 1px solid rgba(34, 211, 238, 0.35);
    background: linear-gradient(90deg, rgba(2, 18, 30, 0.92) 0%, rgba(4, 41, 56, 0.72) 100%);
    box-shadow: 0 0 18px rgba(0, 242, 255, 0.12), inset 0 0 14px rgba(0, 242, 255, 0.06);
    text-shadow: 0 0 10px rgba(0, 242, 255, 0.2);
}

.designer-form-shell {
    max-width: 332px;
}

.designer-form-header {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-bottom: 1rem;
}

.designer-form-header-minimal {
    margin-bottom: 0px; /* Using row margin-top instead for better control */
    border-bottom: none;
    padding-bottom: 0;
}

.designer-hero-title {
    margin: 0;
    font-family: Orbitron, sans-serif;
    font-size: 40px;
    font-style: italic;
    font-weight: 900;
    letter-spacing: 2px;
    line-height: 1;
    text-transform: uppercase;
    /* Ultra-Shiny Gold with speculation highlights */
    background: linear-gradient(
        110deg, 
        #8a6e2f 0%, 
        #bf953f 25%, 
        #fff6a1 50%, 
        #bf953f 75%, 
        #8a6e2f 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: textGlint 3s linear infinite;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.6)) 
            drop-shadow(0 0 25px rgba(255, 170, 0, 0.35));
    white-space: nowrap;
}

.designer-hero-title-mobile {
    font-size: 14px;
    text-align: center;
    letter-spacing: -0.3px;
}

.designer-form-title {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0;
    margin-top: 0.45rem;
    font-family: "Aclonica", "Orbitron", sans-serif;
    font-size: 26px;
    background: linear-gradient(
        110deg, 
        #ffd700 0%, 
        #fff6a1 45%, 
        #ffffff 50%, 
        #fff6a1 55%, 
        #ffd700 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.5));
    white-space: nowrap;
    font-style: normal;
    font-weight: 400;
    letter-spacing: 0.3px;
    line-height: 1.2;
    text-transform: none;
}



.designer-form-body {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.designer-form-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 210px;
    align-items: start;
    gap: 0.95rem;
    margin-top: 2rem; /* Single Space */
}
.designer-form-row-font {
    margin-top: 4rem; /* Double Space after header */
}
.designer-form-row-number {
    align-items: center;
}

.designer-field-copy {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
    padding-top: 0.45rem;
}

.designer-field-title {
    display: block;
    margin: 0;
    color: #ffffff;
    font-family: "Aclonica", sans-serif;
    font-size: 19px;
    line-height: 1.1;
    letter-spacing: 0.6px;
    text-shadow: 
        0 0 2px #fff,
        0 0 10px #ffd700,
        0 0 20px #ffaa00;
    text-transform: uppercase;
    opacity: 1;
}

.designer-form-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(206, 240, 255, 0.1), transparent);
    margin: 2.5rem 0;
}

.control-field-label {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0.2rem 0.65rem;
    border-left: 2px solid rgba(34, 211, 238, 0.7);
    background: linear-gradient(90deg, rgba(2, 12, 20, 0.88) 0%, rgba(2, 12, 20, 0.2) 100%);
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.65);
}

.control-surface {
    border: 1px solid rgba(34, 211, 238, 0.42);
    background: linear-gradient(180deg, rgba(3, 19, 30, 0.96) 0%, rgba(7, 39, 54, 0.9) 100%);
    box-shadow: 0 0 14px rgba(0, 242, 255, 0.12), inset 0 0 10px rgba(0, 242, 255, 0.06);
}

.designer-input {
    color: #ffffff;
    border-radius: 0.9rem;
    font-style: normal;
    letter-spacing: 0.5px;
    box-shadow:
        0 10px 18px rgba(0, 0, 0, 0.16),
        inset 0 0 12px rgba(0, 242, 255, 0.06);
}

.designer-input::placeholder {
    color: rgba(233, 249, 255, 0.66);
}

.number-panel {
    position: relative;
    gap: 0.4rem;
}

.number-panel-label {
    font-family: Orbitron, sans-serif;
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    background: linear-gradient(
        110deg, 
        #ffd700 0%, 
        #ffffff 50%, 
        #ffd700 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: textGlint 6s linear infinite;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.6));
    white-space: nowrap;
    min-height: 24px;
    padding-block: 0.12rem;
    border-left-width: 2px;
}

.number-panel-label-mobile {
    position: absolute;
    left: 50%;
    top: -18px;
    transform: translateX(-50%);
    font-size: 12px;
    letter-spacing: 1.2px;
    padding: 0.15rem 0.35rem;
}

.font-control {
    display: flex;
    justify-content: stretch;
}

.font-control-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.7rem;
}

.font-control-label {
    min-height: 28px;
    padding-inline: 0.65rem;
    color: #dffcff;
}

.font-control-label-mobile {
    min-height: 30px;
    font-size: 16px;
    letter-spacing: 1.4px;
}

.font-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 0.9rem;
    color: #ffffff;
    font-family: Orbitron, sans-serif;
    font-size: 11px;
    font-style: normal;
    font-weight: 800;
    letter-spacing: 0.7px;
    text-transform: uppercase;
}

.font-trigger:hover {
    border-color: rgba(34, 211, 238, 0.7);
    box-shadow: 0 0 22px rgba(0, 242, 255, 0.18), inset 0 0 12px rgba(0, 242, 255, 0.08);
}

.font-trigger-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.font-trigger-icon {
    margin-left: 0.75rem;
    color: #22d3ee;
    font-size: 12px;
    line-height: 1;
}

.font-trigger-mobile {
    font-size: 9px;
    letter-spacing: 0.7px;
}

.designer-number-group {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    width: 100%;
    max-width: 210px;
}

.designer-number-controls {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    gap: 0.55rem;
    align-items: center;
}

.designer-stepper {
    border-radius: 0.9rem;
}

.designer-number-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0 0.1rem;
}

.designer-form-row-mobile {
    grid-template-columns: 1fr;
    gap: 0.55rem;
}

.designer-number-group-mobile {
    max-width: none;
}

.designer-number-preview-mobile {
    justify-content: center;
}

/* 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(-32%) !important;
        /* Prevent overlap with controls */
        margin-bottom: 2rem !important;
    }

    .designer-form-row-font {
        margin-top: 4.5rem !important; /* Double Space to clear top line */
    }

    #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 .status-badge-clip {
        bottom: -20% !important;
        /* Move it towards the bottom edge */
    }

    #desktop-layout .absolute.bottom-\[-23\%\] {
        bottom: -30% !important;
        /* Move ring further down */
    }

    .control-section-label {
        padding: 0.32rem 0.6rem 0.3rem;
    }

    .control-field-label {
        padding-inline: 0.45rem;
    }

    .designer-form-shell {
        max-width: 318px;
    }

    .designer-form-title {
        font-size: 26px;
    }

    .designer-hero-title {
        font-size: 32px;
    }

    .designer-form-row {
        grid-template-columns: minmax(0, 1fr) 190px;
        gap: 0.75rem;
    }

    .designer-number-group {
        max-width: 190px;
    }

    .designer-number-preview {
        padding: 0.6rem 0.7rem;
    }
}
/* 3D Card HUD Layout */
.scene {
    perspective: 1200px;
}

.card {
    width: 400px;
    height: 400px;
    position: relative;
    cursor: default;
    transition: transform 1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card.show-back {
    animation: none !important;
    transform: rotateY(180deg) !important;
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
}

.card-front {
    transform: rotateY(0deg);
}

.card-back {
    transform: rotateY(180deg);
}

@keyframes rotateCardY {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

.animate-rotate-y {
    animation: rotateCardY 12s linear infinite;
}

/* Pause rotation on interaction with form - Disabled in favor of JS control */
/* .group:hover .animate-rotate-y {
    animation-play-state: paused;
} */

@media (max-width: 1023px) {
    .card {
        width: 250px;
        height: 250px;
    }
}
