/* ==========================================================================
   AutoRynek — Profesjonalny Terminal Giełdowy (Anarchia.gg Market Monitor)
   Zero AI Slop • Surowy, Ciemny Gaming Dark Theme • Autentyczny Minecraft Tooltip
   ========================================================================== */

:root {
  /* Paleta Barw Terminala */
  --bg-dark: #090b0e;
  --bg-base: #0d0f14;
  --panel-bg: #12151d;
  --panel-hover: #171b26;
  --panel-active: #1d2230;
  
  /* Krawędzie i Separatory */
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);
  --border-focus: #38bdf8;
  
  /* Typografia & Kontrast */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Finansowe Akcenty Transakcyjne */
  --green: #10b981;
  --green-glow: rgba(16, 185, 129, 0.16);
  --green-border: rgba(16, 185, 129, 0.35);

  --red: #ef4444;
  --red-glow: rgba(239, 68, 68, 0.16);
  --red-border: rgba(239, 68, 68, 0.35);

  --anarchic-gold: #f59e0b;
  --anarchic-glow: rgba(245, 158, 11, 0.16);

  --cyan: #38bdf8;
  --cyan-glow: rgba(56, 189, 248, 0.16);

  --purple: #c084fc;

  /* Geometria */
  --site-max-width: 1440px;
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

/* Reset i Baza */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  color-scheme: dark;
  background-color: var(--bg-dark);
  font-family: var(--font-sans);
  color: var(--text-main);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(56, 189, 248, 0.03) 0%, transparent 60%),
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 100% 100%, 32px 32px, 32px 32px;
}

/* ==========================================================================
   1. Giełdowy Live Ticker (Górny pasek transakcji)
   ========================================================================== */

.market-ticker-bar {
  display: flex;
  align-items: center;
  height: 34px;
  background-color: #07080a;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.76rem;
  overflow: hidden;
  user-select: none;
  z-index: 101;
}

.ticker-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  height: 100%;
  background-color: #0c0e12;
  border-right: 1px solid var(--border-subtle);
  color: var(--green);
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.05em;
  flex-shrink: 0;
  z-index: 2;
}

.ticker-pulse-dot {
  width: 6px;
  height: 6px;
  background-color: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--green);
  animation: pulse-live 1.8s infinite;
}

@keyframes pulse-live {
  0% { transform: scale(0.9); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
  100% { transform: scale(0.9); opacity: 1; }
}

.ticker-viewport {
  flex: 1;
  overflow: hidden;
  position: relative;
  white-space: nowrap;
}

.ticker-track {
  display: inline-flex;
  align-items: center;
  gap: 28px;
  padding-left: 20px;
  animation: ticker-slide 45s linear infinite;
}

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

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

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s ease;
}

.ticker-item:hover {
  color: var(--text-main);
}

.ticker-avatar {
  width: 16px;
  height: 16px;
  border-radius: 2px;
  image-rendering: pixelated;
}

.ticker-seller {
  color: var(--cyan);
  font-weight: 600;
}

.ticker-item-name {
  color: var(--text-main);
}

.ticker-price {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--green);
}

.ticker-server-tag {
  padding: 0 14px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: #0c0e12;
  border-left: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  flex-shrink: 0;
  z-index: 2;
}

.ticker-server-tag strong {
  color: var(--text-muted);
}

/* ==========================================================================
   2. Topbar & Header
   ========================================================================== */

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(13, 15, 20, 0.92);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.header-inner {
  max-width: var(--site-max-width);
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Brand */
.brand-group {
  flex-shrink: 0;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-box {
  width: 32px;
  height: 32px;
  background-color: #12151d;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.logo-text {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--cyan);
  letter-spacing: -0.05em;
}

.brand-titles {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  line-height: 1.1;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

/* Wyszukiwarka Giełdowa */
.search-terminal-wrap {
  flex: 1;
  max-width: 480px;
}

.search-input-box {
  position: relative;
  display: flex;
  align-items: center;
  background-color: #090b0e;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0 12px;
  height: 38px;
  transition: all 0.15s ease;
}

.search-input-box:focus-within {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
  background-color: #0c0e14;
}

.search-icon {
  color: var(--text-dim);
  margin-right: 9px;
  flex-shrink: 0;
}

.search-input-box input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.86rem;
}

.search-input-box input::placeholder {
  color: var(--text-dim);
}

.kbd-shortcut {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 6px;
  background-color: #171b26;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-muted);
}

.search-clear-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 4px;
  margin-left: 4px;
}

.search-clear-btn:hover {
  color: var(--text-main);
}

/* Header Metrics (KPI) — Profesjonalny Terminal Giełdowy */
.header-metrics {
  display: flex;
  align-items: center;
  gap: 10px;
}

.metric-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6px 14px;
  min-width: 82px;
  background: linear-gradient(180deg, #131722 0%, #0d1017 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 2px 4px rgba(0, 0, 0, 0.25);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  cursor: default;
}

.metric-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 4px 8px rgba(0, 0, 0, 0.35);
}

.metric-card .metric-label {
  font-family: var(--font-sans);
  font-size: 0.62rem;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  line-height: 1;
  margin-bottom: 3px;
}

.metric-card .metric-val {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.1;
}

.metric-card.metric-offers .metric-val {
  color: #f8fafc;
}

.metric-card.metric-items .metric-val {
  color: #38bdf8;
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

.metric-card.metric-recent .metric-val {
  color: #10b981;
  text-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
}



/* Animacje błysków zmiany cen (Live Price Flash) */
@keyframes flash-up-anim {
  0% { background-color: rgba(16, 185, 129, 0.35); border-color: rgba(16, 185, 129, 0.8); box-shadow: 0 0 16px rgba(16, 185, 129, 0.3); }
  100% { background-color: #0d1017; border-color: var(--border-subtle); box-shadow: none; }
}

@keyframes flash-down-anim {
  0% { background-color: rgba(239, 68, 68, 0.35); border-color: rgba(239, 68, 68, 0.8); box-shadow: 0 0 16px rgba(239, 68, 68, 0.3); }
  100% { background-color: #0d1017; border-color: var(--border-subtle); box-shadow: none; }
}

.card-pricing-block.price-flash-up {
  animation: flash-up-anim 1.4s ease-out;
}

.card-pricing-block.price-flash-down {
  animation: flash-down-anim 1.4s ease-out;
}

/* ==========================================================================
   3. Główna Przestrzeń Terminala
   ========================================================================== */

.terminal-main {
  max-width: var(--site-max-width);
  margin: 0 auto;
  padding: 20px 20px 60px 20px;
  width: 100%;
  flex: 1;
}

/* Pasek Narzędzi i Kategorii */
.market-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.category-tabs {
  display: flex;
  align-items: center;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background-color: #10131b;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.cat-icon-img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  image-rendering: pixelated;
}

.cat-icon-text {
  font-size: 0.9rem;
  line-height: 1;
}

.cat-pill:hover {
  border-color: var(--border-strong);
  color: var(--text-main);
  background-color: #141724;
}

.cat-pill.active {
  background-color: #161b26;
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.18);
}

.cat-pill.cat-tools.active {
  border-color: #38bdf8;
  color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.22);
}

.cat-pill.cat-armor.active {
  border-color: #f59e0b;
  color: #f59e0b;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.22);
}

.cat-pill.cat-books.active {
  border-color: #ec4899;
  color: #ec4899;
  box-shadow: 0 0 12px rgba(236, 72, 153, 0.22);
}

.cat-pill.cat-special.active {
  border-color: #ef4444;
  color: #ef4444;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.22);
}

/* Pasek Podkategorii (1:1 z gry Anarchia) */
.subcategory-bar {
  margin-top: -6px;
  margin-bottom: 20px;
  padding: 10px 14px;
  background: linear-gradient(90deg, rgba(16, 20, 31, 0.85) 0%, rgba(11, 14, 21, 0.5) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  animation: fadeInSubcat 0.2s ease-out;
}

@keyframes fadeInSubcat {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.subcategory-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.subcat-prefix {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  white-space: nowrap;
}

.subcategory-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.subcat-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  background: rgba(11, 14, 21, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
}

.subcat-chip:hover {
  color: var(--text-main);
  border-color: rgba(56, 189, 248, 0.35);
  background-color: #141824;
  transform: translateY(-1px);
}

.subcat-chip.active {
  background: linear-gradient(135deg, #182338 0%, #101826 100%);
  border-color: var(--cyan);
  color: #fff;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.subcat-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 6px;
  border-radius: 10px;
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.subcat-chip:hover .subcat-count {
  background-color: rgba(56, 189, 248, 0.15);
  color: var(--cyan);
}

.subcat-chip.active .subcat-count {
  background-color: rgba(56, 189, 248, 0.25);
  color: #fff;
}

.toolbar-controls {
  display: flex;
  align-items: center;
  gap: 14px;
}

.items-count-indicator {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}

.sort-dropdown-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: #11141e;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0 12px;
  height: 36px;
  transition: all 0.15s ease;
  cursor: pointer;
}

.sort-dropdown-wrap:hover,
.sort-dropdown-wrap:focus-within {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.12);
  background-color: #141824;
}

.sort-prefix {
  font-size: 0.74rem;
  color: var(--text-dim);
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
  pointer-events: none;
}

.sort-select-input {
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  padding-right: 6px;
}

.sort-select-input option {
  background-color: #10141f;
  color: #f1f5f9;
  font-family: var(--font-sans);
  font-size: 0.84rem;
  padding: 8px 10px;
}

/* ==========================================================================
   4. Siatka Kart Giełdowych (Trading Item Cards)
   ========================================================================== */

.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.terminal-loader {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 80px 20px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.88rem;
}

.loader-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(255, 255, 255, 0.08);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* Karta Przedmiotu — Luksusowy Glassmorphism z Neonowymi Akcentami */
.item-card {
  position: relative;
  background: linear-gradient(180deg, rgba(18, 22, 32, 0.85) 0%, rgba(12, 15, 22, 0.92) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 15px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.22s ease,
              box-shadow 0.22s ease,
              background 0.22s ease;
  user-select: none;
  box-shadow: 0 4px 18px -3px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.item-card:hover {
  transform: translateY(-5px);
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 16px 36px -6px rgba(0, 0, 0, 0.75), 0 0 24px -4px rgba(56, 189, 248, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* Wyróżnienia rzadkości rynkowej */
.item-card.card-anarchic {
  border-color: rgba(245, 158, 11, 0.35);
  box-shadow: 0 4px 20px -3px rgba(245, 158, 11, 0.12), inset 0 1px 0 rgba(245, 158, 11, 0.15);
}

.item-card.card-anarchic:hover {
  border-color: rgba(245, 158, 11, 0.65);
  box-shadow: 0 16px 36px -6px rgba(0, 0, 0, 0.8), 0 0 28px -2px rgba(245, 158, 11, 0.28), inset 0 1px 0 rgba(245, 158, 11, 0.25);
}

.item-card.card-event {
  border-color: rgba(192, 132, 252, 0.35);
  box-shadow: 0 4px 20px -3px rgba(192, 132, 252, 0.12), inset 0 1px 0 rgba(192, 132, 252, 0.15);
}

.item-card.card-event:hover {
  border-color: rgba(192, 132, 252, 0.65);
  box-shadow: 0 16px 36px -6px rgba(0, 0, 0, 0.8), 0 0 28px -2px rgba(192, 132, 252, 0.28), inset 0 1px 0 rgba(192, 132, 252, 0.25);
}

.item-card:focus-visible {
  outline: 2px solid var(--border-focus);
}

/* Górny pasek karty (Tag & Trend) */
.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.item-badge-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 3px;
  text-transform: uppercase;
}

.tag-anarchic {
  background-color: var(--anarchic-glow);
  color: var(--anarchic-gold);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.tag-sword {
  background-color: var(--red-glow);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.tag-special {
  background-color: rgba(192, 132, 252, 0.15);
  color: #c084fc;
  border: 1px solid rgba(192, 132, 252, 0.35);
}

.tag-vanilla {
  background-color: #171b24;
  color: var(--text-dim);
  border: 1px solid var(--border-subtle);
}

.tag-cat-tools {
  background-color: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.tag-cat-armor {
  background-color: rgba(6, 182, 212, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.35);
}

.tag-cat-books {
  background-color: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.tag-cat-special {
  background-color: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.trend-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
}

.trend-positive {
  background-color: var(--green-glow);
  color: var(--green);
  border: 1px solid var(--green-border);
}

.trend-negative {
  background-color: var(--red-glow);
  color: var(--red);
  border: 1px solid var(--red-border);
}

.trend-neutral {
  background-color: #13161f;
  color: var(--text-dim);
  border: 1px solid var(--border-subtle);
}

/* Środek karty: Minecraft Slot Box */
.card-slot-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 12px;
}

.mc-slot-box {
  width: 76px;
  height: 76px;
  background: radial-gradient(circle at 50% 35%, #181d2a 0%, #080a10 100%);
  border: 2px solid #232b3d;
  border-radius: 10px;
  box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.85), 0 2px 6px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.item-card:hover .mc-slot-box {
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.85), 0 0 14px rgba(56, 189, 248, 0.25);
}

.mc-slot-box img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.65));
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.item-card:hover .mc-slot-box img {
  transform: scale(1.14);
}

/* Tytuł */
.card-item-title {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
  margin-bottom: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

/* Blok Cenowy */
.card-pricing-block {
  background: linear-gradient(180deg, rgba(14, 18, 26, 0.9) 0%, rgba(9, 11, 17, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.card-liquid-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 5px;
}

.card-liquid-val {
  font-family: var(--font-mono);
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #10b981;
  text-shadow: 0 0 16px rgba(16, 185, 129, 0.35);
}

.card-liquid-label {
  font-size: 0.68rem;
  color: var(--text-dim);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.card-range-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Stopka Karty: Sprzedawca i Wolumen */
.card-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.74rem;
  color: var(--text-dim);
  border-top: 1px solid var(--border-subtle);
  padding-top: 9px;
  margin-top: auto;
}

.card-seller-box {
  display: flex;
  align-items: center;
  gap: 5px;
}

.card-seller-avatar {
  width: 16px;
  height: 16px;
  border-radius: 2px;
  image-rendering: pixelated;
}

.card-seller-name {
  color: var(--text-muted);
  font-weight: 600;
}

.card-volume-box {
  font-family: var(--font-mono);
  color: var(--text-dim);
}


/* ==========================================================================
   6. Terminal Szczegółowy / Modal (Wykres & Minecraft Tooltip)
   ========================================================================== */

.market-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999;
  background-color: rgba(4, 5, 8, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.market-modal-backdrop[hidden] {
  display: none;
  opacity: 0;
}

.market-modal-panel {
  width: 100%;
  max-width: 1100px;
  max-height: 92vh;
  background-color: #0e1118;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px -12px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background-color: #0b0d13;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-item-identity {
  display: flex;
  align-items: center;
  gap: 14px;
}

.modal-item-icon-box {
  width: 56px;
  height: 56px;
  background-color: #07090d;
  border: 2px solid #1f2533;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.8);
}

.modal-item-icon-box img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  image-rendering: pixelated;
}

.modal-rarity-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}

.modal-rarity-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: 0.05em;
}

.btn-copy-ah {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 4px;
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-copy-ah:hover {
  background: rgba(56, 189, 248, 0.22);
  border-color: var(--cyan);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.25);
}

.modal-item-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.modal-item-key {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
}

.modal-top-pricing {
  display: flex;
  align-items: center;
  gap: 20px;
}

.modal-liquid-display {
  text-align: right;
}

.modal-price-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

.modal-price-val {
  font-family: var(--font-mono);
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--green);
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.7rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  transition: color 0.15s ease;
}

.modal-close-btn:hover {
  color: var(--text-main);
}

/* Modal Body: Split-Screen */
.modal-grid-body {
  display: grid;
  grid-template-columns: 1fr 390px;
  flex: 1;
  overflow-y: auto;
}

.modal-left-chart-col {
  padding: 20px;
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
}

.chart-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.chart-timeframe-group {
  display: flex;
  background-color: #080a0f;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.btn-timeframe {
  padding: 4px 10px;
  background: none;
  border: none;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dim);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.btn-timeframe:hover {
  color: var(--text-main);
}

.btn-timeframe.active {
  background-color: #171b26;
  color: var(--cyan);
}

.chart-legend-pills {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.legend-pill-notations {
  color: var(--green);
}

.legend-pill-liquid {
  color: var(--cyan);
}

.chart-canvas-wrapper {
  height: 290px;
  position: relative;
  margin-bottom: 16px;
}

/* 6 Metryk Giełdowych w Modalu */
.modal-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: auto;
}

.metric-card {
  background-color: #0b0d13;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.metric-card small {
  display: block;
  font-size: 0.62rem;
  color: var(--text-dim);
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.metric-card strong {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
}

.metric-card.metric-low strong {
  color: #10b981;
}

.metric-card.metric-high strong {
  color: #f59e0b;
}

.metric-card.metric-med strong {
  color: #38bdf8;
}

.metric-card.metric-spread strong {
  color: #c084fc;
}

.metric-card.metric-vol strong {
  color: #f1f5f9;
}

.metric-card.metric-samples strong {
  color: #94a3b8;
}

/* Prawa Kolumna: Autentyczny Minecraft Tooltip */
.modal-right-lore-col {
  padding: 20px;
  background-color: #0b0d14;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.lore-section-header, .recent-sellers-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.recent-sellers-header {
  margin-top: 18px;
}

/* 1:1 Minecraft Tooltip Box */
.mc-tooltip-box {
  background-color: #100010;
  border: 2px solid #280070;
  box-shadow: inset 0 0 0 1px #5000ff, 0 8px 16px rgba(0, 0, 0, 0.7);
  border-radius: 4px;
  padding: 10px 12px;
  font-family: 'Inter', var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.4;
  margin-bottom: 10px;
}

.mc-tooltip-header {
  font-weight: 700;
  margin-bottom: 4px;
}

.mc-tooltip-lines div {
  white-space: pre-wrap;
  word-break: break-word;
}

/* Kolory Minecrafta dla Lore */
.mc-c-0 { color: #000000; }
.mc-c-1 { color: #0000aa; }
.mc-c-2 { color: #00aa00; }
.mc-c-3 { color: #00aaaa; }
.mc-c-4 { color: #aa0000; }
.mc-c-5 { color: #aa00aa; }
.mc-c-6 { color: #ffaa00; font-weight: 600; }
.mc-c-7 { color: #aaaaaa; }
.mc-c-8 { color: #555555; }
.mc-c-9 { color: #5555ff; }
.mc-c-a { color: #55ff55; font-weight: 600; }
.mc-c-b { color: #55ffff; font-weight: 600; }
.mc-c-c { color: #ff5555; font-weight: 600; }
.mc-c-d { color: #ff55ff; font-weight: 600; }
.mc-c-e { color: #ffff55; font-weight: 600; }
.mc-c-f { color: #ffffff; }

/* Lista ostatnich wystawień */
.recent-sellers-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
}

.seller-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  background-color: #0e1118;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  font-size: 0.78rem;
  transition: all 0.15s ease;
  user-select: none;
}

.seller-row:hover {
  background-color: #141926;
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateX(2px);
}

.seller-row.is-selected {
  border-color: var(--cyan) !important;
  background-color: rgba(56, 189, 248, 0.12);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.seller-row-left {
  display: flex;
  align-items: center;
  gap: 7px;
}

.seller-row-avatar {
  width: 20px;
  height: 20px;
  border-radius: 3px;
  image-rendering: pixelated;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.seller-row-name {
  color: var(--cyan);
  font-weight: 600;
}

.seller-row-count {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  background-color: #171b26;
  padding: 1px 5px;
  border-radius: 3px;
}

.seller-row-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.seller-deal-badge {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  background-color: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.seller-row-price {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--green);
}

.seller-row-time {
  font-size: 0.68rem;
  color: var(--text-dim);
}

/* Toast Powiadomienia (np. Kopiowanie /ah) */
.market-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: #0f131d;
  border: 1px solid var(--green);
  border-radius: 8px;
  color: #f8fafc;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 16px rgba(16, 185, 129, 0.3);
  animation: toast-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.market-toast[hidden] {
  display: none !important;
}

.toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: var(--green);
  color: #05070a;
  font-weight: 900;
  font-size: 0.75rem;
}

@keyframes toast-in {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ==========================================================================
   7. Stopka
   ========================================================================== */

.app-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
  background-color: #07090d;
  padding: 14px 20px;
  font-size: 0.74rem;
  color: var(--text-dim);
}

.footer-inner {
  max-width: var(--site-max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-brand {
  font-weight: 700;
  color: var(--text-muted);
}

.footer-version {
  font-family: var(--font-mono);
  color: var(--cyan);
}

/* Responsywność */
@media (max-width: 900px) {
  .modal-grid-body {
    grid-template-columns: 1fr;
  }
  .modal-left-chart-col {
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }
  .modal-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  .header-metrics {
    display: none;
  }
  .search-terminal-wrap {
    max-width: 100%;
  }
  .market-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .toolbar-controls {
    justify-content: space-between;
  }
}
