:root {
  --bg: #061420;
  --bg-elevated: #0d2436;
  --bg-card: #0f2b40;
  --line: #1b3d54;
  --text: #eaf6ff;
  --text-dim: #7fa8c2;
  --ice: #6fe3ff;
  --ice-dim: #2c6b82;
  --frost: #b6f2ff;
  --danger: #ff7d7d;
  --radius: 14px;
  font-size: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 15% 0%, #0e3a52 0%, transparent 45%),
    radial-gradient(circle at 90% 15%, #123a4d 0%, transparent 40%),
    var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.display { font-family: 'Fraunces', Georgia, serif; }

header.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(180deg, var(--bg) 75%, transparent);
  padding: 18px 16px 8px;
}

.brand-row { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.brand-row .snowflake { font-size: 18px; color: var(--ice); }

header.top h1 {
  font-size: 22px;
  margin: 0;
  letter-spacing: -0.01em;
  background: linear-gradient(90deg, var(--frost), var(--ice));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

header.top p { margin: 2px 0 0; color: var(--text-dim); font-size: 13px; }

.filter-bar { padding: 10px 16px 6px; }

.filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}
.filter-row::-webkit-scrollbar { display: none; }

.filter-select, .search-box {
  flex: none;
  appearance: none;
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  min-width: 118px;
}
.filter-select:focus, .search-box:focus { outline: none; border-color: var(--ice); }
.search-box { min-width: 140px; color: var(--text); }
.search-box::placeholder { color: var(--text-dim); }
.price-input { min-width: 84px; -moz-appearance: textfield; }
.price-input::-webkit-outer-spin-button,
.price-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.chip-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }

.chip {
  flex: none;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.chip.active { border-color: var(--ice); color: var(--ice); background: rgba(111, 227, 255, 0.08); }

.reset-filters {
  font-size: 12px;
  color: var(--text-dim);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 4px 2px;
  display: inline-block;
}

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 8px 16px 24px; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  position: relative;
}
.card:active { transform: scale(0.97); }
.card:hover { border-color: var(--ice-dim); }

.card .thumb {
  aspect-ratio: 1;
  background: radial-gradient(circle at 30% 20%, #133a52, #081c2a);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.card .thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(111,227,255,0.08), transparent 50%);
  pointer-events: none;
}
.card .thumb img {
  width: 78%;
  height: 78%;
  object-fit: contain;
  filter: drop-shadow(0 6px 18px rgba(0,0,0,0.5)) drop-shadow(0 0 12px rgba(111,227,255,0.15));
}

.card .meta { padding: 10px 12px 12px; }
.card .name {
  font-size: 13.5px;
  font-weight: 600;
  margin: 0 0 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
.card .price { color: var(--ice); font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 4px; }
.card .card-id {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(6, 20, 32, 0.7);
  color: var(--text-dim);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 6px;
}

.empty { text-align: center; padding: 60px 24px; color: var(--text-dim); }
.empty .signature { font-size: 34px; margin-bottom: 8px; }

.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 10, 16, 0.7);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-end;
  z-index: 100;
}
.sheet {
  width: 100%;
  background: var(--bg-elevated);
  border-radius: 20px 20px 0 0;
  padding: 20px 20px 28px;
  border-top: 1px solid var(--line);
  max-height: 85vh;
  overflow-y: auto;
}
.sheet .drag-handle { width: 36px; height: 4px; background: var(--line); border-radius: 2px; margin: 0 auto 16px; }
.sheet .thumb-lg {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius);
  background: radial-gradient(circle at 30% 20%, #133a52, #081c2a);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.sheet .thumb-lg img { width: 60%; height: 60%; object-fit: contain; }
.sheet h2 { margin: 0 0 4px; font-size: 20px; color: var(--frost); }
.sheet .collection { color: var(--text-dim); font-size: 13px; margin: 0 0 16px; }

.attr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 20px; }
.attr { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.attr .k { font-size: 10.5px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.04em; }
.attr .v { font-size: 13px; font-weight: 600; margin-top: 2px; color: var(--text); }

.price-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.price-row .amount { font-size: 26px; font-weight: 700; color: var(--ice); }
.price-row .lock-note { font-size: 11.5px; color: var(--text-dim); }

.pay-methods { display: flex; gap: 8px; margin-bottom: 16px; }
.pay-btn {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  text-align: center;
  cursor: pointer;
}
.pay-btn.active { border-color: var(--ice); color: var(--ice); }

.cta {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(90deg, var(--ice), var(--frost));
  color: #04141f;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}
.cta:disabled { opacity: 0.5; }

.disclaimer { font-size: 11px; color: var(--text-dim); margin-top: 12px; line-height: 1.5; }

.status-view { text-align: center; padding: 40px 20px; }
.status-view .icon { font-size: 40px; margin-bottom: 12px; }
.status-view h2 { margin: 0 0 8px; color: var(--frost); }
.status-view p { color: var(--text-dim); font-size: 14px; }
