/* Community page (Phase 3 sub-step 5). Relies on :root variables and
   header.site from player.css, and reuses .signin-card, .btn-accent,
   .status-msg, .badge-tile, the .bd- and .badge-popup- families,
   .profile-badges-card, .favorites-header, .member-badge-grid and
   .member-badges-empty from profile.css (both loaded before this file in
   community.html) rather than redefining them here.

   Careful with wildcards in comments here: this block used to write those
   prefixes with a star and a slash between them, which closes a CSS
   comment. It ended four lines early, everything after parsed as junk
   until the next closing brace, and that silently ate the first real rule
   in the file — which is how the gold custom properties below went
   missing until 2026-09-20. No star-slash in comments. */

/* The club's gold, spelled out here rather than reaching for --accent:
   --accent is the site's green (player.css :root), while everything that
   says "member" — the membership card, My Selections, badge borders — is
   gold. The Community page is member space, so it follows the gold. */
:root{ --cm-gold:#f4dc98; --cm-gold-deep:#c9a24f; }

.community-wrap{max-width:1180px; margin:0 auto; padding:32px 24px 80px;}
.community-wrap h1{font-size:26px; margin:0 0 6px;}
.community-wrap .sub{color:var(--muted); font-size:13.5px; margin:0 0 28px;}

/* Same embedded-iframe treatment as profile.css — hides the in-page header
   when this page is loaded inside the parent's Community overlay iframe. */
html.embedded header.site{display:none;}
html.embedded .community-wrap{padding-top:48px;}

/* Rebuilt 2026-09-20. The page used to be a two-column split with a single
   "Community Activity" list on the right. It is now tabbed — ALL /
   LISTENING / TALK / MEMBERS — with a live strip above the tabs.
   On desktop the "you" rail sits in the left column beside the panels; on a
   phone placeRail() in community.js moves that same DOM node into the
   MEMBERS panel, so the rail exists exactly once either way. */
.community-layout{
  display:grid; grid-template-columns:320px 1fr; gap:28px; align-items:start;
}
.community-left{position:sticky; top:24px;}
@media(max-width:900px){
  .community-layout{grid-template-columns:1fr;}
  .community-left{display:none; position:static;}
}

/* ---- Live strip ---- */
.cm-pulse{
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  background:var(--card); border:1px solid #272114; border-radius:12px;
  padding:11px 14px; margin:0 0 18px;
}
.cm-live-dot{
  width:8px; height:8px; border-radius:50%; flex:none; background:#7fd18a;
  box-shadow:0 0 8px rgba(127,209,138,.8);
}
.cm-pulse.is-quiet{border-color:#1f1f1f;}
.cm-pulse.is-quiet .cm-live-dot{background:#4a4a4a; box-shadow:none;}
.cm-pulse-main{font-size:13px; color:var(--fg); flex-grow:1;}
.cm-pulse-main strong{color:var(--cm-gold);}
.cm-pulse-meta{font-size:12px; color:var(--muted);}

/* ---- Tabs ---- */
.cm-tabs{
  display:flex; gap:20px; border-bottom:1px solid #1f1f1f; margin:0 0 20px;
  overflow-x:auto; -webkit-overflow-scrolling:touch; scrollbar-width:none;
}
.cm-tabs::-webkit-scrollbar{display:none;}
.cm-tab{
  appearance:none; background:none; border:0; border-bottom:2px solid transparent;
  color:var(--muted); font:inherit; font-size:12px; letter-spacing:.08em;
  padding:0 0 10px; cursor:pointer; white-space:nowrap;
  /* 44px keeps the tap target honest on a phone without pushing the
     underline away from the text. */
  min-height:44px;
}
.cm-tab:hover{color:var(--fg);}
.cm-tab.is-on{color:var(--cm-gold); border-bottom-color:var(--cm-gold); font-weight:700;}
.cm-panel[hidden]{display:none;}

.cm-block{margin:0 0 26px;}
.cm-block:last-child{margin-bottom:0;}
.cm-block-head{display:flex; align-items:center; gap:8px; margin:0 0 12px;}
.cm-block-head h2{font-size:12px; letter-spacing:.14em; color:var(--muted); margin:0; text-transform:uppercase;}

.cm-member-card{
  background:var(--card); border:1px solid #1f1f1f; border-radius:14px;
  padding:22px 24px; margin-bottom:20px;
}
.cm-member-head{display:flex; align-items:center; gap:14px; margin-bottom:14px;}
.cm-avatar{
  width:56px; height:56px; border-radius:50%; flex:none;
  background:#1c1c1c; border:2px solid #262626; overflow:hidden;
  display:flex; align-items:center; justify-content:center;
}
.cm-avatar img{width:100%; height:100%; object-fit:cover; display:block;}
/* Chef-hat default picture — see the matching note in profile.css. */
.cm-avatar #cm-avatar-placeholder{
  width:100%; height:100%; display:block; font-size:0;
  background:#000 url('/assets/default-avatar.svg') center/cover no-repeat;
}
.cm-member-head h2{margin:0 0 2px; font-size:17px;}
.cm-ssd{margin:0; font-size:12px; color:var(--muted);}
.cm-words{
  font-size:13.5px; color:var(--fg); line-height:1.6; margin:0 0 14px;
  white-space:pre-wrap; border-top:1px solid #1f1f1f; padding-top:14px;
}
.cm-edit-link{color:var(--accent); font-size:12.5px; font-weight:700; text-decoration:none;}
.cm-edit-link:hover{text-decoration:underline;}

/* ---- The feed ----
   Rows are cards now rather than a bordered list, and every row is a real
   button: the member's name and avatar open their profile popup, a cover
   opens that record out in the player (via postMessage — community.html is
   an iframe inside the overlay). Runs of badges by the same member collapse
   into one row upstream in community.js, so six unlocks read as one line. */
.cm-feed{display:flex; flex-direction:column; gap:10px;}

/* Date groups fold. Today and this week open; the older ones start shut so
   the top of the feed is news rather than a scroll. */
.cm-group{display:flex; flex-direction:column; gap:10px;}
.cm-day{
  display:flex; align-items:center; gap:8px; width:100%; text-align:left;
  appearance:none; background:none; border:0; cursor:pointer; padding:10px 0 2px;
  font:inherit; font-size:10px; letter-spacing:.18em; color:var(--muted);
  text-transform:uppercase;
}
.cm-group:first-child .cm-day{padding-top:0;}
.cm-day:hover{color:var(--fg);}
.cm-caret{
  display:inline-block; font-size:13px; line-height:1; width:10px;
  transition:transform .15s ease; transform-origin:50% 45%;
}
.cm-group.is-shut .cm-caret{transform:rotate(-90deg);}
.cm-day-count{
  margin-left:auto; font-size:10px; letter-spacing:.06em; color:#6f6a63;
  background:#1a1a1a; border:1px solid #242424; border-radius:999px;
  padding:2px 7px; text-transform:none;
}
/* display:flex would otherwise beat the browser's own [hidden] rule and the
   folded group would stay on screen. */
.cm-group-body{display:flex; flex-direction:column; gap:10px;}
.cm-group-body[hidden]{display:none;}
.cm-row{
  display:flex; gap:12px; align-items:flex-start; width:100%; text-align:left;
  appearance:none; font:inherit; color:inherit;
  background:var(--card); border:1px solid #1f1f1f; border-radius:12px;
  padding:12px; transition:border-color .15s ease, background .15s ease;
}
button.cm-row{cursor:pointer;}
button.cm-row:hover{border-color:#2f2a1c; background:#161616;}
.cm-row-body{flex-grow:1; min-width:0;}
.cm-row-text{font-size:12.5px; line-height:1.5; margin:0;}
.cm-row-text strong{font-weight:700;}
.cm-row-text .cm-who{color:var(--cm-gold);}
.cm-row-sub{font-size:11px; color:var(--muted); margin:4px 0 0;}
.cm-row-time{font-size:10.5px; color:var(--muted); flex:none; margin:0; padding-left:4px;}
.cm-quote{
  font-size:12px; line-height:1.55; color:#cfcac2; margin:6px 0 0;
  border-left:2px solid #3a3320; padding-left:9px;
}
.cm-thumb{
  width:44px; height:44px; border-radius:50%; flex:none; margin:0;
  background-color:#1c1c1c; background-size:cover; background-position:center;
}
/* Avatar rows fall back to the chef hat; badge rows deliberately don't —
   a badge with no artwork should stay an empty gold square, not wear a
   chef hat it didn't earn. */
.cm-thumb.avatar{background-image:url('/assets/default-avatar.svg'); background-color:#000;}
.cm-thumb.badge{border-radius:10px; border:2px solid #c9a227;}
.cm-thumb.cover{width:52px; height:52px; border-radius:6px;}
/* Overlapping avatars for a collapsed "3 new members" row. */
.cm-stack{display:flex; flex:none;}
.cm-stack .cm-thumb{width:30px; height:30px; border:2px solid var(--bg, #0c0c0c);}
.cm-stack .cm-thumb + .cm-thumb{margin-left:-11px;}
/* A collapsed run of finished records: the covers themselves are the play
   buttons, since the row around them can't be one (no nested buttons). */
/* 42 + 6 keeps five covers on one line inside the card at phone width; more
   than that wraps, which is fine and rare. */
.cm-cover-strip{display:flex; flex-wrap:wrap; gap:6px; margin-top:9px; align-items:center;}
.cm-cover-btn{
  width:42px; height:42px; border-radius:5px; padding:0; border:0; cursor:pointer;
  background-color:#1c1c1c; background-size:cover; background-position:center;
  transition:transform .12s ease, box-shadow .12s ease;
}
.cm-cover-btn:hover{transform:scale(1.06); box-shadow:0 0 0 2px var(--cm-gold-deep);}
.cm-cover-more{font-size:11px; color:var(--muted); padding-left:2px;}
.cm-chips{display:flex; gap:6px; flex-wrap:wrap; margin-top:8px;}
.cm-chip{
  font-size:9px; letter-spacing:.08em; padding:4px 7px; border-radius:999px;
  background:#241f14; color:var(--cm-gold); border:1px solid #3a3320;
}
.cm-chip.more{background:#1b1b1b; color:var(--muted); border-color:#2a2a2a;}
.cm-play{
  width:30px; height:30px; flex:none; border-radius:50%; background:#c4453a;
  display:flex; align-items:center; justify-content:center; color:#fff;
  font-size:10px; line-height:1;
}
.cm-feed-empty{color:var(--muted); font-size:12.5px; margin:0;}

/* ---- Badge progress ---- */
.cm-progress{
  background:var(--card); border:1px solid #272114; border-radius:12px;
  padding:14px; margin-top:16px;
}
.cm-progress-head{display:flex; justify-content:space-between; align-items:baseline; gap:12px;}
.cm-progress-head strong{font-size:13px; color:var(--cm-gold); font-weight:700;}
.cm-progress-head span{font-size:11px; color:var(--muted);}
.cm-progress-bar{height:6px; border-radius:999px; background:#241f14; overflow:hidden; margin:10px 0 9px;}
.cm-progress-bar i{display:block; height:100%; background:linear-gradient(90deg,#8b6f2e,var(--cm-gold));}
.cm-progress p{font-size:11px; color:var(--muted); margin:0;}

/* ---- Listening tab ---- */
.cm-chart{
  display:flex; flex-direction:column; gap:1px;
  background:#232323; border:1px solid #232323; border-radius:10px; overflow:hidden;
}
.cm-chart-row{
  display:flex; align-items:center; gap:11px; width:100%; text-align:left;
  appearance:none; font:inherit; color:inherit; border:0; cursor:pointer;
  background:var(--card); padding:11px 12px;
}
.cm-chart-row:hover{background:#181818;}
.cm-rank{font-size:14px; font-weight:800; color:var(--muted); width:16px; flex:none;}
.cm-chart-row:first-child .cm-rank{color:var(--cm-gold);}
.cm-chart-row .cm-thumb{width:32px; height:32px; border-radius:4px;}
.cm-shelf{display:flex; flex-wrap:wrap; gap:9px;}
.cm-shelf-tile{
  width:74px; height:74px; border-radius:6px; padding:0; border:0; cursor:pointer;
  background-color:#1c1c1c; background-size:cover; background-position:center;
}
.cm-shelf-tile.todo{
  background:#151515; border:1px dashed #2f2f2f; cursor:default;
  color:var(--muted); font-size:9px; text-align:center; padding:6px;
  display:flex; align-items:center; justify-content:center;
}
.cm-shelf-note{font-size:11px; color:var(--muted); margin:9px 0 0;}
.cm-bars{display:flex; align-items:flex-end; gap:2px; height:16px; flex:none;}
.cm-bars i{width:2px; background:var(--cm-gold); display:block;}

/* Signed-out badge preview teaser — sits under the sign-in card, same
   .profile-badges-card treatment as the member-facing badge section, just
   wider than the (deliberately narrow) sign-in card above it so the grid
   has room to show a handful of tiles per row. */
.preview-badges-card{margin:28px auto 0; max-width:720px;}
.preview-badges-sub{color:var(--muted); font-size:12.5px; margin:0 0 16px;}
.preview-badges-hint{color:var(--muted); font-size:12px; margin:14px 0 0;}
