:root {
    --neon-cyan: #22d3ee;
    --neon-purple: #a855f7;
    --neon-pink: #ec4899;
}

/* ===== Card Wrapper ===== */
#swap {
    display: none;
    margin: 100px
}

.neon-card {
    width: 380px;
    padding: 22px;
    border-radius: 20px;
    position: relative;
    background: rgba(12, 12, 18, 0.75);
    backdrop-filter: blur(14px);
    color: #e5e7eb;
    font-family: system-ui, -apple-system, Segoe UI, sans-serif;

    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.65),
        0 0 40px rgba(168, 85, 247, 0.15);
}

/* Neon border */
.neon-card::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: 22px;
    padding: 1px;
    background: linear-gradient(135deg,
            var(--neon-cyan),
            var(--neon-purple),
            var(--neon-pink));
    mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    mask-composite: exclude;
    pointer-events: none;
}

/* ===== Header ===== */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.card-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    text-shadow:
        0 0 8px rgba(168, 85, 247, 0.6);
}

.card-settings {
    opacity: 0.7;
    font-size: 1.2rem;
}

/* ===== Swap Sections ===== */
.swap-box {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 14px;
}

.swap-label {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-bottom: 6px;
}

.swap-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.token {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.token-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(circle, #22d3ee, #0ea5e9);
}

.amount-input {
    padding: 10px 14px;
    font-size: 16px;
    font-weight: 500;
    color: #00ffc3;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(0, 255, 200, 0.3);
    border-radius: 14px;
    outline: none;
    text-align: right;
    transition: all 0.25s ease;
}

.amount-input::placeholder {
    color: rgba(0, 255, 200, 0.5);
}

.amount-input:focus {
    background: rgba(0, 0, 0, 0.35);
    border-color: #00ffc3;
    box-shadow: 0 0 10px rgba(0, 255, 200, 0.4);
}

/* Arrow divider */
.swap-arrow {
    display: flex;
    justify-content: center;
    margin: 6px 0 10px;
    color: #a855f7;
    font-size: 1.2rem;
}

/* ===== Action Button ===== */
.swap-button {
    width: 100%;
    height: 50px;
    margin-top: 12px;
    border-radius: 16px;
    border: none;
    cursor: pointer;

    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;

    background: linear-gradient(135deg,
            var(--neon-cyan),
            var(--neon-purple));

    box-shadow:
        0 0 25px rgba(168, 85, 247, 0.65),
        inset 0 0 0 rgba(255, 255, 255, 0);

    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.swap-button:hover {
    transform: translateY(-1px);
    box-shadow:
        0 0 35px rgba(168, 85, 247, 0.85);
}

/* ===== Leverage Position ===== */
.leverage-box {
    margin-top: 14px;
    padding: 12px 14px;
    background: rgba(168, 85, 247, 0.06);
    border: 1px solid rgba(168, 85, 247, 0.25);
    border-radius: 10px;
}

.leverage-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #c4b5fd;
    margin-bottom: 10px;
    font-weight: 600;
}

.leverage-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.leverage-row:last-of-type {
    margin-bottom: 0;
}

.leverage-sub-label {
    font-size: 0.78rem;
    color: #9ca3af;
    flex-shrink: 0;
}

.leverage-group {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.leverage-pill {
    appearance: none;
    background: rgba(18, 18, 18, 0.65);
    color: #d1d5db;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.leverage-pill:hover {
    background: rgba(168, 85, 247, 0.18);
    color: #fff;
}

.leverage-pill.active {
    background: rgba(168, 85, 247, 0.35);
    border-color: rgba(168, 85, 247, 0.7);
    color: #fff;
}

.leverage-pill.leverage-long.active {
    background: rgba(34, 197, 94, 0.32);
    border-color: rgba(34, 197, 94, 0.7);
}

.leverage-pill.leverage-short.active {
    background: rgba(239, 68, 68, 0.32);
    border-color: rgba(239, 68, 68, 0.7);
}

.leverage-preview {
    margin-top: 10px;
    font-family: monospace;
    font-size: 0.78rem;
    color: #c4b5fd;
    text-align: right;
}

/* ===== Footer Info ===== */
.card-footer {
    margin-top: 14px;
    font-size: 0.8rem;
    color: #9ca3af;
    display: grid;
    gap: 4px;
}

#route {
    color: #bbb;
    font-family: monospace;
    font-size: 0.78rem;
    word-break: break-word;
}

#priceImpact {
    color: #9ca3af;
}

#priceImpact.warn {
    color: #fbbf24;
    font-weight: 600;
}

#priceImpact.high {
    color: #f87171;
    font-weight: 700;
}

.token-dropdown {
    position: relative;
    width: 140px;
    font-family: 'Segoe UI', sans-serif;
    color: #00ffc3;
    cursor: pointer;
}

/* Selected */
.token-selected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 12px;
    background: rgba(18, 18, 18, 0.65);
    backdrop-filter: blur(12px) saturate(160%);
    border: 1px solid rgba(0, 255, 200, 0.35);
    border-radius: 14px;
    transition: all 0.25s ease;
}

.token-selected:hover {
    background: rgba(18, 18, 18, 0.85);
    box-shadow: 0 0 12px rgba(0, 255, 200, 0.15);
}

.token-dropdown.open .token-selected {
    box-shadow: 0 0 18px rgba(0, 255, 200, 0.25);
}

/* Arrow */
.arrow {
    font-size: 11px;
    transition: transform 0.25s ease;
}

.token-dropdown.open .arrow {
    transform: rotate(180deg);
}

/* Dropdown panel */
.token-panel {
    position: absolute;
    top: 110%;
    left: 0;
    width: 100%;
    background: rgba(15, 17, 22, 0.95);
    backdrop-filter: blur(14px) saturate(180%);
    border: 1px solid rgba(0, 255, 200, 0.3);
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0, 255, 200, 0.18);
    z-index: 1000;
    display: none;
    overflow: hidden;
}

.token-dropdown.open .token-panel {
    display: block;
}

/* Search */
.token-search {
    width: 100%;
    padding: 8px 10px;
    font-size: 13px;
    border: none;
    outline: none;
    background: rgba(10, 12, 18, 0.9);
    color: #fff;
    border-bottom: 1px solid rgba(0, 255, 200, 0.15);
}

.token-search::placeholder {
    color: #777;
}

/* Token list */
.token-options {
    max-height: 260px;
    overflow-y: auto;
}

/* Token row */
.token-option {
    padding: 9px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    transition: background 0.2s ease, padding-left 0.2s ease;
}

.token-option:hover {
    background: rgba(0, 255, 200, 0.12);
    padding-left: 16px;
}

/* Icon */
.token-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00ffc3, #00bfa6);
    flex-shrink: 0;
}

/* Scrollbar */
.token-options::-webkit-scrollbar {
    width: 6px;
}

.token-options::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 200, 0.35);
    border-radius: 4px;
}

.by-aero {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;

    color: #7dd3fc;
    opacity: 0.85;

    padding: 2px 6px;
    border-radius: 6px;

    background: rgba(34, 211, 238, 0.08);
    border: 1px solid rgba(34, 211, 238, 0.25);

    box-shadow:
        inset 0 0 6px rgba(34, 211, 238, 0.2);
}

.by-aero a {
    color: inherit;
    text-decoration: none;
    font-weight: inherit;
    font-size: inherit;
}

.by-aero a:hover {
    opacity: 0.8;
}

.card-subtitle {
    font-weight: 500;
    letter-spacing: 0.3px;
    margin: 10px 0;
    color: rgba(255, 255, 255, 0.55);
    font-size: 1.3rem;

}

.swap-button.loading {
    pointer-events: none;
    opacity: 0.8;
}

.swap-button.loading::after {
    content: "…";
    animation: dots 1.4s infinite;
}

@keyframes dots {
    0% {
        content: "";
    }

    33% {
        content: ".";
    }

    66% {
        content: "..";
    }

    100% {
        content: "...";
    }
}

.swap-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 15, 0.75);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
    border-radius: 16px;
    z-index: 50;
}

.swap-overlay.show {
    opacity: 1;
    pointer-events: all;
}

.swap-overlay-content {
    text-align: center;
    color: white;
    animation: fadeUp 0.4s ease;
}

.overlay-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.overlay-sub {
    font-size: 0.95rem;
    opacity: 0.8;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================== E2: leverage-first entry card ===================== */

/* Balance header */
.deposit-btn {
    appearance: none;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #d6f9ef;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(0, 255, 200, 0.4);
    background: rgba(0, 255, 200, 0.1);
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.deposit-btn:hover {
    background: rgba(0, 255, 200, 0.22);
    box-shadow: 0 0 14px rgba(0, 255, 200, 0.35);
}

.arena-balance-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 10px 14px;
    margin-bottom: 14px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.arena-balance-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #9ca3af;
}

.arena-balance {
    font-family: monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: #00ffc3;
    text-shadow: 0 0 10px rgba(0, 255, 200, 0.4);
}

/* Stake input */
.stake-input-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(0, 255, 200, 0.3);
}

.stake-unit {
    color: rgba(0, 255, 200, 0.7);
    font-weight: 700;
}

.stake-input {
    width: 90px;
    background: transparent;
    border: none;
    outline: none;
    text-align: right;
    color: #00ffc3;
    font-size: 1rem;
    font-weight: 600;
    font-family: monospace;
}

/* Leverage slider */
.lev-slider-row {
    margin-top: 6px;
    margin-bottom: 8px;
}

.lev-slider-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 6px;
}

.lev-readout {
    font-family: monospace;
    font-size: 0.82rem;
    font-weight: 700;
    color: #c4b5fd;
}

.lev-readout.muted {
    color: #f59e0b;
}

.lev-slider {
    width: 100%;
    accent-color: var(--neon-purple);
    cursor: pointer;
}

/* Exposure / entry / liq line */
.exposure-line {
    margin-top: 8px;
    font-family: monospace;
    font-size: 0.78rem;
    color: #c4b5fd;
    text-align: right;
}

/* Pre-entry crowd bar */
.entry-crowd {
    margin-top: 12px;
}

.entry-crowd-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: monospace;
    font-size: 0.72rem;
    margin-bottom: 4px;
}

.entry-crowd-asset {
    color: #9ca3af;
    letter-spacing: 0.08em;
}

.entry-crowd .up {
    color: #22c55e;
}

.entry-crowd .down {
    color: #ef4444;
}

.entry-crowd-bar {
    display: flex;
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.5);
}

.entry-crowd-long {
    background: linear-gradient(90deg, #16a34a, #22c55e);
}

.entry-crowd-short {
    background: linear-gradient(90deg, #ef4444, #b91c1c);
}

/* Inline entry error */
.enter-error {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 0.82rem;
    color: #fecaca;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.4);
}

/* ===================== Deposit modal ===================== */
.deposit-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(5, 6, 12, 0.72);
    backdrop-filter: blur(6px);
}

.deposit-modal[hidden] {
    display: none;
}

.deposit-content {
    width: 360px;
    font-family: system-ui, -apple-system, Segoe UI, sans-serif;
}

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

.deposit-sub {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 14px;
}

.deposit-faucet {
    font-size: 0.8rem;
    color: #7dd3fc;
    margin: -6px 0 14px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(34, 211, 238, 0.08);
    border: 1px solid rgba(34, 211, 238, 0.25);
}

.deposit-faucet a {
    color: #22d3ee;
    font-weight: 600;
}

.deposit-faucet[hidden] {
    display: none;
}

.deposit-token-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.deposit-token {
    appearance: none;
    cursor: pointer;
    padding: 6px 11px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #d1d5db;
    background: rgba(18, 18, 18, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: background 0.15s ease, border-color 0.15s ease;
}

.deposit-token:hover {
    background: rgba(0, 255, 200, 0.15);
}

/* Wallet balance under each quick-token symbol; hidden until known. */
.deposit-token-bal {
    display: block;
    font-size: 0.62rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.45);
    text-align: center;
}

.deposit-token-bal:empty {
    display: none;
}

.deposit-token.active .deposit-token-bal {
    color: rgba(255, 255, 255, 0.7);
}

.deposit-token.active {
    background: rgba(0, 255, 200, 0.25);
    border-color: rgba(0, 255, 200, 0.6);
    color: #fff;
}

.deposit-dest-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.deposit-dest {
    font-size: 1.1rem;
    font-weight: 700;
    color: #00ffc3;
    font-family: monospace;
}

/* Live quote line under the rate (min received, price impact). */
.deposit-detail {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 2px;
}

.deposit-detail.warn {
    color: #fbbf24;
}

/* ===== Withdraw modal (G4) ===== */
.withdraw-list {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 220px;
    overflow-y: auto;
}

.withdraw-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.78rem;
}

.withdraw-row-label {
    color: rgba(255, 255, 255, 0.75);
}

.withdraw-row-amount {
    margin-left: auto;
    font-variant-numeric: tabular-nums;
    color: #e5e7eb;
}

.withdraw-row-state {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.72rem;
    white-space: nowrap;
}

.withdraw-claim-btn {
    flex: 0 0 auto;
}

.withdraw-max {
    flex: 0 0 auto;
}

.withdraw-empty {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75rem;
    text-align: center;
    padding: 8px 0;
}

.close-btn {
    appearance: none;
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
}

.close-btn:hover {
    color: #fff;
}

/* ===================== Respawn overlay ===================== */
.respawn-overlay {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(5, 6, 12, 0.82);
    backdrop-filter: blur(8px);
}

.respawn-overlay[hidden] {
    display: none;
}

.respawn-content {
    width: 340px;
    text-align: center;
    font-family: system-ui, -apple-system, Segoe UI, sans-serif;
    animation: fadeUp 0.35s ease;
}

.respawn-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #f87171;
    text-shadow: 0 0 16px rgba(239, 68, 68, 0.6);
    margin-bottom: 6px;
}

.respawn-sub {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 16px;
}

.respawn-content .stake-row {
    justify-content: center;
    margin-bottom: 14px;
}

.respawn-menu-btn {
    appearance: none;
    margin-top: 10px;
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: underline;
}

.respawn-menu-btn:hover {
    color: #fff;
}