:root {
  --bg: #16171b;
  --panel: #1e2025;
  --tile-hidden: #e8d5a8;
  --tile-hidden-edge: #c9a15a;
  --gold: #c9a15a;
  --gold-soft: #e8d5a8;
  --ink: #f0eee8;
  --ink-dim: #a9a7a1;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'IBM Plex Sans', sans-serif;
  line-height: 1.5;
}

.topbar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 2.5rem 1.5rem 1.5rem;
  text-align: center;
}

.wordmark {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.tagline {
  color: var(--ink-dim);
  font-size: 0.95rem;
  max-width: 32ch;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}

/* --- the grid is the hero: it gets the most visual weight on the page --- */
.grid-wrap {
  background: var(--panel);
  border-radius: 6px;
  padding: 0.6rem;
  box-shadow: 0 30px 60px -30px rgba(0,0,0,0.6);
}

.mosaic-grid {
  display: grid;
  grid-template-columns: repeat(40, 1fr);
  gap: 1px;
  aspect-ratio: 40 / 25;
  background-image: url('mosaic.jpg');
  background-size: cover;
  background-position: center;
  border-radius: 3px;
  overflow: hidden;
}

.tile {
  background: var(--tile-hidden);
  border: 1px solid var(--tile-hidden-edge);
  transition: opacity 0.6s ease;
}

.tile.sold {
  opacity: 0;
}

.status-bar {
  margin-top: 1.5rem;
  text-align: center;
}

.status-numbers {
  font-family: 'Fraunces', serif;
  font-size: 1.3rem;
  margin-bottom: 0.6rem;
}

#sold-count { color: var(--gold); font-weight: 600; }

.progress-track {
  height: 8px;
  background: var(--tile-hidden);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--gold-soft));
  transition: width 0.6s ease;
}

.buy-panel {
  margin-top: 2.25rem;
  text-align: center;
}

.buy-lede {
  color: var(--ink-dim);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.buy-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.buy-btn {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.75rem 1.4rem;
  border-radius: 5px;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold-soft);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.buy-btn:hover {
  background: var(--gold);
  color: #16171b;
}

.buy-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.buy-panel.closed .buy-lede {
  color: var(--gold-soft);
}

.buy-message {
  min-height: 1.4em;
  color: var(--gold-soft);
  font-size: 0.9rem;
  margin-top: 0.9rem;
}

.activity-feed {
  margin-top: 2.25rem;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.activity-heading {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink-dim);
  text-align: center;
  margin: 0 0 0.75rem;
}

.activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.activity-list li {
  font-size: 0.88rem;
  color: var(--ink-dim);
  background: var(--panel);
  border: 1px solid var(--tile-hidden-edge);
  border-radius: 5px;
  padding: 0.55rem 0.9rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  animation: fade-in 0.5s ease;
}

.activity-list .activity-qty {
  color: var(--gold-soft);
  font-weight: 500;
}

.activity-empty {
  text-align: center;
  justify-content: center !important;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.explainer {
  margin-top: 3rem;
  border-top: 1px solid var(--tile-hidden-edge);
  padding-top: 1.75rem;
}

.explainer h2 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 1.2rem;
  margin: 0 0 0.75rem;
}

.explainer p {
  color: var(--ink-dim);
  font-size: 0.92rem;
  max-width: 60ch;
}

.footer {
  text-align: center;
  color: var(--ink-dim);
  font-size: 0.82rem;
  padding: 1.5rem;
}

@media (max-width: 480px) {
  .mosaic-grid { grid-template-columns: repeat(20, 1fr); }
}
