/* ===== D10 — ÁLBUM DE COLORIR (cartão no artigo, álbum, livro de colorir) ===== */
.coloring-reward, .coloring-album-page, .coloring-book {
  --cr-ink: var(--cy-ink, #24171a);
  --cr-muted: var(--cy-muted, #6b5a52);
  --cr-wine: var(--cy-wine, #7a2d3d);
  --cr-line: var(--cy-line2, #d8c6b0);
  --cr-paper: #fffaf1;
  --cr-sheet: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Cpath d='M14 10h92l-2 14 3 12-2 16 2 14-3 16 2 14-1 14H16l2-12-3-14 2-16-2-14 3-16-2-14z' fill='%23fffdf7' stroke='%23d9c8b0' stroke-width='2'/%3E%3Cg fill='none' stroke='%23382c27' stroke-width='3' stroke-linejoin='round' stroke-linecap='round'%3E%3Cpath d='M60 30l8 17 19 2-14 13 4 19-17-9-17 9 4-19-14-13 19-2z'/%3E%3Ccircle cx='34' cy='88' r='7'/%3E%3Cpath d='M74 92c6-8 16-8 22 0'/%3E%3C/g%3E%3C/svg%3E");
  --cr-sheet-done: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Cpath d='M14 10h92l-2 14 3 12-2 16 2 14-3 16 2 14-1 14H16l2-12-3-14 2-16-2-14 3-16-2-14z' fill='%23fffdf7' stroke='%23d9c8b0' stroke-width='2'/%3E%3Cg stroke='%23382c27' stroke-width='3' stroke-linejoin='round' stroke-linecap='round'%3E%3Cpath d='M60 30l8 17 19 2-14 13 4 19-17-9-17 9 4-19-14-13 19-2z' fill='%23f2d35b'/%3E%3Ccircle cx='34' cy='88' r='7' fill='%23e8a0a8'/%3E%3Cpath d='M74 92c6-8 16-8 22 0' fill='none'/%3E%3C/g%3E%3C/svg%3E");
  --cr-crayon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 120'%3E%3Cpath d='M12 26h16v86H12z' fill='%23c8643b'/%3E%3Cpath d='M12 26l8-22 8 22z' fill='%23e98a5f'/%3E%3Cpath d='M17 12l3-8 3 8z' fill='%23382c27'/%3E%3Cpath d='M12 40h16v6H12zm0 50h16v6H12z' fill='%23fffaf1' opacity='.75'/%3E%3C/svg%3E");
  --cr-lock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 44'%3E%3Cpath d='M11 19v-6a9 9 0 0 1 18 0v6' fill='none' stroke='%237a2d3d' stroke-width='4'/%3E%3Crect x='6' y='18' width='28' height='22' rx='4' fill='%237a2d3d'/%3E%3Ccircle cx='20' cy='28' r='3.5' fill='%23fffaf1'/%3E%3C/svg%3E");
}

/* ---------- cartão no fim do artigo ---------- */
.coloring-reward {
  position: relative;
  display: grid;
  grid-template-columns: clamp(92px, 22%, 150px) minmax(0, 1fr);
  gap: clamp(14px, 2.4vw, 28px);
  align-items: center;
  margin: clamp(28px, 4vw, 44px) 0 clamp(22px, 3vw, 34px) !important;
  padding: clamp(18px, 2.6vw, 30px) clamp(16px, 2.6vw, 30px) !important;
  color: var(--cr-ink);
}
.coloring-reward-art { position: relative; aspect-ratio: 1; }
.coloring-reward-sheet, .coloring-empty-art .coloring-reward-sheet {
  position: absolute; inset: 4% 14% 4% 0;
  background: var(--cr-sheet) center / contain no-repeat;
  rotate: -4deg;
  filter: drop-shadow(0 6px 8px rgb(60 30 15 / 22%));
  transition: rotate .5s cubic-bezier(.2,.9,.3,1.3);
}
.coloring-reward-crayon {
  position: absolute; right: 2%; bottom: 0; width: 22%; height: 74%;
  background: var(--cr-crayon) center / contain no-repeat;
  rotate: 18deg; transform-origin: bottom center;
  filter: drop-shadow(0 4px 4px rgb(60 30 15 / 25%));
}
.coloring-reward-lock {
  position: absolute; left: 30%; top: 32%; width: 30%; aspect-ratio: 40 / 44;
  background: var(--cr-lock) center / contain no-repeat;
  filter: drop-shadow(0 3px 3px rgb(60 30 15 / 30%));
}
.coloring-reward-kicker, .coloring-eyebrow {
  display: inline-block;
  padding: 5px 12px 6px;
  margin-bottom: 10px;
  border: 0 solid transparent;
  border-image: var(--cy-paper-rose, none);
  background: color-mix(in srgb, #e8a0a8 45%, transparent);
  font: 500 14px/1 var(--cy-serif, Georgia, serif);
  color: #24171a;
}
.coloring-reward-title {
  margin: 0 0 6px !important;
  font: 800 clamp(21px, 2.3vw, 28px)/1.12 var(--cy-serif, Georgia, serif) !important;
  color: var(--cr-ink) !important;
  text-wrap: balance;
}
.coloring-reward-text { margin: 0 0 12px !important; font: 400 16px/1.5 var(--cy-sans, system-ui, sans-serif) !important; color: var(--cr-muted) !important; }
.coloring-reward-when { display: none; }
.coloring-reward[data-state="locked"] [data-when="locked"],
.coloring-reward[data-state="earned"] [data-when="earned"],
.coloring-reward[data-state="pending"] [data-when="pending"] { display: block; }
.coloring-reward:not([data-state="locked"]) .coloring-reward-lock { display: none; }
.coloring-reward:not([data-state="locked"]) .coloring-reward-sheet { background-image: var(--cr-sheet-done); rotate: 2deg; }
.coloring-reward.is-celebrating .coloring-reward-sheet { animation: coloring-pop .9s cubic-bezier(.2,.9,.3,1.4); }
@keyframes coloring-pop { 0% { scale: .7; rotate: -14deg; } 60% { scale: 1.08; } 100% { scale: 1; rotate: 2deg; } }

.coloring-reward-steps { list-style: none; margin: 4px 0 0 !important; padding: 0 !important; display: grid; gap: 8px; }
.coloring-reward-steps li {
  display: grid; grid-template-columns: 22px auto minmax(60px, 1fr); align-items: center; gap: 10px;
  margin: 0 !important; padding: 0 !important; font: 600 14px/1.2 var(--cy-sans, system-ui, sans-serif); color: var(--cr-ink);
}
.coloring-reward-steps li::before, .coloring-reward-steps li::marker { content: none; }
.coloring-step-check {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--cr-line); background: var(--cr-paper);
  display: grid; place-items: center;
}
.coloring-reward-steps li.is-done .coloring-step-check { background: #4f6b4a; border-color: #4f6b4a; }
.coloring-reward-steps li.is-done .coloring-step-check::after {
  content: ""; width: 9px; height: 5px; border: 2px solid #fffaf1; border-top: 0; border-right: 0; rotate: -45deg; translate: 0 -1px;
}
.coloring-step-bar { position: relative; height: 8px; border-radius: 6px; background: color-mix(in srgb, var(--cr-line) 60%, transparent); overflow: hidden; }
.coloring-step-bar i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: linear-gradient(90deg, #d9a441, #c8643b); transition: width .9s linear; }
.coloring-reward-note { min-height: 1.2em; margin: 8px 0 0 !important; font: 500 13px/1.3 var(--cy-sans, system-ui, sans-serif) !important; color: var(--cr-muted) !important; }
.coloring-reward-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.coloring-reward-link { font: 600 15px/1.2 var(--cy-sans, system-ui, sans-serif); color: var(--cr-ink); text-decoration-color: var(--cr-wine); text-decoration-thickness: 2px; text-underline-offset: 3px; }
@media (max-width: 520px) {
  .coloring-reward { grid-template-columns: 84px minmax(0, 1fr); align-items: start; }
  .coloring-reward-steps li { grid-template-columns: 20px minmax(0, 1fr); }
  .coloring-step-bar { grid-column: 2; }
}

.coloring-toast {
  position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom, 0px)); z-index: 120;
  translate: -50% 20px; opacity: 0;
  padding: 12px 18px; max-width: min(92vw, 420px);
  background: #fffaf1; color: #24171a; border: 1px solid #d9c8b0; border-radius: 3px;
  box-shadow: 0 10px 24px rgb(40 20 10 / 22%);
  font: 700 15px/1.3 var(--cy-sans, system-ui, sans-serif);
  transition: opacity .35s, translate .35s;
}
.coloring-toast::before { content: ""; display: inline-block; width: 1.1em; height: 1.1em; margin-right: .5em; vertical-align: -.2em; background: var(--cr-crayon, none) center / contain no-repeat; }
.coloring-toast.is-shown { opacity: 1; translate: -50% 0; }
@media (min-width: 900px) { .coloring-toast { bottom: 28px; } }

/* ---------- álbum ---------- */
.coloring-album-page { padding: clamp(22px, 3vw, 44px) 0 clamp(40px, 5vw, 72px); color: var(--cr-ink); }
.coloring-album-head { padding: clamp(22px, 3vw, 40px) !important; margin-bottom: clamp(24px, 3vw, 40px); }
.coloring-album-head h1 { margin: 4px 0 10px !important; font: 900 clamp(34px, 4.4vw, 56px)/1 var(--cy-serif, Georgia, serif) !important; color: var(--cr-ink) !important; }
.coloring-album-head p { max-width: 46ch; margin: 0 0 14px !important; font: 400 17px/1.55 var(--cy-sans, system-ui, sans-serif) !important; color: var(--cr-muted) !important; }
.coloring-album-count { font: 700 15px/1 var(--cy-sans, system-ui, sans-serif); color: var(--cr-wine); }

.coloring-empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: clamp(28px, 4vw, 56px) clamp(18px, 3vw, 40px) !important; }
.coloring-empty-art { position: relative; width: min(190px, 52vw); aspect-ratio: 1; margin-bottom: 6px; }
.coloring-empty h2 { margin: 0 !important; font: 800 clamp(24px, 2.6vw, 32px)/1.1 var(--cy-serif, Georgia, serif) !important; color: var(--cr-ink) !important; }
.coloring-empty p { max-width: 40ch; margin: 0 0 8px !important; font: 400 16px/1.5 var(--cy-sans, system-ui, sans-serif) !important; color: var(--cr-muted) !important; }

.coloring-grid { list-style: none; margin: 0 !important; padding: 0 !important; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: clamp(22px, 2.6vw, 36px); }
.coloring-card { margin: 0 !important; padding: 0 !important; }
.coloring-card::marker { content: none; }
.coloring-card:nth-child(odd) .coloring-card-sheet { rotate: -1.2deg; }
.coloring-card:nth-child(even) .coloring-card-sheet { rotate: 1deg; }
.coloring-card-link { display: grid; gap: 12px; color: inherit; text-decoration: none; }
.coloring-card-sheet {
  position: relative; display: block; width: 100%;
  background: #fffdf7; border: 1px solid #e3d5c1;
  box-shadow: 0 10px 18px rgb(60 30 15 / 16%);
  transition: rotate .4s, translate .4s;
}
.coloring-card-sheet::before {
  content: ""; position: absolute; left: 50%; top: -9px; z-index: 2; width: 74px; height: 18px; translate: -50% 0; rotate: -4deg;
  background: linear-gradient(95deg, #e6cd91bf, #f0dba5ed 55%, #dbc28bbf);
  clip-path: polygon(2% 0,100% 3%,97% 44%,100% 91%,1% 100%,3% 55%);
}
.coloring-card-link:hover .coloring-card-sheet, .coloring-card-link:focus-visible .coloring-card-sheet { rotate: 0deg; translate: 0 -4px; }
.coloring-card-sheet img { position: absolute; inset: 6%; width: 88%; height: 88%; object-fit: contain; }
.coloring-card-paint { mix-blend-mode: multiply; }
.coloring-card-body { display: grid; gap: 6px; }
.coloring-card-status { justify-self: start; padding: 4px 10px; font: 700 12px/1 var(--cy-sans, system-ui, sans-serif); letter-spacing: .02em; text-transform: uppercase; border-radius: 2px; }
.coloring-card-status.is-new { background: #f2d35b; color: #3b2a10; }
.coloring-card-status.is-painted { background: #4f6b4a; color: #fffaf1; }
.coloring-card-title { font: 800 19px/1.15 var(--cy-serif, Georgia, serif); color: var(--cr-ink); text-wrap: balance; }
.coloring-card-link:hover .coloring-card-title { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .14em; }
.coloring-card-date { font: 500 13px/1.3 var(--cy-sans, system-ui, sans-serif); color: var(--cr-muted); }

/* ---------- livro de colorir ---------- */
.coloring-book { padding: clamp(18px, 2.6vw, 36px) 0 clamp(40px, 5vw, 70px); color: var(--cr-ink); }
.coloring-book-head { display: grid; gap: 6px; margin-bottom: clamp(16px, 2.2vw, 26px); }
.coloring-back, .coloring-reread { justify-self: start; font: 600 15px/1.3 var(--cy-sans, system-ui, sans-serif); color: var(--cr-ink); text-decoration-color: var(--cr-wine); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.coloring-book-head h1 { margin: 2px 0 4px !important; font: 900 clamp(26px, 3.4vw, 42px)/1.05 var(--cy-serif, Georgia, serif) !important; color: var(--cr-ink) !important; text-wrap: balance; }
.coloring-book-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 320px); gap: clamp(16px, 2.4vw, 30px); align-items: start; }
.coloring-stage { padding: clamp(10px, 1.6vw, 18px) !important; }
.coloring-canvas-wrap { position: relative; width: 100%; max-height: 78vh; margin: 0 auto; background: #fff; box-shadow: inset 0 0 0 1px #eadfce; touch-action: none; user-select: none; -webkit-user-select: none; }
.coloring-canvas-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.coloring-paint { cursor: crosshair; }
.coloring-book[data-tool="fill"] .coloring-paint, .coloring-book:not([data-tool]) .coloring-paint {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Cpath d='M5 13l8-8 9 9-8 8z' fill='%23fffaf1' stroke='%23382c27' stroke-width='2'/%3E%3Cpath d='M22 16c2 3 3 5 1 6s-3-2-1-6z' fill='%23c8643b'/%3E%3C/svg%3E") 22 22, crosshair;
}
.coloring-lines { pointer-events: none; }
.coloring-status { min-height: 1.3em; margin: 10px 2px 0 !important; font: 500 14px/1.35 var(--cy-sans, system-ui, sans-serif) !important; color: var(--cr-muted) !important; }
.coloring-tools { display: grid; gap: 16px; padding: 16px !important; position: sticky; top: 110px; }
.coloring-tool-group { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.coloring-tool, .coloring-action {
  all: unset; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 6px 10px; cursor: pointer; text-align: center;
  font: 600 14px/1.15 var(--cy-sans, system-ui, sans-serif); color: var(--cr-ink);
  background: #fffaf1; border: 1.5px solid #d9c8b0; border-radius: 3px;
  box-shadow: 0 2px 0 #d9c8b0;
}
.coloring-tool { flex-direction: column; }
.coloring-tool.is-active { background: #24171a; color: #fffaf1; border-color: #24171a; box-shadow: 0 2px 0 #000; }
.coloring-tool:focus-visible, .coloring-action:focus-visible, .coloring-swatch:focus-visible { outline: 3px solid #d9a441; outline-offset: 2px; }
.coloring-tool-ic { width: 22px; height: 22px; background: currentColor; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.ic-fill { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 11l8-8 9 9-8 8z' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'/%3E%3Cpath d='M20 15c2 3 2.5 5 .5 5.5S18 18 20 15z'/%3E%3C/svg%3E"); }
.ic-brush { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 20l2-6L16 4l4 4L10 18z' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'/%3E%3Cpath d='M4 20l2-6 4 4z'/%3E%3C/svg%3E"); }
.ic-eraser { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 15l9-9 7 7-6 6H8z' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'/%3E%3Cpath d='M3 15l5-5 7 7-2 2H8z'/%3E%3Cpath d='M13 20h8' stroke='black' stroke-width='2'/%3E%3C/svg%3E"); }
.coloring-size { display: grid; gap: 6px; font: 600 14px/1 var(--cy-sans, system-ui, sans-serif); }
.coloring-size input { width: 100%; accent-color: #c8643b; }
.coloring-book[data-tool="fill"] .coloring-size, .coloring-book:not([data-tool]) .coloring-size { opacity: .45; }
.coloring-palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 8px; }
.coloring-swatch {
  all: unset; box-sizing: border-box; position: relative; aspect-ratio: 1; min-width: 34px; cursor: pointer;
  background: var(--swatch, #fff); border-radius: 50% 46% 52% 44%;
  box-shadow: inset 0 0 0 1.5px rgb(0 0 0 / 18%), 0 2px 3px rgb(60 30 15 / 18%);
}
.coloring-swatch.is-active { box-shadow: 0 0 0 3px #fffaf1, 0 0 0 5px #24171a; }
/* D10b — every button wears the site's paper (paper-buttons layer), so the colour is a dab of paint on that paper. */
.coloring-swatch-paint {
  position: absolute; inset: 15%; pointer-events: none;
  background: var(--swatch, #fff); border-radius: 50% 44% 52% 46% / 46% 52% 44% 50%;
  box-shadow: inset 0 0 0 1.5px rgb(0 0 0 / 22%), 0 1px 2px rgb(60 30 15 / 25%);
}
.coloring-swatch.is-active .coloring-swatch-paint { inset: 10%; }
.coloring-custom { background: conic-gradient(#c8643b, #f2d35b, #8fa98b, #5b7fa6, #a493c4, #e8a0a8, #c8643b); overflow: hidden; }
.coloring-custom input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.coloring-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.coloring-action[disabled] { opacity: .45; cursor: default; }
.coloring-action.is-primary { background: var(--cr-wine); color: #fffaf1; border-color: var(--cr-wine); box-shadow: 0 2px 0 #4f1d28; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@media (max-width: 899px) {
  .coloring-book-body { grid-template-columns: minmax(0, 1fr); }
  .coloring-tools { position: static; }
  .coloring-canvas-wrap { max-height: none; }
}
@media (max-width: 520px) {
  .coloring-tools { padding: 12px !important; gap: 12px; }
  .coloring-palette { grid-template-columns: repeat(7, 1fr); gap: 7px; }
  .coloring-swatch { min-width: 0; }
  .coloring-actions { grid-template-columns: repeat(4, 1fr); }
  .coloring-action { padding: 6px 4px; font-size: 13px; }
}

/* Luz apagada: the drawing itself stays on white paper. */
body.dark .coloring-reward-text, body.dark .coloring-album-head p, body.dark .coloring-card-date { color: #cdbfb5 !important; }
body.dark .coloring-reward-title, body.dark .coloring-album-head h1, body.dark .coloring-card-title, body.dark .coloring-book-head h1,
body.dark .coloring-empty h2, body.dark .coloring-reward-steps li, body.dark .coloring-back, body.dark .coloring-reread, body.dark .coloring-reward-link { color: #f6ede4 !important; }
/* ===== FIM D10 ===== */
