/*
 * The money side of the interface: the account chip and its menu, the connect
 * dialog, deposit and withdraw, the transaction list and the strip of past
 * results.
 *
 * Same palette as the board, quieter. A screen where somebody is typing an
 * amount is for reading carefully, not for atmosphere.
 */

.icon-button {
  font-weight: 500;
}

/* ------------------------------------------------------------ the account */

.account {
  position: relative;
}

.account-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 10px 0 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.account-chip:hover {
  border-color: var(--text-faint);
}

.account-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--up);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.15);
}

.account-address {
  font-family: var(--mono);
  font-size: 13px;
}

.account-caret {
  color: var(--text-faint);
  font-size: 11px;
}

.account-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 190px;
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/*
 * A menu told to be hidden must be hidden.
 *
 * The display above beats the browser own rule for the hidden attribute, so
 * without this line the account menu sat open on the page from the moment
 * somebody signed in.
 */
.account-menu[hidden] {
  display: none;
}

.account-menu button {
  text-align: left;
  padding: 9px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.account-menu button:hover {
  background: var(--bg-deep);
}

.account-menu button.danger {
  color: var(--down);
}

.account-menu hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 4px 2px;
}

/* ------------------------------------------------------- connect dialog */

.modal.wide {
  max-width: 620px;
}

.modal-lead {
  margin: 0 0 4px;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.5;
}

.modal-fine {
  margin: 2px 0 0;
  color: var(--text-faint);
  font-size: 12px;
  line-height: 1.5;
}

.wallet-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wallet-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--bg-deep);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition:
    border-color 120ms ease,
    background 120ms ease;
}

.wallet-option:hover:not(:disabled) {
  border-color: var(--gold-dark);
  background: #121c2f;
}

.wallet-option:disabled {
  opacity: 0.6;
  cursor: wait;
}

.wallet-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex: none;
}

/* A missing brand file leaves a gap rather than a wrong mark. */
.wallet-logo.missing {
  visibility: hidden;
}

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

.wallet-state {
  margin-left: auto;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
}

.wallet-option[data-missing] .wallet-state {
  color: var(--gold);
}

/* ------------------------------------------------- deposit and withdraw */

.kv {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-deep);
}

.kv.tight {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 10px 14px;
}

.kv div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.kv dt {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
}

.kv dd {
  margin: 0;
  font-size: 14px;
}

.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.pill {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid rgba(245, 185, 66, 0.35);
  color: var(--gold);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.amount-field.wide {
  width: 100%;
  height: 44px;
}

.amount-field.wide input {
  flex: 1;
  width: auto;
  font-size: 15px;
}

.quick-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-deep);
  font-size: 13px;
  color: var(--text-dim);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
  background: var(--text-faint);
}

.dot.pending,
.dot.confirming,
.dot.sending,
.dot.broadcast,
.dot.review {
  background: var(--gold);
  animation: pulse 1.4s ease-in-out infinite;
}

.dot.confirmed,
.dot.completed {
  background: var(--up);
}

.dot.failed,
.dot.rejected {
  background: var(--down);
}

@keyframes pulse {
  50% {
    opacity: 0.35;
  }
}

.tx-link {
  margin-left: auto;
  color: var(--text-faint);
  font-size: 12px;
  border-bottom: 1px solid var(--line-2);
  text-decoration: none;
}

.tx-link:hover {
  color: var(--text);
}

/* ----------------------------------------------------- transaction list */

.tx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.tx-table th,
.tx-table td {
  padding: 9px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.tx-table th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  font-weight: 600;
}

.tx-table tbody tr:last-child td {
  border-bottom: 0;
}

.tx-table .num {
  text-align: right;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.tx-table .num.in {
  color: var(--up);
}

.tx-table .num.out {
  color: var(--text-dim);
}

.tx-table .muted {
  color: var(--text-faint);
}

.status {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid var(--line-2);
  color: var(--text-dim);
}

.status.ok {
  color: var(--up);
  border-color: rgba(52, 211, 153, 0.35);
}

.status.wait {
  color: var(--gold);
  border-color: rgba(245, 185, 66, 0.3);
}

.status.bad {
  color: var(--down);
  border-color: rgba(248, 113, 113, 0.3);
}

/* --------------------------------------------------------- last results */

.rolls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 8px 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.rolls-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  white-space: nowrap;
}

.rolls-list {
  list-style: none;
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  scrollbar-width: none;
  mask-image: linear-gradient(90deg, #000 88%, transparent);
}

.rolls-list::-webkit-scrollbar {
  display: none;
}

.roll {
  flex: none;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px 4px 5px;
  border-radius: 999px;
  background: var(--bg-deep);
  border: 1px solid var(--line-2);
}

.roll-mark {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
}

.roll-mark svg,
.roll-mark img {
  width: 100%;
  height: 100%;
}

.roll-label {
  font-size: 11px;
  color: var(--text-dim);
}

.roll.solana .roll-mark {
  color: var(--solana);
}

.roll.robinhood .roll-mark {
  color: var(--robinhood);
}

.roll.dice {
  border-color: rgba(245, 185, 66, 0.45);
}

.roll.dice .roll-mark,
.roll.dice .roll-label {
  color: var(--gold);
}

@media (max-width: 720px) {
  .account-menu {
    right: auto;
    left: 0;
  }

  .tx-table th:nth-child(4),
  .tx-table td:nth-child(4) {
    display: none;
  }
}

/*
 * Handing in a transfer the page never saw.
 *
 * Folded away by default: it is a recovery path, not a step, and a deposit
 * screen that leads with "something went wrong" invites the question.
 */
.deposit-recover {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.deposit-recover summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--text-faint);
  list-style: none;
}

.deposit-recover summary::-webkit-details-marker {
  display: none;
}

.deposit-recover summary::before {
  content: '+ ';
  color: var(--gold);
}

.deposit-recover[open] summary::before {
  content: '− ';
}

.deposit-recover summary:hover {
  color: var(--text);
}

.deposit-recover .amount-field {
  margin-top: 10px;
}

.deposit-recover input {
  font-family: var(--mono);
  font-size: 12px;
}
