/* :root {
    --bg-deep: #0f1016;
    --accent-cyan: #00f2ff;
    --glass-white: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-glow: 0 0 10px rgba(0, 242, 255, 0.5);
}

body {
    background: radial-gradient(circle at center, #1a1c2c 0%, #0a0b10 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
    color: white;
    padding: 20px;
}

.glass-container {
    width: 100%;
    max-width: 500px;
    background: var(--glass-white);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    padding: 40px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}

h1 {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 2px;
    margin-top: 15px;
}

.accent { color: var(--accent-cyan); text-shadow: var(--text-glow); }

.subtitle {
    color: #888;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 30px;
}

.converter-card label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--accent-cyan);
    margin-bottom: 8px;
    font-weight: 700;
}

#amount-input {
    width: 100%;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 15px;
    color: white;
    font-size: 1.2rem;
    margin-bottom: 25px;
    outline: none;
    transition: 0.3s;
}

#amount-input:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.2);
}

.currency-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
}

.select-group { flex: 1; }

.custom-select {
    display: flex;
    align-items: center;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 10px;
}

.custom-select img {
    width: 24px;
    height: 18px;
    margin-right: 10px;
    border-radius: 2px;
}

.custom-select select {
    background: transparent;
    border: none;
    color: white;
    width: 100%;
    outline: none;
    font-weight: 600;
}

.swap-icon {
    cursor: pointer;
    transition: 0.3s;
    margin-top: 20px;
}

.swap-icon:hover {
    transform: rotate(180deg) scale(1.1);
}

.result-box {
    background: rgba(0, 242, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    margin-bottom: 25px;
    border: 1px dashed var(--accent-cyan);
}

.rate-info {
    font-size: 0.85rem;
    color: #aaa;
    margin-bottom: 5px;
}

.total-display {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.btn-calculate {
    width: 100%;
    background: var(--accent-cyan);
    color: #000;
    border: none;
    padding: 18px;
    border-radius: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 10px 20px rgba(0, 242, 255, 0.3);
    transition: 0.3s;
}

.btn-calculate:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(0, 242, 255, 0.4);
}

.social-footer {
    margin-top: 40px;
    text-align: center;
    border-top: 1px solid var(--glass-border);
    padding-top: 20px;
}

.social-footer p { font-size: 0.7rem; color: #666; }

.icons img {
    width: 28px;
    margin: 0 8px;
    filter: grayscale(1) opacity(0.5);
    transition: 0.3s;
}

.icons img:hover {
    filter: grayscale(0) opacity(1);
    transform: scale(1.2);
}

/* Mobile Responsiveness *
@media (max-width: 480px) {
    .currency-row { flex-direction: column; }
    .swap-icon { transform: rotate(90deg); margin: 10px 0; }
    .glass-container { padding: 25px; }
} */













    /* ══════════════════════════════════════════════
       TOKENS
    ══════════════════════════════════════════════ */
    :root {
      --bg:          #080c14;
      --surface:     #0f1520;
      --card:        #131c2e;
      --card-hover:  #182038;
      --border:      rgba(255,255,255,0.07);
      --border-acc:  rgba(56,189,248,0.4);

      --acc:         #38bdf8;   /* sky-400  */
      --acc2:        #818cf8;   /* indigo-400 */
      --acc-glow:    rgba(56,189,248,0.18);

      --green:       #34d399;
      --green-bg:    rgba(52,211,153,0.08);

      --txt:         #e2e8f8;
      --txt-2:       #7e8faa;
      --txt-3:       #3d4f68;

      --radius:      20px;
      --radius-sm:   12px;
      --radius-xs:   8px;
      --t:           0.3s cubic-bezier(.4,0,.2,1);
      --shadow:      0 24px 80px rgba(0,0,0,0.6);
    }

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

    html { scroll-behavior: smooth; }

    body {
      font-family: 'Outfit', sans-serif;
      background: var(--bg);
      color: var(--txt);
      min-height: 100svh;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 1.5rem;
      overflow-x: hidden;
      -webkit-font-smoothing: antialiased;
    }

    /* ══════════════════════════════════════════════
       ANIMATED MESH BACKGROUND
    ══════════════════════════════════════════════ */
    .bg-mesh {
      position: fixed;
      inset: 0;
      z-index: 0;
      pointer-events: none;
      overflow: hidden;
    }

    .mesh-orb {
      position: absolute;
      border-radius: 50%;
      filter: blur(80px);
      opacity: 0.55;
    }

    .orb-a {
      width: 520px; height: 520px;
      top: -140px; left: -100px;
      background: radial-gradient(circle, #1e3a5f 0%, transparent 70%);
      animation: drift 18s ease-in-out infinite alternate;
    }
    .orb-b {
      width: 420px; height: 420px;
      bottom: -80px; right: -60px;
      background: radial-gradient(circle, #1a2554 0%, transparent 70%);
      animation: drift 22s ease-in-out infinite alternate-reverse;
    }
    .orb-c {
      width: 300px; height: 300px;
      top: 40%; left: 55%;
      background: radial-gradient(circle, #0e2d40 0%, transparent 70%);
      animation: drift 15s ease-in-out infinite alternate;
      animation-delay: -8s;
    }

    /* Subtle grid overlay */
    .bg-mesh::after {
      content: '';
      position: absolute;
      inset: 0;
      background-image:
        linear-gradient(rgba(56,189,248,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56,189,248,0.03) 1px, transparent 1px);
      background-size: 48px 48px;
    }

    @keyframes drift {
      from { transform: translate(0, 0) scale(1); }
      to   { transform: translate(40px, 60px) scale(1.1); }
    }

    /* ══════════════════════════════════════════════
       CARD WRAPPER
    ══════════════════════════════════════════════ */
    .app-wrapper {
      position: relative;
      z-index: 1;
      width: 100%;
      max-width: 520px;
      animation: slideUp 0.7s cubic-bezier(.16,1,.3,1) both;
    }

    @keyframes slideUp {
      from { opacity: 0; transform: translateY(32px); }
      to   { opacity: 1; transform: none; }
    }

    /* ══════════════════════════════════════════════
       HEADER
    ══════════════════════════════════════════════ */
    .app-header {
      text-align: center;
      margin-bottom: 2rem;
      animation: slideUp 0.6s cubic-bezier(.16,1,.3,1) both;
      animation-delay: 0.2s;
    }

    .header-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 56px; height: 56px;
      border-radius: 16px;
      background: linear-gradient(135deg, rgba(56,189,248,0.15), rgba(129,140,248,0.15));
      border: 1px solid rgba(56,189,248,0.2);
      margin-bottom: 1rem;
      box-shadow: 0 0 30px rgba(56,189,248,0.1);
    }

    .app-title {
      font-size: 1.6rem;
      font-weight: 800;
      letter-spacing: -0.02em;
      background: linear-gradient(135deg, #fff 30%, var(--acc));
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
      margin-bottom: 0.3rem;
    }

    .app-subtitle {
      font-size: 0.85rem;
      color: var(--txt-2);
      font-weight: 400;
      letter-spacing: 0.04em;
    }

    /* ══════════════════════════════════════════════
       MAIN CARD
    ══════════════════════════════════════════════ */
    .card {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      overflow: hidden;
      animation: slideUp 0.7s cubic-bezier(.16,1,.3,1) both;
      animation-delay: 0.1s;
    }

    /* Accent top line */
    .card::before {
      content: '';
      display: block;
      height: 2px;
      background: linear-gradient(90deg, var(--acc), var(--acc2), transparent);
    }

    .card-body {
      padding: 2rem;
    }

    /* ── Amount Input ── */
    .field-label {
      display: block;
      font-size: 0.72rem;
      font-weight: 600;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: var(--txt-2);
      margin-bottom: 0.55rem;
    }

    .amount-field {
      position: relative;
      margin-bottom: 1.75rem;
    }

    .amount-field input {
      width: 100%;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 0.9rem 1rem 0.9rem 3rem;
      color: var(--txt);
      font-family: 'DM Mono', monospace;
      font-size: 1.4rem;
      font-weight: 500;
      outline: none;
      transition: border-color var(--t), box-shadow var(--t), background var(--t);
      -moz-appearance: textfield;
    }

    .amount-field input::-webkit-inner-spin-button,
    .amount-field input::-webkit-outer-spin-button { -webkit-appearance: none; }

    .amount-field input:focus {
      border-color: var(--acc);
      box-shadow: 0 0 0 3px var(--acc-glow), 0 0 20px var(--acc-glow);
      background: rgba(56,189,248,0.04);
    }

    .amount-prefix {
      position: absolute;
      left: 1rem;
      top: 50%;
      transform: translateY(-50%);
      color: var(--acc);
      font-size: 1.2rem;
      font-weight: 700;
      pointer-events: none;
    }

    /* ── Currency Row ── */
    .currency-row {
      display: grid;
      grid-template-columns: 1fr auto 1fr;
      gap: 0.75rem;
      align-items: end;
      margin-bottom: 1.75rem;
    }

    .currency-group { display: flex; flex-direction: column; }

    /* Select box */
    .select-wrap {
      position: relative;
      display: flex;
      align-items: center;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      overflow: hidden;
      transition: border-color var(--t), box-shadow var(--t);
    }

    .select-wrap:focus-within {
      border-color: var(--acc);
      box-shadow: 0 0 0 3px var(--acc-glow);
    }

    .flag-slot {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 44px;
      height: 100%;
      padding: 0 0.5rem;
      background: rgba(255,255,255,0.03);
      border-right: 1px solid var(--border);
      flex-shrink: 0;
    }

    .flag-slot img {
      display: block;
      border-radius: 3px;
    }

    .select-wrap select {
      flex: 1;
      background: transparent;
      border: none;
      outline: none;
      color: var(--txt);
      font-family: 'Outfit', sans-serif;
      font-size: 0.9rem;
      font-weight: 600;
      padding: 0.75rem 2rem 0.75rem 0.75rem;
      cursor: pointer;
      appearance: none;
      -webkit-appearance: none;
    }

    /* Custom chevron */
    .select-wrap::after {
      content: '⌄';
      position: absolute;
      right: 0.7rem;
      color: var(--txt-2);
      font-size: 1rem;
      pointer-events: none;
      line-height: 1;
    }

    /* Select options styling (limited browser support but helps) */
    .select-wrap select option {
      background: #0f1520;
      color: var(--txt);
    }

    /* ── Swap Button ── */
    .swap-btn {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 42px;
      height: 42px;
      border-radius: 50%;
      background: rgba(56,189,248,0.08);
      border: 1px solid rgba(56,189,248,0.2);
      color: var(--acc);
      cursor: pointer;
      transition: all var(--t);
      flex-shrink: 0;
      margin-bottom: 2px;
    }

    .swap-btn:hover {
      background: rgba(56,189,248,0.18);
      border-color: var(--acc);
      box-shadow: 0 0 20px var(--acc-glow);
      transform: rotate(180deg);
    }

    .swap-btn svg { pointer-events: none; }

    /* ── Rate Display ── */
    .rate-display {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 1.1rem 1.25rem;
      margin-bottom: 1.5rem;
      min-height: 80px;
      display: flex;
      flex-direction: column;
      gap: 0.3rem;
      position: relative;
      overflow: hidden;
      transition: border-color var(--t);
    }

    .rate-display::before {
      content: '';
      position: absolute;
      inset: 0;
      background: linear-gradient(135deg, rgba(56,189,248,0.03), transparent);
      pointer-events: none;
    }

    .rate-display.has-result {
      border-color: rgba(52,211,153,0.25);
    }

    .rate-label {
      font-size: 0.72rem;
      font-weight: 600;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: var(--txt-3);
    }

    /* This is the existing `.rate` div from main.js */
    .rate {
      font-size: 0.82rem;
      color: var(--acc);
      font-weight: 500;
      min-height: 1.2em;
    }

    /* This is the existing `.total-rate` div from main.js */
    .total-rate {
      font-family: 'DM Mono', monospace;
      font-size: 1.55rem;
      font-weight: 500;
      color: var(--green);
      letter-spacing: -0.01em;
      min-height: 1.5em;
      word-break: break-word;
    }

    .total-rate:empty::before,
    .total-rate.loading::before {
      content: 'Awaiting conversion…';
      font-family: 'Outfit', sans-serif;
      font-size: 0.92rem;
      color: var(--txt-3);
      font-weight: 400;
    }

    /* ── Convert Button ── */
    .convert-btn {
      width: 100%;
      padding: 0.95rem;
      background: linear-gradient(135deg, var(--acc), var(--acc2));
      border: none;
      border-radius: var(--radius-sm);
      color: #fff;
      font-family: 'Outfit', sans-serif;
      font-size: 1rem;
      font-weight: 700;
      letter-spacing: 0.02em;
      cursor: pointer;
      position: relative;
      overflow: hidden;
      transition: opacity var(--t), transform var(--t), box-shadow var(--t);
      box-shadow: 0 4px 24px rgba(56,189,248,0.2);
    }

    .convert-btn::before {
      content: '';
      position: absolute;
      inset: 0;
      background: rgba(255,255,255,0.12);
      opacity: 0;
      transition: opacity var(--t);
    }

    .convert-btn:hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 32px rgba(56,189,248,0.35);
    }

    .convert-btn:hover::before { opacity: 1; }
    .convert-btn:active { transform: translateY(0); }

    /* ══════════════════════════════════════════════
       FOOTER
    ══════════════════════════════════════════════ */
    .app-footer {
      background: rgba(255,255,255,0.02);
      border-top: 1px solid var(--border);
      padding: 1.25rem 2rem;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 0.9rem;
    }

    .footer-copy {
      font-size: 0.75rem;
      color: var(--txt-3);
      text-align: center;
      letter-spacing: 0.03em;
    }

    .footer-copy strong {
      color: var(--txt-2);
      font-weight: 600;
    }

    .social-links {
      display: flex;
      gap: 0.5rem;
      flex-wrap: wrap;
      justify-content: center;
    }

    .social-link {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 34px; height: 34px;
      border-radius: 9px;
      background: rgba(255,255,255,0.04);
      border: 1px solid var(--border);
      text-decoration: none;
      transition: all var(--t);
    }

    .social-link:hover {
      background: rgba(56,189,248,0.1);
      border-color: rgba(56,189,248,0.35);
      transform: translateY(-3px);
      box-shadow: 0 6px 18px rgba(56,189,248,0.15);
    }

    .social-link img { display: block; }

    /* ══════════════════════════════════════════════
       LIVE INDICATOR
    ══════════════════════════════════════════════ */
    .live-badge {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      font-size: 0.68rem;
      font-weight: 600;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--green);
      background: var(--green-bg);
      border: 1px solid rgba(52,211,153,0.2);
      border-radius: 99px;
      padding: 0.2rem 0.6rem;
      margin-left: auto;
    }

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

    @keyframes livePulse {
      0%, 100% { opacity: 1; transform: scale(1); }
      50%       { opacity: 0.5; transform: scale(0.7); }
    }

    /* Header row of rate display */
    .rate-header {
      display: flex;
      align-items: center;
      margin-bottom: 0.2rem;
    }

    /* ══════════════════════════════════════════════
       RESPONSIVE
    ══════════════════════════════════════════════ */
    @media (max-width: 540px) {
      body { padding: 1rem; justify-content: flex-start; padding-top: 2rem; }

      .app-wrapper { max-width: 100%; }

      .card-body { padding: 1.4rem; }

      .app-footer { padding: 1.1rem 1.4rem; }

      .amount-field input { font-size: 1.15rem; }

      .total-rate { font-size: 1.25rem; }

      /* Stack currency row on very small screens */
      .currency-row {
        grid-template-columns: 1fr;
        gap: 0.6rem;
      }

      .swap-btn {
        width: 100%;
        border-radius: var(--radius-xs);
        height: 36px;
        /* transform: rotate(90deg); */
        /* display: block; */
      }

      .swap-btn:hover {
        transform: rotate(180deg); }
    }

    @media (max-width: 380px) {
      .social-links { gap: 0.35rem; }
      .social-link { width: 30px; height: 30px; border-radius: 7px; }
    }

    /* Scrollbar */
    ::-webkit-scrollbar { width: 4px; }
    ::-webkit-scrollbar-track { background: transparent; }
    ::-webkit-scrollbar-thumb { background: var(--txt-3); border-radius: 99px; }
