:root {
  --bg: #070b1b;
  --card: rgba(255, 255, 255, 0.08);
  --card-strong: rgba(255, 255, 255, 0.13);
  --stroke: rgba(255, 255, 255, 0.14);
  --text: #f8fbff;
  --muted: rgba(248, 251, 255, 0.68);
  --soft: rgba(248, 251, 255, 0.42);
  --accent: #45f6c3;
  --accent-2: #7b61ff;
  --danger: #ff5f8f;
  --shadow: 0 24px 90px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 0%, rgba(69, 246, 195, 0.18), transparent 26%),
    radial-gradient(circle at 100% 15%, rgba(123, 97, 255, 0.24), transparent 28%),
    linear-gradient(160deg, #070b1b, #0b1230 52%, #070b1b);
  overflow-x: hidden;
}

button, input, select {
  font: inherit;
}

.app-shell {
  width: min(480px, 100%);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
}

.glass-card {
  position: relative;
  border: 1px solid var(--stroke);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.05));
  border-radius: 30px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.hero-card {
  padding: 18px;
  min-height: 245px;
}

.orb {
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  filter: blur(6px);
  opacity: .34;
  pointer-events: none;
}

.orb-one {
  right: -80px;
  top: -80px;
  background: var(--accent);
}

.orb-two {
  left: -85px;
  bottom: -100px;
  background: var(--accent-2);
}

.top-line, .profile-row, .info-grid, .section-title, .swap-row, .result-box, .quick-grid {
  position: relative;
  z-index: 2;
}

.top-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.status-pill, .mini-label {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--muted);
  font-size: 12px;
}

.status-pill.ok { color: var(--accent); }
.status-pill.bad { color: var(--danger); }

.profile-row {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 28px;
}

.avatar-wrap {
  position: relative;
  width: 88px;
  height: 88px;
  flex: 0 0 auto;
}

.avatar {
  position: relative;
  z-index: 2;
  display: block;
  width: 88px;
  height: 88px;
  border-radius: 28px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,.26);
  background: linear-gradient(135deg, #45f6c3, #7b61ff);
}

.avatar-glow {
  position: absolute;
  inset: -8px;
  border-radius: 34px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  opacity: .35;
  filter: blur(14px);
}

.profile-info h1 {
  margin: 0;
  font-size: clamp(25px, 7vw, 34px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.profile-info p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  word-break: break-word;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 25px;
}

.info-grid div {
  padding: 13px;
  border-radius: 20px;
  background: rgba(0,0,0,.2);
  border: 1px solid rgba(255,255,255,.09);
}

.info-grid span, .input-label, .select-box label, .result-box span, .result-box small, .section-title p {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.info-grid strong {
  display: block;
  margin-top: 5px;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.converter-card, .market-card {
  margin-top: 16px;
  padding: 18px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.section-title p { margin: 0 0 3px; }
.section-title h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1;
  letter-spacing: -0.03em;
}

.coins-stack {
  display: flex;
  align-items: center;
  gap: 5px;
}

.coins-stack span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 14px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.12);
  font-size: 12px;
  font-weight: 800;
}

#amount {
  width: 100%;
  height: 62px;
  margin-top: 7px;
  padding: 0 17px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 20px;
  color: var(--text);
  background: rgba(0,0,0,.22);
  outline: none;
  font-size: 24px;
  font-weight: 750;
}

.swap-row {
  display: grid;
  grid-template-columns: 1fr 48px 1fr;
  gap: 10px;
  align-items: end;
  margin-top: 14px;
}

.select-box {
  position: relative;
  padding: 8px;
  border: 1px solid #26345f;
  border-radius: 22px;
  background: #0d1533;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.08),
    0 12px 28px rgba(0,0,0,.24);
}

.select-box label {
  padding: 2px 8px 7px;
  color: #95a3d7;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.select-box.open {
  border-color: rgba(69, 246, 195, .65);
  box-shadow:
    0 0 0 3px rgba(69,246,195,.10),
    0 16px 34px rgba(0,0,0,.32);
}

.native-select-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  inset: auto auto 0 0;
}

.custom-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 0 12px;
  border: 1px solid #1f2b52;
  border-radius: 17px;
  outline: 0;
  color: var(--text);
  background: #111b40;
  font-weight: 950;
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07);
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.custom-select-trigger:active {
  transform: scale(.985);
}

.select-box.open .custom-select-trigger,
.custom-select-trigger:focus-visible {
  border-color: rgba(69, 246, 195, .58);
  background: #14204a;
}

.custom-select-value {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 16px;
  letter-spacing: -.01em;
}

.custom-select-value::before {
  content: '';
  width: 22px;
  height: 22px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 20px rgba(69, 246, 195, .22);
}

.custom-select-arrow {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 12px;
  color: var(--accent);
  background: #192654;
  border: 1px solid #2a396b;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.select-box.open .custom-select-arrow {
  transform: rotate(180deg);
  background: #203469;
  border-color: rgba(69, 246, 195, .42);
}

.custom-select-menu {
  position: absolute;
  top: calc(100% + 9px);
  left: 0;
  right: 0;
  z-index: 80;
  max-height: 250px;
  padding: 9px;
  border: 1px solid #2a396b;
  border-radius: 20px;
  background: #0a112b;
  box-shadow: 0 24px 58px rgba(0,0,0,.55);
  overflow-y: auto;
  opacity: 0;
  transform: translateY(-8px) scale(.98);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.custom-select-menu::-webkit-scrollbar {
  width: 7px;
}

.custom-select-menu::-webkit-scrollbar-thumb {
  background: #304170;
  border-radius: 999px;
}

.select-box.open .custom-select-menu {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.custom-select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  margin-bottom: 5px;
  padding: 8px 10px;
  border: 1px solid #17234a;
  border-radius: 15px;
  color: var(--text);
  background: #101a3e;
  font-weight: 850;
  text-align: left;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}

.custom-select-option:last-child {
  margin-bottom: 0;
}

.custom-select-option:hover,
.custom-select-option:focus-visible {
  background: #172552;
  border-color: #34477f;
  outline: none;
}

.custom-select-option:active {
  transform: scale(.985);
}

.custom-select-option.is-selected {
  background: #16315a;
  border-color: rgba(69, 246, 195, .52);
}

.custom-select-option-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.coin-badge {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border-radius: 13px;
  color: #081022;
  background: linear-gradient(135deg, var(--accent), #d5ff69);
  font-size: 12px;
  font-weight: 950;
  box-shadow: 0 8px 18px rgba(69, 246, 195, .18);
}

.custom-select-option-text {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.custom-select-option-text b {
  font-size: 14px;
  line-height: 1.05;
}

.custom-select-option-text small {
  color: #95a3d7;
  font-size: 11px;
  font-weight: 650;
}

.custom-select-check {
  color: var(--accent);
  font-size: 16px;
  font-weight: 950;
  opacity: 0;
}

.custom-select-option.is-selected .custom-select-check {
  opacity: 1;
}

.swap-btn {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 17px;
  color: #07101d;
  background: linear-gradient(135deg, var(--accent), #f6ff8a);
  font-size: 22px;
  font-weight: 900;
  box-shadow: 0 12px 32px rgba(69, 246, 195, 0.26);
}

.convert-btn {
  width: 100%;
  height: 58px;
  margin-top: 14px;
  border: 0;
  border-radius: 20px;
  color: #07101d;
  background: linear-gradient(135deg, var(--accent), #d5ff69);
  font-weight: 900;
  letter-spacing: -0.02em;
  box-shadow: 0 18px 42px rgba(69, 246, 195, 0.22);
}

.result-box {
  margin-top: 14px;
  padding: 16px;
  border-radius: 22px;
  background: rgba(0,0,0,.22);
  border: 1px solid rgba(255,255,255,.1);
}

.result-box strong {
  display: block;
  margin: 7px 0 4px;
  font-size: clamp(28px, 10vw, 42px);
  line-height: 1;
  letter-spacing: -0.05em;
}

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

.quick-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 13px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 18px;
  background: rgba(0,0,0,.2);
  color: var(--text);
}

.quick-btn b { font-size: 14px; }
.quick-btn span { color: var(--muted); font-size: 12px; }

@media (max-width: 360px) {
  .swap-row { grid-template-columns: 1fr; }
  .swap-btn { width: 100%; }
  .info-grid { grid-template-columns: 1fr; }
}
