/* Warm field colors and square, tactile controls give Blockyard its own character. */
:root {
  --accent: #4c9a2a;
  --accent-ink: #ffffff;
  --bg: #f4f2e9;
  --surface: #fffef8;
  --surface-2: #e9eadc;
  --ink: #263624;
  --ink-2: #65705b;
  --radius: 6px;
  --radius-sm: 4px;
  --max: 1180px;
  --font-display: ui-monospace, Menlo, Consolas, monospace;
  color-scheme: light;
}

/* Sticky setup remains available while browsing. */
.app-header {
  position: relative;
  background: #283e29;
  color: #ffffff;
}

.app-header .brand {
  font-size: 1.35rem;
  letter-spacing: -1px;
}

.setup {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 16px;
  background: #fffef8;
  border-bottom: 3px solid #d5dbc7;
}

.setup strong {
  font: 700 .8rem var(--font-display);
  letter-spacing: 1px;
}

.setup label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .85rem;
}

.setup select {
  width: auto;
}

.check {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 44px;
}

/* Compact introduction keeps discoveries above the fold. */
.catalog-intro {
  margin: 4px 0 20px;
  color: var(--ink-2);
  font-size: .95rem;
}

.eyebrow {
  color: #5b7942;
  font: 700 .75rem var(--font-display);
}

.categories {
  margin-bottom: 18px;
}

.chip {
  border-radius: 4px;
  min-height: 44px;
}

.btn {
  border-radius: 4px;
  box-shadow: inset 0 -3px 0 #00000018;
}

.toolbar {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  align-items: end;
  gap: 12px;
}

.toolbar label {
  color: var(--ink-2);
  font-size: .8rem;
}

.search input {
  border-radius: 4px;
}

/* Responsive cards retain generous touch targets. */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 255px), 1fr));
  gap: 18px;
}

.entry.card {
  padding: 0;
  overflow: hidden;
  border: 1px solid #d8ddcf;
  margin: 0;
}

.art-button {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  cursor: pointer;
}

.art-button canvas {
  width: 100%;
  image-rendering: pixelated;
}

.art-label {
  position: absolute;
  left: 12px;
  bottom: 10px;
  padding: 3px 8px;
  background: #fffef8ed;
  font: 700 .75rem var(--font-display);
}

.entry-body {
  padding: 16px;
}

.creator {
  color: var(--ink-2);
  font-size: .75rem;
}

 .entry-body h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.entry-body .creator {
  margin: 0 0 12px;
}

.badge {
  border-radius: 3px;
}

.compatible {
  color: #397529;
}

.incompatible {
  color: #a33828;
  font-weight: 700;
}

.stats {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  font-size: .8rem;
  color: var(--ink-2);
}

.favorite {
  margin-top: 12px;
  width: 100%;
}

.favorite[aria-pressed="true"] {
  background: #e2edcc;
}

.library-tools {
  margin-bottom: 18px;
}

footer {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: .85rem;
  color: var(--ink-2);
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  margin-bottom: 20px;
  font-size: .85rem;
}

th, td {
  text-align: left;
  overflow-wrap: anywhere;
  padding: 8px;
  border-bottom: 1px solid var(--line);
}

pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: .8rem;
}

/* Controls share a row at tablet widths; cards follow the available space. */
.setup {
  flex-wrap: nowrap;
  justify-content: flex-start;
  border-bottom-width: 1px;
}

.setup-status {
  color: var(--ink-2);
  font-size: .8rem;
}

.toolbar {
  margin-bottom: 18px;
}

.toolbar > * {
  min-width: 0;
}

.toolbar label {
  display: block;
  margin-bottom: 5px;
}

.catalog-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
}

.categories {
  gap: 8px;
}

.chip[aria-pressed="true"], .active-tag {
  background: #283e29;
  color: white;
  border-color: #283e29;
}

.art-button canvas {
  display: block;
}

.art-button {
  cursor: default;
}

.compatible {
  background: #e9efde;
}

.incompatible {
  background: #f3e9e5;
  color: #985d54;
  font-weight: 400;
}

.stats {
  align-items: center;
  margin-top: 14px;
  padding-top: 10px;
  gap: 8px;
}

.open-entry {
  width: 44px;
  height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  background: #283e29;
  color: white;
}

dialog.sheet {
  max-width: 640px;
}

@media (max-width: 600px) {
  .toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .toolbar .search {
    grid-column: 1 / -1;
  }

  .setup {
    gap: 8px;
    padding: 6px 12px;
  }

  .setup strong {
    font-size: .7rem;
    letter-spacing: 0;
    white-space: nowrap;
  }

  .setup-status {
    display: none;
  }

  .setup-trigger {
    margin-left: auto;
  }
}
