/* Seedbox – interface mobile d'abord, clair / sombre automatique */
:root {
  --bg: #f3f5f9; --surface: #ffffff; --surface-2: #eef1f6; --surface-3: #e4e8f0; --border: #e1e5ed;
  --text: #161b26; --muted: #687187; --primary: #2f6fed; --primary-ink: #fff;
  --primary-soft: color-mix(in srgb, var(--primary) 12%, var(--surface));
  --ok: #16a35a; --ok-soft: #e3f6ea; --warn: #d98a00; --warn-soft: #fdf2dc; --danger: #dc3b3b; --danger-soft: #fdeaea;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 6px 20px rgba(16,24,40,.06);
  --radius: 16px; --tabbar: 64px; --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0d1016; --surface: #161a22; --surface-2: #1e232d; --surface-3: #272d39; --border: #272d38;
  --text: #e9ecf2; --muted: #939bb0; --primary: #6195ff; --ok: #3ccf82; --ok-soft: #133022; --warn: #f2b23a; --warn-soft: #33270f;
  --danger: #f26b6b; --danger-soft: #3a1c1f; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.25); color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #0d1016; --surface: #161a22; --surface-2: #1e232d; --surface-3: #272d39; --border: #272d38;
  --text: #e9ecf2; --muted: #939bb0; --primary: #6195ff; --ok: #3ccf82; --ok-soft: #133022; --warn: #f2b23a; --warn-soft: #33270f;
  --danger: #f26b6b; --danger-soft: #3a1c1f; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.25); color-scheme: dark; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: contain; }
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.ico { width: 22px; height: 22px; flex: none; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .hidden { display: none !important; }
.boot { display: grid; place-items: center; height: 100vh; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--primary); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Structure ---------- */
.shell { min-height: 100vh; display: flex; }
.side { display: none; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; padding-bottom: calc(var(--tabbar) + var(--safe-b) + 12px); }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: calc(10px + var(--safe-t)) 16px 10px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(14px) saturate(1.4); }
.top h1 { font-size: 1.35rem; margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.01em; }
.content { padding: 4px 16px 24px; max-width: 1100px; width: 100%; margin: 0 auto; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around;
  height: calc(var(--tabbar) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(16px) saturate(1.4); border-top: 1px solid var(--border); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font-size: .72rem; font-weight: 600; position: relative; }
.tabbar a.on { color: var(--primary); }
.tabbar a.on::before { content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--primary); }
.tabbar .ico { width: 24px; height: 24px; }

@media (min-width: 900px) {
  .side { display: flex; flex-direction: column; gap: 4px; width: 236px; flex: none; position: sticky; top: 0; height: 100vh;
    padding: 18px 12px; border-right: 1px solid var(--border); background: var(--surface); }
  .side .brand { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 1.05rem; padding: 4px 10px 18px; }
  .side .brand img { width: 34px; height: 34px; }
  .side a.nav { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px; color: var(--muted); font-weight: 600; }
  .side a.nav:hover { background: var(--surface-2); color: var(--text); }
  .side a.nav.on { background: var(--primary-soft); color: var(--primary); }
  .side .spacer { flex: 1; }
  .side .nav.out { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px; color: var(--muted);
    font: inherit; font-weight: 600; background: none; border: 0; cursor: pointer; text-align: left; width: 100%; }
  .side .nav.out:hover { background: color-mix(in srgb, var(--danger, #e5484d) 12%, transparent); color: var(--danger, #e5484d); }
  .side .who { padding: 10px 12px; font-size: .85rem; color: var(--muted); border-top: 1px solid var(--border); margin-top: 8px; }
  .tabbar { display: none; }
  .main { padding-bottom: 24px; }
  .top { padding: 18px 28px 12px; }
  .content { padding: 4px 28px 32px; }
}

/* ---------- Éléments ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.card h2 { font-size: 1.02rem; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-bottom: 14px; }
.grid .card { margin: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-weight: 650; cursor: pointer; white-space: nowrap; }
.btn:hover { filter: brightness(.97); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.block { width: 100%; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: .88rem; border-radius: 10px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.iconbtn { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; border: 0; background: transparent; color: var(--muted); cursor: pointer; flex: none; }
.iconbtn:hover { background: var(--surface-2); color: var(--text); }
.iconbtn.solid { background: var(--surface); box-shadow: var(--shadow); border: 1px solid var(--border); color: var(--text); }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=search], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
label.f { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .9rem; margin-bottom: 12px; }
label.chk { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-weight: 500; }
label.chk input { width: 20px; height: 20px; accent-color: var(--primary); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: .74rem; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.badge.ok { background: var(--ok-soft); color: var(--ok); } .badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.err { background: var(--danger-soft); color: var(--danger); } .badge.pri { background: var(--primary-soft); color: var(--primary); }
.empty { text-align: center; color: var(--muted); padding: 48px 16px; }
.empty .ico { width: 46px; height: 46px; opacity: .5; margin-bottom: 8px; }
.meter { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: inherit; background: var(--primary); transition: width .4s; }
.meter.ok > span { background: var(--ok); } .meter.warn > span { background: var(--warn); } .meter.err > span { background: var(--danger); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: .92rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86em; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; overflow-wrap: anywhere; }

/* ---------- Statistiques ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px; box-shadow: var(--shadow); min-width: 0; }
.stat b { display: block; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.stat span { font-size: .74rem; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 4px; }
.stat .ico { width: 15px; height: 15px; }
.stat.down b { color: var(--primary); } .stat.up b { color: var(--ok); }

/* ---------- Filtres ---------- */
.seg { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 12px; padding: 0 16px; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: none; border: 1px solid var(--border); background: var(--surface); padding: 7px 14px; border-radius: 99px; font-weight: 650; font-size: .86rem; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.seg button .n { opacity: .65; margin-left: 4px; font-weight: 600; }
.search { position: relative; margin-bottom: 12px; }
.search .ico { position: absolute; left: 12px; top: 12px; color: var(--muted); width: 20px; height: 20px; }
.search input { padding-left: 40px; }

/* ---------- Torrents ---------- */
.tlist { display: flex; flex-direction: column; gap: 10px; }
.tor { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px; box-shadow: var(--shadow); cursor: pointer; }
.tor:active { transform: scale(.995); }
.tor .t1 { display: flex; gap: 10px; align-items: flex-start; }
.tor .name { flex: 1; min-width: 0; font-weight: 650; overflow-wrap: anywhere; line-height: 1.3; }
.tor .meter { margin: 10px 0 8px; height: 6px; }
.tor .t2 { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tor .t2 .ico { width: 14px; height: 14px; vertical-align: -2px; }
.tor .t2 .dn { color: var(--primary); font-weight: 600; } .tor .t2 .upl { color: var(--ok); font-weight: 600; }

.tor.sel { border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 35%, transparent); }
.tor .tick { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; margin-top: -1px; }
.tor.sel .tick { background: var(--primary); border-color: var(--primary); color: #fff; }
.tor .tick .ico { width: 14px; height: 14px; stroke-width: 3; }
.tlist.selecting { user-select: none; -webkit-user-select: none; }
.top { flex-wrap: wrap; }
.bulkbar { flex-basis: 100%; padding-top: 4px; }
.bulkbar .bb-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 0 6px; font-size: .9rem; }
.bulkbar .bb-acts { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; max-width: 760px; }
.bulkbar .bb-acts button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); color: var(--text); font: inherit; font-size: .72rem; font-weight: 600; cursor: pointer; }
.bulkbar .bb-acts button .ico { width: 20px; height: 20px; }
.bulkbar .bb-acts button.danger { color: var(--danger); }
.bulkbar .bb-acts button:disabled { opacity: .4; cursor: default; }
.fab { position: fixed; right: 18px; bottom: calc(var(--tabbar) + var(--safe-b) + 18px); z-index: 25; width: 58px; height: 58px; border-radius: 18px;
  border: 0; background: var(--primary); color: #fff; box-shadow: 0 8px 24px color-mix(in srgb, var(--primary) 45%, transparent); display: grid; place-items: center; cursor: pointer; }
.fab .ico { width: 28px; height: 28px; }
@media (min-width: 900px) { .fab { bottom: 28px; right: 28px; } }

/* ---------- Fichiers ---------- */
.crumbs { display: flex; align-items: center; gap: 2px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 10px; padding: 0 16px; white-space: nowrap; }
.crumbs::-webkit-scrollbar { display: none; }
.crumbs a, .crumbs span { padding: 6px 8px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: .9rem; }
.crumbs a:hover { background: var(--surface-2); }
.crumbs span.cur { color: var(--text); }
.crumbs i { color: var(--surface-3); font-style: normal; }
.flist { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.fi { display: flex; align-items: center; gap: 12px; padding: 10px 6px 10px 14px; min-height: 60px; cursor: pointer; }
.fi + .fi { border-top: 1px solid var(--border); }
.fi:hover { background: var(--surface-2); }
.fi .fic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--surface-2); }
.fi .fic .ico { width: 22px; height: 22px; }
.fi .fmeta { flex: 1; min-width: 0; }
.fi .fname { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fi .fsub { font-size: .78rem; color: var(--muted); }
.k-folder .fic { background: color-mix(in srgb, #e9a823 18%, var(--surface)); color: #d9951a; }
.k-video .fic { background: color-mix(in srgb, #7a5af8 16%, var(--surface)); color: #7a5af8; }
.k-audio .fic { background: color-mix(in srgb, #e0458f 15%, var(--surface)); color: #e0458f; }
.k-image .fic { background: color-mix(in srgb, #16a3a3 16%, var(--surface)); color: #16a3a3; }
.k-archive .fic { background: color-mix(in srgb, #b26b22 16%, var(--surface)); color: #b26b22; }
.k-disc .fic { background: color-mix(in srgb, #5c7cfa 16%, var(--surface)); color: #5c7cfa; }

/* ---------- Feuille du bas (actions) ---------- */
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(8,10,16,.45); backdrop-filter: blur(2px); animation: fade .18s; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; max-height: 92vh; overflow-y: auto; background: var(--surface);
  border-radius: 22px 22px 0 0; padding: 8px 16px calc(18px + var(--safe-b)); box-shadow: 0 -10px 40px rgba(0,0,0,.25); animation: up .22s cubic-bezier(.2,.9,.3,1); }
.sheet .grip { width: 40px; height: 5px; border-radius: 99px; background: var(--surface-3); margin: 4px auto 12px; }
.sheet h3 { margin: 0 0 4px; font-size: 1.08rem; overflow-wrap: anywhere; }
.sheet .sub { color: var(--muted); font-size: .85rem; margin-bottom: 12px; overflow-wrap: anywhere; }
.acts { display: flex; flex-direction: column; margin: 6px -6px 0; }
.acts button, .acts a { display: flex; align-items: center; gap: 14px; padding: 13px 10px; border: 0; background: none; border-radius: 12px; text-align: left; cursor: pointer; color: var(--text); font-weight: 600; font-size: .98rem; }
.acts button:hover, .acts a:hover { background: var(--surface-2); }
.acts .danger { color: var(--danger); }
.acts .ico { color: var(--muted); } .acts .danger .ico { color: var(--danger); }
@media (min-width: 700px) {
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: min(560px, 92vw); transform: translate(-50%, -50%); border-radius: 20px; padding: 18px 20px 20px; animation: pop .18s; }
  .sheet .grip { display: none; }
}
@keyframes up { from { transform: translateY(100%); } }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -46%); } }
@keyframes fade { from { opacity: 0; } }

/* Lecteur */
.player { position: fixed; inset: 0; z-index: 70; background: #000; display: flex; flex-direction: column; }
.player .pbar { display: flex; align-items: center; gap: 8px; padding: calc(8px + var(--safe-t)) 8px 8px; color: #fff; }
.player .pbar .t { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player .pbar .iconbtn { color: #fff; }
.player .pbar .iconbtn:hover { background: rgba(255,255,255,.12); }
.player .stage { flex: 1; display: grid; place-items: center; min-height: 0; padding-bottom: var(--safe-b); }
.player video, .player img { max-width: 100%; max-height: 100%; }
.player audio { width: min(520px, 92vw); }
.player pre { color: #e9ecf2; background: #111; padding: 16px; margin: 0; width: 100%; height: 100%; overflow: auto; white-space: pre-wrap; font-size: .85rem; }
.player .hint { color: #aab; font-size: .8rem; text-align: center; padding: 6px 12px calc(10px + var(--safe-b)); }
.player .hint a { color: #8fb3ff; }

/* ---------- Toasts / bandeaux ---------- */
#toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar) + var(--safe-b) + 14px); z-index: 90;
  display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
.toast { background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: 14px; font-weight: 600; font-size: .92rem; box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: up .2s; }
.toast.err { background: var(--danger); color: #fff; }
@media (min-width: 900px) { #toasts { bottom: 24px; } }
.imp { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; padding: calc(8px + var(--safe-t)) 12px 8px;
  background: var(--warn); color: #1d1300; font-weight: 650; font-size: .9rem; }
.imp + .shell .top { padding-top: 10px; }
.imp button { background: #fff; color: #1d1300; border: 0; border-radius: 9px; padding: 6px 12px; font-weight: 700; cursor: pointer; }
.install { display: flex; align-items: center; gap: 12px; }
.install img { width: 44px; height: 44px; border-radius: 12px; }

/* ---------- Connexion ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px calc(24px + var(--safe-b));
  background: radial-gradient(120% 80% at 50% -10%, color-mix(in srgb, var(--primary) 25%, transparent), transparent 60%), var(--bg); }
.login .card { width: 100%; max-width: 400px; padding: 28px 22px; }
.login .logo { width: 64px; height: 64px; display: block; margin: 0 auto 14px; border-radius: 18px; box-shadow: 0 10px 30px color-mix(in srgb, var(--primary) 35%, transparent); }
.login h1 { text-align: center; margin: 0 0 4px; font-size: 1.45rem; }
.login p.lead { text-align: center; color: var(--muted); margin: 0 0 22px; }
.gate-note { display: flex; gap: 10px; align-items: flex-start; background: var(--primary-soft); color: var(--text); padding: 12px 14px; border-radius: 12px; font-size: .88rem; line-height: 1.45; margin: -6px 0 16px; }
.gate-note .ico { flex: none; width: 18px; height: 18px; color: var(--primary); margin-top: 1px; }
.login-alt { display: block; text-align: center; margin-top: 14px; font-size: .9rem; font-weight: 600; color: var(--primary); }
.err-msg { background: var(--danger-soft); color: var(--danger); padding: 10px 12px; border-radius: 12px; margin-bottom: 12px; font-weight: 600; font-size: .9rem; }

/* ---------- Admin ---------- */
.ulist { display: flex; flex-direction: column; gap: 10px; }
.urow { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); cursor: pointer; }
.urow.off { opacity: .6; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; flex: none; text-transform: uppercase; }
.urow .meta { flex: 1; min-width: 0; }
.urow .meta b { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.urow .meta .meter { height: 5px; margin-top: 6px; max-width: 260px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--muted); }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.log { font-size: .84rem; }
.log div { display: flex; gap: 10px; padding: 7px 0; border-top: 1px solid var(--border); }
.log div:first-child { border-top: 0; }
.log time { color: var(--muted); flex: none; width: 92px; font-variant-numeric: tabular-nums; }

.drop { position: fixed; inset: 0; z-index: 80; background: color-mix(in srgb, var(--primary) 22%, transparent); border: 3px dashed var(--primary);
  display: grid; place-items: center; font-size: 1.3rem; font-weight: 750; color: var(--primary); pointer-events: none; }

/* =====================================================================
   Thèmes saisonniers dynamiques
   ===================================================================== */
#app { position: relative; z-index: 1; }
.sx-ambient { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none; opacity: .75; }
:root[data-season] { --primary-soft: color-mix(in srgb, var(--primary) 13%, var(--surface)); }
:root[data-season] .side { background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(12px); }
:root[data-season] body { background-image: radial-gradient(90% 60% at 100% 0%, color-mix(in srgb, var(--season-a) 18%, transparent), transparent 60%),
  radial-gradient(70% 50% at 0% 100%, color-mix(in srgb, var(--season-b) 14%, transparent), transparent 60%); background-attachment: fixed; }

/* ----- Bannière ----- */
.sx-hero { position: relative; isolation: isolate; overflow: hidden; border-radius: 24px; margin: 0 0 16px; min-height: 230px;
  box-shadow: 0 18px 50px -18px color-mix(in srgb, var(--primary) 55%, transparent), var(--shadow); color: #fff; user-select: none; --px: 0; }
.sx-hero > *, .sx-login > * { position: absolute; inset: 0; }
.sx-sky { background: linear-gradient(180deg, var(--s1), var(--s2) 55%, var(--s3)); background-size: 100% 140%; animation: sx-sky 18s ease-in-out infinite alternate; }
@keyframes sx-sky { from { background-position: 0 0; } to { background-position: 0 100%; } }
.sx-aurora { filter: blur(38px) saturate(1.3); opacity: .55; mix-blend-mode: screen; }
.sx-aurora i { position: absolute; width: 55%; height: 75%; border-radius: 50%; animation: sx-blob 16s ease-in-out infinite alternate; }
.sx-aurora i:nth-child(1) { background: var(--season-a); left: -10%; top: -30%; }
.sx-aurora i:nth-child(2) { background: var(--season-b); right: -12%; top: -20%; animation-duration: 21s; animation-delay: -6s; }
.sx-aurora i:nth-child(3) { background: var(--season-c); left: 30%; top: 10%; width: 40%; animation-duration: 26s; animation-delay: -12s; opacity: .7; }
@keyframes sx-blob { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(12%, 18%) scale(1.15); } 100% { transform: translate(-8%, 6%) scale(.9); } }
.sx-day .sx-aurora, .sx-dawn .sx-aurora { opacity: .35; }
.sx-stars { background-image: radial-gradient(1.4px 1.4px at 12% 18%, #fff, transparent), radial-gradient(1px 1px at 28% 42%, #fff, transparent),
  radial-gradient(1.2px 1.2px at 47% 12%, #fff, transparent), radial-gradient(1px 1px at 63% 33%, #fff, transparent), radial-gradient(1.5px 1.5px at 78% 9%, #fff, transparent),
  radial-gradient(1px 1px at 88% 38%, #fff, transparent), radial-gradient(1.2px 1.2px at 35% 25%, #fff, transparent), radial-gradient(1px 1px at 92% 22%, #fff, transparent),
  radial-gradient(1px 1px at 6% 40%, #fff, transparent), radial-gradient(1.3px 1.3px at 55% 48%, #fff, transparent);
  animation: sx-twinkle 4s ease-in-out infinite alternate; }
@keyframes sx-twinkle { from { opacity: .45; } to { opacity: 1; } }
.sx-astre { position: absolute; inset: auto; width: 74px; height: 74px; border-radius: 50%; transform: translate(-50%, -50%) translateX(calc(var(--px) * -18px)); transition: transform .4s; }
.sx-astre.sun { background: radial-gradient(circle at 40% 40%, #fffbe6, #ffd25e 55%, #ffb347); box-shadow: 0 0 40px 14px rgba(255,210,94,.55), 0 0 120px 40px rgba(255,200,90,.25); }
.sx-astre.sun.dusk, .sx-astre.sun.dawn { background: radial-gradient(circle at 40% 40%, #fff1d6, #ff9a5c 60%, #ff6b4a); box-shadow: 0 0 50px 18px rgba(255,120,80,.5); }
.sx-astre.moon { width: 58px; height: 58px; background: radial-gradient(circle at 35% 35%, #fffef5, #e8e4d0 60%, #cfc9b0); box-shadow: 0 0 40px 10px rgba(255,250,220,.35);
  -webkit-mask: radial-gradient(circle at 70% 35%, transparent 32%, #000 33%); mask: radial-gradient(circle at 70% 35%, transparent 32%, #000 33%); }
.sx-back, .sx-front, .sx-fx { width: 100%; height: 100%; }
.sx-back { transform: translateX(calc(var(--px) * -14px)) scale(1.04); transition: transform .5s ease-out; }
.sx-front { transform: translateX(calc(var(--px) * -34px)) scale(1.08); transition: transform .5s ease-out; transform-origin: bottom; }
.sx-fx { pointer-events: none; }
.sx-front .sx-poke, .sx-back .sx-poke { pointer-events: auto; cursor: pointer; transform-box: fill-box; transform-origin: 50% 100%; }
.sx-back, .sx-front { pointer-events: none; }
.sx-grain { pointer-events: none; opacity: .12; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.sx-hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(8,10,20,.48) 0%, rgba(8,10,20,.18) 48%, transparent 75%); z-index: 1; }
.sx-in { position: relative !important; inset: auto !important; z-index: 2; padding: 22px 24px 20px; display: flex; flex-direction: column; gap: 6px; max-width: 640px; pointer-events: none; }
.sx-in * { pointer-events: auto; }
.sx-kicker { display: inline-flex; align-items: center; gap: 7px; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .9; }
.sx-kicker .ico { width: 16px; height: 16px; }
.sx-title { margin: 2px 0 0; font-size: clamp(1.6rem, 4vw, 2.3rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; text-shadow: 0 2px 18px rgba(0,0,0,.35); }
.sx-msg { margin: 0; font-weight: 550; opacity: .92; text-shadow: 0 1px 8px rgba(0,0,0,.35); }
.sx-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.sx-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 99px; font-size: .84rem; font-weight: 650;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28); backdrop-filter: blur(10px) saturate(1.4); font-variant-numeric: tabular-nums; }
.sx-chip .ico { width: 15px; height: 15px; }
.sx-chip.sx-cd { background: rgba(255,255,255,.9); color: #141826; border-color: transparent; }
.sx-chip.sx-cd .ico { color: var(--primary); }
@media (max-width: 600px) {
  .sx-hero { border-radius: 20px; min-height: 250px; margin: 0 0 14px; }
  .sx-in { padding: 18px 16px; }
  .sx-hero::after { background: linear-gradient(180deg, rgba(8,10,20,.45) 0%, rgba(8,10,20,.15) 55%, transparent 80%); }
}

/* Animations du décor */
.sx-tw, .sx-bulb { animation: sx-blink 2.4s ease-in-out infinite; }
.sx-bulb { filter: drop-shadow(0 0 4px currentColor); animation-duration: 1.4s; }
@keyframes sx-blink { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.sx-flicker { animation: sx-flick 2.6s steps(1) infinite; }
@keyframes sx-flick { 0%, 100% { opacity: 1; } 41% { opacity: .6; } 44% { opacity: 1; } 72% { opacity: .78; } }
.sx-wave { animation: sx-wave 7s linear infinite; } .sx-wave.slow { animation-duration: 11s; }
@keyframes sx-wave { to { transform: translateX(200px); } }
.sx-sway { animation: sx-sway 5s ease-in-out infinite alternate; }
@keyframes sx-sway { from { transform: rotate(-3deg); } to { transform: rotate(3deg); } }
.sx-fog { animation: sx-fog 16s ease-in-out infinite alternate; }
@keyframes sx-fog { from { transform: translateX(-50px); } to { transform: translateX(50px); } }
.sx-glow { animation: sx-glowt 2.6s ease-in-out infinite; }
@keyframes sx-glowt { 0%, 100% { filter: drop-shadow(0 0 6px #f5c542); } 50% { filter: drop-shadow(0 0 24px #f5c542); } }
.sx-poke:hover { filter: brightness(1.15) drop-shadow(0 0 8px rgba(255,255,255,.6)); }
.sx-poked { animation: sx-poke .7s ease; }
@keyframes sx-poke { 30% { transform: scale(1.15, .85); } 60% { transform: scale(.94, 1.1) translateY(-6px); } }
.sx-still *, html.no-anim .sx-hero *, html.no-anim .sx-login * { animation: none !important; }
@media (prefers-reduced-motion: reduce) { .sx-hero *, .sx-login * { animation: none !important; } }

/* ----- Connexion ----- */
.sx-login { position: fixed !important; inset: 0; z-index: 0; overflow: hidden; --px: 0; }
.sx-login .sx-front, .sx-login .sx-back { top: auto; height: 45%; }
.sx-login .sx-astre { width: 96px; height: 96px; }
.sx-login::after { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 50% at 50% 45%, rgba(8,10,20,.25), transparent 70%); pointer-events: none; }
.login.has-scene { background: transparent; position: relative; z-index: 1; pointer-events: none; }
.login.has-scene .card { pointer-events: auto; background: color-mix(in srgb, var(--surface) 78%, transparent); backdrop-filter: blur(16px) saturate(1.4);
  border-color: rgba(255,255,255,.35); box-shadow: 0 30px 80px -20px rgba(0,0,0,.45); }
.login .season-tag { display: flex; justify-content: center; margin: -10px 0 18px; }
.login .season-tag span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px; background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: .8rem; }
.login .season-tag .ico { width: 15px; height: 15px; }

/* ----- Logo déguisé ----- */
.sx-logo { position: relative; display: inline-flex; }
.sx-hat { position: absolute; left: 50%; top: -13px; width: 28px; transform: translateX(-50%) rotate(-8deg); pointer-events: none; }
.sx-hat svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 1px 1px rgba(0,0,0,.3)); }
.sx-hat-ete { top: 5px; width: 24px; transform: translateX(-50%); }
.sx-hat-paques { top: -18px; }
.sx-hat-automne, .sx-hat-printemps, .sx-hat-valentin { left: 88%; top: -8px; width: 18px; }
.login .sx-logo { display: flex; justify-content: center; }
.login .sx-hat { width: 52px; top: -26px; }
.login .sx-hat-ete { top: 12px; width: 44px; }
.login .sx-hat-automne, .login .sx-hat-printemps, .login .sx-hat-valentin { left: 62%; top: -14px; width: 30px; }

/* Aperçus (admin) */
.sx-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin: 10px 0 12px; }
.sx-swatches button { border: 2px solid transparent; border-radius: 12px; padding: 10px 8px; font-weight: 700; font-size: .82rem; color: #fff; cursor: pointer; text-shadow: 0 1px 4px rgba(0,0,0,.4); }
.sx-swatches button.on { border-color: var(--text); }

/* ----- Paysages réalistes / photos ----- */
.sx-land { position: absolute; inset: 0; overflow: hidden; z-index: 0; }
.sx-land canvas, .sx-photo { position: absolute; inset: -6%; width: 112%; height: 112%; animation: sx-kb 48s ease-in-out infinite alternate; }
.sx-photo { background: center / cover no-repeat; }
@keyframes sx-kb { from { transform: scale(1) translate(0, 0); } to { transform: scale(1.06) translate(-2%, -1.5%); } }
.sx-grade { position: absolute; inset: 0; pointer-events: none; }
.sx-g-dawn { background: linear-gradient(180deg, rgba(120,90,160,.25), rgba(255,170,120,.18)); mix-blend-mode: soft-light; }
.sx-g-dusk { background: linear-gradient(180deg, rgba(60,40,120,.35), rgba(255,120,60,.25)); mix-blend-mode: soft-light; }
.sx-g-night { background: linear-gradient(180deg, rgba(5,10,35,.55), rgba(10,20,50,.45)); mix-blend-mode: multiply; }
.sx-hero .sx-fx, .sx-login .sx-fx { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.sx-hero .sx-grain, .sx-login .sx-grain { z-index: 1; opacity: .08; }
.sx-hero { min-height: 250px; background: #1b2236; }
.sx-hero::after { z-index: 1; background: linear-gradient(90deg, rgba(5,8,18,.55) 0%, rgba(5,8,18,.2) 50%, transparent 80%); }
.sx-kicker { font-size: .74rem; letter-spacing: .14em; opacity: .85; }
.sx-title { font-weight: 700; letter-spacing: -.025em; }
.sx-msg { font-weight: 450; opacity: .88; }
.sx-chip { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.22); font-weight: 600; }
.sx-chip.sx-cd { background: rgba(255,255,255,.92); }
.sx-login { background: #10141f; }
.sx-login::after { background: linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.35)); }
.sx-still .sx-land canvas, .sx-still .sx-photo { animation: none; }
@media (prefers-reduced-motion: reduce) { .sx-land canvas, .sx-photo { animation: none; } }

/* Admin : vignettes et photos */
.sx-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 12px 0; }
.sx-thumb { position: relative; border-radius: 14px; overflow: hidden; aspect-ratio: 16 / 9; cursor: pointer; border: 2px solid transparent; background: #1b2236; }
.sx-thumb.on { border-color: var(--primary); }
.sx-thumb canvas { width: 100%; height: 100%; display: block; }
.sx-thumb span { position: absolute; left: 8px; bottom: 6px; color: #fff; font-weight: 700; font-size: .82rem; text-shadow: 0 1px 6px rgba(0,0,0,.7); }
.sx-thumb .sx-ph { position: absolute; right: 6px; top: 6px; background: rgba(0,0,0,.55); color: #fff; font-size: .68rem; padding: 2px 7px; border-radius: 99px; font-weight: 700; }

/* ----- Feuille « nouveau mot de passe » ----- */
.pw-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.pw-head .avatar { width: 48px; height: 48px; font-size: 1.2rem; }
.pw-head h3 { margin: 0; }
.pw-field { display: flex; align-items: center; gap: 2px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); padding: 0 4px 0 0; }
.pw-field:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.pw-field input { border: 0; box-shadow: none !important; min-height: 52px; font-size: 1.08rem; letter-spacing: .03em; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: transparent; }
.pw-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 12px 0 8px; }
.pw-meter i { height: 6px; border-radius: 99px; background: var(--surface-3); transition: background .25s; }
.pw-meter i.err { background: var(--danger); } .pw-meter i.warn { background: var(--warn); } .pw-meter i.ok { background: var(--ok); }
.pw-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.pw-done { width: 64px; height: 64px; border-radius: 50%; margin: 6px auto 12px; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); }
.pw-done .ico { width: 32px; height: 32px; }
.pw-show { display: block; text-align: center; font-size: 1.35rem; padding: 14px; margin: 14px 0 10px; border-radius: 14px; letter-spacing: .06em; user-select: all; }

/* ----- Sites de torrents ----- */
.side-sec { margin: 16px 12px 4px; font-size: .72rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.side a.nav.ext span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side a.nav.ext .ext-i { width: 15px; height: 15px; opacity: .5; }
.sites { display: flex; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 12px; padding: 2px 16px; }
.sites::-webkit-scrollbar { display: none; }
.sites > span { display: inline-flex; align-items: center; gap: 6px; flex: none; font-size: .8rem; font-weight: 700; color: var(--muted); }
.sites > span .ico { width: 16px; height: 16px; }
.sites a { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 99px; background: var(--surface);
  border: 1px solid var(--border); color: var(--text); font-weight: 650; font-size: .86rem; box-shadow: var(--shadow); }
.sites a .ico { width: 14px; height: 14px; color: var(--muted); }
.sites a:hover { border-color: var(--primary); color: var(--primary); }
.sites.in-sheet { margin: 0 0 12px; padding: 0; flex-wrap: wrap; }
@media (min-width: 900px) { .sites:not(.in-sheet) { display: none; } }
.links-ed { display: flex; flex-direction: column; gap: 6px; }
.lrow { display: flex; align-items: center; gap: 4px; padding: 8px 6px 8px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.lrow .lmeta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lrow .lmeta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow .iconbtn { width: 36px; height: 36px; }
.lrow .iconbtn[disabled] { opacity: .3; pointer-events: none; }
.badge .bi { width: 12px; height: 12px; }

.bk-list { display: flex; flex-direction: column; gap: 4px; }
.bk-row { display: flex; align-items: center; gap: 10px; padding: 6px 4px 6px 10px; border-radius: 10px; background: var(--surface-2); }
.bk-row > span:first-child { flex: 1; display: flex; align-items: center; gap: 8px; }
.bk-row .ico { width: 18px; height: 18px; }

.tcount { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 99px; font-size: .82rem; font-weight: 750;
  background: var(--surface-2); color: var(--muted); font-variant-numeric: tabular-nums; }
.tcount.near { background: var(--warn-soft); color: var(--warn); }
.tcount.full { background: var(--danger-soft); color: var(--danger); }
.limit-msg { display: flex; gap: 10px; align-items: flex-start; background: var(--danger-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
  padding: 12px 14px; border-radius: 14px; margin: 0 0 12px; font-size: .9rem; line-height: 1.45; }
.limit-msg .ico { flex: none; width: 20px; height: 20px; color: var(--danger); margin-top: 1px; }
.fab.off { opacity: .45; filter: grayscale(.6); }
.urow .tc { font-weight: 650; }
.urow .tc.near { color: var(--warn); }
.urow .tc.full { color: var(--danger); }
