/* PATCH GEN: liquidnick.com's terminal look (Space Mono, square panels with header bars, the faint grid), with
   SynTHBloK's OLED cells */
:root { --bg: #0d0d14; --card: #0d161d; --edge: #0e2f39; --oled: #05070b; --txt: #e8f4f8; --dim: #9fb6c2; --mut: #5a7a8a;
  --cyan: #00e5ff; --mag: #ff00aa; --org: #ff7a00; --grn: #3dff9a; --mono: 'Space Mono', 'Courier New', monospace;
  --head: var(--mono); --sans: var(--mono); }
* { box-sizing: border-box; }
body { margin: 0; background-color: var(--bg); color: var(--txt); font: 13.5px/1.6 var(--sans);
  background-image: linear-gradient(rgba(0, 229, 255, .028) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 229, 255, .028) 1px, transparent 1px);
  background-size: 44px 44px; background-position: -1px -1px; }
a { color: var(--cyan); } a:hover { color: #7ff2ff; }
code { color: var(--txt); word-break: break-all; font-family: var(--mono); font-size: 0.92em; }
.hint { color: var(--dim); font-size: 12.5px; }
.c { color: var(--cyan); } .m { color: var(--mag); } .o { color: var(--org); } .g { color: var(--grn); }
.dim { color: var(--dim); } .small { font-size: 12px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 28px 40px 8px; flex-wrap: wrap;
  width: 100%; max-width: 2400px; margin: 0 auto; }   /* lined up with the cards, so a wide window's left margin stays empty */
h1 { margin: 0; font: 700 34px var(--head); letter-spacing: .02em; }
h1.c { text-shadow: 0 0 22px #00e5ff66, 0 0 2px #00e5ffaa; }
h1 .by { font-size: max(12px, 0.4em); font-weight: 400; letter-spacing: .16em; text-transform: uppercase; color: var(--mut); margin-left: 8px; text-shadow: none; }
h1 .by .o { color: var(--mag); font-weight: 700; }
/* card titles: the site's panel-head bar across the top of the panel */
h2 { margin: 0; font: 700 11px var(--head); letter-spacing: .16em; text-transform: uppercase; }
.top p { margin: 6px 0 0; font-size: 12px; color: var(--mut); }
.safe { display: flex; align-items: center; gap: 8px; border: 1px solid #3dff9a55; padding: 7px 12px; color: var(--grn); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; background: #3dff9a0a; }
main { padding: 12px 40px 40px; display: flex; flex-direction: column; gap: 16px; max-width: 2400px; margin: 0 auto; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; }
.libfoot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
dialog.pop p { margin: 0 0 10px; }
dialog.pop .steps { margin: 0 0 12px; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; }
dialog.pop .cmd { display: flex; gap: 8px; align-items: center; margin-top: 6px; background: var(--oled); border: 1px solid var(--edge); padding: 6px 6px 6px 10px; }
dialog.pop .cmd code { flex: 1; font-size: 12px; }
dialog.pop .copy { min-height: 32px; padding: 4px 10px; flex: none; }
.card { --cp: 18px; background: var(--card); border: 1px solid var(--edge); box-shadow: inset 0 1px 0 #00e5ff22; padding: 0 var(--cp) 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card > h2:first-child, .card > .viewhead:first-child { margin: 0 calc(-1 * var(--cp)); padding: 9px 14px; border-bottom: 1px solid var(--edge); background: #00e5ff08; }
.card > h2.m:first-child { background: #ff00aa0a; border-bottom-color: #ff00aa33; }
.card p { margin: 0; }
button { font: 700 11.5px var(--sans); letter-spacing: .1em; text-transform: uppercase; border-radius: 5px; padding: 10px 14px; cursor: pointer; min-height: 44px; transition: background .2s, color .2s, box-shadow .2s; }
button:disabled { opacity: 0.4; cursor: default; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
/* highlight buttons: a see-through tint of their colour with a solid edge, not a full block of colour */
.solid { border: 1px solid; color: var(--txt); } .solid.cyan { background: #00e5ff38; border-color: var(--cyan); }
.solid.cyan:hover:not(:disabled) { background: #00e5ff55; box-shadow: 0 0 14px #00e5ff40; }
.solid.green { background: #3dff9a38; border-color: var(--grn); }
.line { background: transparent; } .line.cyan { color: var(--cyan); border: 1px solid var(--cyan); } .line.cyan:hover:not(:disabled) { background: #00e5ff14; }
.line.green { color: var(--grn); border: 1px solid var(--grn); } .line.grey { color: var(--dim); border: 1px solid var(--edge); }
.link { background: none; border: 0; padding: 0; min-height: 0; color: var(--mag); font: inherit; text-transform: none; letter-spacing: 0; text-decoration: underline; }
.row2 { display: flex; gap: 8px; } .row2 > * { flex: 1; }
.pickrow > #pick { flex: 2.4; } .pickrow > #copypath { flex: 1; }
.oled { background: var(--oled); border: 1px solid var(--edge); padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; color: var(--cyan); font: 12.5px/1.5 var(--mono); letter-spacing: .06em; }
.oled .link { font-family: var(--mono); }
.oled > div { display: flex; justify-content: space-between; }
.oled .g { color: var(--grn); } .oled .o { color: var(--org); }
/* the scan indicator: label, running count and a sweeping bar; the numbers below dim while it runs */
.oled > .scan { grid-column: 1 / -1; flex-wrap: wrap; gap: 4px 10px; color: var(--cyan); }
.oled > div[hidden] { display: none; }
dialog.pop .ways { margin: 6px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; }
.oled > .scan i { flex-basis: 100%; height: 3px; border-radius: 2px; background: var(--edge); position: relative; overflow: hidden; }
.oled > .scan i::after { content: ''; position: absolute; inset: 0; width: 35%; background: var(--cyan); border-radius: 2px; animation: sweep 1.1s ease-in-out infinite alternate; }
@keyframes sweep { from { transform: translateX(0); } to { transform: translateX(186%); } }
.oled.busy > div:not(.scan) { opacity: 0.35; }
#pick:disabled { opacity: 0.7; cursor: progress; }
@media (prefers-reduced-motion: reduce) { .oled > .scan i::after { animation: none; width: 100%; opacity: 0.5; } }
.genres { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 6px; flex: 1; }
.genres button { padding: 8px 2px; font-size: clamp(9.5px, 0.68vw, 12px); letter-spacing: .04em; line-height: 1.25; background: var(--oled); color: var(--txt); border: 1px solid var(--edge); }
.genres button:hover { border-color: #ff00aa88; color: var(--mag); }
.genres button[aria-checked="true"], .genres button[aria-checked="true"]:hover { background: #ff00aa2e; color: #ffc2e8; border-color: var(--mag); box-shadow: 0 0 8px #ff00aa33; }
.genres button.any { background: transparent; color: var(--mag); border: 1px dashed var(--mag); }
.genres button.any[aria-checked="true"] { background: #ff00aa2e; color: #ffc2e8; border-style: solid; }
.roll { background: #ff00aa40; color: #ffe0f3; border: 1px solid var(--mag); padding: 16px; font: 700 22px var(--head); letter-spacing: .4em; box-shadow: 0 0 16px #ff00aa33; flex: 1; min-height: 64px; }
.roll:hover { background: #ff00aa5c; box-shadow: 0 0 22px #ff00aa55; }
/* the moment of a press: a little lighter, never a flash of full colour */
button:active:not(:disabled) { filter: brightness(1.15); }
.line.mag { color: var(--mag); border: 1px solid var(--mag); } .line.org { color: var(--org); border: 1px solid var(--org); }
.line.mag[aria-pressed="true"] { background: #ff00aa2e; color: #ffc2e8; box-shadow: 0 0 8px #ff00aa33; }
.line.mag:hover:not(:disabled):not([aria-pressed="true"]) { background: #ff00aa14; }
#clear { align-self: center; }
.viewhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.acts { display: flex; gap: 8px; flex-wrap: wrap; }
/* the patch map: drawn like the workbench's PATCH MAP */
.patch { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 10px; }
.map { position: relative; background: #1b1d1f; border: 1px solid var(--edge); height: calc(100vh - 150px); min-height: 360px; overflow: hidden; touch-action: none; cursor: grab; user-select: none; }
.map.drag { cursor: grabbing; }
/* before the first patch: the three steps, in the middle of the empty map */
.empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; font-size: 14px; color: var(--txt); pointer-events: none; padding: 16px; }
.empty[hidden] { display: none; }
.empty > b { font: 700 13px var(--head); letter-spacing: .16em; text-transform: uppercase; color: var(--cyan); }
.empty ol { margin: 0; padding-left: 26px; display: flex; flex-direction: column; gap: 10px; }
.empty em { font-style: normal; font-weight: 700; color: var(--cyan); }
:is(.map, .tile) svg { display: block; width: 100%; height: 100%; }
:is(.map, .tile) .rail { fill: #8b9096; } :is(.map, .tile) .hole { fill: #3a3d40; }
:is(.map, .tile) .face { fill: #232323; stroke: #444; stroke-width: .3; }
:is(.map, .tile) text { fill: #ddd; font: 600 5.5px var(--head); } :is(.map, .tile) text.mk { fill: #8a8f94; font-size: 3.2px; font-weight: 400; }
:is(.map, .tile) .jk { fill: #111; stroke: #6b7075; stroke-width: .5; } :is(.map, .tile) .jk.o { stroke: #a0a5aa; }
:is(.map, .tile) .hi { fill: none; stroke: none; }
:is(.map, .tile) .c { fill: none; stroke-width: 1.9; stroke-linecap: round; opacity: .82; cursor: pointer; }
:is(.map, .tile) .cs { fill: none; stroke: #000; stroke-width: 2.6; stroke-linecap: round; opacity: .3; }
:is(.map, .tile) .j { stroke: #111; stroke-width: .5; } :is(.map, .tile) .jc { fill: #111; }
:is(.map, .tile) .m { cursor: pointer; }
.map.sel .c, .map.sel .j, .map.sel .jc, .map.sel .cs { opacity: .1; }
.map.sel .m:not(.on) { opacity: .45; }
.map.sel .c.on { opacity: 1; stroke-width: 2.4; } .map.sel .j.on, .map.sel .jc.on { opacity: 1; } .map.sel .cs.on { opacity: .3; }
.map.sel .m.on .hi { stroke: var(--cyan); stroke-width: .8; }
.zoom { position: absolute; right: 8px; top: 8px; display: flex; gap: 4px; z-index: 2; }
.zoom button { width: 36px; min-height: 36px; padding: 0; border: 1px solid #444; background: #232323cc; color: #ddd; font-size: 16px; }
.clist { background: #1b1d1f; border: 1px solid var(--edge); height: calc(100vh - 150px); min-height: 360px; overflow-y: auto; padding: 8px; font-size: 13px; }
.clist h4 { margin: 10px 4px 4px; font: 700 10.5px var(--head); letter-spacing: .14em; text-transform: uppercase; color: var(--mut); }
.clist button { display: flex; gap: 8px; align-items: center; width: 100%; min-height: 0; text-align: left; background: none; border: 0; color: #ddd; padding: 4px; font-size: 12px; font-weight: 400; letter-spacing: 0; text-transform: none; }
.clist button.on { background: #ffffff14; color: #fff; }
.clist i { flex: none; width: 10px; height: 10px; border-radius: 50%; }
.clist b { color: #fff; font-weight: 600; }
/* the shelf: kept patches' pictures in a column left of the map, top first; the column's width is set so six fill it */
.patch.shelved { grid-template-columns: auto minmax(0, 1fr) 260px; }
.shelf { display: grid; grid-template-rows: repeat(6, minmax(0, 1fr)); gap: 6px; min-height: 0; }
.shelf[hidden] { display: none; }
.shelf.side { position: fixed; left: 16px; top: 16px; bottom: 16px; z-index: 3; }
.tile { position: relative; min-height: 0; background: #1b1d1f; border: 1px solid var(--edge); border-radius: 5px; overflow: hidden; animation: tile-in .35s ease-out; }
.tile.cur { border-color: var(--mag); box-shadow: 0 0 8px #ff00aa33; }
.tile .go { display: block; position: relative; width: 100%; height: 100%; min-height: 0; padding: 0; border: 0; border-radius: 0; background: none; }
.tile .go:hover { background: #ffffff08; }
.tile .go svg { pointer-events: none; }
.tile .go span { position: absolute; left: 0; right: 0; bottom: 0; padding: 2px 6px; font: 700 9.5px var(--mono); letter-spacing: .08em; color: var(--txt);
  background: #05070bcc; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; min-height: 0; padding: 0; border: 1px solid #ff00aa88; border-radius: 4px;
  background: #05070bcc; color: var(--mag); font: 700 14px/1 var(--mono); letter-spacing: 0; }
.tile .x:hover { background: #ff00aa38; color: #fff; }
@keyframes tile-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .tile { animation: none; } }/* the pop-up: like ToyBoX's */
dialog.pop { border: 1px solid var(--mag); border-radius: 24px; background: var(--card); color: var(--txt); padding: 20px; width: min(560px, calc(100vw - 32px));
  box-shadow: 0 0 32px #ff00aa55; }
dialog.pop[open] { animation: pop 0.22s ease-out; }
dialog.pop::backdrop { background: #05070bcc; backdrop-filter: blur(6px); }
dialog.pop h3 { margin: 0 0 12px; font: 700 18px var(--head); color: var(--mag); }
dialog.pop textarea { width: 100%; min-height: 200px; background: var(--oled); color: var(--txt); border: 1px solid var(--edge); border-radius: 8px; padding: 8px; font: 13px var(--mono); }
dialog.pop .copy { font-size: 13px; }
dialog.pop ul { max-height: 50vh; overflow: auto; margin: 0; padding-left: 18px; }
dialog.pop .acts { margin-top: 14px; justify-content: flex-end; }
@keyframes pop { from { transform: scale(0.94); opacity: 0; } to { transform: none; opacity: 1; } }
/* the welcome page on app.liquidnick.com (members-addon/patchgen.php): signed out, it explains PATCH GEN and asks
   for the member login */
body.welcome { height: auto !important; overflow: auto !important; display: block !important; }
.hello { max-width: 640px; margin: 0 auto; padding: 48px 20px; display: flex; flex-direction: column; gap: 18px; }
.hello h1 { font-size: 40px; }
.hello .lead { font-size: 15px; margin: 0; }
.hello .how { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; color: var(--dim); }
.hello .gate p { margin: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; align-self: flex-start; text-decoration: none; font: 700 12px var(--sans); letter-spacing: .1em; text-transform: uppercase;
  padding: 12px 28px; min-height: 44px; border-radius: 5px; }
.btn.solid.cyan { color: var(--txt); } a.btn:hover { filter: brightness(1.1); }
/* desktop: the whole app fits the window; the patch map takes whatever height the top row leaves */
@media (min-width: 901px) and (min-height: 640px) {
  body { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
  .top { padding: 14px 40px 4px; } h1 { font-size: 28px; }
  main { flex: 1; min-height: 0; width: 100%; padding-bottom: 16px; }
  .card { padding-bottom: 14px; gap: 10px; }
  .view { flex: 1; min-height: 0; }
  .patch { flex: 1; min-height: 0; }
  .map, .clist { height: 100%; min-height: 0; }
}
/* shorter desktop screens: tighter top row so the map keeps most of the height */
@media (min-width: 901px) and (max-height: 960px) {
  .top { padding-top: 10px; } .top p { display: none; } h1 { font-size: 24px; } .safe { padding: 4px 12px; }
  main { gap: 10px; } .cols { gap: 10px; } .card { --cp: 14px; padding-bottom: 10px; gap: 8px; } .card > h2:first-child, .card > .viewhead:first-child { padding: 6px 12px; }
  button { min-height: 34px; padding: 6px 10px; } .genres button { padding: 5px 4px; }
  .oled { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; padding: 6px 10px; }
  .roll { padding: 8px; font-size: 16px; min-height: 44px; }
}
@media (max-width: 900px) {
  .top { padding: 20px 16px 4px; } main { padding: 12px 16px 32px; }
  .cols { grid-template-columns: 1fr; } h1 { font-size: 26px; }
  .genres { grid-template-columns: repeat(3, minmax(0, 1fr)); } .genres button { font-size: 11.5px; }
  .patch, .patch.shelved { grid-template-columns: 1fr; } .map { height: 56vh; }
  .shelf { grid-template-rows: none; grid-template-columns: repeat(3, minmax(0, 1fr)); } .tile { aspect-ratio: 1.6; } .clist { height: auto; max-height: 40vh; min-height: 0; }
}
