:root {
  color-scheme: dark;

  --bg:
    #050b16;

  --surface:
    rgba(13, 27, 52, .92);

  --surface-2:
    #111f39;

  --line:
    rgba(255, 255, 255, .09);

  --text:
    #f5f7fb;

  --muted:
    #91a0b8;

  --gold:
    #e7b952;

  --green:
    #35d18a;

  --red:
    #ff6b76;

  --blue:
    #4ca1ff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(
      circle at top right,
      rgba(38, 88, 166, .20),
      transparent 35%
    ),
    var(--bg);
  color: var(--text);
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

body {
  padding:
    max(12px, env(safe-area-inset-top))
    14px
    max(24px, env(safe-area-inset-bottom));
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.shell {
  width: min(100%, 720px);
  margin: 0 auto;
}

.hidden {
  display: none !important;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 58px;
  margin-bottom: 18px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border:
    1px solid rgba(231, 185, 82, .38);
  border-radius: 15px;
  background:
    linear-gradient(
      145deg,
      #172948,
      #071121
    );
  color: var(--gold);
  font-size: 25px;
}

.brand-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.brand-copy strong {
  font-size: 18px;
}

.brand-copy span {
  color: var(--muted);
  font-size: 12px;
}

.status-badge {
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 11px;
  white-space: nowrap;
}

.status-badge.pending {
  background:
    rgba(255, 255, 255, .08);
  color: var(--muted);
}

.status-badge.online {
  background:
    rgba(53, 209, 138, .12);
  color: var(--green);
}

.status-badge.error {
  background:
    rgba(255, 107, 118, .12);
  color: var(--red);
}

.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
}

.hero h1 {
  max-width: 430px;
  margin: 0;
  font-size:
    clamp(25px, 7vw, 38px);
  line-height: 1.06;
}

.hero-text {
  max-width: 500px;
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 140px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
}

.user-card > div:last-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-card strong {
  max-width: 120px;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--gold);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.small-label {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
}

.stats {
  display: grid;
  grid-template-columns:
    repeat(3, 1fr);
  gap: 9px;
  margin-bottom: 14px;
}

.stat {
  display: flex;
  flex-direction: column;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
}

.stat span,
.stat small {
  color: var(--muted);
  font-size: 10px;
}

.stat strong {
  margin: 3px 0;
  font-size: 20px;
}

.panel {
  margin-bottom: 13px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow:
    0 15px 45px rgba(0, 0, 0, .12);
}

.section-title {
  margin-bottom: 14px;
}

.section-title > div {
  display: flex;
  align-items: center;
  gap: 11px;
}

.section-title div div {
  display: flex;
  flex-direction: column;
}

.section-title strong {
  font-size: 15px;
}

.section-title small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.step {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border-radius: 9px;
  background:
    rgba(231, 185, 82, .12);
  color: var(--gold);
  font-size: 13px;
  font-weight: 900;
}

.search-box,
.amount-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #091426;
}

.search-box:focus-within,
.amount-box:focus-within {
  border-color:
    rgba(76, 161, 255, .65);
}

.search-box > span {
  color: var(--muted);
  font-size: 24px;
}

.search-box input,
.amount-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.amount-box input {
  font-size: 22px;
  font-weight: 800;
}

.amount-box strong {
  color: var(--gold);
}

.clear-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
}

.filters {
  display: flex;
  gap: 7px;
  margin: 12px 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.filters::-webkit-scrollbar {
  display: none;
}

.filter {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.filter.active {
  border-color:
    rgba(231, 185, 82, .35);
  background:
    rgba(231, 185, 82, .10);
  color: var(--gold);
}

.catalog-info {
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 11px;
}

.currency-list {
  display: grid;
  gap: 8px;
}

.currency-card {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #0a162a;
  color: var(--text);
  text-align: left;
}

.currency-card:active {
  transform: scale(.99);
}

.coin-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 39px;
  height: 39px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
}

.coin-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.currency-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.currency-main strong {
  font-size: 14px;
}

.currency-main small {
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.network-count {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  color: var(--muted);
  font-size: 10px;
}

.network-count strong {
  color: var(--green);
  font-size: 13px;
}

.network-list {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.network-button {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #0a162a;
  color: var(--text);
  text-align: left;
}

.network-button strong {
  text-transform: uppercase;
}

.network-button small {
  color: var(--muted);
}

.network-button.available small {
  color: var(--green);
}

.network-button.unavailable {
  opacity: .48;
}

.network-button.selected {
  border-color:
    rgba(231, 185, 82, .60);
  background:
    rgba(231, 185, 82, .09);
}

.range-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.range-card > div {
  display: flex;
  flex-direction: column;
  padding: 11px;
  border-radius: 14px;
  background: #091426;
}

.range-card span {
  color: var(--muted);
  font-size: 10px;
}

.range-card strong {
  margin-top: 3px;
  font-size: 13px;
}

.primary-button {
  width: 100%;
  min-height: 50px;
  margin-top: 11px;
  border: 0;
  border-radius: 15px;
  background:
    linear-gradient(
      135deg,
      #d5a63f,
      #f0ca72
    );
  color: #09101c;
  font-weight: 900;
}

.primary-button:disabled {
  cursor: not-allowed;
}

.disabled-button {
  opacity: .55;
}

.quote-head,
.conversion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.quote-head > div {
  display: flex;
  flex-direction: column;
}

.availability {
  padding: 7px 10px;
  border-radius: 999px;
  background:
    rgba(53, 209, 138, .12);
  color: var(--green);
  font-size: 10px;
}

.availability.bad {
  background:
    rgba(255, 107, 118, .12);
  color: var(--red);
}

.conversion {
  margin: 18px 0;
}

.conversion > div:not(.arrow) {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.conversion > div:last-child {
  text-align: right;
}

.conversion span {
  color: var(--muted);
  font-size: 10px;
}

.conversion strong {
  margin-top: 4px;
  font-size: 17px;
}

.arrow {
  color: var(--gold);
  font-size: 20px;
}

.notice,
.safe-note {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.notice {
  padding: 11px;
  border-radius: 13px;
  background:
    rgba(76, 161, 255, .07);
}

.safe-note {
  margin: 10px 0 0;
  text-align: center;
}

.error-box {
  margin-top: 10px;
  padding: 10px;
  border:
    1px solid rgba(255, 107, 118, .20);
  border-radius: 12px;
  background:
    rgba(255, 107, 118, .08);
  color: #ff9ba3;
  font-size: 11px;
}

.empty {
  padding: 25px 10px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.gate {
  padding: 40px 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  text-align: center;
}

.gate-icon {
  margin-bottom: 12px;
  font-size: 40px;
}

.gate h1 {
  margin: 0 0 10px;
  font-size: 21px;
}

.gate p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      90deg,
      transparent,
      rgba(255,255,255,.05),
      transparent
    );
  content: "";
  animation:
    shimmer 1.1s infinite;
  transform: translateX(-100%);
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 15px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

footer strong {
  color: var(--gold);
}

@media (max-width: 560px) {

  .hero {
    flex-direction: column;
  }

  .user-card {
    width: 100%;
  }

  .stats {
    grid-template-columns:
      repeat(3, minmax(0, 1fr));
  }

  .stat {
    padding: 10px;
  }

  .stat strong {
    font-size: 17px;
  }
}

/* === CHESSTRX PREPARE V1 === */

.refund-form {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.field-stack {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field-label {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.field-stack small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.text-input {
  width: 100%;
  min-height: 49px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: 0;
  background: #091426;
  color: var(--text);
  font-size: 13px;
}

.text-input:focus {
  border-color:
    rgba(76, 161, 255, .65);
}

.prepared-grid {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.prepared-grid > div {
  display: flex;
  flex-direction: column;
  padding: 11px;
  border-radius: 14px;
  background: #091426;
}

.prepared-grid span {
  color: var(--muted);
  font-size: 10px;
}

.prepared-grid strong {
  margin-top: 4px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.warning-notice {
  border:
    1px solid rgba(231, 185, 82, .20);
  background:
    rgba(231, 185, 82, .07);
}

/* === FIN CHESSTRX PREPARE V1 === */

/* === CHESSTRX PAYMENT RESULT V1 === */

.payment-block {
  margin-top: 18px;
}

.payment-address-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 9px;
}

.payment-address-row code {
  flex: 1;
  min-width: 0;
  padding: 15px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 14px;
  background: rgba(0,0,0,.18);
  overflow-wrap: anywhere;
  word-break: break-all;
  font-size: 14px;
  line-height: 1.45;
}

.copy-button {
  flex: 0 0 auto;
  padding: 13px 14px;
  border: 0;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
}

#paymentSection .primary-button {
  margin-top: 18px;
}

/* === FIN CHESSTRX PAYMENT RESULT V1 === */
