/* ==========================================================================
   Espace membre NovelFrance — nuit, or et rouge du logo
   ========================================================================== */
@font-face { font-family: 'Archivo Black'; src: url('/static/fonts/ArchivoBlack.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/static/fonts/Inter-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/static/fonts/Inter-SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/static/fonts/Inter-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/static/fonts/Inter-ExtraBold.ttf') format('truetype'); font-weight: 800; font-display: swap; }
@font-face { font-family: 'Playfair'; src: url('/static/fonts/PlayfairDisplay-Italic.ttf') format('truetype'); font-style: italic; font-display: swap; }

:root {
  --page: #08080b;
  --bg: #0c0c12;
  --panel: rgba(255, 255, 255, 0.035);
  --panel-strong: #14141c;
  --line: rgba(255, 255, 255, 0.08);
  --line-gold: rgba(245, 181, 68, 0.22);
  --text: #fafaf9;
  --muted: #a1a1aa;
  --gold1: #ffe39a;
  --gold2: #f5b544;
  --gold3: #df8a2c;
  --red: #c8102e;
  --good: #86efac;
  --r-c: #a1a1aa;
  --r-r: #3b82f6;
  --r-e: #a855f7;
  --r-l: #f5b544;
  --r-m: #e11d48;
  --radius: 16px;
  --gold: linear-gradient(135deg, var(--gold1), var(--gold2) 55%, var(--gold3));
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  background:
    radial-gradient(900px 500px at 75% -10%, rgba(245, 181, 68, 0.10), transparent 60%),
    radial-gradient(800px 600px at 20% 110%, rgba(52, 72, 190, 0.18), transparent 60%),
    var(--page);
  background-attachment: fixed;
  color: var(--text);
  font: 400 16px/1.55 Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold2); text-decoration: none; }
a:hover { color: var(--gold1); }
:focus-visible { outline: 2px solid var(--gold2); outline-offset: 3px; border-radius: 8px; }
code { font-size: 0.9em; background: rgba(255, 255, 255, 0.07); padding: 2px 6px; border-radius: 6px; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font: 400 clamp(28px, 4vw, 40px)/1.1 'Archivo Black', Inter, sans-serif; text-transform: uppercase; letter-spacing: 0.01em; }
h2 { font: 800 20px/1.25 Inter, sans-serif; }
h3 { font: 700 15px/1.3 Inter, sans-serif; letter-spacing: 0.02em; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.good { color: var(--good); }
.gold { background: var(--gold); -webkit-background-clip: text; background-clip: text; color: transparent; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold2); color: #1c1407; padding: 8px 14px; border-radius: 10px; z-index: 10; }
.skip:focus { left: 8px; }
.ic { width: 20px; height: 20px; flex: none; }

/* ------------------------------------------------------------------ Coquille */
.shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 22px;
  padding: 22px 16px; border-right: 1px solid var(--line);
  background: linear-gradient(rgba(12, 12, 18, 0.85), rgba(8, 8, 11, 0.6));
  backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); padding: 4px 8px; }
.brand img { border-radius: 10px; }
.brand strong { display: block; font: 400 17px/1.1 'Archivo Black', sans-serif; letter-spacing: 0.02em; }
.brand small { color: var(--gold2); font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.side nav { display: flex; flex-direction: column; gap: 18px; }
.nav-title { margin: 0 0 6px 10px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; }
.nav-link {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 12px; border-radius: 12px;
  color: #d4d4d8; font-weight: 600; transition: background 0.15s, color 0.15s;
}
.nav-link:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.nav-link.is-active { background: rgba(245, 181, 68, 0.12); color: var(--gold1); box-shadow: inset 2px 0 0 var(--gold2); }
.side-user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.side-user img { border-radius: 50%; }
.side-user span { flex: 1; min-width: 0; }
.side-user strong, .side-user small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user small { color: var(--muted); font-size: 12px; }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: var(--muted); }
.icon-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }

main { min-width: 0; }
.top { display: flex; align-items: center; justify-content: space-between; padding: 18px 36px; border-bottom: 1px solid var(--line); }
.server { display: flex; align-items: center; gap: 12px; }
.server img { border-radius: 10px; }
.server strong { display: block; font-weight: 800; }
.server small { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.dot-on { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; margin: 0 4px 1px 0; }
.page { padding: 32px 36px 64px; max-width: 1240px; display: flex; flex-direction: column; gap: 22px; }
.eyebrow { margin: 0; color: var(--gold2); font-size: 12px; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; }
.page > .eyebrow + h1 { margin-top: -14px; }
.lead { margin: 0; color: var(--muted); max-width: 70ch; }

/* ------------------------------------------------------------------ Composants */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.panel-head, .panel-foot { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.panel-foot { font-size: 14px; font-weight: 600; }
.grid-main { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; align-items: start; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.col { display: flex; flex-direction: column; gap: 18px; }
.count { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 99px; background: rgba(245, 181, 68, 0.15); color: var(--gold1); font-size: 12px; font-weight: 800; }

.btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 22px; border-radius: 14px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.06); color: var(--text); font-weight: 700;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn:hover { color: var(--text); transform: translateY(-1px); }
.btn-gold { background: var(--gold); color: #1c1407; border: 0; box-shadow: 0 8px 30px rgba(245, 181, 68, 0.35); }
.btn-gold:hover { color: #1c1407; box-shadow: 0 10px 36px rgba(245, 181, 68, 0.5); }

.bar { height: 10px; border-radius: 99px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.bar span { display: block; height: 100%; width: var(--p); border-radius: inherit; background: var(--gold); }
.bar.is-done span { background: linear-gradient(90deg, #22c55e, #86efac); }

.chips, .filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 12px; border-radius: 99px;
  border: 1px solid var(--line-gold); background: rgba(8, 8, 11, 0.5); color: #e7e5e4; font-size: 14px; font-weight: 600;
}
a.chip { min-height: 40px; }
a.chip:hover { color: var(--text); border-color: var(--gold2); }
.chip.is-active, .chip-accent { background: rgba(245, 181, 68, 0.14); border-color: var(--gold2); color: var(--gold1); }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); }
.stat-label { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.stat-value { font-size: 22px; font-weight: 800; }
.stat-sub { color: var(--muted); font-size: 13px; }
.stats-sm .stat { padding: 10px 12px; }
.stats-sm .stat-value { font-size: 17px; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.tab { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; color: var(--muted); font-weight: 700; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--gold1); border-bottom-color: var(--gold2); }
.tab-body { padding-top: 4px; }
.empty { padding: 28px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }

/* ------------------------------------------------------------------ Profil */
.profile-hero {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 24px; padding: 26px;
  border-radius: 22px; border: 1px solid var(--line);
  background:
    radial-gradient(600px 220px at 0% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
}
.avatar-wrap { position: relative; }
.avatar { display: block; border-radius: 50%; border: 4px solid var(--page); box-shadow: 0 0 0 3px var(--gold2), 0 10px 40px color-mix(in srgb, var(--accent) 45%, transparent); }
.lvl-pill { position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%); padding: 3px 12px; border-radius: 99px; background: var(--gold); color: #1c1407; font-size: 12px; font-weight: 800; letter-spacing: 0.08em; white-space: nowrap; }
.who { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.who h2 { font: 400 clamp(22px, 3vw, 30px)/1.1 'Archivo Black', sans-serif; text-transform: uppercase; overflow-wrap: anywhere; }
.who p { margin: 0; }
.prestige { color: var(--gold2); font-size: 0.7em; }
.rank-box { display: flex; flex-direction: column; align-items: flex-end; }
.rank-box strong { font: 400 40px/1 'Archivo Black', sans-serif; background: var(--gold); -webkit-background-clip: text; background-clip: text; color: transparent; }
.roles { display: flex; flex-wrap: wrap; gap: 8px; }
.role { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 99px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.role i { width: 10px; height: 10px; border-radius: 50%; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.badge { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; border: 1px solid var(--line-gold); background: rgba(245, 181, 68, 0.06); }
.badge.is-locked { border-color: var(--line); background: rgba(255, 255, 255, 0.02); opacity: 0.6; }
.badge-emoji { font-size: 26px; }
.badge strong, .badge small { display: block; }
.badge small { color: var(--muted); font-size: 13px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.series-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; font-size: 14px; font-weight: 600; }
.series-row .bar { grid-column: 1 / -1; height: 6px; }

/* ------------------------------------------------------------------ Collection */
.summary { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; padding: 22px; border-radius: 20px; border: 1px solid var(--line); background: var(--panel); }
.big-count { display: grid; grid-template-columns: auto auto; align-items: baseline; gap: 2px 8px; }
.big-count strong { font: 400 56px/1 'Archivo Black', sans-serif; background: var(--gold); -webkit-background-clip: text; background-clip: text; color: transparent; }
.big-count span { color: var(--muted); font-size: 22px; font-weight: 800; }
.big-count small { grid-column: 1 / -1; color: var(--muted); font-size: 14px; }
.rarities { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.rar { display: grid; grid-template-columns: 1fr auto; gap: 6px; padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); font-size: 14px; font-weight: 700; }
.rar .bar { grid-column: 1 / -1; height: 6px; }
.rar.r-c span:first-child { color: var(--r-c); } .rar.r-c .bar span { background: var(--r-c); }
.rar.r-r span:first-child { color: #93c5fd; } .rar.r-r .bar span { background: var(--r-r); }
.rar.r-e span:first-child { color: #d8b4fe; } .rar.r-e .bar span { background: var(--r-e); }
.rar.r-l span:first-child { color: var(--gold1); } .rar.r-l .bar span { background: var(--gold); }
.rar.r-m span:first-child { color: #fda4af; } .rar.r-m .bar span { background: var(--r-m); }

.series { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; }
.series-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid color-mix(in srgb, var(--sc) 35%, transparent); }
.series-head h2 { color: var(--text); }
.series-count { color: var(--muted); font-weight: 700; }
.series-count strong { color: var(--good); }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-top: 6px; }
.slot { position: relative; aspect-ratio: 450 / 630; border-radius: 14px; padding: 0; border: 0; background: none; font: inherit; color: inherit; }
.slot-owned { cursor: zoom-in; transition: transform 0.18s, filter 0.18s; }
.slot-owned img { display: block; width: 100%; height: 100%; object-fit: contain; }
.slot-owned:hover { transform: translateY(-4px) scale(1.02); }
.slot-owned.r-e:hover { filter: drop-shadow(0 8px 18px rgba(168, 85, 247, 0.45)); }
.slot-owned.r-l:hover, .slot-owned.is-golden:hover { filter: drop-shadow(0 8px 20px rgba(245, 181, 68, 0.5)); }
.slot-owned.r-m:hover { filter: drop-shadow(0 8px 20px rgba(225, 29, 72, 0.5)); }
.slot-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border: 1.5px dashed rgba(255, 255, 255, 0.14); background: rgba(255, 255, 255, 0.02);
}
.slot-no { font: 400 26px/1 'Archivo Black', sans-serif; color: rgba(255, 255, 255, 0.22); }
.slot-rar { font-size: 11px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.slot-empty.r-c .slot-rar { color: var(--r-c); }
.slot-empty.r-r .slot-rar { color: #93c5fd; }
.slot-empty.r-e .slot-rar { color: #d8b4fe; }
.slot-empty.r-l .slot-rar { color: var(--gold2); }
.slot-empty.r-m .slot-rar { color: #fda4af; }

dialog#card-modal { padding: 0; border: 0; background: transparent; color: var(--text); max-width: min(92vw, 480px); }
dialog#card-modal::backdrop { background: rgba(4, 4, 8, 0.82); backdrop-filter: blur(4px); }
.modal-in { position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px; }
#card-modal-img { width: min(90vw, 450px); aspect-ratio: 450 / 630; border-radius: 22px; background: rgba(255, 255, 255, 0.04); }
#card-modal-cap { margin: 0; color: var(--gold1); font-weight: 700; text-align: center; }
.modal-close { position: absolute; top: -8px; right: -8px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel-strong); color: var(--text); font-size: 26px; line-height: 1; cursor: pointer; }

/* ------------------------------------------------------------------ Équipe */
.stats-top { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.heroes { display: flex; flex-direction: column; gap: 16px; }
.hero-row { display: grid; grid-template-columns: 190px 1fr; gap: 22px; padding: 18px; border-radius: 20px; border: 1px solid var(--line); background: var(--panel); }
.hero-info { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.hero-info p { margin: 0; }
.skill { font-size: 15px; }
.gear { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0; padding: 0; list-style: none; font-size: 14px; }

/* ------------------------------------------------------------------ Classements */
.camps { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.camp { display: grid; grid-template-columns: 1fr; gap: 6px; padding: 14px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--cc) 40%, transparent); background: color-mix(in srgb, var(--cc) 8%, transparent); font-weight: 700; }
.camp strong { font-size: 14px; color: var(--muted); }
.camp .bar span { background: var(--cc); }
.board { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.board li { display: grid; grid-template-columns: 44px 36px 1fr auto; align-items: center; gap: 14px; min-height: 56px; padding: 8px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); }
.board li.is-me { border-color: var(--gold2); background: rgba(245, 181, 68, 0.08); }
.board img { border-radius: 50%; }
.board a { color: var(--text); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board a:hover { color: var(--gold1); }
.pos { font: 400 18px/1 'Archivo Black', sans-serif; text-align: center; color: var(--muted); }
.val { text-align: right; font-weight: 800; }
.val small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }

/* ------------------------------------------------------------------ Accueil */
.bare .hero-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.hero-card { max-width: 560px; display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; padding: 44px 36px; border-radius: 28px; border: 1px solid var(--line); background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015)); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); }
.hero-card.left { text-align: left; align-items: flex-start; }
.hero-logo { border-radius: 20px; box-shadow: 0 0 60px rgba(200, 16, 46, 0.45); }
.note { color: #fda4af; }
.fine { margin: 0; color: var(--muted); font-size: 13px; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; color: #e7e5e4; }

/* ------------------------------------------------------------------ Responsive */
@media (max-width: 1000px) {
  .grid-main, .grid-2 { grid-template-columns: 1fr; }
  .summary { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side nav { flex-direction: row; flex-wrap: wrap; gap: 4px; width: 100%; }
  .nav-group { display: contents; }
  .nav-title { display: none; }
  .side-user { margin: 0 0 0 auto; padding: 4px; border: 0; background: none; }
  .side-user span { display: none; }
  .top, .page { padding-left: 16px; padding-right: 16px; }
  .profile-hero { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .who .chips { justify-content: center; }
  .rank-box { align-items: center; }
  .hero-row { grid-template-columns: 1fr; }
  .hero-row .slot { max-width: 220px; }
  .camps { grid-template-columns: 1fr; }
  .board li { grid-template-columns: 32px 32px 1fr auto; gap: 10px; padding: 8px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
