body[data-view="mysteryCrayons"] {
  background: radial-gradient(ellipse at 68% 5%, #8663a2, #56396f 48%, #321e4d 100%);
}
.mc-page {max-width:1180px;margin:auto;padding:clamp(14px,3.5vw,42px)}
.mc-back {margin-block-end:clamp(12px,2vw,24px)}
.mc-workspace {position:relative;display:grid;justify-items:center}
.mc-heading {width:100%;margin:0 0 16px;color:#fff8e6;text-align:center}
.mc-heading h1 {margin:0;font-family:Georgia,serif;font-size:clamp(27px,5vw,48px);line-height:1.08}
.mc-heading p {margin:7px 0 0;color:#f5e8f6;font-size:clamp(14px,2.2vw,18px);line-height:1.35}
.mc-studio {
  width:min(100%,clamp(420px,calc((100dvh - 355px) * 1.25),780px));
  display:grid;
  gap:clamp(10px,2.2vw,18px);
}
.mc-paper-frame {
  box-sizing:border-box;
  padding:clamp(7px,1.5vw,16px);
  border:1px solid #fff5db70;
  border-radius:clamp(16px,3vw,30px);
  background:linear-gradient(145deg,#fae5bd,#d8ad8d 49%,#f3d5ab);
  box-shadow:0 9px 0 #2d184a5c,0 15px 30px #21123146,inset 0 1px #fff7e5;
}
.mc-heading [data-collection] {position:absolute;right:0;top:-69px}
.mc-sheet {
  position:relative;
  width:100%;
  aspect-ratio:5/4;
  overflow:hidden;
  border-radius:clamp(10px,1.7vw,17px);
  background:#fffdf6;
  box-shadow:0 3px 10px #6f3e4b44;
  isolation:isolate;
}
.mc-sheet canvas {position:absolute;inset:0;width:100%;height:100%;display:block}
.mc-ink {touch-action:none;cursor:crosshair}
.mc-sheet .mc-color {pointer-events:none;clip-path:inset(0 100% 0 0);visibility:hidden}
.mc-sheet.is-revealed .mc-ink {visibility:hidden;transition:visibility 0s linear .9s}
.mc-sheet.is-revealed .mc-color {
  visibility:visible;
  clip-path:inset(0);
  background:#fffdf6;
  transition:clip-path .9s cubic-bezier(.27,.69,.29,1);
}
.mc-sheet::after {
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:linear-gradient(105deg,transparent 36%,#fff8dbad 48%,#ffffffef 50%,transparent 64%);
  opacity:0;
}
.mc-sheet.is-revealed::after {animation:mc-reveal-light .9s ease-out both}
@keyframes mc-reveal-light {
  0% {transform:translateX(-95%);opacity:0}
  20% {opacity:1}
  100% {transform:translateX(95%);opacity:0}
}
.mc-controls {display:grid;gap:10px}
.mc-tools {display:flex;justify-content:center;align-items:stretch;gap:7px;flex-wrap:wrap}
.mc-sizes {display:flex;gap:6px}
.mc-controls .mc-size {
  display:grid;grid-template-rows:1fr;place-items:center;min-width:46px;min-height:54px;padding-inline:8px;
}
.mc-size i {width:var(--ink-size);height:var(--ink-size);max-width:23px;max-height:23px;border-radius:50%;background:#f5d795}
.mc-tools [aria-pressed="true"] {outline:2px solid #f4d78f;outline-offset:-4px}
.mc-tools [aria-pressed="true"]:focus-visible {outline-offset:3px}
.mc-tools > .ui-picture-button {min-width:75px;min-height:64px;grid-template-rows:26px 16px;padding:6px 9px}
.mc-tools > .ui-picture-button .navicon {height:26px}
.mc-controls .mc-done {display:flex;align-items:center;justify-content:center;gap:10px;font-size:clamp(22px,3vw,32px);font-weight:800;min-height:64px}
.mc-done .navicon .ui-icon {width:1em;height:1em}
.mc-result {display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:9px}
.mc-result .ui-picture-button {min-width:0}
.mc-heading .game-action-art {width:36px;height:33px}
.mc-controls [hidden] {display:none}
.mc-status {margin:0;text-align:center;color:#fff2ce;font-weight:800}
.mc-status:empty {display:none}
.mc-gallery {display:grid;grid-template-columns:repeat(auto-fill,minmax(min(120px,100%),1fr));gap:12px}
.mc-gallery-card {padding:4px;border:1px solid #d9c0dd;border-radius:14px;background:#efe6f1;color:#4d2e65;font:inherit;cursor:pointer}
.mc-gallery-card:focus-visible {outline:3px solid #754291;outline-offset:3px}
.mc-gallery-card img {display:block;width:100%;aspect-ratio:5/4;border-radius:10px}
.mc-gallery-card span {display:block;padding:.4rem}
.mc-gallery-detail {display:grid;grid-template-columns:minmax(0,1fr)}
.mc-gallery-full {width:100%;max-height:54dvh;object-fit:contain}
.mc-gallery-actions {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;border-radius:16px;background:#52386c;padding:9px}
.mc-gallery-actions .ui-picture-button {min-width:0;padding-inline:5px}
.mc-collection > header .ui-picture-button {min-height:58px;grid-template-rows:24px 14px}
.mc-collection > header .navicon {height:24px}
@media (max-width:520px) {
  .mc-page {padding-inline:12px}
  .mc-heading {margin-bottom:11px}
  .mc-studio {width:100%;gap:9px}
  .mc-tools {gap:5px}
  .mc-result {gap:5px}
  :is(.mc-result,.mc-gallery-actions) .ui-picture-button {
    min-height:52px;
    grid-template-rows:24px auto;
    padding:4px 3px;
    gap:3px;
    font-size:clamp(9px,2.8vw,12px);
  }
  :is(.mc-result,.mc-gallery-actions) .ui-picture-button > span:last-child {white-space:nowrap}
  :is(.mc-result,.mc-gallery-actions) .ui-picture-button .navicon {width:27px;height:24px}
  :is(.mc-result,.mc-gallery-actions) .game-action-art {width:30px;height:27px}
  .mc-result .ui-icon {width:21px;height:21px}
  .mc-controls .mc-size {min-width:44px}
  .mc-heading [data-collection] {min-height:56px;grid-template-rows:20px 14px;top:-57px}
  .mc-heading [data-collection] .navicon {height:20px}
  .mc-heading .game-action-art {width:30px;height:27px}
}
@media (prefers-reduced-motion:reduce) {
  .mc-sheet.is-revealed .mc-ink,.mc-sheet.is-revealed .mc-color {transition:none}
  .mc-sheet.is-revealed::after {animation:none}
}

/* Tablet + computer: paper beside the tools, sized so everything fits on one screen. */
@media (min-width:700px) and (orientation:landscape) {
  .mc-page {padding-block:clamp(10px,2vh,24px)}
  .mc-back {margin-block-end:8px}
  .mc-heading {margin-bottom:12px}
  .mc-heading h1 {font-size:clamp(28px,4.2vh,44px)}
  .mc-heading p {margin-top:4px}
  .mc-heading [data-collection] {top:-62px}
  .mc-studio {
    width:100%;
    grid-template-columns:minmax(0,max-content) 172px;
    justify-content:center;
    align-items:center;
    gap:clamp(14px,2.4vw,28px);
  }
  .mc-paper-frame {width:min(calc(100vw - 260px),860px,calc((var(--mc-avail-h,620px) - 34px) * 1.25 + 34px))}
  .mc-controls {width:172px;align-content:center;gap:12px}
  .mc-tools {gap:8px}
  .mc-sizes {width:100%;justify-content:space-between}
  .mc-controls .mc-size {flex:1;min-width:0;min-height:58px}
  .mc-tools > .ui-picture-button {flex:1;min-width:0}
  .mc-controls .mc-done {min-height:84px;font-size:28px}
  .mc-result {grid-auto-flow:row;grid-auto-columns:auto}
  .mc-result .ui-picture-button {min-height:60px}
}

/* Tablet portrait: paper on top, tools underneath, all on one screen. */
@media (min-width:600px) and (orientation:portrait) {
  .mc-back {margin-block-end:8px}
  .mc-heading {margin-bottom:12px}
  .mc-studio {width:100%;justify-items:center}
  .mc-paper-frame {width:min(100%,760px,calc((var(--mc-avail-h,900px) - 200px - 34px) * 1.25 + 34px))}
  .mc-controls {width:min(100%,560px)}
  .mc-tools > .ui-picture-button {min-width:96px}
  .mc-controls .mc-size {min-width:58px;min-height:64px}
}
