/* =============================================================
   RigarduMás Core — Catalogue CSS
   Design system unifié avec player card (Syne + DM Sans)
   ============================================================= */

/* ── Variables ── */
.rgd-catalogue {
  --bg:       #0A0A0F;
  --surface:  #1E1E28;
  --surface2: #252530;
  --border:   rgba(255,255,255,0.07);
  --text:     #F0F0F5;
  --muted:    rgba(240,240,245,0.55);
  --dim:      rgba(240,240,245,0.28);
  --accent:   #FF3B6B;
  --accent2:  #FF7A3B;
  --green:    #2ECC8A;
  --yellow:   #FFD166;
  --blue:     #4A8EFF;
  --card-w:   160px;
  --card-h:   96px;
  --radius:   10px;
  --ease:     cubic-bezier(0.4,0,0.2,1);
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  background: var(--bg);
  border-radius: 16px;
  overflow: hidden;
}

/* ── Hero ── */
.rgd-cat__hero {
  position: relative;
  min-height: 300px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.rgd-cat__hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 60% 30%, rgba(255,59,107,.12) 0%, transparent 70%),
    radial-gradient(ellipse 50% 50% at 20% 80%, rgba(74,142,255,.08) 0%, transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, #0D0D18 100%);
}

.rgd-cat__hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: linear-gradient(180deg, transparent 0%, rgba(0,0,0,.5) 40%, transparent 100%);
}

.rgd-cat__hero-content {
  position: relative;
  z-index: 2;
  padding: 0 36px 40px;
}

.rgd-cat__eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.rgd-cat__title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -1.5px;
  margin-bottom: 12px;
}

.rgd-cat__title em {
  font-style: normal;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.rgd-cat__subtitle {
  font-size: 14px;
  color: var(--muted);
  font-weight: 300;
  max-width: 460px;
  line-height: 1.6;
  margin-bottom: 22px;
}

.rgd-cat__stats {
  display: flex;
  gap: 24px;
}

.rgd-cat__stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rgd-cat__stat-num {
  font-family: 'Syne', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.rgd-cat__stat-label {
  font-size: 10px;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ── Filtres ── */
.rgd-cat__filterbar {
  display: flex;
  gap: 6px;
  padding: 16px 36px 12px;
  overflow-x: auto;
  scrollbar-width: none;
  background: rgba(10,10,15,.8);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
}
.rgd-cat__filterbar::-webkit-scrollbar { display: none; }

.rgd-cat__filter {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s var(--ease);
  white-space: nowrap;
}
.rgd-cat__filter:hover  { border-color: rgba(255,255,255,.15); color: var(--text); background: var(--surface); }
.rgd-cat__filter.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

/* ── Géo banner ── */
.rgd-cat__geo-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 36px 0;
  padding: 12px 16px;
  background: rgba(74,142,255,.07);
  border: 1px solid rgba(74,142,255,.15);
  border-radius: 10px;
  font-size: 13px;
}

.rgd-cat__geo-icon { font-size: 20px; flex-shrink: 0; }

.rgd-cat__geo-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rgd-cat__geo-text strong { color: var(--text); font-size: 13px; }
.rgd-cat__geo-text span   { color: var(--muted); font-size: 12px; }

.rgd-cat__geo-close {
  background: none; border: none;
  color: var(--dim); cursor: pointer;
  font-size: 18px; padding: 4px; flex-shrink: 0;
}

/* ── Loading ── */
.rgd-cat__loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 40px 36px;
  color: var(--muted);
  font-size: 14px;
}

.rgd-cat__spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: rgd-spin .8s linear infinite;
  flex-shrink: 0;
}
@keyframes rgd-spin { to { transform: rotate(360deg); } }

/* ── Sections ── */
.rgd-cat__section {
  margin-bottom: 4px;
  animation: rgd-fadeup .4s var(--ease) both;
}
@keyframes rgd-fadeup {
  from { opacity:0; transform:translateY(16px); }
  to   { opacity:1; transform:translateY(0); }
}

.rgd-cat__section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 36px 12px;
}

.rgd-cat__section-title {
  font-family: 'Syne', sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.rgd-cat__section-count {
  font-size: 12px;
  font-weight: 400;
  color: var(--dim);
  font-family: 'DM Sans', sans-serif;
  margin-left: 2px;
}

.rgd-cat__section-more {
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
  cursor: pointer;
  opacity: 0;
  transition: opacity .2s;
}
.rgd-cat__section:hover .rgd-cat__section-more { opacity: 1; }

/* ── Rangée scrollable ── */
.rgd-cat__row-wrap { position: relative; }

.rgd-cat__row {
  display: flex;
  gap: 10px;
  padding: 4px 36px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}
.rgd-cat__row::-webkit-scrollbar { display: none; }

.rgd-cat__arrow {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(30,30,40,.92);
  border: 1px solid var(--border);
  color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 10;
  font-size: 14px;
  opacity: 0;
  transition: opacity .2s;
  backdrop-filter: blur(8px);
  user-select: none;
}
.rgd-cat__row-wrap:hover .rgd-cat__arrow { opacity: 1; }
.rgd-cat__arrow:hover { color: var(--text); background: var(--surface2); }
.rgd-cat__arrow--left  { left: 8px; }
.rgd-cat__arrow--right { right: 8px; }

/* ── Card chaîne ── */
.rgd-cat__card {
  flex-shrink: 0;
  width: var(--card-w);
  height: var(--card-h);
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  position: relative;
  cursor: pointer;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-decoration: none;
  color: inherit;
}

.rgd-cat__card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.03) 0%, transparent 60%);
  pointer-events: none;
}

.rgd-cat__card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 16px 40px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.09);
  border-color: rgba(255,255,255,.12);
  z-index: 10;
}
.rgd-cat__card:hover .rgd-cat__card-glow { opacity: 1; }

.rgd-cat__card-glow {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,59,107,.07) 0%, transparent 60%);
  opacity: 0;
  transition: opacity .18s;
  pointer-events: none;
}

/* Logo (texte placeholder si pas d'image) */
.rgd-cat__card-logo {
  width: 80px; height: 40px;
  object-fit: contain;
  display: block;
}

.rgd-cat__card-name-placeholder {
  width: 80px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 12px;
  color: var(--text);
  letter-spacing: -.3px;
  text-align: center;
  line-height: 1.2;
  padding: 0 6px;
}

.rgd-cat__card-cat {
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  padding: 0 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  transition: color .15s;
}
.rgd-cat__card:hover .rgd-cat__card-cat { color: var(--text); }

/* Geo dot */
.rgd-cat__card-geo {
  position: absolute; top: 6px; right: 6px;
  width: 7px; height: 7px; border-radius: 50%;
}
.rgd-cat__card-geo--green { background: var(--green); box-shadow: 0 0 5px var(--green); }
.rgd-cat__card-geo--red   { background: var(--accent); box-shadow: 0 0 5px var(--accent); }
.rgd-cat__card-geo--dim   { background: var(--dim); }

/* Tier badge */
.rgd-cat__tier-badge {
  position: absolute; top: 6px; left: 6px;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.rgd-tier--free    { background: rgba(46,204,138,.14); color: var(--green); border: 1px solid rgba(46,204,138,.2); }
.rgd-tier--premium { background: rgba(255,209,102,.10); color: var(--yellow); border: 1px solid rgba(255,209,102,.2); }

/* Replay indicator */
.rgd-cat__card-replay {
  position: absolute; bottom: 5px; right: 6px;
  font-size: 8px; font-weight: 600;
  color: var(--blue); letter-spacing: .5px;
}

/* ── Tooltip card ── */
.rgd-cat__card-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%; transform: translateX(-50%);
  width: 200px;
  background: var(--surface2);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  padding: 12px 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s;
  z-index: 100;
  box-shadow: 0 12px 32px rgba(0,0,0,.6);
}
.rgd-cat__card:hover .rgd-cat__card-tooltip { opacity: 1; pointer-events: auto; }

.rgd-cat__tooltip-name {
  font-family: 'Syne', sans-serif;
  font-size: 13px; font-weight: 700;
  color: var(--text); margin-bottom: 4px;
}
.rgd-cat__tooltip-meta {
  font-size: 11px; color: var(--muted);
  margin-bottom: 8px; line-height: 1.5;
}
.rgd-cat__tooltip-actions {
  display: flex; gap: 6px;
}
.rgd-cat__tooltip-btn {
  flex: 1; padding: 6px 0;
  border-radius: 6px; border: none;
  font-size: 10px; font-weight: 700;
  cursor: pointer; font-family: 'DM Sans', sans-serif;
  text-align: center; text-decoration: none;
  display: flex; align-items: center; justify-content: center;
}
.rgd-cat__tooltip-btn--primary {
  background: var(--accent); color: #fff;
}
.rgd-cat__tooltip-btn--secondary {
  background: var(--surface); color: var(--muted);
  border: 1px solid var(--border);
}
.rgd-cat__tooltip-btn--disabled {
  background: var(--surface); color: var(--dim);
  border: 1px solid var(--border);
  cursor: default; opacity: .5;
}

/* ── Divider ── */
.rgd-cat__divider {
  height: 1px;
  background: linear-gradient(90deg, transparent 36px, var(--border) 36px, var(--border) calc(100% - 36px), transparent calc(100% - 36px));
  margin: 4px 0;
}

/* ── Légende ── */
.rgd-cat__legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 16px 36px 24px;
  margin-top: 8px;
  border-top: 1px solid var(--border);
}
.rgd-cat__legend-label {
  font-size: 10px; color: var(--dim);
  text-transform: uppercase; letter-spacing: 1px;
  margin-right: 2px;
}
.rgd-cat__legend-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--muted);
}

.rgd-dot {
  display: inline-block;
  width: 7px; height: 7px; border-radius: 50%;
  flex-shrink: 0;
}
.rgd-dot--green { background: var(--green); box-shadow: 0 0 5px var(--green); }
.rgd-dot--red   { background: var(--accent); box-shadow: 0 0 5px var(--accent); }
.rgd-dot--dim   { background: var(--dim); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .rgd-cat__hero-content { padding: 0 20px 28px; }
  .rgd-cat__filterbar    { padding: 12px 20px 10px; }
  .rgd-cat__geo-banner   { margin: 12px 20px 0; }
  .rgd-cat__section-header { padding: 18px 20px 10px; }
  .rgd-cat__row          { padding: 4px 20px 12px; }
  .rgd-cat__legend       { padding: 14px 20px 20px; }
  :root { --card-w: 130px; --card-h: 80px; }
}

/* Animations décalées par section */
.rgd-cat__section:nth-child(1)  { animation-delay: .05s; }
.rgd-cat__section:nth-child(2)  { animation-delay: .10s; }
.rgd-cat__section:nth-child(3)  { animation-delay: .15s; }
.rgd-cat__section:nth-child(4)  { animation-delay: .20s; }
.rgd-cat__section:nth-child(5)  { animation-delay: .25s; }
.rgd-cat__section:nth-child(6)  { animation-delay: .30s; }
.rgd-cat__section:nth-child(7)  { animation-delay: .35s; }
.rgd-cat__section:nth-child(8)  { animation-delay: .40s; }
.rgd-cat__section:nth-child(9)  { animation-delay: .45s; }
.rgd-cat__section:nth-child(10) { animation-delay: .50s; }
