/* =========================================================================
   Gruby Kod — portal skin
   Kierunek: „skarbiec autentyczności × kultura dropów”.
   Głęboka warstwowa czerń, złoto = pieczęć autentyczności (oszczędnie),
   mono = materiał techniczny (UID / hash / kod), łańcuch pochodzenia jako sygnatura.
   Zero zależności zewnętrznych — stack systemowy, offline-friendly.
   ========================================================================= */

:root {
    /* grounds — warstwowa czerń z lekko chłodnym biasem */
    --bg:        #0a0b0f;
    --bg-2:      #0d0f15;
    --panel:     #14161d;
    --panel-2:   #1b1e27;
    --elev:      #232733;
    --border:    #262a34;
    --border-2:  #343a48;

    /* ink */
    --text:      #eceef4;
    --muted:     #9aa1b2;
    --faint:     #666d7e;

    /* złoto — pieczęć autentyczności */
    --gold:      #e7bd57;
    --gold-hi:   #f4d585;
    --gold-dim:  rgba(231,189,87,.14);
    --gold-line: rgba(231,189,87,.42);
    --gold-ink:  #1a1400;

    /* semantyka */
    --green:  #37c977;
    --red:    #e5544b;
    --blue:   #5aa2ff;
    --violet: #b494f7;
    --drop:   #ff9d3d;

    --radius:    14px;
    --radius-sm: 9px;
    --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Roboto Mono", monospace;
    --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--sans);
    color: var(--text);
    line-height: 1.6;
    background:
        radial-gradient(1100px 640px at 82% -8%, rgba(231,189,87,.06), transparent 60%),
        radial-gradient(900px 600px at 0% 0%, rgba(90,162,255,.045), transparent 55%),
        var(--bg);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: var(--gold); color: var(--gold-ink); }

:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---- Eyebrow / labels (mono, uppercase — technical texture) ------------- */
.eyebrow {
    font-family: var(--mono);
    text-transform: uppercase;
    letter-spacing: .18em;
    font-size: 12px;
    color: var(--gold);
    display: inline-block;
}

/* ---- Top bar ----------------------------------------------------------- */
.topbar {
    position: sticky; top: 0; z-index: 20;
    border-bottom: 1px solid var(--border);
    background: rgba(10, 11, 15, .72);
    backdrop-filter: saturate(140%) blur(12px);
    -webkit-backdrop-filter: saturate(140%) blur(12px);
}
.topbar::before {
    content: ""; display: block; height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold-line) 20%, var(--gold) 50%, var(--gold-line) 80%, transparent);
    opacity: .8;
}
.topbar-inner {
    max-width: 1040px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 13px 24px;
}
.brand {
    font-weight: 800; letter-spacing: .16em; font-size: 19px;
    color: var(--text); white-space: nowrap;
    display: inline-flex; align-items: center; gap: 9px;
}
.brand:hover { text-decoration: none; }
.brand span { color: var(--gold); }
.brand::before {
    content: ""; width: 9px; height: 9px; border-radius: 2px;
    background: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-dim);
    transform: rotate(45deg);
}
.topbar nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.topbar nav a:not([class]) {
    color: var(--muted); font-size: 14.5px; padding: 6px 10px; border-radius: 8px;
    transition: color .15s, background .15s;
}
.topbar nav a:not([class]):hover { color: var(--text); text-decoration: none; background: var(--panel-2); }
.who {
    color: var(--gold); font-weight: 700; font-size: 14.5px;
    padding: 6px 11px; border-radius: 999px;
    border: 1px solid var(--gold-line); background: var(--gold-dim);
}
.who:hover { text-decoration: none; color: var(--gold-hi); }

/* ---- Layout ------------------------------------------------------------ */
main { max-width: 960px; margin: 0 auto; padding: 40px 24px 80px; }
footer {
    text-align: center; color: var(--faint); font-size: 12.5px;
    padding: 30px 24px; border-top: 1px solid var(--border);
}
footer .mono { color: var(--muted); }

/* ---- Typography -------------------------------------------------------- */
h1 {
    font-size: clamp(1.9rem, 4.4vw, 2.6rem); line-height: 1.08;
    letter-spacing: -.02em; font-weight: 800; margin: 0 0 12px;
    text-wrap: balance;
}
h2 {
    font-size: 1.35rem; line-height: 1.2; letter-spacing: -.01em;
    font-weight: 750; margin: 40px 0 14px; text-wrap: balance;
}
h3 { font-size: 1.02rem; margin: 0 0 8px; font-weight: 700; }
p { margin: 0 0 14px; }
.lead { color: var(--muted); font-size: 1.12rem; line-height: 1.6; margin-top: 0; max-width: 64ch; }
strong { color: var(--text); font-weight: 700; }

/* ---- Hero (home) ------------------------------------------------------- */
.hero { padding: 22px 0 8px; margin-bottom: 8px; }
.hero .eyebrow { margin-bottom: 16px; }
.hero h1 { font-size: clamp(2.1rem, 6vw, 3.4rem); }
.hero .lead { font-size: 1.18rem; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.trust {
    display: flex; gap: 26px; flex-wrap: wrap; margin: 26px 0 6px;
    padding-top: 20px; border-top: 1px solid var(--border);
}
.trust div { display: flex; flex-direction: column; gap: 2px; }
.trust .n { font-size: 1.3rem; font-weight: 800; letter-spacing: -.01em; }
.trust .n.gold { color: var(--gold); }
.trust .k { font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); }

/* ---- Panels / cards ---------------------------------------------------- */
.panel {
    background: linear-gradient(180deg, var(--panel), var(--bg-2));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 18px;
}
.panel > :first-child { margin-top: 0; }
.panel > :last-child { margin-bottom: 0; }

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

.card {
    position: relative;
    background: linear-gradient(180deg, var(--panel), var(--bg-2));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: block; color: var(--text);
    overflow: hidden;
    transition: border-color .16s, transform .16s, box-shadow .16s;
}
.card::after {
    content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: 0; transition: opacity .16s;
}
.card:hover {
    border-color: var(--gold-line); text-decoration: none;
    transform: translateY(-3px);
    box-shadow: 0 14px 30px -18px rgba(0,0,0,.8);
}
.card:hover::after { opacity: 1; }
.card .emblem {
    font-size: 32px; line-height: 1;
    width: 58px; height: 58px; display: flex; align-items: center; justify-content: center;
    border-radius: 12px; background: var(--panel-2); border: 1px solid var(--border);
    margin-bottom: 12px;
}
.card .title { font-weight: 750; margin: 2px 0; letter-spacing: -.01em; }
.card .edition { color: var(--muted); font-size: 13px; }
.card .who { padding: 2px 8px; font-size: 12px; }

/* ---- Certificate — traktowana jak dokument ----------------------------- */
.cert-head { display: flex; gap: 22px; align-items: center; }
.cert-emblem {
    font-size: 46px; line-height: 1; flex: none;
    width: 92px; height: 92px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 35%, var(--panel-2), var(--bg));
    border: 1px solid var(--gold-line);
    box-shadow: inset 0 0 0 4px rgba(231,189,87,.06), 0 0 0 1px var(--border);
}
.badge {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 6px 13px; border-radius: 999px; font-size: 13px; font-weight: 700;
    letter-spacing: .01em;
}
.badge-ok  { background: rgba(55,201,119,.13); color: var(--green); border: 1px solid rgba(55,201,119,.42); }
.badge-bad { background: rgba(229,84,75,.13);  color: var(--red);   border: 1px solid rgba(229,84,75,.45); }

.cert-body { display: flex; gap: 28px; align-items: flex-start; flex-wrap: wrap; margin-top: 20px; }
.cert-body .meta { flex: 1; min-width: 280px; }
.meta { width: 100%; border-collapse: collapse; }
.meta td { padding: 10px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.meta tr:last-child td { border-bottom: none; }
.meta td:first-child {
    color: var(--faint); width: 172px;
    font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
    padding-top: 12px;
}
.mono { font-family: var(--mono); font-size: 13px; word-break: break-all; }

.qr-box { text-align: center; }
.qr {
    width: 180px; height: 180px; background: #fff; border-radius: 12px; padding: 10px; line-height: 0;
    border: 1px solid var(--border); box-shadow: 0 8px 22px -14px rgba(0,0,0,.9);
}
.qr svg { width: 100%; height: 100%; }
.qr-cap { color: var(--muted); font-size: 12.5px; margin: 10px 0 0; }

/* ---- Ledger timeline — sygnatura --------------------------------------- */
.chain { list-style: none; padding: 0; margin: 0; }
.chain li {
    position: relative; padding: 6px 0 18px 30px;
    border-left: 2px solid var(--border); margin-left: 10px;
}
.chain li:last-child { border-left-color: transparent; }
.chain li::before {
    content: ''; position: absolute; left: -8px; top: 6px;
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--bg); border: 2px solid var(--gold);
    box-shadow: 0 0 0 4px rgba(231,189,87,.10);
}
.chain .ev-type {
    font-family: var(--mono); font-weight: 700; font-size: 12px;
    text-transform: uppercase; letter-spacing: .1em;
    padding: 3px 9px; border-radius: 6px;
    background: var(--panel-2); border: 1px solid var(--border);
}
.ev-MINT     .ev-type { color: var(--blue);   border-color: rgba(90,162,255,.4); }
.ev-CLAIM    .ev-type { color: var(--gold);   border-color: var(--gold-line); }
.ev-TRANSFER .ev-type { color: var(--green);  border-color: rgba(55,201,119,.4); }
.ev-MINT::before     { border-color: var(--blue);  box-shadow: 0 0 0 4px rgba(90,162,255,.10); }
.ev-TRANSFER::before { border-color: var(--green); box-shadow: 0 0 0 4px rgba(55,201,119,.10); }
.chain .ev-time { color: var(--faint); font-size: 12.5px; margin-left: 8px; }
.chain .ev-detail { color: var(--muted); font-size: 14.5px; margin-top: 7px; }
.chain .ev-detail a { color: var(--text); border-bottom: 1px solid var(--border-2); }
.chain .ev-detail a:hover { border-color: var(--gold); text-decoration: none; }
.chain .ev-hash {
    color: var(--faint); font-size: 11px; font-family: var(--mono);
    margin-top: 6px; opacity: .85;
}

/* ---- Process list (real sequence: mint → claim → transfer) ------------- */
ol.process, .panel ol {
    counter-reset: step; list-style: none; padding: 0; margin: 6px 0 0;
}
ol.process li, .panel ol li {
    position: relative; padding: 4px 0 14px 42px; color: var(--muted); font-size: 15px;
}
ol.process li::before, .panel ol li::before {
    counter-increment: step; content: counter(step, decimal-leading-zero);
    position: absolute; left: 0; top: 2px;
    font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--gold);
    width: 28px; height: 28px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    background: var(--gold-dim); border: 1px solid var(--gold-line);
}

/* ---- Forms ------------------------------------------------------------- */
label { display: block; margin: 14px 0 5px; color: var(--muted); font-size: 13.5px; font-weight: 600; }
input, textarea, select {
    width: 100%; padding: 11px 13px;
    background: var(--bg-2); color: var(--text);
    border: 1px solid var(--border-2); border-radius: var(--radius-sm); font-size: 15px;
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, textarea:focus, select:focus {
    outline: none; border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-dim);
}
textarea { min-height: 76px; resize: vertical; }

/* Buttons — złoto = akcja główna (ciemny ink), ghost = drugorzędne */
.btn, button.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: linear-gradient(180deg, var(--gold-hi), var(--gold));
    color: var(--gold-ink); font-weight: 750; font-size: 15px;
    padding: 11px 20px; border: none; border-radius: var(--radius-sm);
    cursor: pointer; font-family: inherit; line-height: 1.2;
    transition: filter .15s, transform .05s, box-shadow .15s;
    box-shadow: 0 8px 22px -14px rgba(231,189,87,.9);
}
.btn:hover { filter: brightness(1.06); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-ghost {
    background: transparent; color: var(--text);
    border: 1px solid var(--border-2); box-shadow: none;
}
.btn-ghost:hover { border-color: var(--gold-line); background: var(--panel-2); filter: none; }
.btn-sm, .topbar nav a.btn-sm {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 15px; border-radius: 8px; font-size: 14px; font-weight: 750;
    background: linear-gradient(180deg, var(--gold-hi), var(--gold));
    color: var(--gold-ink); box-shadow: 0 8px 22px -16px rgba(231,189,87,.9);
    transition: filter .15s;
}
.btn-sm:hover, .topbar nav a.btn-sm:hover { text-decoration: none; filter: brightness(1.06); color: var(--gold-ink); }
.form-narrow button.btn { margin-top: 10px; }
.link-btn {
    background: none; border: none; color: var(--muted); cursor: pointer;
    font-size: 14.5px; padding: 6px 8px; font-family: inherit; border-radius: 8px;
}
.link-btn:hover { color: var(--text); background: var(--panel-2); }
.inline { display: inline; }
.form-narrow { max-width: 430px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* ---- Flash ------------------------------------------------------------- */
.flash {
    padding: 13px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: 14.5px;
    border: 1px solid var(--border); display: flex; align-items: center; gap: 10px;
}
.flash::before { font-size: 15px; }
.flash-success { background: rgba(55,201,119,.12); color: var(--green); border-color: rgba(55,201,119,.4); }
.flash-success::before { content: "✓"; }
.flash-error   { background: rgba(229,84,75,.12);  color: var(--red);   border-color: rgba(229,84,75,.4); }
.flash-error::before { content: "✕"; }
.flash-warning { background: var(--gold-dim); color: var(--gold-hi); border-color: var(--gold-line); }
.flash-warning::before { content: "!"; font-weight: 800; }
.flash-info    { background: var(--panel-2); color: var(--text); border-color: var(--border); }

/* ---- Pills / badges ---------------------------------------------------- */
.hint { color: var(--muted); font-size: 13px; margin-top: 8px; }
.hint a { color: var(--gold); }
.pill {
    display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px;
    font-family: var(--mono); letter-spacing: .02em;
    background: var(--panel-2); border: 1px solid var(--border); color: var(--muted);
}
.lvl-pill  { background: rgba(90,162,255,.14);  color: var(--blue);   border-color: rgba(90,162,255,.4); vertical-align: middle; }
.badge-full{ background: rgba(231,189,87,.14);  color: var(--gold-hi);border-color: var(--gold-line); vertical-align: middle; }
.pill-drop { background: rgba(255,157,61,.14);  color: var(--drop);   border-color: rgba(255,157,61,.4); }
.pill-tier { background: rgba(180,148,247,.14); color: var(--violet); border-color: rgba(180,148,247,.45); vertical-align: middle; }

/* ---- Tables ------------------------------------------------------------ */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--border); font-size: 14px; }
.table th {
    color: var(--faint); font-weight: 600; font-family: var(--mono);
    font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em;
}
.table tbody tr:hover, .table tr:hover td { background: rgba(255,255,255,.015); }
.table .write-row td { background: var(--bg-2); }

/* ---- Marketplace + social ---------------------------------------------- */
.card .price {
    font-family: var(--mono); font-weight: 800; font-size: 18px; color: var(--gold);
    margin-top: 8px; letter-spacing: -.01em;
}

/* Karta oferty: etykieta „nowy drop” w prawym górnym rogu, sprzedawca w prawym
   dolnym — cena i sprzedawca zawsze na tej samej wysokości w całym rzędzie. */
.market-card { display: flex; flex-direction: column; padding-right: 20px; }
.market-card .card-flag {
    position: absolute; top: 14px; right: 14px; z-index: 1;
}
.market-card .emblem { margin-top: 4px; }
.market-card .card-foot {
    display: flex; justify-content: space-between; align-items: flex-end;
    gap: 10px; margin-top: auto; padding-top: 10px;
}
.market-card .card-foot .price { margin-top: 0; white-space: nowrap; }
.market-card .seller { color: var(--faint); font-size: 12px; text-align: right; min-width: 0; }
.market-card .seller .who { display: inline-block; margin-top: 3px; }

/* Pasek filtrów (GET) + chipy typu oferty i paginacja */
.filters {
    display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end;
    padding: 16px 18px; margin-bottom: 14px;
}
.filters .field { display: flex; flex-direction: column; gap: 0; min-width: 170px; }
.filters .field.grow { flex: 1 1 260px; }
.filters label {
    margin: 0 0 5px; font-family: var(--mono); font-size: 11px;
    text-transform: uppercase; letter-spacing: .07em; color: var(--faint);
}
.filters input, .filters select { padding: 9px 12px; font-size: 14px; }
.filters .btn { padding: 9px 18px; font-size: 14px; }

.market-bar {
    display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
    justify-content: space-between; margin-bottom: 16px;
}
.market-count { color: var(--faint); font-family: var(--mono); font-size: 12.5px; }
.chips, .pager { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pager { margin-top: 22px; justify-content: center; }
.chip {
    display: inline-block; padding: 6px 13px; border-radius: 999px;
    font-size: 13px; font-weight: 650; color: var(--muted);
    background: var(--panel-2); border: 1px solid var(--border);
    transition: border-color .15s, color .15s;
}
a.chip:hover { text-decoration: none; color: var(--text); border-color: var(--gold-line); }
.chip-on, a.chip-on {
    background: var(--gold-dim); border-color: var(--gold-line); color: var(--gold-hi);
}
.sell-form { display: inline-flex; gap: 8px; align-items: center; }
.price-input { width: 120px; }
.radio-row { display: flex; gap: 9px; align-items: center; margin: 8px 0; color: var(--text); font-size: 15px; }
.radio-row input { width: auto; }
.scan-form input[type="url"] { max-width: 430px; display: block; }

/* ---- Utilities --------------------------------------------------------- */
.center { text-align: center; }
.muted { color: var(--muted); }

/* ---- Responsive -------------------------------------------------------- */
@media (max-width: 620px) {
    .topbar-inner { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px 16px; }
    .topbar nav { justify-content: flex-start; }
    main { padding: 28px 16px 64px; }
    .cert-head { gap: 16px; }
    .cert-emblem { width: 72px; height: 72px; font-size: 36px; }
    .trust { gap: 20px; }
    .meta td:first-child { width: 130px; }
}

/* ---- Motion ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; scroll-behavior: auto !important; }
    .card:hover { transform: none; }
}
