:root {
  --bg: #0b0818;
  --bg-deep: #070511;
  --panel: rgba(16, 10, 36, 0.78);
  --panel-strong: rgba(22, 14, 52, 0.96);
  --line: rgba(180, 140, 255, 0.18);
  --text: #f0eeff;
  --muted: #a99ec8;
  --gold: #ffe066;
  --gold-strong: #ffbb00;
  --sky: #7dd4fc;
  --mint: #6effd4;
  --rose: #ff7eb3;
  --violet: #c084fc;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.modal-open { overflow: hidden; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background:
    radial-gradient(ellipse at 15% 0%, rgba(180, 80, 255, 0.22), transparent 38%),
    radial-gradient(ellipse at 85% 5%, rgba(255, 200, 50, 0.15), transparent 30%),
    radial-gradient(ellipse at 50% 100%, rgba(80, 200, 255, 0.12), transparent 40%),
    radial-gradient(ellipse at 0% 60%, rgba(255, 80, 160, 0.1), transparent 32%),
    linear-gradient(175deg, #110824 0%, #080516 50%, #05030f 100%);
}

.noise, .grid-glow { position: fixed; inset: 0; pointer-events: none; }

.noise {
  opacity: 0.1;
  background-image:
    radial-gradient(rgba(255,255,255,0.3) 0.4px, transparent 0.4px),
    radial-gradient(rgba(255,255,255,0.12) 0.4px, transparent 0.4px);
  background-size: 5px 5px, 7px 7px;
  background-position: 0 0, 1px 1px;
}

.grid-glow {
  opacity: 0.28;
  background:
    linear-gradient(rgba(192, 140, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(192, 140, 255, 0.06) 1px, transparent 1px);
  background-size: 100px 100px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 72%);
}

/* ── Ticker ── */
.ticker-wrap {
  display: flex;
  align-items: center;
  gap: 0;
  overflow: hidden;
  background: rgba(10, 6, 24, 0.9);
  border-bottom: 1px solid rgba(192, 132, 252, 0.2);
  height: 38px;
  position: relative;
  z-index: 10;
}

.ticker-label {
  flex-shrink: 0;
  padding: 0 14px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--violet);
  border-right: 1px solid rgba(192, 132, 252, 0.2);
  height: 100%;
  display: flex;
  align-items: center;
  background: rgba(192, 132, 252, 0.08);
}

.ticker-track { flex: 1; overflow: hidden; }

.ticker-inner {
  display: inline-flex;
  align-items: center;
  gap: 0;
  white-space: nowrap;
  animation: ticker-scroll 60s linear infinite;
}

.ticker-inner:hover { animation-play-state: paused; }

@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px;
  font-size: 0.82rem;
}

.ticker-name { color: var(--text); }
.ticker-price { color: var(--mint); font-weight: 700; }
.ticker-market { color: var(--muted); }
.ticker-ago { color: rgba(169, 158, 200, 0.5); font-size: 0.76rem; }
.ticker-sep { color: rgba(192, 132, 252, 0.4); padding: 0 4px; }

/* ── Layout ── */
.shell {
  width: min(1220px, calc(100% - 28px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 0 10px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}

.brand-orb {
  width: 52px;
  height: 52px;
  filter: drop-shadow(0 8px 20px rgba(200, 60, 60, 0.3));
  transition: transform 220ms ease;
}
.brand-orb:hover { transform: rotate(10deg) scale(1.08); }

h1, h2, h3, h4 { margin: 0; font-family: "Sora", sans-serif; letter-spacing: -0.035em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.55rem); }
h2 { font-size: clamp(2.4rem, 6vw, 4.4rem); line-height: 0.96; }
h3 { font-size: clamp(1.28rem, 2vw, 1.8rem); }
h4, p { margin: 0; }

.gradient-heading {
  background: linear-gradient(135deg, #fff 0%, #d8b4fe 35%, #ffe066 70%, #fff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% 200%;
  animation: heading-shimmer 6s ease infinite;
}

@keyframes heading-shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.eyebrow, .meta-label {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  color: var(--muted);
}

.topbar-actions, .hero-actions, .chip-row, .listing-tags, .listing-footer, .hero-badges, .detail-pills, .detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-button, .ghost-button, .filter-chip, .watch-button {
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.85rem 1.2rem;
  font: inherit;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.primary-button {
  color: #0b0818;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-strong) 60%, #ff9e00 100%);
  box-shadow: 0 14px 32px rgba(255, 187, 0, 0.32);
  font-weight: 600;
}

.ghost-button, .filter-chip, .watch-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--line);
}

.primary-button:hover, .ghost-button:hover, .filter-chip:hover, .watch-button:hover {
  transform: translateY(-2px);
}

.primary-button:hover {
  box-shadow: 0 20px 40px rgba(255, 187, 0, 0.42);
}

/* ── Hero ── */
.hero, .trainer-deck, .info-grid, .detail-columns { display: grid; gap: 20px; }

.hero {
  grid-template-columns: 1.18fr 0.92fr;
  padding: 20px 0;
}

.hero-copy, .hero-panel, .deck-card, .control-panel, .info-card, .roadmap article, .listing-card, .featured-strip {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-copy, .hero-panel, .control-panel, .info-card, .roadmap article { padding: 24px; }

.hero-copy::before, .hero-panel::before, .deck-card::before, .listing-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at top left, rgba(200, 140, 255, 0.13), transparent 28%),
    radial-gradient(circle at top right, rgba(255, 220, 80, 0.1), transparent 26%);
}

.hero-copy p { max-width: 58ch; margin-top: 18px; color: var(--muted); font-size: 1.05rem; line-height: 1.7; }

.status-pill {
  display: inline-flex;
  padding: 0.42rem 0.82rem;
  border-radius: 999px;
  border: 1px solid rgba(110, 255, 200, 0.3);
  color: var(--mint);
  background: rgba(80, 255, 180, 0.1);
  font-size: 0.82rem;
}

.alt-pill { color: var(--gold); border-color: rgba(255, 220, 60, 0.3); background: rgba(255, 200, 50, 0.1); }

.hero-panel { display: grid; gap: 18px; align-content: start; }

.hero-art-card {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border-radius: 24px;
  background:
    radial-gradient(ellipse at 0% 50%, rgba(255, 120, 50, 0.22), transparent 40%),
    linear-gradient(145deg, rgba(20, 10, 40, 0.5), rgba(60, 20, 10, 0.72)),
    url("assets/pattern-grid.svg");
  border: 1px solid rgba(255, 140, 80, 0.2);
}

.hero-mon {
  width: 100%;
  max-width: 180px;
  justify-self: center;
  filter: drop-shadow(0 24px 40px rgba(255, 100, 50, 0.35));
  transition: transform 280ms ease;
}
.hero-mon:hover { transform: translateY(-6px) scale(1.06); }

.scan-copy { margin-top: 12px; color: var(--text); line-height: 1.7; }

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

.metric-grid article {
  padding: 16px;
  border-radius: 20px;
  background: var(--panel-strong);
  border: 1px solid rgba(180, 140, 255, 0.14);
}

.metric-grid span { display: block; color: var(--muted); font-size: 0.88rem; }
.metric-grid strong { display: block; margin-top: 10px; font-size: 1.9rem; }

/* ── Trainer deck ── */
.trainer-deck { grid-template-columns: 1.2fr 1fr 1fr; margin-top: 8px; }

.deck-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px; }
.deck-card p { margin-top: 10px; color: var(--muted); line-height: 1.6; }
.deck-card-primary { background: linear-gradient(135deg, rgba(30, 15, 60, 0.8), rgba(16, 24, 48, 0.85)), url("assets/pattern-grid.svg"); }
.deck-card-primary img { width: 110px; height: 110px; }
.mini-icon { width: 52px; height: 52px; }

/* ── Featured strip ── */
.featured-strip, .control-panel, .query-bar, .results-head, .roadmap, .info-grid, .arena-band, .featured-grail-panel, .intel-grid { margin-top: 20px; }

.featured-strip { padding: 20px 22px; display: grid; gap: 16px; }

.featured-grail-panel, .saved-deck-panel, .saved-search-panel, .alerts-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.featured-grail-panel { padding: 22px; }
.intel-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 18px; }
.saved-search-panel, .alerts-panel { padding: 22px; }
.compact-head { margin-bottom: 16px; }

.featured-rail { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }

.featured-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(180, 140, 255, 0.12);
  cursor: pointer;
  transition: transform 200ms ease, border-color 200ms ease;
}
.featured-card:hover { transform: translateY(-4px); border-color: rgba(192, 132, 252, 0.3); }

.featured-art, .saved-art {
  width: 100%;
  height: 150px;
  object-fit: contain;
  border-radius: 16px;
  background:
    radial-gradient(circle at 60% 30%, rgba(200, 140, 255, 0.18), transparent 38%),
    radial-gradient(circle at 20% 80%, rgba(80, 200, 255, 0.18), transparent 38%),
    rgba(255, 255, 255, 0.03);
  transition: transform 200ms ease;
}
.featured-card:hover .featured-art { transform: scale(1.06); }

.featured-copy, .saved-copy { display: grid; gap: 8px; }
.featured-name, .saved-name { font-family: "Sora", sans-serif; font-size: 0.92rem; }
.featured-meta, .saved-meta { color: var(--muted); line-height: 1.5; font-size: 0.82rem; }
.featured-bottom, .saved-actions, .saved-deck-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.featured-bottom strong { font-size: 1rem; }

/* ── Tools section ── */
.tools-section { margin-top: 20px; }
.tools-section .section-head { margin-bottom: 18px; }

.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.tool-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.tool-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tool-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tool-icon-wrap img { width: 32px; height: 32px; }

.fire-icon { background: rgba(255, 100, 50, 0.15); border: 1px solid rgba(255, 100, 50, 0.25); }
.psychic-icon { background: rgba(255, 100, 210, 0.15); border: 1px solid rgba(255, 100, 210, 0.25); }
.dragon-icon { background: rgba(80, 255, 200, 0.12); border: 1px solid rgba(80, 255, 200, 0.22); }
.electric-icon { background: rgba(255, 224, 102, 0.14); border: 1px solid rgba(255, 224, 102, 0.24); }
.water-icon { background: rgba(125, 212, 252, 0.14); border: 1px solid rgba(125, 212, 252, 0.24); }

.tool-body { display: grid; gap: 12px; }
.tool-footnote { color: var(--muted); font-size: 0.84rem; line-height: 1.6; }
.buy-rule-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}
.checkbox-row input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.calc-result {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(180, 140, 255, 0.14);
}

.calc-verdict {
  font-family: "Sora", sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.calc-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.calc-stats div { display: flex; flex-direction: column; gap: 4px; }
.calc-stats span { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; }
.calc-stats strong { font-size: 1.05rem; }

.calc-note { color: var(--muted); line-height: 1.6; font-size: 0.9rem; }

.tool-empty { color: var(--muted); font-size: 0.9rem; line-height: 1.6; }

.saved-alerts-list { display: grid; gap: 10px; }

.saved-alert-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(180, 140, 255, 0.12);
}

.saved-alert-copy { display: grid; gap: 3px; }
.saved-alert-name { font-size: 0.9rem; }
.saved-alert-threshold { color: var(--mint); font-size: 0.8rem; }

.saved-alert-del {
  padding: 0.3rem 0.6rem;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--rose);
  border-color: rgba(255, 126, 179, 0.2);
}

.top-movers-list { display: grid; gap: 10px; }

.mover-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(180, 140, 255, 0.1);
  transition: background 180ms ease;
}
.mover-item:hover { background: rgba(255, 255, 255, 0.07); }

.mover-art {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  flex-shrink: 0;
}

.mover-copy { flex: 1; }
.mover-name { font-size: 0.92rem; font-family: "Sora", sans-serif; }
.mover-meta { color: var(--muted); font-size: 0.8rem; margin-top: 2px; }
.mover-score {
  font-family: "Sora", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  min-width: 36px;
  text-align: right;
}

.buy-rule-summary,
.buy-rule-matches,
.saved-buy-rules-list,
.telegram-status,
.telegram-connected-chats,
.telegram-commands,
.telegram-preview,
.telegram-quick-actions { display: grid; gap: 12px; }

.buy-rule-summary,
.telegram-status {
  grid-template-columns: repeat(3, 1fr);
}

.buy-rule-stat,
.telegram-stat {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(180, 140, 255, 0.12);
}

.buy-rule-stat span,
.telegram-stat span { display: block; color: var(--muted); font-size: 0.8rem; }
.buy-rule-stat strong,
.telegram-stat strong { display: block; margin-top: 8px; font-size: 1.05rem; }

.buy-match-card,
.buy-rule-item,
.telegram-bubble {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(180, 140, 255, 0.12);
}

.buy-match-card {
  width: 100%;
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 12px;
  align-items: center;
  text-align: left;
  color: inherit;
  cursor: pointer;
}

.buy-match-art {
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
}

.buy-match-copy { display: grid; gap: 4px; }
.buy-match-title,
.buy-rule-name,
.telegram-bubble-title { font-family: "Sora", sans-serif; font-size: 0.95rem; }
.buy-match-meta,
.buy-rule-meta,
.buy-rule-note,
.telegram-bubble-body { color: var(--muted); font-size: 0.86rem; line-height: 1.5; }

.buy-rule-item {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.buy-rule-copy { display: grid; gap: 6px; }
.buy-rule-top,
.telegram-bubble-actions,
.telegram-quick-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.execution-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.72rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  border: 1px solid transparent;
}

.execution-instant {
  background: rgba(110, 255, 212, 0.14);
  border-color: rgba(110, 255, 212, 0.32);
  color: var(--mint);
}

.execution-redirect,
.execution-watch {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(180, 140, 255, 0.18);
  color: var(--muted);
}

.execution-armed {
  background: rgba(255, 224, 102, 0.14);
  border-color: rgba(255, 224, 102, 0.34);
  color: var(--gold);
}

.telegram-command {
  width: 100%;
  text-align: left;
  border-radius: 14px;
  border: 1px solid rgba(125, 212, 252, 0.18);
  background: rgba(125, 212, 252, 0.08);
  color: var(--text);
  padding: 0.85rem 1rem;
  cursor: pointer;
}

.telegram-bubble {
  background: linear-gradient(180deg, rgba(32, 48, 88, 0.55), rgba(18, 22, 42, 0.86));
  border-color: rgba(125, 212, 252, 0.18);
}

.telegram-chat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(125, 212, 252, 0.14);
}

.telegram-chat-copy { display: grid; gap: 4px; }
.telegram-chat-name { font-family: "Sora", sans-serif; font-size: 0.92rem; }
.telegram-chat-meta { color: var(--muted); font-size: 0.82rem; line-height: 1.45; }
.telegram-send-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Saved search / alerts ── */
.saved-search-list, .alert-list { display: grid; gap: 12px; }

.saved-search-card, .alert-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(180, 140, 255, 0.1);
}

.saved-search-copy, .alert-copy { display: grid; gap: 6px; }
.saved-search-name, .alert-title { font-family: "Sora", sans-serif; font-size: 0.95rem; }
.saved-search-meta, .alert-meta { color: var(--muted); font-size: 0.88rem; line-height: 1.5; }
.saved-search-actions { display: flex; gap: 8px; }

/* ── Controls ── */
.filter-chip.is-active {
  color: #100820;
  background: linear-gradient(135deg, var(--violet) 0%, #e0b4ff 100%);
  box-shadow: 0 10px 26px rgba(192, 132, 252, 0.3);
}

.control-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.query-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(180, 140, 255, 0.1);
  border-radius: 22px;
}
.query-copy { display: grid; gap: 6px; }

label { display: grid; gap: 10px; color: var(--muted); }

input, select {
  width: 100%;
  border: 1px solid rgba(180, 140, 255, 0.18);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  font: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  transition: border-color 160ms ease;
}
input:focus, select:focus { outline: none; border-color: rgba(192, 132, 252, 0.5); }
input[type="range"] { padding: 0; }

.results-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.results-note { max-width: 44ch; color: var(--muted); line-height: 1.7; }

/* ── Feed layout ── */
.listing-grid, .roadmap-grid, .detail-grid { display: grid; gap: 18px; }
.listing-grid { grid-template-columns: repeat(2, 1fr); margin-top: 0; padding-bottom: 24px; }

.feed-layout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(280px, 1fr); gap: 18px; align-items: start; }

/* ── Listing card ── */
.listing-card {
  overflow: hidden;
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.listing-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,0.06) 48%, rgba(255,255,255,0.13) 52%, transparent 70%);
  transition: opacity 300ms ease;
}
.listing-card:hover { transform: translateY(-8px) scale(1.012); }
.listing-card:hover::after { opacity: 1; }

/* Gem card animated border */
@keyframes gem-border {
  0%, 100% { border-color: rgba(110, 255, 212, 0.45); box-shadow: var(--shadow), 0 0 30px rgba(110, 255, 212, 0.12); }
  33% { border-color: rgba(192, 132, 252, 0.45); box-shadow: var(--shadow), 0 0 30px rgba(192, 132, 252, 0.14); }
  66% { border-color: rgba(255, 220, 60, 0.45); box-shadow: var(--shadow), 0 0 30px rgba(255, 220, 60, 0.12); }
}

.listing-card.is-gem { animation: gem-border 4s ease infinite; }

/* Holographic shimmer on gem cards */
.listing-card.is-gem .listing-art::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  background: linear-gradient(
    115deg,
    transparent 20%,
    rgba(255, 0, 200, 0.06) 30%,
    rgba(255, 200, 0, 0.07) 40%,
    rgba(0, 255, 200, 0.07) 50%,
    rgba(100, 100, 255, 0.06) 60%,
    transparent 70%
  );
  background-size: 200% 200%;
  animation: holo-shimmer 3.5s ease infinite;
}

@keyframes holo-shimmer {
  0%, 100% { background-position: 0% 50%; opacity: 0.7; }
  50% { background-position: 100% 50%; opacity: 1; }
}

.listing-art {
  position: relative;
  min-height: 260px;
  padding: 18px;
  border-bottom: 1px solid rgba(180, 140, 255, 0.12);
  background: linear-gradient(145deg, rgba(8, 17, 31, 0.28), rgba(16, 41, 71, 0.85)), url("assets/pattern-grid.svg");
  cursor: pointer;
}

.listing-frame {
  position: absolute;
  right: 14px;
  bottom: 8px;
  width: 196px;
  opacity: 0.82;
  filter: drop-shadow(0 16px 26px rgba(0, 0, 0, 0.3));
}

.listing-character-art {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 192px;
  height: 192px;
  object-fit: contain;
  z-index: 2;
  filter: drop-shadow(0 20px 36px rgba(0, 0, 0, 0.45));
  transition: transform 220ms ease;
}
.listing-card:hover .listing-character-art { transform: translateY(-8px) scale(1.06); }

.listing-art-copy {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.listing-marketplace, .listing-rarity {
  display: inline-flex;
  padding: 0.42rem 0.78rem;
  border-radius: 999px;
  font-size: 0.8rem;
  background: rgba(7, 4, 20, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.listing-character-wrap {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 62px;
}

.listing-energy {
  width: 44px;
  height: 44px;
  padding: 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  flex-shrink: 0;
}

.listing-character { font-family: "Sora", sans-serif; font-size: 1.4rem; }
.listing-setline { margin-top: 4px; color: var(--muted); font-size: 0.9rem; }

.listing-body { display: grid; gap: 14px; padding: 18px; }
.listing-meta-top { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.listing-title { font-size: 1.05rem; line-height: 1.45; }
.listing-hook { margin-top: 5px; color: var(--gold); font-size: 0.84rem; letter-spacing: 0.04em; }
.listing-subtitle { color: var(--muted); line-height: 1.6; font-size: 0.9rem; }

/* Type badges */
.listing-tags { flex-wrap: wrap; }
.listing-tags span {
  padding: 0.4rem 0.72rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 0.78rem;
}

.type-badge { font-weight: 600; }
.type-fire { background: rgba(255, 100, 50, 0.18) !important; color: #ff9060 !important; border: 1px solid rgba(255,100,50,0.28); }
.type-water { background: rgba(80, 200, 255, 0.18) !important; color: #7dd4fc !important; border: 1px solid rgba(80,200,255,0.28); }
.type-electric { background: rgba(255, 220, 60, 0.18) !important; color: #ffe066 !important; border: 1px solid rgba(255,220,60,0.28); }
.type-psychic { background: rgba(255, 100, 210, 0.18) !important; color: #f093d8 !important; border: 1px solid rgba(255,100,210,0.28); }
.type-dark { background: rgba(160, 100, 255, 0.18) !important; color: #c084fc !important; border: 1px solid rgba(160,100,255,0.28); }
.type-dragon { background: rgba(80, 255, 200, 0.15) !important; color: #6effd4 !important; border: 1px solid rgba(80,255,200,0.25); }

.listing-price-row, .listing-stat-grid { display: grid; gap: 12px; }
.listing-price-row { grid-template-columns: repeat(2, 1fr); }
.listing-price-row strong { display: block; margin-top: 8px; font-size: 1.38rem; }
.listing-stat-grid { grid-template-columns: repeat(2, 1fr); }

.stat-cell {
  padding: 13px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(180, 140, 255, 0.07);
}
.stat-cell strong { display: block; margin-top: 7px; font-size: 0.95rem; }

/* Score colors */
.score-gem { color: var(--mint); }
.score-hot { color: var(--gold); }
.score-good { color: var(--sky); }

.score-bar-wrap {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-top: 6px;
}
.score-bar-fill { height: 100%; border-radius: 999px; }
.score-gem .score-bar-fill { background: var(--mint); }
.score-hot .score-bar-fill { background: var(--gold); }
.score-good .score-bar-fill { background: var(--sky); }

/* Hot badge */
.hot-badge {
  display: inline-flex;
  padding: 0.3rem 0.62rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #08060f;
  background: linear-gradient(135deg, #6effd4, #40c8a0);
  box-shadow: 0 6px 16px rgba(110, 255, 212, 0.32);
  animation: pulse-badge 2s ease-in-out infinite;
}
@keyframes pulse-badge { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }

/* Countdown pill */
.countdown-pill {
  display: inline-flex;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  background: rgba(255, 100, 100, 0.14);
  border: 1px solid rgba(255, 100, 100, 0.28);
  color: #ff9090;
  font-variant-numeric: tabular-nums;
  transition: background 400ms ease, color 400ms ease;
}
.countdown-pill.is-urgent {
  background: rgba(255, 50, 50, 0.22);
  border-color: rgba(255, 50, 50, 0.5);
  color: #ff6060;
  animation: pulse-badge 1s ease infinite;
}
.countdown-pill.is-ended { color: var(--muted); background: rgba(255,255,255,0.05); }

.watch-button.is-saved { background: rgba(255, 126, 179, 0.16); border-color: rgba(255, 126, 179, 0.3); color: #ffd0e4; }
.inspect-button { margin-right: auto; }

/* ── Saved deck ── */
.saved-deck-panel { position: sticky; top: 18px; padding: 20px; }
.saved-deck-count {
  display: inline-flex;
  min-width: 34px;
  justify-content: center;
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 220, 60, 0.14);
  border: 1px solid rgba(255, 220, 60, 0.22);
  color: var(--gold);
}

.saved-deck-metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
.saved-deck-metrics article {
  padding: 13px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(180, 140, 255, 0.1);
}
.saved-deck-metrics strong { display: block; margin-top: 8px; font-size: 1.1rem; }
.saved-deck-list { display: grid; gap: 12px; margin-top: 16px; }

.saved-card { display: grid; grid-template-columns: 80px 1fr; gap: 10px; padding: 10px; border-radius: 16px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(180, 140, 255, 0.1); }
.saved-card.is-empty { grid-template-columns: 1fr; }
.saved-art { height: 80px; }
.saved-actions .ghost-button, .featured-open { padding: 0.5rem 0.8rem; }

/* ── Type themes ── */
.theme-electric .listing-art {
  background:
    radial-gradient(ellipse at 30% 0%, rgba(255, 230, 80, 0.42), transparent 38%),
    radial-gradient(ellipse at 100% 100%, rgba(255, 180, 0, 0.2), transparent 30%),
    linear-gradient(155deg, rgba(60, 46, 6, 0.3), rgba(120, 88, 8, 0.72)),
    url("assets/pattern-grid.svg");
}
.theme-electric:hover { border-color: rgba(255, 220, 80, 0.4); box-shadow: 0 36px 90px rgba(0,0,0,0.5), 0 0 32px rgba(255,210,50,0.14); }

.theme-fire .listing-art {
  background:
    radial-gradient(ellipse at 30% 0%, rgba(255, 120, 60, 0.44), transparent 36%),
    radial-gradient(ellipse at 100% 100%, rgba(220, 50, 20, 0.2), transparent 32%),
    linear-gradient(155deg, rgba(70, 18, 8, 0.3), rgba(150, 44, 16, 0.74)),
    url("assets/pattern-grid.svg");
}
.theme-fire:hover { border-color: rgba(255, 110, 50, 0.4); box-shadow: 0 36px 90px rgba(0,0,0,0.5), 0 0 32px rgba(255,80,30,0.16); }

.theme-dark .listing-art {
  background:
    radial-gradient(ellipse at 30% 0%, rgba(180, 130, 255, 0.32), transparent 36%),
    radial-gradient(ellipse at 100% 100%, rgba(100, 60, 200, 0.2), transparent 32%),
    linear-gradient(155deg, rgba(14, 10, 34, 0.5), rgba(52, 30, 100, 0.78)),
    url("assets/pattern-grid.svg");
}
.theme-dark:hover { border-color: rgba(180, 130, 255, 0.4); box-shadow: 0 36px 90px rgba(0,0,0,0.5), 0 0 32px rgba(160,100,255,0.16); }

.theme-psychic .listing-art {
  background:
    radial-gradient(ellipse at 30% 0%, rgba(255, 100, 210, 0.38), transparent 36%),
    radial-gradient(ellipse at 100% 100%, rgba(200, 50, 180, 0.18), transparent 32%),
    linear-gradient(155deg, rgba(58, 10, 52, 0.44), rgba(140, 34, 120, 0.74)),
    url("assets/pattern-grid.svg");
}
.theme-psychic:hover { border-color: rgba(255, 100, 210, 0.4); box-shadow: 0 36px 90px rgba(0,0,0,0.5), 0 0 32px rgba(240,80,200,0.14); }

.theme-water .listing-art {
  background:
    radial-gradient(ellipse at 30% 0%, rgba(80, 200, 255, 0.38), transparent 36%),
    radial-gradient(ellipse at 100% 100%, rgba(20, 120, 220, 0.2), transparent 32%),
    linear-gradient(155deg, rgba(6, 28, 60, 0.38), rgba(16, 80, 148, 0.74)),
    url("assets/pattern-grid.svg");
}
.theme-water:hover { border-color: rgba(80, 200, 255, 0.4); box-shadow: 0 36px 90px rgba(0,0,0,0.5), 0 0 32px rgba(60,180,255,0.14); }

.theme-dragon .listing-art {
  background:
    radial-gradient(ellipse at 30% 0%, rgba(80, 255, 200, 0.3), transparent 36%),
    radial-gradient(ellipse at 100% 100%, rgba(20, 180, 140, 0.18), transparent 32%),
    linear-gradient(155deg, rgba(8, 38, 40, 0.38), rgba(18, 90, 88, 0.76)),
    url("assets/pattern-grid.svg");
}
.theme-dragon:hover { border-color: rgba(80, 255, 200, 0.4); box-shadow: 0 36px 90px rgba(0,0,0,0.5), 0 0 32px rgba(60,240,180,0.13); }

/* ── Arena / Info / Roadmap ── */
.arena-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}
.arena-panel p { margin-top: 10px; color: var(--muted); line-height: 1.7; max-width: 58ch; }
.arena-panel img { width: 100px; height: 100px; }

.info-grid { grid-template-columns: repeat(2, 1fr); gap: 18px; }
.info-card ul { margin: 16px 0 0; padding-left: 18px; color: var(--muted); line-height: 1.9; }
.info-card-top { display: flex; align-items: center; gap: 14px; }
.info-card-top img { width: 50px; height: 50px; }

.section-head { margin-bottom: 18px; }
.roadmap-grid { grid-template-columns: repeat(3, 1fr); }
.roadmap article span { display: inline-flex; color: var(--gold); font-family: "Sora", sans-serif; margin-bottom: 14px; }
.roadmap article p { margin-top: 10px; color: var(--muted); line-height: 1.7; }

/* ── Detail modal ── */
.detail-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 30;
  overflow: hidden;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.detail-modal.is-open { display: block; }
.detail-backdrop { position: absolute; inset: 0; background: rgba(3, 2, 12, 0.78); backdrop-filter: blur(12px); }

.detail-shell {
  position: relative;
  width: min(980px, calc(100% - 24px));
  margin: min(4vh, 28px) auto;
  max-height: min(92vh, calc(100dvh - 24px));
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 20px;
  border-radius: 28px;
  border: 1px solid rgba(180, 140, 255, 0.24);
  background: linear-gradient(180deg, rgba(14, 8, 30, 0.97), rgba(8, 5, 18, 0.99)), url("assets/pattern-grid.svg");
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
}

.detail-close { margin-left: auto; display: flex; }
.detail-hero { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 20px; align-items: center; margin-top: 12px; }
.detail-subtitle, .detail-note p, .detail-note li { color: var(--muted); line-height: 1.7; }
.detail-pill { display: inline-flex; padding: 0.42rem 0.78rem; border-radius: 999px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(180, 140, 255, 0.14); font-size: 0.85rem; }

.detail-art-wrap {
  position: relative;
  min-height: 320px;
  border-radius: 26px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at top left, rgba(255, 220, 80, 0.22), transparent 28%),
    radial-gradient(circle at top right, rgba(192, 132, 252, 0.22), transparent 24%),
    linear-gradient(145deg, rgba(14, 8, 30, 0.7), rgba(8, 5, 20, 0.92));
  border: 1px solid rgba(180, 140, 255, 0.18);
}

.detail-energy-icon { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; z-index: 3; opacity: 0.75; border-radius: 50%; }
.detail-character-art {
  position: relative;
  width: 100%;
  max-width: 340px;
  height: 300px;
  object-fit: contain;
  object-position: center;
  z-index: 2;
  filter: drop-shadow(0 24px 44px rgba(0, 0, 0, 0.5));
  display: block;
  margin: 0 auto;
}
.detail-frame { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.15; pointer-events: none; }
.detail-grid { grid-template-columns: repeat(4, 1fr); margin-top: 18px; }
.detail-card, .detail-note { padding: 16px; border-radius: 20px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(180, 140, 255, 0.1); }
.detail-card strong { display: block; margin-top: 10px; font-size: 1.25rem; }
.detail-columns { grid-template-columns: 1.2fr 0.8fr; margin-top: 18px; }
.detail-note ul { margin: 14px 0 0; padding-left: 18px; }
.detail-actions { margin-top: 18px; }

/* ── Entrance animation ── */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 480ms ease, transform 480ms ease;
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ── Toast ── */
.app-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  max-width: 320px;
  padding: 0.85rem 1.1rem;
  border-radius: 16px;
  background: rgba(16, 10, 32, 0.94);
  border: 1px solid rgba(192, 132, 252, 0.24);
  box-shadow: 0 24px 44px rgba(0, 0, 0, 0.4);
  color: var(--text);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}
.app-toast.is-visible { opacity: 1; transform: translateY(0); }

/* ── Footer ── */
.site-footer {
  margin-top: 48px;
  padding: 24px 0 30px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-brand { display: flex; align-items: center; gap: 10px; font-family: "Sora", sans-serif; font-size: 1.05rem; font-weight: 700; color: var(--text); text-decoration: none; }
.footer-brand img { width: 30px; height: 30px; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); text-decoration: none; font-size: 0.88rem; transition: color 160ms ease; }
.footer-links a:hover { color: var(--text); }
.footer-note { color: var(--muted); font-size: 0.8rem; line-height: 1.6; }

/* ── Responsive ── */
@media (max-width: 1080px) {
  .hero, .trainer-deck, .info-grid, .roadmap-grid, .listing-grid, .detail-hero, .detail-columns, .feed-layout, .featured-rail, .intel-grid, .tools-grid { grid-template-columns: 1fr; }
  .control-grid { grid-template-columns: repeat(2, 1fr); }
  .featured-rail { grid-template-columns: repeat(3, 1fr); }
  .buy-rule-summary, .telegram-status { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .shell { width: min(100% - 18px, 1220px); }
  .topbar, .results-head, .query-bar, .hero-art-card, .deck-card, .arena-panel, .saved-deck-head, .featured-bottom, .saved-search-card, .alert-card { flex-direction: column; align-items: start; }
  .hero-art-card { grid-template-columns: 1fr; }
  .topbar-actions { width: 100%; }
  .control-grid, .metric-grid, .saved-deck-metrics, .listing-price-row, .listing-stat-grid, .detail-grid, .calc-stats, .buy-rule-grid, .buy-rule-summary, .telegram-status { grid-template-columns: 1fr; }
  .saved-deck-panel { position: static; }
  .listing-frame { width: 144px; }
  .listing-character-art { width: 138px; height: 138px; }
  .listing-character-wrap { margin-top: 38px; }
  .detail-character-art { width: 100%; max-width: 300px; height: 260px; }
  .featured-rail { grid-template-columns: repeat(2, 1fr); }
  .hero-copy, .hero-panel, .deck-card, .control-panel, .featured-strip, .featured-grail-panel, .saved-deck-panel, .info-card, .roadmap article, .listing-card, .detail-shell, .tool-card { border-radius: 22px; }
  .topbar-actions .ghost-button, .topbar-actions .primary-button, .hero-actions .ghost-button, .hero-actions .primary-button { flex: 1 1 calc(50% - 8px); text-align: center; }
  .chip-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }
  .filter-chip {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }
  .listing-footer, .detail-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .listing-footer .inspect-button { margin-right: 0; }
  .listing-footer .primary-button,
  .listing-footer .ghost-button,
  .detail-actions .primary-button,
  .detail-actions .ghost-button {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
  .detail-modal {
    display: none;
    align-items: end;
    overflow: hidden;
  }
  .detail-modal.is-open { display: flex; }
  .detail-backdrop { position: fixed; }
  .detail-shell {
    width: 100%;
    max-height: calc(100dvh - env(safe-area-inset-top) - 10px);
    margin: auto 0 0;
    border-radius: 24px 24px 0 0;
    padding: 16px 14px calc(18px + env(safe-area-inset-bottom));
  }
  .detail-close {
    position: sticky;
    top: 0;
    z-index: 8;
    margin-left: auto;
  }
  .detail-art-wrap { min-height: 240px; }
  .detail-actions {
    position: sticky;
    bottom: calc(-18px - env(safe-area-inset-bottom));
    z-index: 8;
    margin: 18px -14px calc(-18px - env(safe-area-inset-bottom));
    padding: 12px 14px calc(14px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(8, 5, 18, 0.7), rgba(8, 5, 18, 0.98) 35%);
    border-top: 1px solid rgba(180, 140, 255, 0.14);
    backdrop-filter: blur(14px);
  }
  .app-toast {
    right: 10px;
    left: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    max-width: none;
  }
  .buy-match-card,
  .buy-rule-item { grid-template-columns: 1fr; }
}
