/* =========================================================
   Color Party — LITTLE HANDS look (loaded after game.css)
   For small children: soft lavender page, white cards with
   no outlines, giant round targets, Pip does the talking.
   Everything here overrides the sketchbook rules in game.css;
   the game logic and the coloring pages are unchanged.
   ========================================================= */

:root {
  --paper: #efe9ff;
  --paper-hi: #ffffff;
  --paper-lo: #e4dcfa;
  --ink: #2d2150;
  --ink-soft: #625785;
  --lh-purple: #7b5cfa;
  --lh-purple-dk: #4d33c4;
  --lh-sun: #ffc93c;
  --lh-sun-dk: #c9930a;
  --lh-go: #6fd08a;
  --lh-go-dk: #2e8a48;
  --lh-shadow: 0 6px 0 rgba(45, 33, 80, 0.16);
  --lh-shadow-sm: 0 4px 0 rgba(45, 33, 80, 0.16);
  --print: var(--lh-shadow-sm);
  --print-lg: var(--lh-shadow);
  --ring: #4cc26a;
  --ring-empty: #e4dcfa;
}

body {
  background: var(--paper);
  color: var(--ink);
}

/* soft surfaces: white, no ink outline, a soft drop below */
.icon-btn,
.tab,
.chip,
.btn,
.btn-ghost,
.sticker-btn,
.gallery-card,
.treasure-card,
.modal-card,
.help-card,
.link-tile,
.mode-tile,
.legend-chip,
.trace-banner,
.hint,
#toast,
.box-banner {
  background: var(--paper-hi);
  color: var(--ink);
  border: 0;
  box-shadow: var(--lh-shadow-sm);
}
.icon-btn:hover,
.chip:hover,
.tab:hover,
.link-tile:hover,
.mode-tile:hover {
  background: #fff;
  transform: translateY(-2px);
  box-shadow: var(--lh-shadow);
}
.icon-btn:active,
.btn:active,
.chip:active,
.tab:active,
.link-tile:active,
.mode-tile:active,
.art-card:active,
.gallery-card:active,
.legend-chip:active,
.mode-chip:active,
.dock-btn:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 rgba(45, 33, 80, 0.16);
}
.icon-btn {
  border-radius: 18px;
}
.icon-btn.off {
  background: var(--paper-lo);
}
.btn {
  border-radius: 18px;
  min-height: 52px;
  font-size: 17px;
}
.btn-p1 { background: #d6ebff; }
.btn-p2 { background: #c9f0d8; }
.btn-p3 { background: #ffe0ea; }
.btn-p4,
.btn-big { background: var(--lh-sun); box-shadow: 0 6px 0 var(--lh-sun-dk); }
.btn-ghost { background: #fff; }

/* ---------------- home ---------------- */
#screen-home .home.lh-home {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 0 6px;
  gap: 0;
  /* spare height on tall phones is shared out, not piled in one gap */
  justify-content: space-around;
}
.lh-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: calc(10px + env(safe-area-inset-top)) 16px 0;
}
.lh-wordmark {
  font-size: 22px;
}
.lh-grownups {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 2px solid rgba(45, 33, 80, 0.3);
  background: transparent;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
}
.lh-grownups .ic-img {
  width: 18px;
  height: 22px;
}

/* Pip and the speech bubble */
.lh-pip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 18px 0;
}
.lh-pip-img {
  flex: 0 0 auto;
  width: 78px;
  height: 96px;
  object-fit: contain;
  animation: bob 2.2s ease-in-out infinite;
}
.lh-bubble {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  padding: 12px 16px;
  border-radius: 26px 26px 26px 6px;
  background: #fff;
  box-shadow: var(--lh-shadow);
}
#screen-home .lh-bubble .mode-line {
  margin: 0;
  text-align: start;
  font-family: var(--display);
  font-weight: 600;
  font-size: 18px;
  line-height: 1.2;
  color: var(--ink);
}

/* one big picture at a time: swipe, or tap the big arrows */
.lh-carousel {
  /* the picture grows with the screen: ~280px on small phones, up to 400px */
  --card: clamp(220px, min(74vw, calc(100dvh - 578px)), 400px);
  position: relative;
  margin-top: 10px;
}
#screen-home .art-grid.lh-track {
  display: flex;
  grid-template-columns: none;
  gap: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 6px calc(50% - var(--card) / 2) 12px;
  margin: 0;
  max-width: none;
}
#screen-home .art-grid.lh-track::-webkit-scrollbar {
  display: none;
}
#screen-home .lh-track .art-card {
  flex: 0 0 var(--card);
  width: var(--card);
  scroll-snap-align: center;
  padding: 7px 7px 10px;
  border: 0;
  border-radius: 36px;
  background: #fff;
  box-shadow: var(--lh-shadow);
  transform: none;
  gap: 6px;
}
#screen-home .lh-track .art-card::before {
  display: none;
}
#screen-home .lh-track .art-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 rgba(45, 33, 80, 0.16);
}
#screen-home .lh-track .art-card:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 rgba(45, 33, 80, 0.16);
}
#screen-home .lh-track .art-thumb {
  border: 0;
  border-radius: 30px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
}
#screen-home .lh-track .art-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}
#screen-home .lh-track .art-badge {
  bottom: 10px;
  right: 10px;
  padding: 4px 10px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--lh-shadow-sm);
  font-size: 14px;
}
#screen-home .lh-track .mini-stars .ic,
#screen-home .lh-track .mini-stars .ic-img {
  width: 22px;
  height: 22px;
}
#screen-home .lh-track .art-card.locked {
  background: #f7f4ff;
}
#screen-home .lh-track .lock-veil .ic,
#screen-home .lh-track .lock-veil .ic-img {
  width: 64px;
  height: 80px;
}
#screen-home .lh-track .next-flag {
  top: 18px;
  left: 18px;
  border: 0;
  padding: 5px 14px 5px 10px;
  font-size: 15px;
  background: var(--lh-sun);
  box-shadow: 0 4px 0 var(--lh-sun-dk);
}
.lh-arrow {
  position: absolute;
  z-index: 4;
  top: calc(var(--card) * 0.42);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  background: var(--lh-sun);
  color: var(--ink);
  box-shadow: 0 6px 0 var(--lh-sun-dk);
}
.lh-arrow .ic {
  width: 30px;
  height: 30px;
  stroke-width: 3;
}
.lh-arrow:active {
  transform: translateY(5px);
  box-shadow: 0 1px 0 var(--lh-sun-dk);
}
.lh-prev {
  left: 8px;
}
.lh-next {
  right: 8px;
}
.lh-next .ic {
  transform: scaleX(-1);
}
@media (min-width: 560px) {
  .lh-prev { left: calc(50% - var(--card) / 2 - 82px); }
  .lh-next { right: calc(50% - var(--card) / 2 - 82px); }
}

/* theme jump buttons under the picture */
#screen-home .tabs.lh-themes {
  display: flex;
  flex: 0 0 auto;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 14px;
  padding: 2px 16px 10px;
  margin: 0;
  overflow: visible;
}
#screen-home .lh-themes .tab {
  width: 56px;
  height: 56px;
  min-width: 56px;
  padding: 0;
  border-radius: 50%;
  justify-content: center;
  background: #fff;
}
#screen-home .lh-themes .tab .ic,
#screen-home .lh-themes .tab .ic-img {
  width: 34px;
  height: 34px;
}
#screen-home .lh-themes .tab.active {
  background: #fff;
  box-shadow: 0 0 0 4px var(--lh-purple), var(--lh-shadow-sm);
}
#screen-home .lh-themes .tab.active .ic {
  color: var(--ink);
}

/* how to paint: giant pastel buttons */
#screen-home .mode-strip {
  gap: 12px;
  padding: 6px 18px 14px;
  margin: 0;
  scroll-snap-type: x proximity;
  scroll-padding: 0 18px;
}
#screen-home .mode-chip {
  flex: 0 0 118px;
  min-height: 116px;
  justify-content: center;
  gap: 4px;
  padding: 10px 6px;
  border: 0;
  border-radius: 30px;
  background: color-mix(in srgb, var(--accent) 22%, #fff);
  box-shadow: 0 7px 0 color-mix(in srgb, var(--accent) 38%, #c9bfe6);
}
#screen-home .mode-chip .mode-badge {
  width: 64px;
  height: 64px;
  background: transparent;
  border: 0;
  box-shadow: none;
}
#screen-home .mode-chip .mode-badge .ic-img {
  width: 62px;
  height: 62px;
}
#screen-home .mode-chip b {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
#screen-home .mode-chip.active {
  background: color-mix(in srgb, var(--accent) 22%, #fff);
  transform: translateY(-3px);
  box-shadow: 0 0 0 4px var(--lh-purple), 0 9px 0 4px rgba(77, 51, 196, 0.35);
}
#screen-home .mode-chip.active .mode-badge {
  background: transparent;
}
/* centered when they all fit, still scrollable from the first one when not */
#screen-home .mode-strip .mode-chip:first-child {
  margin-left: auto;
}
#screen-home .mode-strip .mode-chip:last-child {
  margin-right: auto;
}

/* bottom: two big square buttons */
.dock.lh-dock {
  justify-content: center;
  gap: 22px;
  padding: 6px 12px calc(16px + env(safe-area-inset-bottom));
  background: var(--paper);
  border-top: 0;
}
.lh-dock .dock-btn {
  position: relative;
  flex: 0 0 auto;
  width: 76px;
  min-height: 76px;
  height: 76px;
  padding: 0;
  border: 0;
  border-radius: 26px;
  background: #fff;
  box-shadow: var(--lh-shadow);
}
.lh-dock .dock-btn .ic-img {
  width: 48px;
  height: 48px;
  margin: 0;
}
.lh-dock .dock-btn b {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.lh-dock .dock-btn i {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 28px;
  height: 28px;
  border: 0;
  background: var(--lh-purple);
  color: #fff;
  font-size: 14px;
}

/* ---------------- grown-ups sheet ---------------- */
.gu-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 6px 18px 28px;
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
}
.gu-h {
  margin: 10px 0 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.4px;
  color: var(--ink-soft);
}
.gu-row {
  display: flex;
  gap: 10px;
}
.icon-btn.gu-toggle {
  flex: 1 1 0;
  width: auto;
  height: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: 20px;
}
.icon-btn.gu-toggle[hidden] {
  display: none;
}
.icon-btn.gu-toggle .ic,
.icon-btn.gu-toggle .ic-img {
  width: 36px;
  height: 36px;
}
.icon-btn.gu-toggle b {
  font-family: var(--display);
  font-weight: 600;
  font-size: 14px;
}
.icon-btn.gu-toggle.off::after {
  top: 36%;
  left: 30%;
  right: 30%;
}
.gu-wrap .band-row {
  display: flex;
  gap: 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}
.gu-wrap .band-row .seg {
  flex: 1 1 0;
  min-height: 52px;
  border: 0;
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  box-shadow: var(--lh-shadow-sm);
  font-family: var(--display);
  font-weight: 600;
  font-size: 17px;
}
.gu-wrap .band-row .seg.active {
  background: var(--lh-purple);
  color: #fff;
  box-shadow: 0 4px 0 var(--lh-purple-dk);
}
.gu-note {
  margin: 0;
  font-size: 15px;
  color: var(--ink-soft);
}
.gu-wrap .home-stats {
  margin: 0;
  padding: 12px 14px;
  border-radius: 18px;
  background: #fff;
  text-align: left;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
}
.gu-howto {
  margin-top: 14px;
  width: 100%;
  background: var(--lh-sun);
  box-shadow: 0 6px 0 var(--lh-sun-dk);
}
.gu-howto .ic-img {
  width: 30px;
  height: 30px;
}

/* sheets: lavender page, soft top */
.sheet {
  background: var(--paper);
  border: 0;
  border-radius: 30px 30px 0 0;
  box-shadow: 0 -6px 0 rgba(45, 33, 80, 0.1);
}
#sheet-scrim {
  background: rgba(45, 33, 80, 0.4);
}

/* ---------------- painting screen ---------------- */
#screen-studio {
  background: var(--paper);
}
.studio-bar {
  gap: 8px;
}
.studio-bar .icon-btn,
#screen-studio .studio-bar .icon-btn {
  width: 52px;
  height: 52px;
  min-width: 52px;
  border-radius: 18px;
}
.studio-bar .icon-btn .ic {
  width: 28px;
  height: 28px;
}
#btn-done {
  min-height: 52px;
  padding: 0 16px;
  border-radius: 18px;
  background: var(--lh-go);
  color: #123020;
  font-size: 17px;
  font-weight: 700;
  box-shadow: 0 6px 0 var(--lh-go-dk);
}
#btn-done .ic {
  width: 24px;
  height: 24px;
  stroke-width: 3;
}
#btn-done:active {
  transform: translateY(5px);
  box-shadow: 0 1px 0 var(--lh-go-dk);
}
#btn-done.ready {
  background: var(--lh-sun);
  box-shadow: 0 6px 0 var(--lh-sun-dk);
}
.progress-ring {
  border: 0;
  box-shadow: var(--lh-shadow-sm);
}
.studio-bar .progress-wrap {
  flex: 0 0 auto;
}
/* phones: everything in the top bar still fits in one row */
@media (max-width: 420px) {
  .studio-bar {
    gap: 6px;
    padding-left: 8px;
    padding-right: 8px;
  }
  .studio-bar .topbar-actions {
    gap: 6px;
  }
  .studio-bar .icon-btn,
  #screen-studio .studio-bar .icon-btn {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 16px;
  }
  #btn-done {
    min-height: 48px;
    padding: 0 12px;
    gap: 4px;
  }
}
.progress-ring::before {
  background: #fff;
}
.stage {
  border-radius: 34px;
  box-shadow: 0 0 0 7px #fff, 0 13px 0 7px rgba(45, 33, 80, 0.14);
}
@media (min-width: 900px) and (orientation: landscape) {
  .stage {
    box-shadow: 0 0 0 7px #fff, 0 13px 0 7px rgba(45, 33, 80, 0.14);
  }
  #screen-studio .toolbar {
    border-left: 0;
  }
}
.stage-help {
  width: 52px;
  height: 52px;
  border: 0;
  background: #fff;
  box-shadow: var(--lh-shadow-sm);
}
.toolbar {
  background: #fff;
  border-top: 0;
  border-radius: 30px 30px 0 0;
  box-shadow: 0 -5px 0 rgba(45, 33, 80, 0.06);
}

/* paint blobs: big round colors with a white rim */
.swatch,
body.band-little .swatch {
  width: 52px;
  height: 52px;
  min-width: 52px;
  border-radius: 50%;
  border: 4px solid #fff;
  box-shadow: 0 4px 0 rgba(45, 33, 80, 0.22), 0 0 0 1px rgba(45, 33, 80, 0.12);
}
body.band-little .swatch {
  width: 60px;
  height: 60px;
  min-width: 60px;
}
.swatch.active {
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 0 0 4px var(--ink), 0 8px 0 4px rgba(45, 33, 80, 0.3);
}
.tool-row.palette {
  gap: 10px;
  padding: 6px 4px 10px;
}

/* brushes and tools: big soft buttons; the chosen one turns sunny */
.chip,
body.band-little .chip {
  min-height: 56px;
  padding: 8px 16px 8px 12px;
  border: 0;
  border-radius: 20px;
  font-size: 16px;
  font-weight: 600;
  background: #f4f0ff;
  box-shadow: var(--lh-shadow-sm);
}
.chip .ic,
.chip .ic-img {
  width: 32px;
  height: 32px;
}
.chip.active,
.chip.tool.active {
  background: #ffe27a;
  color: var(--ink);
  box-shadow: 0 5px 0 #d1a92a;
}
.chip.active .ic {
  color: var(--ink);
}

/* number paint pots */
.legend-chip {
  width: 52px;
  padding: 6px 1px;
  border-radius: 18px;
  background: #f4f0ff;
}
.legend-chip b {
  width: 38px;
  height: 38px;
  border: 3px solid #fff;
  font-size: 18px;
  box-shadow: 0 2px 0 rgba(45, 33, 80, 0.2);
}
.legend-chip small {
  font-size: 12px;
}
.legend-chip.active {
  background: #fff;
  box-shadow: 0 0 0 4px var(--lh-purple), var(--lh-shadow-sm);
}

.trace-banner {
  border-radius: 22px;
  background: #f4f0ff;
}
.hint,
#toast {
  border-radius: 20px;
  box-shadow: var(--lh-shadow);
  font-size: 17px;
  font-weight: 600;
}
.word-pop {
  border: 0;
  border-radius: 16px;
  box-shadow: var(--lh-shadow-sm);
  font-size: 18px;
}
.num-badge {
  width: var(--bs, 26px);
  height: var(--bs, 26px);
  font-size: calc(var(--bs, 26px) * 0.56);
  line-height: 1;
  border: 2px solid #fff;
  box-shadow: 0 1px 0 rgba(45, 33, 80, 0.25);
}
/* numbers you aren't painting right now step back, so the picture shows */
.num-badge.dim {
  opacity: 0.55;
  transform: translate(-50%, -50%) scale(0.8);
}
.num-badge.sel {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink-line, #2d2150);
  animation: lhBeat 1.1s ease-in-out infinite;
}
@keyframes lhBeat {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.12); }
}

/* modals */
.modal-back {
  background: rgba(45, 33, 80, 0.42);
}
.modal-card {
  border-radius: 34px;
  box-shadow: 0 10px 0 rgba(45, 33, 80, 0.2);
}

/* =========================================================
   ANIMATION — short, purposeful motion only:
   screens settle in, the picture in the middle is the big one,
   a choice gives a little bounce, Pip's new line pops.
   Turned off by prefers-reduced-motion (game.css) and frozen
   while YouTube pauses the game (body.paused).
   ========================================================= */
@keyframes lhRise {
  from { opacity: 0; transform: translateY(16px); }
}
@keyframes lhZoom {
  from { opacity: 0; transform: scale(0.92); }
}
@keyframes lhSlideUp {
  from { transform: translateY(40px); opacity: 0; }
}
@keyframes lhPop {
  0% { transform: scale(0.94); }
  55% { transform: scale(1.04); }
  100% { transform: scale(1); }
}
@keyframes lhBounce {
  0% { transform: translateY(0) scale(1); }
  40% { transform: translateY(-8px) scale(1.1); }
  70% { transform: translateY(-2px) scale(0.98); }
  100% { transform: translateY(-4px) scale(1.06); }
}
@keyframes lhWiggle {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-10deg) scale(1.08); }
  50% { transform: rotate(8deg) scale(1.08); }
  75% { transform: rotate(-4deg); }
}
@keyframes lhBump {
  0% { transform: scale(1); }
  40% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

/* home settles in, top to bottom, every time you come back to it */
#screen-home.active .lh-pip { animation: lhRise 0.42s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
#screen-home.active .lh-carousel { animation: lhRise 0.42s cubic-bezier(0.2, 0.9, 0.3, 1.2) 0.06s both; }
#screen-home.active .lh-themes { animation: lhRise 0.42s ease 0.12s both; }
#screen-home.active .mode-strip { animation: lhRise 0.42s ease 0.16s both; }
#screen-home.active .lh-dock { animation: lhRise 0.42s ease 0.2s both; }

/* the picture in the middle is the big one; neighbours step back */
#screen-home .lh-track .art-card {
  transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.1), opacity 0.28s, box-shadow 0.2s;
}
#screen-home .lh-track .art-card:not(.is-center) {
  transform: scale(0.9);
  opacity: 0.7;
}
#screen-home .lh-track .art-card.is-center:active {
  transform: translateY(4px) scale(0.98);
}
#screen-home .lh-track .art-card.nudge {
  animation: nudge 0.42s ease;
}

/* Pip says something new */
.lh-bubble.pop {
  animation: lhPop 0.38s ease;
}

/* choosing things */
#screen-home .mode-chip {
  transition: transform 0.18s, box-shadow 0.18s, background 0.18s;
}
#screen-home .mode-chip.active .mode-badge .ic-img {
  animation: lhWiggle 0.55s ease;
}
#screen-home .lh-themes .tab {
  transition: transform 0.15s, box-shadow 0.18s;
}
#screen-home .lh-themes .tab.active {
  animation: lhPop 0.32s ease;
}
.swatch {
  transition: transform 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.4), box-shadow 0.18s;
}
.swatch.active {
  animation: lhBounce 0.36s ease;
}
.chip {
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.chip.active .ic-img {
  animation: lhWiggle 0.5s ease;
}
.lh-dock .dock-btn i.bump {
  animation: lhBump 0.45s ease;
}
.lh-arrow,
.lh-grownups,
.icon-btn,
.btn,
#btn-done {
  transition: transform 0.12s, box-shadow 0.12s, background 0.15s;
}

/* painting screen: the picture zooms in, the tools slide up */
#screen-studio.active .stage { animation: lhZoom 0.38s cubic-bezier(0.2, 0.9, 0.3, 1.15) both; }
#screen-studio.active .toolbar { animation: lhSlideUp 0.38s ease 0.08s both; }
#screen-studio.active .studio-bar { animation: lhRise 0.32s ease both; }

/* grown-ups panel rows */
.sheet.open .gu-wrap > * {
  animation: lhRise 0.3s ease both;
}
.sheet.open .gu-wrap > :nth-child(2) { animation-delay: 0.03s; }
.sheet.open .gu-wrap > :nth-child(3) { animation-delay: 0.06s; }
.sheet.open .gu-wrap > :nth-child(4) { animation-delay: 0.09s; }
.sheet.open .gu-wrap > :nth-child(5) { animation-delay: 0.12s; }
.sheet.open .gu-wrap > :nth-child(n + 6) { animation-delay: 0.15s; }

/* =========================================================
   LANGUAGES — picker, right-to-left pages, other scripts
   ========================================================= */
.gu-lang {
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  border: 0;
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  box-shadow: var(--lh-shadow-sm);
  font-family: var(--display);
  font-size: 17px;
  font-weight: 600;
}
.gu-h label {
  cursor: pointer;
}

/* Fredoka has Latin letters only. Every other script falls back to the
   phone's own fonts (Noto on Android, system fonts on iOS / Windows);
   Latin digits keep the rounded Fredoka look. */
:root {
  --display: "Fredoka", ui-rounded, "Noto Sans", "Noto Sans Devanagari", "Nirmala UI", "Kohinoor Devanagari",
    "Noto Sans Bengali", "Noto Sans Tamil", "Noto Sans Telugu", "Noto Sans Gujarati", "Noto Sans Kannada",
    "Noto Sans Malayalam", "Noto Sans Gurmukhi", "Noto Sans Arabic", "Noto Sans Hebrew", "Noto Sans Thai",
    "Leelawadee UI", "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", "Hiragino Sans", "Yu Gothic",
    "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", system-ui, sans-serif;
  --body: var(--display);
}
/* Indic and Thai scripts need more room above and below the letters */
:lang(hi), :lang(mr), :lang(ne), :lang(bn), :lang(ta), :lang(te), :lang(gu), :lang(kn), :lang(ml), :lang(pa), :lang(th) {
  line-height: 1.35;
}
/* long words (German, Finnish, Tamil, Malayalam…) wrap instead of overflowing */
.mode-chip b,
.chip,
.btn,
.tab,
.art-name,
.legend-chip small,
.lh-bubble .mode-line,
.hint,
#toast,
.word-pop {
  overflow-wrap: anywhere;
  hyphens: auto;
}
#screen-home .mode-chip b {
  font-size: 14px;
  line-height: 1.15;
}

/* right-to-left: the page flips, the picture strip keeps its swipe order */
#screen-home .art-grid.lh-track {
  direction: ltr;
}
#screen-home .lh-track .art-card > * {
  direction: inherit;
}
[dir="rtl"] #screen-home .lh-track .art-name {
  direction: rtl;
}
[dir="rtl"] .lh-bubble {
  border-radius: 26px 26px 6px 26px;
}
[dir="rtl"] .studio-bar [data-ic="back"] .ic,
[dir="rtl"] #studio-back .ic {
  transform: scaleX(-1);
}
/* scripts with tall letters (Tamil, Malayalam…) and long words: smaller
   button labels so every "how to paint" button stays two lines */
:lang(ta) #screen-home .mode-chip b,
:lang(ml) #screen-home .mode-chip b,
:lang(el) #screen-home .mode-chip b,
:lang(hu) #screen-home .mode-chip b,
:lang(pl) #screen-home .mode-chip b,
:lang(uk) #screen-home .mode-chip b {
  font-size: 13px;
  line-height: 1.12;
}
:lang(ta) #screen-home .lh-track .art-name,
:lang(ml) #screen-home .lh-track .art-name,
:lang(te) #screen-home .lh-track .art-name,
:lang(kn) #screen-home .lh-track .art-name {
  font-size: 15px;
  line-height: 1.2;
}
/* the brand name always reads "Color Party", even on right-to-left pages */
.wordmark {
  direction: ltr;
}

/* =========================================================
   PLAYFUL PASS (2026-11-22) — after playing other kids'
   coloring apps: a garden scene instead of a plain page,
   bold candy buttons with a dark outline, crayon-stick
   colors, and Pip on the painting screen.
   ========================================================= */
:root {
  --lh-line: #2d2150;
  --sky-1: #a9dcff;
  --sky-2: #e3f4ff;
  --grass-1: #8fdc6a;
  --grass-2: #5fbf4a;
  --frame: #ffb547;
}

/* ---- scene: sky, two clouds, rolling hills ---- */
#screen-home,
#screen-studio {
  background:
    radial-gradient(60px 26px at 14% 9%, #fff 98%, transparent 100%),
    radial-gradient(44px 22px at 22% 7%, #fff 98%, transparent 100%),
    radial-gradient(70px 28px at 84% 15%, #fff 98%, transparent 100%),
    radial-gradient(48px 22px at 76% 13%, #fff 98%, transparent 100%),
    radial-gradient(120% 70px at 20% 100%, var(--grass-2) 98%, transparent 100%),
    radial-gradient(90% 110px at 85% 100%, var(--grass-1) 98%, transparent 100%),
    linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 62%, #f1fbe9 100%);
}
.dock.lh-dock {
  background: transparent;
}
.toolbar {
  position: relative;
  z-index: 1;
}

/* ---- candy buttons: saturated, dark outline, glossy top ---- */
#screen-home .mode-chip {
  position: relative;
  border: 3px solid var(--lh-line);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 45%, #fff) 0%, color-mix(in srgb, var(--accent) 80%, #fff) 100%);
  box-shadow: 0 6px 0 var(--lh-line);
}
#screen-home .mode-chip::after,
.lh-dock .dock-btn::after,
#screen-home .lh-themes .tab::after,
.btn::after,
#btn-done::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  top: 5px;
  height: 28%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0));
  pointer-events: none;
}
#screen-home .mode-chip.active {
  transform: translateY(-4px) scale(1.04);
  box-shadow: 0 0 0 4px #fff, 0 0 0 7px var(--lh-line), 0 9px 0 4px rgba(45, 33, 80, 0.5);
}
#screen-home .mode-chip b {
  font-weight: 700;
}
.lh-dock .dock-btn,
#screen-home .lh-themes .tab {
  position: relative;
  border: 3px solid var(--lh-line);
  box-shadow: 0 5px 0 var(--lh-line);
}
.lh-dock .dock-btn:nth-child(1) { background: #ffe07a; }
.lh-dock .dock-btn:nth-child(2) { background: #ffb3cf; }
#screen-home .lh-themes .tab.active {
  background: #ffe07a;
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--lh-line), 0 5px 0 4px var(--lh-line);
}
.lh-dock .dock-btn i {
  border: 2px solid #fff;
}
.btn {
  position: relative;
  border: 3px solid var(--lh-line);
  box-shadow: 0 5px 0 var(--lh-line);
  font-weight: 700;
}
.btn-p1 { background: #8fd0ff; }
.btn-p2 { background: #7ee39b; }
.btn-p3 { background: #ffa8c8; }
.btn-ghost { background: #fff; }
.btn:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--lh-line);
}
#btn-done,
#btn-done.ready {
  position: relative;
  border: 3px solid var(--lh-line);
  box-shadow: 0 5px 0 var(--lh-line);
}
#btn-done:active {
  box-shadow: 0 1px 0 var(--lh-line);
}
#screen-home .lh-track .art-card {
  border: 4px solid var(--lh-line);
  box-shadow: 0 7px 0 var(--lh-line);
}
.lh-bubble {
  border: 3px solid var(--lh-line);
  box-shadow: 0 4px 0 var(--lh-line);
}
.lh-grownups {
  background: #fff;
  border: 3px solid var(--lh-line);
}

/* ---- painting screen: the picture sits on a chunky easel board ---- */
.stage {
  border-radius: 26px;
  box-shadow: 0 0 0 5px #fff, 0 0 0 13px var(--frame), 0 0 0 16px var(--lh-line), 0 8px 0 16px var(--lh-line);
}
@media (min-width: 900px) and (orientation: landscape) {
  .stage {
    box-shadow: 0 0 0 5px #fff, 0 0 0 13px var(--frame), 0 0 0 16px var(--lh-line), 0 8px 0 16px var(--lh-line);
  }
}
.stage-help {
  border: 3px solid var(--lh-line);
  box-shadow: 0 4px 0 var(--lh-line);
}

/* ---- Pip on the painting screen ---- */
.pal {
  position: absolute;
  left: 2px;
  bottom: 0;
  width: 74px;
  height: 88px;
  z-index: 3;
  pointer-events: none;
  transform-origin: 50% 100%;
}
.pal img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 3px 0 rgba(45, 33, 80, 0.25));
  animation: bob 2.4s ease-in-out infinite;
}
[dir="rtl"] .pal {
  left: auto;
  right: 2px;
}
.pal.pal-hop { animation: palHop 0.55s cubic-bezier(0.3, 1.6, 0.5, 1); }
.pal.pal-tilt { animation: palTilt 0.7s ease; }
.pal.pal-wave { animation: palWave 1.1s ease; }
@keyframes palHop {
  0%, 100% { transform: translateY(0) scale(1); }
  35% { transform: translateY(-22px) scale(1.06, 0.96); }
  70% { transform: translateY(0) scale(1.08, 0.92); }
}
@keyframes palTilt {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-9deg); }
  60% { transform: rotate(7deg); }
}
@keyframes palWave {
  0%, 100% { transform: translateX(0) rotate(0); }
  20% { transform: translateX(10px) rotate(8deg); }
  40% { transform: translateX(4px) rotate(-4deg); }
  60% { transform: translateX(12px) rotate(8deg); }
  80% { transform: translateX(4px) rotate(-2deg); }
}

/* ---- colors as crayon sticks ---- */
.tool-row.palette {
  align-items: flex-end;
  gap: 6px;
  padding: 14px 4px 6px;
}
.swatch[data-color],
body.band-little .swatch[data-color] {
  position: relative;
  width: 40px;
  min-width: 40px;
  height: 74px;
  border: 0;
  border-radius: 0 0 9px 9px;
  background: transparent;
  box-shadow: none;
  transition: transform 0.15s ease;
}
body.band-little .swatch[data-color] {
  width: 48px;
  min-width: 48px;
  height: 82px;
}
/* body + pointed tip, with a paper wrapper band */
.swatch[data-color]::before,
.swatch[data-color]::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 0 0 9px 9px;
  clip-path: polygon(30% 0, 70% 0, 100% 26%, 100% 100%, 0 100%, 0 26%);
  pointer-events: none;
}
.swatch[data-color]::before {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.45) 0 18%, transparent 18% 72%, rgba(0, 0, 0, 0.14) 72%),
    linear-gradient(180deg, transparent 0 46%, rgba(255, 255, 255, 0.9) 46% 50%, transparent 50% 70%, rgba(255, 255, 255, 0.9) 70% 74%, transparent 74%),
    var(--c);
}
.swatch[data-color]::after {
  box-shadow: inset 0 0 0 2.5px var(--lh-line);
}
.swatch[data-color="#FFFFFF"]::before {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.45) 0 18%, transparent 18% 72%, rgba(0, 0, 0, 0.1) 72%),
    linear-gradient(180deg, transparent 0 46%, #e9e2f7 46% 50%, transparent 50% 70%, #e9e2f7 70% 74%, transparent 74%),
    #fff;
}
.swatch[data-color].active {
  transform: translateY(-12px);
  box-shadow: none;
}
.swatch[data-color].active::after {
  box-shadow: inset 0 0 0 4px var(--lh-line);
}
.swatch.more {
  align-self: center;
  width: 52px;
  min-width: 52px;
  height: 52px;
  border-radius: 18px;
  border: 3px dashed var(--lh-line);
  background: #fff;
  box-shadow: none;
}
.swatch.more .ic-img,
.swatch.more .ic {
  width: 32px;
  height: 32px;
}
.tool-row.palette.tip-out .swatch[data-color] {
  animation: crayonOut 0.4s cubic-bezier(0.3, 1.5, 0.5, 1) backwards;
}
@keyframes crayonOut {
  0% { transform: translateY(40px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* number chips get the same bold outline */
.legend-chip {
  border: 3px solid var(--lh-line);
  box-shadow: 0 4px 0 var(--lh-line);
}

/* top bar: the picture name shrinks (with …) so Done always fits */
.studio-bar .progress-wrap {
  flex: 1 1 auto;
  min-width: 0;
}
.studio-bar .studio-title {
  min-width: 0;
  overflow: hidden;
}
.studio-bar .studio-title b,
.studio-bar .studio-title span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.studio-bar .topbar-actions {
  flex: 0 0 auto;
}

/* the bold outlines add a little height: keep the home page on one screen */
#screen-home .mode-chip {
  min-height: 106px;
  padding: 8px 6px;
}
#screen-home .mode-chip .mode-badge,
#screen-home .mode-chip .mode-badge .ic-img {
  width: 56px;
  height: 56px;
}
#screen-home .lh-themes .tab {
  width: 52px;
  height: 52px;
  min-width: 52px;
}
#screen-home .tabs.lh-themes {
  padding-bottom: 8px;
}
.lh-dock .dock-btn {
  width: 70px;
  height: 70px;
  min-height: 70px;
}
/* long Malayalam/Tamil sentences: Pip's bubble a touch smaller */
:lang(ml) #screen-home .lh-bubble .mode-line,
:lang(ta) #screen-home .lh-bubble .mode-line {
  font-size: 15.5px;
}
/* short phones: a smaller Pip so the picture's corner stays clear */
@media (max-height: 840px) {
  .pal {
    width: 54px;
    height: 64px;
  }
}

/* the glossy shine sits BEHIND the label, never over the words */
#screen-home .mode-chip,
.lh-dock .dock-btn,
#screen-home .lh-themes .tab,
.btn,
#btn-done {
  isolation: isolate;
}
#screen-home .mode-chip::after,
.lh-dock .dock-btn::after,
#screen-home .lh-themes .tab::after,
.btn::after,
#btn-done::after {
  z-index: -1;
  top: 4px;
  left: 8%;
  right: 8%;
  height: 42%;
  border-radius: 14px 14px 40% 40% / 14px 14px 100% 100%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0));
}

/* the chosen "how to paint" button lifts and gets a ring: give the strip
   room above and below so nothing is cut off */
#screen-home .mode-strip {
  padding-top: 12px;
  padding-bottom: 16px;
}
#screen-home .mode-chip.active {
  transform: translateY(-3px);
}

/* ---- grown-ups settings: one row per switch ---- */
.gu-settings {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gu-switch {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 10px 14px;
  border: 3px solid var(--lh-line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 4px 0 var(--lh-line);
  color: var(--ink);
  text-align: start;
  font: inherit;
  cursor: pointer;
}
.gu-switch:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--lh-line);
}
.gu-switch-text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.gu-switch-text b {
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.2;
}
.gu-switch-text small {
  font-size: 13px;
  line-height: 1.25;
  color: var(--ink-soft);
}
.gu-knob {
  position: relative;
  flex: 0 0 auto;
  width: 54px;
  height: 32px;
  border-radius: 999px;
  border: 3px solid var(--lh-line);
  background: #e4dcfa;
  transition: background 0.2s ease;
}
.gu-knob::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--lh-line);
  box-sizing: border-box;
  transition: transform 0.2s ease;
}
.gu-switch.on .gu-knob {
  background: var(--lh-go);
}
.gu-switch.on .gu-knob::after {
  transform: translateX(22px);
}
[dir="rtl"] .gu-switch.on .gu-knob::after {
  transform: translateX(-22px);
}
[dir="rtl"] .gu-knob::after {
  left: auto;
  right: 2px;
}

/* grown-ups "Less movement": nearly everything stops moving */
body.less-motion *,
body.less-motion *::before,
body.less-motion *::after {
  animation: none !important;
  transition: none !important;
}
.gu-wrap .band-row .seg {
  border: 3px solid var(--lh-line);
  box-shadow: 0 4px 0 var(--lh-line);
}

/* =================== COLORING-ONLY HOME (2026-11-22) ===================
   Pip says "Pick a picture!", three theme buttons, then a scrolling grid
   of big pictures. Tapping one opens "How do you want to paint?". */
#screen-home .home.lh-home {
  justify-content: flex-start;
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
}
#screen-home .lh-pip {
  position: relative;
  padding: 6px 18px 4px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
#screen-home .lh-pip-img {
  width: 104px;
  height: 124px;
  transform-origin: 50% 100%;
}
#screen-home .lh-bubble .mode-line {
  font-size: 24px;
}
#screen-home .tabs.lh-themes {
  gap: 18px;
  padding: 6px 16px 12px;
}
#screen-home .lh-themes .tab {
  width: 68px;
  height: 68px;
  min-width: 68px;
}
#screen-home .lh-themes .tab .ic,
#screen-home .lh-themes .tab .ic-img {
  width: 44px;
  height: 44px;
}
#screen-home .art-grid.pic-grid {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 16px;
  padding: 6px 18px 24px;
  margin: 0;
  scrollbar-width: none;
}
#screen-home .pic-grid::-webkit-scrollbar { display: none; }
@media (min-width: 560px) {
  #screen-home .art-grid.pic-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
#screen-home .pic-grid .art-card {
  padding: 6px;
  border: 4px solid var(--lh-line);
  border-radius: 30px;
  background: #fff;
  box-shadow: 0 6px 0 var(--lh-line);
  transition: transform 0.12s;
}
#screen-home .pic-grid .art-card::before { display: none; }
#screen-home .pic-grid .art-card:active {
  transform: translateY(4px) scale(0.97);
  box-shadow: 0 2px 0 var(--lh-line);
}
#screen-home .pic-grid .art-card.done { background: #fff6d6; }
#screen-home .pic-grid .art-thumb {
  border: 0;
  border-radius: 24px;
  aspect-ratio: 1 / 1;
}
#screen-home .pic-grid .art-badge {
  top: auto;
  left: auto;
  bottom: 8px;
  right: 8px;
  padding: 3px 9px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--lh-shadow-sm);
  font-size: 14px;
  color: var(--ink);
}
#screen-home .pic-grid .mini-stars .ic,
#screen-home .pic-grid .mini-stars .ic-img { width: 20px; height: 20px; }
#screen-home .pic-grid .art-card.picked { animation: picPick 0.35s ease; }
@keyframes picPick {
  40% { transform: scale(1.08) rotate(-3deg); }
  100% { transform: none; }
}
#screen-home .pic-grid.grid-in .art-card { animation: gridIn 0.36s cubic-bezier(0.2, 0.9, 0.3, 1.3) backwards; }
#screen-home .pic-grid.grid-in .art-card:nth-child(2) { animation-delay: 0.04s; }
#screen-home .pic-grid.grid-in .art-card:nth-child(3) { animation-delay: 0.08s; }
#screen-home .pic-grid.grid-in .art-card:nth-child(4) { animation-delay: 0.12s; }
#screen-home .pic-grid.grid-in .art-card:nth-child(n+5) { animation-delay: 0.16s; }
@keyframes gridIn {
  from { transform: scale(0.6); opacity: 0; }
}
#screen-home.active .pic-grid { animation: lhRise 0.42s cubic-bezier(0.2, 0.9, 0.3, 1.2) 0.08s both; }

/* ---- Pip's moves (home, chooser, finish card) ---- */
.pip-hop { animation: pipHop 0.6s cubic-bezier(0.3, 1.6, 0.5, 1) !important; }
.pip-jump { animation: pipJump 0.8s cubic-bezier(0.3, 1.4, 0.5, 1) !important; }
.pip-spin { animation: pipSpin 0.8s ease-in-out !important; }
.pip-wiggle { animation: pipWiggle 0.8s ease-in-out !important; }
.pip-squish { animation: pipSquish 0.7s ease !important; }
.pip-peek { animation: pipPeek 1.1s ease-in-out !important; }
.pip-dance { animation: pipDance 1.2s ease-in-out !important; }
@keyframes pipHop {
  0%, 100% { transform: none; }
  30% { transform: translateY(-26px) scaleY(1.06); }
  60% { transform: translateY(0) scale(1.1, 0.9); }
}
@keyframes pipJump {
  0%, 100% { transform: none; }
  15% { transform: scale(1.12, 0.86); }
  45% { transform: translateY(-46px) rotate(-10deg) scale(1.05); }
  75% { transform: translateY(0) scale(1.12, 0.88); }
}
@keyframes pipSpin {
  0% { transform: none; }
  50% { transform: translateY(-18px) rotateY(180deg); }
  100% { transform: rotateY(360deg); }
}
@keyframes pipWiggle {
  0%, 100% { transform: none; }
  20% { transform: rotate(-12deg); }
  40% { transform: rotate(10deg); }
  60% { transform: rotate(-8deg); }
  80% { transform: rotate(5deg); }
}
@keyframes pipSquish {
  0%, 100% { transform: none; }
  30% { transform: scale(1.18, 0.8); }
  55% { transform: scale(0.9, 1.14); }
  80% { transform: scale(1.04, 0.97); }
}
@keyframes pipPeek {
  0%, 100% { transform: none; }
  30%, 70% { transform: translateX(10px) rotate(14deg); }
}
@keyframes pipDance {
  0%, 100% { transform: none; }
  15% { transform: translateY(-12px) rotate(-10deg); }
  30% { transform: translateY(0) rotate(0); }
  45% { transform: translateY(-12px) rotate(10deg); }
  60% { transform: translateY(0) rotate(0); }
  80% { transform: translateY(-20px) scale(1.08); }
}
/* always dancing (finish card, gift) */
.pip-party { animation: pipDance 1.2s ease-in-out infinite; transform-origin: 50% 100%; }

/* stars and hearts flying out of Pip */
.pip-spark {
  position: absolute;
  left: 70px;
  top: 56px;
  width: 16px;
  height: 16px;
  pointer-events: none;
  z-index: 5;
  background: var(--c);
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  animation: sparkFly 0.95s cubic-bezier(0.2, 0.8, 0.4, 1) both;
}
.pip-spark.heart {
  clip-path: path('M8 15 C8 15 0 9.5 0 4.5 C0 2 2 0 4.4 0 C6 0 7.3 1 8 2.3 C8.7 1 10 0 11.6 0 C14 0 16 2 16 4.5 C16 9.5 8 15 8 15 Z');
}
@keyframes sparkFly {
  0% { transform: translate(0, 0) scale(0.3); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(1.2) rotate(40deg); opacity: 0; }
}

/* ---- "How do you want to paint?" chooser ---- */
.modal-card.pick-card { max-width: 420px; }
.pick-head {
  position: relative;
  display: flex;
  justify-content: center;
  margin: 4px 0 12px;
}
.pick-art {
  width: 150px;
  height: 150px;
  border-radius: 26px;
  border: 4px solid var(--lh-line);
  background: #fff;
  object-fit: cover;
}
.pick-head .pick-pip {
  position: absolute;
  left: calc(50% - 150px);
  bottom: -6px;
  width: 84px;
  height: 100px;
  object-fit: contain;
  animation: pipDance 1.4s ease-in-out infinite;
  transform-origin: 50% 100%;
}
.pick-modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.pick-mode {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 128px;
  padding: 10px 4px;
  border: 4px solid var(--lh-line);
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 6px 0 var(--lh-line);
  color: var(--ink);
  font-family: var(--display);
}
.pick-mode:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--lh-line); }
.pick-mode .mode-badge,
.pick-mode .mode-badge .ic-img { width: 64px; height: 64px; }
.pick-mode .mode-badge { background: none; box-shadow: none; }
.pick-mode b { font-size: 15px; font-weight: 600; line-height: 1.15; overflow-wrap: anywhere; }
.pick-mode.last { background: color-mix(in srgb, var(--accent) 22%, #fff); }
.pick-pct {
  position: absolute;
  top: -10px;
  right: -6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--lh-sun);
  border: 2px solid var(--lh-line);
  font-style: normal;
  font-size: 13px;
  font-weight: 700;
}
body.less-motion .pick-head .pick-pip,
body.less-motion .pip-party { animation: none; }

/* ---- Pip on the painting screen: sparkles, naps ---- */
.pal .pip-spark { left: calc(50% - 8px); top: 30%; }
.pal.pal-sleep img { animation: palSnore 2.6s ease-in-out infinite; }
.pal.pal-sleep::after {
  content: 'z z z';
  position: absolute;
  left: 62%;
  top: -8px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 2px;
  color: var(--lh-purple, #7c5cff);
  white-space: nowrap;
  animation: zzz 2.6s ease-in-out infinite;
}
@keyframes palSnore {
  0%, 100% { transform: rotate(-6deg) scale(1, 1); }
  50% { transform: rotate(-6deg) scale(1.04, 0.96); }
}
@keyframes zzz {
  0% { transform: translate(0, 6px) scale(0.7); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translate(12px, -16px) scale(1.1); opacity: 0; }
}
body.less-motion .pal.pal-sleep::after { animation: none; }

/* ---- calmer painting screen: just back, progress, undo and Done.
   Redo, Start over, the ? button and the picture title stay for Pro. ---- */
body:not(.band-teen) #btn-redo,
body:not(.band-teen) #btn-clear,
body:not(.band-teen) #btn-mode-help,
body:not(.band-teen) .studio-title {
  display: none !important;
}
/* Pip dances next to the gift you just opened */
.gift-reveal .gift-emoji { position: relative; }
.gift-reveal .gift-pip {
  position: absolute;
  left: -18px;
  bottom: -8px;
  width: 72px;
  height: 86px;
  object-fit: contain;
  z-index: 2;
}

/* long color names ("Light green") wrap to two lines inside the chip */
.legend-chip small {
  display: block;
  max-width: 100%;
  white-space: normal;
  overflow: hidden;
  text-align: center;
  line-height: 1.05;
  word-break: normal;
  overflow-wrap: break-word;
  hyphens: manual;
}
