/* ==========================================================================
   Asobi — styles
   ========================================================================== */

:root {
  --bg: #06070b;
  --bg-2: #0b0d15;
  --panel: rgba(255, 255, 255, .035);
  --panel-2: rgba(255, 255, 255, .065);
  --panel-solid: #10131c;
  --panel-solid-2: #161a26;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .14);
  --text: #eef1f8;
  --muted: #8a92a6;
  --dim: #5d6578;
  --accent: #8b5cf6;
  --accent-2: #22d3ee;
  --accent-3: #f472b6;
  --good: #34d399;
  --warn: #fbbf24;
  --bad: #fb7185;
  --grad: linear-gradient(135deg, #8b5cf6, #22d3ee);
  --radius: 14px;
  --radius-lg: 22px;
  --sidebar: 236px;
  --gutter: clamp(16px, 3.2vw, 40px);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --font-display: "Unbounded", system-ui, sans-serif;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.modal-open { overflow: hidden; }
img { display: block; max-width: 100%; }
svg { fill: currentColor; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; border-radius: 8px; }
::selection { background: rgba(139, 92, 246, .45); }

.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Fond animé ---------- */

.backdrop { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }

.backdrop .blob {
  position: absolute;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .16;
  animation: drift 26s ease-in-out infinite alternate;
}

.backdrop .blob:nth-child(1) { background: #7c3aed; top: -30vmax; left: -15vmax; }
.backdrop .blob:nth-child(2) { background: #0891b2; top: -20vmax; right: -25vmax; animation-delay: -9s; }
.backdrop .blob:nth-child(3) { background: #be185d; bottom: -40vmax; left: 20vmax; opacity: .09; animation-delay: -16s; }

@keyframes drift {
  50% { transform: translate(6vmax, 4vmax) scale(1.08); }
  100% { transform: translate(-4vmax, 7vmax) scale(.95); }
}

.ambient {
  position: absolute;
  inset: -10%;
  background-size: cover;
  background-position: center;
  filter: blur(80px) saturate(1.5);
  opacity: 0;
  transform: scale(1.1);
  transition: opacity 1.4s ease;
}

.ambient.is-visible { opacity: .2; }

.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top, transparent 0%, var(--bg) 75%);
}

/* ---------- Mise en page ---------- */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: var(--sidebar);
  padding: 22px 14px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10, 12, 19, .92), rgba(8, 9, 14, .86));
  backdrop-filter: blur(18px);
}

.logo {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 8px 22px;
  font: 700 17px/1 var(--font-display);
  letter-spacing: .01em;
}

.logo-mark {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 6px 16px rgba(139, 92, 246, .55));
  transition: transform .5s var(--spring);
}

/* La cartouche du logo « s'enfonce » dans la console au survol */
.logo:hover .logo-mark { transform: translateY(3px) rotate(-6deg) scale(1.06); }

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  color: var(--muted);
  font-weight: 600;
  transition: color .2s, background .2s;
}

.nav-link svg { width: 20px; flex: none; }
.nav-link:hover { color: var(--text); background: var(--panel); }

.nav-link.is-active {
  color: #fff;
  background: linear-gradient(90deg, rgba(139, 92, 246, .22), rgba(34, 211, 238, .06));
  box-shadow: inset 0 0 0 1px rgba(139, 92, 246, .3);
}

.nav-link.is-active::before {
  content: "";
  position: absolute;
  left: -14px;
  width: 4px;
  height: 22px;
  border-radius: 0 4px 4px 0;
  background: var(--grad);
}

.nav-count {
  margin-left: auto;
  min-width: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12px;
  line-height: 20px;
  text-align: center;
}

.sidebar-foot { margin-top: auto; display: grid; gap: 10px; }

.app {
  margin-left: var(--sidebar);
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px var(--gutter);
  background: linear-gradient(to bottom, rgba(6, 7, 11, .94), rgba(6, 7, 11, .6));
  backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}

.topbar.is-scrolled { border-bottom-color: var(--line); }

.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.crumbs a:hover { color: var(--text); }
.crumbs .sep { opacity: .4; }
.crumbs strong { color: var(--text); overflow: hidden; text-overflow: ellipsis; }

.view {
  padding: 8px var(--gutter) 80px;
  animation: view-in .55s var(--ease) both;
}

@keyframes view-in { from { opacity: 0; transform: translateY(14px); } }

.tabbar { display: none; }

/* ---------- Boutons, champs ---------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: none;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  overflow: hidden;
  transition: transform .2s var(--ease), box-shadow .3s, background .2s, border-color .2s, opacity .2s;
}

.btn svg { width: 18px; flex: none; }
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .5; cursor: default; }

.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 26px -10px rgba(139, 92, 246, .9); }
.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform .7s var(--ease);
}
.btn-primary:hover::after { transform: translateX(120%); }

.btn-ghost { background: var(--panel); border-color: var(--line); }
.btn-ghost:hover { background: var(--panel-2); border-color: var(--line-2); }
.btn-danger { color: var(--bad); border-color: rgba(251, 113, 133, .3); background: rgba(251, 113, 133, .06); }
.btn-danger:hover { background: rgba(251, 113, 133, .14); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(10, 11, 18, .6);
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: background .2s, transform .3s var(--spring), color .2s, border-color .2s;
}

.icon-btn svg { width: 19px; }
.icon-btn:hover { background: var(--panel-2); }
.icon-btn.is-on { color: var(--warn); border-color: rgba(251, 191, 36, .4); background: rgba(251, 191, 36, .1); }

.input, .select, .textarea {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--panel-solid-2);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.textarea { height: auto; min-height: 120px; padding: 12px 14px; resize: vertical; line-height: 1.6; }
.select { appearance: none; padding-right: 36px; cursor: pointer; background: var(--panel-solid-2) url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%238a92a6'><path d='M7 10l5 5 5-5z'/></svg>") no-repeat right 10px center / 18px; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(139, 92, 246, .18); }
.input::placeholder, .textarea::placeholder { color: var(--dim); }

.field { display: grid; gap: 8px; margin: 0 0 16px; padding: 0; border: 0; }
.field > span, .field > legend, .field > label { padding: 0; font-weight: 600; font-size: 14px; }
.field small { color: var(--muted); font-weight: 400; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s, transform .3s var(--spring);
}

.chip:hover { color: var(--text); border-color: var(--line-2); background: var(--panel-2); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--accent)); box-shadow: 0 0 10px var(--c, var(--accent)); }
.chip.is-on, .chip[aria-pressed="true"] { color: #fff; background: color-mix(in srgb, var(--c, var(--accent)) 26%, transparent); border-color: color-mix(in srgb, var(--c, var(--accent)) 70%, transparent); }
.chip-count { opacity: .7; font-weight: 500; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--c, #888) 20%, rgba(10, 11, 18, .7));
  border: 1px solid color-mix(in srgb, var(--c, #888) 55%, transparent);
  font: 600 12px/1.4 var(--font);
  white-space: nowrap;
}

.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c, #888); box-shadow: 0 0 10px var(--c, #888); }

.tag { padding: 4px 10px; border-radius: 999px; background: var(--panel-2); font-size: 13px; }

/* Contrôle segmenté (statut) */
.segmented {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.segmented button {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: color .2s, background .25s, box-shadow .25s;
}

.segmented button:hover { color: var(--text); }
.segmented button[aria-pressed="true"] {
  color: #fff;
  background: color-mix(in srgb, var(--c) 28%, var(--panel-solid-2));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 60%, transparent), 0 6px 20px -8px var(--c);
}

/* ---------- Recherche du haut ---------- */

.search { position: relative; flex: 1; max-width: 520px; margin-left: auto; }
.search > svg { position: absolute; left: 13px; top: 50%; width: 18px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search .input { height: 42px; padding-left: 40px; padding-right: 44px; background: rgba(255, 255, 255, .04); border-color: var(--line); }
.search kbd {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  padding: 1px 7px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  color: var(--muted);
  font: 12px var(--font);
}
.search .input:focus ~ kbd, .search .input:not(:placeholder-shown) ~ kbd { opacity: 0; }

.suggest {
  margin: 8px 0 0;
  padding: 6px;
  list-style: none;
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: rgba(20, 23, 34, .97);
  backdrop-filter: blur(14px);
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, .85);
  scrollbar-width: thin;
  animation: drop .25s var(--ease) both;
}

.search .suggest { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 60; margin: 0; }

@keyframes drop { from { opacity: 0; transform: translateY(-6px); } }
@keyframes slide-in { from { opacity: 0; transform: translateY(6px); } }

.suggest-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px;
  border-radius: 10px;
  cursor: pointer;
  animation: slide-in .3s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 28ms);
}

.suggest-item:hover, .suggest-item.is-active { background: rgba(255, 255, 255, .08); }
.suggest-item.is-active { box-shadow: inset 3px 0 0 var(--accent); }
.suggest-cover { display: grid; place-items: center; flex: none; width: 36px; height: 48px; border-radius: 6px; object-fit: cover; background: var(--panel-solid-2); color: var(--accent-2); font-size: 20px; }
.suggest-text { flex: 1; min-width: 0; }
.suggest-text strong { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest-text small { color: var(--muted); font-size: 12px; }
.suggest-text mark { background: none; color: var(--accent-2); }
.suggest-tag { flex: none; padding: 2px 8px; border-radius: 999px; background: rgba(139, 92, 246, .18); color: #cdbcff; font-size: 11px; white-space: nowrap; }
.suggest-empty { padding: 10px; color: var(--muted); font-size: 13px; }
.suggest-add { border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; margin-top: 4px; }

/* ---------- Modales, notifications ---------- */

.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(3, 4, 8, .74); backdrop-filter: blur(10px); animation: fade .3s ease both; }
.modal.is-closing .modal-backdrop { animation: fade .25s ease reverse both; }
@keyframes fade { from { opacity: 0; } }

.modal-panel {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 26px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  background: var(--panel-solid);
  box-shadow: 0 40px 100px -20px rgba(0, 0, 0, .9);
  animation: pop .5s var(--spring) both;
  scrollbar-width: thin;
}

.modal.is-closing .modal-panel { animation: pop-out .22s ease-in both; }
@keyframes pop { from { opacity: 0; transform: translateY(26px) scale(.95); } }
@keyframes pop-out { to { opacity: 0; transform: translateY(14px) scale(.97); } }

.modal-panel h2 { margin: 0 0 4px; font: 700 22px/1.2 var(--font-display); }
.modal-lead { margin: 0 0 20px; color: var(--muted); }
.modal-close { position: absolute; top: 14px; right: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.modal-warning { margin: 0 0 14px; color: var(--warn); font-size: 14px; }

.picked {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: -4px 0 18px;
  padding: 10px;
  border: 1px solid rgba(139, 92, 246, .4);
  border-radius: 14px;
  background: rgba(139, 92, 246, .08);
  animation: pop .45s var(--spring) both;
}

.picked img, .picked .suggest-cover { width: 54px; height: 72px; border-radius: 8px; object-fit: cover; flex: none; }
.picked strong { display: block; font: 600 15px/1.3 var(--font-display); }
.picked small { color: var(--muted); font-size: 13px; }
.picked .btn { margin-left: auto; }

.combo { position: relative; display: flex; align-items: center; }
.combo > svg { position: absolute; left: 14px; width: 18px; color: var(--muted); pointer-events: none; }
.combo .input { padding-left: 42px; padding-right: 44px; }
.combo .spinner { position: absolute; right: 14px; width: 18px; height: 18px; border-width: 2px; }

.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 300; display: grid; gap: 10px; max-width: min(380px, calc(100vw - 32px)); }

.toast {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: rgba(22, 26, 38, .95);
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, .8);
  font-size: 14px;
  animation: toast-in .5s var(--spring) both;
}

.toast.is-leaving { animation: toast-out .35s ease-in both; }
.toast strong { display: block; margin-bottom: 2px; }
.toast a { color: var(--accent-2); }
.toast-icon { font-size: 20px; line-height: 1; }
@keyframes toast-in { from { opacity: 0; transform: translateY(20px) scale(.9); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(40px); } }

.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, .12);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Sections, panneaux ---------- */

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 18px 0 26px; }
.page-head h1 { margin: 0; font: 800 clamp(28px, 4vw, 44px)/1.05 var(--font-display); letter-spacing: -.01em; }
.page-head p { margin: 8px 0 0; color: var(--muted); max-width: 640px; }
.kicker { margin: 0 0 8px; color: var(--accent-2); font: 600 12px/1 var(--font); letter-spacing: .14em; text-transform: uppercase; }

.section { margin: 0 0 44px; }
.section-head { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; }
.section-head h2 { margin: 0; font: 700 18px/1.2 var(--font-display); }
.section-head .line { flex: 1; height: 1px; background: linear-gradient(to right, var(--line-2), transparent); }
.section-head a, .section-head button.link { color: var(--muted); font-size: 13px; font-weight: 600; background: none; border: 0; cursor: pointer; }
.section-head a:hover, .section-head button.link:hover { color: var(--text); }

.panel {
  position: relative;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
}

.panel h3 { margin: 0 0 14px; font: 600 14px/1.2 var(--font-display); color: var(--muted); letter-spacing: .02em; }

.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--min, 180px), 1fr)); gap: clamp(14px, 1.8vw, 22px); }

.scroller {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--col, 150px);
  gap: 14px;
  overflow-x: auto;
  padding: 4px 2px 14px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}

.scroller > * { scroll-snap-align: start; }

.empty {
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 60px 20px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius-lg);
  text-align: center;
  color: var(--muted);
}

.empty-icon { font-size: 44px; animation: float 3s ease-in-out infinite; }
.empty h2, .empty h3 { margin: 0; color: var(--text); font: 700 19px var(--font-display); }
.empty p { margin: 0; max-width: 460px; }
@keyframes float { 50% { transform: translateY(-10px) rotate(-6deg); } }

.shimmer {
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .06) 50%, transparent 70%) var(--panel-solid-2);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

@keyframes shimmer { from { background-position: 150% 0; } to { background-position: -50% 0; } }

/* ---------- Accueil ---------- */

.hello { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 20px; margin: 22px 0 30px; }
.hello h1 { margin: 0; font: 800 clamp(30px, 5vw, 56px)/1.02 var(--font-display); letter-spacing: -.02em; }
.hello h1 span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hello p { margin: 10px 0 0; color: var(--muted); font-size: 16px; }
.hello-actions { display: flex; gap: 10px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 12px; margin: 0 0 40px; }

.stat {
  position: relative;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  overflow: hidden;
  animation: slide-in .6s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 60ms);
}

.stat::after {
  content: "";
  position: absolute;
  inset: auto -30% -60% auto;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--c, var(--accent));
  filter: blur(40px);
  opacity: .22;
}

.stat-value { display: block; font: 700 clamp(22px, 2.6vw, 30px)/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: 13px; }
.stat-sub { display: block; margin-top: 2px; color: var(--dim); font-size: 12px; }

.home-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 22px; margin: 0 0 44px; }

.spotlight {
  position: relative;
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  isolation: isolate;
  min-height: 300px;
}

.spotlight-bg { position: absolute; inset: 0; z-index: -2; background-size: cover; background-position: center; opacity: .45; filter: saturate(1.2); transform: scale(1.05); }
.spotlight::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(6, 7, 11, .96) 25%, rgba(6, 7, 11, .55)); }
.spotlight h3 { margin: 6px 0 10px; font: 700 clamp(20px, 2.4vw, 28px)/1.1 var(--font-display); }
.spotlight p { margin: 0 0 16px; color: rgba(238, 241, 248, .78); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.spotlight .meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; color: var(--muted); font-size: 13px; }
.spotlight .actions { display: flex; flex-wrap: wrap; gap: 10px; }

.now-list { display: grid; gap: 10px; }

.now-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  transition: background .2s, transform .3s var(--ease), border-color .2s;
  animation: slide-in .5s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 50ms);
}

.now-item:hover { background: var(--panel-2); border-color: var(--line-2); transform: translateX(4px); }
.now-item img, .now-item .ph { width: 54px; height: 72px; border-radius: 10px; object-fit: cover; background: var(--panel-solid-2); }
.now-item strong { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now-item small { color: var(--muted); font-size: 12px; }

.progress { position: relative; height: 6px; margin-top: 7px; border-radius: 99px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.progress span { position: absolute; inset: 0 auto 0 0; width: var(--p, 0%); border-radius: inherit; background: var(--c, var(--grad)); transition: width 1.2s var(--ease); }

.news { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); gap: 22px; margin: 0 0 44px; }

.mini-cover { display: grid; gap: 8px; cursor: pointer; }
.mini-cover .img {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel-solid-2);
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .9);
  transition: transform .4s var(--ease), box-shadow .3s;
}

.mini-cover img { width: 100%; height: 100%; object-fit: cover; }
.mini-cover:hover .img { transform: translateY(-5px) scale(1.03); box-shadow: 0 16px 30px -12px rgba(0, 0, 0, .9), 0 0 0 1px var(--line-2); }
.mini-cover strong { font-size: 13px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini-cover small { color: var(--muted); font-size: 12px; }
.mini-cover .flag { position: absolute; top: 8px; left: 8px; padding: 2px 8px; border-radius: 999px; background: rgba(6, 7, 11, .75); backdrop-filter: blur(6px); font-size: 11px; font-weight: 600; }
.mini-cover .add {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  background: rgba(6, 7, 11, .8);
  color: #fff;
  opacity: 0;
  transform: translateY(6px);
  cursor: pointer;
  transition: opacity .25s, transform .3s var(--spring), background .2s;
}

.mini-cover .add svg { width: 18px; }
.mini-cover:hover .add, .mini-cover .add:focus-visible { opacity: 1; transform: none; }
.mini-cover .add:hover { background: var(--accent); }
.mini-cover .add.is-done { opacity: 1; transform: none; background: var(--good); }

.upcoming { display: grid; gap: 8px; }

.up-item { display: grid; grid-template-columns: 58px 40px minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px; border-radius: 12px; transition: background .2s; }
.up-item:hover { background: var(--panel); }
.up-date { display: grid; place-items: center; height: 58px; border-radius: 12px; background: var(--panel-2); line-height: 1.1; }
.up-date b { font: 700 19px var(--font-display); }
.up-date small { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.up-item img, .up-item .ph { width: 40px; height: 54px; border-radius: 6px; object-fit: cover; background: var(--panel-solid-2); }
.up-item strong { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-item small { color: var(--muted); font-size: 12px; }

.timeline { position: relative; display: grid; gap: 14px; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; border-radius: 2px; background: linear-gradient(var(--accent), var(--accent-2), transparent); }
.tl-item { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; align-items: center; }
.tl-item::before { content: ""; position: absolute; left: -21px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent-2); box-shadow: 0 0 12px var(--accent-2); }
.tl-item img, .tl-item .ph { width: 44px; height: 58px; border-radius: 8px; object-fit: cover; background: var(--panel-solid-2); }
.tl-item b { color: var(--accent-2); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.tl-item strong { display: block; font-weight: 600; }

/* Quatre graphiques : deux par ligne (jamais un seul orphelin sur trois colonnes) */
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); gap: 18px; margin: 0 0 44px; }

.donut-wrap { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 18px; align-items: center; }
.donut { width: 150px; height: 150px; transform: rotate(-90deg); }
.donut circle { fill: none; stroke-width: 16; }
.donut .seg { transition: stroke-dasharray 1.2s var(--ease), stroke-dashoffset 1.2s var(--ease); }
.donut-center { position: absolute; display: grid; place-items: center; width: 150px; height: 150px; text-align: center; line-height: 1.1; }
.donut-center b { font: 700 26px var(--font-display); }
.donut-center small { color: var(--muted); font-size: 12px; }
.legend { display: grid; gap: 8px; font-size: 13px; }
.legend div { display: flex; align-items: center; gap: 9px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; }
.legend span { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }

.bars { display: grid; gap: 11px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 120px) minmax(0, 1fr) auto; gap: 12px; align-items: center; font-size: 13px; }
.bar-row > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 10px; border-radius: 99px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.bar-fill { height: 100%; width: 0; border-radius: inherit; background: var(--c, var(--grad)); box-shadow: 0 0 14px -2px var(--c, var(--accent)); transition: width 1.2s var(--ease); }
.bar-row b { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600; }

.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }

.medal {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 16px 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  text-align: center;
  transition: transform .3s var(--spring), border-color .2s;
}

.medal:hover { transform: translateY(-4px); }
.medal-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: conic-gradient(from 200deg, #fbbf24, #f472b6, #8b5cf6, #22d3ee, #fbbf24);
  font-size: 24px;
  box-shadow: 0 0 24px -4px rgba(251, 191, 36, .6);
}

.medal strong { font-size: 13px; }
.medal small { color: var(--muted); font-size: 11px; line-height: 1.35; }
.medal.is-locked { opacity: .45; }
.medal.is-locked .medal-icon { background: var(--panel-2); box-shadow: none; filter: grayscale(1); }

/* ---------- Consoles (dossiers) ---------- */

.family { margin: 0 0 36px; }
.folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 26px 20px; }

.folder {
  --c: #888;
  position: relative;
  display: block;
  padding-top: 26px;
  cursor: pointer;
  animation: slide-in .6s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 50ms);
}

.folder-tab {
  position: absolute;
  top: 0;
  left: 0;
  width: 46%;
  height: 34px;
  border-radius: 14px 14px 0 0;
  background: color-mix(in srgb, var(--c) 55%, #11131b);
}

.folder-tab::after {
  content: "";
  position: absolute;
  right: -18px;
  bottom: 0;
  width: 26px;
  height: 22px;
  background: inherit;
  clip-path: polygon(0 0, 30% 0, 100% 100%, 0 100%);
}

/* Les jaquettes dépassent du haut du dossier, devant l'onglet et derrière la face avant */
.folder-papers { position: absolute; inset: 0 14px auto; height: 100px; z-index: 1; }

.folder-papers img, .folder-papers .ph {
  position: absolute;
  top: -14px;
  width: 62px;
  height: 86px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--panel-solid-2);
  box-shadow: 0 10px 20px -8px rgba(0, 0, 0, .9);
  transition: transform .5s var(--spring);
}

.folder-papers > :nth-child(1) { left: 30%; transform: rotate(-9deg); }
.folder-papers > :nth-child(2) { left: 44%; transform: rotate(2deg) translateY(-6px); }
.folder-papers > :nth-child(3) { left: 58%; transform: rotate(11deg); }
.folder:hover .folder-papers > :nth-child(1) { transform: rotate(-16deg) translate(-14px, -22px); }
.folder:hover .folder-papers > :nth-child(2) { transform: rotate(0) translateY(-34px); }
.folder:hover .folder-papers > :nth-child(3) { transform: rotate(17deg) translate(14px, -22px); }

.folder-body {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 150px;
  padding: 18px;
  border-radius: 4px 18px 18px 18px;
  background:
    radial-gradient(120% 80% at 100% 0%, color-mix(in srgb, var(--c) 45%, transparent), transparent 60%),
    linear-gradient(160deg, color-mix(in srgb, var(--c) 30%, #151824), #0d0f17);
  border: 1px solid color-mix(in srgb, var(--c) 40%, transparent);
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .08);
  transition: transform .4s var(--ease), box-shadow .3s;
}

.folder:hover .folder-body { transform: translateY(6px) perspective(600px) rotateX(-8deg); box-shadow: 0 26px 50px -20px color-mix(in srgb, var(--c) 70%, #000); }
.folder-name { font: 700 19px/1.15 var(--font-display); }

/* Logo du constructeur, à droite du dossier */
.folder-brand { position: absolute; top: 50%; right: 18px; display: flex; justify-content: flex-end; width: 96px; height: 38px; transform: translateY(-70%); pointer-events: none; }
.folder-brand svg { width: 100%; height: 100%; fill: #fff; opacity: .78; filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .45)); transition: opacity .3s, transform .4s var(--spring); }
.folder:hover .folder-brand svg { opacity: 1; transform: scale(1.08); }
.folder-year { display: block; margin-top: 4px; color: rgba(238, 241, 248, .55); font-size: 12px; font-weight: 600; letter-spacing: .06em; }
.folder-meta { display: flex; justify-content: space-between; align-items: end; gap: 8px; margin-top: 14px; color: rgba(238, 241, 248, .7); font-size: 13px; }
.folder-count { font: 700 30px/1 var(--font-display); color: #fff; }
.folder.is-empty { opacity: .55; }
.folder.is-empty:hover { opacity: 1; }

/* Page d'une console */
.console-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: clamp(260px, 40vh, 420px);
  margin: 10px 0 26px;
  padding: clamp(20px, 4vw, 40px);
  border-radius: var(--radius-lg);
  overflow: hidden;
  isolation: isolate;
  background: radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--c) 50%, transparent), transparent 60%), linear-gradient(160deg, color-mix(in srgb, var(--c) 30%, #10121b), #08090f);
}

.console-hero .hero-bg { position: absolute; inset: 0; z-index: -2; background-size: cover; background-position: center 30%; }
.console-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(6, 7, 11, .95), rgba(6, 7, 11, .35) 55%, transparent), linear-gradient(90deg, rgba(6, 7, 11, .7), transparent 70%); }
.console-hero > div:last-child { position: relative; max-width: min(560px, 62%); }
.console-hero h1 { margin: 0; font: 800 clamp(28px, 4.5vw, 52px)/1 var(--font-display); }

/* Logo de la console au-dessus du titre, comme celui d'un jeu sur sa fiche */
.console-mark { display: flex; height: clamp(34px, 5vw, 56px); margin-bottom: 16px; animation: logo-rise .9s var(--ease) .1s both; }
.console-mark svg { height: 100%; width: auto; max-width: 260px; fill: #fff; filter: drop-shadow(0 6px 24px rgba(0, 0, 0, .6)); }
@keyframes logo-rise { from { opacity: 0; transform: translateY(16px) scale(.94); } }

/* Photo de la console, détourée, qui flotte à droite du bandeau */
.hero-photo {
  position: absolute;
  right: 5%;
  bottom: 8%;
  width: min(48%, 560px);
  height: 82%;
  object-fit: contain;
  object-position: right bottom;
  filter: drop-shadow(0 30px 40px rgba(0, 0, 0, .65)) drop-shadow(0 0 60px color-mix(in srgb, var(--c) 35%, transparent));
  animation: photo-in 1s var(--ease) both, photo-float 7s ease-in-out 1s infinite;
}

@keyframes photo-in { from { opacity: 0; transform: translateX(40px) scale(.95); } }
@keyframes photo-float { 50% { transform: translateY(-8px); } }

.hero-credit { position: absolute; right: 16px; bottom: 8px; z-index: 5; color: rgba(238, 241, 248, .4); font-size: 10px; transition: opacity .6s; }
.hero-credit:hover { color: var(--text); }
/* La photo s'efface quand la bande-annonce démarre : son crédit aussi */
.hero-bg.is-faded ~ .hero-credit { opacity: 0; pointer-events: none; }
.console-hero p { margin: 8px 0 0; color: rgba(238, 241, 248, .75); }
.console-hero .hero-tools { position: absolute; top: 16px; right: 16px; z-index: 6; display: flex; gap: 8px; }

.toolbar { position: sticky; top: 70px; z-index: 30; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 22px; padding: 10px 0; background: linear-gradient(to bottom, rgba(6, 7, 11, .92), rgba(6, 7, 11, .7) 70%, transparent); backdrop-filter: blur(10px); }
.toolbar .select { width: auto; height: 36px; font-size: 14px; }
.toolbar .spacer { flex: 1; }

/* ==========================================================================
   Cartes façon TCG
   ========================================================================== */

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--card, 190px), 1fr)); gap: clamp(16px, 2vw, 26px); }

.tcg {
  --mx: 50%;
  --my: 50%;
  --rx: 0deg;
  --ry: 0deg;
  --o: 0;
  --frame: linear-gradient(160deg, #9aa3b5, #4b5263 60%, #7d8597);
  --holo-opacity: 0;
  --glow: transparent;
  position: relative;
  display: block;
  perspective: 900px;
  cursor: pointer;
  animation: card-in .7s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 40ms);
}

@keyframes card-in { from { opacity: 0; transform: translateY(26px) scale(.95); } }

.tcg-inner {
  position: relative;
  aspect-ratio: 5 / 7;
  padding: 7px;
  border-radius: 16px;
  background: var(--frame);
  box-shadow: 0 14px 32px -16px rgba(0, 0, 0, .95), 0 0 0 1px rgba(255, 255, 255, .06), 0 0 30px -8px var(--glow);
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  transition: transform .5s var(--ease), box-shadow .4s;
  will-change: transform;
}

.tcg:hover .tcg-inner, .tcg:focus-visible .tcg-inner { transform: rotateX(var(--rx)) rotateY(var(--ry)) translateY(-6px) scale(1.035); box-shadow: 0 30px 50px -20px rgba(0, 0, 0, .95), 0 0 0 1px rgba(255, 255, 255, .1), 0 0 40px -6px var(--glow); }
.tcg.is-tilting .tcg-inner { transition: transform .1s linear, box-shadow .4s; }
.tcg:focus-visible { outline: none; }

.tcg-card { position: relative; height: 100%; border-radius: 10px; overflow: hidden; background: #0c0e15; isolation: isolate; }
.tcg-art { position: absolute; inset: 0; }
.tcg-art img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.tcg:hover .tcg-art img { transform: scale(1.05); }
.tcg-art .fallback { display: grid; place-items: center; height: 100%; padding: 16px; text-align: center; font: 700 17px/1.2 var(--font-display); background: radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--pc) 55%, transparent), transparent 60%), linear-gradient(160deg, #1a1e2b, #0a0b11); }

.tcg-top { position: absolute; inset: 8px 8px auto; z-index: 4; display: flex; justify-content: space-between; align-items: center; gap: 6px; }

.tcg-power {
  display: grid;
  place-items: center;
  min-width: 38px;
  height: 38px;
  padding: 0 6px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .35), transparent 60%), var(--frame);
  color: #fff;
  font: 800 14px/1 var(--font-display);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .6), inset 0 0 0 2px rgba(255, 255, 255, .25);
}

.tcg-plat { padding: 3px 8px; border-radius: 999px; background: rgba(6, 7, 11, .78); backdrop-filter: blur(6px); font: 700 10px/1.3 var(--font); letter-spacing: .04em; border: 1px solid color-mix(in srgb, var(--pc) 60%, transparent); }

.tcg-info { position: absolute; inset: auto 0 0; z-index: 4; padding: 46px 10px 10px; background: linear-gradient(to top, rgba(5, 6, 10, .97) 30%, rgba(5, 6, 10, .7) 70%, transparent); }
.tcg-info h3 { margin: 0 0 6px; font: 700 13.5px/1.2 var(--font-display); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.tcg-meters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.tcg-meter { display: grid; gap: 3px; font-size: 9.5px; color: rgba(238, 241, 248, .7); text-transform: uppercase; letter-spacing: .05em; }
.tcg-meter i { position: relative; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.tcg-meter i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--v, 0%); border-radius: inherit; background: var(--mc, #fff); }
.tcg-rarity { display: flex; justify-content: space-between; align-items: center; margin-top: 7px; font: 700 9.5px/1 var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--rc, #cbd5e1); }
.tcg-rarity .gem { width: 9px; height: 9px; transform: rotate(45deg); background: var(--rc, #cbd5e1); box-shadow: 0 0 10px var(--rc); }

/* Couches holographiques : reflet, arc-en-ciel, paillettes */
.tcg-glare, .tcg-holo, .tcg-sparkle { position: absolute; inset: 0; z-index: 3; pointer-events: none; border-radius: inherit; }

.tcg-glare {
  background: radial-gradient(farthest-corner circle at var(--mx) var(--my), rgba(255, 255, 255, .55) 0%, rgba(255, 255, 255, .12) 30%, transparent 60%);
  mix-blend-mode: overlay;
  opacity: var(--o);
  transition: opacity .3s;
}

.tcg-holo {
  background:
    repeating-linear-gradient(110deg, #ff7773 0%, #ffed5f 7%, #a8ff5f 14%, #83fff7 21%, #7894ff 28%, #d875ff 35%, #ff7773 42%);
  background-size: 300% 300%;
  background-position: var(--mx) var(--my);
  mix-blend-mode: color-dodge;
  opacity: calc(var(--holo-opacity) * (.55 + var(--o) * .45));
  filter: saturate(1.2) contrast(1.1);
  transition: opacity .4s;
}

.tcg-sparkle {
  background-image:
    radial-gradient(circle at 20% 30%, #fff 0 1px, transparent 2px),
    radial-gradient(circle at 70% 65%, #fff 0 1px, transparent 2px),
    radial-gradient(circle at 45% 85%, #fff 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 85% 20%, #fff 0 1px, transparent 2px);
  background-size: 37px 41px, 53px 47px, 61px 59px, 43px 67px;
  background-position: calc(100% - var(--mx)) calc(100% - var(--my));
  mix-blend-mode: color-dodge;
  opacity: 0;
  transition: opacity .4s;
}

/* Raretés */
.tcg[data-tier="common"] { --frame: linear-gradient(160deg, #a6adbb, #555c6b 55%, #8a91a0); --rc: #cbd5e1; }
.tcg[data-tier="uncommon"] { --frame: linear-gradient(160deg, #6ee7b7, #047857 55%, #34d399); --rc: #6ee7b7; --glow: rgba(52, 211, 153, .25); }
.tcg[data-tier="rare"] { --frame: linear-gradient(160deg, #93c5fd, #1d4ed8 55%, #60a5fa); --rc: #93c5fd; --glow: rgba(96, 165, 250, .35); --holo-opacity: .18; }
.tcg[data-tier="epic"] { --frame: linear-gradient(160deg, #d8b4fe, #6d28d9 55%, #c084fc); --rc: #d8b4fe; --glow: rgba(192, 132, 252, .45); --holo-opacity: .32; }
.tcg[data-tier="epic"] .tcg-sparkle { opacity: calc(.25 + var(--o) * .4); }

.tcg[data-tier="legendary"] {
  --frame: linear-gradient(140deg, #fff3b0, #f59e0b 25%, #fde68a 45%, #b45309 70%, #fcd34d);
  --rc: #fcd34d;
  --glow: rgba(251, 191, 36, .55);
  --holo-opacity: .5;
}

.tcg[data-tier="legendary"] .tcg-sparkle { opacity: calc(.45 + var(--o) * .5); }
.tcg[data-tier="legendary"] .tcg-holo { animation: holo-idle 6s ease-in-out infinite; }

@property --angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

.tcg[data-tier="mythic"] {
  --frame: conic-gradient(from var(--angle), #ff3d77, #ffb13d, #f5ff3d, #3dff8b, #3dd8ff, #7a3dff, #ff3dd8, #ff3d77);
  --rc: #fff;
  --glow: rgba(167, 139, 250, .8);
  --holo-opacity: .7;
}

.tcg[data-tier="mythic"] .tcg-inner { animation: spin-angle 4s linear infinite, mythic-glow 3s ease-in-out infinite; }
.tcg[data-tier="mythic"] .tcg-power { animation: spin-angle 4s linear infinite; }
.tcg[data-tier="mythic"] .tcg-sparkle { opacity: calc(.6 + var(--o) * .4); }
.tcg[data-tier="mythic"] .tcg-holo { animation: holo-idle 4s ease-in-out infinite; }
.tcg[data-tier="mythic"] .tcg-rarity { background: linear-gradient(90deg, #ff3d77, #ffb13d, #3dff8b, #3dd8ff, #b13dff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tcg[data-tier="mythic"] .tcg-rarity .gem { background: conic-gradient(#ff3d77, #ffb13d, #3dff8b, #3dd8ff, #b13dff, #ff3d77); }

@keyframes spin-angle { to { --angle: 360deg; } }
@keyframes mythic-glow { 50% { box-shadow: 0 14px 32px -16px rgba(0, 0, 0, .95), 0 0 0 1px rgba(255, 255, 255, .1), 0 0 46px -2px rgba(61, 216, 255, .7); } }
@keyframes holo-idle { 0%, 100% { background-position: 20% 20%; } 50% { background-position: 80% 80%; } }
.tcg:hover .tcg-holo { animation: none; }

/* Sous blister : jamais joué */
.tcg[data-tier="sealed"] { --frame: linear-gradient(160deg, #cfd6e4, #8d96a8 50%, #e6ebf3); --rc: #e2e8f0; }
.tcg[data-tier="sealed"] .tcg-art img { filter: saturate(.75) brightness(.9); }

.tcg-wrap {
  position: absolute;
  inset: 0;
  z-index: 5;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 20%, rgba(255, 255, 255, .28) 26%, transparent 32%, transparent 58%, rgba(255, 255, 255, .16) 63%, transparent 70%),
    repeating-linear-gradient(80deg, rgba(255, 255, 255, .025) 0 3px, transparent 3px 9px),
    linear-gradient(180deg, rgba(220, 230, 255, .12), rgba(220, 230, 255, .04));
  background-size: 250% 100%, auto, auto;
  background-position: calc(var(--mx) * 1.2) 0, 0 0, 0 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25), inset 0 0 18px rgba(255, 255, 255, .12);
}

.tcg-wrap::after {
  content: "NEUF";
  position: absolute;
  top: 54px;
  right: -26px;
  width: 110px;
  padding: 4px 0;
  transform: rotate(38deg);
  background: linear-gradient(90deg, #ef4444, #f97316);
  color: #fff;
  font: 800 10px/1 var(--font-display);
  letter-spacing: .2em;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .5);
}

.tcg.is-unwrapping .tcg-wrap { animation: unwrap .9s var(--ease) forwards; }
@keyframes unwrap { 40% { transform: scale(1.04) rotate(-2deg); } 100% { transform: translate(140%, -40%) rotate(28deg); opacity: 0; } }

.tcg-fav { position: absolute; top: 52px; left: 10px; z-index: 6; color: #fbbf24; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .7)); font-size: 16px; }

/* Grande carte (fiche du jeu) */
.tcg.is-large { --card: 100%; max-width: 330px; cursor: default; }
.tcg.is-large .tcg-info h3 { font-size: 18px; }
.tcg.is-large .tcg-meter { font-size: 11px; }
.tcg.is-large .tcg-power { min-width: 52px; height: 52px; font-size: 19px; }
.tcg.is-large .tcg-plat { font-size: 12px; }
.tcg.is-large .tcg-rarity { font-size: 11.5px; }

/* ---------- Fiche d'un jeu ---------- */

.game-hero {
  position: relative;
  height: clamp(240px, 42vh, 460px);
  margin: 6px 0 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  isolation: isolate;
  background: var(--panel-solid);
}

.game-hero .hero-bg { position: absolute; inset: 0; z-index: -2; background-size: cover; background-position: center 30%; }
.game-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, var(--bg) 0%, rgba(6, 7, 11, .45) 45%, transparent 75%); }
.game-hero .hero-logo { position: absolute; left: 50%; bottom: 26px; max-width: min(440px, 70%); max-height: 42%; object-fit: contain; transform: translateX(-50%); filter: drop-shadow(0 8px 30px rgba(0, 0, 0, .7)); animation: logo-in 1s var(--ease) .1s both; }
@keyframes logo-in { from { opacity: 0; transform: translateX(-50%) translateY(20px) scale(.92); } }

.game-layout { display: grid; grid-template-columns: minmax(250px, 330px) minmax(0, 1fr); gap: clamp(20px, 3vw, 40px); margin-top: -120px; position: relative; z-index: 2; }
.game-side { display: grid; gap: 16px; align-content: start; position: sticky; top: 84px; }
.game-main { padding-top: 130px; min-width: 0; }
.game-main h1 { margin: 6px 0 12px; font: 800 clamp(26px, 3.6vw, 42px)/1.05 var(--font-display); }
.game-meta { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 18px; color: var(--muted); font-size: 14px; }
.game-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }

.power-breakdown { display: grid; gap: 10px; }
.power-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13px; }
.power-row .progress { margin: 0; }

.blocks { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; margin-bottom: 18px; }

.rating-grid { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 18px; align-items: center; }
.sliders { display: grid; gap: 12px; }
.slider-row { display: grid; grid-template-columns: 104px minmax(0, 1fr) 34px; gap: 12px; align-items: center; font-size: 13px; }
.slider-row output { text-align: right; font: 700 15px var(--font-display); font-variant-numeric: tabular-nums; color: var(--dim); transition: color .2s; }

/* Barre de note : dix segments, remplis par demi-points */
.rate {
  display: flex;
  gap: 4px;
  padding: 8px 0; /* zone de toucher plus haute que les segments */
  cursor: pointer;
  touch-action: pan-y; /* le doigt glisse à l'horizontale pour noter, à la verticale pour défiler */
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.rate:focus-visible { outline-offset: 2px; }

.rate i {
  --f: 0;
  position: relative;
  flex: 1;
  height: 12px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .08);
  overflow: hidden;
  transition: transform .25s var(--spring), background .2s;
}

.rate i::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--f) * 100%);
  background: var(--c);
  box-shadow: 0 0 12px var(--c);
}

.rate:hover i { background: rgba(255, 255, 255, .13); }
.rate i:hover { transform: scaleY(1.35); }
.rate.is-dragging i { transform: scaleY(1.25); }
.rate.is-empty i { background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .07) 0 4px, rgba(255, 255, 255, .03) 4px 8px); }

.radar { width: 190px; height: 190px; overflow: visible; }
.radar .grid { fill: none; stroke: rgba(255, 255, 255, .08); }
.radar .shape { fill: rgba(139, 92, 246, .3); stroke: var(--accent-2); stroke-width: 2; transition: all .6s var(--ease); }
.radar text { fill: var(--muted); font-size: 9px; font-family: var(--font); }
.radar .avg { fill: #fff; font: 700 22px var(--font-display); }

.inline-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.inline-fields .input { height: 40px; }
.source-note { color: var(--muted); font-size: 12px; margin: 6px 0 0; }

.ttb { display: grid; gap: 6px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.ttb-bar { position: relative; height: 10px; border-radius: 99px; background: rgba(255, 255, 255, .06); }
.ttb-bar span { position: absolute; inset: 0 auto 0 0; width: var(--p); border-radius: inherit; background: var(--grad); transition: width 1.2s var(--ease); }
.ttb-bar i { position: absolute; top: -4px; bottom: -4px; width: 2px; left: var(--x); background: rgba(255, 255, 255, .6); border-radius: 2px; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 0 0 18px; }
.fact { padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.fact dt { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .07em; }
.fact dd { margin: 3px 0 0; font-weight: 600; }

.summary { margin: 0 0 6px; color: rgba(238, 241, 248, .82); line-height: 1.7; }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.shots button { padding: 0; border: 0; border-radius: 10px; overflow: hidden; aspect-ratio: 16 / 9; background: var(--panel-solid-2); cursor: zoom-in; }
.shots img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.shots button:hover img { transform: scale(1.08); }
.lightbox { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px; background: rgba(0, 0, 0, .9); cursor: zoom-out; animation: fade .25s ease both; }
.lightbox img { max-height: 90vh; border-radius: 12px; animation: pop .4s var(--ease) both; }

.saved { color: var(--good); font-size: 12px; opacity: 0; transition: opacity .3s; }
.saved.is-on { opacity: 1; }

/* ---------- Listes ---------- */

.tabs-head { display: flex; gap: 6px; padding: 4px; margin: 0 0 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); width: fit-content; }
.tabs-head a { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 10px; color: var(--muted); font-weight: 600; white-space: nowrap; transition: color .2s, background .2s; }
.tabs-head a svg { width: 18px; flex: none; }
.tabs-head a:hover { color: var(--text); }
.tabs-head a.is-active { color: #fff; background: linear-gradient(90deg, rgba(139, 92, 246, .3), rgba(34, 211, 238, .12)); box-shadow: inset 0 0 0 1px rgba(139, 92, 246, .35); }

.queue { display: grid; gap: 10px; counter-reset: q; }

.q-item {
  display: grid;
  grid-template-columns: 26px 40px 58px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 10px 14px 10px 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  counter-increment: q;
  transition: background .2s, border-color .2s, box-shadow .2s, transform .2s;
  animation: slide-in .5s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 40ms);
}

.q-item.is-dragging { opacity: .55; }
.q-item.is-over { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(139, 92, 246, .35); }
.q-handle { color: var(--dim); cursor: grab; display: grid; place-items: center; }
.q-handle svg { width: 18px; }
.q-rank::before { content: counter(q); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--panel-2); font: 800 16px var(--font-display); }
.q-item:first-child .q-rank::before { background: var(--grad); color: #fff; }
.q-item img, .q-item .ph { width: 58px; height: 78px; border-radius: 10px; object-fit: cover; background: var(--panel-solid-2); }
.q-item strong { display: block; font-weight: 600; }
.q-item small { color: var(--muted); font-size: 12px; }
.q-actions { display: flex; gap: 6px; }

.wish-card { position: relative; display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); animation: slide-in .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); }
.wish-card img, .wish-card .ph { width: 76px; height: 102px; border-radius: 10px; object-fit: cover; background: var(--panel-solid-2); }
.wish-card strong { display: block; font: 600 15px/1.25 var(--font-display); }
.wish-card small { color: var(--muted); font-size: 12px; }
.wish-card .countdown { display: inline-block; margin: 8px 0; padding: 3px 10px; border-radius: 999px; background: rgba(34, 211, 238, .12); color: var(--accent-2); font-size: 12px; font-weight: 600; }
.wish-card .countdown.is-out { background: rgba(52, 211, 153, .12); color: var(--good); }
.wish-card .row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

/* ---------- Découvrir : roulette ---------- */

.roulette {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 28px;
  align-items: center;
  padding: clamp(20px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: radial-gradient(120% 140% at 0% 0%, rgba(139, 92, 246, .22), transparent 55%), radial-gradient(120% 140% at 100% 100%, rgba(34, 211, 238, .14), transparent 55%), var(--panel);
  margin-bottom: 44px;
}

.roulette h2 { margin: 0 0 10px; font: 800 clamp(22px, 3vw, 32px)/1.1 var(--font-display); }
.roulette p { margin: 0 0 18px; color: var(--muted); }
.slot { position: relative; height: 340px; border-radius: 18px; overflow: hidden; background: rgba(0, 0, 0, .25); box-shadow: inset 0 0 0 1px var(--line-2), inset 0 30px 30px -20px rgba(0, 0, 0, .8), inset 0 -30px 30px -20px rgba(0, 0, 0, .8); }
.slot-reel { position: absolute; inset: 0 30px; display: grid; gap: 14px; padding: 14px 0; }
.slot-reel img, .slot-reel .ph { width: 100%; aspect-ratio: 2 / 3; border-radius: 12px; object-fit: cover; background: var(--panel-solid-2); }
.slot-result { position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; }
.slot-result .tcg { width: 190px; }

/* ---------- Profil ---------- */

.archetype { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 22px; align-items: center; padding: clamp(18px, 3vw, 30px); }
.archetype-emoji { font-size: clamp(54px, 8vw, 84px); line-height: 1; filter: drop-shadow(0 10px 30px rgba(139, 92, 246, .5)); }
.archetype-text h2 { margin: 0 0 8px; font: 800 clamp(24px, 3.4vw, 36px)/1.1 var(--font-display); }
.archetype-text > p.muted { margin: 0 0 14px; max-width: 560px; }
.archetype-score { min-width: 130px; text-align: center; }

.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; margin-bottom: 40px; }
.steam-lib { display: grid; gap: 8px; max-height: 420px; overflow: auto; margin: 12px 0; padding-right: 4px; scrollbar-width: thin; }
.steam-row { display: grid; grid-template-columns: 22px 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 10px; font-size: 14px; cursor: pointer; }
.steam-row:hover { background: var(--panel-2); }
.steam-row img { width: 34px; height: 34px; border-radius: 6px; object-fit: cover; background: var(--panel-solid-2); }
.steam-row small { color: var(--muted); }
.status-line { display: flex; align-items: center; gap: 10px; margin: 8px 0 14px; font-size: 14px; color: var(--muted); }
.status-line .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--dim); }
.status-line .dot.is-on { background: var(--good); box-shadow: 0 0 10px var(--good); }

/* ---------- Compte, connexion Discord ---------- */

.btn-lg { height: 52px; padding: 0 24px; font-size: 16px; border-radius: 14px; }
.btn-discord { background: #5865f2; border-color: #5865f2; color: #fff; box-shadow: 0 10px 28px -10px rgba(88, 101, 242, .8); }
.btn-discord:hover { background: #4752c4; }
.btn-logo { width: 20px; height: 20px; fill: currentColor; flex: none; }
.btn.is-busy { opacity: .7; cursor: progress; }

.avatar { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: var(--panel-2); flex: none; }
.avatar svg { width: 28px; fill: #fff; }
.nav-avatar { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; flex: none; }
#account-link > svg { width: 20px; flex: none; }

.identity-mini { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; }
.identity-mini .avatar { width: 44px; height: 44px; }
.identity-mini strong { display: block; }
.identity-mini small { color: var(--muted); font-size: 12px; }

.toggle { display: flex; align-items: flex-start; gap: 10px; margin: 4px 0 12px; font-size: 14px; cursor: pointer; }
.toggle input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }

.test-banner.profile-banner { background: linear-gradient(90deg, #8b5cf6, #22d3ee); }
/* Collection de quelqu'un d'autre : rien à ajouter */
.is-readonly [data-action="add"] { display: none !important; }
.profile-banner a { color: #fff; text-decoration: underline; }

/* Comptes connectés */
.identity-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: center; }
.identity-card .kicker { margin-bottom: 4px; }
.identity-name { display: block; font: 700 20px var(--font-display); }
.identity-card .status-line { margin: 6px 0 0; }

.accounts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 16px; }
.provider-card { display: grid; gap: 12px; align-content: start; }
.provider-head { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.provider-head strong { display: block; font: 700 16px var(--font-display); }
.provider-head small { color: var(--muted); font-size: 12px; }
.provider-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--panel-2); }
.provider-icon svg { width: 22px; height: 22px; fill: #fff; }
.provider-account { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-weight: 600; }
.provider-account small { color: var(--muted); font-weight: 400; font-size: 12px; }
.verified { color: var(--good); font-size: 12px; }
.unverified { color: var(--warn); font-size: 12px; }
.provider-facts { margin: 0; color: var(--muted); font-size: 13px; }
.provider-card .source-note { margin: 0; }
.provider-card .progress { margin: 0; }
.caps { display: flex; flex-wrap: wrap; gap: 6px; }
.cap { padding: 3px 9px; border-radius: 999px; background: rgba(255, 255, 255, .04); color: var(--dim); font-size: 12px; text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, .2); }
.cap.is-on { background: rgba(52, 211, 153, .12); color: var(--good); text-decoration: none; }

/* Accueil des visiteurs */
.landing { display: grid; gap: 36px; padding: clamp(10px, 4vw, 40px) 0; }
.landing-hero { display: grid; justify-items: start; gap: 6px; max-width: 760px; }
.landing-logo { width: 88px; height: 88px; margin-bottom: 10px; filter: drop-shadow(0 12px 30px rgba(139, 92, 246, .6)); animation: logo-rise .9s var(--ease) both; }
.landing h1 { margin: 0 0 8px; font: 800 clamp(32px, 6vw, 64px)/1.02 var(--font-display); letter-spacing: -.02em; }
.landing h1 span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.landing-lead { margin: 0 0 14px; color: var(--muted); font-size: 17px; max-width: 620px; }
.landing-actions { gap: 12px; margin: 6px 0 4px; }
.landing-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 16px; }
.landing-feature { display: grid; gap: 6px; animation: slide-in .6s var(--ease) both; animation-delay: calc(var(--i) * 80ms); }
.landing-feature span { font-size: 30px; }
.landing-feature strong { font: 700 16px var(--font-display); }
.landing-feature p { margin: 0; color: var(--muted); font-size: 14px; }

/* ---------- Bandes-annonces en fond ---------- */

.has-trailer .hero-bg { animation: zoom-in 3.6s cubic-bezier(.45, 0, .25, 1) forwards; }
@keyframes zoom-in { from { transform: scale(1.02); } to { transform: scale(1.12); } }

/* La vidéo joue sous l'image, toujours opaque (une iframe transparente est gelée par le navigateur) */
.trailer { position: absolute; inset: 0; z-index: -3; overflow: hidden; container-type: size; pointer-events: none; }
.trailer iframe { position: absolute; top: 50%; left: 50%; width: max(100cqw, 177.78cqh); height: max(56.25cqw, 100cqh); border: 0; transform: translate(-50%, -50%) scale(1.18); }
.trailer-video { width: 100%; height: 100%; object-fit: cover; background: #000; }

.hero-bg { transition: opacity .3s ease; }
/* Jamais tout à fait opaque : sinon le navigateur cesse de dessiner la vidéo cachée dessous */
.has-trailer .hero-bg { opacity: .995; }
.hero-bg.is-faded { opacity: 0; transition: opacity 1.2s ease; }

/* Ouverture en diaphragme, des bords vers le centre : le bouton lecture/pause que YouTube
   affiche au centre une fraction de seconde (Firefox) reste caché */
.has-trailer .hero-bg.is-faded.is-iris {
  opacity: .995;
  mask-image: radial-gradient(closest-side, #000 60%, transparent 100%);
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: 0% 0%;
  animation: zoom-in 3.6s cubic-bezier(.45, 0, .25, 1) forwards, iris 1.8s cubic-bezier(.4, 0, .7, 1) forwards;
}

@keyframes iris { from { mask-size: 200% 200%; } to { mask-size: 0% 0%; } }

.trailer-sound {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 6;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: rgba(10, 11, 18, .6);
  backdrop-filter: blur(8px);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transform: scale(.7);
  pointer-events: none;
  transition: opacity .4s ease, transform .5s var(--spring), background .2s;
}

.trailer-sound svg { width: 20px; }
.trailer-sound:hover { background: rgba(255, 255, 255, .15); }
.trailer-sound.is-visible { opacity: 1; transform: none; pointer-events: auto; }

/* Mode diagnostic (?debug) */
.debug-box { position: fixed; left: 12px; bottom: 12px; z-index: 9999; margin: 0; padding: 10px 12px; max-width: min(560px, calc(100vw - 24px)); border-radius: 10px; background: rgba(0, 0, 0, .85); color: #7cfc9a; font: 12px/1.45 ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; pointer-events: none; }

/* Bandeau mode test */
.test-banner { position: fixed; top: 0; left: 50%; z-index: 80; transform: translateX(-50%); padding: 4px 14px; border-radius: 0 0 12px 12px; background: linear-gradient(90deg, #f59e0b, #ef4444); color: #fff; font: 700 11px/1.4 var(--font); letter-spacing: .1em; text-transform: uppercase; box-shadow: 0 6px 20px rgba(0, 0, 0, .5); }

/* Confettis */
.confetti { position: fixed; z-index: 500; width: 9px; height: 14px; pointer-events: none; border-radius: 2px; animation: confetti 1.4s cubic-bezier(.2, .6, .4, 1) forwards; }
@keyframes confetti { to { transform: translate(var(--dx), var(--dy)) rotate(var(--r)); opacity: 0; } }

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .home-grid, .news { grid-template-columns: minmax(0, 1fr); }
  .news > :first-child { order: 0; }
}

@media (max-width: 860px) {
  :root { --sidebar: 0px; }
  .sidebar { display: none; }
  .app { margin-left: 0; padding-bottom: 76px; }
  .topbar { padding: 10px 14px; }
  .crumbs { display: none; }
  .search { max-width: none; margin: 0; }
  .search kbd { display: none; }

  .tabbar {
    position: fixed;
    inset: auto 0 0;
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(8, 9, 14, .94);
    backdrop-filter: blur(18px);
  }

  .tabbar a { display: grid; justify-items: center; gap: 3px; padding: 6px 0; border-radius: 12px; color: var(--muted); font-size: 10.5px; font-weight: 600; }
  .tabbar a svg { width: 22px; }
  .tabbar a.is-active { color: #fff; background: rgba(139, 92, 246, .16); }
  .tabbar a.is-active svg { color: var(--accent-2); }

  /* iOS zoome sur un champ dont le texte fait moins de 16 px */
  .input, .select, .textarea { font-size: 16px; }
  .test-banner { padding: 2px 10px; font-size: 9px; }
  .page-head { margin-top: 10px; }
  .page-head > .btn { width: 100%; justify-content: center; }
  /* Titres de section : le lien reste à droite, une explication passe en dessous */
  .section-head { flex-wrap: wrap; row-gap: 2px; }
  .section-head h2 { font-size: 17px; }
  .section-head a { white-space: nowrap; font-size: 12px; }
  .section-head > span.muted { order: 3; flex-basis: 100%; font-size: 12px !important; }

  /* Accueil : chiffres en bande qu'on fait défiler, suggestion du jour en deux étages */
  .hello { grid-template-columns: 1fr; margin-top: 12px; }
  .stats { display: flex; gap: 10px; overflow-x: auto; margin-inline: calc(var(--gutter) * -1); padding: 2px var(--gutter) 6px; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); scrollbar-width: none; }
  .stats::-webkit-scrollbar { display: none; }
  .stat { flex: 0 0 auto; min-width: 128px; padding: 14px 16px; scroll-snap-align: start; }
  .spotlight { grid-template-columns: 96px minmax(0, 1fr); gap: 8px 16px; align-items: start; padding: 16px; min-height: 0; }
  .spotlight > div:last-child { display: contents; }
  .spotlight > .cards { grid-row: 1 / span 3; }
  .spotlight .kicker, .spotlight h3, .spotlight .meta { grid-column: 2; margin-bottom: 0; }
  .spotlight .kicker { font-size: 10px; line-height: 1.4; }
  .spotlight > div:last-child > p:not(.kicker), .spotlight .actions { grid-column: 1 / -1; margin: 6px 0 0; }
  .spotlight .actions .btn { flex: 1; justify-content: center; }

  /* Console : photo en haut, texte en dessous sur toute la largeur */
  .console-hero { min-height: 360px; }
  .console-hero > div:last-child { max-width: none; }
  .hero-photo { inset: 7% 10% auto; width: auto; height: 44%; object-position: center top; }
  .toolbar { top: 62px; }
  .toolbar .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: -4px; }
  .toolbar .chips::-webkit-scrollbar { display: none; }
  .toolbar .chip { flex: none; }

  /* Fiche d'un jeu */
  .game-hero { height: 220px; }
  .game-layout { grid-template-columns: 1fr; margin-top: -60px; }
  .game-side { position: static; justify-items: center; }
  /* Centrée, la carte n'a plus de largeur imposée par la colonne : on la lui donne */
  .game-side > * { width: min(330px, 100%); }
  .game-main { padding-top: 0; }
  .segmented { display: grid; grid-template-columns: repeat(3, 1fr); }
  .segmented button { padding-inline: 6px; }
  .game-actions > .btn, .game-actions > .select { flex: 1 1 auto; }
  .rating-grid { grid-template-columns: 1fr; justify-items: center; }
  .rating-grid .sliders { width: 100%; }
  /* Une note par ligne : le nom et la valeur au-dessus, la barre en dessous sur toute la largeur */
  .slider-row { grid-template-columns: minmax(0, 1fr) auto; gap: 0 12px; font-size: 14px; }
  .slider-row .rate { grid-column: 1 / -1; grid-row: 2; padding: 6px 0 10px; }
  .slider-row output { grid-column: 2; grid-row: 1; }
  .rate { gap: 5px; }
  .rate i { height: 18px; border-radius: 5px; }
  .blocks { grid-template-columns: minmax(0, 1fr); }

  /* Listes : vignette, texte, et les boutons en dessous */
  .q-item { grid-template-columns: 52px minmax(0, 1fr); gap: 8px 12px; padding: 10px; }
  .q-item .q-rank, .q-item .q-handle { display: none; }
  .q-item > a { grid-row: 1 / span 2; }
  .q-item img, .q-item .ph { width: 52px; height: 70px; }
  .q-actions { grid-column: 2; flex-wrap: wrap; }
  .q-actions .icon-btn { width: 36px; height: 36px; }

  /* Découvrir : roulette plus compacte */
  .roulette { grid-template-columns: 1fr; gap: 20px; }
  .slot { height: 290px; width: min(100%, 230px); justify-self: center; }
  .slot-result .tcg { width: 170px; }

  /* Profil */
  .archetype { grid-template-columns: auto minmax(0, 1fr); gap: 14px 16px; }
  .archetype-emoji { grid-row: 1 / span 2; font-size: 48px; align-self: center; }
  .archetype-text .kicker { align-self: end; margin: 0; }
  .archetype-text { display: contents; }
  .archetype-text .kicker, .archetype-text h2 { grid-column: 2; }
  .archetype-text > p.muted, .archetype-text .chips, .archetype-score { grid-column: 1 / -1; }
  .archetype-text h2 { align-self: center; }
  .archetype-score { display: flex; align-items: baseline; justify-content: center; gap: 10px; }

  .donut-wrap { grid-template-columns: 1fr; justify-items: center; }
  .cards { --card: 150px; }
  .modal-actions .btn { flex: 1; justify-content: center; }
  .identity-card { grid-template-columns: auto minmax(0, 1fr); }
  .identity-card .chips { grid-column: 1 / -1; }
  .landing-actions .btn { flex: 1 1 100%; justify-content: center; }
}

/* Écrans tactiles : le glisser-déposer de la liste ne marche pas au doigt, on garde les flèches */
@media (hover: none) {
  .q-handle { display: none; }
}

@media (max-width: 480px) {
  .cards { --card: 140px; gap: 12px; }
  .folders { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 12px; }
  .folder-body { min-height: 130px; padding: 14px; }
  .folder-name { font-size: 15px; }
  .folder-count { font-size: 24px; }
  /* Dossiers étroits : le logo passe au-dessus du nom au lieu de le chevaucher */
  .folder-body { grid-template-rows: auto 1fr auto; }
  .folder-brand { position: static; width: auto; height: 20px; margin-bottom: 8px; justify-content: flex-start; transform: none; }
  .folder-brand svg { width: auto; max-width: 76px; }
  .bar-row { grid-template-columns: 80px minmax(0, 1fr) auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
