/* The Salted Hash Studio: one stylesheet for the portal online and the guide in the zip.
   The accent is the client's own first colour (set on <html> by app.js); links never
   use browser blue. */
:root {
  --bg: #0d0b16; --panel: #16132a; --panel-2: #1d1935; --line: rgba(255,255,255,.08);
  --text: #ece9f7; --muted: #9b95b8; --accent: #FF3FA4; --accent-2: #2E8BFF; --ok: #4ade80; --warn: #fbbf24;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.8rem; } h2 { font-size: 1.4rem; } h3 { font-size: 1.05rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
code { background: var(--panel-2); padding: .1em .35em; border-radius: 6px; font-size: .92em; }
pre { background: #0a0813; border: 1px solid var(--line); border-radius: 10px; padding: .8rem 1rem; overflow: auto; font-size: .85rem; line-height: 1.45; }
.muted { color: var(--muted); }
.page { max-width: 1100px; margin: 0 auto; padding: 1.5rem; }
.center { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 2rem; }
.center .card { max-width: 440px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.btn { display: inline-flex; align-items: center; gap: .4rem; background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: .55rem .95rem; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn.primary { background: var(--accent); color: #0b0812; border-color: transparent; }
.btn.primary:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.small { padding: .3rem .6rem; font-size: .85rem; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 10; background: rgba(13,11,22,.9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar .page { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 1.5rem; }
.brand { font-weight: 800; letter-spacing: .02em; }
.brand small { color: var(--muted); font-weight: 500; margin-left: .5rem; }
.dot { display: inline-block; width: .6em; height: .6em; border-radius: 50%; background: var(--warn); margin-right: .4em; }
.banner { background: var(--accent-2); color: #061020; padding: .5rem 1.5rem; font-weight: 600; }
.banner a { color: inherit; text-decoration: underline; }

/* layout */
.layout { display: grid; grid-template-columns: 220px 1fr; gap: 1.5rem; }
nav.toc { position: sticky; top: 4.5rem; align-self: start; }
nav.toc a { display: block; padding: .35rem .6rem; border-radius: 8px; color: var(--muted); }
nav.toc a:hover { background: var(--panel); color: var(--text); text-decoration: none; }
nav.toc a.off { opacity: .5; }
@media (max-width: 800px) { .layout { grid-template-columns: 1fr; } nav.toc { position: static; display: flex; flex-wrap: wrap; } }

section.asset { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.5rem; }
section.asset.off .body { opacity: .45; pointer-events: none; }
section.asset header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
section.asset header p { margin: 0; color: var(--muted); }
.switch { display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; white-space: nowrap; font-weight: 600; }
.switch input { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }

/* preview */
.preview { position: relative; width: 100%; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #000; }
.preview .backdrop { position: absolute; inset: 0; }
.preview .backdrop.game { background: repeating-linear-gradient(45deg, #1a1f2e 0 14px, #141827 14px 28px); }
.preview .backdrop.camera { background: radial-gradient(circle at 50% 45%, #3a3550 0 18%, #221e33 19% 100%); }
.preview .backdrop.none { background: linear-gradient(135deg, #111 0, #222 100%); }
.preview .backdrop::after { content: attr(data-label); position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: rgba(255,255,255,.18); font-weight: 800; font-size: 2rem; letter-spacing: .1em; }
.preview iframe { position: absolute; left: 0; top: 0; border: 0; transform-origin: 0 0; background: transparent; }
.preview-tools { display: flex; gap: .5rem; flex-wrap: wrap; margin: .6rem 0 1rem; }
.tabs { display: flex; gap: .3rem; margin-bottom: .8rem; flex-wrap: wrap; }
.tabs button { background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: .3rem .8rem; font: inherit; cursor: pointer; }
.tabs button.on { background: var(--accent); color: #0b0812; border-color: transparent; font-weight: 700; }

/* controls */
.controls { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .8rem 1.2rem; margin: .5rem 0 1rem; }
.controls h3 { grid-column: 1 / -1; margin: .6rem 0 0; }
.ctl { display: flex; flex-direction: column; gap: .25rem; }
.ctl label { font-weight: 600; }
.ctl .hint { color: var(--muted); font-size: .85rem; }
.ctl .about { color: var(--muted); font-size: .85rem; }
.ctl input[type=text], .ctl select, .ctl input[type=number] { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: .45rem .6rem; font: inherit; }
.ctl input[type=color] { width: 3.2rem; height: 2.2rem; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); padding: .15rem; }
.ctl .num { display: flex; gap: .6rem; align-items: center; } .ctl .num input[type=range] { flex: 1; accent-color: var(--accent); } .ctl .num input[type=number] { width: 5.5rem; }
.ctl.toggle { flex-direction: row; align-items: center; gap: .6rem; } .ctl.toggle input { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .8rem; }
.swatch { display: flex; align-items: center; gap: .6rem; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: .5rem .7rem; }
.swatch input[type=color] { width: 2.6rem; height: 2.2rem; border: 0; background: none; padding: 0; }
.swatch .lbl { font-weight: 600; } .swatch .hex { color: var(--muted); font-size: .85rem; font-family: ui-monospace, monospace; }

/* checklist */
details { border: 1px solid var(--line); border-radius: 10px; padding: .6rem .9rem; margin: .6rem 0; background: var(--panel-2); }
details summary { cursor: pointer; font-weight: 700; }
ol.steps { padding-left: 0; list-style: none; margin: .6rem 0 0; }
ol.steps li { display: flex; gap: .6rem; align-items: flex-start; padding: .35rem 0; border-top: 1px solid var(--line); }
ol.steps li input { margin-top: .3rem; accent-color: var(--accent); width: 1.05rem; height: 1.05rem; flex: none; }
ol.steps li.done { color: var(--muted); text-decoration: line-through; }
.md h3 { text-transform: none; letter-spacing: 0; color: var(--text); margin-top: .9rem; }
.md ul, .md ol { padding-left: 1.3rem; }

/* tables (admin) */
table { width: 100%; border-collapse: collapse; } th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); } th { color: var(--muted); font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; }
form.stack { display: grid; gap: .6rem; max-width: 420px; } form.stack input, form.stack select { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: .5rem .6rem; font: inherit; }
.toast { position: fixed; right: 1rem; bottom: 1rem; background: var(--panel-2); border: 1px solid var(--line); border-left: 4px solid var(--accent); padding: .7rem 1rem; border-radius: 10px; max-width: 420px; z-index: 20; }
.toast.error { border-left-color: #f87171; }
