:root {
  --bg: #050914;
  --side: #0d1324;
  --panel: #111827;
  --panel-2: #1e293b;
  --input: #1f2937;
  --border: #1f2a44;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --violet: #a855f7;
  --violet-strong: #9333ea;
  --pink: #ec4899;
  --grad: linear-gradient(90deg, #b445ff, #f0359a);
  --green: #16a34a;
  --orange: #ea580c;
  --red: #dc2626;
  --blue: #2563eb;
  /* Bulle Basique (par defaut) : couleur unie et sobre, pour ne pas ressembler aux bulles de la boutique */
  --mine: #433a63;
  --other: #1e293b;
  --radius: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
#app { height: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { opacity: .5; cursor: not-allowed; }
a { color: #c084fc; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.hint { font-size: 12.5px; color: var(--muted); margin: 8px 0 0; }
.text-green { color: #22c55e; }
.text-orange { color: #f97316; }
.text-red { color: #f87171; }
.text-yellow { color: #facc15; }
.error-text { color: #f87171; }

/* ---------- Boutons & champs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 10px; padding: 11px 18px; font-weight: 600;
  transition: filter .15s, transform .05s;
}
.btn:hover:not(:disabled) { filter: brightness(1.12); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-block { width: 100%; }
.btn-small { padding: 7px 12px; font-size: 13.5px; border-radius: 8px; }
.btn-primary { background: var(--grad); color: #fff; }
.btn-ghost { background: #334155; color: #e2e8f0; }
.btn-violet { background: var(--violet-strong); color: #fff; }
.btn-green { background: var(--green); color: #fff; }
.btn-orange { background: var(--orange); color: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-news { background: linear-gradient(90deg, #2563eb, #0891b2); color: #fff; }
.btn-muted { background: #334155; color: #e2e8f0; }
.btn-red-soft { background: #3b1219; color: #f87171; }
.btn-green-soft { background: #0f3b25; color: #4ade80; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent; flex-shrink: 0;
}
.icon-btn.small { width: 28px; height: 28px; border-radius: 7px; }
.icon-btn:hover:not(:disabled) { filter: brightness(1.2); background-color: rgba(255,255,255,.06); }
.icon-btn.btn-violet:hover, .icon-btn.btn-orange:hover, .icon-btn.btn-green:hover { background-color: unset; }
.link-btn { background: none; border: 0; color: #4ade80; display: inline-flex; align-items: center; gap: 4px; font-weight: 500; }
.pulse { animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .6; } }

.input {
  width: 100%; background: var(--input); border: 1px solid transparent; color: var(--text);
  border-radius: 10px; padding: 12px 14px; font: inherit; outline: none; transition: border-color .15s;
}
.input:focus { border-color: var(--violet); }
.input::placeholder { color: #7c8799; }
.input:disabled { opacity: .7; }
textarea.input { resize: vertical; }
.input-small { width: auto; padding: 6px 8px; font-size: 13px; }
.input-color { padding: 4px; height: 46px; }
select.input { appearance: auto; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--muted); }
.check-row { flex-direction: row; align-items: center; gap: 10px; color: var(--text); font-size: 14.5px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 46px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); padding: 6px; }

.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 2px 8px; border-radius: 6px; background: #334155; color: #e2e8f0; font-weight: 500; margin-left: 6px; vertical-align: middle; }
.chip-red { background: #b91c1c; color: #fff; }
.chip-orange { background: var(--orange); color: #fff; }
.chip-violet { background: #6b21a8; color: #f3e8ff; }
.chip-x { background: none; border: 0; color: inherit; padding: 0 0 0 4px; }
.role-chip { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 999px; color: #fff; font-weight: 600; margin-left: 6px; vertical-align: middle; }
.badge { background: var(--pink); color: #fff; border-radius: 999px; font-size: 11.5px; font-weight: 700; min-width: 20px; height: 20px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; }

.brand { font-weight: 700; font-size: 24px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; margin: 0; }
.brand.big { font-size: 40px; text-align: center; }

/* ---------- Avatars & presence ---------- */
.avatar {
  position: relative; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-weight: 700; color: #fff;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.av-user { background: linear-gradient(135deg, #d36ff2, #f05aa8); }
.av-group { background: linear-gradient(135deg, #10b981, #3b82f6); }
.sp-news { background: radial-gradient(circle, #1e3a8a, #172554); }
.sp-love { background: radial-gradient(circle, #831843, #500724); }
.sp-report { background: radial-gradient(circle, #7f1d1d, #450a0a); }
.sp-news-text { color: #93c5fd; }
.sp-love-text { color: #f9a8d4; }
.sp-report-text { color: #fca5a5; }
.dot { position: absolute; right: -1px; bottom: -1px; width: 30%; height: 30%; min-width: 10px; min-height: 10px; border-radius: 50%; border: 2px solid var(--side); }
.dot-online { background: #22c55e; }
.dot-call { background: #f97316; }
.dot-offline { background: rgba(148,163,184,.35); }

/* ---------- Ecrans de connexion ---------- */
.auth-bg, .admin-bg {
  min-height: 100%;
  background: linear-gradient(135deg, #5b168f 0%, #3b2a8a 40%, #263a8f 100%);
}
.auth-bg { display: flex; align-items: center; justify-content: center; padding: 16px; }
.auth-card {
  width: 100%; max-width: 440px; background: rgba(23, 26, 58, .82); border-radius: 22px; padding: 34px;
  display: flex; flex-direction: column; gap: 16px; box-shadow: 0 25px 60px rgba(0,0,0,.35);
}
.auth-sub { text-align: center; color: #d8b4fe; margin: -6px 0 6px; }
.alert { background: rgba(127, 29, 29, .55); border: 1px solid #b91c1c; color: #fecaca; padding: 12px; border-radius: 10px; text-align: center; font-size: 14px; }

.center-screen { height: 100%; min-height: 200px; display: flex; align-items: center; justify-content: center; }
.spinner { width: 36px; height: 36px; border: 3px solid rgba(255,255,255,.15); border-top-color: var(--violet); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.ban-screen { min-height: 100%; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px; text-align: center; }
.ban-icon { color: #ef4444; stroke-width: 2.5; }
.ban-screen h1 { color: #ef4444; font-size: 38px; margin: 10px 0 0; }
.ban-count { font-family: 'Courier New', monospace; font-weight: 700; color: #f87171; font-size: 36px; }
.ban-screen .btn { margin-top: 18px; }

/* ---------- Panneau admin ---------- */
.admin-wrap { max-width: 1240px; margin: 0 auto; padding: 28px 16px 60px; display: flex; flex-direction: column; gap: 24px; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.admin-head .brand { font-size: 32px; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.card { background: rgba(23, 26, 58, .78); border-radius: 18px; padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.card h2 { margin: 0 0 4px; font-size: 20px; display: flex; align-items: center; gap: 8px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.input-search { max-width: 320px; }
.form-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.special-row, .student-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; }
.special-row.sp-news { background: #1e3a8a; }
.special-row.sp-love { background: #4a1340; }
.special-row.sp-report { background: #4a1525; }
.student-row { background: var(--panel-2); flex-wrap: wrap; }
.row-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.row-sub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-ban { font-size: 13px; color: #f87171; margin-top: 2px; }
.row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- Messagerie ---------- */
.chat-layout { display: flex; height: 100%; overflow: hidden; }
.sidebar { width: 345px; flex-shrink: 0; background: var(--side); border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; }
.side-actions { display: flex; gap: 6px; }
.impersonate-bar { margin: 0 16px 8px; padding: 6px 10px; font-size: 12.5px; border-radius: 8px; background: #431407; color: #fdba74; text-align: center; }
.me-card { margin: 0 16px; display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: #172036; border: 0; text-align: left; }
.me-card:hover { background: #1c2742; }
.side-search { margin: 12px 16px; width: calc(100% - 32px); }
.side-scroll { flex: 1; overflow-y: auto; border-top: 1px solid var(--border); padding-bottom: 12px; }
.section { padding-top: 6px; }
.section-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 16px 4px; }
.section-toggle { background: none; border: 0; color: #8b95a7; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; display: flex; align-items: center; gap: 6px; padding: 4px 0; }
.tri { display: inline-block; transition: transform .15s; font-size: 13px; }
.tri.closed { transform: rotate(-90deg); }
.side-empty { color: var(--muted); font-size: 13px; padding: 4px 16px; margin: 0; }
.conv-row { width: calc(100% - 16px); margin: 2px 8px; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: none; border: 1px solid transparent; text-align: left; }
.conv-row:hover { background: #151d33; }
.conv-row.active { background: #3b1366; border-color: #6b21a8; }
.conv-row.blocked { opacity: .55; }
.conv-text { flex: 1; min-width: 0; }
.conv-top, .conv-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.conv-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-time { font-size: 11.5px; color: var(--muted); flex-shrink: 0; }
.conv-sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blocked-icon { color: #f87171; vertical-align: -2px; }
.side-foot { padding: 10px 16px; border-top: 1px solid var(--border); }

.chat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }
.welcome { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; padding: 16px; }
.welcome-icon { width: 136px; height: 136px; border-radius: 50%; background: linear-gradient(135deg, #c86af0, #ec4899); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.welcome h2 { margin: 0; }
.welcome p { color: #c084fc; margin: 6px 0 0; }

.conv { flex: 1; display: flex; flex-direction: column; min-height: 0; background: #0f111c; }
.conv-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--side); border-bottom: 1px solid var(--border); }
.conv-head-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; background: none; border: 0; text-align: left; padding: 0; }
.conv-head-actions { display: flex; gap: 8px; align-items: center; }
.back-btn { display: none; }
.messages { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 3px; }
.load-more { align-self: center; margin-bottom: 8px; }
.empty-chat { margin: auto; color: var(--muted); }
.day-sep { align-self: center; margin: 14px 0 8px; }
.day-sep span { background: #1e2537; color: #cbd5e1; font-size: 12.5px; padding: 5px 12px; border-radius: 8px; }
.msg-row { display: flex; }
.msg-row.mine { justify-content: flex-end; }
.msg-row.flash .bubble { box-shadow: 0 0 0 3px #facc15; }
.bubble { position: relative; max-width: min(70%, 560px); padding: 8px 12px 6px; border-radius: 14px; word-wrap: break-word; overflow-wrap: anywhere; }
.bubble-mine { background: var(--mine); border-bottom-right-radius: 4px; }
.bubble-other { background: var(--other); border-bottom-left-radius: 4px; }
.bubble-deleted { opacity: .7; }
.bubble-hidden { color: var(--muted); font-style: italic; font-size: 13.5px; }
.bubble-was-deleted { outline: 2px dashed #f87171; }
/* Prenom neutre par defaut : seules les couleurs achetees en boutique se distinguent */
.msg-name { font-size: 13px; font-weight: 600; margin-bottom: 2px; color: #e2e8f0; }
.msg-tag { font-size: 11.5px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.msg-fwd { font-size: 12px; color: rgba(255,255,255,.65); font-style: italic; display: flex; align-items: center; gap: 4px; }
.msg-text { white-space: pre-wrap; line-height: 1.4; }
.deleted-text { font-style: italic; color: rgba(255,255,255,.7); display: flex; align-items: center; gap: 6px; }
.msg-meta { font-size: 11px; color: rgba(255,255,255,.65); text-align: right; margin-top: 2px; display: flex; justify-content: flex-end; gap: 6px; white-space: nowrap; overflow-wrap: normal; word-wrap: normal; }
.edited { font-style: italic; }
.ticks { font-weight: 700; letter-spacing: -2px; }
.ticks.read { color: #67e8f9; }
.msg-menu-btn { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border: 0; border-radius: 7px; background: rgba(0,0,0,.35); display: none; align-items: center; justify-content: center; }
.bubble:hover .msg-menu-btn { display: inline-flex; }
.msg-menu { position: absolute; top: 30px; z-index: 20; background: #1f2937; border: 1px solid #374151; border-radius: 10px; padding: 6px; min-width: 170px; box-shadow: 0 12px 30px rgba(0,0,0,.45); }
.msg-menu.left { right: 0; }
.msg-menu.right { left: 0; }
.msg-menu button { width: 100%; display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 8px 10px; border-radius: 7px; text-align: left; font-size: 14px; }
.msg-menu button:hover { background: #374151; }
.msg-menu button.danger { color: #f87171; }
.reply-quote { display: flex; flex-direction: column; text-align: left; width: 100%; background: rgba(0,0,0,.25); border: 0; border-left: 3px solid #f0abfc; border-radius: 8px; padding: 5px 8px; margin: 2px 0 4px; }
.reply-who { font-size: 12px; font-weight: 600; color: #f0abfc; }
.reply-text { font-size: 13px; color: rgba(255,255,255,.8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-label { font-size: 12px; font-weight: 700; color: #fde68a; }
.hist-deleted { font-size: 12.5px; color: #fecaca; font-weight: 600; margin-top: 4px; }
.hist-hidden { font-size: 12px; color: #fdba74; margin-top: 2px; }
.att-img { display: block; max-width: 100%; max-height: 320px; border-radius: 10px; margin: 2px 0 4px; }
.att-video { display: block; max-width: 100%; max-height: 320px; border-radius: 10px; margin: 2px 0 4px; }
.att-audio { display: block; max-width: 260px; margin: 4px 0; }
.att-file { display: inline-flex; align-items: center; gap: 8px; background: rgba(0,0,0,.25); padding: 8px 12px; border-radius: 8px; color: #fff; text-decoration: none; margin: 2px 0 4px; }
.att-loading { font-size: 13px; color: var(--muted); }

.blocked-card { margin: auto; background: #1a2030; border-radius: 16px; padding: 22px 32px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.blocked-card span { color: var(--muted); font-size: 14px; }
.readonly-bar { padding: 16px; text-align: center; color: var(--muted); border-top: 1px solid var(--border); background: var(--side); }

.composer-wrap { border-top: 1px solid var(--border); background: #0b0f1c; }
.composer-ctx { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 16px 0; padding: 8px 12px; border-left: 3px solid var(--violet); background: #161d2f; border-radius: 8px; }
.ctx-title { font-size: 12.5px; font-weight: 600; color: #d8b4fe; }
.ctx-text { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60vw; }
.composer { display: flex; align-items: flex-end; gap: 10px; padding: 12px 16px; }
.composer .icon-btn { width: 46px; height: 46px; }
.composer-input { resize: none; min-height: 46px; max-height: 160px; line-height: 1.4; }
.btn-send { background: var(--grad); color: #fff; }

/* ---------- Modales ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.65); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal { width: 100%; max-width: 460px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--panel); border-radius: 18px; padding: 22px 24px 24px; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.modal-wide { max-width: 640px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-head h2 { margin: 0; font-size: 22px; }
.modal-head .icon-btn { background: #334155; }
.dlg-text { color: #cbd5e1; line-height: 1.5; margin: 0 0 18px; }
.dlg-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 6px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.panel { background: var(--panel-2); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.panel-title { font-weight: 600; color: var(--text); }
.profile { display: flex; flex-direction: column; gap: 14px; }
.profile-avatar { align-self: center; background: none; border: 0; padding: 0; border-radius: 50%; }
.profile-avatar.editable { cursor: pointer; outline: 3px dashed transparent; }
.profile-avatar.editable:hover { outline-color: var(--violet); }
.profile-avatar:disabled { opacity: 1; cursor: default; }
.official-chip { margin-top: 6px; background: #3a2f22; border: 1px solid #a16207; color: #facc15; padding: 8px 12px; border-radius: 6px; font-size: 14px; }
.bio { margin: 0; white-space: pre-wrap; }
.group-head { display: flex; align-items: center; gap: 14px; }
.picker { display: flex; flex-direction: column; gap: 8px; }
.picker-list { max-height: 280px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.picker-row { display: flex; flex-direction: row; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: none; border: 0; color: var(--text); font-size: 14.5px; text-align: left; cursor: pointer; }
.picker-row:hover { background: var(--panel-2); }
.member-list { display: flex; flex-direction: column; gap: 6px; }
.member-row { display: flex; align-items: center; gap: 10px; background: var(--panel-2); border-radius: 10px; padding: 10px 12px; flex-wrap: wrap; }

/* ---------- News ---------- */
.news-wrap { max-width: 760px; margin: 0 auto; padding: 32px 16px; }
.news-card { gap: 18px; }
.news-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.news-title { margin: 0; font-size: 30px; background: linear-gradient(90deg, #60a5fa, #22d3ee); -webkit-background-clip: text; background-clip: text; color: transparent; }
.news-head p { margin: 2px 0 0; }
.news-actions { display: flex; gap: 10px; margin-top: 6px; }
.file-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stat { border-radius: 12px; padding: 18px; text-align: center; display: flex; flex-direction: column; }
.stat b { font-size: 34px; }
.stat-blue { background: #1e3a8a66; color: #93c5fd; }
.stat-green { background: #14532d66; color: #4ade80; }
.news-post { position: relative; background: #172036; border-radius: 10px; padding: 12px 44px 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.news-del { position: absolute; top: 6px; right: 6px; }

/* ---------- Appels ---------- */
.btn-blue { background: var(--blue); color: #fff; }
.call-head-btn { padding: 8px 12px; }
.call-btn { width: 60px; height: 60px; border-radius: 50%; border: 0; display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.call-btn:hover { filter: brightness(1.15); }
.call-red { background: #dc2626 !important; color: #fff !important; }
.call-green { background: #16a34a; }
.call-dark { background: rgba(255,255,255,.14); }
.call-white { background: #f1f5f9; color: #0f172a; }
.call-actions { display: flex; gap: 22px; justify-content: center; align-items: center; }
.call-title { font-size: 22px; font-weight: 700; }
.call-pulse { border-radius: 50%; animation: ring 1.6s infinite; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(168,85,247,.55); } 100% { box-shadow: 0 0 0 26px rgba(168,85,247,0); } }

.call-incoming-back { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; padding: 16px; }
.call-incoming { width: 100%; max-width: 360px; background: linear-gradient(160deg, #2e1065, #111827); border-radius: 24px; padding: 34px 24px 30px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.call-incoming .call-actions { margin-top: 18px; gap: 54px; }

.call-screen { position: fixed; inset: 0; z-index: 70; background: radial-gradient(circle at top, #2e1065, #030712 70%); display: flex; flex-direction: column; padding: 18px 18px 28px; gap: 16px; }
.call-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.call-grid { flex: 1; min-height: 0; display: grid; gap: 12px; grid-template-columns: 1fr; }
.call-grid.n2 { grid-template-columns: 1fr 1fr; }
.call-grid.n3, .call-grid.n4 { grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; }
.call-tile { position: relative; background: rgba(15,23,42,.7); border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; overflow: hidden; min-height: 160px; }
.call-tile.waiting { background: transparent; gap: 26px; }
.call-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.call-video.hidden { display: none; }
.call-video.mirror { transform: scaleX(-1); }
.call-video.screen { object-fit: contain; }
.call-grid:has(.call-tile.sharing) { grid-template-columns: 1fr; }
.call-grid:has(.call-tile.sharing) .call-tile:not(.sharing) { display: none; }
.call-self-label { position: absolute; left: 6px; bottom: 6px; font-size: 11px; background: rgba(0,0,0,.6); padding: 2px 6px; border-radius: 6px; }
.call-name { position: relative; background: rgba(0,0,0,.5); padding: 4px 10px; border-radius: 8px; font-size: 14px; }
.call-tile:has(.call-video:not(.hidden)) .call-name { position: absolute; left: 10px; bottom: 10px; }
.call-self { position: absolute; right: 22px; bottom: 116px; width: 150px; height: 112px; border-radius: 14px; overflow: hidden; background: #111827; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 30px rgba(0,0,0,.5); border: 2px solid rgba(255,255,255,.15); }

.call-mini { position: fixed; z-index: 70; top: 12px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; background: #14532d; border: 1px solid #22c55e; border-radius: 999px; padding: 4px 6px 4px 14px; box-shadow: 0 10px 30px rgba(0,0,0,.5); max-width: calc(100vw - 32px); }
.call-mini .icon-btn { width: 36px; height: 36px; border-radius: 50%; }
.call-mini-dot { width: 10px; height: 10px; border-radius: 50%; background: #4ade80; animation: pulse 1s infinite; flex-shrink: 0; }
.call-mini-main { background: none; border: 0; display: flex; flex-direction: column; text-align: left; line-height: 1.2; min-width: 0; }
.call-mini-main b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.call-mini-main span { font-size: 12px; color: #bbf7d0; }

@media (max-width: 760px) {
  .call-head-btn span { display: none; }
  .call-grid.n2 { grid-template-columns: 1fr; }
  .call-self { width: 100px; height: 140px; bottom: 112px; right: 14px; }
}

/* ---------- Cosmetiques ---------- */
.avatar.has-frame::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%; pointer-events: none; z-index: 1;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3.5px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3.5px), #000 calc(100% - 3px));
}
.avatar .dot { z-index: 2; }
.bd { display: inline-block; margin-left: 4px; font-size: .95em; line-height: 1; }
.banner { height: 96px; border-radius: 14px; background: linear-gradient(135deg, #1e293b, #0f172a); }
.profile-avatar.on-banner { margin-top: -66px; border-radius: 50%; box-shadow: 0 0 0 5px var(--panel); }
.profile-name { font-size: 18px; }

.wallet-pill { margin: 0 16px 10px; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; border: 1px solid #3b2a6b; background: linear-gradient(90deg, #1e1440, #2a1338); text-align: left; }
.wallet-pill:hover { filter: brightness(1.15); }
.wallet-pill .streak { font-weight: 700; color: #fb923c; }
.wallet-pill .streak.cold { color: var(--muted); }
.wallet-pill .sparks { font-weight: 700; color: #fde68a; }
.wallet-pill .shop-label { margin-left: auto; font-size: 12.5px; font-weight: 600; color: #e9d5ff; background: #6b21a8; padding: 3px 9px; border-radius: 999px; }

.shop-head { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.shop-stat { background: var(--panel-2); border-radius: 12px; padding: 10px; text-align: center; display: flex; flex-direction: column; }
.shop-stat b { font-size: 20px; }
.shop-stat span { font-size: 12px; color: var(--muted); }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 12px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 10px 12px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.active { color: #fff; border-bottom-color: var(--violet); }
.shop-timer { margin: 0 0 12px; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.shop-card {
  position: relative; border-radius: 14px; padding: 12px 10px 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  background: linear-gradient(180deg, color-mix(in srgb, var(--r) 18%, #111827), #111827 70%);
  border: 1px solid color-mix(in srgb, var(--r) 45%, transparent);
}
.shop-card.is-equipped { box-shadow: 0 0 0 2px var(--violet); }
.shop-card.rarity-legendary { box-shadow: 0 0 14px color-mix(in srgb, var(--r) 35%, transparent); }
.shop-card.rarity-mythic { box-shadow: 0 0 18px color-mix(in srgb, var(--r) 45%, transparent); animation: cx-card-mythic 3s ease-in-out infinite; }
@keyframes cx-card-mythic { 50% { box-shadow: 0 0 26px color-mix(in srgb, var(--r) 70%, transparent); } }
.shop-rarity { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--r); }
.shop-preview { height: 72px; width: 100%; display: flex; align-items: center; justify-content: center; }
.shop-name { font-weight: 700; font-size: 14px; }
.shop-slot { font-size: 12px; color: var(--muted); }
.shop-card .btn { width: 100%; margin-top: 4px; }
.btn-buy { background: linear-gradient(90deg, #a16207, #d97706); color: #fff; }
.preview-name { font-weight: 700; font-size: 16px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-badge { font-size: 36px; margin: 0; }
.preview-banner { width: 100%; height: 64px; border-radius: 10px; }
.preview-bubble { max-width: 100%; text-align: left; }
.ring-preview { display: flex; flex-direction: column; align-items: center; gap: 2px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); border-radius: 12px; padding: 6px 14px; font-size: 12.5px; font-weight: 600; }
.ring-preview:hover { background: rgba(255,255,255,.12); }
.ring-preview .ring-icon { font-size: 26px; line-height: 1; }
.ring-preview.playing .ring-icon { animation: cx-ring 0.25s ease-in-out infinite; }
@keyframes cx-ring { 0%, 100% { transform: rotate(-14deg); } 50% { transform: rotate(14deg); } }
.inv-title { margin: 6px 0 8px; }
.help p { margin: 0; line-height: 1.5; color: #cbd5e1; }
.rarity-list { display: flex; flex-wrap: wrap; gap: 6px; }
.rarity-list .chip { margin: 0; }

.reward { max-width: 380px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; background: radial-gradient(circle at top, #4c1d95, var(--panel) 70%); }
.reward h2 { margin: 0; }
.reward p { margin: 4px 0; }
.reward-fire { font-size: 64px; animation: cx-float 1.6s ease-in-out infinite; filter: drop-shadow(0 0 16px #f97316); }
.reward-gain { font-size: 40px; font-weight: 800; color: #fde68a; text-shadow: 0 0 18px #f59e0b88; }
.reward-bonus { color: #fb923c; font-weight: 700; }
.reward-streak { color: #fdba74; font-weight: 600; }
.shop-promo { position: absolute; top: 8px; right: -4px; background: linear-gradient(90deg, #16a34a, #22c55e); color: #fff; font-weight: 800; font-size: 12.5px; padding: 3px 9px; border-radius: 6px 0 0 6px; box-shadow: 0 4px 10px rgba(0,0,0,.35); }
.shop-old-price { font-size: 12px; color: var(--muted); text-decoration: line-through; margin-bottom: -4px; }
.promo-banner { background: linear-gradient(90deg, #14532d, #166534); border: 1px solid #22c55e; color: #dcfce7; padding: 10px 14px; border-radius: 12px; margin-bottom: 10px; }
.admin-shop-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: #431407; border: 1px solid #ea580c; color: #fed7aa; padding: 10px 12px; border-radius: 12px; margin-bottom: 12px; font-size: 13.5px; }
.code-input { font-family: 'Courier New', monospace; font-size: 20px; letter-spacing: .08em; text-align: center; text-transform: uppercase; }
.gift-items { display: flex; flex-direction: column; gap: 6px; width: 100%; max-height: 300px; overflow-y: auto; }
.gift-item { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 18px; border-radius: 12px; border: 1px solid var(--r); background: color-mix(in srgb, var(--r) 15%, transparent); margin: 6px 0; }
.center-actions { justify-content: center; margin-top: 10px; }

/* ---------- Badge de l'hebergeur (fixe, en bas a droite) ---------- */
.host-badge { --badge-h: 56px; }
.host-badge .composer-wrap,
.host-badge .readonly-bar,
.host-badge .side-foot { padding-bottom: var(--badge-h); }
.host-badge .modal-back { padding-bottom: calc(16px + var(--badge-h)); }
.host-badge .call-screen { padding-bottom: calc(28px + var(--badge-h)); }
.host-badge .call-self { bottom: calc(116px + var(--badge-h)); }
.host-badge .admin-wrap, .host-badge .news-wrap { padding-bottom: calc(60px + var(--badge-h)); }
.host-badge .toasts { bottom: calc(20px + var(--badge-h)); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 100; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: #1e293b; border: 1px solid #334155; padding: 10px 16px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.4); font-size: 14px; }
.toast-error { background: #450a0a; border-color: #b91c1c; color: #fecaca; }

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
  .admin-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .sidebar { width: 100%; border-right: 0; }
  .chat-main { display: none; }
  .chat-layout.has-open .sidebar { display: none; }
  .chat-layout.has-open .chat-main { display: flex; }
  .back-btn { display: inline-flex; }
  .messages { padding: 12px; }
  .bubble { max-width: 85%; }
  .msg-menu-btn { display: inline-flex; opacity: .7; }
  .form-2 { grid-template-columns: 1fr; }
  .card { padding: 18px; }
  .admin-head .brand { font-size: 26px; }
  .row-actions { width: 100%; justify-content: flex-end; }
}
.call-audio { position: fixed; width: 0; height: 0; overflow: hidden; }

/* Vitrines d'evenement (Halloween, Automne...) */
.event-section { border: 1px solid color-mix(in srgb, var(--ev) 55%, transparent); background: linear-gradient(160deg, color-mix(in srgb, var(--ev) 18%, transparent), transparent 70%); border-radius: 14px; padding: 10px 10px 0; margin-bottom: 12px; }
.event-section.event-halloween { background: radial-gradient(circle at 92% 0, #f9731633, transparent 45%), linear-gradient(160deg, #3b076455, #0c0a1d55 70%); }
.event-section.event-automne { background: radial-gradient(circle at 92% 0, #facc1526, transparent 45%), linear-gradient(160deg, #9a341244, #451a0333 70%); }
.event-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-bottom: 10px; }
.event-title { font-weight: 800; font-size: 16px; color: var(--ev); display: flex; align-items: center; gap: 8px; }
.event-pill { font-size: 11px; font-weight: 700; color: #fff; background: var(--ev); padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
.event-timer { font-size: 12.5px; color: var(--muted, #94a3b8); }
.event-timer b { color: #f8fafc; }
.shop-event-tag { position: absolute; top: 6px; left: 8px; font-size: 15px; filter: drop-shadow(0 0 4px rgba(0,0,0,.6)); }

/* Anniversaires (panneau admin) */
.field-label { font-size: 13px; color: var(--muted); margin-top: 2px; }
.form-3 { display: grid; grid-template-columns: 1fr 1.4fr 1.3fr; gap: 8px; }
.bday-chip { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: #ec489922; color: #f9a8d4; }
.bday-chip.today { background: linear-gradient(90deg, #ec4899, #f59e0b); color: #fff; font-weight: 700; }

/* Message d'anniversaire */
.bday-modal { position: relative; overflow: hidden; border: 1px solid #ec4899aa; background: radial-gradient(circle at 50% 0, #ec489944, transparent 60%), var(--panel, #111827); }
.bday-confetti { position: absolute; inset: 0; pointer-events: none; opacity: .9;
  background: radial-gradient(circle 3px at 10% 20%, #facc15 96%, transparent), radial-gradient(circle 2.5px at 30% 60%, #f472b6 96%, transparent),
    radial-gradient(circle 3px at 55% 15%, #22d3ee 96%, transparent), radial-gradient(circle 2.5px at 75% 45%, #a3e635 96%, transparent),
    radial-gradient(circle 3px at 90% 25%, #f472b6 96%, transparent), radial-gradient(circle 2px at 20% 85%, #22d3ee 96%, transparent);
  background-size: 100% 160px; animation: bday-fall 4s linear infinite; }
@keyframes bday-fall { to { background-position: 0 160px, 0 160px, 0 160px, 0 160px, 0 160px, 0 160px; } }
.bday-modal > *:not(.bday-confetti) { position: relative; z-index: 1; }
.bday-cake { filter: drop-shadow(0 0 18px #ec4899); }
.bday-age { font-size: 18px; font-weight: 700; color: #f9a8d4; margin: 0; }

/* ---- Secrets ---- */
.brand { cursor: default; user-select: none; display: inline-block; }
.brand-spin { animation: cx-spin .5s linear 4; }
.fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 200; overflow: hidden; }
.fx-p { position: absolute; display: block; }
.fx-fall { top: -30px; border-radius: 2px; animation: fx-fall var(--d) linear var(--delay) both; }
.fx-px { border-radius: 0; animation-timing-function: steps(24); }
.fx-txt { background: none !important; line-height: 1; }
@keyframes fx-fall { from { transform: translate(0, 0) rotate(0); } to { transform: translate(var(--x2), 110vh) rotate(var(--r)); } }
.fx-burst { width: 6px; height: 6px; border-radius: 50%; opacity: 0; animation: fx-burst 1.3s ease-out var(--delay) both; }
@keyframes fx-burst { 0% { transform: translate(0, 0); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)); opacity: 0; } }
.fx-rise { bottom: -30px; animation: fx-rise var(--d) ease-out var(--delay) both; }
@keyframes fx-rise { from { transform: none; opacity: 1; } to { transform: translate(var(--x2), -70vh) scale(1.3); opacity: 0; } }
.golden-star { position: fixed; z-index: 150; background: none; border: 0; font-size: 44px; cursor: pointer; padding: 6px;
  filter: drop-shadow(0 0 14px #facc15) drop-shadow(0 0 4px #fff); animation: gs-fly 11s linear forwards; }
.golden-star span { display: inline-block; animation: cx-spin 1.5s linear infinite; }
@keyframes gs-fly { 0% { left: -70px; top: 65%; } 25% { top: 30%; } 50% { top: 55%; } 75% { top: 22%; } 100% { left: 105%; top: 45%; } }
.secret-cat { position: fixed; z-index: 150; bottom: 6px; left: -80px; background: none; border: 0; font-size: 42px; cursor: pointer; animation: cat-walk 18s linear forwards; }
.secret-cat span { display: inline-block; transform: scaleX(-1); animation: cat-bob .5s ease-in-out infinite alternate; }
@keyframes cat-walk { to { left: 105%; } }
@keyframes cat-bob { to { transform: scaleX(-1) translateY(-4px); } }
.ach-popup { border: 1px solid #facc15aa; background: radial-gradient(circle at 50% 0, #facc1533, transparent 60%), var(--panel); }
.ach-label { font-weight: 800; color: #fde68a; letter-spacing: .04em; }
.ach-emoji { font-size: 64px; animation: cx-float 1.6s ease-in-out infinite; filter: drop-shadow(0 0 16px #facc15); }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; margin-bottom: 14px; }
.ach-card { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--panel-2); border: 1px dashed var(--border); opacity: .8; }
.ach-card.done { opacity: 1; border: 1px solid #facc1577; background: linear-gradient(135deg, #facc1518, var(--panel-2)); }
.ach-card-emoji { font-size: 30px; width: 40px; text-align: center; }
.ach-card:not(.done) .ach-card-emoji { filter: grayscale(1); opacity: .6; }
.ach-reward { color: #fde68a; margin-top: 2px; }
.ghost-banner { background: linear-gradient(90deg, #0f172a, #334155, #0f172a); background-size: 200% 100%; animation: cx-shine 4s linear infinite; border: 1px solid #e2e8f0aa; color: #f8fafc; padding: 10px 14px; border-radius: 12px; margin-bottom: 10px; box-shadow: 0 0 16px #e2e8f044; }
.shop-card.rarity-secret { background: linear-gradient(180deg, #334155, #020617 75%); border: 1px solid #f8fafc; animation: cx-glow-ghost 3s ease-in-out infinite; }
.shop-card.rarity-secret .shop-rarity { color: #fff; text-shadow: 0 0 8px #fff; }
.gift-item.rarity-secret { box-shadow: 0 0 14px #f8fafc66; }
/* 1er avril : les pseudos a l'envers pendant 10 secondes */
.cx-april .nm { display: inline-block; transform: rotate(180deg); transition: transform .6s; }
/* Vendredi 13 : ambiance sombre et rouge toute la journee */
body.cx-f13 { --bg: #0a0203; --side: #120405; --panel: #180607; --panel-2: #250a0b; --input: #220909; --border: #3f1214;
  --violet: #dc2626; --violet-strong: #b91c1c; --pink: #f87171; --grad: linear-gradient(90deg, #7f1d1d, #dc2626); --mine: #4c1414; --other: #2a0d0e; }
body.cx-f13::after { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 190; box-shadow: inset 0 0 120px #7f1d1daa; animation: f13-flicker 7s linear infinite; }
@keyframes f13-flicker { 0%, 92%, 96%, 100% { opacity: 1; } 94% { opacity: .3; } }

/* ---- Mythisiel : la rarete ultime ---- */
.shop-card.rarity-mythisiel, .gift-item.rarity-mythisiel {
  border: 2px solid transparent;
  background: linear-gradient(180deg, #1e1037, #05030f 80%) padding-box,
    linear-gradient(90deg, #fff, #67e8f9, #c4b5fd, #f9a8d4, #fde68a, #fff, #67e8f9) border-box;
  background-size: 100% 100%, 300% 100%;
  animation: myth-border 3s linear infinite, cx-glow-mythisiel 4s linear infinite;
}
.shop-card.rarity-mythisiel .shop-rarity, .gift-item.rarity-mythisiel .shop-rarity {
  background: linear-gradient(90deg, #fff, #a5f3fc, #f0abfc, #fde68a, #fff); background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: cx-shine 2s linear infinite;
  font-size: 12.5px; letter-spacing: .18em;
}
@keyframes myth-border { to { background-position: 0 0, 300% 0; } }
.mythisiel-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 12px; margin-bottom: 10px; color: #fff;
  border: 2px solid transparent;
  background: linear-gradient(90deg, #1e1037, #0b0620, #1e1037) padding-box, linear-gradient(90deg, #fff, #67e8f9, #c4b5fd, #f9a8d4, #fde68a, #fff, #67e8f9) border-box;
  background-size: 100% 100%, 300% 100%; animation: myth-border 3s linear infinite, cx-glow-mythisiel 4s linear infinite; }

/* ---- Fonds de discussion : mon fond a droite, celui de l'autre a gauche, fondus au centre ---- */
.messages-area { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.messages-area > .messages { position: relative; z-index: 1; }
.chatbg-layer { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.chatbg-layer.side-left { -webkit-mask-image: linear-gradient(100deg, #000 0 36%, transparent 64%); mask-image: linear-gradient(100deg, #000 0 36%, transparent 64%); }
.chatbg-layer.side-right { -webkit-mask-image: linear-gradient(280deg, #000 0 36%, transparent 64%); mask-image: linear-gradient(280deg, #000 0 36%, transparent 64%); }
.preview-chatbg { position: relative; width: 100%; height: 64px; border-radius: 10px; overflow: hidden; background: #0f111c; }
.preview-chatbg .chatbg-layer.side-right { -webkit-mask-image: linear-gradient(280deg, #000 0 45%, transparent 85%); mask-image: linear-gradient(280deg, #000 0 45%, transparent 85%); }
.pv-bubble { position: absolute; z-index: 1; height: 12px; border-radius: 6px; }
.pv-left { left: 8px; top: 10px; width: 46%; background: var(--other); }
.pv-right { right: 8px; top: 28px; width: 40%; background: var(--mine); }
.pv-right.short { top: 44px; width: 24%; }

/* ---- Secrets arcade ---- */
.secret-ufo { position: fixed; z-index: 150; top: 10px; left: -70px; background: none; border: 0; font-size: 34px; cursor: crosshair; padding: 6px;
  filter: drop-shadow(0 0 10px #4ade80); animation: ufo-fly 9s linear forwards; }
.secret-ufo span { display: inline-block; animation: ufo-wobble .8s ease-in-out infinite alternate; }
@keyframes ufo-fly { 0% { left: -70px; top: 10px; } 30% { top: 40px; } 60% { top: 14px; } 100% { left: 105%; top: 34px; } }
@keyframes ufo-wobble { from { transform: rotate(-8deg) translateY(-2px); } to { transform: rotate(8deg) translateY(2px); } }
.dino-offline { position: fixed; z-index: 160; left: 50%; bottom: 16px; transform: translateX(-50%); width: min(420px, calc(100vw - 32px));
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 8px; box-shadow: 0 20px 50px rgba(0,0,0,.5); text-align: center; }
.dino-offline .banner { height: 80px; margin-bottom: 6px; }

/* ---- Photos de profil (10 emplacements) ---- */
.photo-slots-wrap { margin: 6px 0 4px; }
.photo-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 10px 8px; margin-top: 8px; }
.photo-slot { position: relative; aspect-ratio: 1; border-radius: 50%; }
.photo-slot-img, .photo-slot-empty { width: 100%; height: 100%; border-radius: 50%; padding: 0; overflow: hidden; cursor: pointer;
  border: 2px solid var(--border); background: var(--panel-2); color: #94a3b8; font-size: 22px; }
.photo-slot-empty { border-style: dashed; }
.photo-slot-empty:hover:not(:disabled), .photo-slot-img:hover { border-color: var(--violet); }
.photo-slot-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-slot.active .photo-slot-img { border-color: var(--violet); box-shadow: 0 0 0 3px #a855f755; }
.photo-slot-x { position: absolute; top: -4px; right: -4px; width: 20px; height: 20px; border-radius: 50%; border: 0; padding: 0;
  background: #ef4444; color: #fff; font-size: 11px; cursor: pointer; display: none; }
.photo-slot:hover .photo-slot-x { display: block; }
@media (hover: none) { .photo-slot-x { display: block; } }
.photo-slot-studio { position: absolute; bottom: -9px; left: 50%; transform: translateX(-50%); white-space: nowrap; border: 0; border-radius: 99px;
  padding: 2px 7px; font-size: 10px; font-weight: 700; cursor: pointer; background: var(--grad); color: #fff; }
.photo-slot.perso.active .photo-slot-img { border-color: #f0abfc; box-shadow: 0 0 0 3px #f0abfc55; }

/* ---- Studio du perso 3D ---- */
.studio { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start; }
.studio-stage { position: sticky; top: 0; }
.studio-canvas { width: 300px; height: 380px; display: block; border-radius: 16px; touch-action: none; cursor: grab; background: var(--panel-2); }
.studio-canvas:active { cursor: grabbing; }
.studio-panel { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.studio-tabs { flex-wrap: wrap; }
.studio-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.av-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; max-height: 300px; overflow-y: auto; padding: 2px; }
.av-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px; border-radius: 12px; cursor: pointer;
  border: 2px solid var(--border); background: var(--panel-2); color: inherit; font: inherit; }
.av-item img { width: 72px; height: 72px; border-radius: 50%; display: block; }
.av-item-name { font-size: 11px; line-height: 1.2; text-align: center; }
.av-item:hover { border-color: var(--r, var(--violet)); }
.av-item.active { border-color: var(--violet); box-shadow: 0 0 0 3px #a855f744; }
.av-item.locked img { filter: saturate(.55) brightness(.8); }
.av-item.locked .av-item-name { color: var(--r); }
.av-swatches { display: flex; flex-wrap: wrap; gap: 7px; }
.av-swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #ffffff33; background: var(--c); cursor: pointer; padding: 0; font-size: 11px;
  display: inline-flex; align-items: center; justify-content: center; box-shadow: inset 0 -4px 8px #0003; }
.av-swatch.active { outline: 3px solid var(--violet); outline-offset: 2px; }
.av-swatch.locked { opacity: .75; border-color: var(--r); }
.av-swatch.mat-metal { background: linear-gradient(135deg, #fff8 0, var(--c) 35%, #0004 70%, var(--c) 100%); }
.av-swatch.mat-glow { box-shadow: 0 0 10px var(--c), inset 0 0 6px #fff8; }
.av-swatch.mat-iri, .av-swatch.mat-holo { background: conic-gradient(#f9a8d4, #a5f3fc, #fde68a, #c4b5fd, #86efac, #f9a8d4); }
.av-swatch.mat-galaxy { background: radial-gradient(circle at 30% 30%, #fff 0 1px, transparent 2px), radial-gradient(circle at 70% 60%, #fff 0 1px, transparent 2px), linear-gradient(135deg, #1e1b4b, #581c87, #0c4a6e); }
.av-swatch.mat-celeste { background: radial-gradient(circle at 35% 35%, #fff 0 1.5px, transparent 2.5px), linear-gradient(135deg, #fdf4ff, #c4b5fd, #a5f3fc, #fbcfe8); box-shadow: 0 0 10px #f0abfc; }
.av-swatch.big { width: 56px; height: 56px; }
.av-preview { width: 72px; height: 72px; border-radius: 50%; display: block; background: var(--panel-2); }
.studio-warn { margin-top: 12px; padding: 8px 12px; border-radius: 10px; background: #f59e0b22; border: 1px solid #f59e0b77; font-size: 13px; }
.studio-actions { align-items: center; }
@media (max-width: 720px) {
  .studio { grid-template-columns: 1fr; }
  .studio-stage { position: static; display: flex; flex-direction: column; align-items: center; }
  .studio-canvas { width: min(300px, 100%); height: 300px; }
}
.studio-actions input[type="checkbox"] { width: auto; margin: 0; }
.photo-slot-menu { position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 5; display: flex; flex-direction: column; gap: 4px;
  padding: 6px; border-radius: 12px; background: var(--panel); border: 1px solid var(--border); box-shadow: 0 12px 30px rgba(0,0,0,.45); white-space: nowrap; }
.photo-slot-menu button { border: 0; border-radius: 8px; padding: 7px 10px; background: var(--panel-2); color: inherit; font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.photo-slot-menu button:hover { background: var(--violet); color: #fff; }
