:root {
  --bg: #050607;
  --panel: #090b0d;
  --bar: #282828;
  --text: #f2f5f7;
  --muted: #8d98a3;
  --green: #35e274;
  --red: #ff3030;
  --yellow: #f4f05a;
  --cyan: #49d7ff;
  --purple: #d04cff;
  --line: #1c2329;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

.wall {
  width: 100%;
  min-height: 100vh;
  padding: 10px 12px 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px 12px;
  background: #10206b;
  border-bottom: 1px solid #223aa0;
}

h1 {
  margin: 2px 0 0;
  font-size: 22px;
  letter-spacing: 0;
}

.feed-note {
  margin: 0;
  color: #dfe9ff;
  font-size: 14px;
}

button {
  border: 1px solid #78fbff;
  background: #082126;
  color: #bffcff;
  border-radius: 4px;
  padding: 9px 14px;
  font-weight: 800;
  cursor: pointer;
}

button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.ticker {
  display: flex;
  gap: 24px;
  overflow: hidden;
  white-space: nowrap;
  padding: 8px 10px;
  background: var(--bar);
  color: #f6f6f6;
  font-size: 17px;
}

.msrp-marquee {
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid rgba(244, 240, 90, 0.55);
  background: #121302;
  box-shadow: inset 0 0 0 1px rgba(244, 240, 90, 0.16), 0 0 18px rgba(244, 240, 90, 0.12);
}

.msrp-marquee[hidden] {
  display: none;
}

.msrp-marquee-track {
  display: flex;
  width: max-content;
  min-width: 100%;
  animation: msrpMarquee 26s linear infinite;
}

.msrp-marquee:hover .msrp-marquee-track {
  animation-play-state: paused;
}

.msrp-marquee-item {
  display: inline-grid;
  grid-template-columns: auto minmax(260px, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  min-width: 760px;
  padding: 8px 18px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.msrp-marquee-item strong {
  color: var(--yellow);
  font-size: 18px;
  text-shadow: 0 0 12px rgba(244, 240, 90, 0.4);
}

.msrp-marquee-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 15px;
}

.msrp-marquee-item em {
  color: var(--red);
  font-style: normal;
  font-size: 18px;
  font-weight: 900;
}

.msrp-marquee-item small {
  color: var(--muted);
  font-size: 12px;
}

.verification-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 0 0;
}

.verification-bar a,
.verification-bar button {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid #3d6570;
  border-radius: 4px;
  color: #d8fbff;
  background: #0b242a;
  text-decoration: none;
  font-size: 13px;
  font-weight: 900;
}

.verification-bar button {
  cursor: pointer;
}

.verification-bar a:hover,
.verification-bar button:hover {
  border-color: var(--cyan);
  background: #103943;
}

.verification-status {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  color: var(--muted);
  font-size: 12px;
}

.tabs {
  display: flex;
  gap: 8px;
  padding: 10px 0 0;
}

.tab-btn {
  min-width: 126px;
  border-color: #2b434b;
  background: #0a0d10;
  color: var(--muted);
}

.tab-btn.active {
  border-color: var(--cyan);
  color: #e8fdff;
  background: #0b242a;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.stock-wall {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
  padding: 12px 0;
}

.store-column {
  min-height: 440px;
  background: var(--panel);
  border: 1px solid #111920;
  padding: 8px;
}

.store-head {
  min-height: 54px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}

.store-head h2 {
  margin: 0;
  color: var(--cyan);
  font-size: 15px;
  line-height: 1.1;
}

.store-column:nth-child(2n) .store-head h2 { color: var(--purple); }
.store-column:nth-child(3n) .store-head h2 { color: var(--green); }
.store-column:nth-child(4n) .store-head h2 { color: var(--yellow); }

.store-head span,
.store-head small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.next-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  justify-content: flex-end;
}

.sync-spinner {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border-radius: 50%;
  border: 2px solid rgba(73, 215, 255, 0.25);
  border-top-color: var(--cyan);
  animation: spinSync 1.1s linear infinite;
}

.scan-item {
  margin: 8px 0;
  color: var(--yellow);
  font-size: 11px;
  text-align: center;
}

.sync-label {
  color: var(--cyan);
}

.rows {
  display: grid;
  gap: 7px;
}

.stock-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  min-height: 58px;
  padding: 6px 6px 7px;
  text-decoration: none;
  color: var(--text);
  border-left: 3px solid #303841;
  background: #07090a;
}

.stock-row:hover {
  background: #11171c;
}

.row-title {
  color: #e9edf0;
  font-size: 12px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.row-updated {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.1;
}

.row-price {
  color: var(--red);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.1;
}

.row-state {
  font-size: 12px;
  font-weight: 900;
  color: var(--red);
}

.row-in {
  border-left-color: var(--green);
}

.row-in .row-state {
  color: var(--green);
}

.row-out .row-state,
.empty-row.no-stock {
  animation: outStockFlash 2.2s ease-in-out infinite;
}

.msrp-hit {
  border-left-color: var(--yellow);
  animation: msrpPulse 2.8s ease-in-out infinite;
}

.msrp-hit .row-title,
.msrp-hit .row-state {
  color: var(--yellow);
}

.direct-link.msrp-hit strong,
.stock-row.msrp-hit .row-price {
  color: var(--yellow);
}

@keyframes msrpPulse {
  0%, 100% {
    background: #0a0d10;
    box-shadow: inset 0 0 0 1px rgba(244, 240, 90, 0.15);
  }
  50% {
    background: #171807;
    box-shadow: inset 0 0 0 1px rgba(244, 240, 90, 0.65), 0 0 18px rgba(244, 240, 90, 0.2);
  }
}

@keyframes spinSync {
  to { transform: rotate(360deg); }
}

@keyframes msrpMarquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes outStockFlash {
  0%, 100% { opacity: 1; text-shadow: none; }
  50% { opacity: 0.42; text-shadow: 0 0 10px rgba(255, 48, 48, 0.45); }
}

.empty-row {
  min-height: 32px;
  display: grid;
  place-items: center;
  color: var(--red);
  font-size: 14px;
  font-weight: 900;
}

.empty-row.has-stock {
  color: var(--green);
}

.lower-panel {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.links-panel {
  margin: 0 0 10px;
  background: #07090a;
  border: 1px solid var(--line);
}

.direct-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 7px;
  padding: 9px;
}

.direct-link {
  display: grid;
  gap: 4px;
  align-content: start;
  min-height: 62px;
  padding: 8px;
  color: #eef4f7;
  text-decoration: none;
  border-left: 3px solid #303841;
  background: #0a0d10;
}

.direct-link:hover {
  background: #11171c;
}

.direct-link span {
  font-size: 12px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.direct-link small {
  color: var(--muted);
  font-size: 11px;
}

.direct-link strong {
  color: var(--red);
  font-size: 15px;
}

.direct-in {
  border-left-color: var(--green);
}

.drop-panel {
  min-height: 180px;
  background: #07090a;
  border: 1px solid var(--line);
}

.panel-title {
  padding: 8px 10px;
  background: var(--bar);
  color: #fff;
  font-size: 19px;
  text-transform: uppercase;
}

.drop-history,
.diagnostics {
  padding: 9px;
  display: grid;
  gap: 7px;
}

.drop-row {
  display: grid;
  grid-template-columns: 74px 1fr auto;
  gap: 8px;
  align-items: start;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
}

.drop-row span,
.drop-row em,
.diag small {
  color: var(--muted);
  font-style: normal;
}

.drop-row em {
  color: var(--green);
  font-weight: 800;
}

.drop-row.error em {
  color: var(--red);
}

.drop-row.msrp-alert strong,
.drop-row.msrp-alert em {
  color: var(--yellow);
}

.diag {
  display: grid;
  gap: 2px;
  padding: 7px;
  border-left: 3px solid var(--green);
  background: #0a0d10;
  font-size: 12px;
}

.diag.warn {
  border-left-color: var(--red);
}

.diag span {
  color: #d7dde1;
}

.verify-link {
  width: max-content;
  margin-top: 4px;
  padding: 5px 8px;
  border: 1px solid #3d6570;
  border-radius: 4px;
  color: #d8fbff;
  background: #0b242a;
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
}

.verify-link:hover {
  border-color: var(--cyan);
  background: #103943;
}

.muted-row {
  color: var(--muted);
  font-size: 13px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 0 0;
}

.stat-card {
  background: #07090a;
  border: 1px solid var(--line);
  min-height: 180px;
}

.stat-card.wide {
  grid-column: 1 / -1;
}

.stat-body {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.stat-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  gap: 8px 12px;
  align-items: start;
  padding: 8px;
  border-left: 3px solid #303841;
  background: #0a0d10;
  color: var(--text);
  text-decoration: none;
}

.stat-row strong {
  color: var(--red);
  font-size: 16px;
}

.stat-row small {
  grid-column: 1 / -1;
  color: var(--muted);
  line-height: 1.35;
}

.stat-link:hover {
  background: #11171c;
}

.split-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.split-stats h3 {
  margin: 0 0 8px;
  color: var(--cyan);
  font-size: 14px;
}

@media (max-width: 760px) {
  .topbar,
  .ticker,
  .lower-panel,
  .stats-grid,
  .split-stats {
    display: grid;
    grid-template-columns: 1fr;
  }

  .stock-wall {
    grid-template-columns: 1fr;
  }

  .msrp-marquee-item {
    grid-template-columns: 1fr;
    gap: 3px;
    min-width: 320px;
    padding: 8px 12px;
    white-space: normal;
  }

  .store-column {
    min-height: auto;
  }

  .drop-row {
    grid-template-columns: 1fr;
  }

  .tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .stat-card.wide {
    grid-column: auto;
  }
}
