/* Achievements on the noticeboard (templates/achievements/achievement_list.html; loaded
   after css/achievements/achievements.css). Brief §7: title plaque with the totals, a
   filter bar with category chips, a calm grid of pinned cards, the detail popup.
   Nothing here can un-redact a card: invariant #16 is decided in the view/template. */

.ach-header-stats{ margin:2px 0 0; display:block; }
.ach-header-stats .ach-stat, .ach-header-stats .ach-stat strong{ color:#fff4e4; }

.ach-filter-bar{ display:block; }
.ach-filter-top{ display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; }
.ach-chip-row.chip-row{ margin:0; padding:0; list-style:none; flex:1 1 300px; min-width:0; }
.ach-chip-row .ach-chip.fchip{ min-height:44px; padding:4px 14px; font-size:13px; border-width:2px; border-radius:999px;
  background:var(--parch-2); color:var(--ink); border-color:var(--line); }
.ach-chip-row .ach-chip.fchip:hover{ border-color:var(--rose-deep); }
.ach-chip-row .ach-chip.fchip.ach-chip--active{ background:var(--rose); border-color:var(--rose-deep); color:var(--on-accent); }
.ach-filter-bar .filter-toggle{ min-height:44px; }
.ach-filter-bar .filter-body{ margin-top:12px; }
.ach-filter-bar .filters{ display:grid; grid-template-columns:repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap:10px 14px; align-items:end; }
.ach-filter-bar .filters input[type="text"], .ach-filter-bar .filters select{ width:100%; max-width:100%; min-height:44px; }
.ach-past-toggle{ padding-bottom:10px; }
.ach-check{ white-space:normal; min-height:44px; }

/* The grid: calm (no tilt), one pin per card, colours rotating for variety. */
.ach-grid{ grid-template-columns:repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap:30px 20px; padding-top:10px; }
.ach-card{ position:relative; overflow:visible; border-radius:14px;
  box-shadow:0 4px 0 rgba(111,79,51,.28), 0 12px 20px rgba(60,40,20,.22); transition:transform .14s ease, border-color .14s ease; }
:root[data-theme="dark"] .ach-card{ box-shadow:0 4px 0 rgba(0,0,0,.35), 0 12px 20px rgba(0,0,0,.4); }
.ach-card::before{ content:""; position:absolute; z-index:3; top:-10px; left:50%; margin-left:-10px; width:20px; height:20px; border-radius:50%;
  background:radial-gradient(circle at 35% 30%, #fff 0 2px, var(--tack-fill, var(--rose-deep)) 3px);
  border:2px solid var(--tack-ring, var(--rose-ink)); box-shadow:0 3px 0 rgba(0,0,0,.2); pointer-events:none; }
.ach-card:nth-child(4n+1)::before{ --tack-fill:#f2cf6b; --tack-ring:#9a7322; }
.ach-card:nth-child(4n+2)::before{ --tack-fill:#9ed092; --tack-ring:#4f7d44; }
.ach-card:nth-child(4n+3)::before{ --tack-fill:var(--rose-deep); --tack-ring:var(--rose-ink); }
.ach-card:nth-child(4n+4)::before{ --tack-fill:#b7a2e0; --tack-ring:#6b56a0; }
.ach-card:has(.ach-card-trigger:not(.ach-card-trigger--inert)):hover{ transform:translateY(-3px); box-shadow:0 4px 0 rgba(111,79,51,.28), 0 12px 20px rgba(60,40,20,.22); }
.ach-card-trigger{ padding:18px 14px 14px; border-radius:12px; }
.ach-card-trigger:focus-visible{ outline:3px solid var(--accent-dark); outline-offset:3px; }
.ach-icon{ width:48px; height:48px; border:2px solid var(--line); background:var(--tint-butter); }
.ach-name{ font-family:"Fredoka"; font-weight:600; font-size:17px; line-height:1.2; }
.ach-points{ font-weight:800; color:var(--rose-ink); font-size:12.5px; }
.ach-unlocked-date{ color:var(--ink-soft); }
.ach-bar-track{ height:8px; border-width:1.5px; }

/* The popup */
.ach-modal-box{ max-width:560px; }
/* Lines sitting straight on the board get the same cream-on-dark-wood label as
   board.css gives .corkboard's own direct children (they're one level deeper here). */
#ach-results > :is(.result-count, .empty){ margin:22px 0 0; width:fit-content; max-width:100%; padding:2px 12px; border-radius:10px;
  font-weight:700; color:#fff3dc; background:rgba(60,40,22,.6); text-shadow:0 1px 0 rgba(0,0,0,.35); }
:root[data-theme="dark"] #ach-results > :is(.result-count, .empty){ background:none; padding-left:0; padding-right:0; }

@media (max-width:480px){
  /* Text card grid: one across on phones. */
  .ach-grid{ grid-template-columns:minmax(0,1fr); }
  .ach-chip-row.chip-row{ flex-wrap:nowrap; overflow-x:auto; padding:2px 2px 6px; flex-basis:100%; }
  .ach-chip-row .ach-chip.fchip{ white-space:nowrap; }
}
@media (prefers-reduced-motion: reduce){
  .ach-card{ transition:none; }
  .ach-card:has(.ach-card-trigger:not(.ach-card-trigger--inert)):hover{ transform:none; }
}
.modal-paper .ach-modal-header{ padding-right:38px; }
