/* CC Edit for the browser. CykaCircus night palette: ink, cream, red; gold for brand touches only. */
:root {
  --ink: #0b0910; --panel: #110d18; --card: #18121f; --line: #2c2437; --cream: #f6efe2; --sub: #b9b1a6;
  --red: #e5322d; --red-soft: #3a1518; --gold: #f6c445; --track: #4a4057; --hover: #201828;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--ink); color: var(--cream); font: 13px/1.4 "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  display: flex; flex-direction: column; overflow: hidden; user-select: none;
}
button, select, input { font: inherit; color: inherit; }
.dim { color: var(--sub); } .small { font-size: 12px; }
h1, h2 { font-family: Impact, "Arial Narrow Bold", sans-serif; font-weight: 400; letter-spacing: .02em; margin: 0; }

#top {
  display: flex; align-items: center; gap: 14px; padding: 8px 14px; background: var(--panel);
  border-bottom: 2px solid var(--red); flex: none;
}
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--cream); }
.brand .name { font: 22px Impact, "Arial Narrow Bold", sans-serif; letter-spacing: .02em; }
.brand .by { font-size: 10px; font-weight: 700; color: var(--gold); letter-spacing: .08em; margin-top: 6px; }
.bar { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; flex-wrap: wrap; }
.sep { width: 1px; height: 20px; background: var(--line); margin: 0 6px; }
.pill {
  background: var(--card); border: 1.5px solid var(--line); border-radius: 20px; padding: 6px 14px; font-weight: 700;
  cursor: pointer; white-space: nowrap; transition: border-color .12s ease-out, background-color .12s ease-out;
}
.pill:hover:not(:disabled) { border-color: var(--red); }
.pill:active:not(:disabled) { background: var(--hover); }
.pill:disabled { opacity: .4; cursor: default; }
.pill.primary { background: var(--red); border-color: var(--red); color: #fff; }
.pill.primary:hover:not(:disabled) { background: #f0443f; border-color: #f0443f; }
.pill.on { border-color: var(--gold); color: var(--gold); }
.pill.big { font-size: 16px; padding: 12px 28px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

main { flex: 1; display: flex; min-height: 0; }
#stage { flex: 1; position: relative; min-width: 0; background: #07050b; }
#view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
#view.panning { cursor: grabbing; }
#drop { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; }
#drop[hidden] { display: none; }
#drop.over .card { border-color: var(--gold); }
#drop .card {
  max-width: 460px; text-align: center; background: var(--panel); border: 1.5px dashed var(--line);
  border-radius: 16px; padding: 34px 30px;
}
#drop h1 { font-size: 46px; }
#drop .lead { color: var(--sub); font-size: 15px; margin: 6px 0 22px; }
#drop .note { margin: 22px 0 8px; padding: 10px 12px; background: var(--card); border-radius: 10px; }
#busy {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: rgba(11, 9, 16, .86);
  border: 1px solid var(--line); border-radius: 22px; padding: 10px 18px; display: flex; gap: 10px; align-items: center;
}
#busy[hidden] { display: none; }
.spin {
  width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--track); border-top-color: var(--red);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2.4s; } }
#status { position: absolute; left: 12px; bottom: 8px; font-size: 12px; pointer-events: none; text-shadow: 0 1px 2px #000; }

#cropbox { position: absolute; border: 1.5px solid var(--cream); box-shadow: 0 0 0 9999px rgba(7, 5, 11, .62); cursor: move; touch-action: none; }
#cropbox[hidden] { display: none; }
#cropbox i { position: absolute; width: 18px; height: 18px; border: 3px solid var(--gold); }
#cropbox i[data-h="nw"] { left: -3px; top: -3px; border-right: 0; border-bottom: 0; cursor: nwse-resize; }
#cropbox i[data-h="ne"] { right: -3px; top: -3px; border-left: 0; border-bottom: 0; cursor: nesw-resize; }
#cropbox i[data-h="sw"] { left: -3px; bottom: -3px; border-right: 0; border-top: 0; cursor: nesw-resize; }
#cropbox i[data-h="se"] { right: -3px; bottom: -3px; border-left: 0; border-top: 0; cursor: nwse-resize; }

#side {
  width: 344px; flex: none; background: var(--panel); border-left: 1px solid var(--line); display: flex;
  flex-direction: column; min-height: 0;
}
#hist { width: 100%; height: 84px; background: #07050b; display: block; flex: none; }
#meta { padding: 6px 14px; min-height: 28px; border-bottom: 1px solid var(--line); flex: none; }
#tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 10px; border-bottom: 1px solid var(--line); flex: none; }
#tabs button {
  background: none; border: 0; border-radius: 8px; padding: 6px 9px; color: var(--sub); cursor: pointer; font-weight: 600;
}
#tabs button:hover { background: var(--hover); }
#tabs button.on { background: var(--red-soft); color: var(--red); }
#panel { flex: 1; overflow-y: auto; padding: 10px 14px 24px; scrollbar-width: thin; scrollbar-color: var(--track) transparent; }
#panel h3 { font-size: 11.5px; font-weight: 700; color: var(--sub); text-transform: uppercase; letter-spacing: .06em; margin: 18px 0 6px; }
#panel h3:first-child { margin-top: 4px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.slider { margin: 7px 0; }
.slider .lab { display: flex; justify-content: space-between; cursor: default; }
.slider .lab b { font-weight: 600; }
.slider .lab span { color: var(--sub); font-variant-numeric: tabular-nums; }
.slider.changed .lab span { color: var(--gold); }
input[type=range] { width: 100%; height: 22px; margin: 0; background: none; accent-color: var(--red); cursor: pointer; }
.swatches { display: flex; gap: 6px; margin: 8px 0; }
.swatches button { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.swatches button.on { border-color: var(--cream); }
select {
  background: var(--card); border: 1.5px solid var(--line); border-radius: 8px; padding: 6px 8px; width: 100%;
}
.presets { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.presets button {
  background: var(--card); border: 1.5px solid var(--line); border-radius: 8px; padding: 8px; text-align: left; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.presets button:hover { border-color: var(--red); }
.presets button.on { border-color: var(--gold); color: var(--gold); }
#curve { width: 100%; aspect-ratio: 1; background: #07050b; border: 1px solid var(--line); border-radius: 8px; touch-action: none; cursor: crosshair; }
.hint { color: var(--sub); font-size: 12px; margin: 8px 0; }
label.check { display: flex; gap: 8px; align-items: center; margin: 8px 0; cursor: pointer; }

dialog {
  background: var(--panel); color: var(--cream); border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px; width: 360px;
}
dialog::backdrop { background: rgba(7, 5, 11, .7); }
dialog h2 { font-size: 28px; margin-bottom: 12px; }
dialog label { display: block; margin: 12px 0; font-weight: 600; }
dialog .row { justify-content: flex-end; margin-top: 18px; }

@media (max-width: 760px) {
  main { flex-direction: column; }
  #side { width: auto; height: 46%; border-left: 0; border-top: 1px solid var(--line); }
  #hist { display: none; }
  .brand .by { display: none; }
}
