/* Variante « Système » (app de Narindra) : écran déguisé en app système Xiaomi + transition Spider-Verse.
   Chargé par tout le monde mais n'affiche rien tant que syslock.js ne crée pas #sys-gate / #sys-sv. */

/* Pendant le verrou, on cache complètement l'arrière-plan (login, app…) pour ne rien laisser deviner. */
html.sys-app body > *:not(#sys-gate):not(#sys-sv) { visibility: hidden; }

#sys-gate { position: fixed; inset: 0; z-index: 9000; background: radial-gradient(130% 80% at 50% 0%, #191b1e, #0e0f11); }
#sys-gate .sys-screen { position: absolute; inset: 0; display: flex; flex-direction: column; color: #e9eaec; font-family: system-ui, sans-serif; }
.sys-bar { height: 30px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; font-size: 12px; color: #8a8f96; }
.sys-bar-r { display: flex; gap: 6px; align-items: center; }
.sys-dot { width: 4px; height: 4px; border-radius: 50%; background: #8a8f96; }
.sys-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 26px 24px; text-align: center; }
.sys-logo { width: 74px; height: 74px; display: grid; place-items: center; }
.sys-logo-img, .sys-logo img { width: 74px; height: 74px; border-radius: 18px; display: block; object-fit: contain; }
.sys-logo.badge { width: auto; min-width: 74px; max-width: 210px; height: 68px; padding: 0 16px; border-radius: 18px; background: var(--bg, #3a3d42); color: var(--ink, #fff); }
.sys-logo.badge span { font-weight: 800; font-size: 21px; letter-spacing: .5px; white-space: nowrap; font-family: system-ui, Arial, sans-serif; }
.sys-logo.gear { border-radius: 18px; background: var(--bg, #3a3d42); }
.sys-logo.gear svg { width: 44px; height: 44px; }
.sys-title { font-size: 21px; font-weight: 700; margin-top: 16px; letter-spacing: .3px; }
.sys-ver { font-size: 12.5px; color: #8a8f96; margin-top: 3px; }
.sys-msg { font-size: 13.5px; color: #b7bbc1; line-height: 1.5; margin: 18px 0 14px; max-width: 30ch; }
.sys-field { width: 100%; max-width: 280px; margin-top: 10px; }
.sys-field input { width: 100%; height: 46px; border-radius: 12px; border: 1px solid #ffffff1f; background: #00000055; color: #fff;
  padding: 0 16px; font-size: 16px; letter-spacing: 3px; outline: none; text-align: center; }
.sys-field input:focus { border-color: #ffffff3d; }
.sys-btn { width: 100%; max-width: 280px; height: 46px; margin-top: 16px; border: 0; border-radius: 12px;
  background: #3a3d42; color: #fff; font-size: 15px; font-weight: 600; cursor: pointer; }
.sys-btn:active { background: #46494f; }
.sys-note { min-height: 18px; margin-top: 12px; font-size: 12.5px; color: #8a8f96; }
.sys-note.err { color: #e8736f; }
.sys-foot { flex-shrink: 0; display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 14px; font-size: 11px; color: #6c7177; }
.sys-foot img { height: 15px; width: auto; opacity: .85; }

/* Transition Spider-Verse, brève : rayons comic rouges + flash, avant d'arriver sur HS. */
#sys-sv { position: fixed; inset: 0; z-index: 9100; background: #0a0206; overflow: hidden; pointer-events: none; }
#sys-sv .sv-rays { position: absolute; left: 50%; top: 50%; width: 200vmax; height: 200vmax; transform: translate(-50%, -50%) scale(.2);
  opacity: 0; background: repeating-conic-gradient(from 0deg, #e8112f 0 7deg, #0a0206 7deg 15deg);
  -webkit-mask: radial-gradient(circle, #000 18%, transparent 60%); mask: radial-gradient(circle, #000 18%, transparent 60%); }
#sys-sv.play .sv-rays { animation: sv-rays 1.4s ease-out forwards; }
@keyframes sv-rays { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.2) rotate(0deg); }
  25% { opacity: .9; } 70% { opacity: .9; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.6) rotate(140deg); } }
#sys-sv .sv-flash { position: absolute; inset: 0; background: #fff; opacity: 0; }
#sys-sv.play .sv-flash { animation: sv-flash 1.4s ease-out forwards; }
@keyframes sv-flash { 0%, 55% { opacity: 0; } 62% { opacity: .85; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #sys-sv .sv-rays, #sys-sv .sv-flash { animation-duration: .4s !important; } }

/* ===== App « Système » : menu secret (page d'accueil après déverrouillage) ===== */
#sys-menu { position: fixed; inset: 0; z-index: 8000; display: flex; flex-direction: column;
  background: var(--bg, #0c0d10); color: var(--ink, #e9eaec); font-family: system-ui, sans-serif; overflow-y: auto; }
#sys-menu.spider { background: radial-gradient(120% 80% at 50% -10%, color-mix(in srgb, var(--accent) 24%, #140a17), #0a0206 70%); }
.sm-top-bar { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 8px; }
.sm-logo { font-weight: 900; font-style: italic; font-size: 22px; letter-spacing: 1px; color: var(--accent, #e5e5e7); }
#sys-menu.spider .sm-logo { font-family: 'Bangers', Impact, sans-serif; font-style: normal; color: #fff; text-shadow: 2px 2px 0 #000, 0 0 14px var(--accent); }
.sm-lock { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #ffffff26; background: #ffffff10; color: inherit;
  border-radius: 20px; padding: 7px 13px; font-size: 12.5px; cursor: pointer; }
.sm-lock svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }
.sm-tag { align-self: center; margin: 2px 0 14px; font-size: 12.5px; color: #ffffffb0; background: #ffffff12; padding: 4px 14px; border-radius: 14px; }
#sys-menu.spider .sm-tag { background: #fff; color: #000; font-family: 'Bangers', Impact, sans-serif; letter-spacing: .04em; transform: rotate(-2deg); box-shadow: 3px 3px 0 #000; }
.sm-body { flex: 1; padding: 0 16px 28px; display: flex; flex-direction: column; gap: 14px; max-width: 560px; width: 100%; margin: 0 auto; }
.sm-row { display: flex; gap: 12px; align-items: center; }
.sm-story { display: flex; flex-direction: column; align-items: center; gap: 4px; flex-shrink: 0; cursor: pointer; }
.sm-story small { font-size: 10px; color: #ffffff9a; }
.sm-note { flex: 1; min-width: 0; background: #ffffff0f; border-radius: 12px; padding: 8px 13px; }
.sm-note-l { font-size: 9.5px; text-transform: uppercase; letter-spacing: .3px; color: #ffffff85; }
.sm-note p { font-size: 13.5px; margin-top: 2px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-disc { display: flex; align-items: center; gap: 12px; width: 100%; background: #ffffff0d; border: 0; border-radius: 14px;
  padding: 10px 12px; cursor: pointer; color: inherit; text-align: left; }
.sm-disc-t { flex: 1; min-width: 0; } .sm-disc-t strong { display: block; font-size: 15.5px; color: #fff; } .sm-disc-t small { font-size: 12px; color: #ffffff9a; }
.sm-arrow svg { width: 20px; height: 20px; fill: none; stroke: var(--accent, #9a9aa0); stroke-width: 2.4; }
.sm-posters { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sm-poster { position: relative; aspect-ratio: 4/3; border: 1px solid #ffffff14; border-radius: 13px; cursor: pointer; color: inherit;
  display: grid; place-items: center; padding: 14px; background: #ffffff0d; }
.sm-poster .sm-ic svg { width: 32px; height: 32px; fill: none; stroke: var(--accent, #cfd4da); stroke-width: 1.8; display: block; margin: 0 auto 8px; }
.sm-poster strong { font-size: 13.5px; }
/* Variante Spider : coupure de journal + avis de recherche */
.sm-poster.np { background: #e9e2cf; color: #17110c; transform: rotate(-1.4deg); align-items: flex-start; }
.sm-poster.np .sm-mast { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 12px; border-bottom: 2px solid #17110c; padding-bottom: 3px; }
.sm-poster.np .sm-head { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 16px; margin-top: 6px; }
.sm-poster.wanted { background: #d9c9a3; color: #17110c; transform: rotate(1.4deg); text-align: center; }
.sm-poster.wanted .sm-top { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 20px; letter-spacing: 4px; border-top: 3px solid #17110c; border-bottom: 3px solid #17110c; padding: 3px 0; }
.sm-poster.wanted .sm-sub { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 12px; letter-spacing: 1px; margin-top: 10px; }

/* ===== Coffre (navigateur plein écran) ===== */
dialog.vault { width: 100%; max-width: 100%; height: 100%; max-height: 100%; margin: 0; border: 0; padding: 0;
  background: var(--bg, #0c0d10); color: var(--ink, #e9eaec); }
dialog.vault::backdrop { background: #000; }
.vt-top { display: flex; align-items: center; gap: 10px; height: 54px; padding: 0 10px; border-bottom: 1px solid #ffffff14; }
.vt-top .vt-h { flex: 1; font-size: 16px; }
.vt-x, .vt-add { width: 36px; height: 36px; border: 0; border-radius: 50%; background: #ffffff12; color: inherit; cursor: pointer; display: grid; place-items: center; }
.vt-x svg, .vt-add svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.vt-add { background: var(--accent, #3a3d42); color: var(--accent-ink, #fff); }
.vt-scroll { position: absolute; inset: 54px 0 46px; overflow-y: auto; padding: 10px; }
.vt-info { text-align: center; color: #ffffff9a; padding: 40px 20px; font-size: 13.5px; }
.vt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
@media (min-width: 560px) { .vt-grid { grid-template-columns: repeat(4, 1fr); } }
.vt-cell { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #ffffff14; cursor: pointer; }
.vt-cell.no-thumb { background: repeating-linear-gradient(45deg, #ffffff0f 0 8px, transparent 8px 16px); }
.vt-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.vt-play { position: absolute; inset: 0; display: grid; place-items: center; }
.vt-play svg { width: 30px; height: 30px; fill: #fff; filter: drop-shadow(0 2px 4px #000); }
.vt-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 46px; display: flex; align-items: center; justify-content: center; border-top: 1px solid #ffffff14; }
.vt-link { border: 0; background: none; color: var(--accent, #9a9aa0); font-size: 13px; cursor: pointer; }
.vt-prog-dlg { border: 0; border-radius: 16px; padding: 20px 24px; background: #1a1b1e; color: #fff; }
.vt-prog-dlg::backdrop { background: #000a; }
.vt-prog { min-width: 240px; }
.vt-prog-l { font-size: 13px; }
.vt-prog-track { height: 6px; border-radius: 3px; background: #ffffff1f; margin-top: 10px; overflow: hidden; }
.vt-prog-track i { display: block; height: 100%; width: 0; background: var(--accent, #4a90d9); transition: width .2s; }
