:root {
  --bg: #0f0624; --bg2: #1a0b3a; --panel: rgba(255,255,255,.06); --panel2: rgba(255,255,255,.10); --line: rgba(255,255,255,.12);
  --text: #fff6ea; --muted: #b7a6dc; --accent: #ffc233; --pink: #ff4fa3; --cyan: #37e6ff; --ok: #35e0a1; --bad: #ff6b7d; --blue: #6a8dff;
  --radius: 16px; --shadow: 0 12px 40px rgba(0,0,0,.35);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: radial-gradient(110% 60% at 50% -10%, #3b1a78 0%, var(--bg2) 38%, var(--bg) 100%) fixed; color: var(--text);
  font: 16px/1.5 "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; min-height: 100vh; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; line-height: 1.15; }
h1 { font-size: 30px; } h2 { font-size: 22px; } h3 { font-size: 17px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); } .ok { color: var(--ok); } .bad { color: var(--bad); } .tiny { font-size: 13px; }
.mono { font-family: ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace; }
[hidden] { display: none !important; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border: 0; border-radius: 12px; font: inherit; font-weight: 700;
  cursor: pointer; text-decoration: none; color: #2a1200; background: linear-gradient(135deg, #ffd45a, #ffa51f); box-shadow: 0 6px 18px rgba(255,165,31,.25); transition: transform .15s, box-shadow .15s, opacity .15s; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(255,165,31,.35); }
.btn:active { transform: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.pink { color: #fff; background: linear-gradient(135deg, #ff4fa3, #b03dff); box-shadow: 0 6px 18px rgba(255,79,163,.28); }
.btn.ghost { color: var(--text); background: transparent; border: 1.5px solid var(--line); box-shadow: none; }
.btn.ghost:hover { background: var(--panel); }
.btn.danger { color: var(--bad); background: transparent; border: 1.5px solid rgba(255,107,125,.5); box-shadow: none; }
.btn.danger:hover { background: rgba(255,107,125,.1); }
.btn.sm { padding: 6px 12px; font-size: 14px; border-radius: 10px; }
.btn.lg { padding: 15px 28px; font-size: 18px; border-radius: 14px; }
.btn.block { width: 100%; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }

/* ---------- Champs ---------- */
label.f { display: block; margin-bottom: 14px; font-weight: 600; font-size: 14px; color: var(--muted); }
label.f > span.hint { display: block; font-weight: 400; font-size: 13px; margin-top: 4px; color: var(--muted); opacity: .85; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=url], select, textarea {
  width: 100%; padding: 11px 14px; margin-top: 6px; border-radius: 12px; border: 1.5px solid var(--line); background: rgba(0,0,0,.28); color: var(--text); font: inherit; min-width: 0; }
textarea { resize: vertical; min-height: 80px; }
input:focus, select:focus, textarea:focus { border-color: var(--cyan); outline: none; box-shadow: 0 0 0 3px rgba(55,230,255,.18); }
select option { background: #1a0b3a; }
input[type=range] { width: 100%; accent-color: var(--accent); margin-top: 10px; }
input[type=color] { width: 54px; height: 42px; padding: 2px; border-radius: 10px; border: 1.5px solid var(--line); background: transparent; margin-top: 6px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; } .row.between { justify-content: space-between; }
.grid { display: grid; gap: 16px; } .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
@media (max-width: 760px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } .g4.keep2 { grid-template-columns: 1fr 1fr; } }

/* interrupteur */
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 600; margin-bottom: 12px; user-select: none; }
.switch input { appearance: none; width: 46px; height: 26px; border-radius: 13px; background: rgba(255,255,255,.18); position: relative; cursor: pointer; transition: background .2s; flex: none; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked { background: var(--ok); } .switch input:checked::after { transform: translateX(20px); }

/* ---------- Cartes & éléments ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; backdrop-filter: blur(6px); }
.card h3 { margin-bottom: 12px; }
.card + .card { margin-top: 16px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; background: var(--panel2); color: var(--text); white-space: nowrap; }
.badge.ok { background: rgba(53,224,161,.18); color: var(--ok); } .badge.bad { background: rgba(255,107,125,.18); color: var(--bad); }
.badge.gold { background: rgba(255,194,51,.18); color: var(--accent); } .badge.blue { background: rgba(106,141,255,.2); color: #a9bdff; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.live { background: var(--ok); box-shadow: 0 0 0 0 rgba(53,224,161,.6); animation: pulse 1.6s infinite; }
@keyframes pulse { to { box-shadow: 0 0 0 10px rgba(53,224,161,0); } }
.kpi { padding: 18px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.kpi b { display: block; font-size: 30px; line-height: 1.1; letter-spacing: -.02em; } .kpi span { color: var(--muted); font-size: 14px; }
.kpi.gold b { color: var(--accent); } .kpi.pink b { color: var(--pink); } .kpi.cyan b { color: var(--cyan); } .kpi.ok b { color: var(--ok); }
.progress { height: 10px; border-radius: 5px; background: rgba(255,255,255,.12); overflow: hidden; } .progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--pink)); border-radius: 5px; transition: width .5s; }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty .big { font-size: 42px; margin-bottom: 8px; }
.av { border-radius: 50%; display: inline-grid; place-items: center; font-weight: 800; color: #fff; overflow: hidden; flex: none; border: 2px solid rgba(255,255,255,.7); vertical-align: middle; }
.av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tab { padding: 10px 14px; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text); } .tab.on { color: var(--accent); border-bottom-color: var(--accent); }
.seg { display: inline-flex; background: rgba(0,0,0,.3); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { border: 0; background: none; color: var(--muted); font: inherit; font-weight: 700; padding: 8px 16px; border-radius: 9px; cursor: pointer; }
.seg button.on { background: var(--accent); color: #2a1200; }
.callout { padding: 12px 16px; border-radius: 12px; background: rgba(255,194,51,.1); border: 1px solid rgba(255,194,51,.4); margin-bottom: 14px; }
.callout.info { background: rgba(55,230,255,.08); border-color: rgba(55,230,255,.35); } .callout.bad { background: rgba(255,107,125,.1); border-color: rgba(255,107,125,.4); }

/* ---------- Tableaux ---------- */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 10px; white-space: nowrap; }
td { padding: 10px; border-top: 1px solid var(--line); vertical-align: middle; }
tr.hl td { background: rgba(255,255,255,.04); }
td.r, th.r { text-align: right; } td.nw { white-space: nowrap; }
.ell { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Fenêtres modales & notifications ---------- */
.overlay { position: fixed; inset: 0; background: rgba(8,2,20,.7); display: grid; place-items: center; padding: 16px; z-index: 50; backdrop-filter: blur(4px); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(560px, 100%); max-height: 92vh; overflow: auto; background: #1d0e42; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); animation: pop .25s cubic-bezier(.2, 1.2, .4, 1); }
.modal.wide { width: min(760px, 100%); }
@keyframes pop { from { opacity: 0; transform: scale(.94) translateY(12px); } }
.modal header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 8px; } .modal header h2 { font-size: 20px; }
.modal .body { padding: 8px 22px 6px; } .modal footer { padding: 14px 22px 20px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.x { border: 0; background: none; color: var(--muted); font-size: 26px; cursor: pointer; line-height: 1; }
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 80; width: min(440px, calc(100% - 24px)); pointer-events: none; }
.toast { padding: 12px 16px; border-radius: 14px; background: #2b1660; border: 1px solid var(--line); box-shadow: var(--shadow); font-weight: 600; animation: pop .25s both; }
.toast.ok { border-color: rgba(53,224,161,.6); } .toast.err { border-color: rgba(255,107,125,.7); }

/* ---------- Chargement ---------- */
.spin { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .001s !important; transition-duration: .001s !important; } }

/* ---------- Application (menu latéral) ---------- */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side { padding: 20px 14px; border-right: 1px solid var(--line); background: rgba(0,0,0,.2); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; padding: 4px 10px 18px; letter-spacing: -.02em; text-decoration: none; color: var(--text); }
.logo svg { width: 34px; height: 34px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; color: var(--muted); text-decoration: none; font-weight: 700; }
.nav a:hover { background: var(--panel); color: var(--text); } .nav a.on { background: var(--panel2); color: var(--accent); }
.nav .ic { width: 22px; text-align: center; font-size: 18px; }
.side .spacer { flex: 1; }
.me { padding: 12px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.me b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .me .row { margin-top: 8px; }
.main { padding: 26px clamp(16px, 3vw, 40px) 80px; min-width: 0; max-width: 1180px; width: 100%; margin: 0 auto; }
.page-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.banner { padding: 12px 18px; border-radius: 14px; background: linear-gradient(90deg, rgba(255,79,163,.25), rgba(106,141,255,.25)); border: 1px solid var(--line); margin-bottom: 18px; font-weight: 600; }
.topbar { display: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; bottom: 0; left: 0; right: 0; top: auto; height: auto; z-index: 40; flex-direction: row; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); background: rgba(15,6,36,.96); backdrop-filter: blur(10px); justify-content: space-around; }
  .side .logo, .side .spacer, .side .me { display: none; }
  .nav { display: flex; width: 100%; justify-content: space-around; }
  .nav a { flex-direction: column; gap: 2px; padding: 6px 8px; font-size: 11px; border-radius: 10px; } .nav .ic { font-size: 20px; }
  .topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .main { padding-bottom: 100px; }
}

/* ---------- LiveGames : catalogue, éditeur, médias, programmes ---------- */
.cat-h { font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin: 22px 0 10px; }
.gcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.gc { text-align: left; cursor: pointer; color: inherit; font: inherit; padding: 16px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); transition: transform .15s, border-color .15s, background .15s; display: flex; flex-direction: column; gap: 6px; }
.gc:hover { transform: translateY(-3px); border-color: rgba(255,255,255,.3); background: var(--panel2); }
.gc .e { font-size: 30px; line-height: 1; } .gc b { font-size: 16px; } .gc p { margin: 0; color: var(--muted); font-size: 13px; }
.gc .tag { align-self: flex-start; }
.game-card { display: flex; flex-direction: column; gap: 10px; margin: 0 !important; }
.game-card.blocked { border-color: rgba(255,107,125,.55); background: rgba(255,107,125,.06); }
.kicon { font-size: 22px; width: 30px; text-align: center; flex: none; }
.rrow { display: flex; gap: 12px; align-items: center; padding: 10px 14px; margin: 0 0 8px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.rrow .t { flex: 1; min-width: 0; } .rrow .t b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rrow .t span { display: block; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thumb { width: 54px; height: 40px; border-radius: 8px; object-fit: cover; background: rgba(0,0,0,.3); flex: none; }
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.mitem { border-radius: 14px; overflow: hidden; background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; cursor: default; position: relative; }
.mitem.pick { cursor: pointer; } .mitem.pick:hover, .mitem.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.mitem .pv { height: 110px; display: grid; place-items: center; background: rgba(0,0,0,.35); font-size: 40px; }
.mitem .pv img { width: 100%; height: 100%; object-fit: cover; }
.mitem .nm { padding: 8px 10px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mitem .act { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; }
.drop { border: 2px dashed var(--line); border-radius: 16px; padding: 22px; text-align: center; color: var(--muted); transition: border-color .2s, background .2s; cursor: pointer; }
.drop.on, .drop:hover { border-color: var(--accent); background: rgba(255,194,51,.06); color: var(--text); }
.track { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); margin-bottom: 8px; }
.track audio { height: 34px; flex: 1; min-width: 160px; }
.plitem { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: rgba(0,0,0,.25); border: 1px solid var(--line); margin-bottom: 8px; }
.plitem .n { width: 26px; height: 26px; border-radius: 50%; background: var(--panel2); display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; }
.plitem.now { border-color: var(--ok); box-shadow: 0 0 0 1px var(--ok); }
.livebox { padding: 16px; border-radius: 16px; background: rgba(0,0,0,.28); }
.livebox .ph { font-size: 20px; font-weight: 800; } .livebox .sub { color: var(--muted); font-size: 14px; }
.mini-ov { width: 100%; aspect-ratio: 9 / 16; border: 0; border-radius: 16px; background: #12051f; }
.imp-banner { position: sticky; top: 0; z-index: 45; padding: 10px 16px; background: linear-gradient(90deg, #ff4fa3, #b03dff); color: #fff; font-weight: 700; display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; }
.status-chip { display: inline-flex; gap: 6px; align-items: center; }
.opt-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: nowrap; }
.opt-row input[type=text] { margin-top: 0; }
.opt-row .l { width: 22px; font-weight: 800; text-align: center; flex: none; }
.scene-box { padding: 12px; border-radius: 12px; background: rgba(0,0,0,.22); border: 1px solid var(--line); margin-bottom: 10px; }

/* Aperçus des décors de fond (Réglages → Affichage) */
.bgp-venise { background: radial-gradient(circle at 84% 4%, #ffe9a8 0 56px, rgba(255,233,168,.25) 58px, rgba(255,233,168,0) 110px), linear-gradient(180deg, #3b1d5c 0%, #8a3a7a 24%, #f08a4b 40%, #f7b267 46%, #2a3f7a 52%, #18234f 75%, #0c1230 100%); }
.bgp-nuit { background: radial-gradient(circle at 84% 4%, #fff6d6 0 56px, rgba(255,246,214,.2) 58px, rgba(255,246,214,0) 110px), radial-gradient(120% 60% at 50% 0%, #26327a 0%, rgba(38,50,122,0) 60%), linear-gradient(180deg, #0b1236 0%, #070b22 60%, #03050f 100%); }
.bgp-ocean { background: radial-gradient(100% 50% at 50% 0%, #5be3ff 0%, rgba(91,227,255,0) 60%), linear-gradient(180deg, #0a7bb8 0%, #075c95 40%, #04325e 75%, #021a36 100%); }
.bgp-neon { background: linear-gradient(transparent 0 96%, rgba(255,79,163,.35) 96%) 0 0 / 100% 80px, linear-gradient(90deg, transparent 0 96%, rgba(55,230,255,.3) 96%) 0 0 / 80px 100%, radial-gradient(100% 60% at 50% 100%, #ff2d8a 0%, rgba(255,45,138,0) 60%), linear-gradient(180deg, #0d0221 0%, #261447 55%, #3d0e5f 100%); }
.bgp-foret { background: radial-gradient(80% 30% at 50% 0%, #b4f28a 0%, rgba(180,242,138,0) 60%), linear-gradient(180deg, #2e7d4f 0%, #1d5a39 45%, #0f3624 80%, #071d13 100%); }
.bgp-desert { background: radial-gradient(circle at 14% 4%, #fff2b0 0 70px, rgba(255,242,176,.25) 72px, rgba(255,242,176,0) 130px), linear-gradient(180deg, #ffb563 0%, #f08a4b 30%, #d1603d 48%, #a8432f 70%, #5c2420 100%); }
.bgp-espace { background: radial-gradient(40% 20% at 20% 25%, rgba(181,138,255,.45) 0%, rgba(181,138,255,0) 70%), radial-gradient(50% 25% at 80% 70%, rgba(55,230,255,.3) 0%, rgba(55,230,255,0) 70%), linear-gradient(180deg, #05010f 0%, #0d0630 50%, #02010a 100%); }
.bgp-bonbon { background: radial-gradient(70% 40% at 20% 10%, #ffd1ec 0%, rgba(255,209,236,0) 60%), radial-gradient(70% 40% at 80% 90%, #bde7ff 0%, rgba(189,231,255,0) 60%), linear-gradient(160deg, #ff8fc8 0%, #b88cff 50%, #7fb7ff 100%); }
.bgp-arcade { background: radial-gradient(120% 60% at 50% 0%, #ffcc00 0%, rgba(255,204,0,0) 45%), repeating-linear-gradient(45deg, rgba(255,255,255,.04) 0 30px, transparent 30px 60px), linear-gradient(180deg, #e8303d 0%, #8d1a6b 45%, #2b0f4c 100%); }
