/*
 * Purpose: Style shared buttons, cards, forms, dialogs, and app components.
 * Loaded by: the public static pages and app shell.
 * Security: Presentation only; do not use CSS as an access-control boundary.
 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 7px;
  border: 1px solid var(--ink);
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font: 700 12px/1 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.btn.secondary {
  background: transparent;
  color: var(--ink);
}
.btn.danger {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}
.eyebrow {
  font: 500 12px/1.2 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--small-red);
}
.card {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
}
.listing-card {
  overflow: hidden;
  padding: 0;
}
.listing-image-frame {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--section-surface);
}
.listing-image-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: var(--muted);
  font: 700 2rem var(--font-mono);
}
.listing-image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--image-x, 50%) var(--image-y, 50%);
  transform: scale(var(--image-zoom, 1));
}
.listing-card-content {
  padding: 18px;
}
.listing-card-content h2 {
  margin-top: 0;
  font-size: 1.2rem;
}
.listing-byline {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}
.listing-developer-logo {
  width: 28px;
  height: 28px;
  flex: none;
  overflow: hidden;
  border-radius: 50%;
  background: var(--section-surface);
}
.listing-developer-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.listing-verified {
  color: var(--blue, #0b84ff);
  font-weight: 700;
}
.listing-tags {
  margin: 10px 0;
}
.listing-stats {
  color: var(--muted);
  font: 500 12px/1.5 var(--font-mono);
}
.country-gate {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  align-content: center;
  gap: 14px;
  padding: 24px;
  overflow: auto;
  background: var(--paper);
  color: var(--ink);
}
.country-gate select,
.country-gate input {
  width: min(100%, 560px);
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
}
.skeleton {
  min-height: 160px;
  border-radius: 8px;
  background: linear-gradient(
    90deg,
    var(--section-surface),
    var(--surface-raised),
    var(--section-surface)
  );
  background-size: 200% 100%;
  animation: skeleton 1.4s infinite linear;
}
@keyframes skeleton {
  to {
    background-position: -200% 0;
  }
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--surface);
  text-decoration: none;
  color: var(--ink);
}
.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  max-width: 360px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 7px;
  padding: 12px 16px;
  z-index: 100;
}
.error {
  border: 1px solid var(--red);
  color: var(--small-red);
  background: var(--surface-raised);
  padding: 12px;
  border-radius: 7px;
}
.comment-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}
.comment-thread {
  display: grid;
  gap: 8px;
}
.comment {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
}
.comment.pinned {
  border-color: var(--gold);
}
.comment p {
  margin: 0.35em 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.65;
}
.comment-form label,
.reply-form label {
  display: grid;
  gap: 6px;
}
.comment-form textarea,
.reply-form textarea {
  min-height: 96px;
  resize: vertical;
}
.comment-thread > .comment:not(:first-child) {
  margin-left: clamp(12px, 4vw, 36px);
}
.comment-meta {
  color: var(--muted);
  font-size: 14px;
  margin-top: 0;
}
.comment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.comment-form textarea,
.reply-form textarea {
  width: 100%;
  min-height: 90px;
  display: block;
  margin: 8px 0;
}
.notification-dot {
  display: inline-flex;
  min-width: 10px;
  min-height: 10px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 2px 6px;
  margin-left: 6px;
  color: #fff;
  font-size: 11px;
  line-height: 1;
  vertical-align: middle;
}
.notification-dot[hidden] {
  display: none;
}
.notification-dot.blue {
  background: #0b84ff;
}
.notification-dot.red {
  background: #e61c24;
}
.update-card {
  margin-bottom: 12px;
}
dialog.report-dialog {
  width: min(520px, calc(100% - 24px));
  max-height: 90vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  color: var(--ink);
  background: var(--surface-raised);
}
dialog.report-dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}
dialog.report-dialog label {
  display: block;
  margin: 12px 0;
}
dialog.report-dialog select,
dialog.report-dialog textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}
.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 12px;
}
.badge-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.badge-card h3 {
  margin: 0 0 6px;
}
.badge-image {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  object-fit: contain;
}
.badge-card p {
  margin: 6px 0;
}
.badge-card time {
  color: var(--muted);
  font-size: 14px;
}
.badge-revoked {
  opacity: 0.7;
}
.badge-section {
  margin: 24px 0;
}
.account-tick {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tick-image {
  width: 24px;
  height: 24px;
  object-fit: contain;
  vertical-align: middle;
}
.rank-list {
  display: grid;
  gap: 10px;
  padding: 0;
  list-style: none;
}
.rank-row {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}
.rank-position {
  font: 700 1.1rem var(--font-mono);
}
.rank-user {
  min-width: 0;
  overflow-wrap: anywhere;
}
.rank-score {
  white-space: nowrap;
}
.admin-section {
  display: grid;
  gap: 14px;
}
.admin-tabs,
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}
.admin-list {
  display: grid;
  gap: 12px;
}
.admin-section label {
  display: block;
  margin: 10px 0;
}
.admin-section input,
.admin-section textarea,
.admin-section select {
  width: 100%;
  margin-top: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
}
.setting-row textarea {
  min-height: 100px;
}
.admin-report {
  display: grid;
  gap: 8px;
}
.drawer {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(320px, 88vw);
  background: var(--surface-raised);
  transform: translateX(-100%);
  transition: transform 0.2s;
  z-index: 80;
  padding: 20px;
  box-shadow: var(--shadow);
}
.drawer.open {
  transform: none;
}
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 79;
}
.drawer nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
}
