/* Theme commun au Systeme et a KobaHunter (sololeveling.kobacraft.net), meme esprit que kobacraft.net.
   Les regles propres a KobaHunter (bundle compile, styles en ligne) sont sous html.kh-hunter. */
:root{
  --bg:#03030d;
  --violet:#8b5cf6; --violet-2:#a78bfa; --cyan:#00aaff; --indigo:#5865f2;
  --ink:#e6e8ff; --ink-2:#c0c4ec; --ink-3:#8a8fc0;
  --glass:rgba(22,24,52,.62); --glass-strong:rgba(18,16,44,.92);
  --glass-border:rgba(160,170,255,.16);
  --shadow:0 10px 34px rgba(0,0,0,.35); --shadow-hover:0 18px 44px rgba(80,60,200,.35);
  --r-md:20px; --r-lg:28px;
  --fond-image:none; --voile-haut:.25; --voile-bas:.8;
}
/* Themes de fond (bouton "Fond" du menu) */
html.kh-th-ombre{--fond-image:url("/fond/ombre.jpg");--voile-haut:.2;--voile-bas:.78}
html.kh-th-nebuleuse{--fond-image:url("/fond/solo-leveling.jpg");--voile-haut:.55;--voile-bas:.92}
html.kh-th-perso{--fond-image:url("/fond/perso.jpg");--voile-haut:.35;--voile-bas:.85}
html.kh-th-noir{--fond-image:none;--voile-haut:.0;--voile-bas:.0}

html,body{background:var(--bg)!important;-webkit-font-smoothing:antialiased}
#root,#app{position:relative;z-index:1}

body::before{
  content:"";position:fixed;inset:0;z-index:0;pointer-events:none;
  background:
    linear-gradient(180deg,rgba(3,3,13,var(--voile-haut)) 0%,rgba(3,3,13,var(--voile-bas)) 100%),
    var(--fond-image),
    radial-gradient(60% 50% at 50% 0%,rgba(139,92,246,.35),transparent 70%),
    radial-gradient(50% 40% at 85% 90%,rgba(0,170,255,.16),transparent 70%),
    var(--bg);
  background-size:cover,cover,auto,auto,auto;
  background-position:center center;background-repeat:no-repeat;
}
#kh-particules{position:fixed;inset:0;z-index:0;pointer-events:none}

/* ---------- KobaHunter : style kobacraft (bundle compile, on surcharge par selecteurs d'attribut) ---------- */
html.kh-hunter,html.kh-hunter body{color:var(--ink);font-family:'Fredoka','Rajdhani',sans-serif}
html.kh-hunter [style*="background: rgb(3, 3, 13)"]{background:rgba(3,3,13,.5)!important}
html.kh-hunter [style*="background: rgb(30, 41, 59)"]{
  background:rgba(14,17,40,.9)!important;
  -webkit-backdrop-filter:blur(14px) saturate(140%);backdrop-filter:blur(14px) saturate(140%);
  border-color:var(--glass-border)!important;border-radius:var(--r-md)!important;box-shadow:var(--shadow);
  transition:transform .2s ease,box-shadow .2s ease,border-color .2s ease;
}
html.kh-hunter [style*="background: rgb(30, 41, 59)"]:hover{border-color:rgba(167,139,250,.45)!important;box-shadow:var(--shadow-hover)}
html.kh-hunter [style*="border: 1px solid rgb(51, 65, 85)"]{border-color:var(--glass-border)!important}
html.kh-hunter button{font-family:'Fredoka','Rajdhani',sans-serif!important;font-weight:600;letter-spacing:.02em;
  border-radius:14px;transition:transform .15s ease,filter .15s ease,box-shadow .15s ease}
html.kh-hunter button:not(:disabled):hover{transform:translateY(-2px);filter:brightness(1.15);box-shadow:0 8px 22px rgba(139,92,246,.35)}
html.kh-hunter button:not(:disabled):active{transform:translateY(0) scale(.98)}
html.kh-hunter input,html.kh-hunter select{border-radius:12px!important;background:rgba(8,9,24,.55)!important;color:var(--ink)!important;
  border:1px solid var(--glass-border)!important}
html.kh-hunter input:focus,html.kh-hunter select:focus{border-color:var(--violet)!important;box-shadow:0 0 0 3px rgba(139,92,246,.25)}
html.kh-hunter [style*="position: fixed"][style*="z-index"]{-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)}
/* Lisibilite : les gris fonces de l'appli (prevus pour un fond plein) sont eclaircis */
html.kh-hunter [style^="color: rgb(30, 41, 59)"],html.kh-hunter [style*=" color: rgb(30, 41, 59)"]{color:#8d9bb8!important}
html.kh-hunter [style^="color: rgb(51, 65, 85)"],html.kh-hunter [style*=" color: rgb(51, 65, 85)"]{color:#9aa8c4!important}
html.kh-hunter [style^="color: rgb(71, 85, 105)"],html.kh-hunter [style*=" color: rgb(71, 85, 105)"]{color:#a9b6cf!important}
html.kh-hunter [style^="color: rgb(100, 116, 139)"],html.kh-hunter [style*=" color: rgb(100, 116, 139)"]{color:#b8c3d9!important}
html.kh-hunter [style^="color: rgb(148, 163, 184)"],html.kh-hunter [style*=" color: rgb(148, 163, 184)"]{color:#d3dcec!important}
html.kh-hunter text[fill="#334155"],html.kh-hunter text[fill="#475569"],html.kh-hunter text[fill="#64748b"]{fill:#b8c3d9!important}
html.kh-hunter text[fill="#94a3b8"]{fill:#d3dcec!important}

/* ---------- Commun : barre de defilement, selection, focus ---------- */
::-webkit-scrollbar{width:8px}
::-webkit-scrollbar-thumb{background:linear-gradient(var(--violet),var(--cyan));border-radius:8px}
::-webkit-scrollbar-track{background:transparent}
::selection{background:rgba(139,92,246,.45)}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--violet-2)!important;outline-offset:2px}

/* ---------- Icones (remplacent les emojis) ---------- */
svg.kh-ico{width:1.2em;height:1.2em;vertical-align:-.2em;margin-right:.22em;flex:none;
  color:#d6ccff;filter:drop-shadow(0 0 5px rgba(139,92,246,.55))}
button svg.kh-ico:only-child{margin-right:0}

/* ---------- Taille (Auto / Telephone / PC) ---------- */
#root,#app{zoom:var(--kh-zoom,1);min-height:calc(100vh / var(--kh-zoom,1))}
html.kh-phone.kh-hunter button{min-height:44px}
html.kh-phone.kh-hunter input,html.kh-phone.kh-hunter select{font-size:16px!important;min-height:44px}

/* ---------- Mode paysage force : tourne l'affichage de 90 degres (telephone dont la rotation est bloquee) ---------- */
html.kh-rot{position:fixed;top:0;left:100vw;width:100vh;height:100vw;transform-origin:0 0;transform:rotate(90deg);overflow:auto}
html.kh-rot #root,html.kh-rot #app{min-height:calc(100vw / var(--kh-zoom,1))}
html.kh-rot body::before,html.kh-rot #kh-particules{width:100%;height:100%}

/* ---------- Systeme : meme interface que KobaHunter (cartes sombres arrondies, bleu #00aaff, navigation du bas) ---------- */
html.kh-systeme{
  --cyan:#00aaff; --cyan-dim:rgba(255,255,255,.09); --cyan-glow:rgba(0,170,255,.45);
  --bg-panel:rgba(5,5,18,.93); --bg-panel-2:rgba(9,9,28,.93);
  --text-dim:#94a3b8;
}
html.kh-systeme #app{max-width:560px}
/* Mode PC : le Systeme prend tout l'ecran (le mode Telephone garde la colonne etroite) */
html.kh-systeme.kh-pc #app{max-width:none}
html.kh-systeme .panel{
  clip-path:none;border-radius:16px;border:1px solid var(--glass-border);
  background:rgba(14,17,40,.72);
  -webkit-backdrop-filter:blur(14px) saturate(140%);backdrop-filter:blur(14px) saturate(140%);
  box-shadow:var(--shadow);transition:border-color .2s ease,box-shadow .2s ease;
}
html.kh-systeme .panel:hover{border-color:rgba(167,139,250,.35)}
html.kh-systeme .panel .panel{background:rgba(8,9,24,.55);-webkit-backdrop-filter:none;backdrop-filter:none}
html.kh-systeme .kh-lucide{filter:drop-shadow(0 0 5px rgba(139,92,246,.45))}
html.kh-systeme .overlay{-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}
html.kh-systeme .panel::after{display:none}
html.kh-systeme .btn{clip-path:none;border-radius:10px}
html.kh-systeme .tabbar{
  border-top:1px solid var(--glass-border);background:rgba(6,6,20,.7);
  -webkit-backdrop-filter:blur(16px) saturate(140%);backdrop-filter:blur(16px) saturate(140%);
}
html.kh-systeme .tab{border-radius:16px 16px 0 0;border-top:2px solid transparent}
html.kh-systeme .tab.active{border-top-color:rgba(255,255,255,.3);background:rgba(255,255,255,.06)}
html.kh-systeme .topbar{background:rgba(6,6,20,.7);border-bottom:1px solid var(--glass-border);
  -webkit-backdrop-filter:blur(16px) saturate(140%);backdrop-filter:blur(16px) saturate(140%)}
html.kh-systeme .chip{border-radius:999px}
html.kh-systeme input,html.kh-systeme select,html.kh-systeme textarea{border-radius:10px}
html.kh-systeme .eyebrow{letter-spacing:.3em}

/* ---------- Systeme : structure KobaHunter (en-tete, Base, Stats, modules) ---------- */
html.kh-systeme .kh-head{display:flex;align-items:center;gap:12px}
html.kh-systeme .kh-avatar{width:46px;height:46px;flex:none;display:grid;place-items:center;border:2px solid currentColor;border-radius:12px;
  font:700 20px Orbitron,monospace;background:rgba(255,255,255,.04);box-shadow:0 0 18px rgba(0,170,255,.18)}
html.kh-systeme .kh-head-mid{flex:1;min-width:0}
html.kh-systeme .kh-head-l1{display:flex;justify-content:space-between;align-items:baseline;gap:8px}
html.kh-systeme .kh-head-l1 .hunter-tag{font:600 15px Orbitron,monospace;color:#fff;letter-spacing:.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html.kh-systeme .kh-lvl{font:600 14px Orbitron,monospace;color:#e2e8f0;flex:none}
html.kh-systeme .kh-xp{height:5px;border-radius:3px;background:rgba(255,255,255,.08);margin:6px 0 4px;overflow:hidden}
html.kh-systeme .kh-xp-fill{height:100%;width:0;border-radius:3px;background:linear-gradient(90deg,#00aaff,#8b5cf6);box-shadow:0 0 10px rgba(0,170,255,.6);transition:width .4s}
html.kh-systeme .kh-head-l3{display:flex;justify-content:space-between;font:500 9px Orbitron,monospace;letter-spacing:2px;color:#94a3b8}
html.kh-systeme .kh-date{font:500 11px Orbitron,monospace;letter-spacing:3px;color:#8d9bb8;margin:4px 4px 2px}
html.kh-systeme .kh-bienvenue{font:600 22px Orbitron,monospace;color:#fff;margin:0 4px 6px}
html.kh-systeme .kh-carte{display:block;width:100%;padding:16px;text-align:left;color:inherit;font:inherit}
html.kh-systeme .kh-cliquable{cursor:pointer}
html.kh-systeme .kh-titre{font:600 12px Orbitron,monospace;letter-spacing:2px;color:#cbd5e1}
html.kh-systeme .kh-titre-hors{margin:6px 4px 0}
html.kh-systeme .kh-compte{font:600 15px Orbitron,monospace;color:#fff}
html.kh-systeme .kh-segments{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;gap:6px;margin-top:12px}
html.kh-systeme .kh-segments i{height:6px;border-radius:3px;background:rgba(255,255,255,.1)}
html.kh-systeme .kh-segments i.ok{background:#10b981;box-shadow:0 0 8px rgba(16,185,129,.6)}
html.kh-systeme .kh-tuiles{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
html.kh-systeme .kh-tuiles-5{grid-template-columns:repeat(5,1fr);margin-top:8px}
html.kh-systeme .kh-tuile,html.kh-systeme .kh-mini{display:flex;flex-direction:column;align-items:center;gap:4px;padding:12px 6px;text-align:center}
html.kh-systeme .kh-tuile .icon-svg,html.kh-systeme .kh-mini .icon-svg{font-size:22px}
html.kh-systeme .kh-tuile b,html.kh-systeme .kh-mini b{font:700 18px Orbitron,monospace}
html.kh-systeme .kh-tuile small,html.kh-systeme .kh-mini small{font:500 8.5px Orbitron,monospace;letter-spacing:1.5px;color:#94a3b8}
html.kh-systeme .kh-attr{margin-top:12px}
html.kh-systeme .kh-attr .row span:first-child{display:flex;align-items:center;gap:8px;color:#e2e8f0;font-size:15px}
html.kh-systeme .kh-val{font:600 13px Orbitron,monospace}
html.kh-systeme .kh-barre{height:6px;border-radius:3px;background:rgba(255,255,255,.08);margin-top:6px;overflow:hidden}
html.kh-systeme .kh-barre div{height:100%;border-radius:3px;min-width:4px;box-shadow:0 0 8px currentColor}
html.kh-systeme .kh-modules{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}
html.kh-systeme.kh-pc .kh-modules{grid-template-columns:repeat(auto-fill,minmax(220px,1fr))}
html.kh-systeme .kh-module{display:flex;flex-direction:column;align-items:flex-start;gap:4px;padding:16px;text-align:left;color:inherit;font:inherit;cursor:pointer}
html.kh-systeme .kh-module .icon-svg{font-size:24px;color:#c4b5fd}
html.kh-systeme .kh-module b{font:600 13px Orbitron,monospace;color:#fff;letter-spacing:1px}
html.kh-systeme .kh-module small{font-size:13px;color:#94a3b8}
html.kh-systeme .kh-large{width:100%}
html.kh-systeme .kh-radar{display:block;width:100%;max-width:380px;margin:8px auto 0}
html.kh-systeme .kh-radar-grille{fill:none;stroke:rgba(255,255,255,.12);stroke-width:1}
html.kh-systeme .kh-radar-forme{fill:rgba(0,170,255,.25);stroke:#00aaff;stroke-width:2;filter:drop-shadow(0 0 6px rgba(0,170,255,.6))}
html.kh-systeme .kh-radar-texte{fill:#cbd5e1;font:500 10px Orbitron,monospace;text-anchor:middle;dominant-baseline:middle}
html.kh-systeme .kh-colonnes{display:flex;align-items:flex-end;gap:8px;height:130px;margin-top:12px}
html.kh-systeme .kh-col{flex:1;height:100%;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:4px}
html.kh-systeme .kh-col div{width:70%;min-height:3px;border-radius:4px 4px 0 0;background:linear-gradient(180deg,#00aaff,#8b5cf6)}
html.kh-systeme .kh-col span{font:500 9px Orbitron,monospace;color:#cbd5e1}
html.kh-systeme .kh-col small{font:500 10px Orbitron,monospace;color:#94a3b8}
html.kh-systeme .kh-vide{padding:26px 0 12px;text-align:center;font:500 11px Orbitron,monospace;letter-spacing:2px;color:#64748b}
html.kh-systeme .kh-sous-barre{display:flex;align-items:center;gap:12px;padding:10px 16px 0}
html.kh-systeme .kh-sous-barre[hidden]{display:none}
html.kh-systeme .kh-retour{display:flex;align-items:center;gap:6px;padding:8px 14px;border-radius:10px;cursor:pointer;
  border:1px solid var(--glass-border);background:rgba(255,255,255,.05);color:#fff;font:600 12px Orbitron,monospace;letter-spacing:1px}
html.kh-systeme .kh-retour:hover{border-color:rgba(167,139,250,.5)}
html.kh-systeme .kh-sous-titre{display:flex;align-items:center;gap:8px;font:600 13px Orbitron,monospace;letter-spacing:2px;color:#e2e8f0}
/* en-tete compact sur telephone : nom et XP lisibles a cote des 4 boutons */
html.kh-systeme.kh-phone .kh-head{gap:8px}
html.kh-systeme.kh-phone .kh-avatar{width:38px;height:38px;font-size:17px;border-radius:10px}
html.kh-systeme.kh-phone .kh-head .gear-btn{width:30px;height:30px;min-width:30px;padding:0;display:grid;place-items:center}
html.kh-systeme.kh-phone .kh-head > div:last-child{gap:4px!important}
html.kh-systeme.kh-phone .kh-head-l1 .hunter-tag{font-size:13px}
html.kh-systeme.kh-phone .kh-lvl{font-size:12px}
html.kh-systeme.kh-phone .kh-head-l3{letter-spacing:1px;gap:6px}
@media (max-width:400px){html.kh-systeme .kh-head-l3 span:first-child{display:none}}
/* navigation du bas : une seule couleur, comme KobaHunter */
html.kh-systeme .tab{font-size:10px}
html.kh-systeme .tab.active{color:#fff!important;text-shadow:none!important;box-shadow:none!important;
  border-top-color:rgba(255,255,255,.35)!important;background:rgba(255,255,255,.07)!important}
html.kh-systeme .tab .icon-svg{font-size:20px}

/* ---------- Menu commun (bouton rond en bas a droite) ---------- */
#kh-menu{position:fixed;right:14px;bottom:96px;z-index:99999;font-family:'Fredoka',sans-serif}
#kh-fab{width:54px;height:54px;border-radius:50%;border:1px solid rgba(167,139,250,.55);cursor:pointer;
  background:linear-gradient(135deg,rgba(139,92,246,.92),rgba(88,101,242,.92));color:#fff;display:grid;place-items:center;
  box-shadow:var(--shadow-hover);transition:transform .15s}
#kh-fab:hover{transform:scale(1.06)}
#kh-fab svg.kh-ico{width:26px;height:26px;margin:0;color:#fff;filter:none}
#kh-panel{position:absolute;right:0;bottom:64px;width:236px;padding:8px;border-radius:var(--r-md);
  background:var(--glass-strong);border:1px solid var(--glass-border);box-shadow:var(--shadow-hover);
  -webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);display:none;flex-direction:column;gap:4px}
#kh-menu.ouvert #kh-panel{display:flex}
#kh-panel .kh-ligne{display:flex;align-items:center;gap:10px;padding:11px 12px;border-radius:12px;border:0;cursor:pointer;
  background:transparent;color:var(--ink);font:500 15px 'Fredoka',sans-serif;text-decoration:none;text-align:left;width:100%}
#kh-panel .kh-ligne:hover{background:rgba(139,92,246,.22)}
#kh-panel .kh-ligne.actif{background:rgba(139,92,246,.35);font-weight:600}
#kh-panel .kh-ligne svg.kh-ico{width:20px;height:20px;margin:0}
#kh-panel .kh-ligne small{margin-left:auto;color:var(--ink-3);font-size:13px}
#kh-panel hr{border:0;border-top:1px solid var(--glass-border);margin:4px 2px}
#kh-panel .kh-ligne.kh-danger{color:#fca5a5}
#kh-panel .kh-ligne.kh-danger:hover{background:rgba(239,68,68,.18)}
#kh-panel .kh-ligne.kh-danger svg.kh-ico{color:#fca5a5}
#kh-panel .kh-ligne.kh-discord{background:linear-gradient(135deg,rgba(88,101,242,.55),rgba(71,82,196,.55))}

@media (prefers-reduced-motion:reduce){
  *{transition:none!important;animation-duration:.01ms!important}
  #kh-particules{display:none}
}
