/* Krosmo Idle — interface sombre, fine et translucide */
:root { --bg: #0b1017; --glass: rgba(18, 26, 38, .72); --line: rgba(255, 255, 255, .09); --txt: #e8eef5; --dim: #8fa0b3; --acc: #38c6f4; --gold: #ffcf5a; --good: #58d68d; --bad: #ff6b6b; }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: radial-gradient(1200px 700px at 30% 0%, #16202e, var(--bg)); color: var(--txt); font: 14px/1.4 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
img { -webkit-user-drag: none; user-select: none; }
.glass { background: var(--glass); border: 1px solid var(--line); border-radius: 12px; backdrop-filter: blur(10px); }
#app { height: 100%; display: flex; flex-direction: column; padding: 10px; gap: 10px; max-width: 1760px; margin: 0 auto; }
#top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#heroBadge { display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 8px; min-width: 210px; text-align: left; }
#heroBadge img { width: 40px; height: 40px; object-fit: contain; }
#heroBadge .col { display: flex; flex-direction: column; gap: 3px; flex: 1; }
#heroBadge small { color: var(--dim); font-size: 11px; }
.xp { height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .1); overflow: hidden; display: block; }
.xp i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #7b6cff, var(--acc)); transition: width .3s; }
#res { display: flex; gap: 8px; }
.res { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; font-size: 15px; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex: none; }
.dot.kama { background: radial-gradient(circle at 35% 30%, #fff3b0, #f2b01e 60%, #a86a00); }
.dot.pep { background: radial-gradient(circle at 35% 30%, #e6fff2, #3ed598 60%, #0d7a4f); border-radius: 3px; transform: rotate(45deg); }
.dot.shard { background: radial-gradient(circle at 35% 30%, #fff, #c08cff 55%, #5b2ea6); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); border-radius: 0; }
#tabs { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
#tabs button { padding: 9px 11px; border-radius: 10px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); color: var(--dim); position: relative; }
#tabs button:hover { color: var(--txt); background: rgba(255, 255, 255, .1); }
#tabs button.on { color: #04131c; background: var(--acc); border-color: transparent; font-weight: 600; }
#tabs button .pin { position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--gold); color: #2b1d00; font-size: 10px; font-weight: 700; line-height: 16px; padding: 0 4px; }
main { flex: 1; display: flex; gap: 10px; min-height: 0; }
#scene { flex: 1; position: relative; border-radius: 14px; overflow: hidden; background: #05080c; border: 1px solid var(--line); min-width: 0; }
.mini { padding: 5px 10px; border-radius: 8px; background: rgba(255, 255, 255, .08); border: 1px solid var(--line); }
.mini:hover { background: rgba(255, 255, 255, .16); }
.mini.on { background: var(--good); color: #04210f; font-weight: 600; border-color: transparent; }
.mini:disabled { opacity: .35; cursor: default; }
.sp { width: 50px; height: 50px; border-radius: 11px; position: relative; overflow: hidden; background: rgba(10, 16, 24, .8); border: 1px solid var(--line); }
.sp img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sp .cd { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(4, 8, 14, .78); transition: height .1s linear; }
.sp .el { position: absolute; left: 4px; top: 4px; width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(0, 0, 0, .5); }
.sp .lv { position: absolute; right: 4px; bottom: 2px; font-size: 11px; font-weight: 700; text-shadow: 0 1px 2px #000; }
.sp.empty { border-style: dashed; opacity: .5; }
.toast { padding: 8px 12px; border-radius: 10px; background: rgba(12, 18, 28, .88); border: 1px solid var(--line); animation: toast 4.5s forwards; max-width: 360px; display: flex; align-items: center; gap: 8px; }
.toast img { width: 26px; height: 26px; }
@keyframes toast { 0% { opacity: 0; transform: translateX(20px); } 8%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; } }
#panel { width: 470px; flex: none; display: flex; flex-direction: column; overflow: hidden; }
#panel h2 { margin: 0; padding: 14px 16px 10px; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); font-weight: 600; }
#panel .body { flex: 1; overflow-y: auto; padding: 0 16px 16px; }
#panel .body::-webkit-scrollbar { width: 8px; } #panel .body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .14); border-radius: 4px; }
.row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; background: rgba(255, 255, 255, .04); margin-bottom: 6px; border: 1px solid transparent; }
.row:hover { border-color: var(--line); }
.row .ico { width: 36px; height: 36px; flex: none; object-fit: contain; border-radius: 8px; }
.row .grow { flex: 1; min-width: 0; }
.row b { font-weight: 600; } .row small { color: var(--dim); display: block; font-size: 12px; }
.btn { padding: 8px 12px; border-radius: 9px; background: var(--acc); color: #04131c; font-weight: 600; white-space: nowrap; }
.btn:hover { filter: brightness(1.12); }
.btn.sec { background: rgba(255, 255, 255, .08); color: var(--txt); border: 1px solid var(--line); font-weight: 500; }
.btn.gold { background: var(--gold); color: #2b1d00; }
.btn.off, .btn:disabled { opacity: .38; filter: grayscale(.6); cursor: default; }
.btn.danger { background: var(--bad); color: #2a0606; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 6px; }
.cell { aspect-ratio: 1; border-radius: 9px; background: rgba(255, 255, 255, .05); border: 2px solid transparent; position: relative; padding: 0; overflow: hidden; }
.cell img { width: 100%; height: 100%; object-fit: contain; display: block; }
.cell.sel { box-shadow: 0 0 0 2px #fff inset; }
.cell .tag { position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 4px; background: var(--good); color: #04210f; font-size: 10px; font-weight: 800; line-height: 14px; text-align: center; }
.cell .lvl { position: absolute; right: 3px; bottom: 1px; font-size: 10px; color: #fff; text-shadow: 0 1px 2px #000; }
.cell.empty { border: 1px dashed var(--line); background: none; display: flex; align-items: center; justify-content: center; color: var(--dim); font-size: 10px; text-align: center; }
.slots { display: grid; grid-template-columns: repeat(9, 1fr); gap: 5px; margin-bottom: 6px; }
.slots.dof { grid-template-columns: repeat(9, 1fr); }
.sub { display: flex; gap: 6px; margin: 10px 0 8px; flex-wrap: wrap; align-items: center; }
.sub .mini.on { background: var(--acc); color: #04131c; }
.card { padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); margin-bottom: 10px; }
.card h3 { margin: 0 0 4px; font-size: 16px; } .card p { margin: 4px 0; color: var(--dim); font-size: 13px; }
.stat { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid rgba(255, 255, 255, .05); }
.stat img { width: 20px; height: 20px; object-fit: contain; } .stat .n { width: 104px; font-weight: 600; } .stat .v { width: 58px; text-align: right; font-variant-numeric: tabular-nums; } .stat .e { flex: 1; color: var(--dim); font-size: 12px; }
.stat .plus { width: 26px; height: 24px; border-radius: 7px; background: var(--acc); color: #04131c; font-weight: 800; }
.stat .plus:disabled { opacity: .25; }
.lines { color: var(--txt); font-size: 13px; margin: 8px 0; } .lines div { padding: 1px 0; }
.set { color: var(--good); font-size: 12px; margin: 6px 0; }
.dj { position: relative; border-radius: 12px; overflow: hidden; margin-bottom: 10px; border: 1px solid var(--line); background: #0d141d; }
.dj .img { height: 92px; background-size: cover; background-position: center; filter: saturate(.9) brightness(.75); }
.dj .in { padding: 10px 12px 12px; } .dj h3 { margin: 0; font-size: 16px; } .dj small { color: var(--dim); }
.dj .drop { display: none; margin-top: 8px; padding: 8px; border-radius: 9px; background: rgba(255, 207, 90, .09); border: 1px solid rgba(255, 207, 90, .25); font-size: 12px; align-items: center; gap: 8px; }
.dj:hover .drop { display: flex; } .dj .drop img { width: 34px; height: 34px; }
.dj.lock { opacity: .55; }
.note { color: var(--dim); font-size: 12px; margin: 8px 0; }
#overlay { position: fixed; inset: 0; background: rgba(4, 7, 11, .82); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; z-index: 10; padding: 20px; }
#overlay[hidden] { display: none; }
.modal { max-width: 980px; width: 100%; max-height: 92vh; overflow: auto; padding: 22px 24px; }
.modal h1 { margin: 0 0 4px; font-size: 26px; font-weight: 600; } .modal p { color: var(--dim); margin: 0 0 16px; }
.classes { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.classes button { padding: 12px 8px; border-radius: 12px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.classes button:hover { background: rgba(56, 198, 244, .16); border-color: var(--acc); }
.classes img { width: 64px; height: 64px; object-fit: contain; } .classes small { color: var(--dim); font-size: 11px; }
textarea { width: 100%; min-height: 90px; background: rgba(0, 0, 0, .35); color: var(--txt); border: 1px solid var(--line); border-radius: 9px; padding: 8px; font: 12px ui-monospace, Consolas, monospace; resize: vertical; }
@media (max-width: 1100px) { body { overflow: auto; } main { flex-direction: column; } #panel { width: auto; min-height: 520px; } #scene { aspect-ratio: 16 / 9; flex: none; } #app { height: auto; } }

/* ---- scène de combat ---- */
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; touch-action: manipulation; }
#sceneTop { position: absolute; top: 12px; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
#sceneTop > * { pointer-events: auto; }
#zoneBar { padding: 7px 10px; display: flex; align-items: center; gap: 10px; white-space: nowrap; max-width: calc(100% - 24px); }
#zoneBar .name { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
#zoneBar .z { font-size: 15px; font-weight: 600; }
#zoneBar .f { color: var(--dim); font-size: 11px; overflow: hidden; text-overflow: ellipsis; max-width: 210px; }
#zoneBar .cnt { color: var(--dim); font-size: 12px; min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; }
.pips { display: flex; gap: 4px; align-items: center; }
.pip { width: 30px; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .13); overflow: hidden; position: relative; }
.pip i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--acc); border-radius: 4px; transition: width .2s; }
.pip.done i { width: 100%; opacity: .55; }
.pip.boss { width: 38px; background: rgba(255, 107, 107, .22); } .pip.boss i { background: var(--bad); }
.pip.now { box-shadow: 0 0 0 1px rgba(255, 255, 255, .45); }
.bar { display: block; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .12); overflow: hidden; position: relative; }
.bar i { display: block; height: 100%; background: var(--acc); transition: width .2s; }
#zoneBar .bar { width: 170px; }
#bossBar { display: flex; align-items: center; gap: 10px; padding: 6px 12px; width: min(460px, calc(100% - 24px)); }
#bossBar[hidden] { display: none; }
#bossBar b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
#bossBar .bar { flex: 1; height: 16px; border-radius: 8px; background: rgba(0, 0, 0, .45); }
#bossBar .bar i { background: linear-gradient(90deg, #c0392b, #ff6b6b); transition: width .12s; }
#bossBar .bar em { position: absolute; inset: 0; text-align: center; font-style: normal; font-size: 11px; line-height: 16px; text-shadow: 0 1px 2px #000; }
#bossTime { font-size: 12px; color: var(--gold); min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; }
#hud { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 7px; }
#heroHp { position: relative; height: 16px; border-radius: 8px; overflow: hidden; background: rgba(0, 0, 0, .45); }
#heroHp i { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; background: linear-gradient(90deg, #2faa5f, #7be08f); transition: width .15s; border-radius: 8px; }
#heroHp.low i { background: linear-gradient(90deg, #c0392b, #ff8a5c); }
#heroHp span { position: absolute; inset: 0; text-align: center; font-size: 11px; line-height: 16px; text-shadow: 0 1px 2px #000; font-variant-numeric: tabular-nums; }
#spellBar { display: flex; gap: 6px; }
.sp.ready { box-shadow: 0 0 0 1px rgba(255, 255, 255, .28), 0 0 10px rgba(56, 198, 244, .35); }
#meters { position: absolute; left: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; pointer-events: none; }
.chip { display: flex; flex-direction: column; padding: 5px 10px; border-radius: 9px; background: rgba(12, 18, 28, .72); border: 1px solid var(--line); line-height: 1.2; min-width: 86px; pointer-events: auto; }
.chip[hidden] { display: none; }
.chip small { color: var(--dim); font-size: 10px; letter-spacing: .04em; text-transform: uppercase; }
.chip b { font-size: 14px; font-variant-numeric: tabular-nums; }
.chip.buff { flex-direction: row; gap: 6px; align-items: center; border-color: rgba(255, 207, 90, .55); color: var(--gold); font-weight: 600; font-size: 12px; }
#gold { position: absolute; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; padding: 0; animation: goldBob 1.6s ease-in-out infinite; z-index: 2; }
#gold[hidden] { display: none; }
#gold i { position: absolute; inset: 5px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff8cf, #ffcf5a 45%, #c98a12 80%); box-shadow: 0 0 0 2px rgba(255, 245, 190, .7) inset, 0 0 18px 6px rgba(255, 207, 90, .55); }
#gold i::after { content: "K"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 800 20px/1 "Segoe UI", system-ui, sans-serif; color: #7a4d00; }
#gold.last { animation-duration: .5s; }
@keyframes goldBob { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-7px) scale(1.07); } }
#toasts { position: absolute; right: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; pointer-events: none; }
#hint { position: absolute; left: 50%; bottom: 118px; transform: translateX(-50%); padding: 5px 12px; border-radius: 9px; background: rgba(12, 18, 28, .78); border: 1px solid var(--line); color: var(--dim); font-size: 12px; pointer-events: none; white-space: nowrap; }
#hint[hidden] { display: none; }
/* ---- panneaux : paliers, succès, bénédictions ---- */
.thin { display: block; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .1); overflow: hidden; margin-top: 5px; }
.thin i { display: block; height: 100%; background: var(--acc); border-radius: 2px; }
.thin.gold i { background: var(--gold); }
.row.done { opacity: .6; } .row .tick { color: var(--good); font-weight: 700; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg button { padding: 5px 11px; background: rgba(255, 255, 255, .05); color: var(--dim); }
.seg button.on { background: var(--acc); color: #04131c; font-weight: 600; }
.delta.up { color: var(--good); } .delta.down { color: var(--bad); }
.btn.shard { background: #c08cff; color: #1d0b3a; }
@media (max-width: 760px) { #meters { display: none; } #toasts { bottom: 118px; } }
