* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', system-ui, sans-serif;
  color: #e2e8f0;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(16, 185, 129, 0.08), transparent 60%),
    radial-gradient(700px 420px at -10% 30%, rgba(59, 130, 246, 0.06), transparent 55%),
    #020617;
}

.page {
  width: min(680px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

/* ---------- Header ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  color: #052e22;
  background: linear-gradient(135deg, #34d399, #10b981);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: 'Sora', sans-serif; font-size: 1.15rem; letter-spacing: -0.02em; }
.brand-text small { color: #64748b; font-size: 0.72rem; font-weight: 600; }

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #34d399;
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.22);
  white-space: nowrap;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5); }
  50% { box-shadow: 0 0 0 5px rgba(52, 211, 153, 0); }
}

.back-link {
  color: #94a3b8;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease;
  white-space: nowrap;
}
.back-link:hover { color: #e2e8f0; }

/* ---------- Cards ---------- */
.card {
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.9), rgba(2, 6, 23, 0.95));
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.converter-card { margin-bottom: 24px; }

.page-title {
  margin: 0 0 20px;
  font-family: 'Sora', sans-serif;
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #f1f5f9;
  text-align: center;
}

.intro-text {
  margin: 0 0 24px;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #94a3b8;
  text-align: center;
}

.field-label {
  display: block;
  margin-bottom: 10px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #64748b;
}

.field-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(2, 6, 23, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 18px;
  padding: 8px 8px 8px 20px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field-box:focus-within {
  border-color: rgba(52, 211, 153, 0.55);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.12);
}

#amount-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: none;
  color: #f8fafc;
  font-family: 'Sora', sans-serif;
  font-size: clamp(1.6rem, 6vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}
#amount-input::placeholder { color: #334155; }
#amount-input::-webkit-outer-spin-button,
#amount-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
#amount-input { -moz-appearance: textfield; appearance: textfield; }

.result-value {
  flex: 1;
  min-width: 0;
  font-family: 'Sora', sans-serif;
  font-size: clamp(1.5rem, 5.5vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #34d399;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

select {
  appearance: none;
  -webkit-appearance: none;
  max-width: 55%;
  background-color: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  color: #e2e8f0;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 10px 32px 10px 14px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
}

select:hover { border-color: rgba(52, 211, 153, 0.45); }
select:focus { outline: none; border-color: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.15); }
select optgroup { color: #64748b; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }

/* ---------- Swap ---------- */
.swap-btn {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin: 14px auto;
  border-radius: 50%;
  border: 1px solid rgba(52, 211, 153, 0.3);
  background: rgba(52, 211, 153, 0.08);
  color: #34d399;
  cursor: pointer;
  transition: transform 0.25s ease, background 0.2s ease;
}
.swap-btn svg { width: 20px; height: 20px; }
.swap-btn:hover { background: rgba(52, 211, 153, 0.18); transform: rotate(180deg); }
.swap-btn:active { transform: rotate(180deg) scale(0.92); }

/* ---------- Rate line ---------- */
.rate-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  font-size: 0.88rem;
  color: #94a3b8;
}
.rate-line b { color: #e2e8f0; }
.rate-value { color: #34d399 !important; }
.rate-time { font-size: 0.72rem; color: #475569; }

/* ---------- Quick pairs ---------- */
.quick-pairs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
}
.quick-label { font-size: 0.75rem; font-weight: 700; color: #475569; margin-right: 2px; }
.quick-chip {
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(148, 163, 184, 0.06);
  color: #cbd5e1;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.quick-chip:hover { border-color: rgba(52, 211, 153, 0.45); color: #34d399; background: rgba(52, 211, 153, 0.08); }
.quick-chip:active { transform: scale(0.96); }

/* ---------- Market overview ---------- */
.market-card h2 {
  margin: 0 0 18px;
  font-family: 'Sora', sans-serif;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.ticker-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.ticker-item {
  background: rgba(2, 6, 23, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 16px;
  padding: 14px 16px;
  transition: border-color 0.15s ease;
}
.ticker-item:hover { border-color: rgba(148, 163, 184, 0.28); }

.ticker-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ticker-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.ticker-code { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; color: #94a3b8; }
.ticker-name { font-size: 0.68rem; color: #475569; margin-left: auto; }

.ticker-price {
  font-family: 'Sora', sans-serif;
  font-size: 1.02rem;
  font-weight: 800;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ticker-change { font-size: 0.72rem; font-weight: 700; margin-top: 4px; }
.ticker-change.up { color: #34d399; }
.ticker-change.down { color: #fb7185; }
.ticker-change.flat { color: #64748b; }

/* ---------- FAQ ---------- */
.faq-card { margin-top: 24px; }
.faq-card h3 {
  margin: 20px 0 8px;
  font-family: 'Sora', sans-serif;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
}
.faq-card h3:first-of-type { margin-top: 0; }
.faq-card p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.6;
  color: #94a3b8;
}

/* ---------- Ads ---------- */
.ad-top { display: flex; justify-content: center; padding: 12px 16px 0; overflow: hidden; }
.ad-bottom { display: flex; justify-content: center; padding: 8px 16px 0; overflow: hidden; }

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 28px 16px 36px;
  font-size: 0.72rem;
  color: #475569;
}

.fine-print {
  text-align: center;
  font-size: 0.72rem;
  color: #475569;
  margin: 22px 0 0;
}

@media (max-width: 480px) {
  .page { width: calc(100% - 24px); padding-top: 18px; }
  .card { padding: 22px 18px; border-radius: 20px; }
  .site-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  select { max-width: 48%; font-size: 0.82rem; }
  .ticker-grid { grid-template-columns: 1fr 1fr; }
}
