/* ===== Wallgold live cards ===== */
.wg-live {
  --wg-ink: #171D26;
  --wg-ink-2: #616161;
  --wg-ink-3: #8A9099;
  --wg-line: #EBEDEF;
  --wg-line-2: #D7DADF;
  --wg-soft: #F5F6F7;
  --wg-gold: #B99C49;
  --wg-gold-deep: #7D641E;
  --wg-gold-soft: #F9F7F0;
  --wg-gold-line: #DDCEA7;

  direction: rtl;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
  font-family: inherit;
  font-feature-settings: "ss02";
  color: var(--wg-ink);
  -webkit-font-smoothing: antialiased;
}
.wg-live *,
.wg-live *::before,
.wg-live *::after { box-sizing: border-box; }

.wg-live .wg-live__status {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 12px;
  line-height: 1.8;
  color: var(--wg-ink-2);
}
.wg-live .wg-live__status[hidden] { display: none; }

/* ---------- Card ---------- */
.wg-live .wg-card {
  --wg-accent: var(--wg-gold-deep);
  --wg-tile-a: var(--wg-gold-soft);
  --wg-tile-b: #F1ECDC;

  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--wg-line);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(23, 29, 38, .04);
  transition: border-color .35s ease;
}
.wg-live .wg-card:hover { border-color: var(--wg-gold-line); }

/* ---------- Head ---------- */
.wg-live .wg-card__head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.wg-live .wg-card__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--wg-tile-a), var(--wg-tile-b));
  color: var(--wg-accent);
}
.wg-live svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.wg-live .wg-card__title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--wg-ink);
  letter-spacing: 0;
}

/* ---------- Last-time row ---------- */
.wg-live .wg-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--wg-line-2);
}
.wg-live .wg-row__label {
  font-size: 13px;
  color: var(--wg-ink-2);
}
.wg-live .wg-row__value {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-align: left;
}
.wg-live .wg-time {
  direction: ltr;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  color: var(--wg-ink);
}
.wg-live .wg-ago {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--wg-ink-3);
  white-space: nowrap;
}

/* ---------- Highlight box ---------- */
.wg-live .wg-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--wg-soft);
  transition: background-color 1s ease, box-shadow 1s ease;
}
.wg-live .wg-box__label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--wg-ink-2);
}
.wg-live .wg-box__value {
  display: flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
}
.wg-live .wg-box__value b {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
  color: var(--wg-ink);
}
.wg-live .wg-box__value small {
  font-size: 12px;
  font-weight: 500;
  color: var(--wg-ink-3);
}

/* last-hour volume, sits right under the amount box */
.wg-live .wg-box--total {
  margin-top: -8px;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--wg-line);
}
.wg-live .wg-box--total .wg-box__value b { font-size: 20px; }
.wg-live .wg-box[hidden] { display: none; }

/* flash when a new event arrives (instant on, 1s fade out) */
.wg-live .wg-card.is-new .wg-box:not(.wg-box--total) {
  background: var(--wg-gold-soft);
  box-shadow: inset 0 0 0 1px var(--wg-gold-line);
  transition: none;
}
.wg-live .wg-card.is-new .wg-time,
.wg-live .wg-card.is-new .wg-box--total b { animation: wg-pop .6s ease; }

/* ---------- Footer ---------- */
.wg-live .wg-card__foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--wg-gold-soft);
  font-size: 12px;
  line-height: 1.7;
  color: var(--wg-gold-deep);
}
.wg-live .wg-card__foot svg { flex: none; width: 16px; height: 16px; }
.wg-live .wg-card__foot b { font-weight: 700; }
.wg-live .wg-card__foot[hidden] { display: none; }

/* ---------- Animations ---------- */
@keyframes wg-pop {
  0% { transform: translateY(4px); opacity: .2; }
  100% { transform: none; opacity: 1; }
}

/* ---------- Responsive ---------- */
@media (min-width: 640px) {
  /* Fill the same area as the one-minute and hourly-volume boxes in the adjacent card. */
  .wg-live .wg-card--trade > .wg-box { flex-grow: 1; }
}

@media (max-width: 639px) {
  .wg-live { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .wg-live .wg-card--trade { order: 1; }
  .wg-live .wg-card--deposit { order: 2; }
  .wg-live .wg-card--withdraw { order: 3; }
  .wg-live .wg-card--delivery { order: 4; }
  .wg-live .wg-live__status { order: 6; }
  .wg-live .wg-card { padding: 16px; gap: 14px; }
  .wg-live .wg-card__icon { width: 40px; height: 40px; }
  .wg-live .wg-card__title { font-size: 15px; }
  .wg-live .wg-box__value b { font-size: 22px; }
  .wg-live .wg-box--total .wg-box__value b { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .wg-live .wg-card { transition: none; }
  .wg-live .wg-card.is-new .wg-time,
  .wg-live .wg-card.is-new .wg-box--total b { animation: none; }
}
