/* ================================
   RESET + BASE
   ================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Kode Mono", monospace;
  background: transparent;
  color: #f4f4f5;
  line-height: 1.45;
  -webkit-font-smoothing: subpixel-antialiased;
  text-rendering: geometricPrecision;
}

/* ================================
   OUTER OVERLAY CONTAINER
   ================================ */

#market-overlay {
  width: 520px;
  max-width: 100vw;
  padding: 18px 20px 16px;
  box-shadow:
    0 32px 90px rgba(0, 0, 0, 0.95),
    0 0 0 1px rgba(15, 23, 42, 0.9);
}

/* Header text (matches GUN TOKEN PRICE ACTION) */

.subheader {
  margin-bottom: 10px;
}

.subtitle {
  font-family: "Kode Mono", monospace;
  font-size: 14px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #e5e7eb;
}

/* ================================
   OPENSEA CARD (MATCH GUN CARD)
   ================================ */

#opensea-section {
  position: relative;
  border-radius: 18px;
  padding: 14px 18px 10px;
  background: radial-gradient(circle at top left, #020617, #020314);
  border: 1px solid rgba(148, 163, 184, 0.22);
  overflow: hidden;
}

/* Mesh canvas as a subtle layer under content */

#opensea-mesh-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;

  /* Stronger presence than the old grid, but still behind content */
  opacity: 0.10;
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 0;
}

/* Ensure content sits above the mesh */

#opensea-section > :not(#opensea-mesh-canvas) {
  position: relative;
  z-index: 1;
}

/* ================================
   SESSION HIGH / ALL-TIME HIGH
   ================================ */

#high-sale {
  display: flex;
  flex-direction: row;
  gap: 10px;
  margin-bottom: 6px;
}

.high-card {
  flex: 1 1 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.35); /* subtle 1px outline */
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.75);
}

.high-thumb-wrapper {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(17, 24, 39, 0.9);
  flex-shrink: 0;
}

.high-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.high-sale-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.high-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(203, 213, 225, 0.9);
}

.high-value {
  font-size: 11px;
  font-weight: 600;
  color: #f9fafb;
}

/* Error line */

#error {
  margin-top: 4px;
  font-size: 11px;
  color: #eb15ae;
}

/* ================================
   EVENTS LIST
   ================================ */

#events {
  list-style: none;
  margin: 4px 0 2px 0;
  padding: 0;
}

#events li {
  padding: 8px 0;
  border-top: 1px solid rgba(55, 65, 81, 0.8);
}

#events li:first-child {
  border-top: none;
}

/* Card layout per event */

.event-card {
  display: flex;
  gap: 8px;
}

.thumb-wrapper {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.9);
}

.thumb {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.thumb-placeholder {
  background: rgba(31, 41, 55, 0.8);
}

/* Right-hand text block */

.event-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

/* Line 1: item name */

.item-name {
  font-size: 13px;
  font-weight: 500;
  color: #f3f4f6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Line 2: SALE + price */

.sale-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 11px;
}

.sale-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #4dd9b3;
}

.sale-label.sale-animating {
  animation: sale-blink 1s step-start 5;
}

.sale-price {
  font-weight: 500;
  color: #e5e7eb;
}

.sale-price.sale-price-animating {
  color: #9ca3af;
}

.sale-price.sale-price-final {
  color: #4dd9b3;
}

/* Line 3 & 4 */

.datetime-line {
  font-size: 11px;
  color: #cbd5f5;
}

.direction-line {
  font-size: 11px;
  color: #e5e7eb;
}

/* ================================
   RARITY PILL STYLING
   ================================ */

.rarity-pill {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

/* Common */

.rarity-common .item-name {
  color: #f9fafb;
}

.rarity-common .rarity-pill {
  background: rgba(156, 163, 175, 0.22);
  color: #e5e7eb;
}

/* Uncommon */

.rarity-uncommon .item-name {
  color: #6ee7b7;
}

.rarity-uncommon .rarity-pill {
  background: rgba(34, 197, 94, 0.22);
  color: #6ee7b7;
}

/* Rare */

.rarity-rare .item-name {
  color: #93c5fd;
}

.rarity-rare .rarity-pill {
  background: rgba(59, 130, 246, 0.22);
  color: #60a5fa;
}

/* Epic */

.rarity-epic .item-name {
  color: #c4b5fd;
}

.rarity-epic .rarity-pill {
  background: rgba(168, 85, 247, 0.22);
  color: #e9d5ff;
}

/* Fallback / other */

.rarity-other .rarity-pill {
  background: rgba(75, 85, 99, 0.3);
  color: #e5e7eb;
}

/* ================================
   ANIMATIONS
   ================================ */

@keyframes sale-blink {
  0%,
  40% {
    opacity: 1;
  }
  40.01%,
  100% {
    opacity: 0.25;
  }
}
