/* ===============================================
   POKÉDEX CARD SCANNER — Premium Dark Theme
   =============================================== */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;700;900&family=Rajdhani:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&family=Press+Start+2P&display=swap');

/* === MODERN CYBER-DEX DESIGN === */
:root {
    /* Premium Hyper-Dex Palette */
    --pokedex-red-primary: hsl(355, 85%, 48%);
    --pokedex-red-bright: hsl(355, 100%, 60%);
    --pokedex-red-deep: hsl(355, 90%, 25%);
    --pokedex-metal-dark: hsl(230, 20%, 6%);
    --pokedex-metal-mid: hsl(230, 15%, 15%);
    --pokedex-metal-light: hsl(230, 10%, 25%);
    --pokedex-screen-bg: hsl(230, 30%, 3%);
    
    /* Neon & Energy Accents */
    --led-blue: hsl(185, 100%, 50%);
    --led-blue-dim: hsla(185, 100%, 50%, 0.15);
    --led-blue-glow: hsla(185, 100%, 50%, 0.4);
    --led-green: hsl(150, 100%, 50%);
    --led-yellow: hsl(55, 100%, 55%);
    --led-red: hsl(0, 100%, 60%);
    --accent-orange: hsl(32, 100%, 55%);
    --accent-cyan: hsl(180, 100%, 50%);
    --accent-magenta: hsl(320, 100%, 60%);
    
    /* Type-Specific DNA Hues */
    --type-fire: hsl(15, 90%, 55%);
    --type-water: hsl(205, 100%, 55%);
    --type-grass: hsl(145, 75%, 50%);
    --type-electric: hsl(50, 100%, 60%);
    --type-psychic: hsl(305, 80%, 65%);
    --type-fighting: hsl(10, 70%, 50%);
    --type-dark: hsl(260, 45%, 35%);
    --type-metal: hsl(210, 25%, 75%);
    --type-fairy: hsl(335, 100%, 80%);
    --type-dragon: hsl(255, 100%, 65%);
    --type-normal: hsl(0, 0%, 75%);
    
    /* Advanced Glassmorphism */
    --glass-surface: hsla(230, 30%, 8%, 0.7);
    --glass-bright: hsla(0, 0%, 100%, 0.05);
    --glass-border: hsla(0, 0%, 100%, 0.1);
    --glass-border-bright: hsla(185, 100%, 50%, 0.3);
    --glass-blur: blur(25px) saturate(180%);
    --panel-shadow: 0 20px 50px -10px hsla(0, 0%, 0%, 0.8), inset 0 1px 1px hsla(0, 0%, 100%, 0.05);

    /* Typography Evolution */
    --font-heading: 'Orbitron', sans-serif;
    --font-primary: 'Rajdhani', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --font-pixel: 'Press Start 2P', cursive;
    
    /* Text hierarchy */
    --text-high: hsla(0, 0%, 100%, 0.95);
    --text-med: hsla(0, 0%, 100%, 0.7);
    --text-low: hsla(0, 0%, 100%, 0.4);
    --text-muted: hsla(0, 0%, 100%, 0.25);
    
    /* Depth & Shadows */
    --depth-outer: 0 30px 90px -20px hsla(0, 0%, 0%, 0.9);
    --depth-inner: inset 0 2px 15px hsla(0, 0%, 0%, 0.8);
    --glow-soft: 0 0 20px var(--led-blue-dim);
    --glow-hard: 0 0 15px var(--led-blue);
    
    /* Border Radii */
    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius-md: 20px;
    --radius-lg: 40px;
    --radius-pill: 9999px;

    /* Motion System */
    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
    --ease-in-out-cubic: cubic-bezier(0.65, 0, 0.35, 1);
    --transition-fast: 0.2s var(--ease-out-expo);
    --transition-med: 0.4s var(--ease-out-expo);
}

/* === RESET & FOUNDATION === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background: radial-gradient(ellipse at 30% 20%, hsl(230, 30%, 12%) 0%, hsl(230, 40%, 3%) 60%, hsl(250, 35%, 2%) 100%);
    color: var(--text-high);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-x: hidden;
}

/* === BACKGROUND LAYERS === */
.bg-grid {
    position: fixed;
    inset: 0;
    background-image: 
        linear-gradient(hsla(190, 100%, 50%, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, hsla(190, 100%, 50%, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: -2;
    mask-image: radial-gradient(circle at center, black 0%, transparent 80%);
}

.bg-gradient-orbs {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
}

.bg-gradient-orbs::before, .bg-gradient-orbs::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.2;
    animation: float-orb 20s infinite ease-in-out;
}

.bg-gradient-orbs::before {
    width: 600px; height: 600px;
    background: radial-gradient(circle, var(--pokedex-red-primary), transparent);
    top: -200px; right: -100px;
}

.bg-gradient-orbs::after {
    width: 500px; height: 500px;
    background: radial-gradient(circle, var(--led-blue), transparent);
    bottom: -150px; left: -100px;
    animation-delay: -10s;
}

@keyframes float-orb {
    66% { transform: translate(-20px, 20px); }
}

@keyframes staggered-reveal {
    0% { opacity: 0; transform: translateY(20px) scale(0.95); filter: blur(4px); }
    100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

@keyframes matrix-glitch {
    0% { clip-path: inset(0 0 0 0); filter: hue-rotate(0deg); }
    20% { clip-path: inset(20% 0 50% 0); filter: hue-rotate(90deg); }
    40% { clip-path: inset(50% 0 10% 0); filter: hue-rotate(180deg); }
    60% { clip-path: inset(10% 0 70% 0); filter: hue-rotate(270deg); }
    80% { clip-path: inset(0 0 0 0); filter: hue-rotate(360deg); }
}

.view-transitioning .app-container {
    animation: matrix-glitch 0.3s ease-out;
    background-color: var(--pokedex-red-bright);
}

.view-transitioning .main-viewport {
    opacity: 0.8;
    transform: scale(0.995);
    transition: transform 0.2s ease;
}

/* === COMPONENTS === */
.recent-searches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
}

.recent-item {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.35s var(--ease-spring);
    text-align: center;
}

.recent-item:hover {
    background: hsla(230, 25%, 15%, 0.9);
    border-color: var(--glass-border-hover);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px hsla(0, 0%, 0%, 0.5), 0 0 15px var(--led-blue-dim);
}

.recent-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    filter: drop-shadow(0 0 10px hsla(190, 100%, 50%, 0.1));
    transition: transform 0.3s ease;
}

.recent-item:hover img {
    transform: scale(1.1) rotate(5deg);
}

.recent-item span {
    font-size: 0.5rem;
    font-family: var(--font-heading);
    color: var(--text-med);
    letter-spacing: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

@keyframes scan-glow {
    0%, 100% { box-shadow: 0 0 20px hsla(190, 100%, 50%, 0.2); }
    50% { box-shadow: 0 0 40px hsla(190, 100%, 50%, 0.5); }
}

/* === APP DEVICE FRAME === */
.app-container {
    width: 100%;
    max-width: 1300px;
    height: 94vh;
    height: 94dvh;
    background: var(--pokedex-red-primary);
    background-image: 
        linear-gradient(135deg, var(--pokedex-red-bright) 0%, var(--pokedex-red-primary) 50%, var(--pokedex-red-deep) 100%),
        repeating-linear-gradient(45deg, hsla(0, 0%, 100%, 0.05) 0px, hsla(0, 0%, 100%, 0.05) 1px, transparent 1px, transparent 4px);
    border: 12px solid var(--pokedex-metal-dark);
    border-radius: 48px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    box-shadow: 
        0 50px 120px hsla(0, 0%, 0%, 0.85),
        0 0 0 1px hsla(0, 0%, 100%, 0.03),
        inset 0 0 50px hsla(0, 0%, 0%, 0.6),
        0 0 30px hsla(355, 80%, 45%, 0.2);
    z-index: 10;
}

/* Pokedex Hinge (Clamshell feel) */
.app-container::before {
    content: '';
    position: absolute;
    top: 50px;
    left: -6px;
    width: 12px;
    height: calc(100% - 100px);
    background: linear-gradient(to right, 
        var(--pokedex-metal-dark), 
        var(--pokedex-metal-light), 
        var(--pokedex-metal-dark));
    border-radius: 6px;
    z-index: 15;
    box-shadow: 2px 0 5px hsla(0, 0%, 0%, 0.3);
}

/* Blue Main LED Lens - Futuristic Eye */
.app-container::after {
    content: '';
    position: absolute;
    top: 25px;
    left: 25px;
    width: 65px;
    height: 65px;
    background: radial-gradient(circle at 35% 35%, 
        #fff 0%, 
        var(--led-blue) 30%, 
        hsl(185, 100%, 20%) 70%, 
        var(--pokedex-metal-dark) 100%);
    border: 5px solid #eee;
    border-radius: 50%;
    box-shadow: 
        0 0 0 4px var(--pokedex-metal-dark),
        0 0 30px var(--led-blue-glow), 
        inset 0 0 20px hsla(0, 0%, 0%, 0.6);
    z-index: 20;
    animation: led-eye-glow 5s infinite var(--ease-in-out-cubic);
}

@keyframes led-eye-glow {
    0%, 100% { transform: scale(1); filter: brightness(1) contrast(1); box-shadow: 0 0 30px var(--led-blue-glow); }
    50% { transform: scale(1.05); filter: brightness(1.3) contrast(1.2); box-shadow: 0 0 50px var(--led-blue); }
}

/* Screen Viewport */
.main-viewport {
    flex: 1;
    margin: 15px;
    margin-top: 5px;
    background: var(--pokedex-screen-bg);
    background-image: 
        radial-gradient(circle at center, hsla(190, 100%, 50%, 0.05) 0%, transparent 70%),
        linear-gradient(hsla(190, 100%, 50%, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, hsla(190, 100%, 50%, 0.02) 1px, transparent 1px);
    background-size: 100% 100%, 30px 30px, 30px 30px;
    border: 10px solid var(--pokedex-metal-dark);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    box-shadow: 
        inset 0 0 50px hsla(0, 0%, 0%, 0.95),
        inset 0 2px 0 hsla(0, 0%, 100%, 0.02),
        0 8px 32px hsla(0, 0%, 0%, 0.4);
}

.led {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1.5px solid hsla(0, 0%, 0%, 0.5);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: inset 0 2px 4px hsla(0, 0%, 100%, 0.2);
}

.led::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: inherit;
    filter: blur(4px);
    opacity: 0.6;
}

.led.red { background: var(--led-red); box-shadow: 0 0 15px var(--led-red); }
.led.yellow { background: var(--led-yellow); box-shadow: 0 0 15px var(--led-yellow); }
.led.green { background: var(--led-green); box-shadow: 0 0 15px var(--led-green); }

.led.glow {
    animation: led-pulse 1s infinite alternate;
}

@keyframes led-pulse {
    0% { filter: brightness(0.8); box-shadow: 0 0 5px currentColor; }
    100% { filter: brightness(1.3); box-shadow: 0 0 20px currentColor; }
}

/* === PREMIUM TOP BAR === */
.top-bar {
    background: linear-gradient(to bottom, hsla(0, 0%, 0%, 0.4), hsla(0, 0%, 0%, 0.2));
    backdrop-filter: blur(15px);
    padding: 1rem 2rem 1rem 90px;
    border-bottom: 2px solid hsla(0, 0%, 0%, 0.4);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 50;
}

.top-bar-logo h1 {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 900;
    letter-spacing: 3px;
    color: #fff;
    text-shadow: 0 0 15px hsla(190, 100%, 50%, 0.5);
    display: flex;
    align-items: center;
    gap: 10px;
}

.v-tag {
    font-size: 0.5rem;
    background: var(--led-blue);
    color: #000;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 1px;
    vertical-align: middle;
}

/* Glass Tactical Navigation */
.top-bar-nav {
    display: flex;
    gap: 12px;
    background: hsla(230, 40%, 4%, 0.6);
    padding: 10px;
    margin: 12px 18px 6px;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--glass-blur);
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5);
    overflow-x: auto;
    scrollbar-width: none;
}

.top-bar-nav::-webkit-scrollbar {
    display: none;
}

.nav-btn {
    flex: 1;
    padding: 12px 6px;
    border: 1px solid transparent;
    background: hsla(0, 0%, 100%, 0.02);
    color: var(--text-low);
    font-family: var(--font-heading);
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 2px;
    cursor: pointer;
    transition: var(--transition-med);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
}

.nav-btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, hsla(0, 0%, 100%, 0.1), transparent);
    transition: left 0.5s var(--ease-out-expo);
}

.nav-btn:hover::before {
    left: 100%;
}

.nav-btn.active {
    color: var(--led-blue);
    background: hsla(185, 100%, 50%, 0.08);
    border-color: hsla(185, 100%, 50%, 0.2);
    box-shadow: 
        inset 0 0 20px hsla(185, 100%, 50%, 0.1),
        0 0 15px hsla(185, 100%, 50%, 0.1);
}

.nav-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--led-blue);
    box-shadow: 0 0 10px var(--led-blue);
    animation: slide-in-bottom 0.4s var(--ease-out-expo);
}

@keyframes slide-in-bottom {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

.nav-btn:hover:not(.active) {
    color: var(--text-high);
    background: hsla(0, 0%, 100%, 0.05);
    border-color: hsla(0, 0%, 100%, 0.1);
}

.badge-count {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    background: var(--pokedex-red-bright);
    color: #fff;
    padding: 1px 5px;
    border-radius: 5px;
    margin-left: 3px;
    box-shadow: 0 0 10px hsla(355, 100%, 50%, 0.3);
}

.led {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.led.red { background: #ff3b30; box-shadow: 0 0 10px #ff3b30; }
.led.orange { background: #ff9500; box-shadow: 0 0 10px #ff9500; }
.led.yellow { background: #ffcc00; box-shadow: 0 0 10px #ffcc00; }
.led.glow { animation: blink 0.8s infinite; }

.btn-reboot {
    background: rgba(255, 59, 48, 0.2);
    border: 1px solid #ff3b30;
    color: #ff3b30;
    font-family: var(--font-mono);
    font-size: 0.5rem;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 10px;
    animation: pulse-red 1.5s infinite;
    transition: all 0.3s ease;
}

.btn-reboot:hover {
    background: #ff3b30!important;
    color: #fff!important;
}

.btn-reboot.hidden { display: none; }

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 59, 48, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0); }
}

.led.green { background: var(--led-green); box-shadow: 0 0 12px var(--led-green); }

/* === VIEWS === */
.view {
    display: none;
    padding: 1.25rem;
    height: 100%;
    overflow-y: auto;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: var(--led-blue) transparent;
    animation: cyberReveal 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    isolation: isolate;
}

.view.active {
    display: block;
}

@keyframes cyberReveal {
    0% { opacity: 0; filter: blur(10px) brightness(2); transform: scale(0.98); }
    100% { opacity: 1; filter: blur(0) brightness(1); transform: scale(1); }
}

/* === SCANNER VIEW === */
.scanner-container {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 1.5rem;
    height: 100%;
}

/* === SCANNER HUD & OVERLAYS === */
.scanner-viewport {
    position: relative;
    background: var(--pokedex-screen-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 500px;
    box-shadow: inset 0 0 30px hsla(0, 0%, 0%, 0.9);
}

#camera-feed {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
    transition: filter 0.3s ease;
}

#camera-feed.active {
    filter: brightness(1.1) contrast(1.1);
}

/* === USER IDENTITY UI === */
.user-profile-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    background: hsla(0, 0%, 100%, 0.03);
    padding: 6px 12px 6px 6px;
    border-radius: 40px;
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.user-profile-btn:hover {
    background: hsla(0, 0%, 100%, 0.08);
    border-color: var(--led-blue);
}

.avatar-frame {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--led-blue);
    position: relative;
    cursor: pointer;
    box-shadow: 0 0 10px hsla(190, 100%, 50%, 0.3);
}

.avatar-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-overlay {
    position: absolute;
    inset: 0;
    background: hsla(190, 100%, 50%, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.5rem;
    font-weight: 900;
    opacity: 0;
    transition: opacity 0.3s;
}

/* --- PREMIUM COMPONENT STYLES --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: var(--transition-med);
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--led-blue);
    color: var(--pokedex-metal-dark);
    box-shadow: 0 0 20px var(--led-blue-dim);
}

.btn-primary:hover {
    background: #fff;
    box-shadow: 0 0 30px var(--led-blue);
    transform: translateY(-2px);
}

.btn-ghost {
    background: hsla(0, 0%, 100%, 0.03);
    color: var(--text-med);
    border-color: var(--glass-border);
}

.btn-ghost:hover {
    background: hsla(0, 0%, 100%, 0.1);
    color: var(--text-high);
    border-color: var(--led-blue);
    box-shadow: 0 0 15px var(--led-blue-dim);
}

.btn-success {
    background: var(--led-green);
    color: var(--pokedex-metal-dark);
}

.btn-success:hover {
    filter: brightness(1.2);
    box-shadow: 0 0 25px hsla(150, 100%, 50%, 0.3);
}

.btn-danger {
    background: var(--led-red);
    color: #fff;
}

.btn-danger:hover {
    filter: brightness(1.2);
    box-shadow: 0 0 25px hsla(0, 100%, 60%, 0.3);
}

/* Form Controls */
.meta-field label {
    display: block;
    font-family: var(--font-heading);
    font-size: 0.55rem;
    color: var(--led-blue);
    margin-bottom: 8px;
    letter-spacing: 1.5px;
    opacity: 0.8;
}

input[type="text"], 
input[type="email"], 
select, 
textarea {
    width: 100%;
    background: hsla(230, 40%, 4%, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xs);
    padding: 10px 14px;
    color: var(--text-high);
    font-family: var(--font-primary);
    font-size: 0.85rem;
    transition: var(--transition-fast);
}

input:focus, 
select:focus, 
textarea:focus {
    outline: none;
    border-color: var(--led-blue);
    background: hsla(230, 40%, 8%, 0.8);
    box-shadow: 0 0 15px var(--led-blue-dim);
}

/* Collection Cards Redesign */
.collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 10px;
}

.collection-card {
    background: var(--glass-surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 15px;
    cursor: pointer;
    transition: var(--transition-med);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.collection-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--glass-border-bright);
    background: hsla(230, 40%, 12%, 0.8);
    box-shadow: 0 15px 40px -10px rgba(0,0,0,0.6), 0 0 20px var(--led-blue-dim);
}

.card-image-wrap {
    width: 100%;
    aspect-ratio: 63/88;
    background: #000;
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
    border: 1px solid var(--glass-border);
}

.card-image-wrap img {
    width: 1000%; /* Purposeful zoom for thumbnail feel if needed, but standard is 100% */
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease-out-expo);
}

.collection-card:hover img {
    transform: scale(1.1);
}

.card-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-info strong {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    color: #fff;
    letter-spacing: 1px;
}

.card-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.6rem;
    font-family: var(--font-primary);
}

.type-badge {
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    background: var(--led-blue-dim);
    color: var(--led-blue);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.5rem;
    letter-spacing: 1px;
}

/* Cinematic HUD Elements */
.scanner-hud-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 10;
}

.hud-corners .corner {
    position: absolute;
    width: 48px;
    height: 48px;
    border: 2px solid var(--led-blue);
    opacity: 0.6;
    transition: all 0.3s var(--ease-spring);
    box-shadow: 0 0 15px var(--led-blue-dim);
}

.corner.top-left { top: 24px; left: 24px; border-right: none; border-bottom: none; }
.corner.top-right { top: 24px; right: 24px; border-left: none; border-bottom: none; }
.corner.bottom-left { bottom: 24px; left: 24px; border-right: none; border-top: none; }
.corner.bottom-right { bottom: 24px; right: 24px; border-left: none; border-top: none; }

.hud-diagnostics {
    position: absolute;
    top: 40px;
    left: 40px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: hsla(230, 25%, 5%, 0.4);
    padding: 15px;
    border-radius: 8px;
    border-left: 2px solid var(--led-blue);
    backdrop-filter: blur(10px);
}

.diag-item {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--led-blue);
    display: flex;
    gap: 10px;
    text-shadow: 0 0 8px var(--led-blue-glow);
}

.diag-label { color: var(--text-low); }
.diag-val.pulse { animation: blink 1.2s infinite ease-in-out; }

@keyframes blink {
    0%, 100% { opacity: 1; filter: brightness(1.2); }
    50% { opacity: 0.2; filter: brightness(0.8); }
}

.scan-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--led-blue), transparent);
    box-shadow: 
        0 0 15px var(--led-blue),
        0 0 30px var(--led-blue);
    z-index: 20;
    display: none;
    animation: scan-sweep 2.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes scan-sweep {
    0% { top: 0%; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

/* Upload & Empty States */
.upload-zone {
    z-index: 5;
    text-align: center;
    transition: all 0.3s ease;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 20px var(--led-blue));
    animation: float 3s infinite ease-in-out;
}

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

/* Card outline animation */
.card-outline-overlay {
    position: absolute;
    inset: 0;
    z-index: 15;
    pointer-events: none;
}

/* === MOBILE-FRIENDLY HEADER & MODERN REFINEMENTS === */
/* === MOBILE-FRIENDLY HEADER & MODERN REFINEMENTS === */
/* === SCANNER VIEW ENHANCEMENTS === */
.scanner-viewport {
    position: relative;
    background: var(--pokedex-screen-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 500px;
    box-shadow: var(--depth-inner), 0 0 40px rgba(0,0,0,0.5);
    background-image: 
        radial-gradient(circle at center, hsla(185, 100%, 50%, 0.05) 0%, transparent 70%),
        linear-gradient(rgba(185, 100%, 50%, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(185, 100%, 50%, 0.02) 1px, transparent 1px);
    background-size: 100% 100%, 30px 30px, 30px 30px;
}

.scanner-viewport::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(185, 100%, 50%, 0.05) 0%, transparent 10%, transparent 90%, rgba(185, 100%, 50%, 0.05) 100%);
    pointer-events: none;
    z-index: 5;
}

.scanner-hud-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 10;
    border: 20px solid transparent;
}

.hud-corners .corner {
    position: absolute;
    width: 60px;
    height: 60px;
    border: 2px solid var(--led-blue);
    opacity: 0.5;
    transition: var(--transition-med);
    filter: drop-shadow(0 0 10px var(--led-blue-dim));
}

.corner.top-left { top: 0; left: 0; border-right: none; border-bottom: none; }
.corner.top-right { top: 0; right: 0; border-left: none; border-bottom: none; }
.corner.bottom-left { bottom: 0; left: 0; border-right: none; border-top: none; }
.corner.bottom-right { bottom: 0; right: 0; border-left: none; border-top: none; }

.scanner-viewport.active .hud-corners .corner {
    opacity: 1;
    width: 40px;
    height: 40px;
}

.hud-diagnostics {
    position: absolute;
    top: 30px;
    left: 30px;
    background: hsla(230, 40%, 4%, 0.5);
    padding: 15px;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--led-blue);
    backdrop-filter: var(--glass-blur);
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
}

.diag-item {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--led-blue);
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.diag-label { color: var(--text-low); letter-spacing: 1px; }
.diag-val { font-weight: 700; text-shadow: 0 0 8px var(--led-blue-glow); }

/* Results Panel Glass Stack */
.results-panel {
    background: var(--glass-surface);
    backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    padding: 20px;
    margin-top: 20px;
    box-shadow: var(--panel-shadow);
}

.panel-card {
    background: hsla(0, 0%, 100%, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin-bottom: 15px;
}

.panel-card-header h3 {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    color: var(--led-blue);
    margin-bottom: 20px;
    letter-spacing: 2px;
}

@media (max-width: 600px) {
    body { padding: 0; }
    .app-container { 
        height: 100vh; 
        height: 100dvh;
        border-radius: 0; 
        border: none; 
        width: 100vw;
        max-width: none;
    }
    .app-container::before { top: 8px; left: 10px; width: 32px; height: 32px; border-width: 2px; }
    .top-bar { padding: 0.5rem 1rem 0.5rem 50px; }
    .top-bar-logo h1 { font-size: 0.6rem; letter-spacing: 1px; }
    .back-link span { display: none; }
    .hardware-leds { gap: 6px; }
    .led { width: 8px; height: 8px; }
    .main-viewport { margin: 5px; border-width: 4px; border-radius: 12px; }
    .nav-btn { font-size: 0.6rem; padding: 12px 4px; letter-spacing: 0; }
    .scanner-controls { padding: 0.5rem; gap: 0.5rem; }
    .ctrl-btn { width: 40px; height: 40px; font-size: 1.1rem; }
    .ctrl-btn.capture-btn { width: 60px; height: 60px; }
    
    /* One-Screen Mobile Fixes */
    .view { padding: 0.75rem; }
    .scanner-container { 
        grid-template-columns: 1fr; 
        gap: 0.75rem; 
        display: flex;
        flex-direction: column;
        overflow-x: hidden;
    }
    
    .scanner-viewport { 
        min-height: auto !important; 
        height: 25vh !important; 
        flex: 0 0 auto;
    }
    
    .results-panel {
        flex: 1;
        overflow-y: auto;
        padding-bottom: 2rem;
    }

    .scanner-view-container { 
        display: flex !important;
        flex-direction: column !important;
        gap: 0.5rem !important; 
    }
    
    .scanner-preview-card { 
        padding: 0.5rem !important; 
        margin-bottom: 0.5rem !important; 
        border-radius: 8px !important;
        display: flex;
        gap: 10px;
        align-items: center;
    }
    
    #preview-image-v2 { 
        max-height: 120px !important; 
        width: 80px !important;
        object-fit: contain !important; 
    }
    
    .scanner-left-col {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .meta-field { margin-bottom: 0.5rem !important; }
    .meta-field label { font-size: 0.5rem !important; margin-bottom: 2px !important; }
    .meta-field input, .meta-field select, .meta-field textarea { font-size: 0.8rem; padding: 8px; }
    
    .panel-card { padding: 12px !important; }
    .ocr-status { font-size: 0.5rem !important; }
    
    .hud-diagnostics, .hud-data-left, .hud-data-right, .hud-corners { display: none !important; }
    .scanner-hud-overlay::after { font-size: 0.45rem !important; top: 5px !important; right: 8px !important; }
}

/* === SCANNER OVERHAUL === */
.scanner-viewport::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(0, 238, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 238, 255, 0.05) 1px, transparent 1px);
    background-size: 30px 30px;
    pointer-events: none;
    z-index: 1;
}

.scanner-viewport::after {
    content: 'SCANNING...';
    position: absolute;
    top: 10px;
    right: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    color: var(--led-blue);
    opacity: 0.4;
    letter-spacing: 2px;
}

.capture-btn {
    background: radial-gradient(circle, #ff3b30 0%, #aa0000 70%) !important;
    border: 4px solid rgba(255,255,255,0.2) !important;
    box-shadow: 0 0 20px rgba(255, 59, 48, 0.5), inset 0 0 10px rgba(0,0,0,0.5) !important;
    position: relative;
    overflow: hidden;
}

.capture-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.4) 0%, transparent 40%);
}

.capture-btn.scanning {
    animation: pulse-red 0.8s infinite;
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 20px rgba(255, 59, 48, 0.5); }
    50% { box-shadow: 0 0 40px rgba(255, 59, 48, 0.8); transform: scale(1.05); }
    100% { box-shadow: 0 0 20px rgba(255, 59, 48, 0.5); }
}

/* === ENHANCED COLLECTION CARDS === */
.collection-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
    backdrop-filter: blur(12px);
}

.collection-card.revealing {
    animation: staggered-reveal 0.5s forwards;
}

.collection-card:hover {
    transform: translateY(-10px) scale(1.03);
    border-color: var(--led-blue);
    box-shadow: 
        0 20px 40px rgba(0,0,0,0.8), 
        0 0 30px rgba(0, 238, 255, 0.15);
}

/* Holographic Shine Effect */
.collection-card.holo-shine::before {
    content: '';
    position: absolute;
    top: -150%; left: -150%; width: 300%; height: 300%;
    background: linear-gradient(
        135deg,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0) 45%,
        rgba(255,255,255,0.08) 50%,
        rgba(255,255,255,0) 55%,
        rgba(255,255,255,0) 100%
    );
    z-index: 2;
    transition: all 0.5s;
    pointer-events: none;
}

.collection-card:hover.holo-shine::before {
    transform: translate(50%, 50%);
}

.collection-card.secret-rare-glow {
    border-color: var(--led-yellow);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.15);
}

.card-image-wrap {
    aspect-ratio: 63 / 88;
    background: #000;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.collection-card:hover .card-image-wrap img {
    transform: scale(1.15);
}

/* Duplicate Badge */
.duplicate-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--pokedex-red);
    color: #fff;
    font-family: var(--font-pixel);
    font-size: 0.5rem;
    padding: 4px 6px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.3);
    z-index: 5;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

/* === SCANNER VIEW ENHANCEMENTS === */
.scanner-view-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    transition: all 0.5s ease;
}

@media (min-width: 1024px) {
    .scanner-view-container {
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }
}

.scanner-left-col {
    position: sticky;
    top: 2rem;
}

.scanner-preview-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--glass-glow);
    margin-bottom: 2rem;
    backdrop-filter: blur(12px);
}

.scanner-preview-card::after {
    content: 'OPTICAL_FEED_V4';
    position: absolute;
    top: 12px;
    right: 20px;
    font-family: var(--font-mono);
    font-size: 0.5rem;
    color: var(--led-blue);
    opacity: 0.4;
    letter-spacing: 2px;
}

#preview-image-v2 {
    width: 100%;
    border-radius: 12px;
    display: block;
    box-shadow: 0 10px 40px hsla(0, 0%, 0%, 0.6);
    background: #000;
    border: 1px solid hsla(0, 0%, 100%, 0.05);
}

.results-dim-card {
    margin-bottom: 15px !important;
}

.results-dim-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.results-dim-header h4 {
    font-size: 0.6rem;
    color: var(--led-blue);
    margin: 0;
}

.confidence-bar {
    width: 60px;
    height: 4px;
    background: hsla(0, 0%, 100%, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.dimension-display {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

.dimension-display .dim-value {
    font-size: 1.4rem;
    font-family: var(--font-mono);
    color: var(--text-high);
    text-shadow: var(--glow-blue);
}

.dimension-display .dim-sep {
    opacity: 0.3;
    font-size: 1.2rem;
}

.dimension-display .dim-unit {
    font-size: 0.6rem;
    color: var(--text-low);
    margin-left: -5px;
    align-self: flex-end;
    margin-bottom: 4px;
}

/* === SIMILAR CARDS COMPONENT === */
#similar-cards-container {
    margin-top: 20px;
    padding: 15px;
}

.similar-cards-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--glass-border);
}

.similar-cards-header i {
    color: var(--led-blue);
    font-size: 0.8rem;
}

.similar-cards-header span {
    font-size: 0.65rem;
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-low);
}

.similar-cards-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 5px 2px 10px 2px;
    scrollbar-width: none;
}

.similar-card-sm {
    flex: 0 0 70px;
    aspect-ratio: 63/88;
    background: hsla(0, 0%, 0%, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    padding: 2px;
    cursor: pointer;
    transition: all 0.3s var(--ease-spring);
    overflow: hidden;
}

.similar-card-sm:hover {
    border-color: var(--led-blue);
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 16px hsla(0, 0%, 0%, 0.6), 0 0 10px var(--led-blue-dim);
}

.similar-card-sm img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

/* === MODAL DETAILS COMPONENT === */
.modal-details-container {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.modal-card-wrap {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: hsla(230, 25%, 2%, 0.4);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

.calibration-ring {
    position: absolute;
    width: 250px;
    height: 250px;
    border: 1px dashed var(--led-blue-glow);
    border-radius: 50%;
    animation: rotate-ring 20s linear infinite;
    pointer-events: none;
    opacity: 0.3;
}

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

#modal-display-img {
    max-height: 45vh;
    max-width: 100%;
    object-fit: contain;
    border-radius: 12px;
    position: relative;
    z-index: 2;
    box-shadow: 0 15px 45px hsla(0, 0%, 0%, 0.8), 0 0 30px var(--led-blue-dim);
    transition: transform 0.3s var(--ease-spring);
}

#modal-display-img:hover {
    transform: scale(1.02);
}

.modal-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
}

.stat-box {
    background: hsla(230, 25%, 5%, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: all 0.3s var(--ease-spring);
}

.stat-box.accent {
    border-color: var(--led-blue-glow);
    background: hsla(190, 100%, 50%, 0.03);
}

.stat-box .stat-label {
    font-size: 0.55rem;
    font-family: var(--font-heading);
    color: var(--text-low);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.stat-box .stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-high);
}

.stat-box.accent .stat-value {
    color: var(--led-blue);
    text-shadow: var(--glow-blue);
}

.ocr-marquee-container {
    background: black;
    border: 1px solid hsla(0, 0%, 100%, 0.05);
    padding: 8px;
    border-radius: 6px;
    overflow: hidden;
    white-space: nowrap;
}

.ocr-marquee {
    display: inline-block;
    padding-left: 100%;
    animation: marquee 20s linear infinite;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--led-blue);
    opacity: 0.6;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* Card Info Styling */
.card-info {
    padding: 12px;
    background: rgba(0,0,0,0.4);
    border-top: 1px solid var(--glass-border);
}

.card-info strong {
    display: block;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    color: #fff;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.type-badge {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 700;
}

.type-badge.fire { background: var(--type-fire); box-shadow: 0 0 8px var(--type-fire); }
.type-badge.water { background: var(--type-water); box-shadow: 0 0 8px var(--type-water); }
.type-badge.grass { background: var(--type-grass); box-shadow: 0 0 8px var(--type-grass); }
.type-badge.electric { background: var(--type-electric); color: #000; box-shadow: 0 0 8px var(--type-electric); }
.type-badge.psychic { background: var(--type-psychic); box-shadow: 0 0 8px var(--type-psychic); }
.type-badge.fighting { background: var(--type-fighting); box-shadow: 0 0 8px var(--type-fighting); }
.type-badge.dark { background: var(--type-dark); box-shadow: 0 0 8px var(--type-dark); }
.type-badge.metal { background: var(--type-metal); color: #000; box-shadow: 0 0 8px var(--type-metal); }
.type-badge.fairy { background: var(--type-fairy); color: #000; box-shadow: 0 0 8px var(--type-fairy); }
.type-badge.dragon { background: var(--type-dragon); box-shadow: 0 0 8px var(--type-dragon); }

.set-tag {
    font-size: 0.6rem;
    color: var(--text-tertiary);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* === STATS PAGE MODERNIZATION === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.panel-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.5rem;
    backdrop-filter: blur(12px);
    margin-bottom: 1.5rem;
}

.panel-card-header {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1rem;
}

.panel-card-header h3 {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    color: var(--led-blue);
    letter-spacing: 1px;
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, transparent, var(--led-blue), transparent);
    opacity: 0.3;
}

.stat-label {
    font-family: var(--font-heading);
    font-size: 0.65rem;
    color: var(--text-tertiary);
    letter-spacing: 2px;
    margin-bottom: 0.75rem;
}

.stat-value {
    font-family: var(--font-pixel);
    font-size: 1.5rem;
    color: #fff;
    text-shadow: 0 0 15px rgba(255,255,255,0.2);
}

.type-chart {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(10px);
}

.type-bar-row {
    margin-bottom: 16px;
    transition: transform 0.3s ease;
}

.type-bar-row:hover {
    transform: translateX(5px);
}

.type-bar-label {
    transition: color 0.3s;
}

.type-bar-row:hover .type-bar-label {
    color: #fff;
}

.type-bar-fill {
    transition: width 1.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Rarity Box */
.rarity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.rarity-box {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rarity-label {
    font-size: 0.6rem;
    font-family: var(--font-heading);
    color: var(--text-tertiary);
}

.rarity-value {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--led-blue);
}

/* === COLLECTION CARDS === */
.collection-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
}

.collection-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--led-blue);
    box-shadow: 0 15px 30px rgba(0,0,0,0.6), 0 0 20px rgba(0, 238, 255, 0.1);
}

.collection-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.05) 50%, transparent 100%);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.collection-card:hover::after {
    transform: translateX(100%);
}

.card-image-wrap {
    aspect-ratio: 63 / 88;
    background: #000;
    position: relative;
    overflow: hidden;
}

.card-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s;
}

.collection-card:hover .card-image-wrap img {
    transform: scale(1.1);
}

/* Modern Inputs & Toggles */
.toggle-field input[type="checkbox"] {
    appearance: none;
    width: 34px;
    height: 18px;
    background: #333;
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    transition: 0.3s;
}

.toggle-field input[type="checkbox"]:checked {
    background: var(--led-blue);
}

.toggle-field input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: 0.3s;
}

.toggle-field input[type="checkbox"]:checked::before {
    left: 18px;
}

/* === CYBER-DEX THEMED INPUTS === */
input, select, textarea {
    background: rgba(0, 0, 0, 0.4) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    font-family: var(--font-data) !important;
    border-radius: 12px !important;
    padding: 12px 18px !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    letter-spacing: 0.5px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: inset 0 2px 15px rgba(0,0,0,0.5) !important;
    backdrop-filter: blur(8px) !important;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--led-blue) !important;
    box-shadow: 0 0 20px hsla(186, 100%, 50%, 0.3), inset 0 2px 15px rgba(0,0,0,0.6) !important;
    outline: none !important;
    background: rgba(0, 0, 0, 0.6) !important;
    transform: translateY(-1px);
}

input::placeholder {
    font-family: var(--font-heading);
    color: var(--text-tertiary) !important;
    text-transform: uppercase;
    font-size: 0.6rem;
    letter-spacing: 2px;
}

/* Custom Tactical Select styling */
select {
    cursor: pointer;
    background-image: 
        linear-gradient(45deg, transparent 50%, var(--led-blue) 50%),
        linear-gradient(135deg, var(--led-blue) 50%, transparent 50%);
    background-position: 
        calc(100% - 25px) 50%,
        calc(100% - 20px) 50%;
    background-size: 
        5px 5px,
        5px 5px;
    background-repeat: no-repeat;
    padding-right: 45px !important;
}

/* === TACTICAL BUTTONS === */
.btn {
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 0.75rem;
    border-radius: 14px;
    padding: 12px 24px;
    border: 1px solid hsla(0, 0%, 100%, 0.1);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(to bottom, var(--pokedex-metal-light), var(--pokedex-metal-dark));
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 4px 0 hsla(0, 0%, 0%, 0.4),
        0 8px 15px hsla(0, 0%, 0%, 0.3);
}

.btn:active:not(:disabled) {
    transform: translateY(2px);
    box-shadow: 0 2px 0 hsla(0, 0%, 0%, 0.4);
}

.btn:hover:not(:disabled) {
    filter: brightness(1.1);
    border-color: hsla(0, 0%, 100%, 0.3);
}

.btn-primary {
    background: linear-gradient(135deg, var(--led-blue) 0%, hsl(190, 100%, 40%) 100%) !important;
    color: var(--pokedex-screen-bg) !important;
    box-shadow: 
        0 4px 0 hsl(190, 100%, 30%),
        0 0 20px hsla(190, 100%, 50%, 0.2);
}

.btn-success {
    background: linear-gradient(135deg, var(--led-green) 0%, hsl(120, 100%, 35%) 100%) !important;
    color: var(--pokedex-screen-bg) !important;
    box-shadow: 
        0 4px 0 hsl(120, 100%, 25%),
        0 0 20px hsla(120, 100%, 50%, 0.2);
}

.btn-danger {
    background: linear-gradient(135deg, var(--led-red) 0%, hsl(0, 100%, 40%) 100%) !important;
}

.btn-ghost {
    background: hsla(0, 0%, 100%, 0.03) !important;
    border: 1px solid hsla(0, 0%, 100%, 0.1) !important;
    backdrop-filter: blur(5px);
    box-shadow: none;
}

/* === NAVIGATION MODERNIZATION === */
.top-bar-nav {
    display: flex;
    gap: 4px;
    background: hsla(230, 30%, 5%, 0.6);
    padding: 6px 8px;
    border-bottom: 2px solid hsla(0, 0%, 0%, 0.5);
    backdrop-filter: var(--panel-blur);
}

.nav-btn {
    flex: 1;
    padding: 12px 8px;
    background: transparent;
    border: none;
    color: var(--text-low);
    font-family: var(--font-heading);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.35s var(--ease-spring);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.nav-btn.active {
    color: var(--led-blue);
    background: var(--led-blue-dim);
    text-shadow: var(--glow-blue);
}

.nav-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 15%;
    right: 15%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--led-blue), transparent);
    box-shadow: 0 0 12px var(--led-blue), 0 0 25px var(--led-blue-glow);
    border-radius: 3px;
}

.nav-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 40%, hsla(0, 0%, 100%, 0.06) 50%, transparent 60%);
    transform: translateX(-150%);
    transition: transform 0.6s ease;
}

.nav-btn:hover::before {
    transform: translateX(150%);
}

.nav-btn:hover:not(.active) {
    color: var(--text-high);
    background: hsla(0, 0%, 100%, 0.04);
}

/* Card grid */
.collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
}

/* === PREMIUM COLLECTION CARDS === */
.collection-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s var(--ease-spring);
    position: relative;
    backdrop-filter: blur(10px);
    will-change: transform;
    transform-style: preserve-3d;
}

.collection-card:hover {
    transform: translateY(-10px) scale(1.03) rotateX(3deg);
    border-color: var(--glass-border-hover);
    box-shadow: 
        0 25px 50px hsla(0, 0%, 0%, 0.7),
        0 0 30px var(--led-blue-dim);
}

.collection-card:active {
    transform: translateY(-5px) scale(0.99);
    transition-duration: 0.1s;
}

.card-image-wrap {
    position: relative;
    width: 100%;
    padding-top: 140%;
    background: black;
    overflow: hidden;
}

.card-image-wrap img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s var(--ease-spring);
}

.collection-card:hover .card-image-wrap img {
    transform: scale(1.12);
}

/* Holographic Shimmer Effect — animated diagonal sweep */
.collection-card .card-image-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(
        105deg,
        transparent 30%,
        hsla(0, 0%, 100%, 0.12) 45%,
        hsla(190, 100%, 50%, 0.15) 50%,
        hsla(50, 100%, 55%, 0.08) 55%,
        transparent 70%
    );
    background-size: 200% 200%;
    background-position: 150% 150%;
    transition: background-position 0.6s ease, opacity 0.4s;
    mix-blend-mode: overlay;
    z-index: 3;
    opacity: 0;
}

.collection-card:hover .card-image-wrap::after {
    background-position: -50% -50%;
    opacity: 1;
}

/* Holo shine additional effect for rare cards */
.collection-card.holo-shine::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        transparent 30%,
        hsla(0, 0%, 100%, 0.08) 45%,
        hsla(190, 100%, 50%, 0.15) 50%,
        hsla(50, 100%, 55%, 0.08) 55%,
        transparent 70%
    );
    z-index: 5;
    background-size: 200% 200%;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.collection-card:hover.holo-shine::after {
    opacity: 1;
    animation: holo-shimmer 3s linear infinite;
}

@keyframes holo-shimmer {
    0% { background-position: -100% -100%; }
    100% { background-position: 100% 100%; }
}

/* === GLASS MODALS === */
.modal-overlay {
    background: hsla(230, 40%, 3%, 0.8);
    backdrop-filter: blur(15px);
    z-index: 1000;
}

.glass-modal {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: 
        0 40px 100px hsla(0, 0%, 0%, 0.7),
        inset 0 0 30px hsla(0, 0%, 100%, 0.02);
    padding: 0;
    overflow: hidden;
    backdrop-filter: var(--panel-blur);
}

.modal-header {
    background: hsla(0, 0%, 100%, 0.03);
    padding: 20px 30px;
    border-bottom: 1px solid var(--glass-border);
}

.modal-header h2, .modal-header h3 {
    font-size: 1rem;
    color: var(--led-blue);
    text-shadow: 0 0 10px hsla(190, 100%, 50%, 0.3);
}

.modal-body {
    padding: 30px;
}

.stat-box {
    background: hsla(0, 0%, 0%, 0.3);
    border-radius: 12px;
    padding: 15px;
    border: 1px solid var(--glass-border);
}

.stat-box.accent {
    border-color: var(--led-blue);
    background: hsla(190, 100%, 50%, 0.05);
}

.stat-label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--led-blue);
    opacity: 0.6;
    margin-bottom: 5px;
    display: block;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: #fff;
}

/* === STATS VIEW === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: all 0.35s var(--ease-spring);
    box-shadow: var(--panel-shadow);
    position: relative;
    overflow: hidden;
    backdrop-filter: var(--panel-blur);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--led-blue), var(--accent-purple), var(--led-blue));
    background-size: 200% 100%;
    animation: gradient-shift 4s linear infinite;
    opacity: 0.6;
}

@keyframes gradient-shift {
    0% { background-position: 0% 0; }
    100% { background-position: 200% 0; }
}

.stat-card:hover {
    background: hsla(230, 25%, 10%, 0.9);
    border-color: var(--glass-border-hover);
    box-shadow: 
        0 15px 35px hsla(0, 0%, 0%, 0.5),
        0 0 15px var(--led-blue-dim);
    transform: translateY(-4px);
}

.stat-card .stat-label {
    font-family: var(--font-heading);
    font-size: 0.55rem;
    color: var(--text-low);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.stat-card .stat-value {
    font-family: var(--font-data);
    font-size: 2rem;
    color: var(--text-high);
    font-weight: 700;
    line-height: 1;
    text-shadow: 0 0 20px hsla(0, 0%, 100%, 0.1);
}

.stat-card .stat-sub {
    font-size: 0.75rem;
    color: var(--text-low);
}

/* Type distribution chart */
.type-chart {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.5rem;
}

.type-chart h3 {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.type-bar-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
}

.type-bar-label {
    font-size: 0.75rem;
    font-weight: 500;
    min-width: 70px;
}

.type-bar-track {
    flex: 1;
    height: 8px;
    background: var(--bg-surface);
    border-radius: 4px;
    overflow: hidden;
}

.type-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s ease;
}

.type-bar-count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-tertiary);
    min-width: 24px;
    text-align: right;
}

/* === CARD DETAIL MODAL === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modal-in 0.4s var(--ease-spring);
    backdrop-filter: var(--panel-blur);
    box-shadow: 0 40px 80px hsla(0, 0%, 0%, 0.8), 0 0 40px var(--led-blue-dim);
}

@keyframes modal-in {
    from { opacity: 0; transform: scale(0.95) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(237, 28, 36, 0.15);
    color: var(--poke-red);
    border-color: rgba(237, 28, 36, 0.3);
}

.modal-body {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 1.5rem;
    padding: 1.5rem;
}

.modal-image {
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #0a0a12;
}

.modal-image img {
    width: 100%;
    display: block;
}

.modal-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-subtle);
}

/* === TOAST NOTIFICATIONS === */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--glass);
    backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: var(--text-high);
    animation: toast-in 0.4s var(--ease-spring);
    min-width: 280px;
    box-shadow: 0 20px 40px hsla(0, 0%, 0%, 0.6), 0 0 20px var(--led-blue-dim);
}

.toast.success { border-left: 3px solid var(--poke-green); }
.toast.error { border-left: 3px solid var(--poke-red); }
.toast.info { border-left: 3px solid var(--poke-blue); }

.toast.removing {
    animation: toast-out 0.3s ease forwards;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
    to { opacity: 0; transform: translateX(30px); }
}

/* === LOADING SKELETON === */
.skeleton {
    background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-surface-hover) 50%, var(--bg-surface) 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .scanner-container {
        grid-template-columns: 1fr;
    }

    .results-panel {
        max-height: none;
    }

    .modal-body {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .top-bar {
        padding: 0.5rem 0.75rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .top-bar-nav {
        width: 100%;
        justify-content: center;
    }

    .nav-btn span:not(.nav-icon):not(.badge-count) {
        display: none;
    }

    .view {
        padding: 1rem;
    }

    .collection-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .collection-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 0.75rem;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .scanner-viewport {
        min-height: 350px;
    }
}

@media (max-width: 768px) {
    .scanner-container {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding-bottom: 80px; /* Space for bottom nav */
    }

    .scanner-viewport {
        min-height: 400px;
        height: 60vh;
        border-radius: var(--radius-sm);
    }

    .results-panel {
        max-height: none;
        overflow: visible;
        padding-bottom: 2rem;
    }

    .panel-card {
        padding: 1rem;
    }

    .top-bar-logo h1 {
        font-size: 0.8rem;
    }

    .view {
        padding: 1rem 1rem 80px;
    }
}

@media (max-width: 480px) {
    .collection-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .ctrl-btn.capture-btn {
        width: 72px;
        height: 72px;
    }
}

/* === SELECTION & SCROLLBAR === */
::selection {
    background: rgba(0, 183, 255, 0.3);
    color: #fff;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

/* === FILE INPUT HIDDEN === */
#file-input {
    display: none;
}

.duplicate-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--led-blue);
    color: #000;
    font-size: 0.6rem;
    font-weight: 900;
    padding: 2px 5px;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0, 238, 255, 0.4);
    z-index: 5;
    pointer-events: none;
    text-transform: uppercase;
    border: 1px solid rgba(0,0,0,0.2);
}

#similar-cards-container {
    margin-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    background: rgba(255,255,255,0.02);
}

#similar-cards-container.hidden {
    display: none !important;
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

#btn-show-help {
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

#btn-show-help:hover {
    color: var(--led-blue);
    text-shadow: 0 0 10px rgba(0, 238, 255, 0.4);
}

.help-modal {
    max-width: 450px;
}

.help-step {
    display: flex;
    gap: 1.2rem;
    margin-bottom: 2rem;
    align-items: flex-start;
}

.step-icon {
    font-size: 1.8rem;
    background: rgba(255,255,255,0.05);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: inset 0 0 10px rgba(255,255,255,0.05);
}

.step-text h4 {
    color: var(--led-blue);
    font-size: 0.8rem;
    letter-spacing: 1px;
    margin-bottom: 0.3rem;
}

.step-text p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.help-footer {
    margin-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 1.5rem;
}

@media (max-width: 600px) {
    .hide-mobile {
        display: none !important;
    }
    .top-bar-actions {
        gap: 0.8rem;
    }
}

.hidden {
    display: none !important;
}

/* === CINEMATIC HUD === */
.scanner-hud-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    opacity: 0.6;
    display: none; /* Only show when scanner active */
}

#scanner-viewport:has(#camera-feed.active) .scanner-hud-overlay,
#scanner-viewport:has(#preview-image.active) .scanner-hud-overlay {
    display: block;
}

.hud-corners .corner {
    position: absolute;
    width: 30px;
    height: 30px;
    border: 2px solid var(--led-blue);
}

.top-left { top: 20px; left: 20px; border-right: 0; border-bottom: 0; }
.top-right { top: 20px; right: 20px; border-left: 0; border-bottom: 0; }
.bottom-left { bottom: 20px; left: 20px; border-right: 0; border-top: 0; }
.bottom-right { bottom: 20px; right: 20px; border-left: 0; border-top: 0; }

.hud-diagnostics {
    position: absolute;
    top: 25px;
    right: 60px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    text-align: right;
    color: var(--led-blue);
    text-shadow: 0 0 5px rgba(0, 238, 255, 0.5);
    background: rgba(0,0,0,0.4);
    padding: 8px;
    border-radius: 4px;
    border: 1px solid rgba(0, 238, 255, 0.2);
}

.diag-item { margin-bottom: 4px; }
.diag-label { opacity: 0.5; margin-right: 5px; }

.pulse {
    animation: diag-pulse 2s infinite ease-in-out;
}

@keyframes diag-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.hud-center-cross {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    transform: translate(-50%, -50%);
    opacity: 0.4;
    transition: all 0.3s var(--ease-spring);
}

.hud-center-cross::before, .hud-center-cross::after {
    content: '';
    position: absolute;
    background: var(--led-blue);
    box-shadow: 0 0 10px var(--led-blue);
}

.hud-center-cross::before { width: 100%; height: 1px; top: 16px; }
.hud-center-cross::after { height: 100%; width: 1px; left: 16px; }

/* === PREMIUM CARD INTERACTIVITY === */
#collection-grid {
    perspective: 1000px;
}

.collection-card {
    will-change: transform;
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s ease;
    transform-style: preserve-3d;
}

.collection-card:hover {
    transform: translateY(-5px) rotateX(5deg) rotateY(5deg);
    box-shadow: 
        0 15px 30px rgba(0,238,255,0.1),
        0 0 20px rgba(0,0,0,0.6);
    border-color: var(--led-blue);
}

.collection-card:active {
    transform: scale(0.98);
}

/* === MODAL & DATA COMPONENTS === */
.modal-details-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
}

.modal-card-wrap {
    width: 100%;
    max-width: 260px;
    aspect-ratio: 63/88;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.7);
    border: 1px solid var(--glass-border);
    position: relative;
    background: #000;
}

.modal-card-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-box {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.stat-box .stat-label {
    font-family: var(--font-heading);
    font-size: 0.55rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-box .stat-value {
    font-family: var(--font-data);
    font-size: 1.1rem;
    color: #fff;
    font-weight: 600;
}

.stat-box.accent .stat-value {
    color: var(--led-blue);
    text-shadow: var(--glow-blue);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    width: 100%;
    margin-top: 1rem;
}

/* === SEARCH & GALLERY Polish === */
.search-box {
    position: relative;
    overflow: hidden;
}

.search-scanline {
    position: absolute;
    top: 0;
    left: -100%;
    width: 30%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 238, 255, 0.2), transparent);
    z-index: 1;
    pointer-events: none;
    animation: search-scan 4s infinite linear;
}

@keyframes search-scan {
    0% { left: -100%; }
    100% { left: 200%; }
}

@keyframes card-reveal {
    0% { opacity: 0; transform: translateY(20px) scale(0.95); filter: blur(10px); }
    100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

/* Card Reveal Animation Base */
.collection-card {
    opacity: 1; /* Ensure visible by default */
}

.collection-card.revealing {
    animation: card-reveal 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Modal Title Refinement */
.modal-header h2 {
    font-family: var(--font-heading) !important;
    letter-spacing: 3px !important;
    font-size: 1rem !important;
    color: var(--led-blue) !important;
    text-shadow: var(--glow-blue) !important;
}

/* === SCANNER LENS REFINE === */
.scanner-hud-overlay {
    pointer-events: none;
    transition: all 0.5s ease;
}

.scanner-view-container.scanning .scanner-hud-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, transparent 20%, rgba(255, 0, 0, 0.05) 40%, rgba(0, 0, 255, 0.05) 60%, transparent 80%);
    mix-blend-mode: color-dodge;
    filter: blur(2px);
    opacity: 0.6;
    animation: lens-flicker 0.2s infinite alternate;
    pointer-events: none;
    z-index: 2;
}

@keyframes lens-flicker {
    0% { opacity: 0.4; }
    100% { opacity: 0.7; transform: scale(1.005); }
}

/* === HOLOGRAPHIC RARITY EFFECTS === */
@keyframes foil-shimmer {
    0% { background-position: -200% 0%; }
    100% { background-position: 200% 0%; }
}

@keyframes glint-flare {
    0% { left: -50%; opacity: 0; }
    20% { opacity: 0.4; }
    40% { left: 150%; opacity: 0; }
    100% { left: 150%; opacity: 0; }
}

.holo-shine {
    position: relative;
    overflow: hidden;
}

.holo-shine::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        125deg,
        transparent 0%,
        rgba(255, 255, 255, 0.05) 30%,
        rgba(255, 0, 150, 0.1) 40%,
        rgba(0, 255, 255, 0.1) 50%,
        rgba(255, 255, 0, 0.1) 60%,
        rgba(255, 255, 255, 0.05) 70%,
        transparent 100%
    );
    background-size: 200% 100%;
    mix-blend-mode: color-dodge;
    animation: foil-shimmer 4s infinite linear;
    pointer-events: none;
}

.ultra-sparkle::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 20px;
    height: 200%;
    background: rgba(255, 255, 255, 0.4);
    filter: blur(10px);
    transform: rotate(25deg);
    animation: glint-flare 6s infinite ease-in-out;
    pointer-events: none;
    z-index: 2;
}

.secret-rare-glow {
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3), inset 0 0 20px rgba(255, 215, 0, 0.1) !important;
    border-color: rgba(255, 215, 0, 0.4) !important;
}

/* === MODAL HUD Polish === */
.modal-overlay {
    backdrop-filter: blur(12px) saturate(180%);
}

.modal-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(0, 238, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 238, 255, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: -1;
    pointer-events: none;
    opacity: 0.5;
}

.modal-card-wrap {
    position: relative;
    padding: 1rem;
    background: rgba(0,0,0,0.4);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
    display: flex;
    justify-content: center;
    align-items: center;
}

.calibration-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 140%;
    height: 140%;
    border: 1px dashed rgba(0, 238, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: rotate-ring 20s infinite linear;
    pointer-events: none;
}

@keyframes rotate-ring {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.ocr-marquee-container {
    width: 100%;
    background: rgba(0, 0, 20, 0.6);
    padding: 12px;
    margin: 1rem 0;
    border: 1px solid rgba(0, 238, 255, 0.15);
    border-radius: 8px;
}

.ocr-marquee {
    display: block;
    white-space: normal;
    font-family: var(--font-data);
    font-size: 0.75rem;
    color: var(--led-blue);
    line-height: 1.5;
    word-break: break-word;
}

/* === DEVICE IMMERSION === */
.crt-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.08) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.02), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.02));
    background-size: 100% 3px, 3px 100%;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.15;
    animation: screen-flicker 0.15s infinite alternate;
}

@keyframes screen-flicker {
    0% { opacity: 0.12; transform: translateY(0); }
    100% { opacity: 0.18; transform: translateY(1px); }
}

.bg-noise {
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.015;
    z-index: 9998;
    pointer-events: none;
}

.data-particles {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.data-particles .particle {
    position: absolute;
    font-family: var(--font-mono);
    font-size: 0.5rem;
    color: var(--led-blue);
    opacity: 0.08;
    animation: data-float 30s infinite ease-in-out;
}

@keyframes data-float {
    0% { transform: translateY(0) rotate(0deg); opacity: 0; }
    20% { opacity: 0.2; }
    80% { opacity: 0.2; }
    100% { transform: translateY(-800px) rotate(360deg); opacity: 0; }
}

/* Transmission Signal HUD */
.transmission-signal {
    width: 6px;
    height: 18px;
    background: rgba(0, 238, 255, 0.05);
    border-radius: 2px;
    border: 1px solid rgba(0, 238, 255, 0.1);
    position: relative;
    overflow: hidden;
    margin-right: 8px;
}

.transmission-signal.transmitting::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--led-blue);
    box-shadow: 0 0 10px var(--led-blue);
    animation: signal-pulse 0.4s infinite alternate;
}

@keyframes signal-pulse {
    0% { height: 20%; opacity: 0.4; }
    100% { height: 100%; opacity: 1; }
}

/* --- NEURAL TRACE ANIMATION (Edge Detection) --- */
.scanning-neural-trace {
    filter: invert(1) sepia(1) saturate(5) hue-rotate(150deg) brightness(1.2) contrast(1.5);
    animation: neuralPulse 1.5s infinite alternate ease-in-out;
    mix-blend-mode: screen;
}

@keyframes neuralPulse {
    0% { opacity: 0.3; filter: invert(1) hue-rotate(150deg) brightness(0.8); }
    100% { opacity: 1; filter: invert(1) hue-rotate(180deg) brightness(1.5); }
}


#preview-image {
    transition: filter 0.5s ease, opacity 0.5s ease;
}

/* === QR CODE POKEBALL OVERLAY === */
#auth-qrcode, #auth-qrcode-otp {
    position: relative !important;
    display: inline-block !important;
    background: white !important;
    padding: 12px !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4), 0 0 20px rgba(0, 238, 255, 0.1) !important;
    border: 1px solid rgba(255,255,255,0.1);
}

.qr-pokeball-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 28%;
    height: 28%;
    min-width: 34px;
    min-height: 34px;
    z-index: 10;
    pointer-events: none;
}

.qr-pokeball {
    position: relative;
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 50%;
    border: 2px solid #000;
    box-shadow: 0 0 10px rgba(255,255,255,1), 0 0 15px rgba(0,0,0,0.3);
    overflow: hidden;
}

.qr-pokeball::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(180deg, #ff0000 0%, #cc0000 100%);
    border-bottom: 2px solid #000;
}

.qr-pokeball::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 35%;
    height: 35%;
    background: white;
    border: 2px solid #000;
    border-radius: 50%;
    z-index: 11;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
}

.qr-pokeball-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 15%;
    height: 15%;
    background: white;
    border: 1px solid #666;
    border-radius: 50%;
    z-index: 12;
}

/* === TACTICAL UI OVERHAUL ENHANCEMENTS === */

/* Global Texture & Depth */
.bg-noise {
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.02;
    z-index: 9998;
    pointer-events: none;
}

.crt-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.15) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    background-size: 100% 3px, 3px 100%;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.2;
    animation: screen-flicker 0.15s infinite alternate;
}

@keyframes screen-flicker {
    0% { opacity: 0.15; transform: translateY(0); }
    100% { opacity: 0.25; transform: translateY(1px); }
}

/* Data Particles */
.data-particles .particle {
    position: fixed;
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: var(--led-blue);
    opacity: 0;
    z-index: -1;
    pointer-events: none;
    animation: particle-float 20s infinite linear;
}

@keyframes particle-float {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    20% { opacity: 0.15; }
    80% { opacity: 0.15; }
    100% { transform: translateY(-100px) rotate(360deg); opacity: 0; }
}

/* Scanner HUD tactical details */
.hud-scanline {
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 1px;
    background: rgba(0, 238, 255, 0.2);
    box-shadow: 0 0 10px rgba(0, 238, 255, 0.5);
    z-index: 5;
    animation: scanline-move 4s infinite ease-in-out;
}

@keyframes scanline-move {
    0%, 100% { transform: translateY(-100px); opacity: 0.2; }
    50% { transform: translateY(100px); opacity: 0.5; }
}

#shoutbox-container {
    background: hsla(30, 100%, 5%, 0.6) !important;
    border: 1px solid hsla(30, 100%, 50%, 0.2) !important;
    border-radius: 16px !important;
    backdrop-filter: var(--panel-blur);
    box-shadow: 0 20px 50px hsla(0, 0%, 0%, 0.6), 0 0 30px hsla(30, 100%, 50%, 0.05) !important;
}

#shout-feed {
    padding-right: 12px;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-orange) transparent;
}

.shout-message {
    background: hsla(30, 100%, 50%, 0.03);
    border: 1px solid hsla(30, 100%, 50%, 0.08);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 8px;
    transition: all 0.3s var(--ease-spring);
}

.shout-message:hover {
    background: hsla(30, 100%, 50%, 0.06);
    border-color: hsla(30, 100%, 50%, 0.2);
    transform: translateX(4px);
}

.hud-data-left, .hud-data-right {
    position: absolute;
    bottom: 20px;
    padding: 10px;
    background: rgba(0,0,0,0.6);
    border: 1px solid rgba(0, 238, 255, 0.1);
    border-radius: 4px;
    z-index: 10;
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: var(--led-blue);
    backdrop-filter: blur(4px);
}

.hud-data-left { left: 20px; text-align: left; }
.hud-data-right { right: 20px; text-align: right; }

.hud-readout {
    margin-bottom: 2px;
    opacity: 0.8;
}

/* Holographic Shimmer V2 */
.collection-card .card-image-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(
        105deg,
        transparent 30%,
        rgba(255, 255, 255, 0.1) 45%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.1) 55%,
        transparent 70%
    );
    background-size: 200% 200%;
    background-position: 150% 150%;
    transition: background-position 0.5s ease;
    mix-blend-mode: overlay;
    z-index: 3;
}

.collection-card:hover .card-image-wrap::after {
    background-position: -50% -50%;
}

/* === TACTICAL PANEL ACCENTS === */
.panel-card {
    position: relative;
    border: 1px solid var(--glass-border) !important;
    background: hsla(230, 25%, 6%, 0.8) !important;
    backdrop-filter: var(--panel-blur);
    border-radius: 14px;
    box-shadow: var(--panel-shadow);
    transition: all 0.35s var(--ease-spring);
}

.panel-card:hover {
    border-color: var(--glass-border-hover) !important;
    box-shadow: 0 15px 40px hsla(0, 0%, 0%, 0.6), 0 0 20px var(--led-blue-dim);
}

.panel-card::before, .panel-card::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border: 2px solid var(--led-blue);
    pointer-events: none;
    opacity: 0.4;
    transition: opacity 0.3s;
}

.panel-card:hover::before, .panel-card:hover::after {
    opacity: 0.7;
}

.panel-card::before {
    top: -2px;
    left: -2px;
    border-right: none;
    border-bottom: none;
    border-top-left-radius: 4px;
}

.panel-card::after {
    bottom: -2px;
    right: -2px;
    border-left: none;
    border-top: none;
    border-bottom-right-radius: 4px;
}

/* Premium Navigation Hover */
.nav-btn:hover::before {
    width: 90%;
    background: linear-gradient(90deg, transparent, rgba(0, 238, 255, 0.1), transparent);
}

/* === POKEAPI DEX & SEARCH UI === */
.header-search-wrap {
    position: relative;
    flex: 1;
    max-width: 180px;
}

.search-input-tactical {
    width: 100%;
    background: rgba(0, 238, 255, 0.05);
    border: 1px solid rgba(0, 238, 255, 0.2);
    border-radius: 6px;
    padding: 6px 10px 6px 28px;
    color: var(--led-blue);
    font-family: var(--font-data);
    font-size: 0.75rem;
    transition: all 0.3s ease;
    outline: none;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.3);
}

.search-input-tactical:focus {
    background: rgba(0, 238, 255, 0.1);
    border-color: var(--led-blue);
    box-shadow: 0 0 20px rgba(0, 238, 255, 0.1), inset 0 0 10px rgba(0,0,0,0.5);
}

.search-suggestions {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: rgba(10, 14, 25, 0.98);
    border: 1px solid var(--led-blue);
    border-radius: 8px;
    z-index: 5000;
    max-height: 250px;
    overflow-y: auto;
    box-shadow: 0 15px 40px rgba(0,0,0,1);
    backdrop-filter: blur(20px);
}

.suggestion-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-data);
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.suggestion-item:hover {
    background: rgba(0, 238, 255, 0.1);
    color: var(--led-blue);
    padding-left: 20px;
}

/* === DEX VIEW HOLOGRAPH === */
.dex-lookup-container {
    padding: 20px;
    min-height: 70vh;
}

.dex-search-hub {
    margin-bottom: 2rem;
    background: hsla(230, 25%, 5%, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    backdrop-filter: var(--panel-blur);
    transition: all 0.3s var(--ease-spring);
}

.dex-search-hub:focus-within {
    border-color: var(--glass-border-hover);
    box-shadow: 0 0 20px var(--led-blue-dim);
}

.dex-search-icon {
    font-size: 1.2rem;
    opacity: 0.7;
}

#global-dex-search {
    flex: 1;
    background: transparent !important;
    border: none !important;
    padding: 5px 0 !important;
    box-shadow: none !important;
    text-transform: uppercase;
    font-size: 0.9rem !important;
}

.dex-search-hub kbd {
    font-size: 0.6rem;
    opacity: 0.4;
    background: hsla(0, 0%, 100%, 0.05);
    padding: 3px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
}

.dex-empty-state {
    text-align: center;
    padding: 4rem 2rem !important;
    opacity: 0.6;
}

.dex-empty-icon {
    font-size: 3.5rem;
    display: block;
    margin-bottom: 1.5rem;
    filter: grayscale(1) opacity(0.5);
}
.dex-display-hologram {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    animation: hologram-flicker 6s infinite;
}

.dex-artwork-frame {
    flex: 0 0 300px;
    height: 360px;
    background: radial-gradient(circle, var(--led-blue-dim) 0%, transparent 65%);
    border: 1px solid hsla(190, 100%, 50%, 0.15);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 40px hsla(190, 100%, 50%, 0.05);
}

.dex-artwork-frame::before {
    content: '';
    position: absolute;
    inset: 15%;
    border: 1px dashed hsla(190, 100%, 50%, 0.2);
    border-radius: 50%;
    animation: rotate-ring 25s infinite linear;
    pointer-events: none;
}

.dex-artwork-frame img {
    max-width: 80%;
    max-height: 80%;
    filter: drop-shadow(0 0 40px var(--led-blue-glow));
    z-index: 2;
    transition: transform 0.5s var(--ease-spring);
}

.dex-artwork-frame:hover img {
    transform: scale(1.08);
}

.dex-info-panel {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.dex-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

.dex-stat-item {
    background: hsla(230, 25%, 8%, 0.6);
    border: 1px solid var(--glass-border);
    padding: 14px;
    border-radius: 12px;
    transition: all 0.3s var(--ease-spring);
}

.dex-stat-item:hover {
    border-color: var(--glass-border-hover);
    background: hsla(230, 25%, 10%, 0.7);
}

.stat-bar-fill {
    height: 7px;
    border-radius: 4px;
    margin-top: 6px;
    background: linear-gradient(90deg, var(--led-blue), var(--accent-purple));
    box-shadow: 0 0 12px var(--led-blue-glow);
    width: 0;
    transition: width 1.5s var(--ease-bounce);
}

.shoutbox-input-area {
    display: flex;
    gap: 12px;
    background: hsla(30, 100%, 50%, 0.04);
    padding: 12px;
    border-radius: 10px;
    margin-top: 10px;
    border: 1px solid hsla(30, 100%, 50%, 0.1);
}

#shout-input {
    flex: 1;
    background: transparent !important;
    border: 1px solid hsla(30, 100%, 50%, 0.2) !important;
    color: white !important;
    padding: 10px 15px !important;
    transition: all 0.3s ease !important;
}

#shout-input:focus {
    border-color: var(--accent-orange) !important;
    box-shadow: 0 0 15px hsla(30, 100%, 50%, 0.1) !important;
}

#btn-send-shout {
    background: var(--accent-orange) !important;
    color: black !important;
    font-weight: 800 !important;
    padding: 0 25px !important;
}

.dex-type-pill {
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 0.7rem;
    font-family: var(--font-heading);
    text-transform: uppercase;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.1);
}

@keyframes hologram-flicker {
    0%, 100% { opacity: 1; filter: brightness(1) contrast(1); }
    50% { opacity: 0.95; filter: brightness(1.1) contrast(1.05); }
    52% { opacity: 0.8; }
    54% { opacity: 1; }
}

/* PokeAPI DNA Analysis Styling */
.pokeapi-enhanced-view {
    background: rgba(0, 238, 255, 0.05);
    border: 1px solid rgba(0, 238, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    margin-top: 10px;
    position: relative;
    overflow: hidden;
}

.pokeapi-enhanced-view::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(0deg, transparent 50%, rgba(0, 238, 255, 0.03) 50%);
    background-size: 100% 4px;
    pointer-events: none;
}

.pokeapi-enhanced-view p {
    margin: 5px 0 12px;
    text-shadow: 0 0 5px rgba(255,255,255,0.1);
}

.pokeapi-enhanced-view .stat-item {
    background: rgba(0,0,0,0.3);
    padding: 5px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.05);
}

/* === POKEAPI ENHANCEMENTS === */
.rarity-badge {
    font-family: var(--font-heading);
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.6rem;
    position: relative;
    overflow: hidden;
    background: rgba(0,0,0,0.4);
    border: 1px solid currentColor;
}

.holographic {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0) 45%,
        rgba(255, 255, 255, 0.5) 50%,
        rgba(255, 255, 255, 0) 55%,
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 200% 200%;
    animation: holo-shimmer 3s infinite linear;
}

@keyframes holo-shimmer {
    0% { background-position: -100% -100%; }
    100% { background-position: 100% 100%; }
}

.dex-genus-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-top: -5px;
    margin-bottom: 10px;
    opacity: 0.8;
}

#dex-rarity-badge {
    margin-bottom: 15px;
}

.pokeapi-enhanced-view {
    position: relative;
    overflow: hidden;
}

.pokeapi-enhanced-view::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at 10% 10%, rgba(255,255,255,0.03) 0%, transparent 50%);
    pointer-events: none;
}

/* === ADVANCED AUTH & SYNC UI === */
.sync-badge {
    font-size: 0.5rem;
    padding: 3px 8px;
    background: rgba(0, 238, 255, 0.1);
    border: 1px solid var(--led-blue);
    color: var(--led-blue);
    border-radius: 4px;
    font-family: var(--font-mono);
    box-shadow: 0 0 10px rgba(0, 238, 255, 0.2);
    animation: pulseGlow 2s infinite ease-in-out;
}

.recent-searches-grid .recent-item {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 8px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: hidden;
}

.recent-searches-grid .recent-item:hover {
    background: rgba(0, 238, 255, 0.05);
    border-color: var(--led-blue);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.recent-searches-grid .recent-item img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 5px;
    filter: brightness(0.8);
    transition: filter 0.3s ease;
}

.recent-searches-grid .recent-item:hover img {
    filter: brightness(1.1);
}

.recent-searches-grid .recent-item span {
    font-size: 0.5rem;
    color: var(--text-secondary);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: var(--font-mono);
}

/* Auth Revamp: QR Link & Multi-Key */
.auth-instruction {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    margin-bottom: 1.5rem;
    line-height: 1.4;
    border-left: 2px solid var(--led-blue);
    padding-left: 10px;
}

.auth-qr-wrap {
    background: white;
    padding: 10px;
    border-radius: 8px;
    display: inline-block;
    margin: 10px 0;
}

.key-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 0.7rem;
}

.key-list-item .key-icon { margin-right: 10px; opacity: 0.6; }
.key-list-item .key-name { flex: 1; text-align: left; }
.key-list-item .btn-remove-key { opacity: 0.4; transition: opacity 0.2s; }
.key-list-item .btn-remove-key:hover { opacity: 1; color: var(--led-red); }

@keyframes pulseGlow {
    0%, 100% { opacity: 0.8; box-shadow: 0 0 5px var(--led-blue); }
    50% { opacity: 1; box-shadow: 0 0 15px var(--led-blue); }
}

/* === USER AVATAR SYSTEM === */
.user-profile-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-right: 10px;
}

.avatar-frame {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid var(--led-blue);
    position: relative;
    cursor: pointer;
    overflow: hidden;
    background: rgba(0,0,0,0.4);
    box-shadow: 0 0 10px var(--accent-blue-dim);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-frame:hover {
    box-shadow: 0 0 15px var(--led-blue);
    transform: scale(1.05);
}

#user-avatar {
    width: 110%;
    height: 110%;
    object-fit: contain;
    filter: drop-shadow(0 0 5px var(--led-blue));
}

.avatar-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-size: 0.5rem;
    font-family: var(--font-heading);
    color: var(--led-blue);
    pointer-events: none;
}

.avatar-frame:hover .avatar-overlay {
    opacity: 1;
}

/* === OFFLINE BACKEND WARNING === */
#offline-backend-warning {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    background: rgba(10, 14, 25, 0.95);
    border: 2px solid var(--accent-red);
    border-radius: 16px;
    padding: 20px;
    z-index: 9999;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8), 0 0 20px var(--accent-red-dim);
    backdrop-filter: blur(15px);
    animation: slide-up 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slide-up {
    from { transform: translateY(100px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.warning-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
}

.warning-content i {
    font-size: 2rem;
    color: var(--accent-red);
    margin-bottom: 5px;
    text-shadow: 0 0 15px var(--accent-red-dim);
}

.warning-content h3 {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    color: var(--accent-red);
    margin: 0;
}

.warning-content p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 0;
}

.warning-content .btn {
    margin-top: 10px;
    width: 100%;
}

.warning-close {
    position: absolute;
    top: 10px;
    right: 12px;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 0.8rem;
    transition: color 0.3s;
}

.warning-close:hover {
    color: var(--text-primary);
}

/* === ADVANCED HUD ELEMENTS === */
.logo-energy-ring {
    position: absolute;
    width: 200px;
    height: 200px;
    border: 1px solid var(--led-blue-dim);
    border-radius: 50%;
    top: -80px;
    left: -50px;
    pointer-events: none;
    z-index: -1;
    animation: rotate 20s linear infinite;
}

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

.hud-center-reticle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reticle-inner {
    width: 60px;
    height: 60px;
    border: 2px dashed var(--led-blue);
    border-radius: 50%;
    opacity: 0.6;
    animation: pulse-reticle 2s infinite ease-in-out;
}

.reticle-outer {
    position: absolute;
    width: 100px;
    height: 100px;
    border: 1px solid var(--led-blue-dim);
    border-radius: 50%;
}

@keyframes pulse-reticle {
    0%, 100% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.hud-bottom-status {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    background: hsla(230, 40%, 4%, 0.6);
    padding: 6px 15px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--glass-blur);
    overflow: hidden;
}

.status-ticker {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: var(--led-blue);
    white-space: nowrap;
    animation: ticker 30s linear infinite;
    letter-spacing: 2px;
}

@keyframes ticker {
    from { transform: translateX(100%); }
    to { transform: translateX(-100%); }
}

.hud-vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 40%, rgba(0,0,0,0.4) 100%);
    pointer-events: none;
}

.hud-interference {
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(0deg, hsla(0, 0%, 100%, 0.03) 0px, hsla(0, 0%, 100%, 0.03) 1px, transparent 1px, transparent 2px);
    background-size: 100% 2px;
    pointer-events: none;
    opacity: 0.3;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: var(--radius-pill);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--led-blue-dim);
}
