/* Wallet: the header balance menu, and the wallet, vault and settings modals. */

/* Balance menu */
.wallet-menu {
  position: absolute;
  top: calc(100% + var(--space-2));
  left: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  width: 300px;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  box-shadow: 0 16px 40px rgb(0 0 0 / calc(0.45 * var(--shade)));
}

.wallet-menu[hidden] {
  display: none;
}

.wallet-menu__title {
  margin: 0;
  padding: var(--space-3) var(--space-4) 6px;
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 700;
}

.wallet-menu__row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px var(--space-4);
  font-size: 15px;
}

.wallet-menu__row span {
  flex: 1;
}

.wallet-menu__row strong {
  font-variant-numeric: tabular-nums;
}

.wallet-menu__row .icon {
  color: var(--ink-muted);
}

.wallet-menu__fiat {
  margin: 0;
  padding: var(--space-1) var(--space-4) var(--space-3);
  color: var(--ink-muted);
  font-size: 12px;
}

.wallet-menu__settings {
  display: grid;
  place-items: center;
  height: var(--control-lg);
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.wallet-menu__settings:hover {
  background: var(--surface-3);
}

/* Modal parts */
.wallet-tabs {
  display: flex;
}

.wallet-tabs a {
  flex: 1;
  justify-content: center;
}

.wallet-back {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

.wallet-back:hover {
  color: var(--focus);
}

.wallet-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-0);
}

.wallet-card__label,
.wallet-card__meta {
  color: var(--ink-muted);
  font-size: 13px;
}

.wallet-card__label {
  font-weight: 600;
}

.wallet-card__amount {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 30px;
  font-variant-numeric: tabular-nums;
}

.wallet-card__amount .chip-mark {
  width: 20px;
  height: 20px;
}

.wallet-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.wallet-actions .button {
  padding-inline: var(--space-3);
}

.wallet-history__list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.wallet-history__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--surface-2);
}

.wallet-history__item:last-child {
  border-bottom: 0;
}

.wallet-history__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink-muted);
}

.wallet-history__icon--win {
  color: var(--win);
}

.wallet-history__icon--accent {
  color: var(--focus);
}

.wallet-history__text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  font-size: 14px;
}

.wallet-history__text time {
  color: var(--ink-muted);
  font-size: 12px;
}

.wallet-history__amount {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.wallet-history__amount.is-positive {
  color: var(--win);
}

.wallet-history__empty {
  margin: 0;
  padding: var(--space-2) 0;
  color: var(--ink-muted);
  font-size: 14px;
}

.wallet-history__all,
.wallet-foot a,
.wallet-more summary {
  color: var(--focus);
  font-weight: 600;
  text-decoration: none;
}

.wallet-history__all {
  align-self: center;
  font-size: 14px;
}

/* Coin and network pickers */
/* The network's names are the longer ones, like "TRON (TRC20)", so they get the wider half. */
.coin-picker {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 10px;
}

.select-control {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  height: var(--control-md);
  padding: 0 var(--space-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--field);
}

.select-control:focus-within {
  border-color: var(--focus);
}

.select-control__input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: none;
  appearance: none;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.select-control__input option {
  background: var(--surface-1);
}

.select-control > .icon {
  flex: none;
  color: var(--ink-muted);
  pointer-events: none;
}

.coin-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--coin);
  color: var(--on-accent);
  font-size: 12px;
  font-weight: 700;
}

.copy-field__mono {
  font-family: ui-monospace, Menlo, monospace;
}

/* Deposit */
.deposit-info {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.deposit-qr {
  flex: none;
  width: 140px;
  height: 140px;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: #FFFFFF;
}

.deposit-qr svg {
  display: block;
  width: 100%;
  height: 100%;
}

.deposit-presets {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.deposit-preset {
  min-width: 56px;
  height: 36px;
  padding: 0 var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.deposit-preset:hover {
  border-color: var(--focus);
}

.deposit-order {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.deposit-order__status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--surface-0);
}

.deposit-order__clock {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  color: var(--ink-muted);
  font-size: 13px;
}

.deposit-order__clock strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.deposit-order__amount {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
}

.deposit-order__unit {
  align-self: center;
  color: var(--ink-muted);
  font-weight: 700;
}

.deposit-order__no {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 13px;
}

.deposit-order__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.deposit-order__link {
  display: inline-flex;
  align-items: center;
  min-height: var(--control-md);
  font-size: 14px;
}

.deposit-order__cancel {
  min-height: var(--control-md);
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--ink-muted);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.deposit-order__cancel:hover {
  color: var(--ink);
}

.deposit-order__simulate {
  align-self: flex-start;
}

.deposit-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) 0;
  text-align: center;
}

.deposit-result__icon {
  color: var(--ink-muted);
}

.deposit-result[data-state="credited"] .deposit-result__icon {
  color: var(--win);
}

.deposit-result[data-state="review"] .deposit-result__icon,
.deposit-result[data-state="failed"] .deposit-result__icon {
  color: var(--tile-amber);
}

.deposit-result__title {
  margin: var(--space-1) 0 0;
  font-size: 17px;
  font-weight: 700;
}

.deposit-result__body {
  margin: 0;
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.7;
}



.info-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  margin: 0;
  font-size: 14px;
}

.info-list div {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
}

.info-list dt {
  color: var(--ink-muted);
}

.info-list dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
}

.info-list--box {
  gap: var(--space-2);
  padding: var(--space-3) 14px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

.info-list--box div:first-child dd {
  font-weight: 400;
}

.info-list--box div:last-child dd {
  font-weight: 700;
}

.wallet-notice {
  display: flex;
  gap: var(--space-2);
  margin: 0;
  padding: 10px var(--space-3);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--ink-muted);
  font-size: 13px;
}

.wallet-notice .icon {
  flex: none;
  margin-top: 1px;
  color: var(--tile-amber);
}

.wallet-foot {
  margin: 0;
  color: var(--ink-muted);
  font-size: 14px;
  text-align: center;
}

.wallet-note {
  margin: 0;
  color: var(--ink-muted);
  font-size: 12px;
  text-align: center;
}

.wallet-note--start {
  font-size: 13px;
  text-align: left;
}

.wallet-empty,
.wallet-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-6) var(--space-2);
  color: var(--ink-muted);
  text-align: center;
}

.wallet-empty p,
.wallet-done p {
  margin: 0;
}

.wallet-empty__title,
.wallet-done__title {
  color: var(--ink);
  font-weight: 700;
}

.wallet-done {
  gap: var(--space-3);
  padding-block: var(--space-2);
}

.wallet-done > .icon {
  color: var(--win);
}

.wallet-done__title {
  font-family: var(--font-display);
  font-size: 20px;
}

.wallet-done__address {
  max-width: 100%;
  padding: var(--space-2) var(--space-3);
  overflow-wrap: anywhere;
  border-radius: 8px;
  background: var(--surface-0);
  color: var(--ink);
  font-size: 13px;
}

.wallet-done .button {
  align-self: stretch;
}

/* Vault */
.vault-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  margin: 0;
}

.vault-tiles div {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-3) 14px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

.vault-tiles dt {
  color: var(--ink-muted);
  font-size: 12px;
}

.vault-tiles dd {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.wallet-more {
  align-self: center;
  text-align: center;
}

.wallet-more summary {
  font-size: 14px;
  list-style: none;
  cursor: pointer;
}

.wallet-more summary::-webkit-details-marker {
  display: none;
}

.wallet-more p {
  margin: var(--space-2) 0 0;
  color: var(--ink-muted);
  font-size: 13px;
  text-align: left;
}

/* Settings */
.wallet-settings {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.setting {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  cursor: pointer;
}

.setting__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.setting__title {
  font-size: 15px;
  font-weight: 600;
}

.setting__hint {
  color: var(--ink-muted);
  font-size: 13px;
}

/* Shown once deposit mail is switched off: the bell and the corner still tell. */
.setting__off-note {
  display: none;
  align-items: flex-start;
  gap: var(--space-2);
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  font-size: 13px;
  line-height: 1.6;
}

.setting__off-note .icon {
  flex: none;
  margin-top: 2px;
  color: var(--focus);
}

.setting:has(.switch-input:not(:checked)) .setting__off-note {
  display: flex;
}

/* A row that can't be switched: mail about the player's money. */
.setting--fixed {
  cursor: default;
}

.setting__lock {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 26px;
  border-radius: var(--radius-full);
  background: var(--surface-3);
  color: var(--ink);
}

.setting__always {
  display: inline-flex;
  align-items: center;
  height: 20px;
  margin-left: var(--space-2);
  padding: 0 var(--space-2);
  border-radius: var(--radius-full);
  background: var(--surface-2);
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 600;
  vertical-align: 1px;
}

.switch-input {
  position: relative;
  flex: none;
  width: 44px;
  height: 26px;
  margin: 0;
  border-radius: var(--radius-full);
  appearance: none;
  background: var(--surface-3);
  cursor: pointer;
  transition: background 0.15s;
}

.switch-input::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ink-muted);
  transition: transform 0.15s, background 0.15s;
}

.switch-input:checked {
  background: var(--accent);
}

.switch-input:checked::before {
  background: var(--on-accent);
  transform: translateX(18px);
}

.switch-input:focus-visible,
.currency-option:has(:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.currency-options {
  margin: 0;
  padding: 0;
  border: 0;
}

.currency-options legend {
  margin: 0 0 var(--space-2);
  padding: 0;
}

.currency-options__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
}

.currency-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font-size: 14px;
  cursor: pointer;
}

.currency-option:has(:checked) {
  border-color: var(--accent);
  background: var(--surface-2);
  font-weight: 600;
}

.currency-option input {
  margin: 0;
  accent-color: var(--accent);
}

@media (max-width: 767px) {
  /* 320px wide, centred under the header's wallet. */
  .wallet-menu {
    position: fixed;
    top: calc(var(--phone-header-height) + var(--space-1));
    left: 50%;
    width: min(320px, 100% - 32px);
    translate: -50% 0;
  }

  .deposit-info {
    flex-direction: column;
    align-items: stretch;
  }

  .deposit-qr {
    align-self: center;
  }
}

.modal__body .copy-field .icon-button {
  flex: none;
  width: var(--control-md);
  height: var(--control-md);
  background: var(--surface-3);
}

/* Chip amounts are typed or filled by "Max"; the spinner arrows only crowd the field. */
.field__affix--max input {
  -moz-appearance: textfield;
}

.field__affix--max input::-webkit-inner-spin-button,
.field__affix--max input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.modal__body:has(.wallet-settings) {
  gap: var(--space-4);
}

/* The empty wallet: art across the top, a line, and the way to deposit. */
.wallet-start {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.wallet-start__art {
  width: calc(100% + 2 * var(--space-5));
  margin: 0 calc(-1 * var(--space-5));
  aspect-ratio: 1000 / 440;
  object-fit: cover;
}

.wallet-start__text {
  margin: 0;
  color: var(--ink-muted);
  text-align: center;
}

.wallet-start__deposit {
  width: 100%;
}
