/* My Doodle World colour-in screen: full screen, big touch targets. Uses the tokens in site.css. */
.cz-body { margin: 0; height: 100dvh; overflow: hidden; overscroll-behavior: none; }
.cz { display: grid; height: 100dvh; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "top top" "view tools"; }
.cz__top { grid-area: top; display: flex; align-items: center; gap: var(--sp-1) var(--sp-2); flex-wrap: wrap; padding: 0.5rem max(0.75rem, env(safe-area-inset-right)) 0.5rem max(0.75rem, env(safe-area-inset-left)); border-bottom: var(--stroke) solid var(--ink); background: var(--paper) url("/assets/img/paper.png"); }
.cz__title { font-family: var(--font-display); font-weight: 600; font-size: var(--s-large); line-height: 1.15; flex: 1 1 12rem; margin: 0; }
.cz__status { font-weight: 800; font-size: var(--s-small); min-width: 8ch; }
.cz__actions { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.cz__btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem; min-width: 48px; min-height: 48px; padding: 0 0.7rem; border: var(--stroke) solid var(--ink); border-radius: 14px; background: var(--sheet); font-weight: 800; font-size: var(--s-small); text-decoration: none; cursor: pointer; touch-action: manipulation; }
.cz__btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.cz__btn:disabled { opacity: 0.55; cursor: default; }
.cz__btn--round { border-radius: 50%; padding: 0; }
.cz__done { min-height: 52px; }
.cz__viewport { grid-area: view; position: relative; overflow: hidden; touch-action: none; background: #ebe7e0 url("/assets/img/paper.png"); user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.cz[data-tool="crayon"] .cz__viewport, .cz[data-tool="eraser"] .cz__viewport { cursor: crosshair; }
.cz[data-tool="fill"] .cz__viewport { cursor: cell; }
.cz__stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; background: #fff; border: 2px solid var(--ink); }
.cz__colour, .cz__line { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cz__line { mix-blend-mode: multiply; pointer-events: none; }
.cz__zoom { position: absolute; right: 0.75rem; bottom: max(0.75rem, env(safe-area-inset-bottom)); display: grid; gap: 0.4rem; }
.cz__zoom--row { grid-auto-flow: column; bottom: 0.6rem; }
.cz__tools { grid-area: tools; display: flex; flex-direction: column; gap: var(--sp-2); padding: 0.75rem max(0.75rem, env(safe-area-inset-right)) 0.75rem 0.75rem; border-left: var(--stroke) solid var(--ink); background: var(--paper) url("/assets/img/paper.png"); overflow-y: auto; width: 13.5rem; }
.cz__toolset { display: grid; gap: 0.4rem; }
.cz__tool { display: flex; align-items: center; gap: 0.6rem; min-height: 56px; padding: 0 0.8rem; border: var(--stroke) solid var(--ink); border-radius: 14px; background: var(--sheet); font-weight: 800; cursor: pointer; touch-action: manipulation; }
.cz__tool svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.cz__tool[aria-pressed="true"] { background: var(--yellow); }
.cz__sizes { display: flex; gap: 0.4rem; }
.cz__size { flex: 1; display: grid; place-items: center; min-height: 52px; border: var(--stroke) solid var(--ink); border-radius: 14px; background: var(--sheet); cursor: pointer; touch-action: manipulation; }
.cz__size i { display: block; width: var(--d); height: var(--d); border-radius: 50%; background: var(--ink); }
.cz__size[aria-pressed="true"] { background: var(--yellow); }
.cz__palette { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.45rem; }
.cz__swatch { aspect-ratio: 1; min-width: 44px; min-height: 44px; border: var(--stroke) solid var(--ink); border-radius: 50% 46% 52% 48%; background: var(--sw); cursor: pointer; touch-action: manipulation; }
.cz__swatch[aria-pressed="true"] { outline: 4px solid var(--ink); outline-offset: 3px; }
.cz__cheer { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: var(--sp-3); background: rgba(26, 26, 26, 0.45); }
.cz__cheer[hidden] { display: none; }
.cz__cheer-card { background: var(--sheet); padding: var(--sp-4); display: grid; gap: var(--sp-2); justify-items: center; text-align: center; max-width: 26rem; }
.cz__cheer-dood { width: 120px; height: auto; }
.cz__cheer-title { font-family: var(--font-display); font-size: calc(var(--s-large) * 1.5); font-weight: 600; }
.cz__cheer-title:focus { outline: none; }
.cz__cheer-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); justify-content: center; }
.cz__sticker { display: grid; justify-items: center; gap: 0.3rem; font-weight: 800; }
.cz__sticker-badge { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; border: var(--stroke) solid var(--ink); background: var(--yellow); font-size: 2.6rem; }
@media (prefers-reduced-motion: no-preference) {
  .cz__cheer.is-party .cz__cheer-dood { animation: cz-jump 0.7s var(--ease-out) 2; transform-origin: 50% 100%; }
  .cz__cheer.is-party .cz__sticker-badge { animation: cz-pop 0.5s var(--ease-out); }
  @keyframes cz-jump { 40% { transform: translateY(-14px) rotate(-4deg); } }
  @keyframes cz-pop { from { transform: scale(0.4); } }
}
.cz__print { display: none; }

/* phones: tools under the page; tools and sizes on one row, the crayons on a scrolling row beneath */
@media (max-width: 760px), (max-height: 520px) and (orientation: landscape) and (max-width: 960px) {
  .cz { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "top" "view" "tools"; }
  .cz__top { flex-wrap: nowrap; gap: 0.35rem; }
  .cz__title, .cz__status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .cz__actions { flex-wrap: nowrap; gap: 0.35rem; margin-left: auto; }
  .cz__btn span { display: none; }
  .cz__btn { min-width: 46px; padding: 0 0.5rem; }
  .cz__done { min-height: 46px; padding-inline: 0.8em; font-size: var(--s-small); }
  .cz__tools { width: auto; display: grid; grid-template-columns: auto auto; gap: 0.5rem; border-left: 0; border-top: var(--stroke) solid var(--ink); padding: 0.5rem 0.75rem max(0.6rem, env(safe-area-inset-bottom)); overflow: visible; justify-content: start; }
  .cz__toolset { grid-auto-flow: column; gap: 0.35rem; }
  .cz__tool span { display: none; }
  .cz__tool { justify-content: center; min-width: 50px; min-height: 50px; padding: 0; }
  .cz__sizes { gap: 0.35rem; }
  .cz__size { min-width: 46px; min-height: 50px; }
  .cz__palette { grid-column: 1 / -1; display: flex; gap: 0.45rem; overflow-x: auto; padding: 0.55rem; scrollbar-width: none; }
  .cz__swatch { flex: none; width: 46px; height: 46px; }
}

@media print {
  .cz-body { height: auto; overflow: visible; background: #fff; }
  .cz > *:not(.cz__print) { display: none !important; }
  .cz { display: block; height: auto; }
  .cz__print { display: block; width: 100%; height: auto; max-height: 100vh; object-fit: contain; }
}

/* ---------- /colour: the page picker */
.ci-hero { position: relative; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--sp-5); align-items: center; margin-bottom: var(--sp-5); }
.ci-hero__text { display: grid; gap: var(--sp-3); justify-items: start; }
.ci-hero__title { font-size: clamp(2.6rem, 7vw, 6.6rem); }
.ci-hero__sheet { position: relative; display: block; background: var(--sheet); padding: var(--sp-3); transform: rotate(2deg); isolation: isolate; }
.ci-hero__sheet img { width: 100%; height: auto; }
.ci-hero__wash { position: absolute; inset: 12% 8% 18% 10%; z-index: -1; background: url("/assets/img/swash-yellow.webp") center / cover no-repeat, url("/assets/img/swash-red.webp") 30% 70% / 80% no-repeat; opacity: 0.85; }
.ci-hero__dood { position: absolute; right: -0.5rem; bottom: -2.5rem; width: 92px; height: auto; transform: rotate(-8deg); }
.ci-theme { margin-top: var(--sp-6); }
.ci-theme__title { font-family: var(--font-display); font-size: calc(var(--s-large) * 1.4); font-weight: 600; margin-bottom: var(--sp-2); }
.ci-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-3); }
.ci-tile { position: relative; display: grid; gap: 0.4rem; background: var(--sheet); padding: 0.6rem; text-decoration: none; height: 100%; }
.ci-tile img { width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: contain; background: #fff; }
.ci-tile__name { font-weight: 800; font-size: var(--s-small); }
.ci-tag { position: absolute; top: 0.4rem; left: 0.4rem; background: var(--sheet); border: var(--stroke) solid var(--ink); border-radius: 999px; padding: 0.05rem 0.6rem; font-weight: 800; font-size: var(--s-small); }
.ci-tag--free { background: var(--yellow); }
.ci-more { margin-top: var(--sp-2); }
.ci-club { margin-top: var(--sp-6); }
.ci-peek img { width: 100%; height: auto; }
@media (hover: hover) and (pointer: fine) { .ci-tile { transition: transform var(--t-hover) var(--ease-out); } .ci-tile:hover { transform: rotate(-1deg) translateY(-3px); } }
@media (prefers-reduced-motion: no-preference) {
  .ci-hero__sheet { animation: ci-drop 700ms var(--ease-out) both; }
  .ci-hero__dood { animation: ci-pop 600ms 300ms var(--ease-out) both; }
  @keyframes ci-drop { from { opacity: 0; transform: rotate(8deg) translateY(-24px); } }
  @keyframes ci-pop { from { opacity: 0; transform: rotate(-30deg) scale(0.6); } }
}
@media (max-width: 760px) {
  .ci-hero { grid-template-columns: 1fr; gap: var(--sp-4); }
  .ci-hero__sheet { width: 78%; justify-self: center; }
  .ci-hero__dood { width: 70px; bottom: -1.5rem; right: 0.5rem; }
  .ci-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); }
}
@media (prefers-reduced-motion: no-preference) {
  .ci-motion .ci-reveal { opacity: 0; transform: translateY(26px) rotate(-1deg); transition: opacity 600ms var(--ease-out), transform 800ms var(--ease-expo); transition-delay: var(--d, 0ms); }
  .ci-motion .ci-reveal.is-in { opacity: 1; transform: none; }
}
