/* css/admin.css: chế độ Admin. Tách từ index.html (tools/split_index.py). */
/* ---- Admin mode ---- */
.tab.adm{color:#ff8a60} .tab.adm[aria-selected="true"]{border-bottom-color:#ff6a3a}
body.admin-on::after{content:'ADMIN';position:fixed;right:6px;bottom:4px;z-index:50;font:700 9px/1 system-ui;letter-spacing:.15em;color:#ff8a60;opacity:.7;pointer-events:none}
.adm-p{display:flex;flex-direction:column;gap:10px;padding:10px 12px;font-size:12px}
.adm-p h4{margin:0 0 4px;font-size:11px;letter-spacing:.12em;text-transform:uppercase;color:#ff9a70}
.adm-p section{border:1px solid #3a2a24;background:#140f0d;padding:8px;display:flex;flex-direction:column;gap:6px}
.adm-row{display:flex;flex-wrap:wrap;gap:5px;align-items:center}
.adm-grp{display:inline-flex;align-items:center;gap:4px} .adm-grp button{min-width:34px}
.adm-p button{padding:4px 9px;background:#2a1c16;border:1px solid #6a3a28;color:#f2d2c0;font-size:12px;cursor:pointer}
.adm-p button:hover{background:#3a261c} .adm-p button.on{background:#7a2a14;border-color:#ff6a3a;color:#fff}
.adm-p select,.adm-p input{background:#0d0a08;border:1px solid #4a3a30;color:#eee;padding:3px 5px;font-size:12px;min-width:0}
.adm-p input[type=number]{width:90px}
.adm-p small{color:#9a8a7a}
.adm-donate-list{display:flex;flex-direction:column;gap:4px;max-height:220px;overflow:auto}.adm-donate-row{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:4px 6px;border:1px solid #3a2a24;background:#0d0a08;font-size:12px}.adm-donate-row code{color:#efd17e;letter-spacing:.04em}.adm-donate-row em{font-style:normal;color:#9a8a7a;margin-left:auto}.adm-donate-row em.used{color:#6a5a4a}
.pane{padding:16px;display:flex;flex-direction:column;gap:14px}
.pane[hidden]{display:none}
.eyebrow{font-size:11px;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);margin:0}
.target{font-family:var(--f-display);font-size:26px;font-weight:700;line-height:1.1;margin:2px 0 0;text-wrap:balance}
.rows{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:6px}
.row{display:flex;align-items:center;gap:10px;padding:9px 12px;border-top:1px solid var(--line);font-size:13px}
.row:first-child{border-top:0}
.row .nm{flex:1;min-width:0}


.ic{width:22px;height:22px;flex:none;display:inline-block}
.note{font-size:12.5px;color:var(--muted);margin:0}
.chance{display:flex;justify-content:space-between;align-items:baseline;font-size:13px;cursor:help}
.chance .hint{color:var(--muted);font-size:12px}

/* hiệu ứng đột phá: chớp sáng toàn khung + băng chữ */
.burst{position:fixed;inset:0;z-index:60;display:grid;place-content:center;justify-items:center;gap:2px;pointer-events:none;text-align:center;padding:12px}
.burst::before{content:"";position:absolute;inset:0;background:radial-gradient(circle at 50% 55%,var(--bc) 0%,transparent 65%);opacity:0;animation:burst-flash 1.1s ease-out}
.burst b{position:relative;font-family:var(--f-display);font-weight:700;font-size:26px;line-height:1.05;color:var(--bc);text-shadow:0 0 12px var(--bc),0 2px 0 #000;animation:burst-text 2.2s ease-out forwards}
.burst small{position:relative;font-size:12px;color:var(--paper);text-shadow:0 1px 2px #000;animation:burst-text 2.2s ease-out forwards}
.burst.good{--bc:#7fe3d2} .burst.gold{--bc:#f2c94c} .burst.bad{--bc:#e58472}
.burst.gold b{font-size:30px}
body.strip .burst b{font-size:19px} body.strip .burst.gold b{font-size:21px} body.strip .burst small{font-size:10px}
body.panel .burst b{font-size:22px}
.burst b i{display:inline-block;font-style:normal;animation:burst-ch .6s cubic-bezier(.2,1.6,.4,1) both;animation-delay:calc(var(--i)*45ms)}
/* Thành công: từng chữ bật lên, ánh sáng quét qua */
.burst.good b i,.burst.gold b i{animation:burst-ch .6s cubic-bezier(.2,1.6,.4,1) both,burst-glint .5s ease-in-out both;animation-delay:calc(var(--i)*45ms),calc(.55s + var(--i)*70ms)}
/* Thất bại: rung, từng chữ rơi xuống rồi tắt dần */
.burst.bad b{animation:burst-shake .45s ease-in-out,burst-text 2.2s ease-out forwards}
.burst.bad b i{animation:burst-fall 2s cubic-bezier(.5,0,.8,.4) both;animation-delay:calc(.75s + var(--i)*60ms)}
.burst.bad::after{content:"";position:absolute;left:50%;top:50%;width:min(70%,240px);height:2px;background:linear-gradient(90deg,transparent,var(--bc),transparent);transform:translate(-50%,-50%) rotate(-8deg);opacity:0;animation:burst-crack .9s .15s ease-out}
@keyframes burst-ch{0%{opacity:0;transform:translateY(10px) scale(.4)}100%{opacity:1;transform:none}}
@keyframes burst-glint{0%,100%{color:var(--bc);text-shadow:0 0 12px var(--bc),0 2px 0 #000}50%{color:#fff;text-shadow:0 0 18px #fff,0 0 8px var(--bc),0 2px 0 #000}}
@keyframes burst-shake{0%,100%{transform:translateX(0)}20%{transform:translateX(-6px) rotate(-2deg)}40%{transform:translateX(5px) rotate(1.5deg)}60%{transform:translateX(-4px)}80%{transform:translateX(3px)}}
@keyframes burst-fall{0%,30%{transform:none;opacity:1}100%{transform:translateY(16px) rotate(calc((var(--i) - 3)*6deg));opacity:0}}
@keyframes burst-crack{0%{opacity:0;width:0}30%{opacity:1}100%{opacity:0;width:min(70%,240px)}}
@keyframes burst-flash{0%{opacity:0}12%{opacity:.85}100%{opacity:0}}
.craft-toast{position:fixed;left:50%;top:18%;z-index:61;display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:4px 12px;min-width:240px;max-width:min(360px,calc(100vw - 32px));padding:12px 18px 12px 12px;
  background:linear-gradient(#211a10,#15100a);border:1px solid #8a6a3a;border-radius:6px;box-shadow:0 0 0 1px #0b0806,0 8px 28px #000a,0 0 22px #e6c46a33;pointer-events:none;animation:ct-in 2.8s ease-out forwards}
.craft-toast .ct-ic{grid-row:span 3;width:56px;height:56px;display:grid;place-items:center;background:radial-gradient(circle,#e6c46a40,transparent 70%)}
.craft-toast .ct-ic img{width:48px;height:48px;image-rendering:pixelated;animation:ct-pop .6s cubic-bezier(.2,1.6,.4,1) both .1s}
.craft-toast .ct-t{font-family:var(--f-display);font-weight:700;font-size:15px;letter-spacing:.08em;color:#ffe2a0;text-shadow:0 0 8px #e6c46a88}
.craft-toast .ct-o{font-size:14px;color:var(--paper)} .craft-toast .ct-o b{color:#ffe2a0}
.craft-toast .ct-u{font-size:11px;color:var(--muted);display:flex;flex-wrap:wrap;gap:2px 8px;align-items:center}
.craft-toast .ct-u img{width:16px;height:16px;vertical-align:-3px;image-rendering:pixelated}
body.strip .craft-toast{top:8px;min-width:0;padding:6px 10px 6px 6px} body.strip .craft-toast .ct-ic{width:36px;height:36px} body.strip .craft-toast .ct-ic img{width:32px;height:32px}
.craft-toast.fast{animation-duration:1s}
@keyframes ct-in{0%{opacity:0;transform:translate(-50%,10px) scale(.92)}8%{opacity:1;transform:translate(-50%,0) scale(1.03)}14%{transform:translate(-50%,0) scale(1)}82%{opacity:1}100%{opacity:0;transform:translate(-50%,-8px)}}
@keyframes ct-pop{0%{transform:scale(.3);filter:brightness(2)}100%{transform:scale(1);filter:none}}
@media (prefers-reduced-motion:reduce){.craft-toast,.craft-toast .ct-ic img{animation-duration:.01s}.craft-toast{animation:none}}
@keyframes burst-text{0%{opacity:0;transform:scale(.6)}12%{opacity:1;transform:scale(1.12)}22%{transform:scale(1)}78%{opacity:1}100%{opacity:0;transform:translateY(-6px)}}
@media (prefers-reduced-motion:reduce){.burst::before{animation:none}.burst b,.burst small{animation:burst-fade 2s linear forwards}@keyframes burst-fade{0%,80%{opacity:1}100%{opacity:0}}}


.chance b{font-family:var(--f-display);font-size:24px;color:var(--gold)}



.desc{font-size:13px;color:#c6ccc6;margin:0;max-width:60ch}
.inv{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:8px}
.item{display:flex;gap:10px;align-items:center;padding:10px;border:1px solid var(--line);border-radius:6px;min-width:0}
.item .ic{width:28px;height:28px}
.item div{min-width:0}
.item b{display:block;font-weight:500;font-size:13px;line-height:1.3}
.item span{font-variant-numeric:tabular-nums;color:var(--gold);font-size:13px}
.empty{color:var(--muted);font-size:13px}











/* Searchable admin item catalog. */
.adm-catalog-groups{display:flex;flex-wrap:wrap;gap:6px;margin:14px 0}.adm-catalog-filters{display:flex;flex-wrap:wrap;gap:10px;align-items:end}.adm-catalog-filters label,.adm-catalog-receive label{display:flex;flex-direction:column;gap:5px;font-size:11px;color:#b9ac8c}.adm-catalog-filters select{max-width:260px;width:100%}.adm-catalog-filters .adm-search{flex:1;min-width:220px}.adm-search input{width:100%;box-sizing:border-box}.adm-catalog-count{display:flex;justify-content:space-between;align-items:center;margin:12px 0;color:#b9ac8c;font-size:12px}.adm-catalog-count button{padding:3px 10px}.adm-catalog-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:7px;max-height:360px;overflow:auto;padding:2px}.adm-p .adm-item{display:flex;align-items:center;gap:10px;padding:9px;text-align:left;min-width:0;background:#15201c;border:1px solid #645635;cursor:pointer}.adm-item img{width:38px;height:38px;object-fit:contain;flex:none}.adm-item>span{min-width:0}.adm-item b{display:block;font-size:12px;overflow-wrap:anywhere}.adm-item small{display:block;margin-top:4px;font-size:10px;color:#b9b39f}.adm-p .adm-item.selected{border-color:#efd17e;background:#393321;box-shadow:inset 3px 0 #efd17e}.adm-catalog-receive{position:sticky;bottom:0;z-index:2;display:flex;align-items:center;flex-wrap:wrap;gap:10px;background:#151a16;border:1px solid #8e7744;padding:12px;margin-top:12px;box-shadow:0 -4px 12px #0004}.adm-catalog-receive>div{flex:1;min-width:170px}.adm-catalog-receive small{display:block;color:#958d77;font-size:10px;margin-top:5px}.adm-catalog-receive input{width:90px}.adm-catalog-recent{margin-top:12px}.adm-catalog-recent summary{cursor:pointer;color:#c5b484;margin-bottom:8px}.adm-catalog-grid button:focus-visible{outline:2px solid #efd17e;outline-offset:1px}@media(max-width:600px){.adm-catalog-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.adm-p .adm-item{flex-direction:column;align-items:start}.adm-catalog-filters label{flex:1;min-width:120px}.adm-catalog-filters select{max-width:100%}}
