:root {
  --bg: #000000;
  --bg-elevated: #121218;
  --bg-card: #16161f;
  --text: #f4f1ea;
  --muted: #9a958c;
  --gold: #d4af37;
  --gold-soft: #f0d78c;
  --blue: #1a4f9c;
  --blue-deep: #0d2f66;
  --red: #9b1c1c;
  --line: rgba(212, 175, 55, 0.22);
  --ok: #3d9b6e;
  --danger: #c44747;
  --radius: 16px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Manrope", system-ui, sans-serif;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(26, 79, 156, 0.35), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 20%, rgba(155, 28, 28, 0.18), transparent 50%),
    radial-gradient(ellipse 50% 35% at 0% 80%, rgba(212, 175, 55, 0.1), transparent 45%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

a {
  color: var(--gold-soft);
}

.app-shell {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 1rem 1rem 5rem;
}

.logo-wrap {
  display: grid;
  place-items: center;
  padding: 0.5rem 0 0.25rem;
  animation: fadeDown 0.7s ease both;
}

.logo-wrap img {
  width: min(220px, 58vw);
  height: auto;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.55));
}

.eyebrow {
  margin: 0;
  text-align: center;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.7rem;
  color: var(--gold);
  font-weight: 700;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
}

h1 {
  text-align: center;
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  margin-top: 0.4rem;
}

.lead {
  text-align: center;
  color: var(--muted);
  margin: 0.65rem auto 0;
  max-width: 28rem;
  line-height: 1.5;
}

.status-bar {
  margin: 1.1rem 0 1.4rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(18, 18, 24, 0.85);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  animation: fadeUp 0.6s ease both;
}

.status-bar .label {
  font-size: 0.82rem;
  color: var(--muted);
}

.status-bar .value {
  font-weight: 700;
  color: var(--gold-soft);
  font-variant-numeric: tabular-nums;
}

.status-bar.open .value {
  color: #7ddea8;
}

.status-bar.closing .value {
  color: #ffb347;
  animation: pulse 1.2s ease-in-out infinite;
}

.status-bar.closed .value {
  color: #ff8e8e;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--gold-soft);
}

.grid {
  display: grid;
  gap: 1rem;
}

.item-card {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 0.9rem;
  padding: 0.75rem;
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(22, 22, 31, 0.95), rgba(12, 12, 16, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
  animation: fadeUp 0.55s ease both;
  text-align: left;
  width: 100%;
}

.item-card:hover,
.item-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(212, 175, 55, 0.45);
  outline: none;
}

.item-card .thumb {
  width: 112px;
  height: 112px;
  border-radius: 12px;
  object-fit: cover;
  background: #222;
}

.item-card .meta h3 {
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
}

.item-card .meta p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.price-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.7rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.pill.gold {
  background: rgba(212, 175, 55, 0.18);
  color: var(--gold-soft);
}

.pill.blue {
  background: rgba(26, 79, 156, 0.35);
  color: #b8d0ff;
}

.screen {
  display: none;
  animation: fadeUp 0.45s ease both;
}

.screen.active {
  display: block;
}

.panel {
  margin-top: 1rem;
  padding: 1.15rem;
  border-radius: calc(var(--radius) + 4px);
  background: rgba(16, 16, 22, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: var(--shadow);
}

.panel h2 {
  font-size: 1.35rem;
  margin-bottom: 0.35rem;
}

.field {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.9rem;
}

.field label {
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 700;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: rgba(212, 175, 55, 0.55);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
}

.field textarea {
  min-height: 88px;
  resize: vertical;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.1rem;
}

.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 0.85rem 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold), #b8891f);
  color: #1a1405;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-danger {
  background: rgba(196, 71, 71, 0.2);
  color: #ffb4b4;
  border: 1px solid rgba(196, 71, 71, 0.35);
}

.btn-blue {
  background: linear-gradient(135deg, var(--blue), var(--blue-deep));
  color: white;
}

.hero-detail {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.hero-detail img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.bids {
  display: grid;
  gap: 0.65rem;
  margin-top: 1rem;
}

.bid {
  padding: 0.8rem 0.9rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.bid.top {
  border-color: rgba(212, 175, 55, 0.45);
  background: rgba(212, 175, 55, 0.08);
}

.bid .who {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-weight: 700;
}

.bid .amount {
  color: var(--gold-soft);
  font-variant-numeric: tabular-nums;
}

.bid .comment {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.bid .when {
  margin-top: 0.3rem;
  font-size: 0.72rem;
  color: #6f6a63;
}

.banner {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: -1rem -1rem 1rem;
  padding: 0.85rem 1rem;
  text-align: center;
  font-weight: 700;
  background: linear-gradient(90deg, #7a3b00, #b86a00);
  color: #fff8e8;
  animation: slideDown 0.4s ease both;
}

.banner.closed {
  background: linear-gradient(90deg, var(--blue-deep), var(--red));
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%) translateY(120%);
  z-index: 50;
  max-width: min(92vw, 420px);
  padding: 0.85rem 1.1rem;
  border-radius: 999px;
  background: rgba(20, 20, 28, 0.96);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform 0.3s ease;
  text-align: center;
  font-size: 0.9rem;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast.error {
  border-color: rgba(196, 71, 71, 0.5);
  color: #ffc9c9;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 1.5rem 0.5rem;
}

.admin-nav {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  margin: 1rem 0;
}

.admin-nav button {
  white-space: nowrap;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.admin-nav button.active {
  background: rgba(212, 175, 55, 0.18);
  border-color: rgba(212, 175, 55, 0.45);
  color: var(--gold-soft);
}

.admin-item {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  margin-bottom: 0.85rem;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-item img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 12px;
}

.thanks-screen {
  text-align: center;
  padding: 2rem 0.5rem;
}

.thanks-screen h1 {
  color: var(--gold-soft);
  margin: 1rem 0 0.75rem;
}

.footer-note {
  margin-top: 2rem;
  text-align: center;
  color: #5d5852;
  font-size: 0.75rem;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeDown {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

@media (max-width: 420px) {
  .item-card {
    grid-template-columns: 92px 1fr;
  }

  .item-card .thumb {
    width: 92px;
    height: 92px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
