/* "Community: <page>" section (build/shell/community-widget.mjs), linked only
   on pages that render it: games, quizzes, skill and hardware tests. Flat
   Deck panel with a Seam edge (no gradient, no blur; DESIGN.md Community Widget). */
.cw { padding-block: var(--space-7) 0; border-block-start: 1px solid var(--border); }
.cw + .up-next { border-block-start: 0; }
.cw__panel {
  display: grid;
  gap: var(--space-5);
  padding: var(--space-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
}
.cw__head { display: flex; align-items: center; gap: var(--space-4); }
.cw__icon {
  flex: none;
  display: grid;
  place-items: center;
  inline-size: 40px;
  block-size: 40px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--text);
}
.cw__heading { min-inline-size: 0; }
.cw__heading h2 { margin: 0; font-family: var(--font-display); font-size: var(--step-3); line-height: 1; color: var(--text); overflow-wrap: anywhere; }
.cw__heading p { margin: var(--space-1) 0 0; color: var(--text-muted); }

.cw__list { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.cw__post a {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
  transition: border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.cw__post a:hover { border-color: var(--border-strong); background: var(--surface-3); }
.cw__post a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.cw__title { font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.cw__excerpt { color: var(--text-muted); font-size: var(--step--1); line-height: 1.45; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.cw__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); color: var(--text-faint); font-size: var(--step--1); }
.cw__author { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--text-muted); font-weight: 600; }
.cw__avatar {
  display: grid;
  place-items: center;
  inline-size: 22px;
  block-size: 22px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text);
  font-size: var(--step--1);
  font-weight: 700;
  line-height: 1;
}
.cw__replies { display: inline-flex; align-items: center; gap: 4px; }
.cw__replies svg { inline-size: 15px; block-size: 15px; }

.cw__status, .cw__empty { margin: 0; color: var(--text-muted); }
.cw__empty { padding: var(--space-4); border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); text-align: center; }
.cw__status[data-state="loading"]::before {
  content: '';
  display: inline-block;
  inline-size: 0.9em;
  block-size: 0.9em;
  margin-inline-end: var(--space-2);
  border: 2px solid rgb(196 181 253 / 0.35);
  border-block-start-color: #c4b5fd;
  border-radius: 50%;
  vertical-align: -0.1em;
  animation: cw-spin 0.8s linear infinite;
}
@keyframes cw-spin { to { transform: rotate(360deg); } }

/* Posts could not be loaded: one calm panel like the console's error state (assets/play/play.css .play-embed-error):
   an icon tile, one line and "Try again". Never shown together with the "No posts yet" line. */
.cw__error { display: grid; justify-items: center; gap: var(--space-3); padding: var(--space-5) var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-raised); text-align: center; }
.cw__error[hidden] { display: none; }
.cw__error-icon { display: grid; place-items: center; inline-size: 40px; block-size: 40px; border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--surface-2); color: var(--text-muted); }
.cw__error p { margin: 0; max-inline-size: 36ch; color: var(--text-muted); }
.cw__error .cw__retry { display: inline-flex; align-items: center; justify-content: center; min-block-size: var(--tap); }

.cw__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.cw__actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-block-size: var(--tap); }
/* Guests: the write button is the one .btn--signin (components.css); the pen swaps for the sign-in arrow. */
.cw__ico-in { display: none; }
.cw[data-viewer="guest"] .cw__ico-in { display: block; }
.cw[data-viewer="guest"] .cw__ico-write { display: none; }

@media (max-width: 599px) {
  .cw__panel { padding: var(--space-5) var(--space-4); }
  .cw__head { align-items: flex-start; }
  .cw__heading h2 { font-size: var(--step-2); }
  .cw__actions .btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .cw__post a { transition: none; }
  .cw__status[data-state="loading"]::before { animation: none; }
}
@media (forced-colors: active) {
  .cw__panel, .cw__post a { border-color: CanvasText; }
}
