/* 上色頁（疊在官網 style.css 上面）。紙放在夜空桌面上，顏色是一顆顆黏土球。 */
.c-hero { padding: .25rem 0 0; }
.c-hero .hero-grid { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 56.25rem) { .c-hero .hero-grid { grid-template-columns: minmax(0, 1fr) 21rem; padding-block: 3rem; } }
.c-start { font: inherit; cursor: pointer; border: 0; border-radius: 999px; padding: .95rem 1.9rem; font-family: var(--round), var(--sans); font-weight: 800; font-size: 1.25rem;
  color: var(--on-gold); background: linear-gradient(150deg, var(--gold-hi), var(--gold));
  box-shadow: inset 0 3px 0 rgba(255,255,255,.6), inset 0 -5px 0 rgba(150,90,0,.3), 0 14px 26px -12px rgba(6,4,34,.8); }
.c-start:active { transform: translateY(2px) scale(.985); }
.c-paper-btn { display: block; width: min(100%, 21rem); justify-self: center; border: 0; padding: .75rem; background: #fff; border-radius: 1.25rem; cursor: pointer; rotate: 2deg;
  box-shadow: 0 30px 50px -22px rgba(6,4,34,.9), 0 3px 0 rgba(0,0,0,.08); }
.c-paper-btn img { display: block; width: 100%; height: auto; }
@media (max-width: 56.24rem) { .c-paper-btn { width: min(62vw, 15rem); } }

.c-bar { display: flex; flex-wrap: wrap; gap: .625rem 1.5rem; align-items: center; justify-content: space-between; margin-bottom: 2rem; }
.c-filter { display: inline-flex; gap: .25rem; padding: .3rem; border-radius: 999px; background: var(--bg-alt); }
.c-filter button { font: inherit; font-weight: 700; border: 0; background: none; color: var(--mute); border-radius: 999px; padding: .5rem 1.1rem; cursor: pointer; min-height: 2.75rem; }
.c-filter button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: var(--clay-sm); }
.c-themes { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.c-themes a { font-weight: 700; color: var(--accent); min-height: 2.75rem; display: inline-flex; align-items: center; }
.c-theme { padding-top: 1.5rem; }
.c-theme + .c-theme { margin-top: 2rem; }
.c-theme-head { display: grid; gap: .25rem 1.5rem; margin-bottom: 1.25rem; }
@media (min-width: 48rem) { .c-theme-head { grid-template-columns: minmax(0,1fr) auto; align-items: end; } }
.c-theme-head h2 { margin: 0; }
.c-theme-head p { color: var(--mute); max-width: 38em; }
.c-pack { font-weight: 800; color: var(--accent); white-space: nowrap; min-height: 2.75rem; display: inline-flex; align-items: center; }
.c-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 48rem) { .c-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 64rem) { .c-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.c-card { display: flex; flex-direction: column; background: var(--card); border-radius: 1.75rem; box-shadow: var(--clay-sm); padding: .75rem; }
.c-card[hidden] { display: none; }
.c-open { display: block; border: 0; padding: 0; background: #fff; border-radius: 1.25rem; overflow: hidden; cursor: pointer; }
.c-open img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: contain; }   /* 26 張裡有 8 張不是 3:4，留白不拉伸 */
.c-card h3 { font-size: 1.0625rem; margin: .75rem .375rem .125rem; }
.c-level { margin: 0 .375rem; color: var(--mute); font-size: .875rem; }
.c-acts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .5rem; margin-top: auto; padding-top: .75rem; }
.c-acts > * { font: inherit; font-weight: 800; font-size: .9375rem; line-height: 1.2; min-height: 2.75rem; border: 0; border-radius: 1rem; display: grid; place-items: center; text-align: center; text-decoration: none; cursor: pointer; padding: .4rem; }
.c-acts button { color: var(--on-gold); background: linear-gradient(150deg, var(--gold-hi), var(--gold)); box-shadow: inset 0 2px 0 rgba(255,255,255,.55), inset 0 -3px 0 rgba(150,90,0,.28); }
.c-acts a { color: var(--ink); background: var(--bg-alt); }
@media (prefers-color-scheme: dark) { .c-acts a, .c-filter { background: rgba(255,255,255,.08); } }
.c-parents { display: grid; gap: 1.25rem 2rem; padding: 1.75rem 2rem; align-items: center; }
@media (min-width: 48rem) { .c-parents { grid-template-columns: 7rem minmax(0,1fr) auto; } }
.c-parents img.ic { width: 7rem; height: 7rem; border-radius: 1.5rem; }
.c-parents h2 { font-size: 1.375rem; margin: 0 0 .25rem; }
.c-parents p { color: var(--mute); }

/* ---- 上色桌（全螢幕） ---- */
html.c-lock { overflow: hidden; }
#desk { --tray: rgba(255,255,255,.08); border: 0; padding: 0; margin: 0; width: 100%; height: 100%; max-width: none; max-height: none; color: var(--sky-ink);
  background: var(--stars), linear-gradient(160deg, var(--sky-1) 0%, var(--sky-2) 55%, var(--sky-3) 100%); background-size: 420px 420px, 100% 100%; overflow: hidden; }
#desk[open] { display: grid; grid-template: auto minmax(0, 1fr) auto / minmax(0, 1fr); }
.d-top { display: flex; align-items: center; gap: .5rem; padding: max(.5rem, env(safe-area-inset-top)) .75rem .5rem; }
.d-top h2 { font-size: 1.0625rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.d-ref { width: 2.75rem; height: 2.75rem; flex: none; padding: 0; border: 0; border-radius: 50%; overflow: hidden; background: none; box-shadow: 0 0 0 3px var(--gold); cursor: pointer; }
.d-ref img { width: 100%; height: 100%; display: block; object-fit: contain; }
.d-btn { font: inherit; font-weight: 700; font-size: .9375rem; color: var(--sky-ink); background: var(--tray); border: 0; border-radius: 1rem; min-width: 2.75rem; min-height: 2.75rem; padding: .25rem .75rem; display: inline-flex; gap: .4rem; align-items: center; justify-content: center; cursor: pointer; white-space: nowrap; }
.d-btn svg { width: 1.375rem; height: 1.375rem; flex: none; fill: none; stroke: currentColor; stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }
.d-btn:disabled { opacity: .35; cursor: default; }
.d-btn.ask { background: #C83A2B; color: #fff; }
.d-btn[aria-pressed="true"] { background: var(--gold); color: var(--on-gold); }
.d-stage { overflow: auto; display: grid; padding: .25rem .75rem; overscroll-behavior: contain; container-type: size; }
.d-paper { position: relative; margin: auto; background: #fff; border-radius: .75rem; box-shadow: 0 24px 50px -20px rgba(4,2,30,.9); width: min(100cqw, 100cqh * var(--r, .75)); aspect-ratio: var(--r, .75); }   /* --r 由 coloring.js 依那張圖設定 */
.d-paper.zoom { width: calc(2 * min(100cqw, 100cqh * var(--r, .75))); }
.d-paper canvas { display: block; width: 100%; height: 100%; border-radius: .75rem; cursor: pointer; touch-action: pan-x pan-y pinch-zoom; -webkit-tap-highlight-color: transparent; }
.d-paper canvas:focus { outline: none; }
.d-paper canvas:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.d-dot { position: absolute; width: 1.5rem; height: 1.5rem; margin: -.75rem 0 0 -.75rem; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 3px #1B1A5C; pointer-events: none; }
.d-bottom { display: grid; gap: .5rem; padding: .5rem .75rem max(.625rem, env(safe-area-inset-bottom)); }
.d-balls { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: .375rem; max-width: 34rem; margin: 0 auto; width: 100%; justify-items: center; }
.d-balls button { width: 100%; max-width: 2.75rem; aspect-ratio: 1; padding: 0; border: 0; border-radius: 50%; cursor: pointer; background: var(--k); position: relative; transition: scale .15s ease;
  box-shadow: inset 0 4px 5px rgba(255,255,255,.5), inset 0 -5px 7px rgba(0,0,0,.24), 0 4px 8px -3px rgba(0,0,0,.6); }
.d-balls button[aria-checked="true"] { scale: 1.06 .9; box-shadow: inset 0 4px 5px rgba(255,255,255,.5), inset 0 -5px 7px rgba(0,0,0,.24), 0 0 0 3px var(--sky-1), 0 0 0 6px var(--gold); z-index: 1; }
.d-balls button.er::after { content: ""; position: absolute; inset: 26%; border-radius: 50%; border: 2px dashed #8a83a8; }
.d-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; }
@media (max-width: 30rem) { .d-tools { gap: .375rem; } .d-tools .d-btn { flex: 1; flex-direction: column; gap: .1rem; font-size: .75rem; padding: .375rem .125rem; } .d-balls { gap: .3rem; } }
@media (min-width: 56.25rem) and (min-aspect-ratio: 1/1) {
  #desk[open] { grid-template: auto minmax(0, 1fr) / minmax(0, 1fr) 19rem; }
  .d-top { grid-column: 1 / -1; padding-inline: 1.5rem; }
  .d-bottom { align-content: center; gap: 1.75rem; padding: 1rem 2rem 2rem 0; }
  .d-balls { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem 1rem; max-width: 13rem; }
  .d-balls button { max-width: 3.5rem; }
  .d-tools [data-a=print] { grid-column: 1 / -1; }
  .d-tools { display: grid; grid-template-columns: 1fr 1fr; }
  .d-stage { padding: .5rem 1.5rem 1.5rem; }
}
.d-big { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(12,10,50,.72); padding: 1rem; border: 0; cursor: pointer; width: 100%; }
.d-big[hidden] { display: none; }
.d-big img { width: min(80vw, 26rem); border-radius: 2rem; box-shadow: 0 0 0 .5rem var(--gold); }
.d-done { position: absolute; inset: auto 0 0 0; margin: 0 auto 1rem; width: min(30rem, calc(100% - 1.5rem)); background: var(--card); color: var(--ink); border-radius: 2rem; padding: 1rem 1.25rem; display: flex; align-items: center; gap: 1rem; box-shadow: 0 30px 60px -10px rgba(0,0,0,.7); }
.d-done[hidden] { display: none; }
.d-done img { width: 5.5rem; height: 5.5rem; border-radius: 1.25rem; flex: none; }
.d-done p { font-family: var(--round), var(--sans); font-weight: 800; font-size: 1.25rem; line-height: 1.3; }
.d-done .row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.d-done .d-btn { color: var(--on-gold); background: var(--gold); }
.d-done .d-btn.x { color: var(--ink); background: var(--bg-alt); }
@media (prefers-reduced-motion: no-preference) { .d-done { animation: up .35s cubic-bezier(.2,1.4,.4,1); } @keyframes up { from { transform: translateY(40%); opacity: 0 } } }

#sheet { display: none; }
@media print {
  @page { size: A4 portrait; margin: 10mm; }
  body.p-sheet > *:not(#sheet) { display: none !important; }
  body.p-sheet { background: #fff !important; }
  body.p-sheet #sheet { display: block; }
  #sheet img { display: block; width: 100%; max-height: 272mm; object-fit: contain; }
}
/* 高一點的手機：六顆一列，顏色球 44 px 以上 */
@media (max-width: 30rem) and (min-height: 47rem) { .d-balls { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .4rem .75rem; max-width: 22rem; } .d-balls button { max-width: 2.9rem; } }
.d-done, .d-big { z-index: 5; }
@media (max-width: 30rem) { .d-done { padding: .875rem 1rem; gap: .75rem; } .d-done img { width: 4.5rem; height: 4.5rem; } .d-done .row { flex-wrap: nowrap; gap: .375rem; } .d-done .d-btn { padding: .25rem .7rem; font-size: .875rem; } }

/* 麵包屑、整份列印、其他主題、家長統計、首頁入口 */
.c-crumb { font-size: .875rem; color: var(--sky-mute); margin-bottom: .875rem; }
.c-crumb a { color: var(--gold-hi); }
.c-pack { gap: .5rem; padding: .25rem 1.25rem; border-radius: 999px; background: var(--card); box-shadow: var(--clay-sm); text-decoration: none; justify-self: start; }
.c-consent { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 1.25rem; font-size: .9375rem; }
.c-consent h3 { font-size: 1rem; margin: 0 0 .25rem; }
.c-consent button { font: inherit; font-weight: 700; margin-top: .625rem; min-height: 2.75rem; padding: .25rem 1.125rem; border-radius: 999px; border: 1.5px solid var(--line); background: none; color: var(--ink); cursor: pointer; }
.c-consent [hidden] { display: none; }
.c-more { display: flex; flex-wrap: wrap; gap: .75rem; }
.c-more a { display: flex; align-items: center; gap: .875rem; padding: .5rem 1.25rem .5rem .5rem; border-radius: 1.25rem; background: var(--card); box-shadow: var(--clay-sm); text-decoration: none; font-weight: 800; }
.c-more img { width: 4.5rem; height: 6rem; object-fit: cover; border-radius: .875rem; background: #fff; }
/* 自家產品連結（John 12-01）：主位有獅找你＋App Store，次位其他自家產品；只有下載鈕能點，不放進作畫畫面 */
.c-house { position: relative; display: grid; gap: .75rem 1.25rem; align-items: center; margin-top: 2.5rem; padding: 1.5rem; border-radius: 1.75rem; background: var(--card); box-shadow: var(--clay-sm); grid-template-columns: 5.5rem minmax(0, 1fr); }
.c-house > img { width: 5.5rem; height: 5.5rem; border-radius: 1.25rem; display: block; }
.c-house .tag { display: inline-block; font-size: .8125rem; font-weight: 700; color: var(--mute); border: 1.5px solid var(--line); border-radius: 999px; padding: .05rem .625rem; margin-bottom: .25rem; }
.c-house strong { display: block; font-family: var(--round), var(--sans); font-size: 1.1875rem; line-height: 1.3; }
.c-house p { color: var(--mute); font-size: .9375rem; line-height: 1.5; }
.c-house .badge { grid-column: 1 / -1; justify-self: start; }
@media (min-width: 48rem) { .c-house { grid-template-columns: 5.5rem minmax(0, 1fr) auto; padding: 1.25rem 1.75rem 1.25rem 1.25rem; } .c-house .badge { grid-column: auto; } }
.c-others h2 { font-size: 1.375rem; margin-bottom: 1rem; }
.c-others ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .875rem; } @media (min-width: 48rem) { .c-others ul { grid-template-columns: 1fr 1fr; } }
.c-others a { display: flex; gap: .875rem; align-items: center; padding: .875rem 1.125rem .875rem .875rem; border-radius: 1.25rem; background: var(--card); box-shadow: var(--clay-sm); text-decoration: none; }
.c-others img { border-radius: .875rem; flex: none; } .c-others b { display: block; } .c-others span { color: var(--mute); font-size: .9375rem; line-height: 1.4; display: block; }
.d-bottom { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 30rem) { .d-tools { flex-wrap: nowrap; } .d-tools .d-btn { min-width: 0; font-size: .6875rem; letter-spacing: -.01em; } }
@media (max-width: 30rem) { .c-acts > * { font-size: .8125rem; padding-inline: .125rem; } }
