/* Rynek offline — Nostalgie™ Legacy */
.mk {
  --g-hi: #f6dc94;
  --g: #d8b45a;
  --ink: #f4ecda;
  --text: rgba(236, 226, 206, .82);
  --muted: rgba(214, 200, 172, .56);
  --line: rgba(255, 236, 190, .08);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --panel: linear-gradient(180deg, rgba(26, 21, 30, .92), rgba(10, 8, 14, .94));
  --corner-tl: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cg %3E%3Cg fill='none' stroke='%23d8b45a' stroke-width='1.2'%3E%3Cpath d='M1.5 27V10a8.5 8.5 0 0 1 8.5-8.5H27'/%3E%3Cpath d='M6.5 21V13a6.5 6.5 0 0 1 6.5-6.5h8' opacity='.5'/%3E%3C/g%3E%3Cpath d='M10 6.8l3.2 3.2-3.2 3.2-3.2-3.2z' fill='%23f0cf7a'/%3E%3Ccircle cx='31' cy='1.6' r='1.2' fill='%23d8b45a'/%3E%3Ccircle cx='1.6' cy='31' r='1.2' fill='%23d8b45a'/%3E%3C/g%3E%3C/svg%3E");
  --corner-tr: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cg transform='translate(40 0) scale(-1 1)'%3E%3Cg fill='none' stroke='%23d8b45a' stroke-width='1.2'%3E%3Cpath d='M1.5 27V10a8.5 8.5 0 0 1 8.5-8.5H27'/%3E%3Cpath d='M6.5 21V13a6.5 6.5 0 0 1 6.5-6.5h8' opacity='.5'/%3E%3C/g%3E%3Cpath d='M10 6.8l3.2 3.2-3.2 3.2-3.2-3.2z' fill='%23f0cf7a'/%3E%3Ccircle cx='31' cy='1.6' r='1.2' fill='%23d8b45a'/%3E%3Ccircle cx='1.6' cy='31' r='1.2' fill='%23d8b45a'/%3E%3C/g%3E%3C/svg%3E");
  --corner-bl: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cg transform='translate(0 40) scale(1 -1)'%3E%3Cg fill='none' stroke='%23d8b45a' stroke-width='1.2'%3E%3Cpath d='M1.5 27V10a8.5 8.5 0 0 1 8.5-8.5H27'/%3E%3Cpath d='M6.5 21V13a6.5 6.5 0 0 1 6.5-6.5h8' opacity='.5'/%3E%3C/g%3E%3Cpath d='M10 6.8l3.2 3.2-3.2 3.2-3.2-3.2z' fill='%23f0cf7a'/%3E%3Ccircle cx='31' cy='1.6' r='1.2' fill='%23d8b45a'/%3E%3Ccircle cx='1.6' cy='31' r='1.2' fill='%23d8b45a'/%3E%3C/g%3E%3C/svg%3E");
  --corner-br: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cg transform='translate(40 40) scale(-1 -1)'%3E%3Cg fill='none' stroke='%23d8b45a' stroke-width='1.2'%3E%3Cpath d='M1.5 27V10a8.5 8.5 0 0 1 8.5-8.5H27'/%3E%3Cpath d='M6.5 21V13a6.5 6.5 0 0 1 6.5-6.5h8' opacity='.5'/%3E%3C/g%3E%3Cpath d='M10 6.8l3.2 3.2-3.2 3.2-3.2-3.2z' fill='%23f0cf7a'/%3E%3Ccircle cx='31' cy='1.6' r='1.2' fill='%23d8b45a'/%3E%3Ccircle cx='1.6' cy='31' r='1.2' fill='%23d8b45a'/%3E%3C/g%3E%3C/svg%3E");
  --divider: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 24'%3E%3Cdefs%3E%3ClinearGradient id='a' x1='0' x2='1'%3E%3Cstop offset='0' stop-color='%23d8b45a' stop-opacity='0'/%3E%3Cstop offset='1' stop-color='%23d8b45a'/%3E%3C/linearGradient%3E%3ClinearGradient id='b' x1='1' x2='0'%3E%3Cstop offset='0' stop-color='%23d8b45a' stop-opacity='0'/%3E%3Cstop offset='1' stop-color='%23d8b45a'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M0 12h128' stroke='url(%23a)'/%3E%3Cpath d='M192 12h128' stroke='url(%23b)'/%3E%3Cpath d='M132 12c8-8 16-8 22 0M188 12c-8-8-16-8-22 0M132 12c8 8 16 8 22 0M188 12c-8 8-16 8-22 0' fill='none' stroke='%23d8b45a' stroke-width='1.1'/%3E%3Cpath d='M160 3l9 9-9 9-9-9z' fill='%23f0cf7a'/%3E%3Cpath d='M160 7.5l4.5 4.5-4.5 4.5-4.5-4.5z' fill='%230b0910'/%3E%3Ccircle cx='124' cy='12' r='1.6' fill='%23d8b45a'/%3E%3Ccircle cx='196' cy='12' r='1.6' fill='%23d8b45a'/%3E%3C/svg%3E");
  display: block;
  width: min(100% - 32px, 1120px);
  margin: 34px auto 80px;
  color: var(--text);
}

/* Nagłówek */
.mk-head { text-align: center; }
.mk-k { margin: 0 0 10px; font: 600 .7rem/1 Inter, system-ui, sans-serif; letter-spacing: .26em; text-transform: uppercase; color: var(--g); }
.mk-title { margin: 0; font: 700 clamp(1.8rem, 3.6vw, 2.6rem)/1.1 Cinzel, Georgia, serif; letter-spacing: .04em; color: var(--ink); text-shadow: 0 4px 22px rgba(0, 0, 0, .5); }
.mk-sub { max-width: 560px; margin: 10px auto 0; font-size: .95rem; line-height: 1.55; color: var(--muted); }
.mk-divider { display: block; width: 220px; max-width: 70%; height: 18px; margin: 14px auto 0; background: var(--divider) center / contain no-repeat; }
.mk-season {
  width: fit-content; max-width: 100%; margin: 22px auto 0; padding: 9px 18px; border-radius: 999px;
  font-size: .84rem; line-height: 1.45; text-align: center; color: var(--text);
  background: rgba(216, 180, 90, .07); border: 1px solid rgba(216, 180, 90, .22);
}
.mk-season span { color: var(--g); margin-right: 4px; }
.mk-season b { color: var(--g-hi); font-weight: 650; }

/* Liczby rynku */
.mk-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; margin: 28px 0 0; border-radius: 6px; overflow: hidden; background: rgba(216, 180, 90, .16); border: 1px solid rgba(216, 180, 90, .2); }
.mk-kpis div { padding: 16px 14px; text-align: center; background: linear-gradient(180deg, rgba(22, 18, 26, .97), rgba(11, 9, 14, .98)); }
.mk-kpis dt { font-size: .62rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.mk-kpis dd { margin: 6px 0 0; font: 700 1.25rem/1.1 Cinzel, Georgia, serif; color: var(--ink); font-variant-numeric: tabular-nums; }
.mk-kpis dd.is-gold { color: var(--g-hi); }

/* Pusty rynek: jak postawić sklep */
.mk-empty {
  margin: 30px auto 0; max-width: 820px; padding: 34px 34px 30px; text-align: center; border-radius: 4px;
  background: var(--corner-tl) top 6px left 6px / 30px no-repeat, var(--corner-tr) top 6px right 6px / 30px no-repeat,
    var(--corner-bl) bottom 6px left 6px / 30px no-repeat, var(--corner-br) bottom 6px right 6px / 30px no-repeat,
    radial-gradient(120% 80% at 50% 0%, rgba(216, 170, 80, .1), transparent 55%), var(--panel);
  border: 1px solid rgba(216, 180, 90, .22);
  box-shadow: inset 0 0 0 4px rgba(10, 8, 12, .85), inset 0 0 0 5px rgba(216, 180, 90, .12), 0 22px 44px rgba(0, 0, 0, .45);
}
.mk-empty h2 { margin: 0; font: 700 1.35rem/1.2 Cinzel, Georgia, serif; letter-spacing: .05em; color: var(--ink); }
.mk-empty > p { margin: 8px 0 0; color: var(--muted); font-size: .95rem; }
.mk-how { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 26px 0 0; padding: 0; list-style: none; counter-reset: mk; text-align: left; }
.mk-how li { counter-increment: mk; padding: 16px; border-radius: 6px; background: rgba(255, 255, 255, .025); border: 1px solid var(--line); }
.mk-how li::before {
  content: counter(mk); display: grid; place-items: center; width: 30px; height: 30px; margin-bottom: 10px; border-radius: 50%;
  font: 700 .9rem/1 Cinzel, Georgia, serif; color: #241703;
  background: radial-gradient(circle at 34% 28%, #fff1c6, #e2b85e 52%, #9c6f22); box-shadow: 0 0 0 3px rgba(12, 9, 14, .9), 0 0 0 4px rgba(216, 180, 90, .35);
}
.mk-how b { display: block; color: var(--ink); font-size: .95rem; margin-bottom: 4px; }
.mk-how span { display: block; color: var(--muted); font-size: .84rem; line-height: 1.5; }
.mk-how code { color: var(--g-hi); font-size: .9em; }

/* Wyszukiwarka i filtr */
.mk-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 28px 0 18px; }
.mk-search { position: relative; flex: 1 1 320px; max-width: 460px; }
.mk-search svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; translate: 0 -50%; fill: none; stroke: var(--g); stroke-width: 1.8; stroke-linecap: round; pointer-events: none; }
.mk-search input {
  width: 100%; height: 46px; padding: 0 16px 0 42px; border-radius: 6px; box-sizing: border-box;
  font: 500 .92rem/1 Inter, system-ui, sans-serif; color: var(--ink);
  background: rgba(10, 8, 14, .85); border: 1px solid rgba(216, 180, 90, .25); outline: none;
  transition: border-color .25s ease, box-shadow .25s ease;
}
.mk-search input::placeholder { color: rgba(214, 200, 172, .42); }
.mk-search input:focus { border-color: rgba(246, 220, 148, .6); box-shadow: 0 0 0 4px rgba(216, 170, 80, .12); }
.mk-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.mk-filter button {
  flex: none; white-space: nowrap;
  padding: 10px 14px; border-radius: 4px; cursor: pointer;
  font: 700 .72rem/1 Cinzel, Georgia, serif; letter-spacing: .12em; text-transform: uppercase;
  color: rgba(236, 226, 206, .66); background: rgba(12, 10, 16, .8); border: 1px solid var(--line);
  transition: color .25s ease, border-color .25s ease;
}
.mk-filter button small { font: 600 .7rem/1 Inter, system-ui, sans-serif; color: var(--muted); margin-left: 4px; }
.mk-filter button:hover { color: var(--g-hi); border-color: rgba(216, 180, 90, .35); }
.mk-filter button.on { color: #241703; border-color: #5c3f0e; background: linear-gradient(180deg, #ffeab0 0%, #e7c06a 40%, #c3922f 75%, #8f6519 100%); }
.mk-filter button.on small { color: rgba(36, 23, 3, .7); }

/* Sklepy */
.mk-shops { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.mk-shop {
  --tone: #e3c27a;
  display: flex; flex-direction: column; border-radius: 4px; overflow: hidden;
  background: radial-gradient(120% 60% at 0% 0%, color-mix(in srgb, var(--tone) 12%, transparent), transparent 60%), var(--panel);
  border: 1px solid rgba(216, 180, 90, .2);
  box-shadow: inset 0 0 0 4px rgba(10, 8, 12, .85), inset 0 0 0 5px rgba(216, 180, 90, .1), 0 18px 36px rgba(0, 0, 0, .4);
  transition: transform .35s var(--ease), border-color .3s ease;
  animation: mkIn .5s var(--ease) both;
}
.mk-shop:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--tone) 55%, transparent); }
.mk-shop.is-buy { --tone: #7cb8ff; }
.mk-shop.is-craft { --tone: #8fe0a5; }
@keyframes mkIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.mk-shop__head { padding: 18px 20px 12px; }
.mk-badge {
  display: inline-block; margin-bottom: 8px; padding: 3px 9px; border-radius: 999px;
  font-size: .6rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--tone); background: color-mix(in srgb, var(--tone) 12%, transparent); border: 1px solid color-mix(in srgb, var(--tone) 40%, transparent);
}
.mk-shop__head h2 { margin: 0; font: 700 1.15rem/1.2 Cinzel, Georgia, serif; letter-spacing: .04em; color: var(--ink); }
.mk-shop__head p { margin: 4px 0 0; font-size: .78rem; color: var(--muted); }
.mk-shop__head .mk-shop__title { color: var(--g-hi); font-style: italic; font-size: .86rem; }
.mk-items { margin: 0; padding: 4px 20px; list-style: none; flex: 1; }
.mk-items li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 4px 12px; align-items: baseline; padding: 9px 0; border-top: 1px solid var(--line); font-size: .86rem; }
.mk-item { color: var(--ink); overflow-wrap: anywhere; }
.mk-item em, .mk-feed em { font-style: normal; font: 700 .68rem/1 Cinzel, Georgia, serif; color: #241703; padding: 2px 5px; border-radius: 3px; background: linear-gradient(180deg, #ffeab0, #d9ae4f 60%, #a87c2a); vertical-align: 1px; }
.mk-qty { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mk-price { color: var(--g-hi); font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.mk-price small { color: var(--muted); font-weight: 500; font-size: .72rem; }
.mk-shop__foot { display: flex; justify-content: space-between; gap: 10px; padding: 12px 20px 16px; font-size: .76rem; color: var(--muted); border-top: 1px solid var(--line); }
.mk-shop__foot b { color: var(--g-hi); font-weight: 650; }
.mk-note { margin: 10px 0 0; font-size: .82rem; line-height: 1.5; color: var(--muted); }
.mk-items + .mk-note, .mk-shop > .mk-note { padding: 0 20px; }
.mk-none { margin: 20px 0 0; text-align: center; color: var(--muted); }

/* Transakcje i najwięksi kupcy */
.mk-cols { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; margin-top: 30px; }
.mk-panel { padding: 22px; border-radius: 6px; background: var(--panel); border: 1px solid rgba(216, 180, 90, .18); box-shadow: 0 18px 36px rgba(0, 0, 0, .35); }
.mk-panel h2 { margin: 0 0 12px; font: 700 .9rem/1.2 Cinzel, Georgia, serif; letter-spacing: .12em; text-transform: uppercase; color: var(--g); }
.mk-feed, .mk-top { margin: 0; padding: 0; list-style: none; }
.mk-feed li { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "item sum" "who sum"; gap: 2px 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.mk-feed li:first-child, .mk-top li:first-child { border-top: 0; }
.mk-feed__item { grid-area: item; color: var(--ink); font-size: .88rem; overflow-wrap: anywhere; }
.mk-feed__item small { color: var(--muted); }
.mk-feed__who { grid-area: who; color: var(--muted); font-size: .74rem; }
.mk-feed b { grid-area: sum; color: var(--g-hi); font-weight: 650; font-variant-numeric: tabular-nums; }
.mk-top li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.mk-top__n { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font: 700 .82rem/1 Cinzel, Georgia, serif; color: var(--muted); border: 1px solid var(--line); }
.mk-top li.is-1 .mk-top__n { color: #3a2808; border: 0; background: radial-gradient(circle at 34% 28%, #fff6cf, #f2d27e 50%, #c4922f); }
.mk-top li.is-2 .mk-top__n { color: #2c323c; border: 0; background: radial-gradient(circle at 34% 28%, #ffffff, #dfe4ec 50%, #9ba5b5); }
.mk-top li.is-3 .mk-top__n { color: #3a200c; border: 0; background: radial-gradient(circle at 34% 28%, #ffe2c6, #dca170 50%, #a2643a); }
.mk-top__name { color: var(--ink); font-size: .9rem; overflow-wrap: anywhere; }
.mk-top__name small { display: block; color: var(--muted); font-size: .72rem; }
.mk-top b { color: var(--g-hi); font-variant-numeric: tabular-nums; }

@media (max-width: 860px) {
  .mk-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mk-kpis div:first-child { grid-column: 1 / -1; }
  .mk-how { grid-template-columns: 1fr; }
  .mk-cols { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .mk { width: min(100% - 24px, 1120px); margin-top: 22px; }
  .mk-empty { padding: 26px 18px 22px; }
  .mk-search { flex-basis: 100%; max-width: none; }
  .mk-filter { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .mk-shops { grid-template-columns: 1fr; }
  .mk-items li { grid-template-columns: minmax(0, 1fr) auto; }
  .mk-qty { grid-column: 1; grid-row: 2; font-size: .76rem; }
  .mk-price { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
}
@media (prefers-reduced-motion: reduce) {
  .mk-shop { animation: none; }
}
