/* Fractal Explorer (fractal.batjorge.com/explorer/): a full-screen picture with a panel, the gallery's dark colours */
:root {
  --bg: #0b0f0d; --panel: rgba(16, 22, 19, .92); --line: #2a3530; --text: #dfe7e2; --muted: #8fa199; --strong: #fff;
  --primary: #5fd08f; --primary-text: #0f1712;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
#view { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; touch-action: none; cursor: grab; outline: none; }
#view.dragging { cursor: grabbing; }
#view.picking { cursor: crosshair; }

#hud { position: fixed; left: .6rem; bottom: .5rem; display: flex; gap: .8rem; font: 12px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--muted); text-shadow: 0 1px 2px #000; pointer-events: none; }
/* progress of a slow picture, in the middle of the picture (not over the panel) */
#progress { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 1; pointer-events: none;
  min-width: 15rem; padding: .8rem 1.1rem; border-radius: .7rem; background: rgba(8, 12, 10, .72); border: 1px solid var(--line);
  backdrop-filter: blur(4px); text-align: center; text-shadow: 0 1px 2px #000; }
#progress .pt { font-size: 1.15rem; font-weight: 700; color: var(--strong); }
#progress .pbar { height: .4rem; margin: .5rem 0 .4rem; border-radius: .2rem; background: rgba(255, 255, 255, .12); overflow: hidden; }
#progress .pbar i { display: block; height: 100%; width: 0; background: var(--primary); transition: width .15s linear; }
#progress .ps { font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); }

#panel-toggle { position: fixed; top: .6rem; right: .6rem; z-index: 3; width: 2.4rem; height: 2.4rem; border-radius: .5rem;
  border: 1px solid var(--line); background: var(--panel); color: var(--text); font-size: 1.2rem; cursor: pointer; }
/* the panel: head, tabs, a scrolling middle, the buttons always at the bottom (fits any screen height) */
#panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(22rem, 100vw); z-index: 2; display: flex; flex-direction: column;
  padding: .7rem 1rem .5rem; background: var(--panel); border-left: 1px solid var(--line); backdrop-filter: blur(6px);
  transition: transform .25s ease; }
.pscroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin: 0 -1rem; padding: 0 1rem; }
.pfoot { flex: none; border-top: 1px solid var(--line); padding-top: .55rem; }
.row.start { margin: .2rem 0 .5rem; }
.ptabs { display: flex; gap: .2rem; border-bottom: 1px solid var(--line); flex: none; }
.ptabs [role=tab] { background: none; border: 1px solid transparent; border-bottom: 0; color: var(--muted); font-weight: 700;
  padding: .35rem .8rem; border-radius: .4rem .4rem 0 0; margin-bottom: -1px; }
.ptabs [role=tab]:hover { color: var(--text); }
.ptabs [role=tab][aria-selected=true] { color: var(--strong); background: #111815; border-color: var(--line); }
.pane { border-top: 0; padding: .6rem 0; }
.pane .hint { margin: 0 0 .4rem; }
#panel.closed { transform: translateX(100%); }
.ph { padding-right: 2.6rem; }
.ph .home { color: var(--muted); text-decoration: none; font-size: .82rem; }
.ph .home:hover { color: var(--primary); }
h1 { margin: .1rem 0 .3rem; font-size: 1.2rem; color: var(--strong); }
h2 { margin: 0 0 .45rem; font-size: .95rem; color: var(--strong); }
.hint { color: var(--muted); font-weight: 400; font-size: .76rem; }
section { padding: .7rem 0; border-top: 1px solid var(--line); }
section:first-of-type { border-top: 0; }

.row { display: grid; grid-template-columns: 6.2rem 1fr auto; align-items: center; gap: .5rem; margin: .3rem 0; }
.row.check { display: flex; gap: .45rem; }
select, input[type=number] { width: 100%; background: #111815; color: var(--text); border: 1px solid var(--line); border-radius: .35rem;
  padding: .3rem .4rem; font: inherit; }
input[type=range] { width: 100%; accent-color: var(--primary); }
output { font: 12px ui-monospace, monospace; color: var(--muted); min-width: 3.5rem; text-align: right; }

button { font: inherit; font-weight: 700; border: 1px solid var(--primary); background: var(--primary); color: var(--primary-text);
  border-radius: .4rem; padding: .4rem .8rem; cursor: pointer; }
button.ghost { background: transparent; color: var(--primary); }
button.small { padding: .2rem .55rem; font-size: .82rem; }
button:disabled { opacity: .5; cursor: wait; }
.buttons { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.savebox { display: flex; gap: .4rem; }
.savebox select { width: auto; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: .4rem; overflow: hidden; margin-bottom: .5rem; }
.seg label { padding: .25rem .7rem; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--primary); color: var(--primary-text); font-weight: 700; }

#slots { list-style: none; margin: 0 0 .5rem; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.slot { border: 1px solid var(--line); border-radius: .45rem; padding: .45rem .55rem; background: rgba(0, 0, 0, .25); }
.slot .top { display: flex; gap: .35rem; align-items: center; }
.slot .top select { flex: 1; }
.slot .top input { width: 3.6rem; }
.slot .top button { padding: .15rem .45rem; font-size: .8rem; background: transparent; color: var(--muted); border-color: var(--line); }
.slot .top button:hover { color: var(--text); }
.slot .row { grid-template-columns: 5.6rem 1fr 3.2rem; margin: .2rem 0 0; font-size: .85rem; }
.slot .kind { font-size: .72rem; color: var(--muted); margin-top: .15rem; }

.msg { min-height: 1.2em; color: var(--primary); margin: .5rem 0 0; font-size: .85rem; }
.msg.err { color: #ff6b6b; }
.help summary { cursor: pointer; color: var(--muted); }
.help ul { padding-left: 1.1rem; color: var(--muted); font-size: .84rem; }

#nogl { position: fixed; inset: 0; display: grid; place-content: center; text-align: center; padding: 2rem; background: var(--bg); z-index: 5; }
#nogl a { color: var(--primary); }

@media (min-width: 701px) {   /* the picture uses the free area next to the open panel */
  body:not(.panel-closed) #view { width: calc(100vw - min(22rem, 100vw)); }
  body:not(.panel-closed) #progress { left: calc((100vw - min(22rem, 100vw)) / 2); }
}
@media (max-width: 700px) {
  #panel { width: 100vw; top: auto; height: 60vh; height: 60dvh; border-left: 0; border-top: 1px solid var(--line); }
  #panel.closed { transform: translateY(100%); }
}
.savebox select { max-width: 9.5rem; }
.custom { display: flex; align-items: center; gap: .35rem; margin-top: .45rem; color: var(--muted); }
.custom input { width: 5.5rem; }

