:root {
  color-scheme: dark;
  --felt: #0c2f24;
  --felt-deep: #082018;
  --cream: #f7f1e6;
  --cream-2: #fffdf8;
  --ink: #1c1915;
  --muted: #5e584f;
  --line: #eadfce;
  --red: #c53636;
  --red-dark: #a82c2c;
  --gold: #e0a84a;
  --gold-dark: #c9923a;
  --gold-soft: #f0c27a;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--cream);
  font-family: Outfit, "Avenir Next", "Segoe UI", sans-serif;
  font-size: 1.05rem;
  line-height: 1.45;
  background-color: var(--felt);
  background-image:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.06), transparent 26%),
    radial-gradient(circle at 90% 8%, rgba(224, 168, 74, 0.12), transparent 22%),
    linear-gradient(#176348, var(--felt) 280px);
}

h1, h2, .brand, .section-title {
  font-family: Fraunces, Georgia, "Iowan Old Style", serif;
  font-weight: 560;
  letter-spacing: -0.02em;
}

h1, h2, h3, p { overflow-wrap: break-word; }

a { color: inherit; }

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

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 5;
  background: white;
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 10px;
}

.skip:focus { top: 12px; }

.wrap {
  width: min(880px, calc(100% - 32px));
  margin: 0 auto;
}

.top {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(12, 47, 36, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(240, 194, 122, 0.18);
}

.bar { padding: 14px 0 12px; }

.suits {
  margin: 0 0 2px;
  letter-spacing: 0.42em;
  font-size: 0.78rem;
  color: var(--gold-soft);
}

.suits .red { color: #e07a7a; }

.brand {
  display: inline-block;
  color: inherit;
  text-decoration: none;
  font-size: clamp(1.7rem, 4vw, 2.1rem);
  line-height: 1.1;
}

.tag {
  margin: 4px 0 0;
  color: var(--gold-soft);
  font-size: 0.98rem;
}

#app { padding: 22px 0 12px; }

.foot {
  padding: 28px 0 calc(36px + env(safe-area-inset-bottom));
  color: rgba(246, 241, 231, 0.78);
  font-size: 0.92rem;
}

.loading { color: var(--cream); }

.hero h1 { margin: 0 0 8px; font-size: clamp(2rem, 6vw, 2.8rem); }

.hero p { margin: 0 0 16px; max-width: 38rem; }

.count { color: var(--gold-soft); font-weight: 600; }

.grid {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.panel, .card, dialog.sheet {
  color-scheme: light;
  background: var(--cream);
  color: var(--ink);
  border-radius: 20px;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.22);
}

.panel, .card { padding: 16px; }

.detail {
  width: min(640px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.back {
  color: var(--gold-soft);
  font-weight: 700;
  text-decoration: none;
  width: fit-content;
}

.back:hover { text-decoration: underline; }

a.listing-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
  min-height: 104px;
}

a.listing-card h2 {
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1.2;
}

.tile-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

a.listing-card:hover {
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.22), 0 0 0 2px var(--gold);
}

a.listing-card > div,
.title-row h1,
.title-row h3 { min-width: 0; }

.card h2, .panel h2, .empty h2 { margin: 0; font-size: 1.35rem; }

.meta, .hint, .who {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.meta { margin: 4px 0; }

.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  color: #3c362e;
}

.prose { white-space: pre-wrap; margin: 10px 0 0; }

.chip {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  background: repeating-conic-gradient(#f4f1ea 0 14deg, #c53636 0 28deg);
  box-shadow: inset 0 0 0 3px #f7f1e6;
}

.chip-face {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--cream-2);
  font-size: 1.45rem;
  box-shadow: inset 0 0 0 2px rgba(197, 54, 54, 0.35);
}

.thumb, .hero-photo {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 16px;
  background: #efe7d8;
  flex: none;
}

.hero-visual { position: relative; margin-bottom: 12px; }

.hero-visual:not(:has(.hero-photo)) {
  display: flex;
  justify-content: center;
  padding: 8px 0 4px;
}

.hero-visual:not(:has(.hero-photo)) .chip {
  width: 84px;
  height: 84px;
}

.hero-visual:not(:has(.hero-photo)) .chip-face {
  width: 60px;
  height: 60px;
  font-size: 1.8rem;
}

.hero-photo {
  width: 100%;
  height: min(240px, 52vw);
  display: block;
}

.hero-visual:has(.hero-photo) .chip {
  position: absolute;
  left: 12px;
  bottom: 12px;
  width: 54px;
  height: 54px;
}

.hero-visual:has(.hero-photo) .chip-face {
  width: 38px;
  height: 38px;
  font-size: 1.15rem;
}

.title-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.pill {
  display: inline-flex;
  align-items: center;
  flex: none;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pill.open, .pill.pending { background: #e7f2ea; color: #146c3a; }
.pill.closed, .pill.declined { background: #f3e4e1; color: #8a332c; }
.pill.traded, .pill.accepted { background: #f8e7c4; color: #7a4e09; }

.stack { display: grid; gap: 12px; }

.offer {
  background: var(--cream-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
}

.offer.accepted { box-shadow: inset 4px 0 0 var(--gold); }
.offer.declined { opacity: 0.72; }

.offer h3 { margin: 0 0 4px; font-size: 1.05rem; font-family: inherit; }

.section-title { margin: 26px 0 10px; font-size: 1.55rem; }

.settled a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 2px;
  text-decoration: none;
  color: inherit;
  border-top: 1px solid var(--line);
}

.settled a:first-of-type { border-top: 0; padding-top: 2px; }

.settled strong { font-weight: 700; }

.empty {
  margin-top: 16px;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 8px;
}

.field {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.field .hint, .panel > .hint { font-weight: 500; margin: 0; }

input, textarea {
  width: 100%;
  color-scheme: light;
  color: var(--ink);
  background: white;
  border: 1px solid #e0d6c6;
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;
  font-weight: 500;
}

textarea { min-height: 96px; resize: vertical; }

.picks { display: flex; flex-wrap: wrap; gap: 8px; }

.pick {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid #e0d6c6;
  background: white;
  font-size: 1.25rem;
  cursor: pointer;
}

.pick[aria-pressed="true"] {
  border-color: var(--red);
  box-shadow: 0 0 0 2px var(--red);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.btn:disabled { opacity: 0.65; cursor: wait; }

.btn-primary { background: var(--red); color: white; }
.btn-primary:hover { background: var(--red-dark); }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { background: var(--gold-dark); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px #c9bfb0;
}
.btn-ghost:hover { background: rgba(0, 0, 0, 0.04); }

.actions { display: flex; flex-wrap: wrap; gap: 8px; }

.banner {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fde8e4;
  color: #6e221c;
  font-weight: 600;
}

.banner.ok { background: #e7f6ea; color: #14532d; }

dialog.sheet {
  margin: auto;
  padding: 0;
  border: 0;
  width: min(480px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
}

dialog.sheet::backdrop { background: rgba(4, 16, 12, 0.72); }

.dialog-body { padding: 18px 18px 20px; display: grid; gap: 12px; }
.dialog-body h2 { margin: 0; }

@media (min-width: 720px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .btn-block { width: auto; min-width: 220px; }
}

@media (max-width: 719px) {
  .btn-block, .actions .btn { flex: 1 1 auto; }
  .btn-block { width: 100%; }
  .settled a { align-items: flex-start; flex-direction: column; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
