/* app.css — Doodle. One canvas, six copies. */

:root {
  --sux-bg: #101014;
  --sux-fg: #f4f2ec;
  --sux-accent: #F06AAE;
  --muted: #a8a49b;
  --line: #2b2b31;
  color-scheme: dark light;
  --on-accent: #08130d;
  --line-strong: #3a3a41;
  --sheet: color-mix(in srgb, var(--sux-fg) 3%, var(--sux-bg));
  --card: #16161b;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --dialog-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

@media (prefers-color-scheme: light) {
  :root {
    --sux-bg: #f6f3ec;
    --sux-fg: #17171a;
    --muted: #55524c;
    --line: #ded8cc;
    --on-accent: #08130d;
    --line-strong: #cfc7b8;
    --sheet: #fdfbf6;
    --card: #fffdf8;
    --shadow: 0 10px 30px rgba(90, 55, 35, 0.12);
    --dialog-shadow: 0 24px 60px rgba(90, 55, 35, 0.28);
  }
}

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

body {
  margin: 0;
  min-height: 100svh;
  padding-block-start: var(--sux-shell-h, 0);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  background: var(--sux-bg);
  color: var(--sux-fg);
  font: 400 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

main {
  flex: 1;
  width: min(48rem, 100% - 2.5rem);
  margin: 0 auto;
  padding-block: 1.5rem 2rem;
}

h1 {
  margin: 0 0 0.25rem;
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  line-height: 1.05;
}

.job {
  margin: 0 0 0.9rem;
  color: var(--muted);
}

.intro {
  margin: 0 0 1.2rem;
  max-width: 40rem;
  font-size: 0.97rem;
  color: var(--muted);
}

.pad-wrap {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: color-mix(in srgb, var(--sux-accent) 6%, transparent);
}

#pad {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 62svh;
  touch-action: none;
  cursor: crosshair;
}

.cursor {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 13px;
  height: 13px;
  margin: 0;
  translate: -50% -50%;
  border: 2px solid var(--sux-accent);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
}

.pad-wrap:focus-within .cursor,
.pad-wrap:focus .cursor {
  opacity: 1;
}

.pad-wrap:focus-visible {
  outline: 2px solid var(--sux-accent);
  outline-offset: 3px;
}

.status {
  margin: 0.7rem 0 1rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
  min-height: 1.4em;
}

.tools {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  align-items: start;
  margin-block-end: 1.1rem;
}

.group {
  min-width: 0;
  margin: 0;
  padding: 0.7rem 0.9rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 14px;
}

fieldset.group {
  border-color: var(--line);
}

legend,
.group > label {
  padding-inline: 0.2rem;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-block-start: 0.5rem;
}

.swatch {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, #000 12%, transparent);
  cursor: pointer;
}

.swatch[data-colour="#E4572E"] { --swatch: #E4572E; }
.swatch[data-colour="#F2B134"] { --swatch: #F2B134; }
.swatch[data-colour="#5FC9A8"] { --swatch: #5FC9A8; }
.swatch[data-colour="#4C9AFF"] { --swatch: #4C9AFF; }
.swatch[data-colour="#9B8CFF"] { --swatch: #9B8CFF; }
.swatch[data-colour="#F06AAE"] { --swatch: #F06AAE; }

.swatch[aria-pressed="true"] {
  border-color: var(--sux-fg);
  box-shadow: inset 0 0 0 2px var(--sux-bg);
}

.width-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-block-start: 0.5rem;
}

input[type="range"] {
  flex: 1;
  min-height: 44px;
  accent-color: var(--sux-accent);
}

#width-out {
  min-width: 3.2rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.segments {
  display: flex;
  gap: 0.4rem;
  margin-block-start: 0.5rem;
}

.segments button {
  flex: 1;
  min-width: 44px;
}

button {
  min-width: 44px;
  min-height: 44px;
  padding: 0 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

button:hover {
  border-color: var(--sux-accent);
}

button[aria-pressed="true"] {
  border-color: var(--sux-accent);
  box-shadow: inset 0 0 0 1px var(--sux-accent);
}

.actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  padding: 0.7rem 0.9rem;
}

.actions button {
  flex: 1;
}

#save {
  border-color: var(--sux-accent);
  background: color-mix(in srgb, var(--sux-accent) 14%, transparent);
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 40rem;
}

a {
  color: inherit;
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 2px solid var(--sux-accent);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  inset-inline-start: -999px;
}
.skip:focus {
  inset-inline-start: 1rem;
  inset-block-start: calc(var(--sux-shell-h, 0px) + 1rem);
  z-index: 2;
  padding: 0.6rem 1rem;
  background: var(--sux-fg);
  color: var(--sux-bg);
  border-radius: 8px;
}

footer {
  width: min(48rem, 100% - 2.5rem);
  margin: 0 auto;
  padding-block: 1.25rem 2rem;
  border-block-start: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

footer p {
  margin: 0 0 0.35rem;
}

@media (max-width: 30rem) {
  .tools {
    grid-template-columns: 1fr;
  }

  .intro {
    font-size: 0.94rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ---- About panel (the suite-wide pattern; see template/app/app.css). ---- */
dialog.about {
  display: block;
  width: min(46rem, 100% - 2.5rem);
  margin: 0 auto;
  padding: 1.1rem 1.4rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--sheet);
  color: var(--sux-fg);
}

dialog.about .intro,
dialog.about .hint {
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 40rem;
  margin: 0 0 0.9rem;
}

.about-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 0.9rem;
}

.about-head h2 {
  margin: 0;
  font-size: 1.1rem;
  letter-spacing: 0.01em;
}

dialog.about .close {
  display: none;
  min-width: 44px;
  min-height: 44px;
  padding: 0 0.9rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.85rem;
}

dialog.about .close:hover {
  color: var(--sux-fg);
}

.about-body h3 {
  margin: 1.1rem 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.about-body h3 + .hint {
  margin-block-start: 0;
}

/* Scripts running: the panel becomes a modal behind the About button. */
.js dialog.about:not([open]) {
  display: none;
}

.js dialog.about .close {
  display: inline-block;
}

.js dialog.about {
  max-width: min(40rem, calc(100% - 2rem));
  max-height: min(24rem, 80svh);
  overflow: auto;
}

.js dialog.about::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.about-body a {
  color: var(--sux-accent);
  text-decoration-color: color-mix(in srgb, var(--sux-accent) 55%, transparent);
}

.about-btn {
  min-width: 44px;
  min-height: 44px;
  padding: 0 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.about-btn:hover {
  border-color: var(--line-strong);
  background: color-mix(in srgb, var(--sux-fg) 6%, transparent);
  color: var(--sux-fg);
}
