:root {
  --bg: #07070a;
  --card: #121218;
  --card2: #1a1a22;
  --text: #f4f4f6;
  --muted: #8b8b9a;
  --accent: #f5c518;
  --green: #3dd68c;
  --red: #ff5c5c;
  --orange: #ff9f43;
  --border: rgba(255,255,255,0.07);
  --radius: 18px;
  --shadow: 0 12px 40px rgba(0,0,0,0.45);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(245,197,24,0.12), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(80,60,200,0.08), transparent);
}

.app { max-width: 480px; margin: 0 auto; padding: 12px 14px 28px; }

.top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.brand { display: flex; gap: 10px; align-items: center; }
.logo { font-size: 28px; filter: drop-shadow(0 0 12px rgba(245,197,24,0.4)); }
.title { font-weight: 700; font-size: 17px; letter-spacing: -0.02em; }
.sub { font-size: 12px; color: var(--muted); }

.size-toggle {
  display: flex; background: var(--card); border-radius: 10px;
  border: 1px solid var(--border); overflow: hidden;
}
.size-toggle button {
  background: transparent; border: 0; color: var(--muted);
  padding: 6px 10px; font-size: 12px; font-weight: 600; cursor: pointer;
}
.size-toggle button.on { background: var(--accent); color: #111; }

.search-bar {
  display: flex; gap: 8px; margin-bottom: 16px;
}
.search-bar input {
  flex: 1; background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px; color: var(--text); font-size: 15px;
  outline: none;
}
.search-bar input:focus { border-color: rgba(245,197,24,0.45); }
.search-bar button {
  background: var(--accent); color: #111; border: 0; border-radius: 12px;
  padding: 0 16px; font-weight: 700; font-size: 14px; cursor: pointer;
}

.card-root { min-height: 200px; }
.empty {
  text-align: center; padding: 48px 20px; color: var(--muted);
}
.empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.7; }

/* ===== GIFT CARD ===== */
.gift-card {
  background: linear-gradient(160deg, var(--card) 0%, #0e0e14 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: rise 0.35s ease;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.card-hero {
  position: relative;
  padding: 20px 18px 16px;
  background:
    linear-gradient(135deg, rgba(245,197,24,0.08), transparent 50%),
    var(--card2);
  border-bottom: 1px solid var(--border);
}
.hero-top { display: flex; gap: 14px; align-items: flex-start; }
.hero-emoji {
  font-size: 42px; line-height: 1;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,0.4));
}
.hero-meta { flex: 1; min-width: 0; }
.hero-name {
  font-size: 20px; font-weight: 800; letter-spacing: -0.03em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hero-model {
  margin-top: 4px; font-size: 13px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hero-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag {
  font-size: 11px; font-weight: 600; padding: 4px 8px;
  border-radius: 8px; background: rgba(255,255,255,0.06);
  color: var(--muted);
}
.tag.rarity { color: var(--accent); background: rgba(245,197,24,0.12); }
.tag.num { color: #9ab; }

.floor-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 8px;
  padding: 14px 18px;
}
.floor-box {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
}
.floor-box .lbl { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.floor-box .val { font-size: 16px; font-weight: 800; margin-top: 4px; }
.floor-box.best .val { color: var(--accent); }
.floor-box .val small { font-size: 11px; font-weight: 600; color: var(--muted); }

.section {
  border-top: 1px solid var(--border);
  padding: 0;
}
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px; cursor: pointer; user-select: none;
}
.section-head:active { background: rgba(255,255,255,0.03); }
.section-title { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.section-title .badge {
  font-size: 11px; background: rgba(255,255,255,0.08);
  padding: 2px 7px; border-radius: 99px; color: var(--muted); font-weight: 600;
}
.chev {
  width: 20px; height: 20px; color: var(--muted);
  transition: transform 0.2s ease;
}
.section.open .chev { transform: rotate(180deg); }

.section-body {
  display: none; padding: 0 12px 14px;
}
.section.open .section-body { display: block; }

.sale-row, .list-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 8px; border-radius: 10px;
  font-size: 13px;
}
.sale-row:nth-child(odd), .list-row:nth-child(odd) {
  background: rgba(255,255,255,0.025);
}
.sale-left, .list-left { display: flex; align-items: center; gap: 8px; color: var(--muted); min-width: 0; }
.sale-price, .list-price { font-weight: 700; font-variant-numeric: tabular-nums; }
.sale-price.deal { color: var(--green); }
.sale-price.high { color: var(--red); }
.src-pill {
  font-size: 10px; padding: 2px 6px; border-radius: 6px;
  background: rgba(255,255,255,0.06); color: var(--muted); text-transform: uppercase;
}
.src-pill.tonnel { color: #7ec8ff; }
.src-pill.mrkt { color: #f5c518; }
.src-pill.portals { color: #c9a0ff; }

.muted-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 16px; }

/* sizes */
.size-small .hero-emoji { font-size: 28px; }
.size-small .hero-name { font-size: 16px; }
.size-small .floor-row { grid-template-columns: 1fr 1fr; }
.size-small .floor-box:nth-child(n+3) { display: none; }
.size-small .floor-box .val { font-size: 14px; }
.size-small .section-body { max-height: 180px; overflow: auto; }

.size-large .hero-emoji { font-size: 56px; }
.size-large .hero-name { font-size: 24px; }
.size-large .floor-box .val { font-size: 20px; }
.size-large .sale-row, .size-large .list-row { padding: 12px 10px; font-size: 14px; }

.foot {
  margin-top: 18px; display: flex; justify-content: space-between;
  font-size: 11px; color: var(--muted); opacity: 0.7;
}

.loading {
  text-align: center; padding: 40px; color: var(--muted);
}
.spinner {
  width: 28px; height: 28px; border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent); border-radius: 50%;
  margin: 0 auto 12px; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-box {
  background: rgba(255,92,92,0.1); border: 1px solid rgba(255,92,92,0.3);
  color: #ffb0b0; padding: 16px; border-radius: 12px; font-size: 14px;
}