/* Minecraft Hologram Generator (hologram-generator.html). Loaded after tools.css. The scene and the icons are our own drawings. */

.hd-loc { margin: 0 0 14px; padding: 0; border: 0; min-width: 0; }
.hd-loc legend { padding: 0; margin-bottom: 6px; font-size: 0.82rem; font-weight: 700; }
.hd-loc legend small { font-family: var(--mono); font-weight: 400; color: var(--on-paper-soft); margin-left: 6px; }
.hd-loc .trow > .tf { flex: 1 1 70px; }
.hd-loc .trow > .tf.hd-wfield { flex: 2 1 130px; }

/* lines */
.hd-pagebar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.hd-pagebar .chips { flex: 1 1 auto; }
.hd-lines { display: flex; flex-direction: column; gap: 6px; }
/* a line: number | text | height on top, kind and buttons below; FancyHolograms has one row */
.hd-line {
  display: grid;
  grid-template-columns: 1.8em minmax(0, 1fr) 76px;
  grid-template-areas: "n text h" ". type btns";
  align-items: center;
  gap: 6px;
  padding: 6px;
  box-shadow: inset 0 0 0 1px var(--rule-paper);
  min-width: 0;
}
.is-fh .hd-line { grid-template-columns: 1.8em minmax(0, 1fr) auto; grid-template-areas: "n text btns" "off off off"; }
.hd-line.off { opacity: 0.6; }
.hd-ln { grid-area: n; font-family: var(--mono); font-size: 0.78rem; color: var(--on-paper-soft); text-align: right; }
.tool .hd-line select.hd-type { grid-area: type; justify-self: start; width: auto; max-width: 100%; padding: 6px; font-size: 0.82rem; }
.tool .hd-line input.hd-text { grid-area: text; width: 100%; min-width: 0; padding: 7px 9px; }
.tool .hd-line input.hd-h { grid-area: h; width: 100%; padding: 7px 6px; }
.hd-btns { grid-area: btns; display: inline-flex; justify-content: flex-end; gap: 4px; }
.hd-btns .tbtn { padding: 5px 10px; min-width: 34px; }
.hd-off { grid-area: off; padding-left: 2.3em; font-size: 0.76rem; color: var(--on-paper-soft); }
.hd-add { margin-top: 12px; }
.hd-lines:empty + .hd-add { margin-top: 0; }

/* click actions */
.hd-acts { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.hd-act { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tool .hd-act select { flex: 1 1 130px; width: auto; padding: 7px 6px; font-size: 0.84rem; }
.tool .hd-act input { flex: 2 1 160px; width: auto; min-width: 0; padding: 7px 9px; }
.hd-act .tbtn { flex: none; padding: 6px 12px; }
.hd-acts .thint { margin: 0; }

/* settings */
.hd-colour { align-items: center; margin-bottom: 14px; }
.hd-colour .tf.hd-hex { flex: 0 1 110px; }
.hd-colour .tf.hd-hex input { text-transform: uppercase; }
.hd-colour .tf:last-child { flex: 2 1 180px; }
.hd-fhchips { margin-bottom: 14px; }
.tool .hd-fhchips + .tf, .tool [data-only] > .trow + .tf { margin-top: 0; }
[data-only="dh"] > .chips { margin-top: 2px; }
[data-only] > .trow { margin-bottom: 14px; }

/* placeholder samples */
.hd-samples { display: flex; flex-direction: column; gap: 6px; }
.hd-sample { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.hd-sample code { flex: 1 1 180px; min-width: 0; font-family: var(--mono); font-size: 0.8rem; overflow-wrap: anywhere; }
.tool .hd-sample input { flex: 1 1 140px; width: auto; min-width: 0; padding: 6px 9px; }
.hd-samples .thint { margin: 0; }

/* preview scene */
.hd-scene { position: relative; aspect-ratio: 16 / 10; min-height: min(240px, 62vw); overflow: hidden; background: #0b1226; box-shadow: 0 0 0 1px var(--rule-paper); }
.hd-scene canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.hd-world { position: absolute; inset: 0; font-family: var(--mono); color: #fff; }
.hd-tag, .hd-fh, .hd-ico, .hd-anchor { position: absolute; transform: translateX(-50%); }
.hd-tag {
  white-space: pre;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.25);
  letter-spacing: 0.02em;
}
.hd-tag.hd-blank { min-width: 0.6em; min-height: 1em; }
.hd-fh { font-weight: 600; letter-spacing: 0.02em; white-space: pre-wrap; overflow-wrap: anywhere; width: max-content; }
.hd-fh.flat { transform: translateX(-50%) perspective(420px) rotateX(68deg); transform-origin: 50% 100%; }
.hd-row { min-height: 1em; }
.hd-world .b { font-weight: 800; }
.hd-world .i { font-style: italic; }
.hd-world .u { text-decoration: underline; }
.hd-world .s { text-decoration: line-through; }
.hd-world .u.s { text-decoration: underline line-through; }
.hd-empty { color: #b9bfd6; font-style: italic; font-weight: 400; padding: 4px 8px; font-size: 0.85rem; }
/* the location: a dashed mark at the left edge of the scene, at the height of the hologram's location */
.hd-anchor { left: 0; width: 34px; height: 0; border-top: 2px dashed rgba(255, 216, 74, 0.85); transform: none; pointer-events: none; }
.hd-anchor span { position: absolute; left: 4px; top: -15px; font-size: 10px; line-height: 1; color: rgba(255, 216, 74, 0.9); white-space: nowrap; }
.hd-anchor.below span { top: 5px; }
.hd-range { position: absolute; left: 12px; right: 12px; bottom: 12px; margin: 0; padding: 8px 10px; background: rgba(0, 0, 0, 0.7); color: #fff; font-size: 0.85rem; line-height: 1.4; }
.hd-pvbar { margin-top: 12px; align-items: center; }
.hd-pvbar .tf.hd-dist { flex: 1 1 200px; }
.hd-pvpage { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 0.8rem; }
.hd-pvpage .tbtn { min-width: 36px; }
.hd-warns { max-height: 40vh; overflow-y: auto; }
.hd-warns .note { margin: 0; }
.hd-warns .note + .note { margin-top: 6px; }

/* outputs and import */
.tgrid.hd-io { margin-top: clamp(16px, 2.5vw, 32px); grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr); }
.hd-outs .out + .out { margin-top: 12px; }
.hd-outs .out-head .tbtn + .tbtn { margin-left: 6px; }
.hd-outs .out-head span { margin-left: auto; }
.tool textarea.hd-imp { white-space: pre; overflow: auto; tab-size: 2; min-height: 180px; }
#imp-result { margin-top: 12px; }
#imp-result .note + .note, #imp-result .note + .tf { margin-top: 8px; }
.hd-pick { margin-top: 10px; }

@media (max-width: 900px) { .tgrid.hd-io { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) {
  .hd-loc .trow > .tf.hd-wfield { flex-basis: 100%; }
  .hd-loc .trow > .tf { flex-basis: 60px; }
  .hd-line { padding: 6px 4px; }
  .hd-scene { aspect-ratio: 4 / 3; }
  .hd-off { padding-left: 0; }
}
