/* Per-category page (one identity or one stable behavior) */

.category-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.25rem 4rem;
  color: #d8d8d8;
}

.sig-display {
  font-family: ui-monospace, monospace;
  font-size: 2.4rem;
  letter-spacing: 0.02em;
  line-height: 1.2;
  margin: 0.4rem 0 0.6rem;
  text-shadow: 0 2px 12px rgba(0,0,0,0.7);
}

.purity-pill {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 11px;
  font-size: 0.7em;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-left: 0.4rem;
  vertical-align: middle;
}
.purity-p1 { background:#1f4823; color:#6f9; border:1px solid #6f9; }
.purity-p2 { background:#3a2f0a; color:#fbbf24; border:1px solid #fbbf24; }
.purity-p3 { background:#3a2f00; color:#f5d76e; border:1px solid #f5d76e; }
.purity-p4 { background:#3a1f00; color:#f97316; border:1px solid #f97316; }
.purity-p5 { background:#3a0a0a; color:#ef4444; border:1px solid #ef4444; }

/* Filter bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.4rem;
  align-items: flex-end;
  background: #0e0e0e;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 1rem 1.2rem;
  margin: 1rem 0 2rem;
}
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 130px;
}
.filter-group label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #888;
}
.filter-group select,
.filter-group input[type=range] {
  background: #181818;
  border: 1px solid #333;
  color: #d8d8d8;
  padding: 0.3rem 0.5rem;
  border-radius: 3px;
  font-family: ui-monospace, monospace;
  font-size: 0.84rem;
  min-width: 130px;
}
.filter-group input[type=range] {
  padding: 0;
  height: 22px;
}
.filter-readout {
  font-family: ui-monospace, monospace;
  font-size: 0.78rem;
  color: #f5d76e;
  align-self: flex-start;
  margin-top: -0.05rem;
}
.filter-clear {
  background: transparent;
  border: 1px solid #444;
  color: #aaa;
  padding: 0.5rem 0.9rem;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.78rem;
}
.filter-clear:hover { color: #fff; border-color: #888; }

/* Section titles */
.cat-section-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #f5d76e;
  margin: 1.5rem 0 0.4rem;
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
}
.cat-section-count {
  font-size: 0.78rem;
  font-weight: 400;
  color: #888;
}
.cat-section-help {
  color: #aaa;
  font-size: 0.85rem;
  line-height: 1.55;
  margin: 0 0 1rem;
}

/* Shape pool grid */
.shape-pool {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.8rem;
}
.shape-card {
  background: #111;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  padding: 0.7rem 0.8rem;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  position: relative;
}
.shape-card:hover {
  border-color: #f5d76e;
  transform: translateY(-1px);
}
.shape-card-thumb {
  width: 100%;
  aspect-ratio: 1;
  background: #0a0a0a;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  font-size: 0.7rem;
}
.shape-card-thumb img {
  width: 100%; height: 100%; object-fit: contain;
}
.shape-card-name {
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
  color: #d8d8d8;
  font-weight: 600;
  line-height: 1.2;
}
.shape-card-meta {
  font-size: 0.72rem;
  color: #888;
  font-family: ui-monospace, monospace;
}
.shape-card-mini {
  display: flex;
  gap: 2px;
  height: 5px;
  border-radius: 1px;
  overflow: hidden;
  background: #1a1a1a;
}
.shape-card-mini > i { display:block; height:100%; }
.viewer-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(34,211,238,0.15);
  border: 1px solid #22d3ee44;
  color: #22d3ee;
  font-size: 0.66rem;
  padding: 0.15rem 0.45rem;
  border-radius: 10px;
  text-decoration: none;
  font-family: ui-monospace, monospace;
}
.viewer-badge:hover {
  background: rgba(34,211,238,0.35);
  color: #fff;
}

/* Shape × behavior drawer */
.shape-drawer {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.78);
  z-index: 200;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  animation: cl-drawer-in 0.18s ease-out;
}
/* The HTML 'hidden' attribute must beat the class-rule display:flex above. */
.shape-drawer[hidden] {
  display: none !important;
}
@keyframes cl-drawer-in {
  from { background: rgba(0,0,0,0); }
  to   { background: rgba(0,0,0,0.78); }
}
.shape-drawer-inner {
  background: #0a0a0a;
  border-left: 1px solid #2a2a2a;
  width: min(720px, 100%);
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 40px rgba(0,0,0,0.5);
}
.shape-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #2a2a2a;
}
.drawer-shape-name {
  font-family: ui-monospace, monospace;
  font-size: 1.15rem;
  font-weight: 700;
  color: #f5d76e;
}
.drawer-context {
  font-size: 0.78rem;
  color: #888;
  margin-top: 0.2rem;
}
.shape-drawer-close {
  background: transparent;
  border: 1px solid #444;
  color: #888;
  width: 32px; height: 32px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1.1rem;
}
.shape-drawer-close:hover { color:#fff; border-color:#888; }
.shape-drawer-body {
  padding: 1rem 1.25rem 2rem;
  overflow-y: auto;
}

.symbol-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.65rem;
}
.symbol-cell {
  background: #111;
  border: 1px solid #2a2a2a;
  border-radius: 4px;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s;
}
.symbol-cell:hover { border-color: #22d3ee; }
.symbol-cell img {
  width: 100%; aspect-ratio: 1; object-fit: contain;
  background: #0a0a0a; border-radius: 2px;
}
.symbol-cell-meta {
  display: flex;
  flex-direction: column;
  font-family: ui-monospace, monospace;
  font-size: 0.72rem;
  color: #888;
  text-align: center;
  line-height: 1.3;
}
.symbol-cell-dim {
  color: #6b8bff;
  font-weight: 600;
}
.symbol-cell-dim.dim-4d { color: #b5f; }
.symbol-cell-dec {
  color: #f5d76e;
}
.symbol-cell-dom {
  color: #aaa;
  font-size: 0.66rem;
}

/* Drawer empty state */
.drawer-empty {
  text-align: center;
  color: #666;
  padding: 2rem 1rem;
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  .shape-drawer-inner { width: 100%; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-group { min-width: 0; }
}
