/* ================= site-wide hacked-client HUD (hud.js) ================= */
@property --hue { syntax: '<number>'; inherits: true; initial-value: 0; }
@keyframes hue { to { --hue: 360; } }

/* ---------- arraylist + watermark ---------- */
.al {
  position: fixed; top: 68px; right: 0; z-index: 26; pointer-events: none;
  display: flex; flex-direction: column; align-items: flex-end;
  font: 9px/1 var(--pixel); animation: hue 6s linear infinite; transition: opacity .3s, translate .3s;
}
.cpage .al { top: 118px; }
html.al-tuck .al { opacity: 0; translate: 30px 0; }
.al-wm, .al-rows > div { background: rgba(0, 0, 0, .5); text-shadow: 1px 1px 0 #000; white-space: nowrap; border-right: 2px solid currentColor; }
.al-wm { padding: 5px 8px 4px; margin-bottom: 2px; color: #e6ebe7; }
.al-wm b { font-weight: normal; color: hsl(var(--hue) 85% 68%); }
.al-wm span { color: #9ca3af; }
.al-rows > div { color: hsl(calc(var(--hue) + var(--i) * 24) 85% 68%); padding: 4px 8px 3px; }
.al-rows > div span { color: #9ca3af; }
.al-rows > div.new { animation: al-in .35s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes al-in { from { translate: 100% 0; opacity: 0; } }
html.al-static .al-rows > div, html.al-static .al-wm b { color: var(--accent); }
@media (max-width: 760px) { .al { display: none; } }

/* ---------- notifications ---------- */
.notes { position: fixed; right: 16px; bottom: 16px; z-index: 45; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.note {
  position: relative; overflow: hidden; width: 220px; padding: 10px 12px 12px;
  background: rgba(9, 12, 11, .94); border: 1px solid var(--line); border-left: 3px solid var(--nc); border-radius: 8px;
  box-shadow: 0 16px 34px -12px rgba(0, 0, 0, .85); animation: note-in .35s cubic-bezier(.2, .9, .3, 1.15);
}
.note b { display: block; margin-bottom: 5px; font: 9px/1.3 var(--pixel); color: #fff; }
.note span { font-size: 13px; color: var(--muted); }
.note em { font-style: normal; font-weight: 700; }
.note .n-on { color: #55ff55; }
.note .n-off { color: #ff5555; }
.note i { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--nc); transform-origin: left; animation: note-t var(--ms) linear forwards; }
.note.out { animation: note-out .3s ease-in forwards; }
@keyframes note-in { from { translate: 110% 0; } }
@keyframes note-out { to { translate: 110% 0; opacity: 0; } }
@keyframes note-t { to { transform: scaleX(0); } }
@media (max-width: 900px) { .notes { bottom: auto; top: 72px; } .cpage .notes { top: 116px; } }

/* ---------- chat ---------- */
.chat { position: fixed; left: 12px; bottom: 12px; z-index: 46; width: min(580px, calc(100vw - 24px)); font: 20px/1.15 'VT323', ui-monospace, monospace; pointer-events: none; }
.chat-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; max-height: 42vh; overflow: hidden; }
.chat-log li { padding: 1px 8px; background: rgba(0, 0, 0, .5); color: #fff; text-shadow: 2px 2px 0 rgba(0, 0, 0, .55); overflow-wrap: anywhere; transition: opacity 1.2s; }
.chat-log li:first-child { padding-top: 4px; }
.chat-log li:last-child { padding-bottom: 4px; }
.chat:not(.open) .chat-log li.old { opacity: 0; }
.chat:not(.open) .chat-log li:nth-last-child(n+9) { display: none; }
.chat.open { pointer-events: auto; }
.chat.open .chat-log { overflow-y: auto; scrollbar-width: thin; }
.chat-bar { margin-top: 4px; background: rgba(0, 0, 0, .62); border: 1px solid rgba(255, 255, 255, .12); }
.chat-bar input {
  display: block; width: 100%; padding: 6px 9px; border: 0; border-radius: 0; background: transparent; color: #fff;
  font: inherit; outline: none; caret-color: #fff; text-shadow: 2px 2px 0 rgba(0, 0, 0, .55);
}
.chat-bar input:focus { outline: none; }
.chat-sug { position: absolute; left: 0; bottom: 100%; margin: 0 0 2px; padding: 3px 0; list-style: none; min-width: 220px; max-width: 100%; background: rgba(0, 0, 0, .86); }
.chat .chat-sug:not([hidden]) + .chat-bar { margin-top: 4px; }
.chat-sug li { padding: 1px 9px; color: #aaa; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-sug li.on { color: #ff5; }
.chat-sug i { font-style: normal; color: #777; }
.chat:has(.chat-sug:not([hidden])) .chat-log { visibility: hidden; }
@media (max-width: 900px) { .cpage .chat { bottom: 92px; } }

/* ---------- effects canvas + chunk borders ---------- */
.hud-fx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 24; pointer-events: none; }
.hud-chunks {
  position: fixed; inset: 0; z-index: 23; pointer-events: none;
  background-image:
    linear-gradient(rgba(250, 204, 21, .55) 1px, transparent 1px), linear-gradient(90deg, rgba(250, 204, 21, .55) 1px, transparent 1px),
    linear-gradient(rgba(96, 165, 250, .16) 1px, transparent 1px), linear-gradient(90deg, rgba(96, 165, 250, .16) 1px, transparent 1px);
  background-size: 128px 128px, 128px 128px, 32px 32px, 32px 32px;
  background-position: 0 var(--cy, 0), 0 var(--cy, 0), 0 var(--cy, 0), 0 var(--cy, 0);
}

/* ---------- X-Ray: panels go see-through, download buttons glow like ores ---------- */
html.xray body { background-image: linear-gradient(rgba(34, 211, 238, .08) 1px, transparent 1px), linear-gradient(90deg, rgba(34, 211, 238, .08) 1px, transparent 1px); }
html.xray :is(.ccard, .how-step, .card, .rcard, .feat, .side-card, .mc, .cta-band, .stats-strip, .pill, .tl-card, .side-facts, .side-facts div, .side-verify, .path-chip, .path, .chip, .btn:not(.btn-primary), .ccard-icon, .c-tile, .how-icon, .rcard-av, .inst-check, header.site, .c-tabs, .ticker, .dock, .lf-line, .c-facts span, kbd, .tag) {
  background: transparent !important; border-color: rgba(34, 211, 238, .55) !important; border-style: dashed !important;
  box-shadow: none !important; backdrop-filter: none !important;
}
html.xray :is(img, video, #gl) { opacity: .22; }
html.xray :is([data-dl], .btn-primary) {
  background: #67e8f9 !important; border-color: #a5f3fc !important; color: #083344 !important;
  box-shadow: 0 0 0 2px #22d3ee, 0 0 28px 6px rgba(34, 211, 238, .75) !important;
}
html.xray :is(.ccard::before, .ccard-glare) { display: none; }

/* ---------- Nuker ---------- */
html.nuker body, html.nuker body :not(a, button, input, textarea, select, label, summary, a *, button *) { cursor: var(--pickaxe), crosshair; }
.nk-crack {
  position: fixed; z-index: 25; pointer-events: none; image-rendering: pixelated; background-size: 32px 32px;
  clip-path: circle(0 at var(--ox) var(--oy)); animation: nk-mine var(--ms) steps(9, end) forwards;
}
@keyframes nk-mine { to { clip-path: circle(150% at var(--ox) var(--oy)); } }

/* ---------- nav button ---------- */
.nav-gui {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; font-size: 13px;
  background: rgba(192, 132, 252, .1); border-color: rgba(192, 132, 252, .45); color: #e9d5ff;
}
.nav-gui:hover { border-color: #c084fc; background: rgba(192, 132, 252, .18); }
.nav-gui kbd { font: 8px var(--pixel); padding: 3px 5px 2px; border-radius: 4px; border: 1px solid rgba(192, 132, 252, .45); border-bottom-width: 2px; background: rgba(0, 0, 0, .35); color: #d8b4fe; }
@media (max-width: 900px) { .nav-gui kbd { display: none; } }

/* ---------- ClickGUI ---------- */
html.cgui-open { overflow: hidden; }
.cgui {
  position: fixed; inset: 0; z-index: 80; background: rgba(3, 5, 4, .6); backdrop-filter: blur(4px);
  animation: cg-fade .2s ease-out;
}
.cgui::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(192, 132, 252, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(192, 132, 252, .07) 1px, transparent 1px);
  background-size: 32px 32px;
}
@keyframes cg-fade { from { opacity: 0; } }
.cgui-top { position: absolute; top: 22px; left: 50%; translate: -50% 0; display: flex; flex-direction: column; align-items: center; gap: 12px; width: min(560px, calc(100% - 32px)); text-align: center; }
.cgui-title { font: 14px var(--pixel); color: #fff; text-shadow: 2px 2px 0 #000; }
.cgui-title b { font-weight: normal; color: #c084fc; }
.cgui-title span { display: block; margin-top: 8px; font: 18px 'VT323', monospace; color: #9ca3af; text-shadow: none; }
.cgui-search { width: 300px; max-width: 100%; text-align: center; background: rgba(9, 12, 11, .9); border-color: #2a312d; border-radius: 99px; padding: 9px 16px; }
.cgui-search:focus { outline: 2px solid rgba(192, 132, 252, .5); border-color: #c084fc; }
.cgui-x { position: absolute; top: 16px; right: 16px; width: 40px; height: 40px; justify-content: center; padding: 0; font-size: 24px; border-radius: 50%; background: rgba(255, 255, 255, .06); }
.cg-panel {
  position: absolute; width: 214px; overflow: hidden; border-radius: 10px;
  background: rgba(10, 13, 12, .95); border: 1px solid #262d29;
  box-shadow: 0 30px 60px -24px rgba(0, 0, 0, .95), 0 0 0 1px rgba(0, 0, 0, .4), 0 0 40px -18px var(--cc);
  animation: cg-drop .42s cubic-bezier(.2, .9, .3, 1.2) both; animation-delay: calc(var(--k) * 55ms);
}
.cg-panel.drag { box-shadow: 0 40px 80px -24px rgba(0, 0, 0, .95), 0 0 0 1px var(--cc), 0 0 50px -12px var(--cc); z-index: 2; }
.cg-panel.empty { opacity: .35; }
@keyframes cg-drop { from { opacity: 0; translate: 0 -24px; } }
.cg-head {
  display: flex; align-items: center; gap: 9px; padding: 11px 12px 10px; font: 10px var(--pixel); color: #fff; text-shadow: 1px 1px 0 #000;
  background: linear-gradient(90deg, color-mix(in srgb, var(--cc) 34%, #0b0e0d), #0b0e0d 85%);
  border-bottom: 2px solid var(--cc); cursor: grab; user-select: none; touch-action: none;
}
.cg-panel.drag .cg-head { cursor: grabbing; }
.cg-ico { width: 16px; height: 16px; flex: none; }
.cg-ico svg { width: 100%; height: 100%; display: block; }
.cg-n { margin-left: auto; color: rgba(255, 255, 255, .45); font-size: 8px; }
.cg-list { padding: 4px 0; max-height: calc(100vh - 230px); overflow-y: auto; scrollbar-width: thin; }
.cg-mod { display: grid; grid-template-columns: 1fr 30px; }
.cg-mod[hidden] { display: none; }
.cg-row, .cg-more, .cg-mode, .cg-bind {
  border: 0; border-radius: 0; background: transparent; padding: 0; font: inherit; color: inherit; white-space: nowrap;
}
.cg-row { justify-content: space-between; gap: 8px; padding: 8px 4px 8px 13px; font-size: 13px; font-weight: 600; color: #a3aea7; text-align: left; transition: color .15s, background .15s, box-shadow .15s; }
.cg-row:hover { color: #fff; background: rgba(255, 255, 255, .04); }
.cg-mod.on .cg-row { color: #fff; background: linear-gradient(90deg, color-mix(in srgb, var(--cc) 30%, transparent), transparent 90%); box-shadow: inset 3px 0 0 var(--cc); }
.cg-key { font: 7px var(--pixel); color: #6b7570; }
.cg-mod.on .cg-key { color: color-mix(in srgb, var(--cc) 70%, #fff); }
.cg-more { justify-content: center; gap: 2px; flex-direction: column; color: #6b7570; }
.cg-more i { display: block; width: 3px; height: 3px; background: currentColor; }
.cg-more:hover, .cg-more[aria-expanded="true"] { color: #fff; }
.cg-set { grid-column: 1 / -1; display: grid; gap: 7px; padding: 8px 12px 11px 16px; background: rgba(0, 0, 0, .38); border-block: 1px solid #1d2320; font-size: 12px; color: #9ca3af; }
.cg-set[hidden] { display: none; }
.cg-s { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 12px; color: #9ca3af; }
.cg-s > span { flex: 1; }
.cg-mode, .cg-bind { padding: 3px 8px; font: 8px var(--pixel); color: color-mix(in srgb, var(--cc) 75%, #fff); background: rgba(255, 255, 255, .05); border: 1px solid #2a312d; border-radius: 4px; }
.cg-mode:hover, .cg-bind:hover { border-color: var(--cc); }
.cg-s input[type=range] { width: 84px; padding: 0; border: 0; background: none; accent-color: var(--cc); }
.cg-s b { min-width: 26px; text-align: right; font: 8px var(--pixel); color: #fff; }
.cgui-desc {
  position: absolute; left: 50%; bottom: 20px; translate: -50% 0; width: max-content; max-width: calc(100% - 32px);
  padding: 7px 14px; border-radius: 6px; background: rgba(0, 0, 0, .7); font: 19px 'VT323', monospace; color: #d1d5db; text-align: center;
}
.cgui-desc b { font-weight: normal; color: #c084fc; }
@media (max-width: 759px) {
  .cgui { overflow-y: auto; }
  .cgui-top { position: relative; top: auto; left: auto; translate: none; margin: 22px auto 0; padding-right: 44px; }
  .cgui-panels { display: grid; gap: 12px; padding: 18px 16px 90px; }
  .cg-panel { position: static; width: auto; }
  .cg-head { cursor: default; }
  .cg-list { max-height: none; }
  .cg-row { padding-block: 11px; }
  .cgui-desc { position: fixed; }
}

/* ---------- boot sequence ---------- */
html.booting body { overflow: hidden; }
/* covers the page from the first paint until hud.js takes over, and gives up on its own after 3.5s */
html.booting body::before { content: ''; position: fixed; inset: 0; z-index: 99; background: #050706; animation: boot-failsafe .3s 3.5s forwards; }
@keyframes boot-failsafe { to { opacity: 0; visibility: hidden; } }
.boot { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; font: 21px/1.3 'VT323', ui-monospace, monospace; color: #b6f5c8; cursor: pointer; }
.boot-half { position: absolute; left: 0; right: 0; height: 50.5%; background: #050706; transition: translate .7s cubic-bezier(.75, 0, .2, 1); }
.boot-half.top { top: 0; border-bottom: 1px solid rgba(74, 222, 128, 0); }
.boot-half.bot { bottom: 0; }
.boot-half::after { content: ''; position: absolute; left: 0; right: 0; height: 2px; background: var(--accent); box-shadow: 0 0 24px 4px rgba(74, 222, 128, .7); opacity: 0; transition: opacity .2s; }
.boot-half.top::after { bottom: 0; }
.boot-half.bot::after { top: 0; }
.boot.out { pointer-events: none; }
.boot.out .boot-half::after { opacity: 1; }
.boot.out .boot-half.top { translate: 0 -100%; }
.boot.out .boot-half.bot { translate: 0 100%; }
.boot-term { position: relative; width: min(600px, calc(100% - 32px)); transition: opacity .2s, scale .3s; }
.boot.out .boot-term { opacity: 0; scale: .96; }
.boot-head { margin-bottom: 14px; font: 13px var(--pixel); color: #fff; text-shadow: 0 0 18px rgba(74, 222, 128, .6); }
.boot-head b { font-weight: normal; color: var(--accent); }
.boot-head span { color: #64748b; font-size: 9px; margin-left: 6px; }
.boot-lines { list-style: none; margin: 0; padding: 0; min-height: 9.4em; }
.boot-lines li { display: flex; gap: 12px; opacity: 0; }
.boot-lines li.on { opacity: 1; animation: boot-line .18s steps(3); }
.boot-lines li span { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.boot-lines em { font-style: normal; color: var(--accent); }
.boot-lines em::before { content: '['; color: #475569; } .boot-lines em::after { content: ']'; color: #475569; }
.boot-lines .boot-done { margin-top: 6px; color: #fde047; }
@keyframes boot-line { from { opacity: 0; translate: -6px 0; } }
.boot-bar { height: 4px; margin-top: 16px; background: #0f1a14; overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), #86efac); box-shadow: 0 0 14px var(--accent); transition: width 1.05s cubic-bezier(.3, .1, .3, 1); }
.boot.go .boot-bar i { width: 100%; }
.boot-skip { margin-top: 12px; font-size: 16px; color: #475569; }

@media (prefers-reduced-motion: reduce) {
  .al, .al-rows > div.new, .note, .note.out, .cgui, .cg-panel, .boot-lines li.on { animation: none; }
  .note i { animation-duration: 0s; }
}
@media (pointer: coarse) { .cg-key { display: none; } }
