:root {
  --bg: #0B0820;
  --surface: #1E1442;
  --surface-2: #2a1d5a;
  --line: rgba(244, 241, 255, .12);
  --magenta: #E5368A;
  --gold: #F5C542;
  --cyan: #3FD0F0;
  --text: #F4F1FF;
  --muted: #b3aad6;
  --danger: #FF4D5E;
  --good: #3ddc84;
  --radius: 18px;
  --display: 'Poppins', 'Montserrat', system-ui, sans-serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--body);
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
  overflow-x: hidden;
}
h1, h2, h3, .display { font-family: var(--display); letter-spacing: -.01em; margin: 0; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* Halos de projecteurs */
.spotlights {
  position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background:
    radial-gradient(40vmax 60vmax at 10% -10%, rgba(229, 54, 138, .22), transparent 60%),
    radial-gradient(40vmax 60vmax at 90% -10%, rgba(63, 208, 240, .14), transparent 60%),
    radial-gradient(60vmax 40vmax at 50% 120%, rgba(245, 197, 66, .08), transparent 60%);
}

/* ---------- Header */
.top {
  position: sticky; top: 0; z-index: 20;
  /* pas de backdrop-filter ici : il casserait la barre d'onglets fixe du bas */
  background: linear-gradient(120deg, #2b1662, #781868);
  box-shadow: 0 6px 30px rgba(0, 0, 0, .35);
}
.top-row {
  display: flex; align-items: center; gap: 10px;
  max-width: 1100px; margin: 0 auto; padding: 10px 16px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand img { filter: drop-shadow(0 0 8px rgba(245, 197, 66, .6)); flex: none; }
.brand-mark {
  display: block; width: 62px; height: 52px; flex: none;
  background: linear-gradient(135deg, #fff3bd, var(--gold));
  -webkit-mask: url('logo-line.png') center / contain no-repeat;
  mask: url('logo-line.png') center / contain no-repeat;
}
@media (min-width: 760px) { .brand-mark { width: 72px; height: 60px; } }
.brand strong { display: block; font-family: var(--display); font-size: 1.05rem; line-height: 1.1; white-space: nowrap; }
.brand small { color: var(--gold); font-weight: 600; font-size: .75rem; }
.prime-switch { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.prime-label { text-align: center; line-height: 1.15; min-width: 92px; }
.prime-label b { font-family: var(--display); display: block; }
.prime-label small { color: var(--muted); font-size: .72rem; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line);
  background: rgba(255, 255, 255, .06); cursor: pointer; font-size: 1.2rem; line-height: 1;
  display: grid; place-items: center; flex: none;
}
.icon-btn:hover { background: rgba(255, 255, 255, .14); }

.live-banner {
  background: var(--danger); color: #fff; text-align: center; font-weight: 700;
  font-family: var(--display); letter-spacing: .12em; font-size: .8rem; padding: 3px;
  animation: pulse 1.4s ease-in-out infinite;
}
.live-banner .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #fff; margin-right: 6px; vertical-align: 1px; }
@keyframes pulse { 50% { background: #b8162a; } }

/* Onglets : barre du bas sur mobile, sous le header sur desktop */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(20, 13, 48, .97); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs a {
  text-decoration: none; text-align: center; font-size: .68rem; font-weight: 600; color: var(--muted);
  padding: 8px 2px 9px; display: flex; flex-direction: column; align-items: center; gap: 1px;
}
.tabs a span { font-size: 1.25rem; filter: grayscale(.6); transition: transform .2s; }
.tabs a.active { color: var(--text); }
.tabs a.active span { filter: none; transform: translateY(-2px) scale(1.12); }
.tabs a.active::after { content: ''; width: 18px; height: 3px; border-radius: 3px; background: var(--magenta); }
@media (min-width: 760px) {
  body { padding-bottom: 40px; }
  .tabs { position: static; display: flex; justify-content: center; gap: 4px; background: transparent; border: 0; padding: 0 16px 8px; }
  .tabs a { flex-direction: row; gap: 6px; font-size: .9rem; padding: 6px 14px; border-radius: 999px; }
  .tabs a span { font-size: 1rem; }
  .tabs a.active { background: rgba(255, 255, 255, .14); }
  .tabs a.active::after { display: none; }
}

/* ---------- Layout */
main { max-width: 1100px; margin: 0 auto; padding: 18px 16px; }
.section { margin-bottom: 26px; }
.section-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.section-head .grow { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.panel {
  background: linear-gradient(160deg, var(--surface), #170f36);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
}
.panel + .panel { margin-top: 14px; }
.grid2 { display: grid; gap: 14px; }
@media (min-width: 860px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty .big { font-size: 2.6rem; display: block; margin-bottom: 6px; }

/* ---------- Boutons & champs */
.btn {
  border: 0; border-radius: 999px; padding: 10px 18px; cursor: pointer; font-weight: 600;
  background: rgba(255, 255, 255, .1); transition: transform .1s, background .2s; white-space: nowrap;
}
.btn:hover { background: rgba(255, 255, 255, .18); }
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(120deg, var(--magenta), #b2297c); box-shadow: 0 4px 18px rgba(229, 54, 138, .4); }
.btn.gold { background: linear-gradient(120deg, #ffd96b, var(--gold)); color: #2a1a00; }
.btn.danger { background: rgba(255, 77, 94, .18); color: #ff9aa4; }
.btn.sm { padding: 6px 12px; font-size: .85rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.input, select.input, textarea.input {
  width: 100%; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; outline: none;
}
.input:focus { border-color: var(--magenta); box-shadow: 0 0 0 3px rgba(229, 54, 138, .25); }
textarea.input { resize: vertical; min-height: 76px; }
.fields2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line); background: rgba(255, 255, 255, .05); border-radius: 999px;
  padding: 6px 12px; cursor: pointer; font-size: .88rem; font-weight: 500;
}
.chip:hover { background: rgba(255, 255, 255, .12); }
.chip.on { background: var(--magenta); border-color: var(--magenta); color: #fff; }
.chip.on.gold { background: var(--gold); border-color: var(--gold); color: #2a1a00; }
.chip.on.red { background: var(--danger); border-color: var(--danger); }
.chip.on.cyan { background: var(--cyan); border-color: var(--cyan); color: #04212a; }
.chip.ok { box-shadow: 0 0 0 2px var(--good); }

.pill { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .12); }
.pill.nomine { background: var(--danger); color: #fff; }
.pill.elimine { background: #444; color: #ccc; }
.pill.finaliste { background: var(--gold); color: #2a1a00; }
.pill.lice { background: rgba(63, 208, 240, .2); color: var(--cyan); }

/* ---------- Cartes élèves */
.filters .chip { white-space: nowrap; flex: none; }
.filters { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
@media (min-width: 760px) { .cards { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; } }
.card {
  position: relative; border-radius: var(--radius); overflow: hidden; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); aspect-ratio: 3 / 4;
  transition: transform .2s, box-shadow .2s; text-align: left; padding: 0;
}
.card:hover { transform: translateY(-4px) rotate(-.5deg); box-shadow: 0 10px 34px rgba(229, 54, 138, .35); }
.card:hover .sparkle { opacity: 1; }
.card .photo, .avatar {
  background-size: cover; background-position: center 25%;
  display: grid; place-items: center; font-family: var(--display); font-weight: 800; color: rgba(255, 255, 255, .9);
}
.card .photo { position: absolute; inset: 0; font-size: 3.4rem; }
.card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(11, 8, 32, .95) 8%, transparent 55%); }
.card .info { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 12px; z-index: 1; }
.card .name { font-family: var(--display); font-size: 1.35rem; font-weight: 800; line-height: 1.1; text-shadow: 0 2px 10px rgba(0, 0, 0, .6); word-break: break-word; }
.card .meta { font-size: .78rem; color: var(--muted); }
.card .star-note { position: absolute; top: 8px; right: 8px; z-index: 1; }
.card .tag { position: absolute; top: 10px; left: 10px; z-index: 1; font-size: 1.3rem; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .6)); }
.card.out { filter: grayscale(.9); opacity: .6; }
.card .pill { margin-top: 4px; }
.sparkle { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .3s;
  background-image: radial-gradient(2px 2px at 20% 30%, #fff, transparent), radial-gradient(2px 2px at 70% 20%, var(--gold), transparent),
    radial-gradient(1.5px 1.5px at 40% 70%, #fff, transparent), radial-gradient(2px 2px at 85% 60%, var(--gold), transparent),
    radial-gradient(1.5px 1.5px at 55% 45%, #fff, transparent);
  animation: twinkle 1.2s ease-in-out infinite alternate; }
@keyframes twinkle { to { filter: brightness(1.8); transform: translateY(-3px); } }

.star-note { width: 52px; height: 52px; position: relative; display: grid; place-items: center; }
.star-note svg { position: absolute; inset: 0; filter: drop-shadow(0 2px 8px rgba(245, 197, 66, .55)); }
.star-note b { position: relative; font-family: var(--display); font-weight: 800; font-size: .88rem; color: #2a1a00; margin-top: 4px; }
.star-note.empty-note svg path { fill: rgba(255, 255, 255, .15); }
.star-note.empty-note b { color: var(--muted); }
.star-note.lg { width: 92px; height: 92px; }
.star-note.lg b { font-size: 1.4rem; }

.add-card { display: grid; place-items: center; border: 2px dashed rgba(229, 54, 138, .5); background: rgba(229, 54, 138, .06); color: var(--magenta); font-weight: 700; font-family: var(--display); font-size: 1rem; }
.add-card::after { display: none; }
.add-card span { display: block; font-size: 2.6rem; text-align: center; line-height: 1; }

/* Capsule */
.capsule { display: flex; gap: 14px; align-items: center; background: linear-gradient(120deg, rgba(245, 197, 66, .18), rgba(229, 54, 138, .14)); border-color: rgba(245, 197, 66, .4); }
.capsule .ico { font-size: 2.4rem; }
.capsule .grow { flex: 1; min-width: 0; }

/* ---------- Modale (bottom sheet sur mobile) */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(5, 3, 18, .7); backdrop-filter: blur(4px); }
.sheet {
  position: relative; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto;
  background: linear-gradient(170deg, #241852, #140d30); border: 1px solid var(--line);
  border-radius: 24px 24px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  animation: up .25s ease-out;
}
@media (min-width: 760px) { .modal { align-items: center; } .sheet { border-radius: 24px; padding: 24px; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.sheet-head .grow { flex: 1; min-width: 0; }
.sheet-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.avatar { width: 72px; height: 72px; border-radius: 18px; flex: none; font-size: 1.8rem; }
.avatar.sm { width: 38px; height: 38px; border-radius: 11px; font-size: .95rem; }
.photo-pick { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }

/* Notation */
.crit { margin-bottom: 10px; }
.crit-head { display: flex; justify-content: space-between; font-weight: 600; font-size: .9rem; }
.crit-head b { font-family: var(--display); color: var(--gold); }
input[type=range] { width: 100%; accent-color: var(--magenta); height: 28px; }
.note-box { display: flex; gap: 16px; align-items: center; }
.note-box .crits { flex: 1; min-width: 0; }
.counter { text-align: right; font-size: .75rem; color: var(--muted); }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Classement */
.rank-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.rank-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line); user-select: none;
}
.rank-item .pos { font-family: var(--display); font-weight: 800; width: 30px; text-align: center; font-size: 1.1rem; color: var(--muted); }
.rank-item:nth-child(1) .pos, .rank-item:nth-child(2) .pos, .rank-item:nth-child(3) .pos { color: var(--gold); }
.rank-item:nth-child(-n+3) { border-color: rgba(245, 197, 66, .45); background: linear-gradient(90deg, rgba(245, 197, 66, .14), var(--surface) 60%); }
.rank-item .nm { flex: 1; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.delta { font-size: .78rem; font-weight: 700; width: 34px; text-align: right; }
.up { color: var(--good); } .down { color: var(--danger); } .flat { color: var(--muted); }

table.hist { border-collapse: collapse; width: 100%; font-size: .85rem; }
.table-wrap { overflow-x: auto; }
table.hist th, table.hist td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
table.hist th:first-child, table.hist td:first-child { text-align: left; }
table.hist th { color: var(--muted); font-weight: 600; }

/* ---------- Live */
.chrono { font-family: var(--display); font-weight: 800; font-size: 2.4rem; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.tableau { display: grid; gap: 8px; padding: 12px 14px; }
.tableau-top { display: flex; gap: 10px; align-items: flex-start; }
.tableau-top .num { font-family: var(--display); font-weight: 800; color: var(--magenta); font-size: 1.2rem; }
.tableau-top .grow { flex: 1; min-width: 0; }
.tableau-top .ttl { font-weight: 700; }
.stars { display: flex; gap: 2px; }
.stars button { background: none; border: 0; cursor: pointer; font-size: 1.9rem; line-height: 1; padding: 2px; color: rgba(255, 255, 255, .2); transition: transform .1s; }
.stars button.on { color: var(--gold); text-shadow: 0 0 12px rgba(245, 197, 66, .7); }
.stars button:active { transform: scale(1.3); }
.emojis { display: flex; gap: 4px; flex-wrap: wrap; }
.emojis button { border: 1px solid var(--line); background: rgba(255, 255, 255, .05); border-radius: 999px; padding: 3px 9px; cursor: pointer; font-size: 1rem; }
.emojis button b { font-size: .75rem; margin-left: 2px; }
.emojis button.on { background: rgba(229, 54, 138, .25); border-color: var(--magenta); }

/* ---------- Pronos */
.score-big { font-family: var(--display); font-weight: 800; font-size: 2.2rem; color: var(--gold); line-height: 1; }
.prono-block { margin-bottom: 14px; }
.prono-block h3 { font-size: .9rem; margin-bottom: 6px; }
.envelope { font-size: 3rem; display: inline-block; animation: float 3s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-6px) rotate(3deg); } }

/* ---------- Stats */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { padding: 14px; }
.kpi .v { font-family: var(--display); font-size: 1.8rem; font-weight: 800; line-height: 1.1; }
.kpi .l { font-size: .78rem; color: var(--muted); }
.chart-box { position: relative; height: 280px; }
.legend-chips .chip { display: inline-flex; align-items: center; gap: 6px; }
.legend-chips .sw { width: 10px; height: 10px; border-radius: 3px; }
.topflop { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.topflop li { display: flex; align-items: center; gap: 10px; }
.topflop li .grow { flex: 1; }

/* ---------- Jeux */
  aspect-ratio: 1; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  font-size: .72rem; line-height: 1.2; padding: 4px; cursor: pointer; font-weight: 500;
}

/* ---------- Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60;
  background: #fff; color: #1a1033; font-weight: 600; padding: 10px 18px; border-radius: 999px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .4); max-width: calc(100% - 32px); text-align: center;
}
@media (min-width: 760px) { .toast { bottom: 28px; } }

/* ---------- Logo */
.logo-thumb { width: 66px; height: 44px; object-fit: cover; object-position: 55% 50%; border-radius: 10px; flex: none; box-shadow: 0 0 14px rgba(229, 54, 138, .5); }

/* ---------- Ce soir : prime de présentation */
.hero { position: relative; border-radius: 22px; overflow: hidden; min-height: 190px; display: flex; align-items: flex-end; border: 1px solid var(--line); }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 40%; }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(11, 8, 32, .95) 5%, rgba(11, 8, 32, .25) 60%, transparent); }
.hero-txt { position: relative; z-index: 1; padding: 16px; }
.hero h1 { font-size: 1.5rem; line-height: 1.15; margin: 6px 0 2px; text-shadow: 0 2px 12px rgba(0, 0, 0, .6); }
@media (min-width: 760px) { .hero { min-height: 280px; } .hero h1 { font-size: 2.1rem; } }
.progress { height: 10px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--magenta), var(--gold)); transition: width .4s; }
.guide summary { cursor: pointer; list-style: none; }
.guide summary::-webkit-details-marker { display: none; }
.guide summary h3::after { content: ' ▾'; color: var(--muted); }
.guide[open] summary h3::after { content: ' ▴'; }
.steps { margin: 12px 0; padding-left: 0; list-style: none; counter-reset: s; display: grid; gap: 10px; }
.steps li { counter-increment: s; display: flex; gap: 10px; font-size: .92rem; }
.steps li::before { content: counter(s); flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--magenta); display: grid; place-items: center; font-weight: 700; font-family: var(--display); font-size: .85rem; }
.crit-guide { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (min-width: 760px) { .crit-guide { grid-template-columns: repeat(4, 1fr); } }
.crit-guide div { background: rgba(255, 255, 255, .05); border-radius: 12px; padding: 10px; }
.crit-guide span { font-size: 1.3rem; display: block; }
.crit-guide small { display: block; color: var(--muted); font-size: .76rem; line-height: 1.3; }
.rate-list { display: grid; gap: 8px; }
@media (min-width: 760px) { .rate-list { grid-template-columns: 1fr 1fr; } }
.rate-row { display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; min-height: 62px; }
.rate-row:hover { border-color: var(--magenta); }
.rate-row .grow { flex: 1; min-width: 0; }
.rate-row b { font-family: var(--display); font-size: 1.05rem; }
.rate-row small { display: block; color: var(--muted); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rate-row .go { color: var(--magenta); font-weight: 700; font-size: .9rem; }
.rate-row.done { border-color: rgba(245, 197, 66, .35); background: linear-gradient(90deg, rgba(245, 197, 66, .1), var(--surface) 70%); }
.star-note.sm { width: 42px; height: 42px; }
.star-note.sm b { font-size: .78rem; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.checklist li { display: flex; align-items: center; gap: 10px; }
.checklist .grow { flex: 1; }
.checklist .ck { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-weight: 700; font-size: .8rem; flex: none; }
.checklist li.ok .ck { background: var(--good); border-color: var(--good); color: #04210f; }
.checklist li.ok .grow { color: var(--muted); text-decoration: line-through; }

/* ---------- Notation 1 clic (1 à 10) */
.flow-progress { display: flex; justify-content: space-between; font-size: .78rem; color: var(--muted); margin-bottom: 10px; font-weight: 600; }
.rate-help { background: rgba(229, 54, 138, .12); border: 1px solid rgba(229, 54, 138, .35); border-radius: 12px; padding: 8px 12px; font-size: .88rem; margin-bottom: 14px; }
.crit { margin-bottom: 14px; }
.crit-head b small { color: var(--muted); font-weight: 500; font-size: .75rem; }
.crit .hint { font-size: .76rem; color: var(--muted); margin-bottom: 6px; }
.scale { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.scale button { height: 38px; border-radius: 9px; border: 1px solid var(--line); background: rgba(255, 255, 255, .05); cursor: pointer; font-weight: 700; font-size: .85rem; padding: 0; transition: transform .1s, background .15s; }
.scale button:hover { background: rgba(255, 255, 255, .14); }
.scale button.on { background: linear-gradient(160deg, var(--magenta), #9b2370); border-color: transparent; }
.scale button.sel { background: linear-gradient(160deg, #ffd96b, var(--gold)); color: #2a1a00; transform: scale(1.1); box-shadow: 0 0 14px rgba(245, 197, 66, .6); }
.scale-legend { display: flex; justify-content: space-between; font-size: .7rem; color: var(--muted); gap: 4px; }

/* Ajustements mobile */
.hero { display: block; min-height: 0; background: var(--surface); }
.hero img { position: static; display: block; height: 170px; }
.hero::after { display: none; }
.hero h1 { text-shadow: none; }
@media (min-width: 760px) { .hero { min-height: 0; } .hero img { height: 260px; } }
.steps li > div { flex: 1; min-width: 0; }
@media (max-width: 440px) {
  .brand > span:not(.brand-mark) { display: none; }
  .prime-label { min-width: 84px; }
}

/* Logo officiel recoloré (or → magenta) */
.brand-logo { height: 50px; width: auto; flex: none; filter: drop-shadow(0 0 10px rgba(245, 197, 66, .55)); }
.brand-logo:not(.tinted) { opacity: 0; }
@media (min-width: 760px) { .brand-logo { height: 58px; } }

/* ---------- Primes 2+ : déroulé avant / pendant / après */
.hero .special { margin-top: 8px; display: inline-block; background: rgba(245, 197, 66, .18); border: 1px solid rgba(245, 197, 66, .5); color: var(--gold); border-radius: 12px; padding: 6px 10px; font-weight: 600; font-size: .88rem; }
.stepper { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: rgba(255, 255, 255, .06); border-radius: 999px; padding: 4px; position: sticky; top: 76px; z-index: 5; backdrop-filter: blur(8px); }
@media (min-width: 760px) { .stepper { top: 120px; } }
.stepper button { border: 0; background: none; border-radius: 999px; padding: 9px 4px; font-weight: 700; cursor: pointer; color: var(--muted); }
.stepper button.on { background: linear-gradient(120deg, var(--magenta), #b2297c); color: #fff; box-shadow: 0 4px 14px rgba(229, 54, 138, .4); }
.big-cta { width: 100%; padding: 14px; font-size: 1rem; margin-bottom: 20px; }
.live-strip { gap: 10px; padding: 10px 14px; }
.chrono.sm { font-size: 1.2rem; }
.now-card { border-color: rgba(229, 54, 138, .6); box-shadow: 0 0 30px rgba(229, 54, 138, .25); }
.now-card .who { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.stars.big { justify-content: center; gap: 6px; }
.stars.big button { font-size: 3rem; color: rgba(255, 255, 255, .22); }
.stars.big button:hover, .stars.big button:hover ~ button { color: rgba(255, 255, 255, .22); }
.stars.big:hover button { color: var(--gold); }
.stars.big button:hover ~ button { color: rgba(255, 255, 255, .22); }
.add-sum { cursor: pointer; font-weight: 700; color: var(--magenta); list-style: none; }
.add-sum::-webkit-details-marker { display: none; }
.score-card { text-align: center; background: linear-gradient(140deg, rgba(245, 197, 66, .2), rgba(229, 54, 138, .18)); border-color: rgba(245, 197, 66, .45); }
.verdicts { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 4px; font-size: .9rem; }
.hero.compact img { display: none; }
.hero.compact .hero-txt { padding: 12px 16px; }
.hero.compact h1 { font-size: 1.15rem; }
.crit-sep { font-family: var(--display); font-weight: 700; font-size: .85rem; color: var(--gold); border-top: 1px solid var(--line); padding-top: 12px; margin: 4px 0 10px; }
.chip.suggest { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(245, 197, 66, .35); }

/* ---------- Entre amis */
.amis-hero img { height: 130px; }
.link { display: inline-block; margin-top: 6px; background: rgba(0, 0, 0, .3); border-radius: 8px; padding: 4px 8px; font-size: .85rem; color: var(--cyan); word-break: break-all; }
.demo-banner { background: rgba(63, 208, 240, .12); border: 1px dashed var(--cyan); color: var(--cyan); border-radius: 12px; padding: 8px 12px; font-size: .85rem; }
.ptag { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.ptag small { color: var(--muted); font-weight: 400; }
.pav { width: 28px; height: 28px; border-radius: 50%; background: rgba(255, 255, 255, .1); display: inline-grid; place-items: center; font-size: 1rem; flex: none; }
.pav.big { width: 48px; height: 48px; font-size: 1.6rem; margin: 0 auto 4px; }
.podium { display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 8px; margin-bottom: 14px; text-align: center; }
.pod b { display: block; font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod small { color: var(--muted); font-size: .75rem; }
.pod .step { margin-top: 6px; border-radius: 10px 10px 0 0; font-family: var(--display); font-weight: 800; font-size: 1.3rem; display: grid; place-items: center; }
.pod1 .step { height: 70px; background: linear-gradient(180deg, var(--gold), #a87a10); color: #2a1a00; }
.pod2 .step { height: 50px; background: linear-gradient(180deg, #d8d8e8, #8d8da6); color: #1a1a2a; }
.pod3 .step { height: 36px; background: linear-gradient(180deg, #e0975a, #9a5a2a); color: #2a1200; }
.players { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.players li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 12px; background: rgba(255, 255, 255, .04); }
.players li.me { background: rgba(229, 54, 138, .15); border: 1px solid rgba(229, 54, 138, .4); }
.players .pos { font-family: var(--display); font-weight: 800; width: 20px; text-align: center; color: var(--muted); }
.players li:nth-child(-n+3) .pos { color: var(--gold); }
.locked { text-align: center; padding: 18px 8px; display: grid; gap: 6px; justify-items: center; }
.locked .big { font-size: 2.2rem; }
.votes { display: grid; gap: 6px; }
.vote { display: grid; grid-template-columns: 80px 1fr 24px; gap: 8px; align-items: center; font-size: .88rem; }
.vote .vn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vbar { height: 12px; border-radius: 99px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.vbar span { display: block; height: 100%; border-radius: 99px; background: var(--magenta); }
.vbar span.red { background: var(--danger); }
.vbar span.gold { background: var(--gold); }
.vote b { text-align: right; }
.highlight { background: rgba(255, 77, 94, .12); border: 1px solid rgba(255, 77, 94, .35); border-radius: 12px; padding: 8px 12px; font-size: .88rem; margin-bottom: 12px; }
.group-notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
@media (min-width: 860px) { .group-notes { grid-template-columns: 1fr 1fr; column-gap: 16px; } }
.group-notes li { display: flex; align-items: center; gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.group-notes .pos { font-family: var(--display); font-weight: 800; width: 20px; color: var(--muted); text-align: center; }
.group-notes .grow { flex: 1; min-width: 0; }
.group-notes small { display: block; color: var(--muted); font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.range { position: relative; width: 60px; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .08); flex: none; }
.range span { position: absolute; top: 0; bottom: 0; border-radius: 99px; background: rgba(63, 208, 240, .5); min-width: 3px; }
.range i { position: absolute; top: -3px; width: 3px; height: 12px; border-radius: 2px; background: var(--gold); transform: translateX(-50%); }
.mine { width: 46px; text-align: right; }
@media (max-width: 440px) { .range, .mine { display: none; } }
.twin { display: flex; flex-direction: column; gap: 4px; }
.avatars { display: flex; flex-wrap: wrap; gap: 6px; }
.avatars button { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line); background: rgba(255, 255, 255, .05); font-size: 1.4rem; cursor: pointer; }
.avatars button.on { border-color: var(--magenta); background: rgba(229, 54, 138, .25); transform: scale(1.1); }

/* ---------- Classement général automatique */
.rank-item { cursor: pointer; }
.rank-item:hover { border-color: var(--magenta); }
.rank-item .nm small { display: block; font-weight: 400; color: var(--muted); font-size: .74rem; }
.spark { display: inline-flex; align-items: flex-end; gap: 2px; height: 26px; }
.spark i { width: 5px; border-radius: 2px; background: var(--cyan); opacity: .8; }
.spark i.none { background: rgba(255, 255, 255, .15); }
@media (max-width: 400px) { .spark { display: none; } }
.clickable { cursor: pointer; border-radius: 10px; padding: 4px; }
.clickable:hover { background: rgba(255, 255, 255, .06); }

/* ---------- Prestations préférées */
.fav-list { display: grid; gap: 6px; }
.fav-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.fav-row .grow { flex: 1; min-width: 0; }
.fav-row small { display: block; color: var(--muted); font-size: .76rem; }
.fav-row .medal { width: 30px; height: 30px; border-radius: 50%; border: 2px dashed var(--line); display: grid; place-items: center; font-size: 1.3rem; flex: none; }
.fav-row.on { border-color: var(--gold); background: linear-gradient(90deg, rgba(245, 197, 66, .16), var(--surface) 70%); }
.fav-row.on .medal { border: 0; }
.mini-stars { color: var(--gold); font-size: .8rem; letter-spacing: -1px; }

/* ---------- En-tête : aide + compte */
.help-btn { font-weight: 800; font-family: var(--display); }
.me-btn { position: relative; width: 38px; height: 38px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .1); font-size: 1.2rem; cursor: pointer; flex: none; display: grid; place-items: center; }
.me-btn::after { content: ''; position: absolute; right: -2px; bottom: -2px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid #4a1a6a; background: var(--good); }
.me-btn[data-sync="saving"]::after { background: var(--gold); }
.me-btn[data-sync="offline"]::after { background: var(--danger); }
.me-btn[data-sync=""]::after { display: none; }
.top-row { gap: 6px; }

/* ---------- Mode démo */
.demo-bar { display: none; position: sticky; top: 0; z-index: 25; background: var(--cyan); color: #04212a; text-align: center; font-weight: 700; font-size: .85rem; padding: 6px 10px; }
.demo-bar button { margin-left: 8px; border: 0; border-radius: 999px; padding: 3px 10px; background: #04212a; color: #fff; font-weight: 700; cursor: pointer; }
body.demo .demo-bar { display: block; }
body.demo .top { top: 33px; }

/* ---------- Écran « Qui es-tu ? » */
body.gated .top, body.gated main, body.gated .demo-bar { display: none; }
body.gated { padding-bottom: 0; }
#gate { min-height: 100vh; display: flex; justify-content: center; padding: 24px 16px 40px; }
.gate-box { width: 100%; max-width: 440px; }
.gate-logo { width: 100%; height: 150px; object-fit: cover; border-radius: 22px; border: 1px solid var(--line); }
.gate-title { text-align: center; font-family: var(--display); font-weight: 800; font-size: 1.4rem; margin: 12px 0 14px; }
.gate-title small { display: block; color: var(--gold); font-size: .85rem; }
#gate h2 { text-align: center; margin-bottom: 4px; }
#gate p { text-align: center; }
.who-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-top: 12px; }
.who-list button { border: 1px solid var(--line); background: rgba(255, 255, 255, .05); border-radius: 16px; padding: 12px 6px; cursor: pointer; display: grid; justify-items: center; gap: 4px; }
.who-list button:hover { border-color: var(--magenta); background: rgba(229, 54, 138, .12); }
.who-list b { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; max-width: 100%; white-space: nowrap; }
.pin { text-align: center; font-size: 2rem; letter-spacing: .6em; padding-left: .6em; font-family: var(--display); margin: 8px 0; }
.gate-err { color: var(--danger); font-size: .88rem; min-height: 1.2em; text-align: center; margin-bottom: 6px; }

/* ---------- Aide */
.help-tabs { margin-bottom: 14px; }
.help-body h3 { margin-bottom: 8px; }
.help-body h4 { font-family: var(--display); margin: 12px 0 4px; color: var(--gold); }
.help-body p { margin: 6px 0; }
.help-body ul, .help-steps { margin: 6px 0; padding-left: 20px; display: grid; gap: 6px; }

/* Note d'un tableau sur 10, en grand pendant le direct */
.big-scale { gap: 5px; margin-bottom: 4px; }
.big-scale button { height: 48px; font-size: 1.05rem; border-radius: 12px; }
.big-scale button:hover { background: linear-gradient(160deg, var(--magenta), #9b2370); }
.tableau .scale button { height: 34px; }

/* ---------- Barème des points */
.bareme ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bareme li { display: flex; align-items: center; gap: 10px; }
.bareme li > span:first-child { font-size: 1.4rem; width: 30px; text-align: center; }
.bareme .grow { flex: 1; min-width: 0; }
.bareme small { display: block; color: var(--muted); font-size: .76rem; }
.bareme .pts { color: var(--gold); font-family: var(--display); font-size: 1.1rem; }
.mood { display: inline-block; margin-left: 4px; color: var(--text); }

/* ---------- Note par élève dans un duo / trio / collectif */
.link-btn { background: none; border: 0; color: var(--cyan); font-size: .82rem; font-weight: 600; cursor: pointer; padding: 6px 0 0; text-align: left; }
.split { display: grid; gap: 10px; }
.split-row { display: grid; gap: 4px; }
.split-row .who { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .9rem; }
.card .rank-badge { display: inline-block; font-family: var(--display); font-weight: 800; font-size: .72rem; color: #2a1a00; background: var(--gold); border-radius: 999px; padding: 1px 7px; margin-bottom: 2px; }
.me-row td { background: rgba(229, 54, 138, .12); }

/* ---------- Passages du prime : choix du type + écrans de note dédiés */
.seg2 { grid-template-columns: 1fr 1fr; position: static; }
.kind-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.kind-btn { border: 1px solid var(--line); background: rgba(255, 255, 255, .04); border-radius: 14px; padding: 8px 4px; cursor: pointer; display: grid; justify-items: center; gap: 2px; text-align: center; }
.kind-btn span { font-size: 1.4rem; }
.kind-btn b { font-size: .82rem; }
.kind-btn small { font-size: .66rem; color: var(--muted); line-height: 1.2; }
.kind-btn.on { border-color: var(--magenta); background: rgba(229, 54, 138, .18); }
.crit-name { font-weight: 600; font-size: .88rem; }
.pass-total { margin-top: 8px; font-size: .9rem; }
.pass-total b { color: var(--gold); font-family: var(--display); }
.profs-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; font-size: .88rem; }
.profs-row label { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.profs-input { width: 70px; padding: 6px 8px; text-align: center; }
.pick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pick-grid.three { grid-template-columns: repeat(3, 1fr); }
.pick { border: 2px solid var(--line); background: rgba(255, 255, 255, .04); border-radius: 16px; padding: 12px 6px; cursor: pointer; display: grid; justify-items: center; gap: 6px; }
.pick .avatar { width: 56px; height: 56px; font-size: 1.3rem; }
.pick span { font-size: .75rem; color: var(--gold); font-weight: 700; }
.pick.on { border-color: var(--gold); background: rgba(245, 197, 66, .14); box-shadow: 0 0 18px rgba(245, 197, 66, .3); }
.now-card.kind-tableau, .tableau.kind-tableau { border-color: rgba(63, 208, 240, .45); }
.now-card.kind-face, .now-card.kind-battle, .tableau.kind-face, .tableau.kind-battle { border-color: rgba(245, 197, 66, .45); }
.tableau .num { font-size: 1.3rem; }
.rank-item .mv { display: flex; gap: 4px; }
.rank-item .mv button { width: 36px; height: 32px; border-radius: 9px; border: 1px solid var(--line); background: rgba(255, 255, 255, .08); cursor: pointer; font-size: .9rem; }
.pick[disabled] { opacity: .7; cursor: default; }

/* ---------- Récaps */
.pnotes { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.pnote { font-size: .74rem; background: rgba(255, 255, 255, .07); border-radius: 999px; padding: 1px 7px; white-space: nowrap; }
.pnote.me { background: rgba(229, 54, 138, .25); }
.medals { font-size: 1rem; white-space: nowrap; }
.medals small { font-size: .72rem; color: var(--muted); margin-right: 2px; }
.topflop .pos { font-family: var(--display); font-weight: 800; width: 20px; text-align: center; color: var(--muted); }

/* ---------- Détail du calcul d'une note */
.calc { background: rgba(0, 0, 0, .2); border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 12px; }
.calc ul { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; font-size: .88rem; }
.calc li { display: flex; justify-content: space-between; gap: 10px; }
.calc-sum { border-top: 1px solid var(--line); padding-top: 8px; font-size: .88rem; line-height: 1.6; }
.calc .gold { color: var(--gold); font-family: var(--display); font-size: 1.05rem; }

/* ---------- Ma note (rose) contre la note des profs (bleu) */
.vs-notes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.vs-box { border-radius: 14px; padding: 10px; text-align: center; display: grid; gap: 2px; }
.vs-box span { font-size: .78rem; font-weight: 700; }
.vs-box b { font-family: var(--display); font-size: 1.8rem; line-height: 1.1; display: flex; align-items: baseline; justify-content: center; gap: 2px; }
.vs-box small { font-size: .8rem; opacity: .7; }
.vs-box.vs-mine { background: rgba(229, 54, 138, .18); border: 2px solid var(--magenta); color: #ff8cc0; }
.vs-box.vs-profs { background: rgba(63, 208, 240, .14); border: 2px solid var(--cyan); color: var(--cyan); cursor: text; }
.vs-box .profs-input { width: 3.2em; background: transparent; border: 0; border-bottom: 2px dashed rgba(63, 208, 240, .6); color: var(--cyan); font: inherit; text-align: center; padding: 0; outline: none; }
.vs-box .profs-input::placeholder { color: rgba(63, 208, 240, .5); }
.vs-verdict { text-align: center; margin-top: 6px; min-height: 1.2em; }
.tag-mine, .tag-profs { display: inline-block; border-radius: 999px; padding: 1px 8px; font-weight: 700; font-size: .82rem; white-space: nowrap; }
.tag-mine { background: rgba(229, 54, 138, .2); color: #ff8cc0; }
.tag-profs { background: rgba(63, 208, 240, .16); color: var(--cyan); margin-left: 4px; }

/* ---------- Nommés : ordre de sauvetage */
.save-list { display: grid; gap: 6px; }
.save-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.save-row b { flex: 1; }
.save-row small { color: var(--muted); font-size: .76rem; }
.save-rank { width: 28px; height: 28px; border-radius: 50%; border: 2px dashed var(--line); display: grid; place-items: center; font-weight: 800; font-family: var(--display); flex: none; }
.save-row.on { border-color: var(--good); background: linear-gradient(90deg, rgba(61, 220, 132, .14), var(--surface) 70%); }
.save-row.on .save-rank { border: 0; background: var(--good); color: #04210f; }
.save-row.out { border-color: var(--danger); background: linear-gradient(90deg, rgba(255, 77, 94, .14), var(--surface) 70%); }
.save-row.out .save-rank { border: 0; }

/* ---------- Saison : le fil des primes */
.season { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.season-card { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.season-card:hover { border-color: var(--magenta); }
.season-card .grow { flex: 1; min-width: 0; }
.season-num { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 800; background: rgba(255, 255, 255, .08); flex: none; }
.season-card.now { border-color: var(--magenta); box-shadow: 0 0 18px rgba(229, 54, 138, .25); }
.season-card.now .season-num { background: var(--magenta); }
.season-card.past .season-num { background: rgba(245, 197, 66, .2); color: var(--gold); }
.season-card.future { opacity: .55; }
.season-facts { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 2px; font-size: .84rem; }
.season-pts { font-family: var(--display); color: var(--gold); white-space: nowrap; }
.frozen { margin-top: 12px; padding: 8px 12px; border-radius: 12px; background: rgba(255, 77, 94, .1); border: 1px dashed rgba(255, 77, 94, .5); font-size: .88rem; }
.prog { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; counter-reset: prog; }
.prog li { display: flex; gap: 10px; align-items: center; font-size: .9rem; }
.prog li > span:first-child { font-size: 1.1rem; width: 24px; text-align: center; }
.prog .grow { flex: 1; min-width: 0; }

/* ---------- Bandeaux Star Academy */
.brand-star { height: 40px; width: 40px; flex: none; filter: drop-shadow(0 0 10px rgba(245, 197, 66, .6)); }
.hero-art {
  height: 170px; display: block;
  background:
    url('logo.webp') center / cover no-repeat,
    radial-gradient(circle at 82% 50%, rgba(245, 197, 66, .55), transparent 38%),
    radial-gradient(2px 2px at 14% 28%, #fff, transparent), radial-gradient(1.5px 1.5px at 30% 70%, #fff, transparent),
    radial-gradient(2px 2px at 48% 22%, #ffe9a0, transparent), radial-gradient(1.5px 1.5px at 60% 78%, #fff, transparent),
    radial-gradient(2px 2px at 8% 82%, #ffe9a0, transparent), radial-gradient(1.5px 1.5px at 40% 45%, #fff, transparent),
    radial-gradient(60% 120% at 0% 0%, rgba(63, 208, 240, .35), transparent 60%),
    linear-gradient(135deg, #2b1662, #781868 60%, #E5368A);
}
@media (min-width: 760px) { .hero-art { height: 240px; } }
.hero.compact .hero-art { display: none; }
.amis-hero .hero-art { height: 120px; }
.hero-art.gate-logo { height: 150px; border-radius: 22px; border: 1px solid var(--line); }

/* ---------- Carnet privé des primes */
.memory-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.memory-grid > .memory-card { margin: 0; }
.memory-card { display: flex; flex-direction: column; gap: 12px; border-top: 2px solid var(--gold); background: linear-gradient(145deg, #302052, var(--surface)); }
.memory-number { color: var(--gold); font-size: .75rem; font-weight: 800; letter-spacing: .08em; }
.memory-metrics { display: grid; gap: 3px; color: var(--muted); font-size: .82rem; }
.memory-metrics b { color: var(--text); font-size: 1.6rem; font-family: var(--display); }
.memory-highlight { padding: 10px 12px; border-radius: 12px; background: rgba(245,197,66,.08); color: #ffe7a2; font-size: .85rem; margin: 0; overflow-wrap: anywhere; }
.memory-open { margin-top: auto; align-self: flex-start; }
.memory-summary { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; padding: 14px 8px; background: rgba(245,197,66,.06); border-radius: 14px; text-align: center; }
.memory-summary b { display: block; font-family: var(--display); color: var(--gold); font-size: 1.25rem; }
.memory-summary small { color: var(--muted); font-size: .72rem; }
.memory-list { display: grid; gap: 10px; margin-top: 12px; }
.memory-entry { padding: 14px; border: 1px solid var(--line); border-radius: 14px; }
.memory-entry .grow, .memory-card .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.memory-score { color: var(--gold); font-weight: 700; font-size: .88rem; }
.memory-criteria { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: .75rem; color: var(--muted); margin-top: 10px; }
.memory-criteria b { color: var(--text); }
.memory-quote { margin: 12px 0 0; padding: 8px 12px; border-left: 2px solid var(--magenta); background: rgba(229,54,138,.06); border-radius: 0 8px 8px 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .88rem; }

/* ---------- Chat de la bande */
.chat-btn { position: fixed; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 35; width: 54px; height: 54px; border-radius: 50%; border: 0; cursor: pointer; font-size: 1.5rem;
  background: linear-gradient(140deg, var(--magenta), #9b2370); box-shadow: 0 6px 22px rgba(229, 54, 138, .5); }
.chat-btn::after { content: attr(data-badge); position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--gold); color: #2a1a00; font: 800 .72rem/20px var(--display); }
.chat-btn[data-badge=""]::after { display: none; }
@media (min-width: 760px) { .chat-btn { bottom: 24px; right: 24px; } }
body.gated .chat-btn { display: none; }
.sheet.chat-sheet { display: flex; flex-direction: column; height: 88vh; }
.sheet.chat-sheet #chatBody { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-head { margin-bottom: 8px; }
.chat-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding: 4px 2px 10px; }
.msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 82%; }
.msg.msg-me { align-self: flex-end; align-items: flex-end; }
.msg:not(.same) { margin-top: 8px; }
.msg-who { display: flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 700; color: var(--muted); margin: 0 0 3px 2px; }
.msg-who .pav { width: 22px; height: 22px; font-size: .8rem; }
.bubble { background: var(--surface-2); border-radius: 16px 16px 16px 4px; padding: 8px 12px; font-size: .92rem; line-height: 1.35; word-break: break-word; white-space: pre-wrap; }
.msg.msg-me .bubble { background: linear-gradient(140deg, var(--magenta), #b2297c); border-radius: 16px 16px 4px 16px; }
.bubble small { display: block; text-align: right; font-size: .66rem; opacity: .65; margin-top: 2px; }
.msg-del { background: none; border: 0; color: inherit; cursor: pointer; font-size: .7rem; padding: 0 0 0 4px; opacity: .8; }
.chat-emojis { display: flex; gap: 4px; overflow-x: auto; padding: 6px 0; scrollbar-width: none; }
.chat-emojis button { border: 1px solid var(--line); background: rgba(255, 255, 255, .05); border-radius: 999px; padding: 4px 10px; font-size: 1.1rem; cursor: pointer; flex: none; }
.chat-form { display: flex; gap: 6px; }
.chat-form .input { flex: 1; }
.chat-form .btn { padding: 10px 16px; }
.chat-spoiler { text-align: center; padding: 30px 10px; display: grid; gap: 8px; justify-items: center; }
.chat-spoiler .big { font-size: 2.6rem; }
