:root {
  color-scheme: dark;
  --gold: #d6a64a;
  --gold-soft: rgba(214, 166, 74, 0.45);
  --panel: rgba(4, 6, 9, 0.62);
  --text: #fff8e2;
  --muted: #b8a981;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  min-width: 320px;
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.42)),
    url("./spam_bank_background.png") center top / cover fixed no-repeat;
}

a {
  color: inherit;
}

.bank-shell {
  position: relative;
  min-height: 100vh;
  padding: clamp(225px, 27vh, 315px) clamp(16px, 4vw, 56px) 56px;
}

.bank-nav {
  position: absolute;
  inset: 0 0 auto;
  z-index: 2;
  height: clamp(205px, 25vh, 290px);
  pointer-events: none;
}

.bank-nav__button,
.contract-strip__copy {
  border: 1px solid rgba(247, 215, 123, 0.72);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
  color: #fff3bd;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.42);
}

.bank-nav__button {
  position: absolute;
  top: clamp(118px, 14vw, 176px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 104px;
  min-height: 40px;
  padding: 10px 18px;
  pointer-events: auto;
}

.bank-nav__button--about {
  left: max(20px, calc(50% - 420px));
}

.bank-nav__button--buy {
  right: max(20px, calc(50% - 420px));
}

.bank-nav__button:hover,
.bank-nav__button:focus-visible,
.contract-strip__copy:hover:not(:disabled),
.contract-strip__copy:focus-visible:not(:disabled) {
  background: rgba(214, 166, 74, 0.18);
}

.bank-nav__button[aria-disabled="true"] {
  opacity: 0.58;
  pointer-events: none;
}

.contract-strip {
  position: absolute;
  top: clamp(185px, 20vw, 242px);
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(720px, calc(100% - 28px));
  min-height: 38px;
  gap: 8px;
  padding: 7px 10px;
  transform: translateX(-50%);
  border: 1px solid rgba(214, 166, 74, 0.26);
  background: rgba(0, 0, 0, 0.58);
  color: var(--text);
  pointer-events: auto;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
}

.contract-strip__label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.contract-strip__address {
  min-width: 0;
  overflow: hidden;
  color: #fff4c7;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contract-strip__copy {
  flex: 0 0 auto;
  padding: 7px 11px;
  font-size: 11px;
}

.contract-strip__copy:disabled {
  cursor: default;
  opacity: 0.45;
}

.contract-strip__status {
  flex: 0 0 auto;
  min-width: 58px;
  color: #f7d77b;
  font-size: 12px;
  font-weight: 800;
}

.coin-panel {
  width: min(1260px, 100%);
  margin: 0 auto;
  padding: clamp(14px, 2vw, 24px);
  border: 1px solid rgba(214, 166, 74, 0.28);
  background: linear-gradient(180deg, rgba(2, 3, 5, 0.52), rgba(2, 3, 5, 0.72));
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}

.bank-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 16px;
}

.status {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status:empty {
  display: none;
}

.cycle-timer {
  display: grid;
  gap: 3px;
  min-width: 146px;
  text-align: right;
}

.cycle-timer__label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.1;
  text-transform: uppercase;
}

.cycle-timer__value {
  color: #f7d77b;
  font-size: clamp(22px, 3vw, 34px);
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
}

.coin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: clamp(12px, 1.6vw, 20px);
}

.coin-card {
  position: relative;
  display: block;
  min-width: 0;
  overflow: hidden;
  aspect-ratio: 1;
  border: 1px solid rgba(214, 166, 74, 0.46);
  background: #050607;
  color: var(--text);
  text-decoration: none;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.46);
}

.coin-card:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.coin-image,
.fallback-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.fallback-image {
  display: grid;
  place-items: center;
  padding: 20px;
  color: #f4d78f;
  font-size: clamp(28px, 5vw, 58px);
  font-weight: 900;
  background:
    radial-gradient(circle at 35% 30%, rgba(214, 166, 74, 0.28), transparent 36%),
    linear-gradient(135deg, #090a0d, #201606 56%, #060607);
}

.coin-count {
  position: absolute;
  top: 9px;
  right: 9px;
  max-width: calc(100% - 18px);
  overflow: hidden;
  padding: 5px 8px;
  border: 1px solid rgba(247, 215, 123, 0.72);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff3bd;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
  text-transform: uppercase;
  white-space: nowrap;
}

.coin-meta {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  gap: 2px;
  padding: 34px 12px 11px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.88));
}

.coin-name {
  overflow: hidden;
  color: #fff8df;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.05;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
}

.coin-symbol {
  overflow: hidden;
  color: #e4bd67;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.load-more {
  display: block;
  margin: 22px auto 0;
  padding: 10px 18px;
  border: 1px solid rgba(214, 166, 74, 0.72);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.58);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.load-more:hover,
.load-more:focus-visible {
  background: rgba(214, 166, 74, 0.16);
}

.empty-state {
  width: min(560px, calc(100% - 32px));
  margin: clamp(245px, 32vh, 360px) auto 0;
  padding: 22px;
  border: 1px solid rgba(214, 166, 74, 0.32);
  background: rgba(0, 0, 0, 0.66);
  text-align: center;
}

.empty-state h1 {
  margin: 0 0 10px;
  font-size: 28px;
}

.empty-state a {
  color: #e8c36b;
  font-weight: 800;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.74);
}

.modal__panel {
  position: relative;
  width: min(620px, 100%);
  max-height: min(680px, calc(100vh - 36px));
  overflow: auto;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid rgba(214, 166, 74, 0.48);
  background: linear-gradient(180deg, rgba(10, 9, 7, 0.96), rgba(2, 3, 5, 0.98));
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.72);
}

.modal__panel h1 {
  margin: 0 0 16px;
  color: #f7d77b;
  font-size: clamp(28px, 5vw, 44px);
  letter-spacing: 0.02em;
}

.modal__panel p {
  margin: 0 0 14px;
  color: #f8ecd0;
  font-size: 16px;
  line-height: 1.58;
}

.modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(214, 166, 74, 0.5);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff3bd;
  cursor: pointer;
  font: inherit;
  font-size: 24px;
  line-height: 1;
}

.modal-open {
  overflow: hidden;
}

@media (max-width: 720px) {
  body {
    background-attachment: scroll;
  }

  .bank-shell {
    padding-top: clamp(215px, 33vh, 260px);
  }

  .bank-nav {
    height: 210px;
  }

  .bank-nav__button {
    top: 116px;
    min-width: 82px;
    min-height: 34px;
    padding: 8px 12px;
    font-size: 11px;
  }

  .bank-nav__button--about {
    left: 12px;
  }

  .bank-nav__button--buy {
    right: 12px;
  }

  .contract-strip {
    top: 164px;
    justify-content: flex-start;
    min-height: 34px;
  }

  .contract-strip__address {
    font-size: 11px;
  }

  .contract-strip__status {
    min-width: 0;
    font-size: 11px;
  }

  .coin-panel {
    padding: 12px;
  }

  .bank-topline {
    flex-direction: column-reverse;
    gap: 10px;
  }

  .cycle-timer {
    min-width: 0;
    text-align: left;
  }

  .coin-grid {
    grid-template-columns: repeat(auto-fill, minmax(122px, 1fr));
  }
}
