/* ============================================================
   Akalavolo — Compositions PvP  (page + teaser)
   Adapté de la maquette Claude Design. v1 « honnête » :
   pas de filtre cote, pas de tendance, pas de matrice (données absentes
   de la source). Voir /opt/akalavolo/compos/compos-investigation.md.
   ============================================================ */

.ak-cp {
  --ak-bg: #1a1a26;
  --ak-bg-2: #232334;
  --ak-bg-3: #2b2b3f;
  --ak-bg-4: #353550;
  --ak-border: #3a3a55;
  --ak-border-soft: #2f2f44;

  --ak-text: #e8e8f0;
  --ak-text-muted: #a8a8be;
  --ak-text-dim: #7c7c95;

  --ak-gold: #D4A017;
  --ak-gold-bright: #FCEB88;
  --ak-gold-deep: #b88a35;
  --ak-gold-glow: rgba(227, 182, 90, 0.18);

  --win-good: #4ade80;
  --win-neutral: #ffd957;
  --win-bad: #f87171;

  --r-sm: 4px; --r-md: 8px; --r-lg: 12px;

  --ak-font-display: 'Cinzel', Georgia, serif;
  --ak-font-body: 'Merriweather Sans', -apple-system, sans-serif;
  --ak-font-mono: 'JetBrains Mono', 'Consolas', monospace;

  font-family: var(--ak-font-body);
  color: var(--ak-text);
}
.ak-cp *, .ak-cp *::before, .ak-cp *::after { box-sizing: border-box; }
.ak-cp a { color: inherit; text-decoration: none; }
.ak-cp button { font: inherit; cursor: pointer; border: none; background: none; }
/* .ak-cp h1, .ak-cp h2 { margin: 0; font-family: var(--ak-font-display); font-weight: 700; letter-spacing: 0.02em; } */

/* ---- Couleurs de classe ---- */
.ak-cp .class-death-knight { --class-color: var(--color-death-knight); }
.ak-cp .class-demon-hunter { --class-color: var(--color-demon-hunter); }
.ak-cp .class-druid        { --class-color: var(--color-druid); }
.ak-cp .class-evoker       { --class-color: var(--color-evoker); }
.ak-cp .class-hunter       { --class-color: var(--color-hunter); }
.ak-cp .class-mage         { --class-color: var(--color-mage); }
.ak-cp .class-monk         { --class-color: var(--color-monk); }
.ak-cp .class-paladin      { --class-color: var(--color-paladin); }
.ak-cp .class-priest       { --class-color: #C9C9D4; }
.ak-cp .class-rogue        { --class-color: var(--color-rogue); }
.ak-cp .class-shaman       { --class-color: var(--color-shaman); }
.ak-cp .class-warlock      { --class-color: var(--color-warlock); }
.ak-cp .class-warrior      { --class-color: #C69B6D; }

/* ============================================================ PAGE */
.ak-cp-page { max-width: 1180px; margin: 0 auto; padding: 8px 0 64px; position: relative; }

.ak-cp-header { margin-bottom: 24px; }
.ak-cp-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ak-gold-deep); font-weight: 600; margin-bottom: 12px;
}
.ak-cp-eyebrow-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ak-gold); box-shadow: 0 0 10px var(--ak-gold); }
.ak-cp-title { font-family: var(--ak-font-display); font-size: 40px; line-height: 1.05; margin: 0 0 12px; }
.ak-cp-title-gold {
  background: linear-gradient(135deg, var(--ak-gold-bright) 0%, var(--ak-gold-deep) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.ak-cp-lead { font-size: 15px; line-height: 1.6; color: var(--ak-text-muted); max-width: 720px; margin: 0; }
.ak-cp-lead strong { color: var(--ak-text); }
.ak-cp-backlink {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 16px;
  font-size: 12px; font-weight: 700; color: var(--ak-gold-deep); transition: gap .15s, color .15s;
}
.ak-cp-backlink:hover { color: var(--ak-gold); gap: 11px; }

/* ============================================================ FILTERS */
.ak-cp-filters { margin: 28px 0 8px; background: var(--ak-bg-2); border: 1px solid var(--ak-border); border-radius: var(--r-lg); }
.ak-cp-filter-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px;
  padding: 16px 20px; border-bottom: 1px solid var(--ak-border-soft);
}
.ak-cp-filter-row:last-child { border-bottom: none; }
.ak-cp-filter-group { display: flex; align-items: center; gap: 12px; }
.ak-cp-filter-label { font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ak-text-dim); font-weight: 700; }

.ak-cp-seg { display: inline-flex; background: var(--ak-bg); border: 1px solid var(--ak-border); border-radius: var(--r-md); padding: 3px; gap: 1px; }
.ak-cp-seg-btn {
  padding: 8px 16px; border-radius: var(--r-sm); color: var(--ak-text-dim);
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; transition: all .12s;
}
.ak-cp-seg-btn:hover { color: var(--ak-text-muted); background: rgba(255,255,255,0.03); }
.ak-cp-seg-btn[aria-pressed="true"] { background: var(--ak-bg-4); color: var(--ak-gold-bright); box-shadow: 0 1px 4px rgba(0,0,0,0.3); }
.ak-cp-seg.is-gold .ak-cp-seg-btn[aria-pressed="true"] { background: var(--ak-gold); color: var(--ak-bg); }

/* Toggle « Masquer échantillon faible » (case à cocher, active par défaut) */
.ak-cp-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px; border: 1px solid var(--ak-border); border-radius: var(--r-md);
  background: var(--ak-bg); color: var(--ak-text-dim);
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; transition: all .12s;
}
.ak-cp-toggle:hover { border-color: var(--ak-gold-deep); color: var(--ak-text-muted); }
.ak-cp-toggle[aria-pressed="true"] { color: var(--ak-text); border-color: var(--ak-gold-deep); }
.ak-cp-toggle-box {
  width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--ak-border);
  display: grid; place-items: center; flex-shrink: 0;
}
.ak-cp-toggle[aria-pressed="true"] .ak-cp-toggle-box { background: var(--ak-gold); border-color: var(--ak-gold); }
.ak-cp-toggle[aria-pressed="true"] .ak-cp-toggle-box::after { content: "✓"; font-size: 10px; line-height: 1; color: var(--ak-bg); }

.ak-cp-specfilter { flex: 1; min-width: 280px; }
.ak-cp-specfilter-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.ak-cp-specfilter-clear { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; color: var(--ak-gold-deep); }
.ak-cp-specfilter-clear:hover { color: var(--ak-gold); }
.ak-cp-specfilter-clear[hidden] { display: none; }
.ak-cp-specfilter-foot { margin: 10px 0 0; font-size: 11px; color: var(--ak-text-dim); }
.ak-cp-slots { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.ak-cp-slot { position: relative; }
.ak-cp-slot-btn {
  display: inline-flex; align-items: center; gap: 9px; min-width: 190px; max-width: 240px;
  padding: 8px 11px; background: var(--ak-bg); border: 1px solid var(--ak-border);
  border-radius: var(--r-md); color: var(--ak-text-muted); font-size: 12px; font-weight: 600; transition: border-color .15s;
}
.ak-cp-slot-btn:hover { border-color: var(--ak-gold-deep); }
.ak-cp-slot-btn[aria-expanded="true"] { border-color: var(--ak-gold); }
.ak-cp-slot.is-filled .ak-cp-slot-btn { border-color: color-mix(in oklab, var(--class-color) 55%, var(--ak-border)); }
.ak-cp-slot-num {
  font-family: var(--ak-font-mono); font-size: 9px; font-weight: 700; color: var(--ak-text-dim);
  width: 16px; height: 16px; border-radius: 4px; background: var(--ak-bg-3); display: grid; place-items: center; flex-shrink: 0;
}
.ak-cp-slot.is-filled .ak-cp-slot-num { background: var(--class-color); color: rgba(0,0,0,0.6); }
.ak-cp-slot-placeholder { color: var(--ak-text-dim); flex: 1; }
.ak-cp-slot-tag { display: inline-flex; align-items: center; gap: 7px; flex: 1; min-width: 0; color: var(--class-color); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ak-cp-slot-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--class-color); flex-shrink: 0; }
.ak-cp-slot-caret { color: var(--ak-text-dim); font-size: 10px; margin-left: auto; flex-shrink: 0; }

.ak-cp-slot-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; width: 264px; max-height: 340px;
  display: flex; flex-direction: column; background: var(--ak-bg-3); border: 1px solid var(--ak-border);
  border-radius: var(--r-md); box-shadow: 0 20px 44px -18px rgba(0,0,0,0.75); overflow: hidden;
}
.ak-cp-slot-menu[hidden] { display: none; }
.ak-cp-slot-search { margin: 8px; padding: 8px 10px; background: var(--ak-bg); border: 1px solid var(--ak-border); border-radius: var(--r-sm); color: var(--ak-text); font-size: 12px; }
.ak-cp-slot-search:focus { outline: none; border-color: var(--ak-gold-deep); }
.ak-cp-slot-list { overflow-y: auto; padding: 0 6px 8px; }
.ak-cp-slot-group.is-hidden { display: none; }
.ak-cp-slot-grouphead { font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ak-text-dim); font-weight: 700; padding: 9px 8px 4px; position: sticky; top: 0; background: var(--ak-bg-3); }
.ak-cp-slot-opt { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 8px; border-radius: var(--r-sm); color: var(--ak-text-muted); font-size: 12px; text-align: left; transition: background .1s, color .1s; }
.ak-cp-slot-opt:hover { background: var(--ak-bg-4); color: var(--ak-text); }
.ak-cp-slot-opt[aria-selected="true"] { color: var(--ak-gold-bright); background: var(--ak-gold-glow); }
.ak-cp-slot-opt.is-hidden { display: none; }
.ak-cp-slot-opt-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--class-color, #777); flex-shrink: 0; }
.ak-cp-slot-opt.is-clear { color: var(--ak-text-dim); margin: 0 2px 4px; border-bottom: 1px solid var(--ak-border-soft); border-radius: 0; }
.ak-cp-slot-opt.is-clear:hover { color: var(--ak-gold); background: transparent; }

.ak-cp-counter { font-family: var(--ak-font-mono); font-size: 11px; color: var(--ak-text-dim); margin-left: auto; white-space: nowrap; }
.ak-cp-counter strong { color: var(--ak-gold); }

/* ============================================================ SECTION */
.ak-cp-section { margin-top: 36px; }
.ak-cp-section-header { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; margin-bottom: 16px; flex-wrap: wrap; }
/* .ak-cp-section-title { font-size: 24px; color: var(--ak-text); } */
.ak-cp-section-mark { color: var(--ak-gold); font-style: normal; }
.ak-cp-section-rule { height: 1px; margin-bottom: 20px; background: linear-gradient(90deg, var(--ak-gold-deep) 0%, var(--ak-border-soft) 30%, transparent 100%); }
.ak-cp-sort { display: inline-flex; align-items: center; gap: 8px; }
.ak-cp-sort-label { font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ak-text-dim); font-weight: 700; }

/* ============================================================ CARDS */
.ak-cp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; }
.ak-cp-card {
  position: relative; display: grid; grid-template-columns: 52px 1fr;
  background: var(--ak-bg-2); border: 1px solid var(--ak-border-soft); border-radius: var(--r-lg);
  overflow: hidden; transition: border-color .15s, transform .12s;
}
.ak-cp-card:hover { border-color: var(--ak-gold-deep); transform: translateY(-2px); }
.ak-cp-card.is-low { opacity: 0.55; }
.ak-cp-card.is-low:hover { opacity: 0.85; }

.ak-cp-rank { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: var(--ak-bg-3); border-right: 1px solid var(--ak-border-soft); }
.ak-cp-rank-num { font-family: var(--ak-font-display); font-size: 20px; font-weight: 700; color: var(--ak-gold); line-height: 1; }
.ak-cp-rank-hash { font-family: var(--ak-font-mono); font-size: 9px; color: var(--ak-text-dim); }

.ak-cp-card-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.ak-cp-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ak-cp-card-head-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.ak-cp-card-name { font-family: var(--ak-font-display); font-size: 14px; font-weight: 600; color: var(--ak-text); letter-spacing: 0.02em; }

.ak-cp-specs { display: flex; flex-wrap: wrap; gap: 6px; }
.ak-cp-spec {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px 5px 5px;
  background: var(--ak-bg); border: 1px solid color-mix(in oklab, var(--class-color) 45%, var(--ak-border));
  border-radius: var(--r-sm); font-size: 11px; font-weight: 700; color: var(--class-color); white-space: nowrap;
}
.ak-cp-spec-icon { width: 20px; height: 20px; border-radius: 3px; background: var(--class-color); display: grid; place-items: center; flex-shrink: 0; overflow: hidden; }
.ak-cp-spec-icon.has-img { background: transparent; }
.ak-cp-spec-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ak-cp-spec-glyph { font-family: var(--ak-font-display); font-size: 9px; color: rgba(0,0,0,0.6); font-weight: 700; }

.ak-cp-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: end; }
.ak-cp-stat-label { font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ak-text-dim); font-weight: 700; margin-bottom: 5px; }
.ak-cp-stat-top { display: flex; align-items: baseline; gap: 6px; margin-bottom: 6px; }
.ak-cp-stat-value { font-family: var(--ak-font-mono); font-size: 20px; font-weight: 700; color: var(--ak-text); line-height: 1; }
.ak-cp-stat-value.win-good { color: var(--win-good); }
.ak-cp-stat-value.win-bad { color: var(--win-bad); }
.ak-cp-stat-value.win-neutral { color: var(--win-neutral); }
.ak-cp-stat-unit { font-size: 11px; color: var(--ak-text-dim); }

.ak-cp-bar { height: 5px; background: var(--ak-bg-4); border-radius: 3px; overflow: hidden; position: relative; }
.ak-cp-bar-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; width: var(--pct, 50%); }
.ak-cp-bar-fill.win-good { background: var(--win-good); }
.ak-cp-bar-fill.win-bad { background: var(--win-bad); }
.ak-cp-bar-fill.win-neutral { background: var(--win-neutral); }
.ak-cp-bar-fill.gold { background: linear-gradient(90deg, var(--ak-gold-deep), var(--ak-gold)); }
.ak-cp-bar.is-winrate::after { content: ""; position: absolute; left: 50%; top: -1px; bottom: -1px; width: 1px; background: rgba(255,255,255,0.25); }

.ak-cp-lowbadge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px;
  background: rgba(248,113,113,0.12); border: 1px solid rgba(248,113,113,0.35); color: var(--win-bad);
  font-size: 9px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
}

.ak-cp-empty { display: none; padding: 48px 32px; text-align: center; background: var(--ak-bg-2); border: 1px dashed var(--ak-border); border-radius: var(--r-lg); color: var(--ak-text-dim); font-style: italic; }
.ak-cp-grid.is-empty { display: none; }
.ak-cp-grid.is-empty + .ak-cp-empty { display: block; }

/* ============================================================ METHOD */
.ak-cp-method {
  margin-top: 40px; display: flex; gap: 16px; align-items: flex-start; padding: 20px 22px;
  background: var(--ak-bg-2); border: 1px solid var(--ak-border-soft); border-left: 3px solid var(--ak-gold-deep); border-radius: var(--r-md);
}
.ak-cp-method-icon { width: 32px; height: 32px; flex-shrink: 0; border-radius: var(--r-sm); background: var(--ak-bg-4); display: grid; place-items: center; color: var(--ak-gold); font-size: 16px; }
.ak-cp-method-title { font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ak-gold-deep); font-weight: 700; margin-bottom: 8px; }
.ak-cp-method p { margin: 0; font-size: 13px; line-height: 1.65; color: var(--ak-text-muted); }
.ak-cp-method strong { color: var(--ak-text); }
.ak-cp-method a { color: var(--ak-gold); text-decoration: underline; text-underline-offset: 3px; }
.ak-cp-credit { margin-top: 10px !important; font-size: 11px !important; color: var(--ak-text-dim) !important; }

/* ============================================================ TEASER (page tier list / accueil) */
.ak-cp-teaser { background: var(--ak-bg-2); border: 1px solid var(--ak-border); border-radius: var(--r-lg); padding: 16px 18px; }
.ak-cp-teaser-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.ak-cp-teaser-title { font-family: var(--ak-font-display); font-size: 16px; color: var(--ak-text); }
.ak-cp-teaser-link { font-size: 11px; font-weight: 700; color: var(--ak-gold-deep); }
.ak-cp-teaser-link:hover { color: var(--ak-gold); }
.ak-cp-teaser-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--ak-border-soft); }
.ak-cp-teaser-rank { font-family: var(--ak-font-display); font-size: 14px; font-weight: 700; color: var(--ak-gold); width: 22px; flex-shrink: 0; }
.ak-cp-teaser-specs { display: flex; gap: 3px; flex-shrink: 0; }
.ak-cp-teaser-specs i { width: 12px; height: 12px; border-radius: 3px; background: var(--class-color, #777); display: block; }
.ak-cp-teaser-name { font-size: 12px; color: var(--ak-text-muted); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ak-cp-teaser-wr { font-family: var(--ak-font-mono); font-size: 12px; font-weight: 700; }
.ak-cp-teaser-wr.win-good { color: var(--win-good); }
.ak-cp-teaser-wr.win-bad { color: var(--win-bad); }
.ak-cp-teaser-wr.win-neutral { color: var(--win-neutral); }

/* ============================================================ RESPONSIVE */
@media (max-width: 900px) {
  .ak-cp-title { font-size: 30px; }
  .ak-cp-grid { grid-template-columns: 1fr; }
  .ak-cp-counter { margin-left: 0; width: 100%; }
}
@media (max-width: 600px) {
  .ak-cp-filter-row { flex-direction: column; align-items: stretch; }
  .ak-cp-filter-group { flex-wrap: wrap; }
  .ak-cp-seg { width: 100%; }
  .ak-cp-seg-btn { flex: 1; text-align: center; padding: 8px 6px; }
  .ak-cp-section-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .ak-cp-stats { grid-template-columns: 1fr; }
}
