/* ============================================================
   OURO — a gallery in the dark.
   Slate night ground, one amber accent (the price-tag gold), system
   type with mono for everything on-chain. Deliberately NOT the game's
   purple pixel look: this site sells art from every collection, so the
   chrome stays quiet and the artwork carries the color.
   ============================================================ */

:root {
  --bg: #0b0d12;
  --panel: #12151d;
  --card: #171b26;
  --border: #232a3a;
  --text: #e7ebf4;
  --dim: #8b94ab;
  --accent: #f5a524;
  --accent-ink: #1a1204;
  --good: #2dd4a7;
  --bad: #f4586e;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
.hidden { display: none !important; }
html { color-scheme: dark; }
body {
  background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100dvh; display: flex; flex-direction: column;
}
a { color: inherit; text-decoration: none; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- chrome ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 20px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: baseline; gap: 8px; font-weight: 800; letter-spacing: 3px; }
.brand img { align-self: center; }
.brand-sub { font-size: 12px; color: var(--dim); letter-spacing: 1px; font-weight: 500; }
.top-actions { display: flex; align-items: center; gap: 10px; }

main { flex: 1; width: min(1180px, 100%); margin: 0 auto; padding: 22px 20px 60px; }
.foot {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 20px; border-top: 1px solid var(--border); color: var(--dim); font-size: 13px;
}

/* ---------- controls ---------- */
.btn {
  font: 600 14px/1 inherit; color: var(--text); cursor: pointer;
  background: var(--card); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 16px; transition: border-color .12s, transform .06s, background .12s;
}
.btn:hover { border-color: var(--accent); }
/* Links that are buttons: an inline <a> ignores vertical padding, so it
   has to become a box before it looks like the buttons beside it. */
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { border-color: color-mix(in srgb, var(--bad) 50%, var(--border)); color: var(--bad); }
.btn.big { padding: 13px 22px; font-size: 15px; border-radius: 10px; }
.btn:disabled { opacity: .5; cursor: default; }
.chip {
  font-size: 12px; padding: 5px 10px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--border);
}
.dim-chip { color: var(--dim); }
input, select {
  font: inherit; color: var(--text); background: var(--panel);
  border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; width: 100%;
}
input:focus { outline: none; border-color: var(--accent); }
label { display: block; font-size: 13px; color: var(--dim); margin: 12px 0 5px; }

/* ---------- home ---------- */
.hero { padding: 26px 0 18px; }
.hero h1 { font-size: clamp(26px, 4.5vw, 40px); line-height: 1.15; letter-spacing: -.5px; max-width: 620px; text-wrap: balance; }
.hero h1 em { color: var(--accent); font-style: normal; }
.hero p { color: var(--dim); margin-top: 10px; max-width: 560px; }
.hero-stats { display: flex; gap: 26px; margin-top: 18px; flex-wrap: wrap; }
.hstat b { display: block; font-size: 20px; font-family: var(--mono); }
.hstat span { font-size: 12px; color: var(--dim); text-transform: uppercase; letter-spacing: 1px; }

.section-head { font-size: 13px; letter-spacing: 2px; text-transform: uppercase; color: var(--dim); margin: 26px 0 12px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.col-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; transition: border-color .12s, transform .12s; display: block;
}
.col-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.col-art { aspect-ratio: 16/9; background: var(--panel); display: grid; place-items: center; overflow: hidden; }
.col-art img { width: 100%; height: 100%; object-fit: cover; }
.col-art .ph { font-size: 34px; opacity: .35; }
.col-body { padding: 12px 14px 14px; }
.col-name { font-weight: 700; }
.col-desc { font-size: 13px; color: var(--dim); margin-top: 2px; min-height: 2.6em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.col-meta { display: flex; gap: 16px; margin-top: 10px; font-size: 13px; }
.col-meta b { font-family: var(--mono); display: block; }
.col-meta span { color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }

/* ---------- collection page ---------- */
.c-head { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; padding: 8px 0 4px; }
.c-title h2 { font-size: 26px; }
.c-title .mono { color: var(--dim); font-size: 12px; word-break: break-all; }
.c-title p { color: var(--dim); margin-top: 6px; max-width: 640px; }
.c-stats { display: flex; gap: 22px; margin-left: auto; }
.tabs { display: flex; gap: 6px; margin: 18px 0 14px; border-bottom: 1px solid var(--border); }
.tab {
  background: none; border: none; color: var(--dim); font: 600 14px/1 inherit;
  padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent;
}
.tab.on { color: var(--text); border-bottom-color: var(--accent); }

.tok-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; display: block; transition: border-color .12s, transform .12s; }
.tok-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.tok-art { aspect-ratio: 1; background: var(--panel); display: grid; place-items: center; overflow: hidden; }
.tok-art img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.tok-art .ph { font-size: 30px; opacity: .3; }
.tok-body { padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tok-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.price { font-family: var(--mono); font-weight: 700; color: var(--accent); white-space: nowrap; font-size: 14px; }
.price small { color: var(--dim); font-weight: 500; }

/* ---------- token page ---------- */
.t-wrap { display: grid; grid-template-columns: minmax(280px, 440px) 1fr; gap: 26px; align-items: start; }
@media (max-width: 760px) { .t-wrap { grid-template-columns: 1fr; } }
.t-art { background: var(--card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.t-art img { width: 100%; display: block; image-rendering: pixelated; }
.t-art .ph { aspect-ratio: 1; display: grid; place-items: center; font-size: 54px; opacity: .3; }
.t-info h2 { font-size: 26px; }
.crumb { font-size: 13px; color: var(--dim); margin-bottom: 6px; display: block; }
.crumb:hover { color: var(--accent); }
.kv { display: flex; gap: 8px; font-size: 14px; margin-top: 6px; color: var(--dim); flex-wrap: wrap; }
.kv .mono { color: var(--text); word-break: break-all; }
.deal {
  margin-top: 18px; background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 18px;
}
.deal .big-price { font-size: 30px; font-family: var(--mono); font-weight: 800; color: var(--accent); }
.deal .fee-note { font-size: 12.5px; color: var(--dim); margin-top: 4px; }
.deal .row { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.attrs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 18px; }
.attr { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
.attr span { display: block; font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: 1px; }
.attr b { font-size: 14px; }

/* ---------- collection filters ---------- */
.c-layout { display: grid; grid-template-columns: 232px 1fr; gap: 22px; align-items: start; margin-top: 18px; }
.c-side {
  position: sticky; top: 74px; background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px; max-height: calc(100dvh - 100px); overflow-y: auto;
}
.side-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.side-head b { font-size: 13px; letter-spacing: 2px; text-transform: uppercase; color: var(--dim); }
.side-head .linkish { margin-left: auto; font-size: 12px; }
.side-x { display: none; background: none; border: none; color: var(--dim); cursor: pointer; font-size: 16px; }
.facet { border-top: 1px solid var(--border); padding: 12px 0 4px; }
.facet:first-of-type { border-top: none; }
.facet.dim { color: var(--dim); font-size: 12px; }
.facet-h { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--dim); margin-bottom: 6px; }
.facet-vals.scrolly { max-height: 208px; overflow-y: auto; }
.fopt {
  display: flex; align-items: center; gap: 8px; margin: 0; padding: 5px 4px;
  border-radius: 6px; cursor: pointer; font-size: 13.5px; color: var(--text);
}
.fopt:hover { background: var(--panel); }
.fopt.dim span { color: var(--dim); }
.fopt input { width: auto; margin: 0; accent-color: var(--accent); flex: none; }
.fopt span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: capitalize; }
.fopt em { font-style: normal; font-size: 11.5px; color: var(--dim); font-variant-numeric: tabular-nums; }
.c-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.c-toolbar input[type="search"] { width: auto; flex: 1; min-width: 140px; }
.c-toolbar select { width: auto; }
.c-count { color: var(--dim); font-size: 13px; font-variant-numeric: tabular-nums; margin-left: auto; }
.filt-toggle { display: none; }
.load-more { margin-top: 14px; }
@media (max-width: 860px) {
  .c-layout { grid-template-columns: 1fr; }
  .filt-toggle { display: inline-flex; }
  .side-x { display: block; margin-left: auto; }
  .side-head .linkish { margin-left: 0; }
  /* Off-canvas on small screens: the filters are a drawer, not a column. */
  .c-side {
    position: fixed; inset: 0 auto 0 0; z-index: 60; width: min(300px, 86vw);
    border-radius: 0; max-height: none; transform: translateX(-102%);
    transition: transform .18s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .5);
  }
  .c-side.open { transform: none; }
  /* A backdrop, so the page behind is visibly out of play and tapping it
     closes the drawer — the gesture everyone tries first. */
  .c-layout::before {
    content: ''; position: fixed; inset: 0; z-index: 55;
    background: rgba(4, 6, 10, .66); opacity: 0; pointer-events: none;
    transition: opacity .18s ease;
  }
  .c-layout.filters-open::before { opacity: 1; pointer-events: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .c-side, .c-layout::before { transition: none; }
}

/* ---------- listing page ---------- */
.list-wrap { display: grid; grid-template-columns: 1fr minmax(300px, 380px); gap: 26px; align-items: start; margin-top: 10px; }
@media (max-width: 860px) { .list-wrap { grid-template-columns: 1fr; } }
.list-item { display: grid; grid-template-columns: minmax(120px, 200px) 1fr; gap: 20px; align-items: start; }
/* Hold the square even while the art is loading, or if it never arrives —
   otherwise the panel jumps once the image lands. */
.list-item .t-art { aspect-ratio: 1; display: grid; place-items: center; }
.list-item .t-art img { width: 100%; height: 100%; object-fit: contain; }
@media (max-width: 520px) { .list-item { grid-template-columns: 1fr; } }
.list-item h2 { font-size: 22px; }
.list-panel { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 18px; }
.list-panel h3 { font-size: 17px; }
.list-panel .btn { width: 100%; justify-content: center; }
.list-panel .fee-note { font-size: 12.5px; color: var(--dim); margin-top: 10px; }
.price-field { display: flex; align-items: center; gap: 8px; }
.price-field input { font-size: 20px; font-family: var(--mono); font-weight: 700; }
.price-field span { color: var(--dim); font-weight: 600; font-size: 14px; }
.breakdown { margin: 16px 0; border-top: 1px solid var(--border); }
.brow { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; font-size: 13.5px; color: var(--dim); border-bottom: 1px solid var(--border); }
.brow b { color: var(--text); font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 600; }
.brow.minus b { color: var(--bad); }
.brow.total { border-bottom: none; padding-top: 12px; font-size: 15px; color: var(--text); font-weight: 600; }
.brow.total b { color: var(--accent); font-size: 17px; font-weight: 800; }

/* ---------- trade history ---------- */
.hist { margin-top: 22px; border-top: 1px solid var(--border); padding-top: 14px; }
.hist-h { font-size: 13px; letter-spacing: 2px; text-transform: uppercase; color: var(--dim); margin-bottom: 8px; }
.hist .fee-note { font-size: 13px; color: var(--dim); }
.hist-row {
  display: grid; grid-template-columns: 84px 1fr auto auto; gap: 12px; align-items: center;
  padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13.5px;
}
.hist-row:last-child { border-bottom: none; }
.hist-tag {
  font-size: 11px; text-transform: uppercase; letter-spacing: 1px; font-weight: 700;
  padding: 3px 8px; border-radius: 999px; text-align: center;
  background: var(--panel); border: 1px solid var(--border); color: var(--dim);
}
.hist-row.sold .hist-tag { color: var(--good); border-color: color-mix(in srgb, var(--good) 45%, var(--border)); }
.hist-row.listed .hist-tag { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.hist-what { color: var(--dim); overflow: hidden; }
.hist-what em { font-style: normal; display: block; font-size: 12px; opacity: .8; }
.hist-amt { font-family: var(--mono); font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hist-when { color: var(--dim); font-size: 12px; white-space: nowrap; }
.hist-tx { color: var(--dim); margin-left: 6px; text-decoration: none; }
.hist-tx:hover { color: var(--accent); }
@media (max-width: 620px) {
  .hist-row { grid-template-columns: 76px 1fr auto; }
  .hist-when { grid-column: 2 / -1; }
}

/* ---------- modal / toasts ---------- */
.modal-back {
  position: fixed; inset: 0; z-index: 50; background: rgba(4, 6, 10, .78);
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
.modal {
  width: min(420px, 100%); background: var(--panel); border: 1px solid var(--border);
  border-radius: 16px; padding: 22px; max-height: 86dvh; overflow-y: auto;
}
.modal h3 { margin-bottom: 6px; }
.modal .sub { color: var(--dim); font-size: 14px; margin-bottom: 14px; }
.modal .stack { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.modal .alt { text-align: center; color: var(--dim); font-size: 13px; margin: 10px 0 2px; }
.modal .linkish { background: none; border: none; color: var(--accent); cursor: pointer; font: inherit; padding: 0; }
.wallet-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 12px; }

/* One control height down the stack. Left to themselves these buttons size
   to their content — an emoji makes a taller line box than plain text, and
   an icon taller still — so stacked siblings end up a pixel or two apart. */
.modal .stack .btn.big { min-height: 46px; }

/* Google sign-in. Google's own iframe is the only thing allowed to open the
   popup, and it cannot be styled — so it is stretched invisibly across a
   button of ours. Players see OURO's button; the click lands on Google's. */
.g-wrap { position: relative; cursor: pointer; }
.g-face {
  width: 100%; pointer-events: none;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.g-face .g-mark { width: 17px; height: 17px; flex: none; }
.g-wrap:hover .g-face, .g-wrap:focus-within .g-face { border-color: var(--accent); }
.g-wrap:active .g-face { transform: translateY(1px); }
.g-overlay {
  position: absolute; inset: 0; z-index: 2; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  opacity: .001;
}
/* Google's button is a fixed 44px tall and our face is taller, which would
   leave the top and bottom edges dead. A hair of scale spreads the hit area
   over the whole face — it is invisible, so nothing distorts on screen, and
   the overflow clip keeps it inside the button. */
.g-overlay > * { transform: scale(1.1); }
/* Google never arrived: the wrap takes the click itself and explains why. */
.g-wrap.g-dead .g-face { opacity: .75; }

#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; width: min(440px, 92vw); }
.toast {
  background: var(--card); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: 10px; padding: 12px 14px; font-size: 14.5px; animation: tin .2s;
}
.toast.good { border-left-color: var(--good); }
.toast.bad { border-left-color: var(--bad); }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }

.loading { color: var(--dim); text-align: center; padding: 60px 0; }
.empty { color: var(--dim); text-align: center; padding: 46px 0; }
.load-more { display: block; margin: 18px auto 0; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--dim); border-top-color: var(--accent); border-radius: 50%; animation: sp 1s linear infinite; vertical-align: -2px; }
@keyframes sp { to { transform: rotate(360deg); } }

/* ---------- create: launch, add, mint ---------- */
.form-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 20px; max-width: 620px;
}
.form-card h3 { font-size: 18px; }
.form-card .sub { color: var(--dim); font-size: 14px; margin-top: 6px; }
.form-card .sub b { color: var(--accent); }
.form-card > .btn.primary { width: 100%; margin-top: 18px; }
.form-card .fee-note { font-size: 12.5px; color: var(--dim); margin-top: 10px; }
.form-card .dim { color: var(--dim); font-weight: 400; }
textarea {
  font: inherit; color: var(--text); background: var(--panel); resize: vertical;
  border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; width: 100%;
}
textarea:focus { outline: none; border-color: var(--accent); }
.warn {
  background: color-mix(in srgb, var(--accent) 12%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border));
  border-radius: 8px; padding: 10px 12px; font-size: 13.5px; margin: 12px 0;
}
.warn a { color: var(--accent); }
/* The one-shot shopfront bar for your unlisted items on a collection page. */
.bulk-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: color-mix(in srgb, var(--accent) 8%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
  border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: 14px;
}
.bulk-bar .price-field { flex: 0 1 auto; }
.bulk-bar .price-field input { width: 130px; font-size: 16px; }
.bulk-bar .btn { white-space: nowrap; }
/* Artwork: the preview is the point, so it leads. */
.art-pick { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: start; }
.art-prev {
  aspect-ratio: 1; background: var(--panel); border: 1px dashed var(--border);
  border-radius: 10px; display: grid; place-items: center; overflow: hidden;
}
.art-prev span { font-size: 11px; color: var(--dim); }
.art-prev img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.art-ctl .alt { text-align: left; margin: 8px 0 4px; font-size: 12px; color: var(--dim); }
.art-ctl .btn { width: 100%; }
.trait-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-bottom: 8px; }
.trait-row .t-x { padding: 8px 12px; color: var(--dim); }
#mt-addtrait { margin-top: 2px; }

/* ---------- the header on a phone ---------- */
/* Signed in, the header holds brand + Create + My items + an address chip:
   more than a phone's width. Squeezing it caused the WHOLE PAGE to scroll
   sideways, so on small screens the nav folds into a popout instead. */
.top-nav { display: flex; gap: 10px; }
.nav-toggle { display: none; }
@media (max-width: 640px) {
  .brand-sub { display: none; }
  .nav-toggle { display: inline-flex; }
  .top-nav {
    display: none;
    position: absolute; top: calc(100% + 6px); right: 12px; z-index: 40;
    flex-direction: column; gap: 6px; min-width: 160px;
    background: var(--card); border: 1px solid var(--border); border-radius: 12px;
    padding: 8px; box-shadow: 0 12px 34px rgba(0, 0, 0, .5);
  }
  .top-nav.open { display: flex; }
  .top-nav .btn { width: 100%; }
}
/* And whatever else ever overflows, the page itself never pans sideways. */
body { overflow-x: hidden; }

/* Image failures retain a readable, clickable card rather than a broken icon. */
#view img[hidden] { display: none; }
#view .ph.art-unavailable { font-size: 14px; line-height: 1.4; opacity: .75; text-align: center; padding: 16px; }
