:root {
  color-scheme: dark;
  --bg: #0a0c10;
  --surface: #12151b;
  --surface-2: #181c24;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .16);
  --ink: #e9ecf1;
  --muted: #8b94a3;
  --accent: #4ade80;
  --accent-2: #22d3ee;
  --accent-ink: #04130a;
  --warn: #f87171;
  --soon: #fbbf24;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(74, 222, 128, .08), transparent 60%),
    radial-gradient(800px 500px at 100% 0%, rgba(34, 211, 238, .07), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
main { flex: 1; width: 100%; max-width: 1160px; margin: 0 auto; padding: 32px 24px 64px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { letter-spacing: -.02em; }
h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
::selection { background: rgba(74, 222, 128, .3); }

/* ---------- header / footer ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  background: rgba(10, 12, 16, .72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; font-size: 1.2rem; letter-spacing: -.02em; color: var(--ink); }
.brand:hover { text-decoration: none; }
.site-header nav { display: flex; gap: 20px; align-items: center; }
.site-header nav a:not(.btn) { color: var(--muted); font-weight: 500; transition: color .15s; }
.site-header nav a:not(.btn):hover { color: var(--ink); text-decoration: none; }
.site-footer { text-align: center; padding: 24px; color: var(--muted); font-size: .8rem; border-top: 1px solid var(--line); }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; border: 0; border-radius: 10px; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), #86efac);
  color: var(--accent-ink); font: inherit; font-weight: 700;
  padding: 11px 20px;
  box-shadow: 0 0 0 1px rgba(74, 222, 128, .4), 0 6px 20px rgba(74, 222, 128, .18);
  transition: transform .12s, box-shadow .15s, filter .15s;
}
.btn:hover { text-decoration: none; filter: brightness(1.05); box-shadow: 0 0 0 1px rgba(74, 222, 128, .6), 0 8px 28px rgba(74, 222, 128, .3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; filter: grayscale(.6); }
.btn-small { padding: 7px 14px; font-size: .88rem; }

/* ---------- filters ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; align-items: center; }
.chip {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 7px 14px; cursor: pointer; font: inherit; font-size: .88rem; color: var(--muted);
  transition: color .15s, border-color .15s, background .15s;
}
.chip:hover { color: var(--ink); border-color: var(--line-strong); }
.chip.active { background: var(--ink); color: var(--bg); border-color: var(--ink); font-weight: 600; }
.filters select { margin-left: auto; }

/* ---------- cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.card {
  position: relative;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; color: inherit; display: flex; flex-direction: column;
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.card:hover { text-decoration: none; transform: translateY(-4px); border-color: rgba(74, 222, 128, .35); box-shadow: var(--shadow), 0 0 0 1px rgba(74, 222, 128, .15); }
.thumb {
  aspect-ratio: 4 / 3; display: grid; place-items: center; font-size: 4.5rem; overflow: hidden;
  background:
    radial-gradient(circle at 50% 60%, rgba(255, 255, 255, .07), transparent 65%),
    linear-gradient(160deg, var(--surface-2), #0e1116);
  border-bottom: 1px solid var(--line);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .thumb { transition: font-size .2s; }
.card:hover .thumb { font-size: 5rem; }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-title { font-weight: 650; font-size: 1.02rem; }
.meta { color: var(--muted); font-size: .84rem; }
.card-foot { display: flex; justify-content: space-between; align-items: end; margin-top: auto; padding-top: 12px; }
.price { font-weight: 750; font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.label { color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.timer {
  font-variant-numeric: tabular-nums; font-size: .8rem; font-weight: 600;
  padding: 4px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
}
.timer.soon { color: var(--soon); border-color: rgba(251, 191, 36, .35); background: rgba(251, 191, 36, .08); }
.timer.closed { color: var(--warn); border-color: rgba(248, 113, 113, .35); background: rgba(248, 113, 113, .08); }

/* ---------- lot page ---------- */
.lot { display: grid; grid-template-columns: 1.25fr 1fr; gap: 32px; align-items: start; }
@media (max-width: 760px) { .lot { grid-template-columns: 1fr; } }
.lot .thumb { border-radius: var(--radius); border: 1px solid var(--line); font-size: 9rem; }
.lot h1 { margin: 0 0 6px; }
.facts {
  display: grid; grid-template-columns: auto 1fr; gap: 10px 20px; margin: 20px 0;
  padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
}
.facts dt { color: var(--muted); font-size: .9rem; }
.facts dd { margin: 0; font-weight: 500; }
.panel {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
}
.panel + .panel { margin-top: 16px; }
#bid-panel { position: sticky; top: 84px; box-shadow: var(--shadow); }
.big-price {
  font-size: 2.4rem; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.big-timer { font-size: 1rem; }
.big-timer .timer { font-size: .95rem; padding: 5px 12px; }

/* ---------- forms ---------- */
form .row { display: flex; gap: 12px; flex-wrap: wrap; }
form .row > * { flex: 1; min-width: 140px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: .85rem; color: var(--muted); font-weight: 500; margin-bottom: 14px; }
input, select, textarea {
  font: inherit; color: var(--ink); padding: 10px 12px;
  background: #0d1015; border: 1px solid var(--line-strong); border-radius: 10px;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: #5b6472; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(74, 222, 128, .2); }
input:disabled { opacity: .5; }
textarea { min-height: 110px; resize: vertical; }
input[type="file"] { padding: 8px; cursor: pointer; color: var(--muted); }
input[type="file"]::file-selector-button {
  font: inherit; font-weight: 600; margin-right: 12px; padding: 7px 14px; cursor: pointer;
  color: var(--ink); background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 8px;
}
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label { margin: 0; }
.field input { width: 100%; }
.loc { position: relative; }
.loc-list {
  position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; right: 0; min-width: 200px;
  margin: 0; padding: 4px; list-style: none;
  background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow);
}
.loc-list li { padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: .9rem; }
.loc-list li:hover, .loc-list li.active { background: rgba(74, 222, 128, .14); color: var(--accent); }
.link-btn {
  align-self: flex-start; background: none; border: 0; padding: 2px 0; cursor: pointer;
  font: inherit; font-size: .8rem; font-weight: 600; color: var(--accent);
}
.link-btn:hover { text-decoration: underline; }
.link-btn:disabled { color: var(--muted); cursor: default; text-decoration: none; }
.ai-status { font-size: .8rem; font-weight: 500; }
.ai-status.working { color: var(--accent-2); animation: pulse 1.4s ease-in-out infinite; }
.ai-status.done { color: var(--accent); }
.ai-status.error { color: var(--warn); }
@keyframes pulse { 50% { opacity: .5; } }
.photo-preview { margin-top: 8px; max-width: 100%; max-height: 260px; object-fit: contain; border-radius: 10px; border: 1px solid var(--line); align-self: flex-start; }
.msg { margin-top: 12px; font-size: .9rem; }
.msg:empty { display: none; }
.msg.error { color: var(--warn); }
.msg.ok { color: var(--accent); }

/* ---------- bid history ---------- */
.bids { list-style: none; margin: 0; padding: 0; }
.bids li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .9rem; font-variant-numeric: tabular-nums; }
.bids li:last-child { border-bottom: 0; }
.bids li:first-child { font-weight: 650; color: var(--accent); }
.bids li:first-child .meta { color: var(--muted); font-weight: 400; }

.empty { color: var(--muted); text-align: center; padding: 48px 0; }
.sell-form { max-width: 680px; }

/* ---------- phones ---------- */
@media (max-width: 600px) {
  html, body { overflow-x: clip; } /* never let the page slide sideways on phones */
  main { padding: 20px 22px 48px; }
  .site-header { padding: 12px 22px; }
  .brand, .site-header nav a { white-space: nowrap; }
  .brand { font-size: 1.05rem; }
  .site-header nav { gap: 12px; }
  .site-header nav a:not(.btn) { display: none; }

  /* species chips: one row that scrolls sideways */
  .filters { flex-wrap: nowrap; overflow-x: auto; margin: 0 -22px 20px; padding: 0 22px 4px; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .chip { flex-shrink: 0; }
  .filters select { margin-left: 4px; flex-shrink: 0; }

  /* two compact columns */
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .card { border-radius: 12px; }
  .card:hover { transform: none; }
  .card .thumb, .card:hover .thumb { aspect-ratio: 1 / 1; font-size: 3rem; }
  .card-body { padding: 10px 11px 12px; gap: 2px; }
  .card-title { font-size: .9rem; line-height: 1.25; }
  .card .meta { font-size: .74rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .card-foot { flex-direction: column; align-items: flex-start; gap: 6px; padding-top: 8px; }
  .price { font-size: 1.05rem; }
  .label { font-size: .62rem; }
  .timer { font-size: .72rem; padding: 3px 8px; }

  .lot .thumb { font-size: 6rem; }
  #bid-panel { position: static; }
}
