/* chinesify-pic.css — dark paint-app chrome for the poster-paint tool.
   Standalone (does not ride on cyber-goth.css), so it carries its own
   chrome-is-not-text block and its own @font-face lines. */

@font-face { font-family: 'RoyaleCouture'; src: url('fonts/custom/royale-couture-sans.otf') format('opentype'); }
@font-face { font-family: 'Handwriting'; src: url('fonts/custom/My handwriting.ttf') format('truetype'); }

/* ── chrome is not text ──
   Every control on this page is chrome: buttons, tool toggles, swatches,
   sliders and their labels, step headings, the size note. Only the credits
   line at the foot is prose, and it stays selectable. */
button,
[role="button"],
.rail,
.stage-note,
.working-note,
.drop {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg:    #08080F;
  --panel: #0D0D18;
  --line:  #232336;
  --ink:   #EDE8FF;
  --dim:   rgba(237, 232, 255, 0.52);
  --cyan:  #74D7FE;
  --pink:  #DE97E7;
  --lav:   #B9ADF9;
  --mono:  'JetBrains Mono', 'IBM Plex Mono', ui-monospace, monospace;
}

html { background: var(--bg); }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
}

/* ── header ── */

.top {
  padding: 26px 28px 18px;
  border-bottom: 1px solid var(--line);
}

.title {
  font-family: 'RoyaleCouture', serif;
  font-weight: 400;
  font-size: clamp(30px, 4.6vw, 46px);
  letter-spacing: 0.06em;
  color: var(--cyan);
  text-wrap: balance;
}

.sub {
  margin-top: 4px;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--dim);
}

/* ── app split ── */

.app {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 0;
}

/* ── stage ── */

.stage {
  flex: 1;
  min-width: 0;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 26px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(138, 111, 232, 0.05), transparent 60%),
    var(--bg);
}

.stage.is-drop { outline: 2px dashed var(--pink); outline-offset: -10px; }

#view {
  max-width: 100%;
  max-height: calc(100vh - 258px);
  min-height: 0;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.65);
  border: 1px solid var(--line);
  touch-action: none;
  transition: opacity 0.15s;
}
#view.cur-pick  { cursor: crosshair; }
#view.cur-brush { cursor: none; }

body:not(.has-image) #view { display: none; }
body.has-image .drop { display: none; }

.stage.is-working #view { opacity: 0.45; }
.working-note {
  display: none;
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--cyan);
}
.stage.is-working .working-note { display: block; }

.drop {
  width: min(460px, 88%);
  padding: 64px 30px;
  border: 1px dashed var(--line);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: var(--dim);
}
.drop-line { font-size: 15px; letter-spacing: 0.06em; color: var(--ink); }
.drop-hint { font-size: 11px; letter-spacing: 0.04em; }

.stage-note {
  position: absolute;
  left: 28px; bottom: 12px;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--dim);
}

/* ── icon toolbar under the canvas ── */

.stage-tools { display: flex; gap: 8px; }
body:not(.has-image) .stage-tools { display: none; }

.ibtn {
  width: 34px; height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}
.ibtn svg {
  width: 16px; height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ibtn:hover { border-color: var(--pink); }
.ibtn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.ibtn.is-on {
  border-color: var(--pink);
  color: var(--pink);
  background: rgba(222, 151, 231, 0.1);
}

/* ── control rail ── */

.rail {
  width: 302px;
  flex-shrink: 0;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: var(--panel);
}

.step {
  padding: 18px 20px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

body:not(.has-image) .needs-image { opacity: 0.35; pointer-events: none; }

.step-head {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.step-num { color: var(--pink); }

/* ── sliders ── */

.ctl { display: flex; flex-direction: column; gap: 5px; }

.ctl label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: 0.07em;
  color: var(--dim);
}
.ctl output { color: var(--ink); font-variant-numeric: tabular-nums; }

.ctl input[type="range"] {
  width: 100%;
  accent-color: var(--pink);
  background: transparent;
}

/* ── buttons ── */

.btn,
.tool {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  padding: 8px 12px;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}
.btn:hover, .tool:hover { border-color: var(--pink); }
.btn:focus-visible, .tool:focus-visible, .sw:focus-visible, .sel-clear:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.btn-accent { border-color: var(--pink); color: var(--pink); }
.btn-accent:hover { background: rgba(222, 151, 231, 0.12); }

.row { display: flex; gap: 8px; }
.row .btn { flex: 1; }

.tools { display: flex; gap: 8px; }
.tool { flex: 1; }
.tool.is-on {
  border-color: var(--pink);
  color: var(--pink);
  background: rgba(222, 151, 231, 0.1);
}

/* ── selection readout ── */

.sel {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 22px;
}
.sel-swatch {
  width: 18px; height: 18px;
  flex-shrink: 0;
  border: 1px solid var(--line);
}
.sel-text { font-size: 10.5px; letter-spacing: 0.05em; color: var(--dim); }
.sel-clear {
  margin-left: auto;
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 5px 8px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  cursor: pointer;
}
.sel-clear:hover { border-color: var(--pink); color: var(--pink); }

/* ── brush colour ── */

.color-row { display: flex; align-items: center; gap: 10px; }
.color-row .ctl-label { font-size: 11px; letter-spacing: 0.07em; color: var(--dim); }

.chip {
  width: 22px; height: 22px;
  flex-shrink: 0;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line);
  cursor: pointer;
}
.chip.is-target { outline: 2px solid var(--pink); outline-offset: 1px; }
.chip:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.wheel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
#wheel-cv { touch-action: none; cursor: crosshair; max-width: 100%; }
.wheel-read {
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.swatches { display: flex; gap: 6px; margin-left: auto; }
.sw {
  width: 18px; height: 18px;
  border: 1px solid rgba(0, 0, 0, 0.5);
  cursor: pointer;
  padding: 0;
}
.sw:hover { transform: scale(1.18); }

.aside-hand {
  font-family: 'Handwriting', cursive;
  font-size: 22px;
  color: var(--lav);
  transform: rotate(-2deg);
  align-self: flex-end;
  padding-right: 6px;
}

/* ── credits ── */

.credits {
  padding: 14px 28px 18px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: 0.03em;
  color: var(--dim);
}
.credits a { color: var(--lav); }

/* ── small screens ── */

@media (max-width: 860px) {
  .app { flex-direction: column; }
  .stage { padding: 16px; }
  #view { max-height: 54vh; }
  .rail {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--line);
  }
  .stage-note { left: 18px; bottom: 6px; }
}
