:root {
    --neon-green: #39FF14;
    --neon-blue: #00FFFF;
    --neon-purple: #B026FF;
    --dark-bg: #050505;
    --panel-bg: #111;
    --text-main: 'Roboto Mono', monospace;
    --text-header: 'Orbitron', sans-serif;
    --border-color: #333;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--text-main);
    background-color: var(--dark-bg);
    color: var(--neon-green);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Tech Background */
.grid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image:
        linear-gradient(rgba(0, 255, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 40px 40px;
    perspective: 1000px;
    transform-style: preserve-3d;
    /* Performance optimization */
    will-change: transform;
    contain: layout style paint;
}

.scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: rgba(0, 255, 255, 0.3);
    opacity: 0.4;
    animation: scan 3s linear infinite;
    z-index: 999;
    pointer-events: none;
    /* Performance optimization */
    will-change: top;
    contain: layout style paint;
}

@keyframes scan {
    0% {
        top: -10%;
    }

    100% {
        top: 110%;
    }
}

/* Header */
header {
    text-align: center;
    padding: 2rem 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--neon-blue);
    background: rgba(0, 0, 0, 0.8);
    position: relative;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.2);
}

.lang-switcher {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
}

.lang-btn {
    background: transparent;
    border: 1px solid var(--neon-blue);
    color: var(--neon-blue);
    padding: 0.3rem 0.6rem;
    font-family: var(--text-header);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.lang-btn:hover,
.lang-btn.active {
    background: var(--neon-blue);
    color: black;
    box-shadow: 0 0 10px var(--neon-blue);
}

.logo-container {
    margin-bottom: 0.5rem;
}

.logo-placeholder {
    font-family: var(--text-header);
    font-size: 2rem;
    font-weight: 900;
    color: var(--neon-blue);
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px var(--neon-blue);
}

.logo-placeholder a {
    color: inherit;
    text-decoration: none;
    transition: all 0.3s ease;
}

.logo-placeholder a:hover {
    color: white;
    text-shadow: 0 0 20px var(--neon-blue), 0 0 40px var(--neon-blue);
}

h1 {
    font-family: var(--text-header);
    font-size: 1.5rem;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Main Content */
main {
    flex: 1;
    max-width: 1200px;
    /* Increased width for side-by-side */
    margin: 0 auto;
    width: 100%;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

.pickers-container {
    display: flex;
    gap: 2rem;
    width: 100%;
    align-items: stretch;
    /* Stretch to same height */
}

/* Ensure article tags don't break flex layout */
.pickers-container>article {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.picker-section {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Mecha-Dino Card Design */
.card {
    background: var(--panel-bg);
    border: 2px solid var(--neon-green);
    position: relative;
    margin-top: 2rem;
    padding: 4px;
    /* Increased inner spacing to prevent clip */
    clip-path: polygon(20px 0, 100% 0,
            100% calc(100% - 20px), calc(100% - 20px) 100%,
            0 100%, 0 20px);
    overflow: hidden;
    /* Ensure content stays inside */
    flex: 1;
    /* Fill section height */
    display: flex;
    flex-direction: column;
}

/* The "Head" Tab */
.card::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 20px;
    width: 150px;
    height: 10px;
    background: var(--neon-green);
    clip-path: polygon(0 0, 100% 0, 90% 100%, 10% 100%);
}

.card-header {
    background: rgba(57, 255, 20, 0.1);
    padding: 1rem;
    border-bottom: 1px solid var(--neon-green);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.card-header h2 {
    font-family: var(--text-header);
    font-size: 1.2rem;
    color: var(--neon-green);
    text-transform: uppercase;
}

/* Specific Style for Item Picker (Blue) */
#item-picker .card {
    border-color: var(--neon-blue);
}

#item-picker .card::before {
    background: var(--neon-blue);
}

#item-picker .card-header {
    background: rgba(0, 255, 255, 0.1);
    border-bottom-color: var(--neon-blue);
}

#item-picker .card-header h2 {
    color: var(--neon-blue);
}

.card-body {
    padding: 2rem;
    padding-bottom: 3rem;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    flex: 1;
    /* Push content to fill space */
    display: flex;
    flex-direction: column;
}

/* Dino Filler for Number Picker */
.dino-filler {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    opacity: 0.3;
    filter: drop-shadow(0 0 10px var(--neon-green));
    animation: float 4s ease-in-out infinite;
    margin: 1rem 0;
    /* Performance optimization */
    will-change: transform;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Inputs */
.input-group-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.input-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-wrapper.full-width {
    width: 100%;
    margin-bottom: 1.5rem;
}

label {
    font-size: 0.9rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

input[type="number"],
textarea {
    background: #000;
    border: 1px solid var(--neon-green);
    color: #FF3333;
    /* Red text for visibility */
    padding: 1rem;
    font-family: var(--text-main);
    font-size: 1.2rem;
    outline: none;
    box-shadow: inset 0 0 10px rgba(57, 255, 20, 0.1);
}

#item-picker input,
#item-picker textarea {
    border-color: var(--neon-blue);
    color: #FF3333;
    /* Red text for visibility */
    box-shadow: inset 0 0 10px rgba(0, 255, 255, 0.1);
}

/* Compact Inputs for Min/Max */
#min-num,
#max-num {
    padding: 0.5rem;
    font-size: 1rem;
    height: auto;
}

input:focus,
textarea:focus {
    box-shadow: 0 0 15px rgba(57, 255, 20, 0.4);
}

/* Range Slider */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    /* Fix lint: standard property */
    width: 100%;
    background: transparent;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 20px;
    width: 20px;
    background: var(--neon-green);
    cursor: pointer;
    margin-top: -8px;
    box-shadow: 0 0 10px var(--neon-green);
}

input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    background: #333;
}

/* Result Area */
.result-area {
    background: rgba(0, 0, 0, 0.5);
    border: 1px dashed var(--neon-green);
    padding: 2rem;
    min-height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

#item-picker .result-area {
    border-color: var(--neon-blue);
}

.result-item {
    background: transparent;
    border: 1px solid var(--neon-green);
    color: var(--neon-green);
    padding: 0.5rem 1.5rem;
    font-family: var(--text-header);
    font-size: 1.5rem;
    text-shadow: 0 0 5px var(--neon-green);
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.2);
    position: relative;
}

#item-picker .result-item {
    border-color: var(--neon-blue);
    color: var(--neon-blue);
    text-shadow: 0 0 5px var(--neon-blue);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.2);
}

/* Glitch Animation for Result */
@keyframes glitch {
    0% {
        transform: translate(0);
    }

    20% {
        transform: translate(-2px, 2px);
    }

    40% {
        transform: translate(-2px, -2px);
    }

    60% {
        transform: translate(2px, 2px);
    }

    80% {
        transform: translate(2px, -2px);
    }

    100% {
        transform: translate(0);
    }
}

.glitch-active {
    animation: glitch 0.2s infinite;
    /* Performance optimization */
    will-change: transform;
}

/* Buttons */
.button-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 1rem 2rem;
    border: none;
    font-family: var(--text-header);
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.btn-primary {
    background: var(--neon-green);
    color: black;
    box-shadow: 0 0 15px rgba(57, 255, 20, 0.4);
}

.btn-primary:hover {
    background: white;
    box-shadow: 0 0 25px rgba(57, 255, 20, 0.8);
}

#item-picker .btn-primary {
    background: var(--neon-blue);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.4);
}

.btn-secondary {
    background: #333;
    color: white;
    border: 1px solid #555;
}

.btn-secondary:hover {
    background: #555;
}

.btn-outline {
    background: transparent;
    border: 1px solid #555;
    color: #888;
}

.btn-outline:hover {
    border-color: white;
    color: white;
}

.demo-link a {
    color: var(--neon-blue);
    text-decoration: none;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.error-msg {
    color: #ff3333;
    text-align: center;
    margin-bottom: 1rem;
    font-family: var(--text-main);
}

/* CTA Section */
.cta-section {
    text-align: center;
    padding: 4rem 1rem;
}

.cta-button {
    display: inline-block;
    padding: 1.2rem 3rem;
    background: transparent;
    color: var(--neon-purple);
    text-decoration: none;
    font-family: var(--text-header);
    font-weight: 700;
    font-size: 1.2rem;
    border: 2px solid var(--neon-purple);
    box-shadow: 0 0 15px rgba(176, 38, 255, 0.3);
    transition: all 0.3s;
    text-transform: uppercase;
}

.cta-button:hover {
    background: var(--neon-purple);
    color: white;
    box-shadow: 0 0 30px rgba(176, 38, 255, 0.6);
}

/* Footer */
footer {
    background: #000;
    color: #555;
    text-align: center;
    padding: 2rem 1rem;
    margin-top: auto;
    font-size: 0.8rem;
    border-top: 1px solid #333;
    font-family: var(--text-main);
}

/* Dino Animation Container */
.dino-container {
    position: fixed;
    bottom: 20px;
    z-index: 100;
    pointer-events: none;
}

#dino-container-right {
    right: 20px;
}

#dino-container-left {
    left: 20px;
}

/* Flip the left dino to face right */
#dino-container-left .dino-emoji {
    transform: scaleX(-1);
}

.dino-popup {
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Performance optimization */
    will-change: transform;
}

.dino-popup.show {
    transform: translateY(0);
}

.dino-symbol {
    font-family: var(--text-header);
    font-size: 4rem;
    color: var(--neon-purple);
    text-shadow: 0 0 10px var(--neon-purple);
    position: absolute;
    top: -60px;
    right: 0px;
    animation: bounce 1s infinite;
    z-index: 101;
}

/* Adjust symbol position for left dino since it's flipped */
#dino-container-left .dino-symbol {
    right: auto;
    left: 0px;
    /* Counter-flip the symbol so text isn't backwards */
    /* transform: scaleX(-1);  <-- Not needed if symbol is outside the flipped element, but here it's sibling. 
       Wait, if I flip .dino-emoji only, symbol is fine. 
    */
}

/* Mobile Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 1.2rem;
    }

    .pickers-container {
        flex-direction: column;
        gap: 1rem;
    }

    .card {
        margin-top: 1rem;
    }

    .input-group-row {
        flex-direction: column;
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}