/* HP Bar Builder: the stage fills the window under the site's top bar; everything else floats over it. The floating
   parts are dark glass whatever the site's theme, because they sit on the game's room. */
[hidden] { display: none !important; }
body.hb { margin: 0; overflow: hidden; background: #0b0d10; overscroll-behavior: none; }
.hb-app { position: fixed; inset: var(--hb-top, 61px) 0 0 0; overflow: hidden; background: #0b0d10; color: #eef0f3;
  font: 14px/1.4 var(--body); --glass: rgb(13 15 19 / .74); --edge: rgb(255 255 255 / .1); --dim: #a8b0bd; --acc: #e3b04b; --acc-ink: #15120a;
  user-select: none; -webkit-user-select: none; }
.hb-stage, .hb-stage > * { position: absolute; inset: 0; width: 100%; height: 100%; }
.hv-canvas { display: block; touch-action: none; cursor: grab; outline: none; }
.hv-canvas.hv-drag { cursor: grabbing; }
.hv-poster { object-fit: cover; transition: opacity .5s ease; pointer-events: none; }
.hv-bar2d { inset: auto; pointer-events: none; }

.hb-title { position: absolute; left: clamp(14px, 2.4vw, 30px); top: clamp(12px, 2vw, 22px); pointer-events: none; text-shadow: 0 1px 12px rgb(0 0 0 / .6); }
.hb-title h1 { margin: 0; font: 800 clamp(22px, 2.3vw, 30px)/1 var(--display); letter-spacing: .03em; text-transform: uppercase; color: #fff; }

.hb-actions { position: absolute; right: clamp(14px, 2.4vw, 30px); top: clamp(12px, 2vw, 22px); display: flex; gap: 10px; align-items: center; }
.hb-app button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.hb-app button:focus-visible, .hb-app input:focus-visible, .hb-app summary:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.hb-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--glass); border: 1px solid var(--edge); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); }
.hb-seg button { border: 0; background: none; padding: 6px 13px; border-radius: 999px; font-weight: 600; font-size: 13px; color: var(--dim); }
.hb-seg button:hover { color: #fff; }
.hb-seg button[aria-pressed="true"] { background: rgb(255 255 255 / .14); color: #fff; }
.hb-primary { border: 0; border-radius: 999px; padding: 9px 18px; background: var(--acc); color: var(--acc-ink) !important; font-weight: 700 !important; font-size: 13.5px; box-shadow: 0 6px 22px -8px rgb(227 176 75 / .7); }
.hb-primary:hover { filter: brightness(1.08); }
.hb-quiet { border: 1px solid var(--edge); border-radius: 999px; padding: 8px 14px; background: rgb(255 255 255 / .06); font-weight: 600; font-size: 13px; }
.hb-quiet:hover { background: rgb(255 255 255 / .12); }

/* what is under the pointer, and what is being edited */
.hb-hot, .hb-sel { position: absolute; left: 0; top: 0; pointer-events: none; border-radius: 5px; will-change: transform, width, height; }
.hb-hot { box-shadow: 0 0 0 1.5px rgb(255 255 255 / .95), 0 0 0 3px rgb(0 0 0 / .35); }
.hb-hot.off { box-shadow: none; outline: 1.5px dashed rgb(255 255 255 / .8); }
.hb-hot span { position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); white-space: nowrap; padding: 3px 9px; border-radius: 999px;
  background: #fff; color: #111; font-size: 12px; font-weight: 600; }
.hb-sel { box-shadow: 0 0 0 2px var(--acc), 0 0 0 4px rgb(0 0 0 / .35); }
.hb-handle { position: absolute; left: 0; top: 0; width: 14px; height: 14px; margin: -7px 0 0 -7px; padding: 0; border-radius: 50%; border: 2px solid #111; background: var(--acc);
  box-shadow: 0 1px 6px rgb(0 0 0 / .5); touch-action: none; }
.hb-handle-w { cursor: ew-resize; } .hb-handle-h { cursor: ns-resize; }
/* a part being dragged: its place before, and a line of the bar it lines up with */
.hb-ghost, .hb-guide { position: absolute; left: 0; top: 0; pointer-events: none; }
.hb-ghost { border-radius: 5px; outline: 1.5px dashed rgb(255 255 255 / .55); }
.hb-guide { background: #ff4fd8; box-shadow: 0 0 0 .5px rgb(0 0 0 / .4); }
.hb-guide-x { width: 1px; margin-left: -.5px; } .hb-guide-y { height: 1px; margin-top: -.5px; }
.hb-handle::after { content: ""; position: absolute; inset: -12px; }
/* the first visit: the stage dims around the bar, a ring pulses on it and a caption says what to do; in the close-up
   every part pulses in turn. None of it takes clicks: they go to the stage. */
.hb-spot { position: absolute; inset: 0; pointer-events: none; opacity: 1; transition: opacity .5s ease;
  background: radial-gradient(circle at var(--x, 50%) var(--y, 30%), transparent var(--r, 120px), rgb(4 5 8 / .62) calc(var(--r, 120px) + 110px)); }
.hb-spot.off { opacity: 0; }
.hb-ring { position: absolute; left: 0; top: 0; pointer-events: none; border-radius: 10px; box-shadow: 0 0 0 2px #fff; animation: hb-ring 1.7s ease-out infinite; }
@keyframes hb-ring { 0% { box-shadow: 0 0 0 2px #fff, 0 0 0 2px rgb(227 176 75 / .9); } 80%, 100% { box-shadow: 0 0 0 2px #fff, 0 0 0 22px rgb(227 176 75 / 0); } }
.hb-zone { position: absolute; left: 0; top: 0; pointer-events: none; border-radius: 5px; outline: 1.5px dashed rgb(255 255 255 / .9);
  animation: hb-zone 2.6s ease-in-out infinite; animation-delay: calc(var(--i) * .32s); }
@keyframes hb-zone { 0%, 30%, 100% { background: rgb(255 255 255 / 0); outline-color: rgb(255 255 255 / .55); } 12% { background: rgb(255 255 255 / .28); outline-color: #fff; } }
.hb-coach { position: absolute; left: 0; top: 0; margin: 0; display: grid; justify-items: center; gap: 1px; padding: 9px 18px 11px; border-radius: 14px; background: #fff; color: #111;
  pointer-events: none; white-space: nowrap; box-shadow: 0 14px 40px -10px rgb(0 0 0 / .8); animation: hb-bob 1.8s ease-in-out infinite; }
.hb-coach strong { font: 800 22px/1.05 var(--display); letter-spacing: .04em; text-transform: uppercase; }
.hb-coach span { font-size: 13px; color: #4a4f58; }
.hb-coach::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 12px; height: 12px; margin-left: -6px; background: #fff; transform: rotate(45deg); }
@keyframes hb-bob { 50% { margin-top: -6px; } }
.hb-skip { position: absolute; left: 50%; top: clamp(12px, 2vw, 22px); transform: translateX(-50%); border: 1px solid var(--edge); border-radius: 999px; padding: 6px 14px;
  background: var(--glass); color: var(--dim); font-size: 12.5px; font-weight: 600; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.hb-skip:hover { color: #fff; }
@media (prefers-reduced-motion: reduce) { .hb-coach, .hb-ring, .hb-zone { animation: none; } }

/* pop-ups: one part's settings, and the download */
.hb-pop { position: absolute; left: 0; top: 0; width: min(300px, calc(100vw - 24px)); max-height: calc(100% - 150px); display: flex; flex-direction: column; border-radius: 16px;
  background: var(--glass); border: 1px solid var(--edge); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: 0 24px 60px -20px rgb(0 0 0 / .8); user-select: none; }
.hb-pop header { display: flex; align-items: center; justify-content: space-between; padding: 12px 10px 4px 16px; }
.hb-app h2::before { content: none; }
.hb-pop h2 { margin: 0; display: block; font: 800 19px/1 var(--display); letter-spacing: .05em; text-transform: uppercase; }
.hb-x { border: 0; background: none; width: 30px; height: 30px; border-radius: 50%; font-size: 20px; line-height: 1; color: var(--dim); }
.hb-x:hover { background: rgb(255 255 255 / .1); color: #fff; }
.hb-rows { display: grid; gap: 13px; padding: 8px 16px 16px; overflow-y: auto; overscroll-behavior: contain; }
.hb-get { left: auto; right: clamp(14px, 2.4vw, 30px); top: clamp(60px, 2vw + 48px, 74px); width: min(330px, calc(100vw - 24px)); }
/* one size whatever menu is open, so it never jumps: the menu's content scrolls inside it */
.hb-inspector { width: min(456px, calc(100vw - 24px)); height: min(452px, calc(100% - 100px)); max-height: none; flex-direction: row; }
.hb-inspector.sheet { left: 12px !important; right: 12px; top: auto !important; bottom: 14px; width: auto; height: 52%; transform: none !important; flex-direction: column; }
.hb-inspector.sheet .hb-nav { flex-direction: row; width: auto; border-right: 0; border-bottom: 1px solid var(--edge); overflow-x: auto; scrollbar-width: none; }

.hb-note { margin: 0; padding: 8px 10px; border-radius: 9px; background: rgb(255 255 255 / .07); font-size: 12.5px; line-height: 1.4; color: #cfd4dc; }
.hb-row { display: grid; gap: 6px; min-width: 0; }
.hb-row > .hb-label { display: flex; justify-content: space-between; align-items: baseline; font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--dim); font-weight: 600; }
.hb-move { gap: 4px; }
.hb-reset { border: 0; background: none; padding: 0; font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; font-weight: 600; color: var(--acc); }
.hb-reset:hover { color: #fff; }
.hb-axis { display: grid; grid-template-columns: 16px 1fr 104px; align-items: center; gap: 8px; }
.hb-axis span { color: var(--dim); font-size: 14px; text-align: center; }
.hb-axis output { text-align: right; }
.hb-row output { font-family: var(--mono); font-size: 12px; letter-spacing: 0; text-transform: none; color: #fff; font-variant-numeric: tabular-nums; }
.hb-app input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; margin: 0; background: none; cursor: pointer; --p: 50%; }
.hb-app input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--acc) var(--p), rgb(255 255 255 / .18) var(--p)); }
.hb-app input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: rgb(255 255 255 / .18); }
.hb-app input[type=range]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--acc); }
.hb-app input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 1px 5px rgb(0 0 0 / .6); }
.hb-app input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 1px 5px rgb(0 0 0 / .6); }
.hb-opts { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; padding: 3px; border-radius: 10px; background: rgb(255 255 255 / .07); }
.hb-opts button { border: 0; background: none; padding: 6px 4px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--dim); white-space: nowrap; }
.hb-opts button:hover { color: #fff; }
.hb-opts button[aria-pressed="true"] { background: rgb(255 255 255 / .16); color: #fff; }
.hb-swatches { display: flex; flex-wrap: wrap; gap: 5px; }
.hb-swatches button, .hb-swatches label { width: 20px; height: 20px; flex: none; padding: 0; border-radius: 50%; border: 1px solid rgb(255 255 255 / .28); background: var(--c); position: relative; cursor: pointer; }
.hb-swatches [aria-pressed="true"]::after, .hb-swatches label.on::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid #fff; }
.hb-swatches label { background: conic-gradient(#f44, #fd3, #4d6, #3cf, #56f, #c5f, #f44); overflow: visible; }
.hb-swatches label.on { background: var(--c); }
.hb-swatches input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.hb-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13.5px; cursor: pointer; }
.hb-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.hb-toggle i { flex: none; width: 34px; height: 20px; border-radius: 999px; background: rgb(255 255 255 / .2); position: relative; transition: background .15s; }
.hb-toggle i::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.hb-toggle input:checked + i { background: var(--acc); }
.hb-toggle input:checked + i::after { transform: translateX(14px); }
.hb-toggle input:focus-visible + i { outline: 2px solid var(--acc); outline-offset: 2px; }

.hb-field { display: grid; gap: 6px; font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--dim); font-weight: 600; }
.hb-field input { font: 14px var(--mono); letter-spacing: 0; text-transform: none; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--edge); background: rgb(0 0 0 / .35); color: #fff; user-select: text; -webkit-user-select: text; }
.hb-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.hb-status { margin: 0; min-height: 1.4em; font-size: 13px; color: var(--dim); }
.hb-status.ok { color: #7fd69a; } .hb-status.bad { color: #ff9b91; }
.hb-steps { margin: 0; padding-left: 18px; display: grid; gap: 3px; font-size: 12.5px; color: var(--dim); }
.hb-steps code { font-size: 11.5px; color: #dfe3ea; background: none; padding: 0; border: 0; overflow-wrap: anywhere; }
.hb-rules summary { cursor: pointer; font-size: 12.5px; color: var(--dim); }
.hb-rules pre { margin: 8px 0 0; padding: 10px; border-radius: 9px; background: rgb(0 0 0 / .4); font: 11.5px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 180px; overflow: auto;
  user-select: text; -webkit-user-select: text; }

/* the panel's menu (the styles, then every part of the bar) and the styles' thumbnails */
.hb-nav { flex: none; width: 140px; display: flex; flex-direction: column; gap: 2px; padding: 10px 8px; border-right: 1px solid var(--edge); overflow-y: auto; }
.hb-chip { flex: none; border: 0; background: none; padding: 8px 10px; border-radius: 9px; font-weight: 600; font-size: 13.5px; color: var(--dim); white-space: nowrap; text-align: left; }
.hb-chip:hover { background: rgb(255 255 255 / .07); color: #fff; }
.hb-chip[aria-pressed="true"] { background: rgb(255 255 255 / .15); color: #fff; }
.hb-chip.off { text-decoration: line-through; text-decoration-color: rgb(255 255 255 / .35); }
.hb-body { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.hb-styles { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px 14px 14px; overflow-y: auto; overscroll-behavior: contain; }
.hb-style { display: grid; justify-items: center; gap: 3px; border: 0; background: rgb(255 255 255 / .05); padding: 7px 4px 8px; border-radius: 11px; color: var(--dim); }
.hb-style canvas { width: 104px; height: 42px; display: block; }
.hb-style span { font: 700 12px/1 var(--display); letter-spacing: .09em; text-transform: uppercase; }
.hb-style:hover { background: rgb(255 255 255 / .1); color: #fff; }
.hb-style[aria-pressed="true"] { background: rgb(255 255 255 / .17); color: #fff; box-shadow: 0 0 0 1.5px var(--acc) inset; }

@media (max-width: 720px) {
  .hb-seg button { padding: 6px 10px; }
  .hb-primary { padding: 9px 14px; }
}
