:root {
            --bg: #06060f;
            --card-bg: rgba(16, 16, 36, 0.85);
            --accent-cyan: #00e5ff;
            --accent-green: #00ff88;
            --text: #e0e0f0;
            --text-dim: #7a7a9e;
            --border: rgba(0, 229, 255, 0.18);
            --input-bg: rgba(8, 8, 26, 0.9);
            --binary-color: #00ff88;
            --chip-bg: rgba(0, 255, 136, 0.07);
            --chip-border: rgba(0, 255, 136, 0.22);
            --glow-cyan: 0 0 30px rgba(0, 229, 255, 0.25);
            --glow-green: 0 0 24px rgba(0, 255, 136, 0.3);
            --radius: 16px;
            --radius-sm: 10px;
            --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
            --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', 'Monaco', monospace;
            --font-sans: 'Inter', 'Segoe UI', 'Poppins', system-ui, -apple-system, sans-serif;
        }

        /* ========== Reset & Base ========== */
        *,
        *::before,
        *::after {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        html {
            scroll-behavior: smooth;
            -webkit-text-size-adjust: 100%;
        }

        body {
            font-family: var(--font-sans);
            background-color: var(--bg);
            color: var(--text);
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
            background-image:
                radial-gradient(circle, rgba(0, 229, 255, 0.06) 1px, transparent 1px),
                radial-gradient(circle, rgba(0, 255, 136, 0.04) 1px, transparent 1px);
            background-size: 36px 36px, 48px 48px;
            background-position: 0 0, 18px 18px;
            position: relative;
            overflow-x: hidden;
        }

        body::before {
            content: '';
            position: fixed;
            top: -40%;
            left: -20%;
            width: 80%;
            height: 80%;
            background: radial-gradient(ellipse, rgba(0, 229, 255, 0.06) 0%, transparent 70%);
            pointer-events: none;
            z-index: 0;
        }
        body::after {
            content: '';
            position: fixed;
            bottom: -30%;
            right: -15%;
            width: 70%;
            height: 70%;
            background: radial-gradient(ellipse, rgba(0, 255, 136, 0.05) 0%, transparent 70%);
            pointer-events: none;
            z-index: 0;
        }

        /* ========== SVG Icons ========== */
        .svg-icon {
            display: inline-block;
            width: 1em;
            height: 1em;
            vertical-align: -0.15em;
            fill: none;
            stroke: currentColor;
            stroke-width: 2;
            stroke-linecap: round;
            stroke-linejoin: round;
            flex-shrink: 0;
        }
        .icon-keyboard {
            width: 1.3em;
            height: 1.3em;
            animation: float 3s ease-in-out infinite;
            filter: drop-shadow(0 0 14px rgba(0, 229, 255, 0.5));
            stroke: var(--accent-cyan);
            color: var(--accent-cyan);
        }
        @keyframes float {
            0%,
            100% {
                transform: translateY(0);
            }
            50% {
                transform: translateY(-10px);
            }
        }
        .icon-dot {
            width: 10px;
            height: 10px;
            fill: var(--accent-green);
            stroke: none;
            animation: pulse-dot 1.6s ease-in-out infinite;
            filter: drop-shadow(0 0 6px var(--accent-green));
        }
        @keyframes pulse-dot {
            0%,
            100% {
                filter: drop-shadow(0 0 4px var(--accent-green));
            }
            50% {
                filter: drop-shadow(0 0 12px var(--accent-green)) drop-shadow(0 0 20px rgba(0, 255, 136, 0.6));
            }
        }
        .icon-arrow {
            width: 0.9em;
            height: 0.9em;
            stroke: var(--accent-cyan);
            color: var(--accent-cyan);
        }
        .icon-copy {
            width: 1.1em;
            height: 1.1em;
            stroke: currentColor;
            color: inherit;
        }
        .icon-check {
            width: 1.1em;
            height: 1.1em;
            stroke: var(--accent-green);
            color: var(--accent-green);
        }

        /* ========== Main Container ========== */
        .main-container {
            position: relative;
            z-index: 1;
            width: 100%;
            max-width: 680px;
            display: flex;
            flex-direction: column;
            gap: 24px;
        }

        /* ========== Card ========== */
        .card {
            background: var(--card-bg);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 28px 24px;
            box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5), var(--glow-cyan);
            transition: var(--transition);
        }

        /* ========== Header ========== */
        .header {
            text-align: center;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
        }
        .header h1 {
            font-size: clamp(1.3rem, 3.5vw, 1.75rem);
            font-weight: 700;
            letter-spacing: -0.02em;
            background: linear-gradient(135deg, #e0e0f0 0%, #00e5ff 50%, #00ff88 100%);
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
            line-height: 1.3;
        }
        .header .subtitle {
            font-size: 0.875rem;
            color: var(--text-dim);
            font-weight: 400;
            letter-spacing: 0.02em;
        }

        /* ========== Input Section ========== */
        .input-section {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        .input-label {
            font-size: 0.8rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: var(--accent-cyan);
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .input-wrapper {
            position: relative;
        }
        .input-wrapper input {
            width: 100%;
            padding: 14px 18px;
            font-size: 1.05rem;
            font-family: var(--font-sans);
            background: var(--input-bg);
            border: 2px solid var(--border);
            border-radius: var(--radius-sm);
            color: var(--text);
            outline: none;
            transition: var(--transition);
            letter-spacing: 0.03em;
            caret-color: var(--accent-green);
        }
        .input-wrapper input::placeholder {
            color: rgba(200, 200, 220, 0.35);
            letter-spacing: 0.02em;
        }
        .input-wrapper input:focus {
            border-color: var(--accent-cyan);
            box-shadow: 0 0 0 4px rgba(0, 229, 255, 0.08), 0 0 20px rgba(0, 229, 255, 0.12);
        }
        .input-wrapper .input-glow {
            position: absolute;
            inset: -2px;
            border-radius: var(--radius-sm);
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.4s ease;
            box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.15), 0 0 30px rgba(0, 229, 255, 0.2);
            z-index: -1;
        }
        .input-wrapper input:focus~.input-glow {
            opacity: 1;
        }

        /* ========== Stats Bar ========== */
        .stats-bar {
            display: flex;
            gap: 18px;
            flex-wrap: wrap;
            font-size: 0.8rem;
            color: var(--text-dim);
            padding: 2px 0;
            margin-top: 10px;
        }
        .stat-item {
            display: flex;
            align-items: center;
            gap: 6px;
            background: rgba(255, 255, 255, 0.03);
            padding: 6px 14px;
            border-radius: 20px;
            border: 1px solid rgba(255, 255, 255, 0.06);
            white-space: nowrap;
            transition: var(--transition);
        }
        .stat-value {
            font-weight: 700;
            color: var(--accent-green);
            font-family: var(--font-mono);
            font-size: 0.85rem;
        }
        .stat-icon {
            display: flex;
            align-items: center;
            opacity: 0.8;
        }

        /* ========== Output Section ========== */
        .output-section {
            display: flex;
            flex-direction: column;
            gap: 14px;
        }
        .output-label {
            font-size: 0.8rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: var(--accent-green);
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .binary-display-container {
            background: rgba(6, 6, 20, 0.8);
            border: 1px solid rgba(0, 255, 136, 0.2);
            border-radius: var(--radius-sm);
            padding: 18px 20px;
            min-height: 60px;
            display: flex;
            align-items: center;
            font-family: var(--font-mono);
            font-size: clamp(0.8rem, 2vw, 0.95rem);
            letter-spacing: 0.04em;
            word-break: break-all;
            overflow-wrap: anywhere;
            position: relative;
            box-shadow: inset 0 0 30px rgba(0, 255, 136, 0.03);
            transition: var(--transition);
            line-height: 1.7;
        }
        .binary-display-container.has-content {
            border-color: rgba(0, 255, 136, 0.4);
            box-shadow: inset 0 0 40px rgba(0, 255, 136, 0.05), var(--glow-green);
        }
        .binary-text {
            color: var(--binary-color);
            text-shadow: 0 0 8px rgba(0, 255, 136, 0.5);
            white-space: pre-wrap;
            word-break: break-all;
        }
        .binary-placeholder {
            color: rgba(120, 120, 160, 0.5);
            font-style: italic;
            font-family: var(--font-sans);
            font-size: 0.9rem;
            letter-spacing: 0.02em;
        }
        .cursor {
            display: inline;
            color: var(--accent-green);
            font-weight: 300;
            animation: blink-cursor 0.75s step-end infinite;
            text-shadow: 0 0 10px rgba(0, 255, 136, 0.7);
            user-select: none;
            font-family: var(--font-mono);
            font-size: inherit;
        }
        @keyframes blink-cursor {
            0%,
            100% {
                opacity: 1;
            }
            50% {
                opacity: 0;
            }
        }

        /* ========== Character Mapping Chips ========== */
        .char-mapping {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            min-height: 0;
        }
        .char-chip {
            display: inline-flex;
            align-items: center;
            gap: 7px;
            background: var(--chip-bg);
            border: 1px solid var(--chip-border);
            border-radius: 22px;
            padding: 7px 14px 7px 9px;
            font-size: 0.8rem;
            font-family: var(--font-mono);
            animation: chipIn 0.35s ease forwards;
            opacity: 0;
            transform: translateY(8px);
            transition: var(--transition);
            white-space: nowrap;
        }
        .char-chip:hover {
            background: rgba(0, 255, 136, 0.14);
            border-color: rgba(0, 255, 136, 0.5);
            transform: translateY(-2px);
            box-shadow: 0 4px 14px rgba(0, 255, 136, 0.2);
        }
        @keyframes chipIn {
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        .chip-char {
            background: rgba(0, 229, 255, 0.2);
            color: #fff;
            width: 28px;
            height: 28px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 0.85rem;
            flex-shrink: 0;
            font-family: var(--font-sans);
        }
        .chip-arrow {
            display: flex;
            align-items: center;
            flex-shrink: 0;
        }
        .chip-binary {
            color: var(--binary-color);
            letter-spacing: 0.04em;
            font-size: 0.78rem;
            text-shadow: 0 0 6px rgba(0, 255, 136, 0.4);
        }

        /* ========== Copy Button ========== */
        .btn-copy {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 12px 22px;
            font-size: 0.9rem;
            font-weight: 600;
            font-family: var(--font-sans);
            letter-spacing: 0.03em;
            background: rgba(0, 229, 255, 0.08);
            border: 1px solid rgba(0, 229, 255, 0.35);
            color: var(--accent-cyan);
            border-radius: 28px;
            cursor: pointer;
            transition: var(--transition);
            align-self: flex-start;
            white-space: nowrap;
            position: relative;
            overflow: hidden;
        }
        .btn-copy:hover {
            background: rgba(0, 229, 255, 0.16);
            border-color: rgba(0, 229, 255, 0.6);
            box-shadow: 0 0 22px rgba(0, 229, 255, 0.3);
            transform: translateY(-1px);
        }
        .btn-copy:active {
            transform: scale(0.96);
            transition: 0.1s ease;
        }
        .btn-copy.copied {
            background: rgba(0, 255, 136, 0.15);
            border-color: rgba(0, 255, 136, 0.5);
            color: var(--accent-green);
            box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
        }

        /* ========== Footer ========== */
        .footer-note {
            text-align: center;
            font-size: 0.72rem;
            color: var(--text-dim);
            letter-spacing: 0.04em;
            opacity: 0.7;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 5px;
        }

        /* ========== Responsive Design ========== */
        @media (max-width: 600px) {
            .card {
                padding: 20px 14px;
                border-radius: 14px;
            }
            .binary-display-container {
                padding: 14px 12px;
                font-size: 0.72rem;
                min-height: 48px;
                border-radius: 8px;
            }
            .input-wrapper input {
                padding: 12px 14px;
                font-size: 0.95rem;
                border-radius: 8px;
            }
            .char-chip {
                padding: 5px 10px 5px 7px;
                font-size: 0.7rem;
                gap: 4px;
            }
            .chip-char {
                width: 24px;
                height: 24px;
                font-size: 0.75rem;
            }
            .chip-binary {
                font-size: 0.7rem;
            }
            .stats-bar {
                gap: 8px;
            }
            .stat-item {
                padding: 4px 10px;
                font-size: 0.7rem;
            }
            .btn-copy {
                padding: 10px 16px;
                font-size: 0.8rem;
                border-radius: 22px;
            }
            .header h1 {
                font-size: 1.2rem;
            }
            .header .subtitle {
                font-size: 0.75rem;
            }
        }
        @media (max-width: 380px) {
            body {
                padding: 10px;
            }
            .card {
                padding: 16px 10px;
                border-radius: 12px;
                gap: 16px;
            }
            .main-container {
                gap: 14px;
            }
            .binary-display-container {
                padding: 10px;
                font-size: 0.65rem;
                letter-spacing: 0.02em;
            }
            .input-wrapper input {
                padding: 10px 12px;
                font-size: 0.85rem;
            }
            .char-chip {
                padding: 4px 8px;
                font-size: 0.65rem;
                gap: 3px;
                border-radius: 16px;
            }
            .chip-char {
                width: 20px;
                height: 20px;
                font-size: 0.7rem;
            }
            .chip-binary {
                font-size: 0.63rem;
            }
        }
        
        /* ========== Screenshot Button ========== */
.btn-screenshot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--font-sans);
    letter-spacing: 0.03em;
    background: rgba(0, 255, 136, 0.08);
    border: 1px solid rgba(0, 255, 136, 0.35);
    color: var(--accent-green);
    border-radius: 28px;
    cursor: pointer;
    transition: var(--transition);
    align-self: flex-start;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    margin-left: 12px; /* jarak dengan tombol copy */
}
.btn-screenshot:hover {
    background: rgba(0, 255, 136, 0.16);
    border-color: rgba(0, 255, 136, 0.6);
    box-shadow: 0 0 22px rgba(0, 255, 136, 0.3);
    transform: translateY(-1px);
}
.btn-screenshot:active {
    transform: scale(0.96);
    transition: 0.1s ease;
}
.icon-camera {
    width: 1.1em;
    height: 1.1em;
    stroke: currentColor;
}

/* ========== Expanded Chips (Scrollable) ========== */
.char-mapping.expanded {
    max-height: 220px;
    overflow-y: auto;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 20px;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-cyan) rgba(255, 255, 255, 0.1);
}

.char-mapping.expanded::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.char-mapping.expanded::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

.char-mapping.expanded::-webkit-scrollbar-thumb {
    background: var(--accent-cyan);
    border-radius: 10px;
}

/* ========== More Chip (bisa diklik) ========== */
.char-chip.more-chip {
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(0, 229, 255, 0.15);
    border-color: rgba(0, 229, 255, 0.5);
}

.char-chip.more-chip:hover {
    background: rgba(0, 229, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 229, 255, 0.3);
}

/* ========== Close Chip (tombol tutup) ========== */
.char-chip.close-chip {
    cursor: pointer;
    background: rgba(255, 100, 100, 0.15);
    border-color: rgba(255, 100, 100, 0.4);
}

.char-chip.close-chip:hover {
    background: rgba(255, 100, 100, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 100, 100, 0.3);
}

.char-chip.close-chip .chip-char {
    background: rgba(255, 100, 100, 0.3);
}

/* ========== FIX: Konten Center di Tengah Layar ========== */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;  /* Matikan scroll pada body utama */
    box-sizing: border-box;
}

body {
    display: flex;           /* Aktifkan flexbox */
    justify-content: center; /* Center secara horizontal */
    align-items: center;     /* Center secara vertikal */
    padding: 20px;
}

.main-container {
    width: 100%;
    max-width: 600px;        /* Batasi lebar maksimal biar estetik di desktop */
    max-height: 100%;        /* Ubah dari height ke max-height agar bisa menyusut/center */
    overflow-y: auto;        /* Scroll hanya aktif jika konten melebihi max-height */
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 10px 5px;       /* Beri sedikit jarak aman di dalam container */
    box-sizing: border-box;
}

/* Input Card (card pertama) tetap sticky saat di-scroll di dalam container */
.main-container .card:first-of-type {
    position: sticky;
    top: 0;                 /* Sesuaikan ke 0 karena padding sudah dihandle container */
    z-index: 100;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    margin-top: 0;
}

/* Output Card (card kedua) tetap normal, bisa memanjang */
.main-container .card:last-of-type {
    margin-bottom: 10px;
}

/* Pastikan chip mapping yang panjang bisa discroll di dalam card-nya sendiri */
.char-mapping.expanded {
    max-height: 180px; 
    overflow-y: auto;
}

/* ========== Donation Links ========== */
.donation-links {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 229, 255, 0.2);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.donation-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 6px;
}

.donation-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.donation-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 0.75rem;
    font-weight: 500;
    font-family: var(--font-sans);
    border-radius: 24px;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
}

.donation-link.trakteer {
    background: rgba(255, 70, 70, 0.12);
    border: 1px solid rgba(255, 70, 70, 0.35);
    color: #ff6b6b;
}

.donation-link.trakteer:hover {
    background: rgba(255, 70, 70, 0.25);
    border-color: rgba(255, 70, 70, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 70, 70, 0.2);
}

.donation-link.kofi {
    background: rgba(255, 100, 0, 0.12);
    border: 1px solid rgba(255, 100, 0, 0.35);
    color: #ff9f4a;
}

.donation-link.kofi:hover {
    background: rgba(255, 100, 0, 0.25);
    border-color: rgba(255, 100, 0, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 100, 0, 0.2);
}

.donation-link.nowpayment {
    background: rgba(0, 200, 200, 0.12);
    border: 1px solid rgba(0, 200, 200, 0.35);
    color: #4adede;
}

.donation-link.nowpayment:hover {
    background: rgba(0, 200, 200, 0.25);
    border-color: rgba(0, 200, 200, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 200, 200, 0.2);
}

.donation-icon {
    font-size: 0.9rem;
}

.donation-platform {
    font-size: 0.7rem;
    font-weight: 600;
}
