/* =============================================
   K4-T13 SCAN INTERFACE // dex.beyond
   Neo-Tokyo 2067 // Cyan-Dunkelblau-Schwarz
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Orbitron:wght@400;700;900&display=swap');

:root {
    --bg:         #020810;
    --bg2:        #050f1a;
    --bg3:        #0a1628;
    --cyan:       #00e5ff;
    --cyan-dim:   #0099bb;
    --cyan-glow:  rgba(0, 229, 255, 0.15);
    --blue:       #1a3a5c;
    --blue-light: #2a5a8c;
    --purple:     #8b5cf6;
    --purple-dim: #6d44c4;
    --orange:     #ff6b35;
    --yellow:     #ffd700;
    --white:      #c8d8e8;
    --gray:       #4a6070;
    --red:        #ff3355;
    --green:      #00ff88;

    --font-mono:  'Share Tech Mono', monospace;
    --font-head:  'Orbitron', monospace;

    --glow-cyan:  0 0 8px rgba(0,229,255,0.6), 0 0 20px rgba(0,229,255,0.2);
    --glow-purple: 0 0 8px rgba(139,92,246,0.6);
}

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

html, body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--white);
    font-family: var(--font-mono);
    overflow-x: hidden;
}

/* --- Atmosphere --- */
.scanlines {
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0,0,0,0.15) 2px,
        rgba(0,0,0,0.15) 4px
    );
    pointer-events: none;
    z-index: 1000;
}

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

/* --- Layout --- */
.container {
    max-width: 860px;
    margin: 0 auto;
    padding: 24px 20px 60px;
    position: relative;
    z-index: 1;
}

/* --- Header --- */
header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 20px 0 24px;
    border-bottom: 1px solid var(--blue);
    margin-bottom: 24px;
}

.header-left  { font-size: 11px; color: var(--gray); }
.header-right { font-size: 11px; color: var(--gray); text-align: right; }

.sys-label { color: var(--cyan-dim); margin-right: 4px; }
.sys-path  { color: var(--gray); }

.header-center { text-align: center; }

h1 {
    font-family: var(--font-head);
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--cyan);
    text-shadow: var(--glow-cyan);
    letter-spacing: 0.15em;
    line-height: 1;
}

.subtitle {
    font-size: 10px;
    color: var(--gray);
    letter-spacing: 0.2em;
    margin-top: 6px;
}

.blink {
    animation: blink 1s step-end infinite;
    color: var(--cyan);
}
@keyframes blink { 50% { opacity: 0; } }

/* --- Katie Bar --- */
.katie-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg2);
    border: 1px solid var(--blue);
    border-left: 3px solid var(--purple);
    padding: 12px 16px;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}

.katie-bar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(139,92,246,0.05) 0%, transparent 60%);
    pointer-events: none;
}

.katie-avatar {
    width: 40px;
    height: 40px;
    border: 1px solid var(--purple);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-head);
    font-size: 10px;
    color: var(--purple);
    flex-shrink: 0;
    box-shadow: var(--glow-purple);
}

.katie-text { flex: 1; }

.katie-name {
    display: block;
    font-family: var(--font-head);
    font-size: 11px;
    color: var(--purple);
    margin-bottom: 4px;
    letter-spacing: 0.1em;
}

.katie-msg {
    display: block;
    font-size: 13px;
    color: var(--white);
    transition: opacity 0.3s;
}

.katie-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    color: var(--green);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 4px var(--green); }
    50%       { opacity: 0.4; box-shadow: none; }
}

/* --- Scan Input --- */
.scan-section {
    margin-bottom: 28px;
}

.scan-label {
    font-size: 11px;
    color: var(--cyan-dim);
    letter-spacing: 0.15em;
    margin-bottom: 10px;
}

.scan-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg2);
    border: 1px solid var(--blue-light);
    padding: 12px 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.scan-input-wrap:focus-within {
    border-color: var(--cyan);
    box-shadow: 0 0 0 1px var(--cyan), var(--glow-cyan);
}

.scan-arrow {
    color: var(--cyan);
    font-size: 18px;
    flex-shrink: 0;
}

#eanInput {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--font-mono);
    font-size: 20px;
    color: var(--white);
    letter-spacing: 0.2em;
    caret-color: var(--cyan);
}

#eanInput::placeholder { color: var(--gray); font-size: 14px; letter-spacing: 0.05em; }

.scan-counter {
    font-size: 12px;
    color: var(--gray);
    flex-shrink: 0;
}

.scan-hint {
    font-size: 11px;
    color: var(--gray);
    margin-top: 8px;
    letter-spacing: 0.05em;
}

/* --- Result Section --- */
.result-section {
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.result-tag {
    font-family: var(--font-head);
    font-size: 10px;
    letter-spacing: 0.2em;
    color: var(--bg);
    background: var(--cyan);
    padding: 3px 10px;
}

.result-ean {
    font-size: 12px;
    color: var(--gray);
    letter-spacing: 0.15em;
}

/* --- Item Card --- */
.item-card {
    background: var(--bg2);
    border: 1px solid var(--blue-light);
    border-top: 2px solid var(--cyan);
    padding: 20px 24px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}

.item-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 40px;
    background: linear-gradient(180deg, var(--cyan-glow) 0%, transparent 100%);
    pointer-events: none;
}

.item-name {
    font-family: var(--font-head);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--cyan);
    text-shadow: var(--glow-cyan);
    margin-bottom: 20px;
    letter-spacing: 0.1em;
}

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

.meta-block { display: flex; flex-direction: column; gap: 4px; }

.meta-label {
    font-size: 10px;
    color: var(--gray);
    letter-spacing: 0.15em;
}

.meta-value {
    font-size: 14px;
    color: var(--white);
}

.highlight-value {
    font-family: var(--font-head);
    font-size: 18px;
    color: var(--cyan);
    text-shadow: var(--glow-cyan);
}

/* Typ-Farben */
.type-NETRUNNER  { color: #00e5ff; }
.type-HARDWARE   { color: #ffd700; }
.type-BIOWARE    { color: #00ff88; }
.type-WEAPON     { color: #ff3355; }
.type-CONSUMABLE { color: #ff6b35; }

/* Rarität-Farben */
.rarity-COMMON    { color: #4a6070; }
.rarity-UNCOMMON  { color: #00ff88; }
.rarity-RARE      { color: #00e5ff; }
.rarity-EPIC      { color: #8b5cf6; text-shadow: var(--glow-purple); }
.rarity-LEGENDARY { color: #ffd700; text-shadow: 0 0 10px rgba(255,215,0,0.5); }

/* --- Breakdown --- */
.breakdown {
    background: var(--bg2);
    border: 1px solid var(--blue);
    padding: 16px 20px;
}

.breakdown-label {
    font-size: 10px;
    color: var(--cyan-dim);
    letter-spacing: 0.15em;
    margin-bottom: 16px;
}

.breakdown-grid {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.bd-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 60px;
}

.bd-value {
    font-size: 20px;
    letter-spacing: 0.15em;
    font-weight: bold;
}

.bd-label {
    font-size: 9px;
    color: var(--gray);
    letter-spacing: 0.15em;
}

.bd-sub {
    font-size: 9px;
    color: var(--gray);
    opacity: 0.6;
}

.bd-sep {
    color: var(--blue-light);
    font-size: 14px;
    padding-bottom: 16px;
}

.cyan   { color: var(--cyan); text-shadow: var(--glow-cyan); }
.orange { color: var(--orange); }
.purple { color: var(--purple); text-shadow: var(--glow-purple); }
.white  { color: var(--white); }
.yellow { color: var(--yellow); }
.gray   { color: var(--gray); }

/* --- Error --- */
.error-section {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 51, 85, 0.08);
    border: 1px solid var(--red);
    padding: 14px 18px;
    color: var(--red);
    font-size: 14px;
    animation: fadeIn 0.3s ease;
}

.error-icon { font-size: 18px; }

/* --- Footer --- */
footer {
    display: flex;
    justify-content: space-between;
    margin-top: 48px;
    padding-top: 16px;
    border-top: 1px solid var(--blue);
    font-size: 10px;
    color: var(--gray);
    letter-spacing: 0.1em;
}

/* --- Responsive --- */
@media (max-width: 600px) {
    h1 { font-size: 1.5rem; }
    .item-name { font-size: 1.3rem; }
    .breakdown-grid { gap: 6px; }
    .bd-value { font-size: 15px; }
    header { grid-template-columns: 1fr; gap: 8px; text-align: center; }
    .header-left, .header-right { text-align: center; }
    footer { flex-direction: column; gap: 6px; align-items: center; }
}

/* =============================================
   STAT BLOCKS
   ============================================= */

.stats-outer {
    margin-bottom: 16px;
}

.stats-block {
    background: var(--bg2);
    border: 1px solid var(--blue);
    border-left: 3px solid var(--cyan);
    padding: 16px 20px;
}

/* --- Netrunner Stat Bars --- */
.netrunner-stats { border-left-color: var(--cyan); }

.stat-row {
    display: grid;
    grid-template-columns: 52px 1fr 36px;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.stat-row:last-child { margin-bottom: 0; }

.stat-name {
    font-family: var(--font-head);
    font-size: 10px;
    color: var(--gray);
    letter-spacing: 0.1em;
}

.stat-bar-wrap {
    height: 8px;
    background: var(--bg3);
    border: 1px solid var(--blue);
    overflow: hidden;
}

.stat-bar {
    height: 100%;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.bar-good { background: var(--cyan); box-shadow: 0 0 6px rgba(0,229,255,0.4); }
.bar-low  { background: var(--blue-light); }

.stat-val {
    font-size: 13px;
    color: var(--white);
    text-align: right;
}

/* --- Hardware Buff --- */
.buff-single {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.buff-stat {
    font-family: var(--font-head);
    font-size: 1.1rem;
    color: var(--yellow);
    letter-spacing: 0.1em;
}

.buff-arrow {
    font-size: 1.4rem;
    color: var(--cyan);
}

.buff-value {
    font-family: var(--font-head);
    font-size: 2rem;
    color: var(--cyan);
    text-shadow: var(--glow-cyan);
}

.buff-label {
    font-size: 10px;
    color: var(--gray);
    letter-spacing: 0.15em;
}

/* --- Bioware Dual Buff --- */
.bioware-note { border-left-color: var(--green); }

.buff-dual { display: flex; gap: 32px; margin-bottom: 10px; }

.buff-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.bio-note {
    font-size: 10px;
    color: var(--gray);
    letter-spacing: 0.1em;
    font-style: italic;
}

/* --- Weapon --- */
.weapon-stats { border-left-color: var(--red); }

.weapon-subtype {
    font-family: var(--font-head);
    font-size: 11px;
    letter-spacing: 0.2em;
    padding: 2px 10px;
    display: inline-block;
    margin-bottom: 12px;
}

.subtype-RANGE {
    background: rgba(0,229,255,0.1);
    border: 1px solid var(--cyan);
    color: var(--cyan);
}

.subtype-MELEE {
    background: rgba(255,51,85,0.1);
    border: 1px solid var(--red);
    color: var(--red);
}

.weapon-bonus {
    font-size: 11px;
    color: var(--gray);
    margin-top: 8px;
    letter-spacing: 0.05em;
}

/* --- Consumable Effects --- */
.consumable-stats { border-left-color: var(--orange); }

.effect-row {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--blue);
}
.effect-row:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.effect-label {
    font-family: var(--font-head);
    font-size: 10px;
    color: var(--orange);
    letter-spacing: 0.1em;
    min-width: 130px;
    flex-shrink: 0;
}

.effect-desc {
    font-size: 14px;
    color: var(--white);
}

/* =============================================
   KATIE PANEL — fixed bottom right
   ============================================= */

.katie-panel {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    align-items: flex-end;
    gap: 12px;
    z-index: 500;
    pointer-events: none;
}

/* Sprechblase */
.katie-bubble {
    background: var(--bg2);
    border: 1px solid var(--purple);
    border-radius: 8px 8px 0 8px;
    padding: 10px 14px;
    max-width: 260px;
    min-width: 160px;
    position: relative;
    box-shadow: 0 0 12px rgba(139,92,246,0.15);
    transition: opacity 0.3s;
}

/* Pfeil-Dreieck rechts unten */
.katie-bubble::after {
    content: '';
    position: absolute;
    bottom: -1px;
    right: -10px;
    width: 0;
    height: 0;
    border-left: 10px solid var(--purple);
    border-bottom: 10px solid transparent;
}

.katie-bubble-name {
    display: block;
    font-family: var(--font-head);
    font-size: 9px;
    color: var(--purple);
    letter-spacing: 0.15em;
    margin-bottom: 5px;
}

.katie-bubble span:last-child {
    font-size: 12px;
    color: var(--white);
    line-height: 1.5;
    font-family: var(--font-mono);
}

/* Avatar-Kreis */
.katie-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 2px solid var(--purple);
    box-shadow: 0 0 14px rgba(139,92,246,0.4), 0 0 30px rgba(139,92,246,0.1);
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
    background: var(--bg2);
    transition: border-color 0.4s, box-shadow 0.4s;
}

.katie-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: opacity 0.3s;
}

.katie-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-head);
    font-size: 14px;
    color: var(--purple);
}

.katie-status-dot {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--green);
    border: 2px solid var(--bg2);
    animation: pulse 2s ease-in-out infinite;
}

/* Rarität beeinflusst Kreis-Farbe */
.katie-circle.rarity-LEGENDARY {
    border-color: var(--yellow);
    box-shadow: 0 0 20px rgba(255,215,0,0.5);
}
.katie-circle.rarity-EPIC {
    border-color: var(--purple);
    box-shadow: 0 0 20px rgba(139,92,246,0.6);
}
.katie-circle.rarity-RARE {
    border-color: var(--cyan);
    box-shadow: 0 0 16px rgba(0,229,255,0.4);
}

/* Text-Wechsel Animation */
@keyframes bubblePop {
    0%   { opacity: 0; transform: translateY(4px); }
    100% { opacity: 1; transform: translateY(0); }
}

.katie-bubble.updated {
    animation: bubblePop 0.3s ease forwards;
}

/* =============================================
   KAMERA SCANNER
   ============================================= */

.cam-btn {
    margin-top: 12px;
    background: transparent;
    border: 1px solid var(--blue-light);
    color: var(--cyan-dim);
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.15em;
    padding: 8px 18px;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, box-shadow 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.cam-btn:hover {
    border-color: var(--cyan);
    color: var(--cyan);
    box-shadow: var(--glow-cyan);
}

.cam-icon { font-size: 16px; }

/* Overlay */
.cam-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 8, 16, 0.95);
    z-index: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cam-inner {
    width: 100%;
    max-width: 500px;
    border: 1px solid var(--cyan);
    box-shadow: var(--glow-cyan);
    background: var(--bg2);
}

.cam-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--blue);
}

.cam-title {
    font-size: 11px;
    color: var(--cyan);
    letter-spacing: 0.15em;
}

.cam-close {
    background: transparent;
    border: 1px solid var(--gray);
    color: var(--gray);
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 4px 10px;
    cursor: pointer;
    letter-spacing: 0.1em;
    transition: border-color 0.2s, color 0.2s;
}

.cam-close:hover {
    border-color: var(--red);
    color: var(--red);
}

.cam-viewport {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    background: #000;
    overflow: hidden;
}

#camVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cam-reticle {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    pointer-events: none;
}

.reticle-line {
    width: 80%;
    height: 2px;
    background: var(--cyan);
    box-shadow: var(--glow-cyan);
    animation: reticlePulse 1.5s ease-in-out infinite;
}

@keyframes reticlePulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.3; }
}

.reticle-label {
    font-size: 11px;
    color: var(--cyan);
    letter-spacing: 0.1em;
    text-shadow: 0 0 8px rgba(0,229,255,0.8);
}

.cam-status {
    padding: 10px 16px;
    font-size: 12px;
    color: var(--gray);
    border-top: 1px solid var(--blue);
    letter-spacing: 0.05em;
    min-height: 38px;
}

.cam-status.success {
    color: var(--green);
}

.cam-status.error {
    color: var(--red);
}

/* =============================================
   KATIE MOBILE — kleiner und relativ
   ============================================= */
@media (max-width: 600px) {
    .katie-panel {
        position: relative;
        bottom: auto;
        right: auto;
        margin: 20px 0 0 0;
        justify-content: flex-end;
        padding: 0 4px;
    }

    .katie-circle {
        width: 72px;
        height: 72px;
    }

    .katie-bubble {
        max-width: 200px;
        min-width: 120px;
        padding: 8px 10px;
        font-size: 11px;
    }

    .katie-bubble span:last-child {
        font-size: 11px;
    }
}

/* =============================================
   LANGUAGE SWITCHER
   ============================================= */

.lang-switcher {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 6px;
}

.lang-btn {
    background: transparent;
    border: 1px solid var(--blue);
    color: var(--gray);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.15em;
    padding: 2px 8px;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.lang-btn:hover {
    border-color: var(--cyan-dim);
    color: var(--white);
}

.lang-btn.active {
    border-color: var(--cyan);
    color: var(--cyan);
    box-shadow: 0 0 6px rgba(0,229,255,0.2);
}

.lang-sep {
    color: var(--blue);
    font-size: 11px;
}

/* =============================================
   HEADER LOGO
   ============================================= */

.header-logo {
    max-width: 100%;
    width: 800px;
    height: auto;
    display: block;
    margin: 0 auto;
    filter:
        brightness(0) invert(1)
        sepia(1)
        saturate(10)
        hue-rotate(160deg)
        brightness(1.2)
        drop-shadow(0 0 8px rgba(0, 229, 255, 0.8))
        drop-shadow(0 0 22px rgba(0, 229, 255, 0.35));
    transition: filter 0.4s;
}

.header-logo:hover {
    filter:
        brightness(0) invert(1)
        sepia(1)
        saturate(12)
        hue-rotate(160deg)
        brightness(1.4)
        drop-shadow(0 0 12px rgba(0, 229, 255, 1))
        drop-shadow(0 0 30px rgba(0, 229, 255, 0.5));
}

@media (max-width: 600px) {
    .header-logo {
        width: 100%;
    }
}

/* =============================================
   NETRUNNER CLASS BADGE
   ============================================= */

.netrunner-class-badge {
    display: inline-block;
    font-family: var(--font-head);
    font-size: 10px;
    letter-spacing: 0.2em;
    padding: 3px 12px;
    margin-bottom: 14px;
    border: 1px solid;
}

.class-ENFORCER   { color: #ff3355; border-color: #ff3355; background: rgba(255,51,85,0.08); }
.class-HACKER     { color: #00e5ff; border-color: #00e5ff; background: rgba(0,229,255,0.08); }
.class-SNIPER     { color: #ffd700; border-color: #ffd700; background: rgba(255,215,0,0.08); }
.class-BUREAUCRAT { color: #8b5cf6; border-color: #8b5cf6; background: rgba(139,92,246,0.08); }
.class-RIPPERDOC  { color: #00ff88; border-color: #00ff88; background: rgba(0,255,136,0.08); }
