.demo-tabs { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--rule); border-radius: 999px; margin-bottom: 28px; }
.demo-tabs button { height: 40px; padding: 0 22px; border: 0; border-radius: 999px; background: transparent; color: var(--mist);
  font: 500 15px/1 var(--sans); cursor: pointer; transition: background .2s, color .2s; }
.demo-tabs button[aria-selected="true"] { background: var(--nib); color: var(--ink); }
.demo { display: none; }
.demo.on { display: block; }
.demo-label { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin: 0 0 12px; color: var(--mist); font-size: 14px; }
.demo-label b { color: var(--paper); font-weight: 500; font-size: 15px; }
.demo-label + .screen { margin-bottom: 40px; }

.screen { position: relative; overflow: hidden; border-radius: 14px; border: 1px solid var(--rule);
  background: #182012 url(hud-bg.jpg) center / cover no-repeat; user-select: none; -webkit-user-select: none; }
.screen.gui::before { content: ""; position: absolute; inset: -20px; background: inherit; filter: blur(10px) brightness(.72); }
.screen .fit { position: absolute; left: 0; top: 0; transform-origin: 0 0; }

.pg { --bg: #fafafc; --tx: #141419; --tx2: #6e6e78; --bd: rgba(0,0,0,.078); --ac: #3c6eff; --card: #fff;
  position: relative; width: 840px; height: 580px; border-radius: 20px; background: var(--bg);
  box-shadow: inset 0 0 0 1.5px var(--bd), 0 24px 60px rgba(0,0,0,.35);
  font-family: Inter, "Noto Sans SC", sans-serif; color: var(--tx); overflow: hidden;
  opacity: 0; transform: scale(.8); transition: opacity .45s cubic-bezier(.2,.7,.2,1), transform .55s cubic-bezier(.2,.7,.2,1); }
.pg.open { opacity: 1; transform: scale(1); }
.pg-title { position: absolute; left: 30px; top: 45px; transform: translateY(-50%); font: 700 32px/1 Inter, sans-serif;
  color: var(--ac); text-shadow: 0 0 6px rgba(60,110,255,.55); letter-spacing: -.01em; }
.pg-logo { position: absolute; left: 178px; top: 32px; width: 26px; height: 26px; background: var(--ac);
  -webkit-mask: url(logo.png) center / contain no-repeat; mask: url(logo.png) center / contain no-repeat;
  filter: drop-shadow(0 0 6px rgba(60,110,255,.45)); }
.pg-ind { position: absolute; left: 14px; width: 192px; height: 40px; border-radius: 10px; background: rgba(60,110,255,.137);
  box-shadow: 0 0 10px rgba(60,110,255,.18); transition: top .35s cubic-bezier(.2,.8,.2,1), opacity .2s; }
.pg-ind::before { content: ""; position: absolute; left: 0; top: 10px; width: 3.5px; height: 20px; border-radius: 2px; background: var(--ac); }
.pg-cat { position: absolute; left: 14px; width: 192px; height: 40px; border: 0; background: none; cursor: pointer; text-align: left;
  color: rgba(20,20,25,.82); padding: 0 0 0 12px; display: flex; align-items: center; gap: 12px; font-family: inherit; }
.pg-cat svg { width: 13px; height: 13px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.pg-cat span { display: flex; flex-direction: column; gap: 2px; }
.pg-cat b { font-size: 12px; font-weight: 400; line-height: 1.1; transition: font-size .2s; }
.pg-cat i { font-style: normal; font-size: 8px; color: rgba(110,110,120,.43); line-height: 1.1; }
.pg-cat i.act { color: rgba(60,110,255,.7); }
.pg-cat.sel { color: var(--ac); }
.pg-cat.sel svg { stroke-width: 2.6; }
.pg-cat.sel b { font-size: 18px; font-weight: 700; text-shadow: 0 0 3px rgba(60,110,255,.5); }
.pg-cat.sel i { color: rgba(20,20,25,.5); }
.pg-cat.sel i.act { color: var(--ac); }
.pg-user { position: absolute; left: 14px; bottom: 16px; width: 192px; height: 54px; border-radius: 14px; background: rgba(255,255,255,.63);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.03); display: flex; align-items: center; gap: 10px; padding-left: 10px; }
.pg-user .av { position: relative; width: 36px; height: 36px; border-radius: 50%; background: #dfe3ea center / cover; flex: none; }
.pg-user .av::after { content: ""; position: absolute; right: -0.5px; bottom: -0.5px; width: 7px; height: 7px; border-radius: 50%;
  background: #32dc78; box-shadow: 0 0 0 1px var(--card); }
.pg-user b { display: block; font-size: 12px; font-weight: 400; line-height: 1.4; }
.pg-user small { display: block; font-size: 8px; color: var(--tx2); }
.pg-head { position: absolute; left: 260px; top: 22px; font: 700 32px/1.2 Inter, "Noto Sans SC", sans-serif; transition: opacity .25s, transform .25s; }
.pg-search { position: absolute; right: 40px; top: 36px; width: 190px; height: 28px; border-radius: 14px; background: var(--bd);
  box-shadow: inset 0 0 0 1px var(--bd); transition: background .2s, box-shadow .2s; }
.pg-search:focus-within { background: var(--card); box-shadow: inset 0 0 0 1px var(--ac); }
.pg-search input { width: 100%; height: 100%; border: 0; background: none; outline: none; padding: 0 12px; font: 400 8px/1 inherit;
  font-family: inherit; font-size: 8px; color: var(--tx); }
.pg-search input::placeholder { color: var(--tx2); }
.pg-view { position: absolute; left: 221px; top: 95px; right: 0; bottom: 0; overflow: hidden; }
.pg-grid { position: absolute; left: 39px; top: 15px; width: 540px; display: grid; grid-template-columns: 260px 260px; gap: 20px;
  transition: transform .4s cubic-bezier(.2,.8,.2,1); }
.pg-grid.swap { animation: pgSwap .45s cubic-bezier(.2,.8,.2,1); }
@keyframes pgSwap { from { opacity: 0; translate: 0 30px; } }
.pg-card { position: relative; height: 110px; border-radius: 15px; background: var(--card); cursor: pointer; border: 0; text-align: left;
  font-family: inherit; color: var(--tx); box-shadow: inset 0 0 0 1px var(--bd);
  transition: transform .18s ease, box-shadow .25s ease; }
.pg-card:hover { transform: scale(1.02); box-shadow: inset 0 0 0 2px var(--ac), 0 0 12px rgba(60,110,255,.2); }
.pg-card.on { box-shadow: inset 0 0 0 1px var(--ac), 0 0 12px rgba(60,110,255,.2); }
.pg-card .nm { position: absolute; left: 22px; top: 21px; font-size: 14px; font-weight: 700; line-height: 1; }
.pg-card .st { position: absolute; left: 22px; top: 47px; font-size: 8px; color: var(--tx2); line-height: 1; letter-spacing: .02em; }
.pg-card.on .st { color: var(--ac); }
.pg-card .ds { position: absolute; left: 22px; top: 79px; width: 180px; font-size: 8px; line-height: 12px; color: var(--tx2); white-space: nowrap; overflow: hidden; }
.pg-card .kb { position: absolute; right: 22px; top: 75px; height: 20px; padding: 0 8px; border-radius: 6px; background: var(--bd);
  font-size: 8px; line-height: 20px; color: var(--tx2); }
.pg-card .sw { position: absolute; right: 22px; top: 24px; width: 34px; height: 18px; border-radius: 9px; background: var(--bd); transition: background .25s; }
.pg-card .sw::after { content: ""; position: absolute; left: 3px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .25s cubic-bezier(.3,.7,.2,1); }
.pg-card.on .sw { background: var(--ac); }
.pg-card.on .sw::after { transform: translateX(16px); }
.pg-empty { grid-column: 1 / -1; padding-top: 40px; text-align: center; font-size: 12px; color: var(--tx2); }

.lg { position: relative; width: 840px; height: 300px; font-family: Inter, "Noto Sans SC", sans-serif; }
.lg-scrim { position: absolute; inset: 0; background: rgba(0,0,0,.4); }
.lp { position: absolute; width: 110px; border-radius: 4px; background: #1e1e1e; box-shadow: 0 3px 10px rgba(0,0,0,.55);
  opacity: 0; transform: translateY(6px) scale(.95); transition: opacity .3s cubic-bezier(.05,.7,.1,1), transform .3s cubic-bezier(.05,.7,.1,1); }
.lg.open .lp { opacity: 1; transform: none; }
.lp-h { height: 20px; display: flex; align-items: center; gap: 4px; padding: 0 7px 0 7px; cursor: grab; color: #e0e0e0; touch-action: none; }
.lp-h:active { cursor: grabbing; }
.lp-h svg { width: 9px; height: 9px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.1; stroke-linecap: round; stroke-linejoin: round; }
.lp-h b { flex: 1; font-size: 9.5px; font-weight: 700; }
.lp-h .chev { width: 7px; height: 4px; transition: transform .2s; stroke: #b4b4b4; }
.lp.shut .lp-h .chev { transform: rotate(180deg); }
.lp-rows { overflow: hidden; display: grid; grid-template-rows: 1fr; transition: grid-template-rows .2s cubic-bezier(.2,0,0,1); }
.lp.shut .lp-rows { grid-template-rows: 0fr; }
.lp-rows > div { min-height: 0; }
.lr { position: relative; display: flex; align-items: center; width: 100%; height: 20px; padding: 0 7px; border: 0; background: transparent;
  color: #b4b4b4; font: 400 9px/1 inherit; font-family: inherit; font-size: 9px; text-align: left; cursor: pointer; transition: background .15s, color .15s; }
.lr:hover { background: rgba(255,255,255,.05); color: #e0e0e0; }
.lr.on { background: #e6e6e6; color: #232323; }
.lr:last-child { border-radius: 0 0 4px 4px; }
.lr span { flex: 1; }
.lr .bd { margin-right: 6px; padding: 0 3px; height: 10px; line-height: 10px; border-radius: 2.5px; background: rgba(255,255,255,.08); font-size: 7px; opacity: .8; }
.lr.on .bd { background: rgba(0,0,0,.1); }
.lr .dots { width: 2px; height: 8px; background: radial-gradient(circle, currentColor .9px, transparent 1.1px) 0 0 / 2px 2.8px repeat-y; }

.hud { position: relative; width: 800px; height: 450px; font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", sans-serif; color: #fff; overflow: hidden; }
.hud-el { position: absolute; touch-action: none; cursor: grab; transition: opacity .25s, transform .25s; }
.hud-el:active { cursor: grabbing; }
.hud-el.hide { opacity: 0; pointer-events: none; }
.hud-el.drag { outline: 1px dashed rgba(255,255,255,.6); outline-offset: 3px; }

.mc-crosshair { position: absolute; left: 50%; top: 50%; width: 15px; height: 15px; transform: translate(-50%, -50%);
  pointer-events: none; z-index: 2; mix-blend-mode: difference; }
.mc-crosshair svg { width: 100%; height: 100%; display: block; }

.mc-gui { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); width: 256px; pointer-events: none; z-index: 2; }
.mc-stats { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 2px; padding: 0 4px; }
.mc-left-stats { display: flex; flex-direction: column; gap: 2px; }
.mc-hearts, .mc-armor { display: flex; gap: 1px; }
.mc-food { display: flex; gap: 1px; flex-direction: row-reverse; }
.mc-xp { position: relative; width: 256px; height: 7px; margin-bottom: 3px; }
.mc-xp-bar { width: 100%; height: 5px; background: rgba(0,0,0,0.6); border: 1px solid rgba(0,0,0,0.8); border-radius: 1px; overflow: hidden; }
.mc-xp-fill { width: 72%; height: 100%; background: linear-gradient(90deg, #55ff55, #aaffaa); }
.mc-xp-lvl { position: absolute; left: 50%; top: -8px; transform: translateX(-50%); font: 700 11px/1 Inter, sans-serif;
  color: #7deb34; text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000; }

.mc-hotbar { position: relative; width: 256px; height: 32px; background: rgba(20,20,20,0.65); border: 2px solid rgba(255,255,255,0.25);
  border-radius: 4px; display: grid; grid-template-columns: repeat(9, 1fr); padding: 2px; box-shadow: 0 4px 12px rgba(0,0,0,0.5); backdrop-filter: blur(4px); }
.mc-slot { position: relative; display: flex; align-items: center; justify-content: center; }
.mc-slot.sel { box-shadow: inset 0 0 0 2px #fff, 0 0 6px rgba(255,255,255,0.5); border-radius: 2px; }
.mc-slot svg { width: 18px; height: 18px; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.4)); }
.mc-slot .cnt { position: absolute; right: 2px; bottom: 1px; font: 700 8.5px/1 Inter, sans-serif;
  color: #fff; text-shadow: 1px 1px 0 #000, -1px -1px 0 #000; }

.h-stack { position: absolute; right: 0px; top: 8px; width: 200px; pointer-events: auto; }
.stack-svg { position: absolute; right: 0; top: 0; overflow: visible; pointer-events: none; }
.stack-bg { fill: rgba(14, 18, 24, 0.58); stroke: rgba(255, 255, 255, 0.16); stroke-width: 1px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.45)); backdrop-filter: blur(12px) saturate(1.2); }
.stack-line { stroke: #ffffff; stroke-width: 1.5px; filter: drop-shadow(0 0 4px rgba(255,255,255,0.6)); }
.stack-rows { position: relative; width: 100%; display: flex; flex-direction: column; align-items: flex-end; }
.stack-row { position: relative; display: flex; align-items: center; justify-content: flex-end; padding: 0 9px 0 6px;
  white-space: nowrap; font-family: Inter, system-ui, sans-serif; font-size: 9.5px; font-weight: 700; color: #fff;
  text-shadow: 0 0 6px rgba(255,255,255,0.4); box-sizing: border-box; }
.stack-row i { font-style: normal; font-size: 8.5px; font-weight: 500; color: rgba(255,255,255,0.45); margin-left: 5px; }

.h-logo { height: 24px; border-radius: 7px; padding: 0 9px; display: flex; align-items: center; gap: 6px;
  background: rgba(14, 18, 24, 0.62); backdrop-filter: blur(12px) saturate(1.2); border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 4px 14px rgba(0,0,0,0.35); font: 700 9.5px/1 Inter, sans-serif; white-space: nowrap; }
.h-logo .logo-mark { width: 12px; height: 12px; background: #3c6eff; border-radius: 3px; display: inline-block; }
.h-logo small { font-weight: 500; color: rgba(255,255,255,0.7); }
.h-logo .sep { color: rgba(255,255,255,0.25); margin: 0 2px; }
.h-logo .fps { color: rgba(255,255,255,0.5); font-weight: 500; font-size: 8.5px; }

.h-target { width: 154px; height: 50px; border-radius: 8px; background: rgba(14, 18, 24, 0.65);
  backdrop-filter: blur(12px) saturate(1.2); border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4); cursor: pointer; user-select: none; }
.h-target:active { transform: scale(0.98); }
.h-target .face { position: absolute; left: 7px; top: 7px; width: 36px; height: 36px; border-radius: 4px;
  image-rendering: pixelated; box-shadow: 0 2px 6px rgba(0,0,0,0.35); transition: transform 0.15s, filter 0.15s; }
.h-target.hit .face { filter: sepia(1) saturate(8) hue-rotate(-50deg) brightness(0.9); transform: scale(0.85); }
.h-target .tn { position: absolute; left: 50px; top: 7px; font: 700 10.5px/1 Inter, sans-serif; color: #fff; }
.h-target .tv { position: absolute; left: 50px; top: 21px; display: flex; gap: 8px; font: 500 7px/1 Inter, sans-serif; }
.h-target .tv .hp-val { color: #4cd964; font-weight: 700; }
.h-target .tv .dp-val { color: #00c8ff; font-weight: 700; }
.h-target .tv .dist-val { color: rgba(255,255,255,0.5); }
.h-target .bar { position: absolute; left: 50px; width: 72px; border-radius: 2px; background: rgba(0,0,0,0.4); overflow: hidden; }
.h-target .dp-bar { top: 33px; height: 3px; }
.h-target .dp-bar i { display: block; height: 100%; width: 100%; background: #00c8ff; border-radius: 2px; }
.h-target .hp-bar { top: 39px; height: 4px; }
.h-target .hp-bar .lag { position: absolute; left: 0; top: 0; height: 100%; background: #ff6b6b; border-radius: 2px; transition: width 0.45s ease 0.2s; }
.h-target .hp-bar .cur { position: absolute; left: 0; top: 0; height: 100%; background: linear-gradient(90deg, #2ecc71, #f1c40f); border-radius: 2px; transition: width 0.2s; }
.h-target .slot-item { position: absolute; right: 7px; width: 18px; height: 18px; border-radius: 4px;
  background: rgba(0,0,0,0.35); border: 1px solid rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: center; }
.h-target .slot-item.main { top: 6px; }
.h-target .slot-item.off { top: 26px; }
.h-target .slot-item svg { width: 14px; height: 14px; }

.h-count { height: 22px; border-radius: 7px; padding: 0 9px; font: 700 9px/1 Inter, sans-serif;
  display: flex; align-items: center; gap: 6px; background: rgba(14, 18, 24, 0.65);
  backdrop-filter: blur(12px) saturate(1.2); border: 1px solid rgba(255,255,255,0.18); box-shadow: 0 4px 14px rgba(0,0,0,0.35); }
.h-count svg { width: 13px; height: 13px; }
.h-count span { color: rgba(255,255,255,0.6); font-weight: 500; font-size: 8px; margin-left: 2px; }

.h-armor { display: flex; gap: 3px; padding: 3px; border-radius: 7px; background: rgba(14, 18, 24, 0.65);
  backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,0.18); box-shadow: 0 4px 14px rgba(0,0,0,0.35); }
.h-armor-slot { position: relative; width: 18px; height: 18px; border-radius: 4px; background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: center; }
.h-armor-slot svg { width: 14px; height: 14px; }
.h-armor-slot .dur { position: absolute; left: 1px; bottom: 1px; right: 1px; height: 1.5px; background: #2ecc71; border-radius: 1px; }

.h-notes { position: absolute; right: 10px; bottom: 44px; width: 146px; display: flex; flex-direction: column-reverse; gap: 6px; pointer-events: none; }
.nt { position: relative; height: 26px; border-radius: 6px; background: rgba(14, 18, 24, 0.88);
  backdrop-filter: blur(12px) saturate(1.2); border: 1px solid rgba(255,255,255,0.14); box-shadow: 0 4px 14px rgba(0,0,0,0.45);
  padding: 0 8px; display: flex; align-items: center; gap: 6px; overflow: hidden;
  transition: transform .35s cubic-bezier(.16,1,.3,1), opacity .3s; animation: slideIn .3s cubic-bezier(.16,1,.3,1); }
@keyframes slideIn { from { transform: translateX(120%); opacity: 0; } }
.nt.out { transform: translateX(120%); opacity: 0; }
.nt .badge { width: 13px; height: 13px; border-radius: 50%; display: grid; place-items: center; font-size: 8px; font-weight: 700; color: #fff; flex: none; }
.nt.on .badge { background: #2ea872; }
.nt.off .badge { background: #e74c3c; }
.nt b { font-size: 8.5px; font-weight: 700; color: #fff; white-space: nowrap; }
.nt small { font-size: 7.5px; font-weight: 500; margin-left: auto; }
.nt.on small { color: #2ea872; }
.nt.off small { color: #e74c3c; }
.nt .pb { position: absolute; left: 0; bottom: 0; height: 1.5px; width: 100%; transform-origin: left; animation: life 3.5s linear forwards; }
.nt.on .pb { background: #2ea872; }
.nt.off .pb { background: #e74c3c; }
@keyframes life { to { transform: scaleX(0); } }

@media (prefers-reduced-motion: reduce) {
  .pg, .lp, .nt, .pg-grid, .pg-ind { transition: none !important; animation: none !important; }
}
